-
Notifications
You must be signed in to change notification settings - Fork 383
Update spec to include img in allowed-descendants for amp-mega-menu
#7652
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
Conversation
| # Skip tags specific to transformed AMP. | ||
| if 'I-AMPHTML-SIZER' == val: | ||
| continue | ||
|
|
||
| # The img tag is currently exclusively to transformed AMP, except as descendant of amp-story-player. | ||
| if 'IMG' == val and 'amp-story-player-allowed-descendants' != _list.name: | ||
| continue |
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.
Considering these two points:
- native
imgis supported by AMPHTML now. i-amphtml-sizercan be present in SSR-transformed HTML.
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-amphtml-sizercan be present in SSR-transformed HTML.
Yes, but the AMP plugin only takes non-transformed AMP as input. So our spec should be devoid of any SSR-specific elements. In the past, this included img. However, now that img is allowed in AMP instead of amp-img, it should no longer be skipped.
So yeah, keep the i-amphtml-sizer skip logic in place.
|
Plugin builds for 6fbbf16 are ready 🛎️!
ChecksumsWarning These builds are for testing purposes only and should not be used in production. |
westonruter
left a comment
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.
See #7652 (comment)
8d162af to
6a7fccb
Compare
| 'hr', | ||
| 'i', | ||
| 'image', | ||
| 'img', |
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 just tried adding an img to an amp-story-page-attachment and I get a validation error. See playground.
It looks like perhaps the AMP Story components haven't been updated to support native images?
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.
| 'hkern', | ||
| 'hr', | ||
| 'i', | ||
| 'img', |
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.
| 'hr', | ||
| 'i', | ||
| 'image', | ||
| 'img', |
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.
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.
Humm seems like it's only allowed for transformed AMP in most of the extensions. In that case, I have to add a condition to only add img to allowed extensions.
6a7fccb to
6fbbf16
Compare
| continue | ||
|
|
||
| # The img tag is currently exclusively to transformed AMP, except as descendant of amp-story-player. | ||
| if 'IMG' == val and 'amp-story-player-allowed-descendants' != _list.name: |
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.
amp-story-player-allowed-descendants was allowed to keep native img but spec adds it for transformed AMP 🤔
| allow_img_as_descendant = [ | ||
| 'amp-story-player-allowed-descendants', | ||
| 'amp-mega-menu-allowed-descendants', | ||
| ] |
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.
Currently, allowing these to keep native img.
img and i-amphtml-sizer in allowed-descendantsimg in allowed-descendants for amp-mega-menu
Summary
Previously #7615
Fixes #7029
Checklist