[anchor] Better handling of OOF sizing on first layout.
If position-area is used, an OOF may be tethered to both the IMCB
(inset-modified containing block) and the default anchor. For instance,
position-area:top will get its top inset from the containing block and
the bottom offset from its default anchor. When scrolling, the default
anchor will appear to move up or down (or sideways), so that there will
be less space available on one side, and more space available on the
other side, of the default anchor. Elements tethered to the default
anchor AND the containing block can now grow or shrink their IMCB
accordingly, based on this.
The scroll offset for this use will only be snapshotted at an "anchor
recalculation point" - i.e. when an element is laid out for the first
time, or when it changes its position fallback style.
For now we only consider first-layout as an "anchor recalculation
point". Will deal with changing position fallback styles later.
This behavior change is behind the CSSAnchorPositionAreaVisualPosition
runtime flag.
Bug: 373874012
Change-Id: I11f0d25421be6ad6b4612501940696f4c806867d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6048895
Reviewed-by: Rune Lillesveen futhark@chromium.org
Commit-Queue: Morten Stenshorne mstensho@chromium.org
Cr-Commit-Position: refs/heads/main@{#1389310}