Commit 55de872c authored by jbroman's avatar jbroman Committed by Commit bot

Spurious scrollbars should not be drawn when overflow is applied to a frame.

It doesn't really make sense to get overflow scrollbars for an iframe (the
real scrollbars are drawn within the frame, and the frame itself cannot
overflow in any useful way).

Rather than address this in the legacy compositing code, this makes the style
system prevent this nonsensical state from ever occurring, by adjusting the
overflow property to visible for all frame elements.

This matches the existing behavior of the non-composited path here: no
scrollbars are drawn in response to the 'overflow' property on a frame.

BUG=384154
TEST=LayoutTests/scrollbars/iframe-overflow-scroll-ignored.html

Review URL: https://codereview.chromium.org/1843723002

Cr-Commit-Position: refs/heads/master@{#383855}
parent d7b5be44
<!DOCTYPE html>
<iframe srcdoc="<div style=height:1000px></div>"></iframe>
<!DOCTYPE html>
<!-- There should be a functioning vertical scrollbar, but no horizontal scrollbar. -->
<iframe style="overflow-x: scroll; overflow-y: hidden" srcdoc="<div style=height:1000px></div>"></iframe>
......@@ -349,6 +349,14 @@ void StyleAdjuster::adjustStyleForHTMLElement(ComputedStyle& style, const Comput
return;
}
if (isHTMLFrameElementBase(element)) {
// Frames cannot overflow (they are always the size we ask them to be).
// Some compositing code paths may try to draw scrollbars anyhow.
style.setOverflowX(OverflowVisible);
style.setOverflowY(OverflowVisible);
return;
}
if (isHTMLRTElement(element)) {
// Ruby text does not support float or position. This might change with evolution of the specification.
style.setPosition(StaticPosition);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment