Bug 1818096 [wpt PR 38625] - [view-timeline]: Avoid reparse of keyframe rules contain...
commit3a153dcb62aec67644612affd933391968a37c57
authorKevin Ellis <kevers@google.com>
Mon, 6 Mar 2023 14:00:55 +0000 (6 14:00 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Tue, 7 Mar 2023 00:24:34 +0000 (7 00:24 +0000)
tree98d5b96c5cde7da76b06ebfabfd66a9c20d8352f
parent3c2e448d1a5f10ba5717d8f45f9a71b22eb25fac
Bug 1818096 [wpt PR 38625] - [view-timeline]: Avoid reparse of keyframe rules containing timeline offsets, a=testonly

Automatic update from web-platform-tests
[view-timeline]: Avoid reparse of keyframe rules containing timeline offsets

A full reparse of the keyframes is wasteful, when we just need to
re-sort. Previously, we had a bug where the effect invalidation caused
the composited animation to lag.  This is because validateSnapshot
could trigger a second pass of layout update, but updateSnapshot could
not. We now avoid this problem entirely. Instead, we track if any
keyframe offsets are affected and simply clear the keyframe effect
cache if needed.

Injecting the neutral keyframes when processing the keyframe rules is
wasteful since already handled for property specific keyframes.
Removal of the neutral keyframes required updating getKeyframes to
return the expected results.  Overall, the process seems cleaner now.

Added tests for keyframe retrieval as well as for interpolation at the keyframe boundaries.

Bug: 1408475
Change-Id: I18fc726c6f42e414760eb52dd8478c6930690238
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4261369
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1112198}

--

wpt-commits: c6b7fa7682f4ff3c5aa928443516473523234352
wpt-pr: 38625
testing/web-platform/tests/css/css-animations/KeyframeEffect-getKeyframes.tentative.html
testing/web-platform/tests/scroll-animations/css/timeline-offset-in-keyframe-change-timeline.tentative.html [new file with mode: 0644]
testing/web-platform/tests/scroll-animations/css/timeline-offset-keyframes-hidden-subject.html [new file with mode: 0644]
testing/web-platform/tests/scroll-animations/css/timeline-offset-keyframes-with-document-timeline.html [new file with mode: 0644]
testing/web-platform/tests/scroll-animations/css/timeline-range-name-offset-in-keyframes.tentative.html
testing/web-platform/tests/scroll-animations/css/view-timeline-keyframe-boundary-interpolation.html [new file with mode: 0644]
testing/web-platform/tests/web-animations/resources/keyframe-utils.js