Skip to content

Commit 7ef04e0

Browse files
authored
Meta: wrap algorithms in <div algorithm> (#174)
This is to enable the scoping/highlighting of variables, and revealed one mistaken use of "top layer" as a variable.
1 parent b1cfc66 commit 7ef04e0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

fullscreen.bs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ its <a>node document</a>'s <a>top layer</a>.
7777

7878
<hr>
7979

80+
<div algorithm>
8081
<p>To <dfn>fully exit fullscreen</dfn> a <a for=/>document</a> <var>document</var>, run these steps:
8182

8283
<ol>
@@ -88,7 +89,9 @@ its <a>node document</a>'s <a>top layer</a>.
8889

8990
<li><p><a>Exit fullscreen</a> <var>document</var>.
9091
</ol>
92+
</div>
9193

94+
<div algorithm="fullscreen removing steps">
9295
<p id=removing-steps>Whenever the <a>removing steps</a> run with a <var>removedNode</var>, run
9396
these steps:
9497

@@ -110,13 +113,14 @@ these steps:
110113

111114
<li>
112115
<p>If <var>document</var>'s <a>top layer</a> <a for=set>contains</a> <var>node</var>,
113-
<a for=set>remove</a> <var>node</var> from <var>document</var>'s <var>top layer</var>.
116+
<a for=set>remove</a> <var>node</var> from <var>document</var>'s <a>top layer</a>.
114117

115118
<p class=note>Other specifications can add and remove elements from <a>top layer</a>, so
116119
<var>node</var> might not be <var>document</var>'s <a>fullscreen element</a>. For example,
117120
<var>node</var> could be an open <{dialog}> element.
118121
</ol>
119122
</ol>
123+
</div>
120124

121125
<p>Whenever the <a>unloading document cleanup steps</a> run with a <var>document</var>,
122126
<a>fully exit fullscreen</a> <var>document</var>.
@@ -128,6 +132,7 @@ security risk, or platform limitation.
128132

129133
<hr>
130134

135+
<div algorithm>
131136
<p>To <dfn>run the fullscreen steps</dfn> for a <a>document</a> <var>document</var>, run these
132137
steps:
133138

@@ -150,6 +155,7 @@ steps:
150155
</ol>
151156

152157
<p class=note>These steps integrate with the <a for=/>event loop</a> defined in HTML. [[!HTML]]
158+
</div>
153159

154160

155161

@@ -227,6 +233,7 @@ if all of the following are true, and false otherwise:
227233
<!-- cross-process, recursive -->
228234
</ul>
229235

236+
<div algorithm>
230237
<p>The <dfn method for=Element><code>requestFullscreen(<var>options</var>)</code></dfn> method,
231238
when invoked, must run these steps:
232239

@@ -352,6 +359,7 @@ when invoked, must run these steps:
352359

353360
<p class=note>Implementations with out-of-process <a for=/>browsing contexts</a> are left as an
354361
exercise to the reader. Input welcome on potential improvements.
362+
</div>
355363

356364
<p>The <dfn attribute for=Document><code>fullscreenEnabled</code></dfn> attribute's getter must
357365
return true if the <a>context object</a> is <a>allowed to use</a> the "<code><a
@@ -363,6 +371,7 @@ false if <a>context object</a>'s <a>fullscreen element</a> is null, and true oth
363371

364372
<p class=note>Use the {{DocumentOrShadowRoot/fullscreenElement}} attribute instead.
365373

374+
<div algorithm>
366375
<p>The
367376
<dfn attribute for=DocumentOrShadowRoot id=dom-document-fullscreenelement><code>fullscreenElement</code></dfn>
368377
attribute's getter must run these steps:
@@ -379,6 +388,7 @@ attribute's getter must run these steps:
379388

380389
<li><p>Return null.
381390
</ol>
391+
</div>
382392

383393
<p>A <a>document</a> is said to be a <dfn>simple fullscreen document</dfn> if there is exactly one
384394
<a>element</a> in its <a>top layer</a> that has its <a>fullscreen flag</a> set.
@@ -387,6 +397,7 @@ attribute's getter must run these steps:
387397
<a>simple fullscreen document</a>. For example, in addition to the <a>fullscreen element</a> there
388398
could be an open <{dialog}> element.
389399

400+
<div algorithm>
390401
<p>To <dfn>collect documents to unfullscreen</dfn> given <var>doc</var>, run these steps:
391402

392403
<ol>
@@ -417,7 +428,9 @@ could be an open <{dialog}> element.
417428
have more than one <a>element</a> in its <a>top layer</a> with the <a>fullscreen flag</a> set,
418429
in which case that document will still remain in fullscreen.
419430
</ol>
431+
</div>
420432

433+
<div algorithm>
421434
<p>To <dfn>exit fullscreen</dfn> a <a for=/>document</a> <var>doc</var>, run these steps:
422435

423436
<ol>
@@ -496,6 +509,7 @@ could be an open <{dialog}> element.
496509

497510
<li><p>Resolve <var>promise</var> with undefined.
498511
</ol>
512+
</div>
499513

500514
<p>The <dfn method for=Document><code>exitFullscreen()</code></dfn> method, when invoked, must
501515
return the result of running <a>exit fullscreen</a> on the <a>context object</a>.

0 commit comments

Comments
 (0)