Skip to content

Commit fe8e40d

Browse files
committed
[css-anchor-position] Rewrite the ordering conditions on 'acceptable anchor element' to be more explicit and hopefully clearer.
1 parent 904fbcd commit fe8e40d

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

css-anchor-position-1/Overview.bs

+29-12
Original file line numberDiff line numberDiff line change
@@ -392,25 +392,42 @@ in anchor positioning.
392392
per the effects of 'anchor-scope' on |positioned el|
393393
or its ancestors.
394394

395-
* Either |possible anchor| is a descendant of |positioned el|'s [=containing block=],
396-
or |positioned el|'s [=containing block=] is the [=initial containing block=].
397-
398-
* If |possible anchor| has the same [=containing block=] as |positioned el|,
399-
then either |possible anchor| is not [=absolutely positioned=],
400-
or |possible anchor| precedes |positioned el| in the tree order.
401-
402-
* If |possible anchor| has a different [=containing block=] from |positioned el|,
403-
then the last [=containing block=] in |possible anchor|'s [=containing block chain=]
404-
before reaching |positioned el|'s [=containing block=]
405-
is either not [=absolutely positioned=]
406-
or precedes |positioned el| in the tree order.
395+
* |possible anchor| is painted strictly before |positioned el|,
396+
aka one of the following is true:
397+
* |positioned el| is [=in a higher top layer=] than |possible anchor|
398+
* Both elements are [=in the same top layer=]
399+
but have different [=containing blocks=],
400+
and |positioned el|'s [=containing block=]
401+
is an ancestor of |possible anchor|'s [=containing block=]
402+
in the [=containing block chain=],
403+
aka one of the following:
404+
* |positioned el|'s [=containing block=] is the viewport,
405+
and |possible anchor|'s [=containing block=] isn't.
406+
* |positioned el|'s [=containing block=] is the [=initial containing block=],
407+
and |possible anchor|'s [=containing block=] is generated by an element,
408+
* both elements' [=containing blocks=] are generated by elements,
409+
and |positioned el|'s containing block
410+
is an ancestor in the [=flat tree=]
411+
to that of |possible anchor|'s [=containing block=].
412+
* Both elements are [=in the same top layer=]
413+
and have the same [=containing block=],
414+
and are both [=absolutely positioned=],
415+
and |possible anchor| is earlier in [=flat tree=] order
416+
than |positioned el|.
417+
* Both elements are [=in the same top layer=]
418+
and have the same [=containing block=],
419+
but |possible anchor| isn't [=absolutely positioned=].
407420

408421
* If |possible anchor| is in the [=skipped contents=] of another element,
409422
then |positioned el| is in the [=skipped contents=] of that same element.
410423

411424
Note: In other words, |positioned el| can anchor to |possible anchor|
412425
if they're both in the same skipped "leaf",
413426
but it can't anchor "across" leafs.
427+
This means skipping an element that contains both of them
428+
won't suddenly cause the |positioned el| to move to another anchor,
429+
but still prevents positioned elements <em>elsewhere</em> in the page
430+
from anchoring to the skipped element.
414431
</div>
415432

416433
<!-- Big Text: default

0 commit comments

Comments
 (0)