Description
What is the issue with the Fullscreen API Standard?
Step 5 & 6 says the following
-
Let topLevelDoc be doc’s node navigable’s top-level traversable’s active document.
-
If topLevelDoc is in docs, and it is a simple fullscreen document, then set doc to topLevelDoc and resize to true.
However, topLevelDoc may indeed be simple (or non simple), but in the case where it's simple, and some doc between this
and topLevelDoc
is non-simple, resize should be false
, not true
. Resize should only be true if the entire tree is simple. We can corroborate/verify this by reading the algorithm for "collecting documents to unfullscreen" which does the following:
To collect documents to unfullscreen given doc, run these steps:
- Let docs be an ordered set consisting of doc.
- While true:
2.1 Let lastDoc be docs’s last document.
2.2 Assert: lastDoc’s fullscreen element is not null.
2.3. If lastDoc is not a simple fullscreen document, break <- NOTE THIS
2.4 Let container be lastDoc’s node navigable’s container.
2.5 If container is null, then break.
2.6 If container’s iframe fullscreen flag is set, break.
2.7 Append container’s node document to docs. - Return docs.
Here we can see that the algorithm terminates if a non simple fullscreen document is encountered. This is also the behaviors of browsers Chrome and Firefox.
I propose a change to step 5 and 6 of the algorithm, because it seems that none of the browsers actually does step 5 & 6 like they're written in the spec (because it doesn't make sense).
What needs to happen is not set doc to topLevelDoc, but instead run the "collect" steps to find the first document which is non-simple or the top-level doc if all of them are simple and in that case, set resize to true.