[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

andersca at apple.com andersca at apple.com
Fri Jan 21 14:36:31 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit d1e80a847bd19dd00f58923d50ed41a64cf47d8a
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 23 02:53:44 2010 +0000

    2010-12-22  Anders Carlsson  <andersca at apple.com>
    
            Reviewed by Sam Weinig.
    
            REGRESSION (WK2): Plugins swallow CMD-W, CMD-Q, and probably other shortcuts
            https://bugs.webkit.org/show_bug.cgi?id=51515
            <rdar://problem/8740926>
    
            Always return false for keyboard events where the command key is down.
    
            * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
            (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74530 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 348b399..12bd454 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-22  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        REGRESSION (WK2): Plugins swallow CMD-W, CMD-Q, and probably other shortcuts
+        https://bugs.webkit.org/show_bug.cgi?id=51515
+        <rdar://problem/8740926>
+
+        Always return false for keyboard events where the command key is down.
+
+        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
+        (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
+
 2010-12-22  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Darin Adler.
diff --git a/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm b/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
index 872cb4d..1240ed7 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
+++ b/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
@@ -639,10 +639,13 @@ static NPCocoaEvent initializeKeyboardEvent(const WebKeyboardEvent& keyboardEven
 
 bool NetscapePlugin::platformHandleKeyboardEvent(const WebKeyboardEvent& keyboardEvent)
 {
+    bool handled = false;
+
     switch (m_eventModel) {
     case NPEventModelCocoa: {
         NPCocoaEvent event = initializeKeyboardEvent(keyboardEvent);
-        return NPP_HandleEvent(&event);
+        handled = NPP_HandleEvent(&event);
+        break;
     }
 
 #ifndef NP_NO_CARBON
@@ -663,7 +666,8 @@ bool NetscapePlugin::platformHandleKeyboardEvent(const WebKeyboardEvent& keyboar
         EventRecord event = initializeEventRecord(eventKind);
         event.modifiers = modifiersForEvent(keyboardEvent);
         event.message = keyboardEvent.nativeVirtualKeyCode() << 8 | keyboardEvent.macCharCode();
-        return NPP_HandleEvent(&event);
+        handled = NPP_HandleEvent(&event);
+        break;
     }
 #endif
 
@@ -671,7 +675,13 @@ bool NetscapePlugin::platformHandleKeyboardEvent(const WebKeyboardEvent& keyboar
         ASSERT_NOT_REACHED();
     }
 
-    return false;
+    // Most plug-ins simply return true for all keyboard events, even those that aren't handled.
+    // This leads to bugs such as <rdar://problem/8740926>. We work around this by returning false
+    // if the keyboard event has the command modifier pressed.
+    if (keyboardEvent.metaKey())
+        return false;
+
+    return handled;
 }
 
 void NetscapePlugin::platformSetFocus(bool hasFocus)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list