Discontinue removing sizes attribute when converting img to amp-img #4606
Labels
Changelogged
Whether the issue/PR has been added to release notes.
Sanitizers
WS:Core
Work stream for Plugin core
Milestone
Feature description
In #4548 the validator was updated to introduce new
disable-inline-width
layout attribute. This will allow us to discontinue removing thesizes
attribute onamp-img
which the image sanitizer is currently doing:amp-wp/includes/sanitizers/class-amp-img-sanitizer.php
Lines 333 to 334 in 014bbbb
This was confirmed in ampproject/amphtml#27083 (comment).
The
sizes
attribute was removed to fix long-standing issues with images:amp-img
receives an unexpected inline style ofwidth:100vw
#1305It was removed as part of a PR to “definitively” fix the issues: #2036.
However, now that the
disable-inline-width
attribute is available to disable AMP'ssizes
behavior, we can add it automatically when convertingimg
intoamp-img
(oramp-anim
), and persist thesizes
attribute as well.This will involve re-checking the above issues for regressions!
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: