When we composite a ScrollTimeline (https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/animation/scroll_timeline_util.cc?l=17&rcl=4ccb547b7ff46b30a7a8fcc59e2ecc8f1094fef4), there are a number of pieces of information that get resolved to absolute values:
* The orientation, which relies on (a) having a LayoutBox, (b) CSS writing-mode, and (c) CSS direction.
* The start/end scroll offset, which rely on (a) having a LayoutBox, (b) CSS writing-mode, (c) current CSS length properties (e.g. <em> size etc), and (d) the size of the scroller (for anything based on percentages).
Currently we only calculate these values once, and don't recalculate them if anything changes. This means a composited ScrollTimeline-based animation can become incorrect if things change on the main-thread side. We need to add logic to invalidate the ScrollTimeline when these conditions change.
The simplest solution might just be to invalidate whenever the style of the resolved_scroll_source_ changes, but that may be overkill and we could be smarter. We may also need to invalidate for changes to <em> etc.