Skip to content

Commit 7f2cacd

Browse files
committed
[css-anchor-position] anchor() and anchor-size() resolve at *computed* time, using interleaving
1 parent e3333b0 commit 7f2cacd

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

css-anchor-position-1/Overview.bs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -775,16 +775,9 @@ The ''anchor()'' function has three arguments:
775775
specifying what the function should resolve to
776776
if it's an [=invalid anchor function=].
777777

778-
Issue: Computed value for anchor()
779-
probably needs to be the anchor() function,
780-
but with the target anchor element resolved.
781-
This allows for transitions to work properly
782-
with tree-scoped names,
783-
and with changing anchor elements.
784-
See <a href="https://github.com/w3c/csswg-drafts/issues/8180">Issue 8180</a>.
785-
786778
An ''anchor()'' function representing a [=valid anchor function=]
787-
resolves at [=used value=] time
779+
resolves at [=computed value=] time
780+
(using [=style & layout interleaving=])
788781
to the <<length>> that would align the edge
789782
of the positioned elements' [=inset-modified containing block=]
790783
corresponding to the property the function appears in
@@ -795,6 +788,14 @@ and the positioned element's [=containing block=]
795788
are scrolled to their initial scroll position
796789
(but see [[#scroll]]).
797790

791+
Note: This means that [=transitions=] or [=animations=]
792+
of a property using an [=anchor function=]
793+
will work "as expected" for all sorts of possible changes:
794+
the anchor element moving,
795+
anchor elements being added or removed from the document,
796+
the 'anchor-name' property being changed on anchors,
797+
etc.
798+
798799
If the [=target anchor element=] is [=fragmented=],
799800
the axis-aligned bounding rectangle
800801
of the fragments' border boxes is used instead.
@@ -1058,7 +1059,9 @@ or the [=writing mode=] of the element's [=containing block=]
10581059
(for ''anchor-size()/block'' and ''anchor-size()/inline'').
10591060

10601061
An ''anchor-size()'' function representing a [=valid anchor-size function=]
1061-
resolves to the <<length>> separating the relevant border edges
1062+
resolves at [=computed value=] time
1063+
(via [=style & layout interleaving=])
1064+
to the <<length>> separating the relevant border edges
10621065
(either left and right, or top and bottom,
10631066
whichever is in the specified axis)
10641067
of the [=target anchor element=].

0 commit comments

Comments
 (0)