- From: Simon Farre <notifications@github.com>
- Date: Wed, 14 May 2025 07:56:17 -0700
- To: whatwg/fullscreen <fullscreen@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/fullscreen/issues/248@github.com>
theIDinside created an issue (whatwg/fullscreen#248) ### What is the issue with the Fullscreen API Standard? Step 5 & 6 says the following 5. Let topLevelDoc be doc’s [node navigable](https://html.spec.whatwg.org/multipage/document-sequences.html#node-navigable)’s [top-level traversable](https://html.spec.whatwg.org/multipage/document-sequences.html#nav-top)’s [active document](https://html.spec.whatwg.org/multipage/document-sequences.html#nav-document). 6. If topLevelDoc is in docs, and it is a [simple fullscreen document](https://fullscreen.spec.whatwg.org/#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 either 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: 1. Let docs be an [ordered set](https://infra.spec.whatwg.org/#ordered-set) consisting of doc. 2. [While](https://infra.spec.whatwg.org/#iteration-while) true: 2.1 Let lastDoc be docs’s last [document](https://dom.spec.whatwg.org/#concept-document). 2.2 Assert: lastDoc’s [fullscreen element](https://fullscreen.spec.whatwg.org/#fullscreen-element) is not null. 2.3. If lastDoc is not a [simple fullscreen document](https://fullscreen.spec.whatwg.org/#simple-fullscreen-document), [break](https://infra.spec.whatwg.org/#iteration-break) <- NOTE THIS 2.4 Let container be lastDoc’s [node navigable](https://html.spec.whatwg.org/multipage/document-sequences.html#node-navigable)’s [container](https://html.spec.whatwg.org/multipage/document-sequences.html#nav-container). 2.5 If container is null, then [break](https://infra.spec.whatwg.org/#iteration-break). 2.6 If container’s [iframe fullscreen flag](https://fullscreen.spec.whatwg.org/#iframe-fullscreen-flag) is set, [break](https://infra.spec.whatwg.org/#iteration-break). 2.7 [Append](https://infra.spec.whatwg.org/#set-append) container’s [node document](https://dom.spec.whatwg.org/#concept-node-document) to docs. 3. 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. -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/fullscreen/issues/248 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/fullscreen/issues/248@github.com>
Received on Wednesday, 14 May 2025 14:56:21 UTC