Skip to content

Commit 12330bb

Browse files
dtapuskafoolip
authored andcommitted
Add FullscreenOptions dictionary to requestFullscreen (#129)
Tests: web-platform-tests/wpt#12828
1 parent c6803d8 commit 12330bb

File tree

1 file changed

+52
-10
lines changed

1 file changed

+52
-10
lines changed

fullscreen.bs

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,18 @@ steps:
165165
<h2 id=api>API</h2>
166166

167167
<pre class=idl>
168+
enum <dfn>FullscreenNavigationUI</dfn> {
169+
"auto",
170+
"show",
171+
"hide"
172+
};
173+
174+
dictionary <dfn>FullscreenOptions</dfn> {
175+
FullscreenNavigationUI navigationUI = "auto";
176+
};
177+
168178
partial interface Element {
169-
Promise&lt;void> requestFullscreen();
179+
Promise&lt;void> requestFullscreen(optional FullscreenOptions options);
170180

171181
attribute EventHandler onfullscreenchange;
172182
attribute EventHandler onfullscreenerror;
@@ -190,8 +200,15 @@ partial interface DocumentOrShadowRoot {
190200
interface, which is implemented by Document and HTMLElement, not Element. -->
191201

192202
<dl class=domintro>
193-
<dt><code><var>promise</var> = <var>element</var> . {{Element/requestFullscreen()}}</code>
194-
<dd><p>Displays <var>element</var> fullscreen and resolves <var>promise</var> when done.
203+
<dt><code><var>promise</var> = <var>element</var> . <a method for=Element lt=requestFullscreen()>requestFullscreen([<var>options</var>])</a></code>
204+
<dd>
205+
Displays <var>element</var> fullscreen and resolves <var>promise</var> when done.
206+
207+
When supplied, <var>options</var>'s <code>navigationUI</code> member indicates whether showing
208+
navigation UI while in fullscreen is preferred or not. If set to "<code>show</code>", navigation
209+
simplicity is preferred over screen space, and if set to "<code>hide</code>", more screen space
210+
is preferred. User agents are always free to honor user preference over the application's. The
211+
default value "<code>auto</code>" indicates no application preference.
195212

196213
<dt><code><var>document</var> . {{Document/fullscreenEnabled}}</code>
197214
<dd><p>Returns true if <var>document</var> has the ability to display <a>elements</a> fullscreen
@@ -219,8 +236,8 @@ if all of the following are true, and false otherwise:
219236
<!-- cross-process, recursive -->
220237
</ul>
221238

222-
<p>The <dfn method for=Element><code>requestFullscreen()</code></dfn> method, when invoked, must run
223-
these steps:
239+
<p>The <dfn method for=Element><code>requestFullscreen(<var>options</var>)</code></dfn> method,
240+
when invoked, must run these steps:
224241

225242
<ol>
226243
<li><p>Let <var>pending</var> be the <a>context object</a>.
@@ -255,11 +272,36 @@ these steps:
255272

256273
<li><p>Return <var>promise</var>, and run the remaining steps <a>in parallel</a>.
257274

258-
<li><p>If <var>error</var> is false: Resize <var>pendingDoc</var>'s
259-
<a>top-level browsing context</a>'s <a>active document</a>'s viewport's dimensions to match the
260-
dimensions of the screen of the output device. Optionally display a message how the end user can
261-
revert this.
262-
<!-- cross-process -->
275+
<li>
276+
<p>If <var>error</var> is false: Resize <var>pendingDoc</var>'s
277+
<a>top-level browsing context</a>'s <a>active document</a>'s viewport's dimensions, optionally
278+
taking into account <var>options</var>'s <code>navigationUI</code> member:
279+
<!-- cross-process -->
280+
281+
<table>
282+
<thead>
283+
<tr>
284+
<th>value</th>
285+
<th>viewport dimensions</th>
286+
</tr>
287+
</thead>
288+
<tbody>
289+
<tr>
290+
<td>"<code>hide</code>"</td>
291+
<td>full dimensions of the screen of the output device</td>
292+
</tr>
293+
<tr>
294+
<td>"<code>show</code>"</td>
295+
<td>dimensions of the screen of the output device clamped to allow the user agent to show page navigation controls</td>
296+
</tr>
297+
<tr>
298+
<td>"<code>auto</code>"</td>
299+
<td>user-agent defined, but matching one of the above</td>
300+
</tr>
301+
</tbody>
302+
</table>
303+
304+
<p>Optionally display a message how the end user can revert this.
263305

264306
<li>
265307
<p>If any of the following conditions are false, then set <var>error</var> to true:

0 commit comments

Comments
 (0)