diff --git a/fullscreen.bs b/fullscreen.bs index 331b90e..2fa652f 100644 --- a/fullscreen.bs +++ b/fullscreen.bs @@ -247,68 +247,65 @@ these steps:
As part of the next animation frame task, run these substeps: - -
If any of the following conditions are false, then set error to true: - -
pending's node document is pendingDoc. +
If any of the following conditions are false, then set error to true: -
The fullscreen element ready check for pending returns true. - -
pending's node document is pendingDoc. -
If error is true, fire a fullscreen event named
- fullscreenerror
for (pending, pendingDoc), reject
- promise with a TypeError
exception, and terminate these steps.
+
The fullscreen element ready check for pending returns true. + +
Let fullscreenElements be an ordered set initially consisting of - pending. +
If error is true: -
While the first element in fullscreenElements is in a - nested browsing context: prepend its browsing context container to - fullscreenElements. - +
Queue an animation frame task for pendingDoc to
+ fire a fullscreen event named fullscreenerror
for (pending,
+ pendingDoc).
-
Let eventPairs be a new ordered set. +
Reject promise with a TypeError
exception and terminate these
+ steps.
+
For each element in fullscreenElements: +
Let fullscreenElements be an ordered set initially consisting of + pending. -
Let doc be element's node document. +
While the first element in fullscreenElements is in a + nested browsing context: append its browsing context container to + fullscreenElements. + -
If element is doc's fullscreen element, continue. +
For each element in fullscreenElements: -
No need to notify observers when nothing has changed. +
Let doc be element's node document. -
Otherwise, append (element, doc) to - eventPairs. +
If element is doc's fullscreen element, continue. -
If element is pending and pending is an <{iframe}> - element, then set element's iframe fullscreen flag. +
No need to notify observers when nothing has changed. -
Fullscreen element within doc. -
If element is pending and pending is an <{iframe}> + element, then set element's iframe fullscreen flag. -
For each (element, document) in eventPairs:
- fire a fullscreen event named fullscreenchange
for (element,
- document).
-
Fullscreen element within doc. -
Resolve promise with undefined. +
Queue an animation frame task for doc to fire a fullscreen event
+ named fullscreenchange
for (element, document).
Animation frame task is not really defined yet, including relative order - within that task, see bug 26440. +
The order in which elements are fullscreened + and animation frame tasks are queued is not observable, because the animation frame tasks will run + in tree order. -
Implementations with out-of-process browsing contexts are left as an - exercise to the reader. Input welcome on potential improvements. +
Resolve promise with undefined. +
Implementations with out-of-process browsing contexts are left as an +exercise to the reader. Input welcome on potential improvements. +
The fullscreenEnabled
attribute's getter must
return true if the context object is allowed to use the feature indicated by attribute
name allowfullscreen
and fullscreen is supported, and false otherwise.
@@ -394,66 +391,57 @@ could be an open <{dialog}> element.
If topLevelDoc is in docs, and it is a - simple fullscreen document, then set resize to true. + simple fullscreen document, then set doc to topLevelDoc and + resize to true.
Return promise, and run the remaining steps in parallel. -
If resize is true, resize topLevelDoc's viewport to its "normal" - dimensions. +
If resize is true, resize doc's viewport to its "normal" dimensions. -
As part of the next animation frame task, run these substeps: - -
If doc's fullscreen element is null, then resolve promise - with undefined and terminate these steps. - -
Let exitDocs be the result of - collecting documents to unfullscreen given - doc. - - -
If resize is true and topLevelDoc is either not in
- exitDocs, or not a simple fullscreen document,
- fully exit fullscreen topLevelDoc, reject promise with a
- TypeError
exception, and terminate these steps.
-
+
If doc's fullscreen element is null, then resolve promise with + undefined and terminate these steps. -
Let eventPairs be a new ordered set. - -
Let descendantDocs be an ordered set consisting of doc's - descendant browsing contexts' active documents whose fullscreen element is - non-null, if any, in reverse tree order. - +
Let exitDocs be the result of + collecting documents to unfullscreen given + doc. + -
For each descendantDoc in descendantDocs: +
Let descendantDocs be an ordered set consisting of doc's + descendant browsing contexts' active documents whose fullscreen element is + non-null, if any, in tree order. + -
Append (descendantDoc's fullscreen element, - descendantDoc) to eventPairs. +
For each exitDoc in exitDocs: -
Queue an animation frame task for exitDoc to
+ fire a fullscreen event named fullscreenchange
for
+ (exitDoc's fullscreen element, exitDoc).
-
For each exitDoc in exitDocs: +
If resize is true, unfullscreen + exitDoc. -
Append (exitDoc's fullscreen element, - exitDoc) to eventPairs. +
Otherwise, unfullscreen exitDoc's + fullscreen element. +
Unfullscreen exitDoc's fullscreen element. -
For each descendantDoc in descendantDocs: -
For each (element, document) in eventPairs:
- fire a fullscreen event named fullscreenchange
for (element,
- document).
+
Queue an animation frame task for descendantDoc to
+ fire a fullscreen event named fullscreenchange
for
+ (descendantDoc's fullscreen element, descendantDoc).
-
Resolve promise with undefined. +
This results in events being fired from the innermost to the outermost document. +
The order in which documents are unfullscreened + and animation frame tasks are queued is not observable, because the animation frame tasks will run + in tree order. + +
Resolve promise with undefined.
The exitFullscreen()
method, when invoked, must