Sticky positioning displaces a view timeline subject by a piecewise-linear function d(s) of the scroll offset s, which StickyDisplacement models using the per-axis sticky scroll ranges added in p2. UpdateCachedCurrentTime() now removes the current displacement from the cached subject position so that it is scroll-invariant, and caches the displacement model alongside it. Timeline range boundaries are then computed by solving s - d(s) == offset for the earliest or latest scroll offset, as appropriate for each boundary, matching the earliest/latest wording in the spec. If more than one sticky ancestor affects the subject we fall back to treating the current displacement as permanent.
Differential Revision: https://phabricator.services.mozilla.com/D317569