Skip to content

Commit ec10499

Browse files
committed
[css-anchor-position] Containment doesn't scope anchor names, but content-skipping does. But anchoring prevents content-skipping from activating. #10040
1 parent 047ab49 commit ec10499

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

css-anchor-position-1/Overview.bs

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,21 @@ Not all elements are capable of being [=anchor elements=]
148148
for a given positioned element,
149149
so a name can be reused in multiple places
150150
if the usages are scoped appropriately.
151-
If the element has either [=style containment=] or [=layout containment=],
152-
the 'anchor-name' property is [=scoped property|scoped=] [=scoped to a sub-tree|to a sub-tree=].
153-
If there are still multiple valid [=anchor elements=]
154-
with the given [=anchor name=],
155-
the last one is chosen.
151+
152+
Note: If multiple elements share an [=anchor name=]
153+
and are all visible to a given positioned element,
154+
the [=target anchor element=] will be the last one in DOM order.
155+
'anchor-scope' can be used to limit what names are visible to a given element.
156+
157+
[=Anchor names=] are <em>not</em> scoped by [=containment=] by default;
158+
even if an element has [=style containment|style=] or [=layout containment=]
159+
(or any similar sort of containment),
160+
the [=anchor names=] of its descendants are visible to elements elsewhere in the page.
161+
162+
Note: While an element is in the [=skipped contents=] of another element
163+
(due to ''content-visibility: hidden'', for instance),
164+
it's not an [=acceptable anchor element=],
165+
effectively acting as if it had no names.
156166

157167
### Implicit Anchor Elements ### {#implicit}
158168

@@ -371,6 +381,8 @@ or nothing (a missing specifier).
371381
Issue: define the term that actually means this,
372382
matching ::before/after/backdrop/etc
373383
(but not ::marker/placeholder/etc whose box is not detectable).
384+
385+
* |el| is not in the [=skipped contents=] of another element.
374386
</div>
375387

376388
<!-- Big Text: default
@@ -433,6 +445,21 @@ in ''anchor()'' and ''anchor-size()''.
433445
</pre>
434446
</div>
435447

448+
<h3 id=anchor-relevance>
449+
Anchor Relevance</h3>
450+
451+
As long as an [=anchor element=]
452+
is a [=target anchor element=]
453+
for any positioned element
454+
that is [=relevant to the user=],
455+
the [=anchor element=] is also [=relevant to the user=].
456+
457+
Note: This means that, for example,
458+
an anchor in a ''content-visibility: auto'' subtree
459+
will prevent its subtree from [=skipping its contents=]
460+
as long as the positioned element relying on it
461+
is [=relevant to the user=].
462+
436463

437464
Anchor-Based Positioning {#positioning}
438465
========================

0 commit comments

Comments
 (0)