Skip to content

Commit

Permalink
Fix a bug tracking changes to layout shift roots.
Browse files Browse the repository at this point in the history
Previously, we were setting was_layout_shift_root_ in the constructor
for FragmentPaintPropertyTreeBuilder. This didn't work, because the
constructor is run twice: in UpdateForSelf and UpdateForChildren,
but was_layout_shift_root_ is only read in UpdateForChildren
call. Unfortunately was_layout_shift_root_ is incorrectly computed
when constructed in UpdateForChildren, because we need to compute
it *before* setting Transform and other property tree nodes that
can influence IsLayoutShiftRoot.

Instead, remove it from the constructor, save it on the context,
and only compute it at the beginning of UpdateForSelf.

Fixed: 1170878

Change-Id: I2e04cc5f5b61f5e6f5c57099421b698d953cee13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2660679
Commit-Queue: Chris Harrelson <[email protected]>
Reviewed-by: Xianzhu Wang <[email protected]>
Cr-Commit-Position: refs/heads/master@{#849159}
  • Loading branch information
chrishtr authored and chromium-wpt-export-bot committed Feb 1, 2021
1 parent a0ff025 commit 3a89363
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions layout-instability/transform-above-filter-dynamic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>Layout Instability: addition of scale transform above filter</title>
<link rel="help" href="https://wicg.github.io/layout-instability/" />
<div id=target style="width: 581px">
<div id=moved style="filter: saturate(1.1); width: 300px; height:300px; background: lightblue">
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/util.js"></script>
<script>
promise_test(async () => {
const watcher = new ScoreWatcher;
// Wait for the initial render to complete.
await waitForAnimationFrames(2);

target.style.transform = "scale(1.1)";
await waitForAnimationFrames(1);

assert_equals(watcher.score, 0);
}, 'addition of scale transform above filter');

</script>

0 comments on commit 3a89363

Please sign in to comment.