Skip to content

Commit 1825ba0

Browse files
committed
[css-anchor-1] Clarify that implicit anchor elements still need to have the right layout relationship to the querying element.
1 parent bdbef68 commit 1825ba0

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

css-anchor-1/Overview.bs

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,13 @@ might not be capable of anchoring the positioned element.
316316
and an optional anchor name |name|:
317317

318318
1. If |name| is not provided:
319+
319320
1. If |query el| has an [=implicit anchor element=],
321+
and that element is an [=acceptable anchor element=] for |query el|,
320322
return that element.
323+
321324
2. Otherwise, return nothing.
325+
322326
2. Otherwise, return the first element |el| in tree order
323327
that satisfies the following conditions:
324328

@@ -329,16 +333,7 @@ might not be capable of anchoring the positioned element.
329333
Note: The [=anchor name=] is a [=tree-scoped name=],
330334
while |name| is a [=tree-scoped reference=].
331335

332-
* Either |el| is a descendant of |query el|'s [=containing block=],
333-
or |query el|'s [=containing block=] is the [=initial containing block=]
334-
335-
* If |el| has the same [=containing block=] as |query el|,
336-
|el| is not [=absolutely positioned=]
337-
338-
* If |el| has a different [=containing block=] from |query el|,
339-
the last [=containing block=] in |el|'s [=containing block chain=]
340-
before reaching |query el|'s [=containing block=]
341-
is not [=absolutely positioned=]
336+
* |el| is an [=acceptable anchor element=] for |query el|.
342337

343338
If no element satisfies these conditions,
344339
return nothing.
@@ -366,6 +361,23 @@ might not be capable of anchoring the positioned element.
366361
but the details of that will depend on the API assigning them.)
367362
</div>
368363

364+
<div algorithm>
365+
An element |el| is a <dfn export>acceptable anchor element</dfn>
366+
for an [=absolutely positioned=] element |query el|
367+
if all of the following properties apply:
368+
369+
* Either |el| is a descendant of |query el|'s [=containing block=],
370+
or |query el|'s [=containing block=] is the [=initial containing block=].
371+
372+
* If |el| has the same [=containing block=] as |query el|,
373+
|el| is not [=absolutely positioned=].
374+
375+
* If |el| has a different [=containing block=] from |query el|,
376+
the last [=containing block=] in |el|'s [=containing block chain=]
377+
before reaching |query el|'s [=containing block=]
378+
is not [=absolutely positioned=].
379+
</div>
380+
369381
An element can also have an <dfn export>implicit anchor element</dfn>,
370382
used when an [=anchor function=] doesn't specify an explicit [=anchor name=].
371383

0 commit comments

Comments
 (0)