Skip to content

Commit 944f711

Browse files
committed
[css-anchor-position] anchor() and anchor-size() resolve at *computed* time, using interleaving. w3c#8181
2 parents 9f3e248 + 7f2cacd commit 944f711

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.
@@ -1175,7 +1176,9 @@ or the [=writing mode=] of the element's [=containing block=]
11751176
(for ''anchor-size()/block'' and ''anchor-size()/inline'').
11761177

11771178
An ''anchor-size()'' function representing a [=valid anchor-size function=]
1178-
resolves to the <<length>> separating the relevant border edges
1179+
resolves at [=computed value=] time
1180+
(via [=style & layout interleaving=])
1181+
to the <<length>> separating the relevant border edges
11791182
(either left and right, or top and bottom,
11801183
whichever is in the specified axis)
11811184
of the [=target anchor element=].

0 commit comments

Comments
 (0)