diff --git a/fullscreen.bs b/fullscreen.bs index 65701db..350c672 100644 --- a/fullscreen.bs +++ b/fullscreen.bs @@ -88,9 +88,12 @@ its node document's top layer.
  • Exit fullscreen document. -

    Whenever the removing steps run with a removedNode, run these steps: +

    Whenever the removing steps run with a removedNode, run 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. @@ -99,11 +102,18 @@ its node document's top layer.

      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.

    @@ -381,8 +391,6 @@ could be an open <{dialog}> element. is null, then reject promise with a TypeError exception and return promise. -
  • Let resize be false. -

  • Let docs be the result of collecting documents to unfullscreen given doc. @@ -392,23 +400,38 @@ could be an open <{dialog}> element. active document. +

  • Let pendingDoc be doc. + +

  • Let resize be false. +

  • If topLevelDoc is in docs, and it is a - simple fullscreen document, then set doc to topLevelDoc and + simple fullscreen document, then set pendingDoc to topLevelDoc and resize to true. +

  • Let pending be pendingDoc's fullscreen element. + +

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

  • If resize is true, resize doc's viewport to its "normal" dimensions. +

  • If resize is true, resize pendingDoc's viewport to its "normal" + dimensions. -

  • If doc's fullscreen element is null, then resolve promise with - undefined and terminate these steps. +

  • +

    If pendingDoc's fullscreen element is not pending: + +

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

    2. Resolve promise with undefined and terminate these steps. +

  • Let exitDocs be the result of collecting documents to unfullscreen given - doc. + pendingDoc. -

  • Let descendantDocs be an ordered set consisting of doc's +

  • Let descendantDocs be an ordered set consisting of pendingDoc's descendant browsing contexts' active documents whose fullscreen element is non-null, if any, in tree order.