Skip to content

Commit

Permalink
[css-anchor-position] Move/rephrase the explanatory note a little to …
Browse files Browse the repository at this point in the history
…make it more obvious.
  • Loading branch information
tabatkins committed May 23, 2024
1 parent de3cd9b commit a1e53bb
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions css-anchor-position-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,20 @@ that should match an 'anchor-name' value elsewhere on the page,
or the keyword ''implicit'',
or nothing (a missing specifier).

Note: The general rule captured by these conditions
is that an element can only be an anchor
if it's fully laid out
before the positioned element that wants to reference it
is laid out.
CSS's layout rules provide some useful guarantees about this,
depending on the anchor and positioned element's relationship
with each other and their containing blocks.
The list of conditions below
exactly rephrases the stacking context rules
into just what's relevant for this purpose,
ensuring there is no possibly circularity
in anchor positioning.

<div algorithm>
To determine the <dfn>target [=anchor element=]</dfn>
given a querying element |query el|
Expand Down Expand Up @@ -339,17 +353,6 @@ or nothing (a missing specifier).
which can affect what elements can be [=anchor elements=]
for a given lookup.

Note: The general rule captured by these conditions
is that |el| must be fully laid out
before |query el| is laid out.
CSS's rules about the layout order of stacking contexts
give us assurances about this,
and the list of conditions above
exactly rephrases the stacking context rules
into just what's relevant for this purpose,
ensuring there is no possibly circularity
in anchor positioning.

Note: An 'anchor-name' defined by styles in one [=shadow tree=]
won't be seen by [=anchor functions=] in styles in a different [=shadow tree=],
preserving encapsulation.
Expand Down

0 comments on commit a1e53bb

Please sign in to comment.