Bug 70534

Summary: REGRESSION (r96823): Contextual menu closes immediately when control-clicking in Flash plug-in
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: Plug-insAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit.review.bot
Priority: P1 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed fix
darin: review+, webkit-ews: commit-queue-
patch for landing
webkit-ews: commit-queue-
patch for landing none

Description Alexey Proskuryakov 2011-10-20 12:13:27 PDT
This part:
+        * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::defaultEventHandler): Call base
+        class default event handler, so that events on focused plug-in elements would fall through
+        to EventHandler::defaultKeyboardEventHandler.

Plug-ins show their context menus from regular mouse event handlers, because they don't get a separate event for context menu. Additionally, browsers dispatch contextmenu event regardless of whether mousedown had a preventDefault, so after Flash shows its context menu, WebKit tries to show its own, causing trouble.

The solution is to add a contextmenu event handler to plugins. Such a handler could display a menu itself, return false for default WebKit menu to be displayed, or just return true meaning that it has no idea about what the plug-in did, as it's the case with NPAPI plug-ins.

<rdar://problem/10308827>
Comment 1 Alexey Proskuryakov 2011-10-20 12:19:58 PDT
Created attachment 111825 [details]
proposed fix
Comment 2 Early Warning System Bot 2011-10-20 12:47:57 PDT
Comment on attachment 111825 [details]
proposed fix

Attachment 111825 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/10178525
Comment 3 Alexey Proskuryakov 2011-10-20 13:02:06 PDT
Created attachment 111829 [details]
patch for landing
Comment 4 Early Warning System Bot 2011-10-20 13:16:18 PDT
Comment on attachment 111829 [details]
patch for landing

Attachment 111829 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/10177578
Comment 5 Alexey Proskuryakov 2011-10-20 13:58:17 PDT
Created attachment 111844 [details]
patch for landing

D'oh!
Comment 6 WebKit Review Bot 2011-10-20 15:24:31 PDT
Comment on attachment 111844 [details]
patch for landing

Clearing flags on attachment: 111844

Committed r98027: <http://trac.webkit.org/changeset/98027>
Comment 7 WebKit Review Bot 2011-10-20 15:24:36 PDT
All reviewed patches have been landed.  Closing bug.