Title: [98170] branches/safari-534.52-branch/Source

Diff

Modified: branches/safari-534.52-branch/Source/WebCore/ChangeLog (98169 => 98170)


--- branches/safari-534.52-branch/Source/WebCore/ChangeLog	2011-10-21 23:53:56 UTC (rev 98169)
+++ branches/safari-534.52-branch/Source/WebCore/ChangeLog	2011-10-21 23:54:04 UTC (rev 98170)
@@ -1,5 +1,21 @@
 2011-10-21  Lucas Forschler  <lforsch...@apple.com>
 
+    Merge 98027
+
+    2011-10-20  Alexey Proskuryakov  <a...@apple.com>
+
+            REGRESSION (r96823): Contextual menu closes immediately when control-clicking in Flash plug-in
+            https://bugs.webkit.org/show_bug.cgi?id=70534
+            <rdar://problem/10308827>
+
+            Reviewed by Darin Adler.
+
+            * plugins/PluginView.cpp: (WebCore::PluginView::handleEvent): Return true for contextmenu
+            event, so that plug-ins won't get a default WebKit context menu. We can't know if the
+            plug-in is handling mousedown (or even mouseup) by displaying a menu.
+
+2011-10-21  Lucas Forschler  <lforsch...@apple.com>
+
     Merge 97810 & 97813
     
     2011-10-18  Sam Weinig  <s...@webkit.org> 

Modified: branches/safari-534.52-branch/Source/WebCore/plugins/PluginView.cpp (98169 => 98170)


--- branches/safari-534.52-branch/Source/WebCore/plugins/PluginView.cpp	2011-10-21 23:53:56 UTC (rev 98169)
+++ branches/safari-534.52-branch/Source/WebCore/plugins/PluginView.cpp	2011-10-21 23:54:04 UTC (rev 98170)
@@ -170,6 +170,8 @@
         handleMouseEvent(static_cast<MouseEvent*>(event));
     else if (event->isKeyboardEvent())
         handleKeyboardEvent(static_cast<KeyboardEvent*>(event));
+    else if (event->type() == eventNames().contextmenuEvent)
+        event->setDefaultHandled(); // We don't know if the plug-in has handled mousedown event by displaying a context menu, so we never want WebKit to show a default one.
 #if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
     else if (event->type() == eventNames().focusoutEvent)
         handleFocusOutEvent();

Modified: branches/safari-534.52-branch/Source/WebKit/mac/ChangeLog (98169 => 98170)


--- branches/safari-534.52-branch/Source/WebKit/mac/ChangeLog	2011-10-21 23:53:56 UTC (rev 98169)
+++ branches/safari-534.52-branch/Source/WebKit/mac/ChangeLog	2011-10-21 23:54:04 UTC (rev 98170)
@@ -1,3 +1,19 @@
+2011-10-21  Lucas Forschler  <lforsch...@apple.com>
+
+    Merge 98027
+
+    2011-10-20  Alexey Proskuryakov  <a...@apple.com>
+
+            REGRESSION (r96823): Contextual menu closes immediately when control-clicking in Flash plug-in
+            https://bugs.webkit.org/show_bug.cgi?id=70534
+            <rdar://problem/10308827>
+
+            Reviewed by Darin Adler.
+
+            * WebCoreSupport/WebFrameLoaderClient.mm: (NetscapePluginWidget::handleEvent): Return true
+            for contextmenu event, so that plug-ins won't get a default WebKit context menu. We can't
+            know if the plug-in is handling mousedown (or even mouseup) by displaying a menu.
+
 2011-08-11  Lucas Forschler  <lforsch...@apple.com>
 
     Merged 91097

Modified: branches/safari-534.52-branch/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm (98169 => 98170)


--- branches/safari-534.52-branch/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm	2011-10-21 23:53:56 UTC (rev 98169)
+++ branches/safari-534.52-branch/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm	2011-10-21 23:54:04 UTC (rev 98170)
@@ -1630,6 +1630,8 @@
             [(WebBaseNetscapePluginView *)platformWidget() handleMouseEntered:currentNSEvent];
         else if (event->type() == eventNames().mouseoutEvent)
             [(WebBaseNetscapePluginView *)platformWidget() handleMouseExited:currentNSEvent];
+        else if (event->type() == eventNames().contextmenuEvent)
+            event->setDefaultHandled(); // We don't know if the plug-in has handled mousedown event by displaying a context menu, so we never want WebKit to show a default one.
     }
 
 private:

Modified: branches/safari-534.52-branch/Source/WebKit2/ChangeLog (98169 => 98170)


--- branches/safari-534.52-branch/Source/WebKit2/ChangeLog	2011-10-21 23:53:56 UTC (rev 98169)
+++ branches/safari-534.52-branch/Source/WebKit2/ChangeLog	2011-10-21 23:54:04 UTC (rev 98170)
@@ -1,5 +1,31 @@
 2011-10-21  Lucas Forschler  <lforsch...@apple.com>
 
+    Merge 98027
+
+    2011-10-20  Alexey Proskuryakov  <a...@apple.com>
+
+            REGRESSION (r96823): Contextual menu closes immediately when control-clicking in Flash plug-in
+            https://bugs.webkit.org/show_bug.cgi?id=70534
+            <rdar://problem/10308827>
+
+            Reviewed by Darin Adler.
+
+            * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::handleContextMenuEvent):
+            * WebProcess/Plugins/Netscape/NetscapePlugin.h:
+            * WebProcess/Plugins/Plugin.h:
+            * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::handleContextMenuEvent):
+            * WebProcess/Plugins/PluginProxy.h:
+            * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::handleEvent):
+            Return true when handling contextmenu event, so that plug-ins won't get a default WebKit
+            context menu. We can't know if the plug-in is handling mousedown (or even mouseup) by
+            displaying a menu.
+
+            * WebProcess/Plugins/PDF/BuiltInPDFView.h:
+            * WebProcess/Plugins/PDF/BuiltInPDFView.cpp: (WebKit::BuiltInPDFView::handleContextMenuEvent):
+            PDF is the only "plug-in" that wants default WebKit menu now.
+
+2011-10-21  Lucas Forschler  <lforsch...@apple.com>
+
     Merge 97810
 
     2011-10-18  Alexey Proskuryakov  <a...@apple.com>

Modified: branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp (98169 => 98170)


--- branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp	2011-10-21 23:53:56 UTC (rev 98169)
+++ branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp	2011-10-21 23:54:04 UTC (rev 98170)
@@ -721,6 +721,12 @@
     return platformHandleMouseLeaveEvent(mouseEvent);
 }
 
+bool NetscapePlugin::handleContextMenuEvent(const WebMouseEvent&)
+{
+    // We don't know if the plug-in has handled mousedown event by displaying a context menu, so we never want WebKit to show a default one.
+    return true;
+}
+
 bool NetscapePlugin::handleKeyboardEvent(const WebKeyboardEvent& keyboardEvent)
 {
     ASSERT(m_isStarted);

Modified: branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h (98169 => 98170)


--- branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h	2011-10-21 23:53:56 UTC (rev 98169)
+++ branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h	2011-10-21 23:54:04 UTC (rev 98170)
@@ -174,6 +174,7 @@
     virtual bool handleWheelEvent(const WebWheelEvent&);
     virtual bool handleMouseEnterEvent(const WebMouseEvent&);
     virtual bool handleMouseLeaveEvent(const WebMouseEvent&);
+    virtual bool handleContextMenuEvent(const WebMouseEvent&);
     virtual bool handleKeyboardEvent(const WebKeyboardEvent&);
     virtual void setFocus(bool);
     virtual NPObject* pluginScriptableNPObject();

Modified: branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.cpp (98169 => 98170)


--- branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.cpp	2011-10-21 23:53:56 UTC (rev 98169)
+++ branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.cpp	2011-10-21 23:54:04 UTC (rev 98170)
@@ -483,6 +483,12 @@
     return false;
 }
 
+bool BuiltInPDFView::handleContextMenuEvent(const WebMouseEvent&)
+{
+    // Use default WebKit context menu.
+    return false;
+}
+
 bool BuiltInPDFView::handleKeyboardEvent(const WebKeyboardEvent&)
 {
     return false;

Modified: branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h (98169 => 98170)


--- branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h	2011-10-21 23:53:56 UTC (rev 98169)
+++ branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h	2011-10-21 23:54:04 UTC (rev 98170)
@@ -96,6 +96,7 @@
     virtual bool handleWheelEvent(const WebWheelEvent&);
     virtual bool handleMouseEnterEvent(const WebMouseEvent&);
     virtual bool handleMouseLeaveEvent(const WebMouseEvent&);
+    virtual bool handleContextMenuEvent(const WebMouseEvent&);
     virtual bool handleKeyboardEvent(const WebKeyboardEvent&);
     virtual void setFocus(bool);
     virtual NPObject* pluginScriptableNPObject();

Modified: branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/Plugin.h (98169 => 98170)


--- branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/Plugin.h	2011-10-21 23:53:56 UTC (rev 98169)
+++ branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/Plugin.h	2011-10-21 23:54:04 UTC (rev 98170)
@@ -154,6 +154,9 @@
     // Tells the plug-in to handle the passed in mouse leave event. The plug-in should return true if it processed the event.
     virtual bool handleMouseLeaveEvent(const WebMouseEvent&) = 0;
 
+    // Tells the plug-in to handle the passed in context menu event. The plug-in should return true if it processed the event.
+    virtual bool handleContextMenuEvent(const WebMouseEvent&) = 0;
+
     // Tells the plug-in to handle the passed in keyboard event. The plug-in should return true if it processed the event.
     virtual bool handleKeyboardEvent(const WebKeyboardEvent&) = 0;
     

Modified: branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp (98169 => 98170)


--- branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp	2011-10-21 23:53:56 UTC (rev 98169)
+++ branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp	2011-10-21 23:54:04 UTC (rev 98170)
@@ -321,6 +321,12 @@
     return handled;
 }
 
+bool PluginProxy::handleContextMenuEvent(const WebMouseEvent&)
+{
+    // We don't know if the plug-in has handled mousedown event by displaying a context menu, so we never want WebKit to show a default one.
+    return true;
+}
+
 bool PluginProxy::handleKeyboardEvent(const WebKeyboardEvent& keyboardEvent)
 {
     bool handled = false;

Modified: branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/PluginProxy.h (98169 => 98170)


--- branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/PluginProxy.h	2011-10-21 23:53:56 UTC (rev 98169)
+++ branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/PluginProxy.h	2011-10-21 23:54:04 UTC (rev 98170)
@@ -89,6 +89,7 @@
     virtual bool handleWheelEvent(const WebWheelEvent&);
     virtual bool handleMouseEnterEvent(const WebMouseEvent&);
     virtual bool handleMouseLeaveEvent(const WebMouseEvent&);
+    virtual bool handleContextMenuEvent(const WebMouseEvent&);
     virtual bool handleKeyboardEvent(const WebKeyboardEvent&);
     virtual void setFocus(bool);
     virtual NPObject* pluginScriptableNPObject();

Modified: branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (98169 => 98170)


--- branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2011-10-21 23:53:56 UTC (rev 98169)
+++ branches/safari-534.52-branch/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2011-10-21 23:54:04 UTC (rev 98170)
@@ -627,6 +627,9 @@
     } else if (event->type() == eventNames().mouseoutEvent && currentEvent->type() == WebEvent::MouseMove) {
         // We have a mouse leave event.
         didHandleEvent = m_plugin->handleMouseLeaveEvent(static_cast<const WebMouseEvent&>(*currentEvent));
+    } else if (event->type() == eventNames().contextmenuEvent && currentEvent->type() == WebEvent::MouseDown) {
+        // We have a context menu event.
+        didHandleEvent = m_plugin->handleContextMenuEvent(static_cast<const WebMouseEvent&>(*currentEvent));
     } else if ((event->type() == eventNames().keydownEvent && currentEvent->type() == WebEvent::KeyDown)
                || (event->type() == eventNames().keyupEvent && currentEvent->type() == WebEvent::KeyUp)) {
         // We have a keyboard event.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to