Skip to content

Commit 80cce94

Browse files
committed
[css-anchor-1] Check the proper trees, so references work as expected. #7916
1 parent 5cf431c commit 80cce94

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

css-anchor-1/Overview.bs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,18 +321,27 @@ might not be capable of anchoring the positioned element.
321321
2. Otherwise, return nothing.
322322
2. Otherwise, return the first element |el| in tree order
323323
that satisfies the following conditions:
324-
* |el| and |query el| have the same [=tree/root=].
324+
325325
* |el| is an [=anchor element=] with an [=anchor name=] of |name|.
326+
327+
* |el|'s [=anchor name=] and |name| are both associated with the same [=tree=] [=tree/root=].
328+
329+
Note: The [=anchor name=] is a [=tree-scoped name=],
330+
while |name| is a [=tree-scoped reference=].
331+
326332
* Either |el| is a descendant of |query el|'s [=containing block=],
327333
or |query el|'s [=containing block=] is the [=initial containing block=]
334+
328335
* If |el| has the same [=containing block=] as |query el|,
329336
|el| is not [=absolutely positioned=]
337+
330338
* If |el| has a different [=containing block=] from |query el|,
331339
the last [=containing block=] in |el|'s [=containing block chain=]
332340
before reaching |query el|'s [=containing block=]
333341
is not [=absolutely positioned=]
334342

335-
Note: There might not be any such element.
343+
If no element satisfies these conditions,
344+
return nothing.
336345

337346
Note: The general rule captured by these conditions
338347
is that |el| must be fully laid out

0 commit comments

Comments
 (0)