Bug 136548 - Clicking on a select element should never hide the popup menu.
Summary: Clicking on a select element should never hide the popup menu.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-04 14:38 PDT by Roger Fong
Modified: 2014-09-04 16:40 PDT (History)
6 users (show)

See Also:


Attachments
patch (2.24 KB, patch)
2014-09-04 14:49 PDT, Roger Fong
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roger Fong 2014-09-04 14:38:56 PDT
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'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'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.
Comment 1 Roger Fong 2014-09-04 14:49:48 PDT
Created attachment 237649 [details]
patch
Comment 2 Simon Fraser (smfr) 2014-09-04 16:24:24 PDT
Comment on attachment 237649 [details]
patch

Can we make a test for this?
Comment 3 Roger Fong 2014-09-04 16:40:02 PDT
Committed: http://trac.webkit.org/changeset/173289

Discussed test with smfr in person and determined that it wasn't feasible since the test infrastructure doesn't allow tests that involves switching to and from more than one window.