Skip to content

Commit 84ead27

Browse files
committed
[css-position-4] Add better 'in the top layer' and 'rendered in the top layer' definitions.
1 parent 8c0b5a8 commit 84ead27

File tree

1 file changed

+60
-6
lines changed

1 file changed

+60
-6
lines changed

css-position-4/Overview.bs

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ Introduction {#intro}
4444
This is an early delta spec over [[css-position-3]].
4545

4646

47+
<!--
48+
██████ ████████ ███ ██████ ██ ██
49+
██ ██ ██ ██ ██ ██ ██ ██ ██
50+
██ ██ ██ ██ ██ ██ ██
51+
██████ ██ ██ ██ ██ █████
52+
██ ██ █████████ ██ ██ ██
53+
██ ██ ██ ██ ██ ██ ██ ██ ██
54+
██████ ██ ██ ██ ██████ ██ ██
55+
-->
56+
4757
Painting Order and Stacking Contexts {#painting-order}
4858
====================================
4959

@@ -324,6 +334,16 @@ It is recommended that UAs use [=out-of-band outlines=],
324334
as making outlines easily visible
325335
is an important accessibility feature.
326336

337+
<!--
338+
████████ ███████ ████████
339+
██ ██ ██ ██ ██
340+
██ ██ ██ ██ ██
341+
██ ██ ██ ████████
342+
██ ██ ██ ██
343+
██ ██ ██ ██
344+
██ ███████ ██
345+
-->
346+
327347
Top Layer {#top-layer}
328348
=========
329349

@@ -336,10 +356,6 @@ as if they were siblings of the root element.
336356
[=Document/Top layer=] elements are rendered in the order they appear in the [=Document/top layer=];
337357
the last element in the [=Document/top layer=] is rendered on top of everything else.
338358

339-
An element is <dfn export>in the top layer</dfn>
340-
if it's present in its document's [=Document/top layer=],
341-
and its computed 'overlay' value is ''overlay/auto''.
342-
343359
Note: This special rendering behavior ensures
344360
that elements in the [=Document/top layer=] cannot be clipped by anything in the document,
345361
or obscured by anything except elements later in the [=Document/top layer=].
@@ -374,7 +390,7 @@ Instead, specifications should use the following algorithms.
374390
Top Layer Styling {#top-styling}
375391
-----------------
376392

377-
Every element [=in the top layer=],
393+
Every element [=rendered in the top layer=],
378394
as well as its corresponding ''::backdrop'' pseudo-element,
379395
are rendered with the following qualities:
380396

@@ -408,7 +424,7 @@ are rendered with the following qualities:
408424
The ''::backdrop'' Pseudo-Element {#backdrop}
409425
---------------------------------
410426

411-
Each element [=in the top layer=] has a <dfn selector>::backdrop</dfn> pseudo-element,
427+
Each element [=rendered in the top layer=] has a <dfn selector>::backdrop</dfn> pseudo-element,
412428
for which it is the [=originating element=].
413429

414430
When its computed 'content' value is not ''content/none'',
@@ -450,6 +466,44 @@ on how ''::backdrop'' elements are rendered.
450466
Top Layer Manipulation {#top-manip}
451467
----------------------
452468

469+
<div algorithm>
470+
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}}.
478+
479+
Note: Specs should use this concept,
480+
rather than [=rendered in the top layer=],
481+
when they are manipulating the top layer itself.
482+
Using this concept avoids the behavior being different
483+
based on whether there's an 'overlay' transition,
484+
or whether two operations happened <em>between</em> rendering updates
485+
or <em>across</em> them.
486+
</div>
487+
488+
<div algorithm>
489+
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=].
492+
493+
If |doc| is not passed,
494+
it's [=rendered in the top layer=]
495+
if it would be so for <em>any</em> {{Document}}.
496+
497+
Note: Specs should use this concept,
498+
rather than [=in the top layer=],
499+
when they are not manipulating the top layer itself,
500+
but rather responding to the rendering behavior of being "on top of everything".
501+
For example, the presence of a ''::backdrop'' pseudo
502+
relies on the element being [=rendered in the top layer=];
503+
even if the element is [=pending top layer removals|pending removal=],
504+
it has a ''::backdrop'' as long as it's being displayed on top of everything.
505+
</div>
506+
453507
<div algorithm>
454508
To <dfn export lt="add an element to the top layer | add to the top layer">add an element to the top layer</dfn>,
455509
given a {{Document}} |doc|

0 commit comments

Comments
 (0)