From 349d0422ddffe95a0926bdafa86ca75b1fe38a87 Mon Sep 17 00:00:00 2001 From: Dave Tapuska Date: Fri, 18 May 2018 15:13:44 -0400 Subject: [PATCH] If the fullscreen element is not connected anymore dispatch event and unfullscreen the element right away. When an node is being remove synchronously remove it from the top layer. --- fullscreen.bs | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/fullscreen.bs b/fullscreen.bs index 4e7428a..3da7eb5 100644 --- a/fullscreen.bs +++ b/fullscreen.bs @@ -92,6 +92,8 @@ its node document's top layer. these steps:
    +
  1. Let document be removedNode's node document. +

  2. Let nodes be removedNode's shadow-including inclusive descendants that have their fullscreen flag set, in shadow-including tree order. @@ -100,11 +102,18 @@ these steps:

    For each node in nodes:

      -
    1. If node is its node document's fullscreen element, - exit fullscreen that document. +

    2. If node is document's fullscreen element, + exit fullscreen document. + +

    3. Otherwise, unfullscreen node. + +

    4. +

      If document's top layer contains node, + remove node from document's top layer. -

    5. Otherwise, unfullscreen node within its - node document. +

      Other specifications can add and remove elements from top layer, so + node might not be document's fullscreen element. For example, + node could be an open <{dialog}> element.

@@ -398,6 +407,13 @@ could be an open <{dialog}> element. simple fullscreen document, then set doc to topLevelDoc and resize to true. +
  • If doc's fullscreen element is not connected: +

      +
    1. Append (fullscreenchange, doc's + fullscreen element) to doc's + list of pending fullscreen events. +

    +
  • Return promise, and run the remaining steps in parallel.

  • If resize is true, resize doc's viewport to its "normal" dimensions. @@ -676,6 +692,7 @@ delivered with the document through which it is nested. Andy Earnshaw, Chris Pearce, Darin Fisher, +Dave Tapuska, fantasai, Giuseppe Pascale, Glenn Maynard,