Skip to content

Commit e05c508

Browse files
josepharharrubberyuzu
authored and
rubberyuzu
committed
Rely on CSS Positioned Layout Module for top layer
This change moves the top layer references from Fullscreen to CSS and uses the new algorithms to add and remove from the top layer. Moving the top layer concept to CSS has been discussed in these issues: * w3c/csswg-drafts#4998 * w3c/csswg-drafts#6939 * w3c/csswg-drafts#7845 * w3c/csswg-drafts#8240 Tests: web-platform-tests/wpt#39828.
1 parent b22e6e3 commit e05c508

File tree

1 file changed

+26
-20
lines changed

1 file changed

+26
-20
lines changed

source

+26-20
Original file line numberDiff line numberDiff line change
@@ -3326,10 +3326,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
33263326
define how the Fullscreen API interacts with HTML: <ref spec=FULLSCREEN></p>
33273327

33283328
<ul class="brief">
3329-
<li><dfn data-x-href="https://fullscreen.spec.whatwg.org/#top-layer">top layer</dfn> (an
3330-
<span data-x="set">ordered set</span>) and its
3331-
<dfn data-x="top-layer-add" data-x-href="https://fullscreen.spec.whatwg.org/#top-layer-add">add</dfn>
3332-
operation</li>
33333329
<li><dfn data-x-href="https://fullscreen.spec.whatwg.org/#dom-element-requestfullscreen"><code data-x="dom-element-requestFullscreen">requestFullscreen()</code></dfn></li>
33343330
<li><dfn data-x-href="https://fullscreen.spec.whatwg.org/#run-the-fullscreen-steps">run the fullscreen steps</dfn></li>
33353331
<li><dfn data-x-href="https://fullscreen.spec.whatwg.org/#fullscreen-flag">fullscreen flag</dfn></li>
@@ -3799,6 +3795,12 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
37993795
<li><dfn data-x-href="https://drafts.csswg.org/css-position/#absolute-position">absolutely-positioned</dfn></li>
38003796
<li>The <dfn data-x-href="https://drafts.csswg.org/css-position/#position-property">'position'</dfn> property and its
38013797
<dfn data-x-href="https://drafts.csswg.org/css-position/#valdef-position-static">'static'</dfn> value</li>
3798+
<li>The <dfn data-x-href="https://drafts.csswg.org/css-position-4/#document-top-layer">top layer</dfn>
3799+
(an <span data-x="set">ordered set</span>)</li>
3800+
<li><dfn data-x-href="https://drafts.csswg.org/css-position-4/#add-an-element-to-the-top-layer">add an element to the top layer</dfn></li>
3801+
<li><dfn data-x-href="https://drafts.csswg.org/css-position-4/#request-an-element-to-be-removed-from-the-top-layer">request an element to be removed from the top layer</dfn></li>
3802+
<li><dfn data-x-href="https://drafts.csswg.org/css-position-4/#remove-an-element-from-the-top-layer-immediately">remove an element from the top layer immediately</dfn></li>
3803+
<li><dfn data-x-href="https://drafts.csswg.org/css-position-4/#process-top-layer-removals">process top layer removals</dfn></li>
38023804
</ul>
38033805

38043806
<p>The following features are defined in <cite>CSS Multi-column Layout</cite>. <ref
@@ -60367,9 +60369,8 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
6036760369
</li>
6036860370

6036960371
<li><p>If <span>this</span>'s <span>node document</span>'s <span>top layer</span> does not
60370-
already <span data-x="list contains">contain</span> <span>this</span>, then <span
60371-
data-x="top-layer-add">add</span> <span>this</span> to <span>this</span>'s <span>node
60372-
document</span>'s <span>top layer</span>.</p></li>
60372+
already <span data-x="list contains">contain</span> <span>this</span>, then <span>add an element
60373+
to the top layer</span> given <span>this</span>.</p></li>
6037360374

6037460375
<li><p>Set <span>this</span>'s <span>previously focused element</span> to the
6037560376
<span>focused</span> element.</p></li>
@@ -60419,11 +60420,10 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
6041960420
<li><p>Set <var>topDocument</var>'s <span>autofocus processed flag</span> to true.</p></li>
6042060421
</ol>
6042160422

60422-
<p>If at any time a <code>dialog</code> element is <span data-x="node is removed from a
60423-
document">removed from a <code>Document</code></span>, then if that <code>dialog</code> is in that
60424-
<code>Document</code>'s <span>top layer</span>, it must be <span
60425-
data-x="list remove">removed</span> from it. Also, set the <code>dialog</code> element's
60426-
<span>is modal</span> flag to false.
60423+
<p>The <code>dialog</code> <span>HTML element removing steps</span>, given <var>removedNode</var>
60424+
and <var>oldParent</var>, are if <var>removedNode</var>'s <span>node document</span>'s <span>top
60425+
layer</span> <span data-x="list contains">contains</span> <var>removedNode</var>, then
60426+
<span>remove an element from the top layer immediately</span> given <var>removedNode</var>.</p>
6042760427

6042860428
<p>The <dfn method for="HTMLDialogElement"><code
6042960429
data-x="dom-dialog-close">close(<var>returnValue</var>)</code></dfn> method steps are:
@@ -60444,8 +60444,8 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
6044460444
<li><p>Remove <var>subject</var>'s <code data-x="attr-dialog-open">open</code>
6044560445
attribute.</p></li>
6044660446

60447-
<li><p>If the <span>is modal</span> flag of <var>subject</var> is true, then <span data-x="list
60448-
remove">remove</span> it from its <code>Document</code>'s <span>top layer</span>.</p></li>
60447+
<li><p>If the <span>is modal</span> flag of <var>subject</var> is true, then <span>request an
60448+
element to be removed from the top layer</span> given <var>subject</var>.</p></li>
6044960449

6045060450
<li><p>Let <var>wasModal</var> be the value of <var>subject</var>'s <span>is
6045160451
modal</span> flag.</p></li>
@@ -77024,9 +77024,9 @@ interface <dfn interface>VisibilityStateEntry</dfn> : <span>PerformanceEntry</sp
7702477024
tree</span> descendants can become <span>inert</span> in a similar fashion.</p>
7702577025

7702677026
<p class="note">The <code>dialog</code> element's <code
77027-
data-x="dom-dialog-showModal">showModal()</code> method causes this mechanism to trigger, by
77028-
<span data-x="top-layer-add">adding</span> the <code>dialog</code> element to its <span>node
77029-
document</span>'s <span>top layer</span>.</p>
77027+
data-x="dom-dialog-showModal">showModal()</code> method causes this mechanism to trigger, by <span
77028+
data-x="add an element to the top layer">adding</span> the <code>dialog</code> element to its
77029+
<span>node document</span>'s <span>top layer</span>.</p>
7703077030

7703177031
<h4>The <dfn data-x="attr-inert"><code>inert</code></dfn> attribute</h4>
7703277032

@@ -82562,7 +82562,7 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
8256282562
<li><p>Let <var>originallyFocusedElement</var> be <var>document</var>'s <span>focused area of the
8256382563
document</span>'s <span>DOM anchor</span>.</p></li>
8256482564

82565-
<li><p>Add <var>element</var> to <var>document</var>'s <span>top layer</span>.</p></li>
82565+
<li><p><span>Add an element to the top layer</span> given <var>element</var>.</p></li>
8256682566

8256782567
<li><p>Set <var>element</var>'s <span>popover visibility state</span> to <span
8256882568
data-x="popover-showing-state">showing</span>.</p></li>
@@ -82697,11 +82697,14 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
8269782697
data-x="event-beforetoggle">beforetoggle</code> event could have disconnected
8269882698
<var>element</var> or changed its <code data-x="attr-popover">popover</code> attribute.</p>
8269982699
</li>
82700+
82701+
<li><p><span>Request an element to be removed from the top layer</span> given
82702+
<var>element</var>.</p></li>
8270082703
</ol>
8270182704
</li>
8270282705

82703-
<li><p><span data-x="list remove">Remove</span> <var>element</var> from the <span>top
82704-
layer</span>.</p></li>
82706+
<li><p>Otherwise, <span>remove an element from the top layer immediately</span> given
82707+
<var>element</var>.</p></li>
8270582708

8270682709
<li><p>Set <var>element</var>'s <span>popover visibility state</span> to <span
8270782710
data-x="popover-hidden-state">hidden</span>.</p></li>
@@ -102444,6 +102447,9 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
102444102447
<li><p>For each <span>fully active</span> <code>Document</code> in <var>docs</var>, update the
102445102448
rendering or user interface of that <code>Document</code> and its <span>node navigable</span>
102446102449
to reflect the current state.</p></li>
102450+
102451+
<li><p>For each <span>fully active</span> <code>Document</code> <var>doc</var> in
102452+
<var>docs</var> run <span>process top layer removals</span> given <var>doc</var>.</p></li>
102447102453
</ol>
102448102454
</li>
102449102455

0 commit comments

Comments
 (0)