diff --git a/fullscreen.bs b/fullscreen.bs index bd54a2c..331b90e 100644 --- a/fullscreen.bs +++ b/fullscreen.bs @@ -133,6 +133,20 @@ security risk, or platform limitation. +
To fire a fullscreen event named e for an (element, +document) pair, run these steps: + +
Let target be element if element is connected + and its node document is document, and otherwise let target be + document. + +
Fire an event named e, with its {{Event/bubbles}} and {{Event/composed}} + attributes set to true, at target. +
partial interface Element { Promise<void> requestFullscreen(); + + attribute EventHandler onfullscreenchange; + attribute EventHandler onfullscreenerror; }; partial interface Document { @@ -156,6 +173,8 @@ partial interface DocumentOrShadowRoot { [LenientSetter] readonly attribute Element? fullscreenElement; };+
promise = element . {{Element/requestFullscreen()}}
@@ -241,9 +260,9 @@ these steps:
- If error is true, fire an event named fullscreenerror
on
- pendingDoc, reject promise with a TypeError
exception, and
- terminate these steps.
+
If error is true, fire a fullscreen event named
+ fullscreenerror
for (pending, pendingDoc), reject
+ promise with a TypeError
exception, and terminate these steps.
Let fullscreenElements be an ordered set initially consisting of pending. @@ -253,7 +272,7 @@ these steps: fullscreenElements. -
Let eventDocs be a new ordered set. +
Let eventPairs be a new ordered set.
For each element in fullscreenElements: @@ -266,7 +285,8 @@ these steps:
No need to notify observers when nothing has changed. -
Otherwise, append doc to eventDocs. +
Otherwise, append (element, doc) to + eventPairs.
If element is pending and pending is an <{iframe}> element, then set element's iframe fullscreen flag. @@ -274,8 +294,10 @@ these steps:
Fullscreen element within doc. -
For each doc in eventDocs, fire an event
- named fullscreenchange
on doc.
+
For each (element, document) in eventPairs:
+ fire a fullscreen event named fullscreenchange
for (element,
+ document).
+
Resolve promise with undefined.
@@ -397,25 +419,36 @@ could be an open <{dialog}> element.
TypeError
exception, 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. -
For each descendantDoc in descendantDocs, - unfullscreen descendantDoc. - +
For each descendantDoc in descendantDocs: -
For each exitDoc in exitDocs, - unfullscreen exitDoc's fullscreen element. +
Append (descendantDoc's fullscreen element, + descendantDoc) to eventPairs. -
For each descendantDoc in descendantDocs,
- fire an event named fullscreenchange
on descendantDoc.
-
+
For each exitDoc in exitDocs, fire an event named
- fullscreenchange
on exitDoc.
-
+
For each exitDoc in exitDocs: + +
Append (exitDoc's fullscreen element, + exitDoc) to eventPairs. + +
Unfullscreen exitDoc's fullscreen element. +
For each (element, document) in eventPairs:
+ fire a fullscreen event named fullscreenchange
for (element,
+ document).
Resolve promise with undefined. @@ -429,7 +462,8 @@ return the result of running exit fullscreen on the context object
The following are the event handlers (and their corresponding -event handler event types) that must be supported on documents as attributes: +event handler event types) that must be supported by {{Element}} and {{Document}} objects as +event handler IDL attributes:
fullscreenerror
|
These are not supported by {{ShadowRoot}} or {{Window}} objects, and there are no +corresponding event handler content attributes for {{Element}} objects in any namespace. +