Skip to content

Commit

Permalink
Cleanup fully exit fullscreen
Browse files Browse the repository at this point in the history
This should help reduce what needs to be defined in the HTML standard.

See whatwg/html#230 for more details.
  • Loading branch information
annevk committed Oct 6, 2015
1 parent 3d35951 commit 3243119
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 56 deletions.
49 changes: 21 additions & 28 deletions Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,27 +152,21 @@ <h2 id="model"><span class="secno">3 </span>Model</h2>

<hr>

<p>To <dfn id="fully-exit-fullscreen">fully exit fullscreen</dfn>, run these steps:
<p>To <dfn id="fully-exit-fullscreen">fully exit fullscreen</dfn> a
<a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#concept-document" title="concept-document">document</a> <var>document</var>, run these
steps:

<ol>
<li><p>Let <var title="">doc</var> be the
<a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/browsers.html#top-level-browsing-context">top-level browsing context</a>'s
<a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#concept-document" title="concept-document">document</a>.

<li><p>If <var title="">doc</var>'s <a href="#fullscreen-element">fullscreen element</a> is null, terminate these
<li><p>If <var>document</var>'s <a href="#fullscreen-element">fullscreen element</a> is null, terminate these
steps.

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

<li><p>Run <a href="#exit-fullscreen">exit fullscreen</a> with <var title="">doc</var>.
<li><p><a href="#exit-fullscreen">Exit fullscreen</a> <var>document</var>.
</ol>

<p class="note">HTML invokes the <a href="#fully-exit-fullscreen">fully exit fullscreen</a> algorithm for
<a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/browsers.html#navigate" title="navigate">navigation</a>.
<a href="#refsHTML">[HTML]</a>

<p>Whenever the
<a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#concept-node-remove-ext" title="concept-node-remove-ext">removing steps</a> run with an
<var>oldNode</var>, run these steps:
Expand All @@ -189,7 +183,7 @@ <h2 id="model"><span class="secno">3 </span>Model</h2>
<ol>
<li><p>If <var title="">node</var> is its
<a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#concept-node-document" title="concept-node-document">node document</a>'s
<a href="#fullscreen-element">fullscreen element</a>, run <a href="#exit-fullscreen">exit fullscreen</a> on that
<a href="#fullscreen-element">fullscreen element</a>, <a href="#exit-fullscreen">exit fullscreen</a> that
<a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#concept-document" title="concept-document">document</a> and terminate these
steps.

Expand All @@ -199,9 +193,8 @@ <h2 id="model"><span class="secno">3 </span>Model</h2>
</ol>
</ol>

<p>Whenever the <a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/browsers.html#unloading-document-cleanup-steps">unloading document cleanup steps</a> run
with a <var>doc</var>,
<a href="#unfullscreen-a-document" title="unfullscreen a document">unfullscreen <var>doc</var></a>.
<p>Whenever the <a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/browsers.html#unloading-document-cleanup-steps">unloading document cleanup steps</a> run with a
<var>document</var>, <a href="#fully-exit-fullscreen">fully exit fullscreen</a> <var>document</var>.

<hr>

Expand Down Expand Up @@ -408,9 +401,8 @@ <h2 id="api"><span class="secno">4 </span>API</h2>
<li><p>Return <var>docs</var>.
</ol>

<p>To <dfn id="exit-fullscreen">exit fullscreen</dfn>, given a
<a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#concept-document" title="concept-document">document</a> <var>doc</var>, run
these steps:
<p>To <dfn id="exit-fullscreen">exit fullscreen</dfn> a <a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#concept-document" title="concept-document">document</a>
<var>doc</var>, run these steps:

<ol>
<li><p>Let <var>promise</var> be a new promise.
Expand Down Expand Up @@ -449,9 +441,9 @@ <h2 id="api"><span class="secno">4 </span>API</h2>
given <var>doc</var>.
<!-- cross-process -->

<li><p>If <var title="">resize</var> is true and <var title="">topLevelDoc</var> is not in
<var title="">exitDocs</var>, <a href="#fully-exit-fullscreen">fully exit fullscreen</a>, reject
<var>promise</var> with a <code>TypeError</code> exception, and terminate these steps.
<li><p>If <var>resize</var> is true and <var>topLevelDoc</var> is not in <var>exitDocs</var>,
<a href="#fully-exit-fullscreen">fully exit fullscreen</a> <var>topLevelDoc</var>, reject <var>promise</var> with a
<code>TypeError</code> exception, and terminate these steps.

<li><p>If <var>exitDocs</var> is the empty set, append <var>doc</var> to
<var>exitDocs</var>.
Expand Down Expand Up @@ -498,10 +490,9 @@ <h2 id="api"><span class="secno">4 </span>API</h2>
document.
</ol>

<p>The
<dfn id="dom-document-exitfullscreen" title="dom-Document-exitFullscreen"><code>exitFullscreen()</code></dfn>
method, when invoked, must return the result of running <a href="#exit-fullscreen">exit fullscreen</a> with
the <a href="#context-object">context object</a>.
<p>The <dfn id="dom-document-exitfullscreen" title="dom-Document-exitFullscreen"><code>exitFullscreen()</code></dfn> method, when
invoked, must return the result of running <a href="#exit-fullscreen">exit fullscreen</a> on the
<a href="#context-object">context object</a>.

<hr>

Expand Down Expand Up @@ -537,7 +528,9 @@ <h2 id="ui"><span class="secno">5 </span>UI</h2>
<p>If the end user instructs the user agent to end a fullscreen session
initiated via
<a href="#dom-element-requestfullscreen"><code title="dom-Element-requestFullscreen">requestFullscreen()</code></a>,
<a href="#fully-exit-fullscreen">fully exit fullscreen</a>.
<a href="#fully-exit-fullscreen">fully exit fullscreen</a> the
<a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/browsers.html#top-level-browsing-context">top-level browsing context</a>'s
<a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#concept-document" title="concept-document">document</a>.



Expand Down
49 changes: 21 additions & 28 deletions Overview.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,27 +137,21 @@ <h2>Model</h2>

<hr>

<p>To <dfn>fully exit fullscreen</dfn>, run these steps:
<p>To <dfn>fully exit fullscreen</dfn> a
<span data-anolis-spec=dom title=concept-document>document</span> <var>document</var>, run these
steps:

<ol>
<li><p>Let <var title>doc</var> be the
<span data-anolis-spec=html>top-level browsing context</span>'s
<span data-anolis-spec=dom title=concept-document>document</span>.

<li><p>If <var title>doc</var>'s <span>fullscreen element</span> is null, terminate these
<li><p>If <var>document</var>'s <span>fullscreen element</span> is null, terminate these
steps.

<li><p><span title="Unfullscreen an element">Unfullscreen elements</span> whose
<span>fullscreen flag</span> is set, within <var>doc</var>'s <span>top layer</span>,
except for <var>doc</var>'s <span>fullscreen element</span>.
<span>fullscreen flag</span> is set, within <var>document</var>'s <span>top layer</span>, except
for <var>document</var>'s <span>fullscreen element</span>.

<li><p>Run <span>exit fullscreen</span> with <var title>doc</var>.
<li><p><span>Exit fullscreen</span> <var>document</var>.
</ol>

<p class=note>HTML invokes the <span>fully exit fullscreen</span> algorithm for
<span data-anolis-spec=html title=navigate>navigation</span>.
<span data-anolis-ref>HTML</span>

<p>Whenever the
<span data-anolis-spec=dom title=concept-node-remove-ext>removing steps</span> run with an
<var>oldNode</var>, run these steps:
Expand All @@ -174,7 +168,7 @@ <h2>Model</h2>
<ol>
<li><p>If <var title>node</var> is its
<span data-anolis-spec=dom title=concept-node-document>node document</span>'s
<span>fullscreen element</span>, run <span>exit fullscreen</span> on that
<span>fullscreen element</span>, <span>exit fullscreen</span> that
<span data-anolis-spec=dom title=concept-document>document</span> and terminate these
steps.

Expand All @@ -184,9 +178,8 @@ <h2>Model</h2>
</ol>
</ol>

<p>Whenever the <span data-anolis-spec=html>unloading document cleanup steps</span> run
with a <var>doc</var>,
<span title="unfullscreen a document">unfullscreen <var>doc</var></span>.
<p>Whenever the <span data-anolis-spec=html>unloading document cleanup steps</span> run with a
<var>document</var>, <span>fully exit fullscreen</span> <var>document</var>.

<hr>

Expand Down Expand Up @@ -393,9 +386,8 @@ <h2>API</h2>
<li><p>Return <var>docs</var>.
</ol>

<p>To <dfn>exit fullscreen</dfn>, given a
<span data-anolis-spec=dom title=concept-document>document</span> <var>doc</var>, run
these steps:
<p>To <dfn>exit fullscreen</dfn> a <span data-anolis-spec=dom title=concept-document>document</span>
<var>doc</var>, run these steps:

<ol>
<li><p>Let <var>promise</var> be a new promise.
Expand Down Expand Up @@ -434,9 +426,9 @@ <h2>API</h2>
given <var>doc</var>.
<!-- cross-process -->

<li><p>If <var title>resize</var> is true and <var title>topLevelDoc</var> is not in
<var title>exitDocs</var>, <span>fully exit fullscreen</span>, reject
<var>promise</var> with a <code>TypeError</code> exception, and terminate these steps.
<li><p>If <var>resize</var> is true and <var>topLevelDoc</var> is not in <var>exitDocs</var>,
<span>fully exit fullscreen</span> <var>topLevelDoc</var>, reject <var>promise</var> with a
<code>TypeError</code> exception, and terminate these steps.

<li><p>If <var>exitDocs</var> is the empty set, append <var>doc</var> to
<var>exitDocs</var>.
Expand Down Expand Up @@ -483,10 +475,9 @@ <h2>API</h2>
document.
</ol>

<p>The
<dfn title=dom-Document-exitFullscreen><code>exitFullscreen()</code></dfn>
method, when invoked, must return the result of running <span>exit fullscreen</span> with
the <span>context object</span>.
<p>The <dfn title=dom-Document-exitFullscreen><code>exitFullscreen()</code></dfn> method, when
invoked, must return the result of running <span>exit fullscreen</span> on the
<span>context object</span>.

<hr>

Expand Down Expand Up @@ -522,7 +513,9 @@ <h2>UI</h2>
<p>If the end user instructs the user agent to end a fullscreen session
initiated via
<code title=dom-Element-requestFullscreen>requestFullscreen()</code>,
<span>fully exit fullscreen</span>.
<span>fully exit fullscreen</span> the
<span data-anolis-spec=html>top-level browsing context</span>'s
<span data-anolis-spec=dom title=concept-document>document</span>.



Expand Down

0 comments on commit 3243119

Please sign in to comment.