Commit 20f5e570 authored by Manuel Rego Casasnovas's avatar Manuel Rego Casasnovas Committed by Commit Bot

Revert r702352 to fix issue with visual overflow recalc

The change in r702352 was causing issues in some situations,
when an inline element has some changes that cause an overflow
that should be visible in a scroller.
Problem is that we're no longer calling
MarkSelfPaintingLayerForVisualOverflowRecalc() after r702352
and the visual overflow is never recalculated.

This revert changes the call
in NGBlockNode::CopyFragmentDataToLayoutBox() to the original one,
to SetNeedsOverflowRecalc().
Due to that change we need to disable NeedsLayoutOverflowRecalc
unit test as it's now failing.

We added a new test case to prevent a similar regression in the future.

BUG=1036644,941180
TEST=fast/overflow/visual-overflow-recalc.html

Change-Id: If205d08281ca0186559715a788b132850e3cbdd6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1992423Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Manuel Rego <rego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#729750}
parent c2e5d507
......@@ -1064,7 +1064,8 @@ TEST_F(LayoutObjectTest, FirstLineBackgroundImageChangeStyleCrash) {
UpdateAllLifecyclePhasesForTest();
}
TEST_F(LayoutObjectTest, NeedsLayoutOverflowRecalc) {
// TODO(rego): Test is failing until we can fix https://crbug.com/941180.
TEST_F(LayoutObjectTest, DISABLED_NeedsLayoutOverflowRecalc) {
if (!RuntimeEnabledFeatures::LayoutNGEnabled())
return;
......
......@@ -896,7 +896,9 @@ void NGBlockNode::CopyFragmentDataToLayoutBox(
// |ComputeOverflow()| below calls |AddVisualOverflowFromChildren()|, which
// computes visual overflow from |RootInlineBox| if |ChildrenInline()|
block->SetNeedsVisualOverflowAndPaintInvalidation();
// TODO(rego): This causes that ChildNeedsLayoutOverflowRecalc flags are not
// cleared after layout (see https://crbug.com/941180).
block->SetNeedsOverflowRecalc();
block->ComputeLayoutOverflow(intrinsic_block_size - borders.block_end -
scrollbars.block_end);
}
......
<!DOCTYPE html>
<style>
#scroller {
height: 200px;
overflow: scroll;
}
#wrapper {
margin-top: 100px;
width: 200px;
height: 200px;
background: green;
}
</style>
<p>Test passes if there is <strong>no red</strong>.</p>
<div id="scroller">
<div id="wrapper">
</div>
<!DOCTYPE html>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<style>
#scroller {
height: 200px;
overflow: scroll;
position: relative;
}
#wrapper {
margin-top: 100px;
width: 200px;
height: 200px;
overflow: hidden;
font-family: Ahem;
color: green;
}
#red {
background: red;
width: 200px;
height: 200px;
position: absolute;
top: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is <strong>no red</strong>.</p>
<div id="scroller">
<div id="wrapper">
<span id="inlineouter">
<span id="inlineinner">X</span>
</span>
</div>
<div id="red"></div>
</div>
<script>
runAfterLayoutAndPaint(function() {
inlineinner.style.fontSize = "200px";
}, true);
</script>
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