<?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>23363</bug_id>
          
          <creation_ts>2013-09-26 09:27:37 +0000</creation_ts>
          <short_desc>requestFullscreen and dialog.showModal interaction</short_desc>
          <delta_ts>2013-11-07 13:58:07 +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="Matt Falkenhagen">falken</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>ian</cc>
    
    <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>93865</commentid>
    <comment_count>0</comment_count>
    <who name="Matt Falkenhagen">falken</who>
    <bug_when>2013-09-26 09:27:37 +0000</bug_when>
    <thetext>What should the top layer be in the following case?
dialog1.showModal();
dialog2.showModal();
dialog1.requestFullscreen();

I think dialog2 should be on top. This currently looks under spec&apos;d though. showModal and requestFullscreen each require adding to the top of the top layer.

A related case is:
dialog1.requestFullscreen();
dialog2.showModal();
dialog1.showModal();

Maybe requestFullscreen should skip adding to top layer if it&apos;s already in the top layer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93873</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-09-26 12:58:25 +0000</bug_when>
    <thetext>It seems more like you want a different behavior from the specification? How is this not defined? If we want a change, an email to the WHATWG list outlining it including a pointer to this bug would be good.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93877</commentid>
    <comment_count>2</comment_count>
    <who name="Matt Falkenhagen">falken</who>
    <bug_when>2013-09-26 13:19:35 +0000</bug_when>
    <thetext>I guess what&apos;s not defined is what &quot;add an element to the top layer&quot; means when it&apos;s already in the top layer. Is it moved to the top of the top layer, remain where it is, or do you have two copies in the top layer?

For example, the HTML spec says:
&quot;When an element is added to the pending dialog stack, it must also be added to the top layer layer.&quot;

And requestFullscreen says:
&quot;add context object on document&apos;s fullscreen element stack&quot;, which leads to:
&quot;To add an element on a document&apos;s fullscreen element stack, add it on top of document&apos;s browsing context&apos;s top layer[...]&quot;

In these cases, what do you do if it&apos;s already in the top layer?

Maybe I&apos;m just reading too much into the word &quot;add&quot;... is the behavior actually well-defined here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93980</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-09-27 19:51:22 +0000</bug_when>
    <thetext>I guess we should clarify the top layer stack is an ordered set, semantically. Meaning that if the element is already in, it would just move around within the set. However, as you say in comment 0 we could make it not do that too. Not sure what is better.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95607</commentid>
    <comment_count>4</comment_count>
    <who name="Matt Falkenhagen">falken</who>
    <bug_when>2013-10-31 13:46:25 +0000</bug_when>
    <thetext>The ordered set behavior sounds OK to me, and thanks for clarifying. In comment 0 I&apos;d forgotten that requestFullscreen terminates if it&apos;s &quot;not allowed to show a popup&quot;, which basically means the user has to click something in the active modal dialog for something to go fullscreen over it. I was worried something would inadvertently go on top of the active modal dialog, and the user wouldn&apos;t be able to exit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95944</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-11-07 13:58:07 +0000</bug_when>
    <thetext>Thanks Matt!

https://github.com/whatwg/fullscreen/commit/5664c8789bd31c1847220fea86da49966dcaf72f</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>