Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Commit

Permalink
Bug 1675553 [wpt PR 26419] - Layout shift detection for fixed positio…
Browse files Browse the repository at this point in the history
…n, a=testonly

Automatic update from web-platform-tests
Layout shift detection for fixed position

With paint properties geometry mapping, we can already correctly detect
layout shift of fixed-position elements because the viewport scroll
offset doesn't exist in the paint property chain of fixed-position
elements.

Also removed the unnecessary layout viewport clip because it's already
applied in LocalToAncestorClipRect to the LayoutView property tree
state.

Change-Id: I0d77bb4fc828b495536b03f8674d8cab35d0f8bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2520330
Reviewed-by: Steve Kobes <skobes@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824480}

--

wpt-commits: 3a36f4adb22464404bf9a48b5a4d4d4a9210ee03
wpt-pr: 26419
  • Loading branch information
wangxianzhu authored and moz-wptsync-bot committed Nov 7, 2020
1 parent da040fe commit ff2ce4b
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<title>Layout Instability: movement of fixed position</title>
<link rel="help" href="https://wicg.github.io/layout-instability/" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/util.js"></script>
<div id="target" style="position: fixed; top: 100px; width: 300px; height: 200px; background: yellow">
</div>
<script>
promise_test(async () => {
const watcher = new ScoreWatcher;

// Wait for the initial render to complete.
await waitForAnimationFrames(2);

// Modify the position of the div.
target.style.top = '200px';

const expectedScore = computeExpectedScore(300 * (200 + 100), 100);

// Observer fires after the frame is painted.
assert_equals(watcher.score, 0);
await watcher.promise;
assert_equals(watcher.score, expectedScore);
}, 'Movement of fixed position');

</script>

0 comments on commit ff2ce4b

Please sign in to comment.