-
Notifications
You must be signed in to change notification settings - Fork 384
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
Add support for the <picture> element, converting to <amp-img> #1316
Comments
According to the docs, the EDIT: That doesn't cover the |
So far I assume the expected output should be as follows... <picture><img></picture>
=> <amp-img><noscript><img></noscript></amp-img> 2.) <picture><source srcset /><img></picture>
=> <amp-img srcset><noscript><img></noscript></amp-img> 3.) <picture><source srcset /><source srcset /><img></picture>
=> <amp-img srcset><amp-img srcset><noscript><img></noscript></amp-img></amp-img> |
As the I initially thought about literally extending |
Is this not implicit by nesting an <amp-img alt="Mountains"
width="550"
height="368"
layout="responsive"
src="/static/inline-examples/images/mountains.webp">
<amp-img alt="Mountains"
fallback
width="550"
height="368"
layout="responsive"
src="/static/inline-examples/images/mountains.jpg"></amp-img>
</amp-img> |
Per conversation on #3082 (comment) there's not likely going to be short-term support for a |
This came up again: https://wordpress.org/support/topic/webp-image-not-loading/ Since the AMP plugin doesn't support converting This should only be done if the underlying |
With |
The
AMP_Img_Sanitizer
needs to be extended to add support for the<picture>
element. For example, on https://fivethirtyeight.com/features/the-eternal-question-how-much-do-these-apricots-weigh/ there is:I'm not sure in this case why there are multiple
source
elements that have the same URL. But normally atype
would be defined on thesource
so that the user agent can skip asource
that is not supported. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pictureThis should be converted into the appropriate
amp-img
. Note thatamp-img
allows for fallbacks to be defined as children. So that is howamp-img
can be used to implement multiplesource
s: https://www.ampproject.org/docs/reference/components/amp-img#example:-specifying-a-fallback-imageThe
picture
element allows for animg
to be nested inside of it as a fallback, so it's not critical that the plugin recognize apicture
to work.The text was updated successfully, but these errors were encountered: