Commit 50a68a46 authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

Don't let a CompositingInputsRoot be a contain:strict element if it was dirty.

contain:strict elements are stopping points for ancestor recursion when
finding a CompositingInputsRoot, but this should only be for when
*descendants* of the contain:strict element are dirtied, not the
contain:strict element itself.

This problem exhibited in a bug in a case when the contain:strict
element was also position:sticky, causing it to fail to update sticky
position constraints as a result.

Bug: 1051455

Change-Id: If7e9f3d19ce5dc949ee9ba6ab7c0c0c2e03b2f20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2076546Reviewed-by: default avatarManuel Rego <rego@igalia.com>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745093}
parent dce697e1
......@@ -1093,7 +1093,8 @@ void PaintLayer::SetNeedsCompositingInputsUpdateInternal() {
last_ancestor = current;
current->child_needs_compositing_inputs_update_ = true;
if (Compositor() &&
current->GetLayoutObject().ShouldApplyStrictContainment())
(current != initial_layer &&
current->GetLayoutObject().ShouldApplyStrictContainment()))
break;
}
......
<!doctype html>
<title>Test that style mutation of contain:strict plus position:sticky updates sticky position</title>
<link rel="help" href="https://www.w3.org/TR/css-position-3/#sticky-pos">
<link rel="author" title="Chris Harrelson" href="mailto:chrishtr@chromium.org">
<div id="scroller" style="width: 200px; height: 200px; overflow-y: scroll;
will-change: transform;">
<div id="scrollbar" style="width: 100px; height: 100px; position: sticky; background: lightblue;
top: 5px; left: 50px; contain: strict;"></div>
<div style="width: 100px; height: 500px;"></div>
</div>
<!doctype html>
<html class="reftest-wait">
<title>Test that style mutation of contain:strict plus position:sticky updates sticky position</title>
<link rel="help" href="https://www.w3.org/TR/css-position-3/#sticky-pos">
<link rel="author" title="Chris Harrelson" href="mailto:chrishtr@chromium.org">
<link rel="match" href="position-sticky-scroll-reposition-ref.html">
<div id="scroller" style="width: 200px; height: 200px; overflow-y: scroll;
will-change: transform;">
<div id="sticky" style="width: 100px; height: 100px; position: sticky; background: lightblue;
top: 50px; left: 50px; contain: strict;"></div>
<div style="width: 100px; height: 500px;"></div>
</div>
<script src="/common/reftest-wait.js"></script>
<script>
requestAnimationFrame(() =>
requestAnimationFrame(() => {
sticky.style.top = '5px';
takeScreenshot();
}));
</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