v135 ยท css
CSS anchor positioning remembered scroll offset
Add support for the concept of "remembered scroll offset" - see https://drafts.csswg.org/css-anchor-position-1/#scroll When a positioned element has a default anchor, and is tethered to this anchor at one edge, and against the original containing block at the other edge, the scroll offset will be taken into account when it comes to sizing the element. Thi
concepts
-
Remembered Scroll Offset
Single scroller demo with a toggle: compare the Chrome 135 automatic remembered-scroll-offset behaviour against a legacy JS scroll-tracking fallback.
-
Side-by-side flicker comparison
Two scroll boxes share the page. One uses anchor-positioned layout with fallback ordering; the other simulates the old per-scroll retargeting that caused visible jumps.
-
Scroll recovery lab
Live menu with a flip-up tooltip pinned via anchor positioning. Toggle the remembered offset, watch the tooltip stay anchored vs flicker, and inspect the generated CSS.
-
Anchor Tooltip Lab
An API-docs page with CSS anchor-positioned definition tooltips. Scroll the container, hover a term, and compare correct anchor tracking (Chrome 135 remembered offset) vs the JS getBoundingClientRect fallback.
-
Synced scroll replay
Hit Replay and watch two panels scroll in lockstep. The left panel simulates legacy per-frame repositioning; the right panel uses current anchor positioning and
position-try-order: most-height. Flicker events are counted and logged in real time. -
Anchor flip counter
Scroll the container and watch a live counter tally every time the popover switches sides โ above ↔ below. Toggle the Chrome 135 CSS path mid-session and see the flip rate drop. Auto-scroll runs 10 passes so you can compare counts without manual scrolling.
why it shipped
A developer should be able to use all available visible space (or a percentage of it) for an anchored element (using `position-area`), to fit as much content as desirable, rather than either using fixed sizes, or requiring that everything be scrolled to the initial scroll offsets for it to work.