-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't take snapshot in CSSScroll/ViewTimeline constructor
CSSScrolltimeline and CSSViewTime objects are created as part of style recalc. However, they currently takes scroll offset snapshot when constructed, which is not spec-compliant (spec says taking snapshot once per frame update before style recalc) and violates pipeline stages. Hence, this patch removes snapshot taking from the constructors. The behavior change is that if a scroll timeline is created due to a style change, it won't be activated in an immediate getComputedStyle() call, but need to wait until the next frame update. This aligns with scroll offset changes. As a result: - Many web tests add waitForNextFrame() before getComputedStyle() - A unit test is changed into web test, because snapshotting is not part of LocalFrameView::UpdateLifecyclePhases(), but current part of update animation steps. Bug: 1371217 Change-Id: Idb0397f241ae579b580c71b01889e92fb7471bde Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3935343 Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Reviewed-by: Kevin Ellis <kevers@chromium.org> Cr-Commit-Position: refs/heads/main@{#1058924}
- Loading branch information
1 parent
c62beb0
commit 1193482
Showing
10 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
scroll-animations/css/scroll-timeline-document-scroller-quirks.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!-- Quirks mode --> | ||
<title>Tests the document scroller in quirks mode</title> | ||
<link rel="help" href="https://drafts.csswg.org/scroll-animations-1/#scroll-notation"> | ||
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1180575"> | ||
<link rel="author" href="mailto:andruud@chromium.org"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/scroll-animations/scroll-timelines/testcommon.js"></script> | ||
<script src="/css/css-animations/support/testcommon.js"></script> | ||
<style> | ||
@keyframes anim { | ||
from { z-index: 100; } | ||
to { z-index: 100; } | ||
} | ||
#element { | ||
animation: anim forwards scroll(root); | ||
} | ||
</style> | ||
<div id=element></div> | ||
|
||
<script> | ||
promise_test(async () => { | ||
await waitForNextFrame(); | ||
assert_equals(getComputedStyle(element).zIndex, "100"); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters