amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

amp-iframe overflow div moved outside of <p>

Open cubeghost opened this issue 6 years ago • 2 comments

What's the issue?

When an amp-iframe is the child of a p, any div children of the iframe (including ones with the overflow property) are moved outside of both the amp-iframe and p tags. When an amp-iframe is resizable, this causes it to become invalid because it no longer has an overflow element.

How do we reproduce the issue?

Demo with the same iframe as a child of a p and standalone

https://jsbin.com/bahuxecuwu/1/edit?html,output

What browsers are affected?

All browsers, as far as I can tell

Which AMP version is affected?

Powered by AMP ⚡ HTML – Version 2011070101001

cubeghost avatar Nov 18 '20 21:11 cubeghost

This issue is WAI since a div element cannot be a (nested) child of p element since p element's content model is phrasing content. For more info, see this stackoverflow page.

I have a PR to update the amp-iframe doc to instead use a span or button in this specific case.

dmanek avatar Nov 20 '20 22:11 dmanek

@dmanek thanks, that makes sense!

cubeghost avatar Nov 22 '20 23:11 cubeghost