Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove top layer definitions, now that CSS Position 4 contains them. #223

Merged
merged 15 commits into from May 23, 2023
Merged
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
124 changes: 23 additions & 101 deletions fullscreen.bs
Expand Up @@ -16,6 +16,7 @@ spec:dom
spec:infra
type:dfn; for:set; text:for each
type:dfn; text:string
spec:css-position-4; type:selector; text: ::backdrop
</pre>

<pre class=anchors>
Expand Down Expand Up @@ -56,7 +57,7 @@ stated otherwise it is unset.

<p>All <a for=/>documents</a> have an associated <dfn export>fullscreen element</dfn>. The
<a>fullscreen element</a> is the topmost <a>element</a> in the <a for=/>document</a>'s
<a>top layer</a> whose <a>fullscreen flag</a> is set, if any, and null otherwise.
<a for=Document>top layer</a> whose <a>fullscreen flag</a> is set, if any, and null otherwise.

<p>All <a for=/>documents</a> have an associated <dfn>list of pending fullscreen events</dfn>, which
is an <a>ordered set</a> of (<a>string</a>, <a>element</a>) <a>tuples</a>. It is initially empty.
Expand All @@ -68,17 +69,18 @@ is an <a>ordered set</a> of (<a>string</a>, <a>element</a>) <a>tuples</a>. It is

<li><p>Set <var>element</var>'s <a>fullscreen flag</a>.

<li><p><a for="top layer">Add</a> <var>element</var> to <var>element</var>'s <a>node document</a>'s
<a>top layer</a>.
<li><p><a>Request removal from the top layer</a> given |element|'s <a>node document</a> and |element|.
foolip marked this conversation as resolved.
Show resolved Hide resolved

<li><a>Add to the top layer</a> given |element|'s <a>node document</a> and |element|.
foolip marked this conversation as resolved.
Show resolved Hide resolved
</ol>

<p>To <dfn>unfullscreen an <var>element</var></dfn>, unset <var>element</var>'s
<a>fullscreen flag</a> and <a>iframe fullscreen flag</a> (if any), and <a for=set>remove</a> it from
its <a>node document</a>'s <a>top layer</a>.
<a>fullscreen flag</a> and <a>iframe fullscreen flag</a> (if any), and
<a>remove from the top layer immediately</a> given |element|'s <a>node document</a> and |element|.
foolip marked this conversation as resolved.
Show resolved Hide resolved

<p>To <dfn>unfullscreen a <var>document</var></dfn>,
<a lt="unfullscreen an element">unfullscreen</a> all <a>elements</a>, within <var>document</var>'s
<a>top layer</a>, whose <a>fullscreen flag</a> is set.
<a for=Document>top layer</a>, whose <a>fullscreen flag</a> is set.

<hr>

Expand All @@ -89,7 +91,7 @@ its <a>node document</a>'s <a>top layer</a>.
<li><p>If <var>document</var>'s <a>fullscreen element</a> is null, terminate these steps.

<li><p><a lt="unfullscreen an element">Unfullscreen elements</a> whose <a>fullscreen flag</a> is
set, within <var>document</var>'s <a>top layer</a>, except for <var>document</var>'s
set, within <var>document</var>'s <a for=Document>top layer</a>, except for <var>document</var>'s
<a>fullscreen element</a>.

<li><p><a>Exit fullscreen</a> <var>document</var>.
Expand Down Expand Up @@ -117,10 +119,10 @@ these steps:
<li><p>Otherwise, <a lt="unfullscreen an element">unfullscreen <var>node</var></a>.

<li>
<p>If <var>document</var>'s <a>top layer</a> <a for=set>contains</a> <var>node</var>,
<a for=set>remove</a> <var>node</var> from <var>document</var>'s <a>top layer</a>.
<p>If <var>document</var>'s <a for=Document>top layer</a> <a for=set>contains</a> <var>node</var>,
<a>remove from the top layer immediately</a> given <var>document</var> and <var>node</var>.
foolip marked this conversation as resolved.
Show resolved Hide resolved

<p class=note>Other specifications can add and remove elements from <a>top layer</a>, so
<p class=note>Other specifications can add and remove elements from <a for=Document>top layer</a>, so
<var>node</var> might not be <var>document</var>'s <a>fullscreen element</a>. For example,
<var>node</var> could be an open <{dialog}> element.
</ol>
Expand Down Expand Up @@ -415,9 +417,9 @@ getter steps are:
</div>

<p>A <a>document</a> is said to be a <dfn>simple fullscreen document</dfn> if there is exactly one
<a>element</a> in its <a>top layer</a> that has its <a>fullscreen flag</a> set.
<a>element</a> in its <a for=Document>top layer</a> that has its <a>fullscreen flag</a> set.

<p class=note>A <a>document</a> with two <a>elements</a> in its <a>top layer</a> can be a
<p class=note>A <a>document</a> with two <a>elements</a> in its <a for=Document>top layer</a> can be a
<a>simple fullscreen document</a>. For example, in addition to the <a>fullscreen element</a> there
could be an open <{dialog}> element.

Expand Down Expand Up @@ -451,7 +453,7 @@ could be an open <{dialog}> element.

<p class=note>This is the set of documents for which the <a>fullscreen element</a> will be
<a lt="unfullscreen an element">unfullscreened</a>, but the last document in <var>docs</var> might
have more than one <a>element</a> in its <a>top layer</a> with the <a>fullscreen flag</a> set,
have more than one <a>element</a> in its <a for=Document>top layer</a> with the <a>fullscreen flag</a> set,
in which case that document will still remain in fullscreen.
</ol>
</div>
Expand Down Expand Up @@ -585,88 +587,6 @@ or call to {{Document/exitFullscreen()}} whenever the user agent deems it necess

<p>This section is to be interpreted equivalently to the Rendering section of HTML. [[!HTML]]

<p class=XXX>Long term CSS will define the <a>top layer</a> concept and its associated
<a><code>::backdrop</code></a> pseudo-element as part of CSS' stacking context model. Patching CSS
as done here is sketchy as hell.


<h3 id=new-stacking-layer>New stacking layer</h3>

<p>This specification introduces a new stacking layer to the
<a href=https://www.w3.org/TR/CSS2/zindex.html>Elaborate description of Stacking Contexts</a> of CSS
2.1. It is called the <dfn export>top layer</dfn>, comes after step 10 in the painting order, and is
therefore rendered closest to the user within a viewport. Each <a for=/>document</a> has one
associated viewport and therefore also one <a>top layer</a>. [[!CSS]]

<p class=note>The terminology used in this and following subsection attempts to match CSS 2.1
Appendix E.

<p>The <a>top layer</a> is an <a>ordered set</a> of elements, rendered in the order they appear in
the set. The last element in the set is rendered last, and thus appears on top.

<p class=note>The <code>z-index</code> property has no effect in the <a>top layer</a>.

<p>Each element and <a><code>::backdrop</code></a> pseudo-element in a <a>top layer</a> has the
following characteristics:

<ul>
<li><p>It generates a new stacking context.

<li><p>Its parent stacking context is the root stacking context.

<li><p>If it consists of multiple layout boxes, the first box is used.
<!-- https://www.w3.org/Bugs/Public/show_bug.cgi?id=24523 -->

<li>
<p>It is rendered as an atomic unit as if it were a sibling of its <a for=tree>root</a>.

<p class=note><a for=tree>Ancestor</a> elements with overflow, opacity, masks, etc. cannot affect
it.

<li><p>If its <code>position</code> property computes to <code>fixed</code>, its containing block
is the viewport, and the initial containing block otherwise.

<li><p>If it is an element, it and its <a><code>::backdrop</code></a> pseudo-element are not
rendered if its <a>shadow-including inclusive ancestor</a> has the <code>display</code> property
set to <code>none</code>.

<li><p>If its specified <code>display</code> property is <code>contents</code>, it computes to
<code>block</code>.

<li><p>If its specified <code>position</code> property is not <code>absolute</code> or
<code>fixed</code>, it computes to <code>absolute</code>.

<li><p>Its outline, if any, is to be rendered before step 10 in the painting order.

<li><p>Unless overridden by another specification, its static position for <code>left</code>,
<code>right</code>, and <code>top</code> is zero.
</ul>

<p>To <dfn export for="top layer">add</dfn> an <var>element</var> to a <var>top layer</var>,
<a for=set>remove</a> it from <var>top layer</var> and then <a for=set>append</a> it to
<var>top layer</var>.

<p class=note>In other words, <var>element</var> is moved to the end of <var>top layer</var> if it
is already present.


<h3 id=::backdrop-pseudo-element><code>::backdrop</code> pseudo-element</h3>

<p>Each element in a <a>top layer</a> has a
<dfn id=css-pe-backdrop selector><code>::backdrop</code></dfn> pseudo-element. This pseudo-element
is a box rendered immediately below the element (and above the element before the element in the
set, if any), within the same <a>top layer</a>.

<p class=note>The <a><code>::backdrop</code></a> pseudo-element can be used to create a backdrop
that hides the underlying document for an element in a <a>top layer</a> (such as an element that is
displayed fullscreen).

<p>It does not inherit from any element and is not inherited from. No restrictions are made on what
properties apply to this pseudo-element either.

<!-- That this is not in a more normative prose is because CSS should have hooks for this stuff
which make it normative. -->


<h3 id=:fullscreen-pseudo-class><code>:fullscreen</code> pseudo-class</h3>

Expand Down Expand Up @@ -711,11 +631,6 @@ iframe:fullscreen {
padding:0 !important;
}

::backdrop {
position:fixed;
inset:0;
}

*|*:not(:root):fullscreen::backdrop {
background:black;
}
Expand Down Expand Up @@ -760,6 +675,13 @@ delivered with the <a>document</a> through which it is nested.
<p>This prevents e.g. content from third parties to go fullscreen without explicit permission.


<h2 id=old-links class=no-num oldids="new-stacking-layer, top-layer, top-layer-add, ::backdrop-pseudo-element, css-pe-backdrop">
Appendix A: Previously-Hosted Definitions</h2>
foolip marked this conversation as resolved.
Show resolved Hide resolved

This specification previously hosted the definitions of <a selector>::backdrop</a>
and the concept of the document's <a for=Document>top layer</a>.



<h2 id=acknowledgments class=no-num>Acknowledgments</h2>

Expand Down Expand Up @@ -791,7 +713,7 @@ Riff Jiang,
Rune Lillesveen,
Sigbjørn Vik,
Simon Pieters,
Tab Atkins,
Tab Atkins-Bittner,
Takayoshi Kochi,
Theresa O'Connor,
triple-underscore,
Expand Down