[scroll-animations] Handle changes to selector(#id) references
An @scroll-timeline rule may reference elements with selector(#id) syntax. Whenever the element represented by the selector() function changes, the "effective" CSSScrollTimeline produced by the @scroll-timeline rule changes as well. This CL solves this problem by registering IdTargetObservers for the IDs a CSSScrollTimeline depends on. The IdTargetObservers are registered when at least one Animation is attached, and unregistered when the last Animation is detached. This is similar to how the ScrollTimeline itself is registered/ unregistered with the resolved scroll source when Animations attach/detach. Marking the animation target elements for style recalc (non-animation-style-change) means we'll re-evaluate the @scroll-timeline rule against the current DOM state, and consider whether or not we need a new CSSScrollTimeline for the animation. Bug: 1074052 Change-Id: Iab0c6b8d8b57d7d63283e97355ee5d9948b831a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2356506 Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by:Kevin Ellis <kevers@chromium.org> Reviewed-by:
Fredrik Söderquist <fs@opera.com> Reviewed-by:
Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#821724}
Showing
Please register or sign in to comment