Skip to content

Commit 0385164

Browse files
committed
[css-position-4] No need for an explicit doc argument, element nodes always have an associated document. Fixes #8849
1 parent 9b8ce4e commit 0385164

File tree

1 file changed

+20
-27
lines changed

1 file changed

+20
-27
lines changed

css-position-4/Overview.bs

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -468,13 +468,8 @@ Top Layer Manipulation {#top-manip}
468468

469469
<div algorithm>
470470
An element |el| is <dfn export>in the top layer</dfn>
471-
of an optional {{Document}} |doc|
472-
if |el| is [=list/contained=] in |doc|'s [=Document/top layer=]
473-
but <em>not</em> [=list/contained=] in |doc|'s [=pending top layer removals=].
474-
475-
If |doc| is not passed,
476-
it's [=in the top layer=]
477-
if it would be so for <em>any</em> {{Document}}.
471+
if |el| is [=list/contained=] in its [=Node/node document's=] [=Document/top layer=]
472+
but <em>not</em> [=list/contained=] in its [=Node/node document's=] [=pending top layer removals=].
478473

479474
Note: Specs should use this concept,
480475
rather than [=rendered in the top layer=],
@@ -487,14 +482,9 @@ Top Layer Manipulation {#top-manip}
487482

488483
<div algorithm>
489484
An element |el| is <dfn export lt="render in the top layer">rendered in the top layer</dfn>
490-
of an optional {{Document}} |doc|
491-
if |el| is [=list/contained=] in |doc|'s [=Document/top layer=],
485+
if |el| is [=list/contained=] in its [=Node/node document's=] [=Document/top layer=],
492486
and |el| has ''overlay: auto''.
493487

494-
If |doc| is not passed,
495-
it's [=rendered in the top layer=]
496-
if it would be so for <em>any</em> {{Document}}.
497-
498488
Note: Specs should use this concept,
499489
rather than [=in the top layer=],
500490
when they are not manipulating the top layer itself,
@@ -507,45 +497,48 @@ Top Layer Manipulation {#top-manip}
507497

508498
<div algorithm>
509499
To <dfn export lt="add an element to the top layer | add to the top layer">add an element to the top layer</dfn>,
510-
given a {{Document}} |doc|
511-
and an {{Element}} |el|:
500+
given an {{Element}} |el|:
501+
502+
1. Let |doc| be |el|'s [=Node/node document=].
512503

513-
1. If |el| is already [=list/contained=] in |doc|'s [=Document/top layer=]:
504+
2. If |el| is already [=list/contained=] in |doc|'s [=Document/top layer=]:
514505
* Assert: |el| is also in |doc|'s [=pending top layer removals=].
515506
(Otherwise, this is a spec error.)
516507
* [=set/Remove=] |el| from both |doc|'s [=Document/top layer=]
517508
and [=pending top layer removals=].
518509

519-
2. [=set/Append=] |el| to |doc|'s [=Document/top layer=].
510+
3. [=set/Append=] |el| to |doc|'s [=Document/top layer=].
520511

521-
3. At the UA !important [=cascade origin=],
512+
4. At the UA !important [=cascade origin=],
522513
add a rule targeting |el|
523514
containing an ''overlay: auto'' declaration.
524515
</div>
525516

526517
<div algorithm>
527518
To <dfn export lt="request an element to be removed from the top layer | request removal from the top layer">request an element to be removed from the top layer</dfn>,
528-
given a {{Document}} |doc|
529-
and an {{Element}} |el|:
519+
given an {{Element}} |el|:
530520

531-
1. If |el| is not [=list/contained=] |doc|'s [=Document/top layer=],
521+
1. Let |doc| be |el|'s [=Node/node document=].
522+
523+
2. If |el| is not [=list/contained=] |doc|'s [=Document/top layer=],
532524
or |el| <em>is</em> already [=list/contained=]
533525
in |doc|'s [=pending top layer removals=],
534526
return.
535527

536-
2. Remove the UA !important ''overlay: auto'' rule targeting |el|.
528+
3. Remove the UA !important ''overlay: auto'' rule targeting |el|.
537529

538-
3. [=set/Append=] |el| to |doc|'s [=pending top layer removals=].
530+
4. [=set/Append=] |el| to |doc|'s [=pending top layer removals=].
539531
</div>
540532

541533
<div algorithm>
542534
To <dfn export lt="remove an element from the top layer immediately | remove from the top layer immediately">remove an element from the top layer immediately</dfn>,
543-
given a {{Document}} |doc|
544-
and an {{Element}} |el|:
535+
given an {{Element}} |el|:
536+
537+
1. Let |doc| be |el|'s [=Node/node document=].
545538

546-
1. [=set/Remove=] |el| from |doc|'s [=Document/top layer=] and [=pending top layer removals=].
539+
2. [=set/Remove=] |el| from |doc|'s [=Document/top layer=] and [=pending top layer removals=].
547540

548-
2. Remove the UA !important ''overlay: auto'' rule targeting |el|,
541+
3. Remove the UA !important ''overlay: auto'' rule targeting |el|,
549542
if it exists.
550543

551544
Note: This algorithm is only intended to be used in special cases

0 commit comments

Comments
 (0)