Re: [whatwg/fullscreen] Update fullscreen spec to be Shadow DOM compliant (#54)

foolip commented on this pull request.

Still trying to understand how this will all fit together, please correct me if I seem confused.

> -whose <a>fullscreen flag</a> is set, if any, and null otherwise.
-
-<p>To <dfn>fullscreen an <var>element</var></dfn> within a <var>document</var>, set the
-<var>element</var>'s <a>fullscreen flag</a> and <a>add</a> it to <var>document</var>'s
-<a>top layer</a>.
-
-<p>To <dfn>unfullscreen an <var>element</var></dfn> within a <var>document</var>, unset the
-<var>element</var>'s <a>fullscreen flag</a> and <a>iframe fullscreen flag</a> (if any), and
-<a>remove</a> it from <var>document</var>'s <a>top layer</a>.
-
-<p>To <dfn>unfullscreen a <var>document</var></dfn>,
+<p>All <a>document trees</a> have an associated <dfn>fullscreen element</dfn>. The
+<a>fullscreen element</a> is the topmost <a>element</a> in the <a>document tree</a>'s
+<a>top layer</a> whose <a>fullscreen flag</a> is set, if any, and null otherwise.
+
+<p>To <dfn>fullscreen an <var>element</var></dfn> within a <a>document tree</a> whose root is

I think that the concepts to fullscreen and unfullscreen an element could just as well take an element only, and use the element's node document and root instead of passing those in. That was true even before this change, and would be nice as a separate change preceding this one, if @annevk agrees.

> @@ -78,25 +78,29 @@ unset.
 <p>All <{iframe}> <a>elements</a> have an associated <dfn>iframe fullscreen flag</dfn>. Unless
 stated otherwise it is unset.
 
-<p>All <a>documents</a> have an associated <dfn>fullscreen element</dfn>. The
-<a>fullscreen element</a> is the topmost <a>element</a> in the <a>document</a>'s <a>top layer</a>
-whose <a>fullscreen flag</a> is set, if any, and null otherwise.
-
-<p>To <dfn>fullscreen an <var>element</var></dfn> within a <var>document</var>, set the
-<var>element</var>'s <a>fullscreen flag</a> and <a>add</a> it to <var>document</var>'s
-<a>top layer</a>.
-
-<p>To <dfn>unfullscreen an <var>element</var></dfn> within a <var>document</var>, unset the
-<var>element</var>'s <a>fullscreen flag</a> and <a>iframe fullscreen flag</a> (if any), and
-<a>remove</a> it from <var>document</var>'s <a>top layer</a>.
-
-<p>To <dfn>unfullscreen a <var>document</var></dfn>,
+<p>All <a>document trees</a> have an associated <dfn>fullscreen element</dfn>. The

Where should the term "document tree" be used? From DOM it looks like a document tree is a set of objects and not a concrete object, so one can't really associate things with them?

(Also, top layer itself will remain a per-document concept, and "fullscreen element" is just a shorthand for an element within, so I think that it was already odd to say that a document has an associated fullscreen element, rather it's just a helper concept.)

>  <p>The <dfn attribute for=Document><code>fullscreen</code></dfn> attribute's getter must return
 false if <a>context object</a>'s <a>fullscreen element</a> is null, and true otherwise.
 
 <p class=note>Use
-<a attribute for=Document lt=fullscreenElement><code>document.fullscreenElement</code></a> instead.
+<a attribute for=DocumentOrShadowRoot lt=fullscreenElement><code>document.fullscreenElement</code></a>
+instead.
+
+<p>The <dfn attribute for=DocumentOrShadowRoot><code>fullscreenElement</code></dfn> attribute's
+getter must return the result of <a>retargeting</a> <a>context object</a>'s

It's unfortunate to have divergence between the definition of "fullscreen element" and `fullscreenElement`. Can "fullscreen element" instead be defined for documents and shadow roots so that it can be used directly here?

> -<var>element</var>'s <a>fullscreen flag</a> and <a>add</a> it to <var>document</var>'s
-<a>top layer</a>.
-
-<p>To <dfn>unfullscreen an <var>element</var></dfn> within a <var>document</var>, unset the
-<var>element</var>'s <a>fullscreen flag</a> and <a>iframe fullscreen flag</a> (if any), and
-<a>remove</a> it from <var>document</var>'s <a>top layer</a>.
-
-<p>To <dfn>unfullscreen a <var>document</var></dfn>,
+<p>All <a>document trees</a> have an associated <dfn>fullscreen element</dfn>. The
+<a>fullscreen element</a> is the topmost <a>element</a> in the <a>document tree</a>'s
+<a>top layer</a> whose <a>fullscreen flag</a> is set, if any, and null otherwise.
+
+<p>To <dfn>fullscreen an <var>element</var></dfn> within a <a>document tree</a> whose root is
+<var>document</var>, set the <var>element</var>'s <a>fullscreen flag</a> and <a>add</a> it to
+<var>document</var>'s <a>top layer</a>. If the <var>element</var> is in a <a>shadow tree</a>,
+set <a>fullscreen flags</a> of all <a>shadow hosts</a> in its <a>shadow-including ancestors</a>.

I wonder if, similar to the "iframe fullscreen flag", the shadow hosts will need a flag to say when it was fullscreen'd explicitly and not?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fullscreen/pull/54#pullrequestreview-183022

Received on Thursday, 15 September 2016 15:40:13 UTC