diff --git a/fullscreen.bs b/fullscreen.bs index d8e23bd..69e3498 100644 --- a/fullscreen.bs +++ b/fullscreen.bs @@ -78,25 +78,29 @@ unset.
All <{iframe}> elements have an associated iframe fullscreen flag. Unless stated otherwise it is unset. -
All documents have an associated fullscreen element. The -fullscreen element is the topmost element in the document's top layer -whose fullscreen flag is set, if any, and null otherwise. - -
To fullscreen an element within a document, set the -element's fullscreen flag and add it to document's -top layer. - -
To unfullscreen an element within a document, unset the -element's fullscreen flag and iframe fullscreen flag (if any), and -remove it from document's top layer. - -
To unfullscreen a document, +
All document trees have an associated fullscreen element. The +fullscreen element is the topmost element in the document tree's +top layer whose fullscreen flag is set, if any, and null otherwise. + +
To fullscreen an element within a document tree whose root is +document, set the element's fullscreen flag and add it to +document's top layer. If the element is in a shadow tree, +set fullscreen flags of all shadow hosts in its shadow-including ancestors. + +
To unfullscreen an element within a document tree whose root is +document, unset the element's fullscreen flag and +iframe fullscreen flag (if any), and remove it from document's +top layer. If the element is in a shadow tree, unset +fullscreen flags in its shadow-including ancestors. + +
To unfullscreen a document tree whose root is document, unfullscreen all elements, within document's top layer, whose fullscreen flag is set.
To fully exit fullscreen a document document, run these steps: +
To fully exit fullscreen a document tree whose root is document, +run these steps:
If document's fullscreen element is null, terminate these steps. @@ -111,15 +115,15 @@ whose fullscreen flag is set, if any, and null otherwise.
Whenever the removing steps run with an oldNode, run these steps:
Let nodes be oldNode's inclusive descendants that have their - fullscreen flag set, in tree order. +
Let nodes be oldNode's shadow-including inclusive descendants + that have their fullscreen flag set, in shadow-including tree order.
For each node in nodes, run these substeps:
If node is its node document's fullscreen element, - exit fullscreen that document. + exit fullscreen that document tree.
Otherwise, unfullscreen node within its node document. @@ -154,7 +158,6 @@ partial interface Element { partial interface Document { [LenientSetter] readonly attribute boolean fullscreenEnabled; - [LenientSetter] readonly attribute Element? fullscreenElement; [LenientSetter] readonly attribute boolean fullscreen; // historical Promise<void> exitFullscreen(); @@ -162,6 +165,10 @@ partial interface Document { attribute EventHandler onfullscreenchange; attribute EventHandler onfullscreenerror; }; + +partial interface DocumentOrShadowRoot { + [LenientSetter] readonly attribute Element? fullscreenElement; +};
Returns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise. -
document . {{Document/fullscreenElement}}
- Returns document's fullscreen element. -
promise = document . {{Document/exitFullscreen()}}
Stops document's fullscreen element from being displayed fullscreen and fulfills promise when done. + +
document . {{DocumentOrShadowRoot/fullscreenElement}}
+ Returns the result of retargeting document's fullscreen element against + document. + +
shadowroot . {{DocumentOrShadowRoot/fullscreenElement}}
+ Returns the result of retargeting document's fullscreen element against + shadowroot if the result is in the same tree as shadowroot.
A fullscreen element ready check for an element element returns true
@@ -191,7 +203,7 @@ if all of the following are true, and false otherwise:
MathML math
element. [[!SVG]] [[!MATHML]]
-
element is in a document. +
element is in a document tree.
element's node document is allowed to use the feature indicated by
attribute name allowfullscreen
.
@@ -284,14 +296,17 @@ these steps:
return true if the context object is allowed to use the feature indicated by attribute
name allowfullscreen
and fullscreen is supported, and false otherwise.
-
The fullscreenElement
attribute's getter must
-return context object's fullscreen element.
-
The fullscreen
attribute's getter must return
false if context object's fullscreen element is null, and true otherwise.
Use
-document.fullscreenElement
instead.
+document.fullscreenElement
+instead.
+
+
The fullscreenElement
attribute's
+getter must return the result of retargeting context object's
+shadow-including root's fullscreen element against context object if the
+result and the context object are in the same tree, otherwise return null.
To collect documents to unfullscreen given doc, run these steps: @@ -309,7 +324,7 @@ false if context object's fullscreen element is null, and true oth
Return docs.
To exit fullscreen a document doc, run these steps: +
To exit fullscreen a document tree doc, run these steps:
Let promise be a new promise. @@ -361,7 +376,7 @@ false if context object's fullscreen element is null, and true oth
For each descendantDoc in descendantDocs, in order, - unfullscreen descendantDoc. + unfullscreen descendantDoc.
For each exitDoc in exitDocs, in order, @@ -462,8 +477,8 @@ following characteristics: is the viewport, and the initial containing block otherwise.
If it is an element, it and its ::backdrop
pseudo-element are not
- rendered if its inclusive ancestor has the display
property set to
- none
.
+ rendered if its shadow-including inclusive ancestor has the display
property
+ set to none
.
If its specified display
property is contents
, it computes to
block
.
@@ -506,7 +521,8 @@ properties apply to this pseudo-element either.
The :fullscreen
pseudo-class must match any
element that has its fullscreen flag set.
-
This makes it different from the {{Document/fullscreenElement}} API, +
This makes it different from the +{{DocumentOrShadowRoot/fullscreenElement}} API, which returns a document's fullscreen element. @@ -596,6 +612,7 @@ Rune Lillesveen, Sigbjørn Vik, Simon Pieters, Tab Atkins, +Takayoshi Kochi, Theresa O'Connor, Vincent Scheib, and Xidorn Quan