Placeholders cannot also act as fallbacks inside of amp-img tags
See original GitHub issueWhat’s the issue?
amp-img
tags with placeholders but no fallback remove the placeholder on failed load. The documentation seems to indicate that the placeholder should be used as a fallback if none exists. (Though I’m unsure if externally loaded images constitute “dynamic content” in this context.)
There appears to be no way to get this behavior without duplicating the nested elements.
How do we reproduce the issue?
See jsbin here. Note how the placeholder texts flash in while the image request is in flight. When the image request fails, the placeholder is removed. Fallback text is then visible only if that element is not also the placeholder.
If necessary, artificially slowing the network via debugging tools can make this more apparent.
What browsers are affected?
Latest Chrome (desktop and Android), Firefox (desktop), IE 11, and Edge
Which AMP version is affected?
1515614886756
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (7 by maintainers)
What we should fix here: I think it makes sense for
amp-img
to follow the same model asamp-list
and essentially do:This will be a change in behaviour, so we should be mindful of situations this may have negative effects. Possibly keep it under an experiment flag, slowing ramping it up to 100%.
/cc @ericlindley-g
What was the status of this issue? I know it’s been 3 years so a very long time. Would be very useful if this feature was included to help solve https://github.com/bbc/simorgh/issues/8811.