<?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>136548</bug_id>
          
          <creation_ts>2014-09-04 14:38:56 -0700</creation_ts>
          <short_desc>Clicking on a select element should never hide the popup menu.</short_desc>
          <delta_ts>2014-09-04 16:40:02 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Forms</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</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="Roger Fong">roger_fong</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>jonlee</cc>
    
    <cc>roger_fong</cc>
    
    <cc>sam</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>thorton</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1033311</commentid>
    <comment_count>0</comment_count>
    <who name="Roger Fong">roger_fong</who>
    <bug_when>2014-09-04 14:38:56 -0700</bug_when>
    <thetext>You can never click on a select element to close the popup associated popup menu.
The popup menu is only closed by either clicking on the popup menu or by clicking elsewhere to no longer focus on the popup menu.

This becomes an issue when you double click on a popup menu while you are not focused on the app containing the popup menu.
The select element thinks there are two clicks back to back on the select element, which normally should never be able to happen.

Details:
This back to back click results in the popup menu being visible but also the popup menu proxy being invalidated. Note that the popup menu does not disappear, it remains visible (which is the desired behavior). This happens because at the time of the second click the popup menu has not been actually been created yet, so there&apos;s nothing to dismiss.

As a result when we actually close the popup we do not set the visible flag to false because the PopupMenuProxy is invalidated.
Then when we try to open up the popup again, nothing happens (no popup appears) because we think that the popup is already visible.

The fix here is to make sure we do not try to invalidate the popup menu at the wrong time. In this case, the wrong time is when you&apos;re clicking on the select element itself. We should never attempt to hide the popup menu as a result of clicking on the select element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1033315</commentid>
    <comment_count>1</comment_count>
      <attachid>237649</attachid>
    <who name="Roger Fong">roger_fong</who>
    <bug_when>2014-09-04 14:49:48 -0700</bug_when>
    <thetext>Created attachment 237649
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1033345</commentid>
    <comment_count>2</comment_count>
      <attachid>237649</attachid>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2014-09-04 16:24:24 -0700</bug_when>
    <thetext>Comment on attachment 237649
patch

Can we make a test for this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1033350</commentid>
    <comment_count>3</comment_count>
    <who name="Roger Fong">roger_fong</who>
    <bug_when>2014-09-04 16:40:02 -0700</bug_when>
    <thetext>Committed: http://trac.webkit.org/changeset/173289

Discussed test with smfr in person and determined that it wasn&apos;t feasible since the test infrastructure doesn&apos;t allow tests that involves switching to and from more than one window.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>237649</attachid>
            <date>2014-09-04 14:49:48 -0700</date>
            <delta_ts>2014-09-04 16:24:24 -0700</delta_ts>
            <desc>patch</desc>
            <filename>patch.patch</filename>
            <type>text/plain</type>
            <size>2298</size>
            <attacher name="Roger Fong">roger_fong</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09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gICAgICAgICAg
IC8vIHRoZSBtZW51LgotICAgICAgICAgICAgICAgIHNhdmVMYXN0U2VsZWN0aW9uKCk7Ci0gICAg
ICAgICAgICAgICAgICAgIG1lbnVMaXN0LnNob3dQb3B1cCgpOwotICAgICAgICAgICAgfQorICAg
ICAgICAgICAgQVNTRVJUKCFtZW51TGlzdC5wb3B1cElzVmlzaWJsZSgpKTsKKyAgICAgICAgICAg
IC8vIFNhdmUgdGhlIHNlbGVjdGlvbiBzbyBpdCBjYW4gYmUgY29tcGFyZWQgdG8gdGhlIG5ldwor
ICAgICAgICAgICAgLy8gc2VsZWN0aW9uIHdoZW4gd2UgY2FsbCBvbkNoYW5nZSBkdXJpbmcgc2Vs
ZWN0T3B0aW9uLAorICAgICAgICAgICAgLy8gd2hpY2ggZ2V0cyBjYWxsZWQgZnJvbSBSZW5kZXJN
ZW51TGlzdDo6dmFsdWVDaGFuZ2VkLAorICAgICAgICAgICAgLy8gd2hpY2ggZ2V0cyBjYWxsZWQg
YWZ0ZXIgdGhlIHVzZXIgbWFrZXMgYSBzZWxlY3Rpb24gZnJvbQorICAgICAgICAgICAgLy8gdGhl
IG1lbnUuCisgICAgICAgICAgICBzYXZlTGFzdFNlbGVjdGlvbigpOworICAgICAgICAgICAgbWVu
dUxpc3Quc2hvd1BvcHVwKCk7CiAgICAgICAgIH0KICNlbmRpZgogICAgICAgICBldmVudC0+c2V0
RGVmYXVsdEhhbmRsZWQoKTsK
</data>
<flag name="review"
          id="262384"
          type_id="1"
          status="+"
          setter="simon.fraser"
    />
          </attachment>
      

    </bug>

</bugzilla>