Commit 8f19da69 authored by Ian Kilpatrick's avatar Ian Kilpatrick Committed by Commit Bot

[overflow] Don't consider margin-block-end as scrollable overflow.

This piece of code was originally introduced in:
https://chromium.googlesource.com/chromium/src/+/493129de0e666cb0b6fd6bf966a0993aa3d64be5

This had the effect of considering the margin-block-end of a LayoutBox
as scrollable overflow.

This wasn't in any specification.

This appears to be trying to replicate an effect from FF, however this
only occurs for FF on the root scroller, not arbitrary scrollers like
this does.

Fortunately Safari never shipped this behaviour.

Bug: 34224
Change-Id: I1a2d45f598fb44955cc39017d70b126221d57a96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2371203Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800987}
parent 395a97e8
...@@ -6321,15 +6321,6 @@ LayoutRect LayoutBox::LayoutOverflowRectForPropagation( ...@@ -6321,15 +6321,6 @@ LayoutRect LayoutBox::LayoutOverflowRectForPropagation(
LayoutObject* container) const { LayoutObject* container) const {
// Only propagate interior layout overflow if we don't clip it. // Only propagate interior layout overflow if we don't clip it.
LayoutRect rect = BorderBoxRect(); LayoutRect rect = BorderBoxRect();
// We want to include the margin, but only when it adds height. Quirky margins
// don't contribute height nor do the margins of self-collapsing blocks.
if (!StyleRef().HasMarginAfterQuirk() && !IsSelfCollapsingBlock()) {
const ComputedStyle* container_style =
container ? container->Style() : nullptr;
rect.Expand(IsHorizontalWritingMode()
? LayoutSize(LayoutUnit(), MarginAfter(container_style))
: LayoutSize(MarginAfter(container_style), LayoutUnit()));
}
if (!ShouldClipOverflow() && !ShouldApplyLayoutContainment()) if (!ShouldClipOverflow() && !ShouldApplyLayoutContainment())
rect.Unite(LayoutOverflowRect()); rect.Unite(LayoutOverflowRect());
......
<!DOCTYPE HTML> <!DOCTYPE HTML>
<html> <html>
<body> <body>
<p> Bug 270473: When you scroll down there should be 50px of space provided by the margin after the yellow box.</p> <p>When you scroll down there should be <b>no</b> space provided by the margin after the yellow box.</p>
<div style="background-color: green; height: 100px; width: 100px;"> <div style="background-color: green; height: 100px; width: 100px;">
<div style="background-color: yellow; border: 1px solid red; width: 100px; height: 1050px; margin-top: 50px;"> <div style="background-color: yellow; border: 1px solid red; width: 100px; height: 1000px; margin-top: 50px;"></div>
</div> </div>
</div>
</body> </body>
</html> </html>
<!DOCTYPE HTML> <!DOCTYPE HTML>
<html> <html>
<body> <body>
<p> Bug 270473: When you scroll down there should be 50px of space provided by the margin after the yellow box.</p> <p>When you scroll down there should be <b>no</b> space provided by the margin after the yellow box.</p>
<div style="background-color: green; height: 100px; width: 100px;"> <div style="background-color: green; height: 100px; width: 100px;">
<div style="background-color: yellow; border: 1px solid red; width: 100px; height: 1000px; margin-top: 50px; margin-bottom: 50px;"> <div style="background-color: yellow; border: 1px solid red; width: 100px; height: 1000px; margin-top: 50px; margin-bottom: 50px;"></div>
</div> </div>
</div>
</body> </body>
</html> </html>
<!DOCTYPE HTML> <!DOCTYPE HTML>
<html> <html>
<body> <body>
<p> Bug 270473: When you scroll down there should be 50px of space provided by the margin after the yellow box.</p> <p>When you scroll down there should be <b>no</b> space provided by the margin after the yellow box.</p>
<div style="position:absolute;width:auto;height:auto;top:0px;bottom:0px;left:0px;right:0px;min-height:200px;"> <div style="position:absolute;width:auto;height:auto;top:0px;bottom:0px;left:0px;right:0px;min-height:200px;">
<div style="background-color: yellow; border: 1px solid red; height: 1050px; margin-top: 50px;"> <div style="background-color: yellow; border: 1px solid red; height: 1000px; margin-top: 50px;"></div>
</div> </div>
</div>
</body> </body>
</html> </html>
<!DOCTYPE HTML> <!DOCTYPE HTML>
<html> <html>
<body> <body>
<p> Bug 270473: When you scroll down there should be 50px of space provided by the margin after the yellow box.</p> <p>When you scroll down there should be <b>no</b> space provided by the margin after the yellow box.</p>
<div style="position:absolute;width:auto;height:auto;top:0px;bottom:0px;left:0px;right:0px;min-height:200px;"> <div style="position:absolute;width:auto;height:auto;top:0px;bottom:0px;left:0px;right:0px;min-height:200px;">
<div style="background-color: yellow; border: 1px solid red; height: 1000px; margin-top: 50px; margin-bottom: 50px;"> <div style="background-color: yellow; border: 1px solid red; height: 1000px; margin-top: 50px; margin-bottom: 50px;"></div>
</div> </div>
</div>
</body> </body>
</html> </html>
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