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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>125272</bug_id>
          
          <creation_ts>2013-12-04 17:58:16 -0800</creation_ts>
          <short_desc>[Win] Exiting from Media Full Screen mode via &apos;escape&apos; key does not work properly</short_desc>
          <delta_ts>2013-12-05 12:12:06 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</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="Brent Fulgham">bfulgham</reporter>
          <assigned_to name="Brent Fulgham">bfulgham</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>jer.noble</cc>
    
    <cc>jonlee</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>956722</commentid>
    <comment_count>0</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2013-12-04 17:58:16 -0800</bug_when>
    <thetext>If you enter full screen video mode, and then exit using the &quot;Escape&quot; key, WebKit will not re-enter fullscreen mode. If you use the media control to enter/exit fullscreen mode, everything works properly.

This bug is caused by improper cleanup of the Document::m_fullScreenElementStack member:

When logic passes through the JavaScript layer, it pops the most recent full screen element off of the stack because it calls Document::webkitExitFullscreen(), which pops the element before calling the client&apos;s exitFullScreenForElement.

The &apos;escape&apos; key handler in Windows calls Document::webkitWillExitFullScreenForElement(Element*), which bypasses the pop operation and leaves the element on the stack.  Subsequent calls to enter full screen mode fail because WebCore believes a full screen controller is already in place.

The proposed solution is to modify the WebKit/win/WebView implementation to use &quot;webkitExitFullscreen&quot; rather than &quot;webkitWillExitFullScreenForElement&quot; to more closely match that logic of the media control interface.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>956926</commentid>
    <comment_count>1</comment_count>
      <attachid>218520</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2013-12-05 09:15:31 -0800</bug_when>
    <thetext>Created attachment 218520
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>956951</commentid>
    <comment_count>2</comment_count>
      <attachid>218520</attachid>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2013-12-05 10:19:03 -0800</bug_when>
    <thetext>Comment on attachment 218520
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=218520&amp;action=review

r=me, with nit.

&gt; Source/WebKit/win/WebView.cpp:6958
&gt; -    m_fullScreenElement-&gt;document().webkitWillExitFullScreenForElement(m_fullScreenElement.get());
&gt; +    m_fullScreenElement-&gt;document().webkitExitFullscreen();

This should probably use webkitCancelFullScreen(), which will pop the entire full screen element stack.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>956997</commentid>
    <comment_count>3</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2013-12-05 12:12:06 -0800</bug_when>
    <thetext>Committed r160184: &lt;http://trac.webkit.org/changeset/160184&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>218520</attachid>
            <date>2013-12-05 09:15:31 -0800</date>
            <delta_ts>2013-12-05 10:19:02 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-125272-20131205091530.patch</filename>
            <type>text/plain</type>
            <size>1362</size>
            <attacher name="Brent Fulgham">bfulgham</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJ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JWaWV3LmNwcAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2ViS2l0L3dp
bi9XZWJWaWV3LmNwcAkocmV2aXNpb24gMTYwMTUwKQorKysgU291cmNlL1dlYktpdC93aW4vV2Vi
Vmlldy5jcHAJKHdvcmtpbmcgY29weSkKQEAgLTY5NTUsNyArNjk1NSw3IEBAIHZvaWQgV2ViVmll
dzo6ZnVsbFNjcmVlbkNsaWVudERpZEVudGVyRnUKIHZvaWQgV2ViVmlldzo6ZnVsbFNjcmVlbkNs
aWVudFdpbGxFeGl0RnVsbFNjcmVlbigpCiB7CiAgICAgQVNTRVJUKG1fZnVsbFNjcmVlbkVsZW1l
bnQpOwotICAgIG1fZnVsbFNjcmVlbkVsZW1lbnQtPmRvY3VtZW50KCkud2Via2l0V2lsbEV4aXRG
dWxsU2NyZWVuRm9yRWxlbWVudChtX2Z1bGxTY3JlZW5FbGVtZW50LmdldCgpKTsKKyAgICBtX2Z1
bGxTY3JlZW5FbGVtZW50LT5kb2N1bWVudCgpLndlYmtpdEV4aXRGdWxsc2NyZWVuKCk7CiB9CiAK
IHZvaWQgV2ViVmlldzo6ZnVsbFNjcmVlbkNsaWVudERpZEV4aXRGdWxsU2NyZWVuKCkK
</data>
<flag name="review"
          id="241971"
          type_id="1"
          status="+"
          setter="jer.noble"
    />
          </attachment>
      

    </bug>

</bugzilla>