<?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>26626</bug_id>
          
          <creation_ts>2014-08-21 09:01:11 +0000</creation_ts>
          <short_desc>Populate the full list of event targets before firing any events</short_desc>
          <delta_ts>2014-08-26 12:59:48 +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>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>110389</commentid>
    <comment_count>0</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2014-08-21 09:01:11 +0000</bug_when>
    <thetext>http://fullscreen.spec.whatwg.org/#dom-document-exitfullscreen

9.6. If exitDocs&apos;s last document has a browsing context container, let topDoc be that browsing context container&apos;s node document, and then remove the top element from topDoc&apos;s fullscreen element stack and fire an event named fullscreenchange on topDoc.

The event handlers already fired in these steps can have moved the iframe element of exitDocs&apos;s last document, so that the fullscreenchange event ends up firing on a document other than the document that the iframe went fullscreen in.

It looks like moving part of step 9.6 to 9.3 and letting step 9.5 fire all of the events should fix this.

It would also be nice if step 9.4 were also more explicit about first creating a list of documents and then firing events.

For requestFullscreen(), bug 26601 should solve the problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110391</commentid>
    <comment_count>1</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2014-08-21 09:22:07 +0000</bug_when>
    <thetext>(In reply to Philip Jägenstedt from comment #0)
&gt; It would also be nice if step 9.4 were also more explicit about first
&gt; creating a list of documents and then firing events.

This bit looks like it shouldn&apos;t matter much because event handlers can&apos;t synchronously modify the fullscreen element stack, but they can change the tree order of the documents.

(Test cases for this will be fun.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110589</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-08-26 09:32:27 +0000</bug_when>
    <thetext>https://github.com/whatwg/fullscreen/commit/d24852303d039fc227edf1b871259120d0c56ec3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110598</commentid>
    <comment_count>3</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2014-08-26 12:59:48 +0000</bug_when>
    <thetext>LGTM and some follow-up:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=26672
https://www.w3.org/Bugs/Public/show_bug.cgi?id=26673</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>