[amp-iframe] iframe height is being miscalculated
Description
On https://www.google.com/amp/s/www.nytimes.com/2021/04/20/us/black-history-continued-events.amp.html the iframe height is miscalculated, causing content to be chopped off.
Additional context: https://amphtml.slack.com/archives/C9HPA6HGB/p1622575649072900
Reproduction Steps
- Go to https://www.google.com/amp/s/www.nytimes.com/2021/04/20/us/black-history-continued-events.amp.html
- Notice content is chopped off at the bottom of the iframe. See screenshot"

- Another issue is following console error:
Uncaught DOMException: Failed to set the 'domain' property on 'Document': Assignment is forbidden for sandboxed iframes.
Relevant Logs
No response
Browser(s) Affected
Chrome, Firefox
OS(s) Affected
No response
Device(s) Affected
No response
AMP Version Affected
No response
The console error only occurs on the AMP viewer due to the page trying to set document.domain, which is only allowed for same or parent domain. It does not occur when accessing the page directly.
After debugging the amp-iframe code, the updateSize_ callback receives height argument that is smaller than what is required for the iframe. I believe this is coming from the runtime. Any ideas @jridgewell?
The iframe is responsible for requesting a size, and we're just granting it. It's not our responsibility to guess the correct size of the iframe.
Thanks @jridgewell. Looks like the postMessage to resize the iframe is sending the wrong height. @callihiggins check out https://amp.dev/documentation/components/amp-iframe/#iframe-resizing and retry with a larger height?
Closing this issue since it's not on AMP.