Commit 0e6e2b90 authored by Vladimir Levin's avatar Vladimir Levin Committed by Commit Bot

content-visibility: Ensure to propagate positioned movement layout dirty bit.

This patch ensures that we propagate the positioned movement layout dirty
bit since it affects "self layout" in the sense that it is the object
itself that could be positioned differently, not necessarily its child.

The early out right now protects us from propagating child only dirty
bits, since those updates would be blocked anyway.

R=ikilpatrick@chromium.org, chrishtr@chromium.org

Change-Id: I1ed4850317ff0248fc74a9ad09fedba2d5fa2041
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2542305Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828928}
parent b02ca1e0
......@@ -1146,11 +1146,13 @@ void LayoutObject::MarkContainerChainForLayout(bool schedule_relayout,
// Note that if the last element we processed was blocked by a display lock,
// and the reason we're propagating a change is that a subtree needed layout
// (ie self doesn't need layout), then we can return and stop the dirty bit
// propagation. Note that it's not enough to check |object|, since the
// element that is actually locked needs its child bits set properly, we
// need to go one more iteration after that.
if (!last->SelfNeedsLayout() && last->ChildLayoutBlockedByDisplayLock()) {
// (ie |last| doesn't need either self layout or positioned movement
// layout), then we can return and stop the dirty bit propagation. Note that
// it's not enough to check |object|, since the element that is actually
// locked needs its child bits set properly, we need to go one more
// iteration after that.
if (!last->SelfNeedsLayout() && !last->NeedsPositionedMovementLayout() &&
last->ChildLayoutBlockedByDisplayLock()) {
return;
}
......
<!doctype HTML>
<html>
<meta charset="utf8">
<title>CSS Content Visibility: positioned movement update moves hidden container (reference)</title>
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility">
<style>
#target {
top: 0;
left: 100px;
position: absolute;
width: 100px;
height: 100px;
background: blue;
}
</style>
<div id=target></div>
<!doctype HTML>
<html class="reftest-wait">
<meta charset="utf8">
<title>CSS Content Visibility: positioned movement update moves hidden container</title>
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility">
<link rel="match" href="content-visibility-078-ref.html">
<meta name="assert" content="when locked, position updates still apply">
<script src="/common/reftest-wait.js"></script>
<style>
.hidden { content-visibility: hidden; }
#target {
top: 0;
left: 0;
position: absolute;
width: 100px;
height: 100px;
background: blue;
}
</style>
<div id=target class=hidden>Content</div>
<script>
function runTest() {
target.style = "left: 100px;";
takeScreenshot();
}
window.onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
</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