-
Notifications
You must be signed in to change notification settings - Fork 13
Plugin Issue #864: Remove <amp-img> workaround filters. #81
Conversation
These filters were workarounds for the AMP plugin's sanitizer not producing the correct <amp-img> The sanitizer now removes the 'sizes' attribute. So remove these workarounds, as they prevent the sanitizer from working. Still, there are some areas to look at. These workarounds inferred a layout="responsive" That seems to clash with a style rule of amp-img { max-width: 100% }.
Deployed latest to https://sizesfix-ampconfdemo.pantheonsite.io/ |
@delawski I'm not sure the best way forward but I have a feeling you might. |
@westonruter @kienstra I've added a CSS fix based on |
@delawski I'm noticing Elon looks different…
In both cases the I don't know what is right. |
@westonruter @kienstra My initial implementation was flawed. This time the images should be scaled and cropped properly since I've followed the AMP by Example instruction. However, in order for this new implementation to work, a change is needed in the AMP plugin itself. Right now the |
Request For Review
Hi @westonruter,
This pull request removes the workaround filters for
<amp-img>
. As you know, they were in place because the AMP plugin's sanitizer didn't produce the correct<amp-img>
.The sanitizer now removes the
sizes
attribute in Plugin PR #937. So this removes the workarounds, as they prevented the sanitizer from working.Remaining Styling Issue
Steps to reproduce
The workaround filters seemed to be causing an inferred layout of
responsive
, because the<amp-img>
had awidth
,height
, andsizes
.But on removing the filters, the inferred layout is
fixed
, as this class suggests:i-amphtml-layout-fixed
. This can be a problem when used with this style rule in the theme:Because its inferred layout is fixed, it has these inline style values:
So it uses the
max-width: 100%;
, but ignoresheight: auto;
, in favor of the inline value ofheight: 432px
The plugin could force the
layout
to beresponsive
. But this could cause images to expand to fill their container, where they hadn't before.