Skip to content

Commit 119d25e

Browse files
committed
[css-position-4] Switch 'adding to the top layer when it's already in it' to actually be a spec error, as removals/reshuffles should be handled properly.
1 parent 8e746ab commit 119d25e

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

css-position-4/Overview.bs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,13 @@ Top Layer Manipulation {#top-manip}
455455
given a {{Document}} |doc|
456456
and an {{Element}} |el|:
457457

458+
1. If |el| is already [=list/contained=] in |doc|'s [=Document/top layer=]:
459+
* Assert: |el| is also in |doc|'s [=pending top layer removals=].
460+
(Otherwise, this is a spec error.)
461+
* [=set/Remove=] |el| from both |doc|'s [=Document/top layer=]
462+
and [=pending top layer removals=].
458463

459-
1. [=set/Remove=] |el| from |doc|'s [=Document/top layer=],
460-
then [=set/append=] |el| to |doc|'s [=Document/top layer=].
461-
462-
2. [=set/Remove=] |el| from |doc|'s [=pending top layer removals=].
464+
2. [=set/Append=] |el| to |doc|'s [=Document/top layer=].
463465

464466
3. At the UA !important [=cascade origin=],
465467
add a rule targeting |el|
@@ -512,6 +514,10 @@ Top Layer Manipulation {#top-manip}
512514
Note: This is intended to be called during the "Update Rendering" step
513515
of HTML's rendering algorithm.
514516
It is not intended to be called by other algorithms.
517+
518+
Note: The 'overlay' check can be delayed arbitrarily long
519+
by author-level transitions;
520+
see [[#overlay]] for details.
515521
</div>
516522

517523
Controlling the Top Layer: the 'overlay' property {#overlay}

0 commit comments

Comments
 (0)