Bug 136548

Summary: Clicking on a select element should never hide the popup menu.
Product: WebKit Reporter: Roger Fong <roger_fong>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, jonlee, roger_fong, sam, simon.fraser, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch simon.fraser: review+

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.