diff --git a/fullscreen.bs b/fullscreen.bs index 16ad739..db2a19b 100644 --- a/fullscreen.bs +++ b/fullscreen.bs @@ -68,6 +68,13 @@ stated otherwise it is unset.
All documents have an associated list of pending fullscreen events, which is an ordered set of (string, element) tuples. It is initially empty. +
All documents have a +pending fullscreen request, which is a boolean. It is initially false. + +
All documents have an associated pending fullscreen request promise, +which is a nullable {{Promise}}. It is initially null. It represents the current pending +fullscreen request. +
To fullscreen an element:
Let pendingDoc be this's node document. -
Let promise be a new promise. -
If pendingDoc is not fully active, then reject promise with a - {{TypeError}} exception and return promise. +
Let promise be [=a new promise=] in [=this=]'s [=relevant realm=]. + +
Set pendingDoc's [=Document/pending fullscreen request promise=] to promise. + +
If pendingDoc is not fully active, then set pendingDoc's + [=Document/pending fullscreen request promise=] to null, reject promise with a + {{TypeError}} exception, and return promise.
Let error be false. @@ -295,6 +306,8 @@ are:
If error is false, then consume user activation given pendingDoc's relevant global object. +
If error is false, then set pendingDoc's [=Document/pending fullscreen request=] to true. +
Return promise, and run the remaining steps in parallel.
If error is true:
Set pendingDoc's [=Document/pending fullscreen request=] to false. + +
Set pendingDoc's [=Document/pending fullscreen request promise=] to null. +
Append ({{fullscreenerror}}, this) to pendingDoc's list of pending fullscreen events. @@ -392,6 +409,10 @@ are:
The order in which elements are fullscreened is not observable, because run the fullscreen steps is invoked in tree order. +
Set pendingDoc's [=Document/pending fullscreen request=] to false. + +
Set pendingDoc's [=Document/pending fullscreen request promise=] to null. +
Resolve promise with undefined.