Files
Simon Farre 6a3dc6db5e Bug 2002289 Fix OOP-frame JSWA fullscreen problem r=edgar
This patch fixes a problem where we have fullscreened a subtree of
documents and now a request is made to fullscreen an element further
down in the tree, which may be out of process, with respect to the
already fullscreened elements and documents.

The bug triggers, because a check in the parent proess will see that the
browser tab, already has a chrome element that is fullscreen and then
aborts. We must also not do any actual work when we hit this issue,
because everything is already fullscreen.

The fix is to resume the JSWA "messaging chain" without doing any
Fullscreen API work and only do so when the in-process-requested
to-be-fullscreened-element is an iframe, or if we're the parent process,
otherwise the check should "fail" as normal and not do anything.

Added wpt-like tests. I guess there's a case to be made to change the
test testing/web-platform/tests/fullscreen/api/element-request-fullscreen-cross-origin.sub.html
to behave like the test I've provided here. It first requests
fullscreen inside B, which will make the body element go fullscreen,
then when a request goes for D (its body element), the iframe in B also
goes fullscreen and then the remainder of frames goes fullscreen. The
point being for us, that when doing fullscreen stuff and we're stuck on
JSWA, we must propagate the MozDOMFullscreen:Entered messages
properly, even if no work needs to be done.

Differential Revision: https://phabricator.services.mozilla.com/D274060
2025-12-15 09:06:14 +00:00
..