commit 942666c2dacc6ef6bd4884f130e69af490c14482 parent 8207b33407420f2da03c4d31d6dde9f07367ae81 Author: David Awogbemila <awogbemila@chromium.org> Date: Fri, 19 Dec 2025 09:14:10 +0000 Bug 2006191 [wpt PR 56755] - [animation-trigger] Allow tolerance in trigger boundary calculations, a=testonly Automatic update from web-platform-tests [animation-trigger] Allow tolerance in trigger boundary calculations This cl allows a tolerance of a 64th of a pixel when checking the boundaries of a TimelineTrigger's range. Without this tolerance, the boundary calculation code might be sensitive to small round-off errors. We need to wait a few frames before checking that the animated style is reflected as the Animation::Update occurs during the Animate Lifecycle phase which is before style and layout which is when triggers are created and attached to animations. Bug: 390314945 Change-Id: I8f3387077a361db2b991e33c0718159712c09324 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7255980 Commit-Queue: David Awogbemila <awogbemila@chromium.org> Reviewed-by: Kevin Ellis <kevers@chromium.org> Reviewed-by: David Awogbemila <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1558939} -- wpt-commits: b35a13361418271fd35cdaa84700fff2ef84a77c wpt-pr: 56755 Diffstat:
| A | testing/web-platform/tests/scroll-animations/animation-trigger/timeline-trigger-source-starts-in-trigger-range.tentative.html | | | 61 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 61 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/scroll-animations/animation-trigger/timeline-trigger-source-starts-in-trigger-range.tentative.html b/testing/web-platform/tests/scroll-animations/animation-trigger/timeline-trigger-source-starts-in-trigger-range.tentative.html @@ -0,0 +1,60 @@ +<!DOCTYPE html> +<html> +<head> + <link rel="help" src="https://drafts.csswg.org/css-animations-2/#animation-trigger"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/web-animations/testcommon.js"></script> + <script src="/dom/events/scrolling/scroll_support.js"></script> + <script src="support/support.js"></script> +</head> + +<body> + <style> + @keyframes anim { + from { + width: 100px; + } + to { + width: 100px; + } + } + #scroller { + width: 400px; + height: 400px; + overflow: scroll; + } + .pad { + height: 200px; + } + + #source { + width: 50px; + height: 50px; + timeline-trigger: --trigger view() contain; + } + + #target { + width: 10px; + animation: anim 1s linear; + animation-trigger: --trigger play-forwards; + background-color: tomato; + } + </style> + <div id=target> + Target + </div> + <div id=scroller> + <div id=source>Source</div> + <div class=pad></div> + <div class=pad></div> + <div class=pad></div> + </div> + <script> + promise_test(async (test) => { + await waitForAnimationFrames(3); + assert_equals(getComputedStyle(target).width, "100px"); + }, "Already in-view source triggers animation"); + </script> + +</html> +\ No newline at end of file