Skip to content

Commit 36059c7

Browse files
committed
Meta: use infra for lists and sets
This also clarifies the description of top layer order somewhat. In whatwg/html#2650 HTML is adjusted to match.
1 parent 48fdc4d commit 36059c7

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

fullscreen.bs

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Boilerplate: omit feedback-header, omit conformance, omit index, omit idl-index
2424
spec:dom
2525
type:dfn; for:/; text:element
2626
type:interface; text:Document
27+
spec:infra
28+
type:dfn; for:set; text:for each
2729
</pre>
2830

2931
<pre class=anchors>
@@ -74,8 +76,8 @@ stated otherwise it is unset.
7476
and <a for="top layer">add</a> it to its <a>node document</a>'s <a>top layer</a>.
7577

7678
<p>To <dfn>unfullscreen an <var>element</var></dfn>, unset <var>element</var>'s
77-
<a>fullscreen flag</a> and <a>iframe fullscreen flag</a> (if any), and <a for="top layer">remove</a>
78-
it from its <a>node document</a>'s <a>top layer</a>.
79+
<a>fullscreen flag</a> and <a>iframe fullscreen flag</a> (if any), and <a for=set>remove</a> it from
80+
its <a>node document</a>'s <a>top layer</a>.
7981

8082
<p>To <dfn>unfullscreen a <var>document</var></dfn>,
8183
<a lt="unfullscreen an element">unfullscreen</a> all <a>elements</a>, within <var>document</var>'s
@@ -102,7 +104,7 @@ it from its <a>node document</a>'s <a>top layer</a>.
102104
that have their <a>fullscreen flag</a> set, in <a>shadow-including tree order</a>.
103105

104106
<li>
105-
<p>For each <var>node</var> in <var>nodes</var>, run these substeps:
107+
<p><a>For each</a> <var>node</var> in <var>nodes</var>, run these substeps:
106108

107109
<ol>
108110
<li><p>If <var>node</var> is its <a>node document</a>'s <a>fullscreen element</a>,
@@ -229,18 +231,18 @@ these steps:
229231
<code>TypeError</code> exception, and terminate these steps.
230232
<!-- cross-process; check is only needed on pending as it is recursive already -->
231233

232-
<li><p>Let <var>fullscreenElements</var> be an ordered set initially consisting of
234+
<li><p>Let <var>fullscreenElements</var> be an <a>ordered set</a> initially consisting of
233235
<var>pending</var>.
234236

235237
<li><p>While the first element in <var>fullscreenElements</var> is in a
236-
<a>nested browsing context</a>, prepend its <a>browsing context container</a> to
238+
<a>nested browsing context</a>, <a for=set>prepend</a> its <a>browsing context container</a> to
237239
<var>fullscreenElements</var>.
238240
<!-- cross-process -->
239241

240-
<li><p>Let <var>eventDocs</var> be an empty list.
242+
<li><p>Let <var>eventDocs</var> be a new <a>ordered set</a>.
241243

242244
<li>
243-
<p>For each <var>element</var> in <var>fullscreenElements</var>, in order, run these
245+
<p><a>For each</a> <var>element</var> in <var>fullscreenElements</var>, run these
244246
subsubsteps:
245247

246248
<ol>
@@ -252,16 +254,16 @@ these steps:
252254

253255
<p class=note>No need to notify observers when nothing has changed.
254256

255-
<li><p>Otherwise, append <var>doc</var> to <var>eventDocs</var>.
257+
<li><p>Otherwise, <a for=set>append</a> <var>doc</var> to <var>eventDocs</var>.
256258

257259
<li><p>If <var>element</var> is <var>pending</var> and <var>pending</var> is an <{iframe}>
258260
<a>element</a>, then set <var>element</var>'s <a>iframe fullscreen flag</a>.
259261

260262
<li><p><a lt="Fullscreen an element">Fullscreen <var>element</var></a> within <var>doc</var>.
261263
</ol>
262264

263-
<li><p>For each <var>doc</var> in <var>eventDocs</var>, in order, <a>fire an event</a> named
264-
<code>fullscreenchange</code> on <var>doc</var>.
265+
<li><p><a>For each</a> <var>doc</var> in <var>eventDocs</var>, <a>fire an event</a>
266+
named <code>fullscreenchange</code> on <var>doc</var>.
265267

266268
<li><p>Resolve <var>promise</var> with undefined.
267269
</ol>
@@ -309,7 +311,7 @@ could be an open <{dialog}> element.
309311
<p>To <dfn>collect documents to unfullscreen</dfn> given <var>doc</var>, run these steps:
310312

311313
<ol>
312-
<li><p>Let <var>docs</var> be an ordered set consisting of <var>doc</var>.
314+
<li><p>Let <var>docs</var> be an <a>ordered set</a> consisting of <var>doc</var>.
313315

314316
<li>
315317
<p>While true:
@@ -324,7 +326,7 @@ could be an open <{dialog}> element.
324326

325327
<li><p>If <var>container</var>'s <a>iframe fullscreen flag</a> is set, break.
326328

327-
<li><p>Append <var>container</var>'s <a>node document</a> to <var>docs</var>.
329+
<li><p><a for=set>Append</a> <var>container</var>'s <a>node document</a> to <var>docs</var>.
328330
</ol>
329331

330332
<li><p>Return <var>docs</var>.
@@ -374,23 +376,23 @@ could be an open <{dialog}> element.
374376
<code>TypeError</code> exception, and terminate these steps.
375377
<!-- cross-process -->
376378

377-
<li><p>Let <var>descendantDocs</var> be an ordered set consisting of <var>doc</var>'s
379+
<li><p>Let <var>descendantDocs</var> be an <a>ordered set</a> consisting of <var>doc</var>'s
378380
<a>descendant browsing contexts</a>' <a>active documents</a> whose <a>fullscreen element</a> is
379381
non-null, if any, in <em>reverse</em> <a>tree order</a>.
380382
<!-- cross-process -->
381383

382-
<li><p>For each <var>descendantDoc</var> in <var>descendantDocs</var>, in order,
384+
<li><p><a>For each</a> <var>descendantDoc</var> in <var>descendantDocs</var>,
383385
<a lt="unfullscreen a document">unfullscreen <var>descendantDoc</var></a>.
384386
<!-- cross-process -->
385387

386-
<li><p>For each <var>exitDoc</var> in <var>exitDocs</var>, in order,
388+
<li><p><a>For each</a> <var>exitDoc</var> in <var>exitDocs</var>,
387389
<a lt="unfullscreen an element">unfullscreen</a> <var>exitDoc</var>'s <a>fullscreen element</a>.
388390

389-
<li><p>For each <var>descendantDoc</var> in <var>descendantDocs</var>, in order,
391+
<li><p><a>For each</a> <var>descendantDoc</var> in <var>descendantDocs</var>,
390392
<a>fire an event</a> named <code>fullscreenchange</code> on <var>descendantDoc</var>.
391393
<!-- cross-process -->
392394

393-
<li><p>For each <var>exitDoc</var> in <var>exitDocs</var>, in order, <a>fire an event</a> named
395+
<li><p><a>For each</a> <var>exitDoc</var> in <var>exitDocs</var>, <a>fire an event</a> named
394396
<code>fullscreenchange</code> on <var>exitDoc</var>.
395397
<!-- cross-process -->
396398

@@ -455,8 +457,8 @@ associated viewport and therefore also one <a>top layer</a>. [[!CSS]]
455457
<p class=note>The terminology used in this and following subsection attempts to match CSS 2.1
456458
Appendix E.
457459

458-
<p>The <a>top layer</a> consists of an ordered set of elements, rendered in the order they have been
459-
added to the set. The last element added is rendered closest to the user.
460+
<p>The <a>top layer</a> is an <a>ordered set</a> of elements, rendered in the order they appear in
461+
the set. The last element in the set is rendered last, and thus appears on top.
460462

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

@@ -496,11 +498,12 @@ following characteristics:
496498
<code>right</code>, and <code>top</code> is zero.
497499
</ul>
498500

499-
<p>To <dfn export for="top layer">add</dfn> an <var>element</var> to a <var>top layer</var>, add, or
500-
move if already present, <var>element</var> on top of <var>top layer</var>.
501+
<p>To <dfn export for="top layer">add</dfn> an <var>element</var> to a <var>top layer</var>,
502+
<a for=set>remove</a> it from <var>top layer</var> and then <a for=set>append</a> it to
503+
<var>top layer</var>.
501504

502-
<p>To <dfn export for="top layer">remove</dfn> an <var>element</var> from a <var>top layer</var>,
503-
remove <var>element</var> from <var>top layer</var>.
505+
<p class=note>In other words, <var>element</var> is moved to the end of <var>top layer</var> if it
506+
is already present.
504507

505508

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

0 commit comments

Comments
 (0)