<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>26326</bug_id>
          
          <creation_ts>2014-07-14 09:27:35 +0000</creation_ts>
          <short_desc>Why fully exit fullscreen when an element is removed?</short_desc>
          <delta_ts>2014-07-28 13:18:46 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>Fullscreen</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philip Jägenstedt">philipj</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>cpearce</cc>
    
    <cc>mike</cc>
    
    <cc>philipj</cc>
    
    <cc>public-webapps</cc>
    
    <cc>roc</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>108903</commentid>
    <comment_count>0</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2014-07-14 09:27:35 +0000</bug_when>
    <thetext>http://fullscreen.spec.whatwg.org/#model

[[
If an element at the top of a fullscreen element stack is removed from a document, fully exit fullscreen.
]]

AFAICT, this is the only way that &quot;fully exit fullscreen&quot; is exposed to scripts. This allows an iframe embedded in a presentation to exit fullscreen for the presentation itself, which seems bad even if rather harmless.

Why not just exit fullscreen on the document from which the element was removed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108910</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-07-14 14:35:48 +0000</bug_when>
    <thetext>I think the user experience was found too confusing in the alternative scenario.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108911</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-07-14 14:37:03 +0000</bug_when>
    <thetext>I guess an alternative model would be to switch the fullscreen element from the one that is removed to its parent or some such. Might still be confusing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108912</commentid>
    <comment_count>3</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2014-07-14 15:12:29 +0000</bug_when>
    <thetext>(In reply to Anne from comment #2)
&gt; I guess an alternative model would be to switch the fullscreen element from
&gt; the one that is removed to its parent or some such. Might still be confusing.

Wouldn&apos;t calling exitFullscreen() do just that? It deals with the case where an element other than the top one has been removed, after all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108933</commentid>
    <comment_count>4</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2014-07-15 07:10:00 +0000</bug_when>
    <thetext>Oh, I missed this bit: &quot;HTML invokes the fully exit fullscreen algorithm for navigation.&quot; Scripts should be able to trigger that as well.

I filed this bug because it looked like an oversight, but if it&apos;s already been discussed I&apos;m OK with WONTFIXing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108936</commentid>
    <comment_count>5</comment_count>
    <who name="Chris Pearce">cpearce</who>
    <bug_when>2014-07-15 10:21:26 +0000</bug_when>
    <thetext>(In reply to Philip Jägenstedt from comment #0)
&gt; AFAICT, this is the only way that &quot;fully exit fullscreen&quot; is exposed to
&gt; scripts. 

FWIW, our fullscreen implementation allows script to exit fullscreen by calling document.exitFullscreen(). The justifcation being that script can exit fullscreen by removing the fullscreen element from the document anyway.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108937</commentid>
    <comment_count>6</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2014-07-15 12:22:51 +0000</bug_when>
    <thetext>(In reply to Chris Pearce from comment #5)
&gt; (In reply to Philip Jägenstedt from comment #0)
&gt; &gt; AFAICT, this is the only way that &quot;fully exit fullscreen&quot; is exposed to
&gt; &gt; scripts. 
&gt; 
&gt; FWIW, our fullscreen implementation allows script to exit fullscreen by
&gt; calling document.exitFullscreen(). The justifcation being that script can
&gt; exit fullscreen by removing the fullscreen element from the document anyway.

AFAICT, Document.mozCancelFullScreen() is the only API you have exposed and it seems to &quot;exit fullscreen&quot;, not &quot;fully exit fullscreen&quot;:
https://github.com/mozilla/gecko-dev/blob/355c7ec07cbe527decbb82d7045f6a39cafdb50c/content/base/src/nsDocument.cpp#L10374</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109340</commentid>
    <comment_count>7</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-07-28 08:58:22 +0000</bug_when>
    <thetext>Chris, roc, what would be best here? Should removing the element do fully exit fullscreen or just exitFullscreen() on its node document? I don&apos;t really care either way, as long as we all agree.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109342</commentid>
    <comment_count>8</comment_count>
    <who name="Robert O&apos;Callahan (Mozilla)">roc</who>
    <bug_when>2014-07-28 09:09:59 +0000</bug_when>
    <thetext>I don&apos;t care either.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109346</commentid>
    <comment_count>9</comment_count>
    <who name="Chris Pearce">cpearce</who>
    <bug_when>2014-07-28 09:20:17 +0000</bug_when>
    <thetext>(In reply to Philip Jägenstedt from comment #6)
&gt; AFAICT, Document.mozCancelFullScreen() is the only API you have exposed and
&gt; it seems to &quot;exit fullscreen&quot;, not &quot;fully exit fullscreen&quot;

Correct. But script can still &quot;fully exit fullscreen&quot; by removing the fullscreen element from the document.

(In reply to Anne from comment #7)
&gt; Chris, roc, what would be best here? Should removing the element do fully
&gt; exit fullscreen or just exitFullscreen() on its node document? I don&apos;t
&gt; really care either way, as long as we all agree.

I don&apos;t feel particularly strongly.

The only argument I can think of is I could imagine a kiosk or some-such running in fullscreen mode with child iframes would not want script in the child iframes to be able to break the top-level browser out of fullscreen mode. So perhaps removing the fullscreen element should just exit fullscreen in the document where the removed element resided.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109358</commentid>
    <comment_count>10</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-07-28 13:18:46 +0000</bug_when>
    <thetext>https://github.com/whatwg/fullscreen/commit/3b2ad1f028b3fc8d69766180fcb0965567d70450</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>