-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embeds: Use native <img>
instead of <amp-img>
#10219
Embeds: Use native <img>
instead of <amp-img>
#10219
Conversation
amp-img component is going to be deprecated Check here: ampproject/amphtml#30442 The component related styles are also being removed as it's NA anymore
loading="lazy" | ||
decoding="async" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes to reasonable to me, but just want to confirm adding these attributes is the right thing. CC @swissspidy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Without these it would be invalid AMP. I explicitly mentioned these in #10213 as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just confirming, no need to thumbs down 😢 . Should, implies some wiggle room, if it needs it, maybe you that wording.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I swear this was meant to be a thumbs up
Should the following be removed as well. and references in Sanitization_Utils.php. |
Thanks for bringing this up. We still need the They are for single stories, not embeds. Single stories remain unaffected by this, as they still require |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works like a charm!
<img>
instead of <amp-img>
Context
Summary
<amp-img/>
element from the markup so the native<img/>
HTML element will be used on both AMP & Non-AMP pages.Relevant Technical Choices
amp-img
tag had some missing styles which were only given for theimg
tag (non-AMP page), and since there's no CSS processing happening on theLoose
sandboxing level, the AMP plugin wasn't adding in the styles foramp-img
.amp-img
is going to be deprecated soon, it makes sense to remove the markup entirely.To-do
User-facing changes
Testing Instructions
Loose
experimental sandboxing level. You'll have to have the AMP running onStandard
mode for this option to be visible.Web Stories
block on a post or a page. By default, if there's no AMP-invalid markup on a page, the AMP plugin will switch to higher/stricter sandboxing levels automatically, if that's the case, you can add aCustom HTML
core block with some invalid AMP content (<script></script>
will do the job).Loose/1
.This PR can be tested by following these steps:
Reviews
Does this PR have a security-related impact?
No
Does this PR change what data or activity we track or use?
No
Does this PR have a legal-related impact?
Checklist
Type: XYZ
label to the PRScreenshots
Before
After
Fixes #10213