[RootScroller] IFrame should use content box
This CL makes iframe candidates use the content box of the iframe when considering whether an iframe is "viewport filling" and eligible for promotion to root scroller. The reason iframes are special is because of how layout works for root scroller iframes. When an iframe is made the root scroller, the layout size we use to layout its content is taken from its parent frame. This is done because of the special semantics of the Android URL bar and how it affects the layout of the page [1]. We pass through the layout size in order to preserve this behavior with respect to the URL bar. Unfortunately, this means that promoting an iframe with a padding would cause the content to reflow into the parent frame's layout size (which cannot set a padding on the LayoutView) which can cause surprising results like in the linked bug. This CL restricts iframe promotion to just those iframe's whose content rect matches the viewport. General elements like scrolling <div>s may continue to be promoted with padding since they don't suffer from this issue. [1] https://developers.google.com/web/updates/2016/12/url-bar-resizing Bug: 945779 Change-Id: I5074f43832a2faa5b268ab99ef5bd861bdff21dc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1545506 Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by:Chris Harrelson <chrishtr@chromium.org> Cr-Commit-Position: refs/heads/master@{#646375}
Showing
Please register or sign in to comment