Skip to content

Commit a5eb357

Browse files
committed
[css-anchor-1] Define how top layer and anchors interact.
1 parent 448f9a6 commit a5eb357

File tree

1 file changed

+47
-10
lines changed

1 file changed

+47
-10
lines changed

css-anchor-1/Overview.bs

+47-10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,24 @@ spec:css-position-3;
2020
type:property; text:inset-inline-start
2121
</pre>
2222

23+
<style>
24+
/* Put nice boxes around each algorithm. */
25+
[data-algorithm]:not(.heading) {
26+
padding: .5em;
27+
border: thin solid #ddd; border-radius: .5em;
28+
margin: .5em calc(-0.5em - 1px);
29+
}
30+
[data-algorithm]:not(.heading) > :first-child {
31+
margin-top: 0;
32+
}
33+
[data-algorithm]:not(.heading) > :last-child {
34+
margin-bottom: 0;
35+
}
36+
[data-algorithm] [data-algorithm] {
37+
margin: 1em 0;
38+
}
39+
</style>
40+
2341
Introduction {#intro}
2442
=====================
2543

@@ -442,21 +460,40 @@ might not be capable of anchoring the positioned element.
442460
but the details of that will depend on the API assigning them.)
443461
</div>
444462

445-
<div algorithm>
463+
<div algorithm="acceptable anchor element">
446464
An element |el| is a <dfn export>acceptable anchor element</dfn>
447465
for an [=absolutely positioned=] element |query el|
448-
if all of the following properties apply:
466+
if any of the following are true:
467+
468+
* |query el| is in a higher [=root layer=] than |el|.
469+
470+
* |query el| and |el| are in the same [=root layer=],
471+
and all of the following are true:
472+
473+
* Either |el| is a descendant of |query el|'s [=containing block=],
474+
or |query el|'s [=containing block=] is the [=initial containing block=].
475+
476+
* If |el| has the same [=containing block=] as |query el|,
477+
|el| is not [=absolutely positioned=].
449478

450-
* Either |el| is a descendant of |query el|'s [=containing block=],
451-
or |query el|'s [=containing block=] is the [=initial containing block=].
479+
* If |el| has a different [=containing block=] from |query el|,
480+
the last [=containing block=] in |el|'s [=containing block chain=]
481+
before reaching |query el|'s [=containing block=]
482+
is not [=absolutely positioned=].
452483

453-
* If |el| has the same [=containing block=] as |query el|,
454-
|el| is not [=absolutely positioned=].
484+
For the purposes of this algorithm,
485+
an element is in a particular <dfn noexport>root layer</dfn>
486+
corresponding to the closest [=inclusive ancestor=]
487+
that is in the [=top layer=],
488+
or the document if there isn't one.
489+
[=Root layers=] are "higher" if their corresponding element
490+
is later in the [=top layer=] list;
491+
the layer corresponding to the document is lower than all other layers.
455492

456-
* If |el| has a different [=containing block=] from |query el|,
457-
the last [=containing block=] in |el|'s [=containing block chain=]
458-
before reaching |query el|'s [=containing block=]
459-
is not [=absolutely positioned=].
493+
Note: This wording around "root layer"
494+
needs to live in a stacking-context spec,
495+
after pulling the [=top layer=] stuff
496+
out of [[fullscreen]].
460497
</div>
461498

462499
An element can also have an <dfn export>implicit anchor element</dfn>,

0 commit comments

Comments
 (0)