[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:51:59 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit a5e9f661a26af1a40f7a542215af0e4d5d85bc4a
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jul 20 23:32:08 2004 +0000

    WebCore:
    
            Reviewed by Richard
    
            * khtml/xml/dom_elementimpl.cpp:
            (ElementImpl::defaultEventHandler): No longer check whether
            the command key is modifying the key event. This check is
            now done elsewhere in the code. See the WebKit checkin that
            added the _web_keyBindingManagerHasBinding method to
            WebNSEventExtras.
    
    WebKit:
    
            Reviewed by Richard
    
            * Misc.subproj/WebNSEventExtras.h: Added helper that returns whether
            a key event has a binding in the key binding manager.
            * Misc.subproj/WebNSEventExtras.m:
            (-[NSEvent _web_keyBindingManagerHasBinding]): New helper mentioned above.
            * Plugins.subproj/npruntime.h:
            * WebView.subproj/WebHTMLView.m:
            (-[WebHTMLView performKeyEquivalent:]): Add a check of whether the key event
            has a binding in the key binding manager. This works around the fact that
            NSResponder's interpretKeyEvents does not return a value telling whether
            or not the key was handled. This now makes it possible for us to trap
            modified key events we know we can handle (like those command-key + arrow events
            used for text navigation), while letting all others pass.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7077 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index e325879..c0c0360 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,14 @@
+2004-07-20  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by Richard
+
+        * khtml/xml/dom_elementimpl.cpp:
+        (ElementImpl::defaultEventHandler): No longer check whether
+        the command key is modifying the key event. This check is
+        now done elsewhere in the code. See the WebKit checkin that
+        added the _web_keyBindingManagerHasBinding method to 
+        WebNSEventExtras.
+
 2004-07-20  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed:
diff --git a/WebCore/khtml/xml/dom_elementimpl.cpp b/WebCore/khtml/xml/dom_elementimpl.cpp
index 1521287..359ccfa 100644
--- a/WebCore/khtml/xml/dom_elementimpl.cpp
+++ b/WebCore/khtml/xml/dom_elementimpl.cpp
@@ -378,8 +378,7 @@ void ElementImpl::defaultEventHandler(EventImpl *evt)
 #if APPLE_CHANGES
     if (evt->id() == EventImpl::KEYPRESS_EVENT && isContentEditable()) {
         KHTMLPart *part = getDocument()->part();
-        // Don't treat command-key combos as editing key events
-        if (part && !static_cast<KeyboardEventImpl*>(evt)->metaKey() && KWQ(part)->interceptEditingKeyEvent())
+        if (part && KWQ(part)->interceptEditingKeyEvent())
             evt->setDefaultHandled();
     }
 #endif
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 54e3d7a..a0b18b5 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,20 @@
+2004-07-20  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by Richard
+
+        * Misc.subproj/WebNSEventExtras.h: Added helper that returns whether
+        a key event has a binding in the key binding manager.
+        * Misc.subproj/WebNSEventExtras.m: 
+        (-[NSEvent _web_keyBindingManagerHasBinding]): New helper mentioned above.
+        * Plugins.subproj/npruntime.h:
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView performKeyEquivalent:]): Add a check of whether the key event 
+        has a binding in the key binding manager. This works around the fact that
+        NSResponder's interpretKeyEvents does not return a value telling whether
+        or not the key was handled. This now makes it possible for us to trap
+        modified key events we know we can handle (like those command-key + arrow events 
+        used for text navigation), while letting all others pass.
+
 2004-07-20  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed:
diff --git a/WebKit/Misc.subproj/WebNSEventExtras.h b/WebKit/Misc.subproj/WebNSEventExtras.h
index 600d534..b90cb61 100644
--- a/WebKit/Misc.subproj/WebNSEventExtras.h
+++ b/WebKit/Misc.subproj/WebNSEventExtras.h
@@ -15,4 +15,6 @@
 -(BOOL)_web_isReturnOrEnterKeyEvent;
 -(BOOL)_web_isTabKeyEvent;
 
+- (BOOL)_web_keyBindingManagerHasBinding;
+
 @end
diff --git a/WebKit/Misc.subproj/WebNSEventExtras.m b/WebKit/Misc.subproj/WebNSEventExtras.m
index f9c0881..2743dfe 100644
--- a/WebKit/Misc.subproj/WebNSEventExtras.m
+++ b/WebKit/Misc.subproj/WebNSEventExtras.m
@@ -5,6 +5,8 @@
 
 #import <WebKit/WebNSEventExtras.h>
 
+#import <AppKit/NSKeyBindingManager.h>
+
 @implementation NSEvent (WebExtras)
 
 -(BOOL)_web_isKeyEvent:(unichar)key
@@ -56,4 +58,10 @@
     return [self _web_isKeyEvent:tabKey] || [self _web_isKeyEvent:shiftTabKey];
 }
 
+- (BOOL)_web_keyBindingManagerHasBinding
+{
+    NSDictionary *keyBindings = [[NSKeyBindingManager sharedKeyBindingManager] dictionary];
+    return [keyBindings objectForKey:[self characters]] != nil;
+}
+
 @end
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 8d7509d..e182269 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -2271,15 +2271,12 @@ static WebHTMLView *lastHitView = nil;
 
 - (BOOL)performKeyEquivalent:(NSEvent *)event
 {
-    // Pass command-key combos through WebCore so Command-return on an active link is treated
-    // as a modified activation rather than ignored. Note that this means web pages have a crack 
-    // at intercepting command-modified keypresses now. If this turns out to cause havoc we
-    // can restrict this to only send the event through WebCore if it contains the Return or
-    // Enter key.
-    if ([self firstResponderIsSelfOrDescendantView] && [[self _bridge] interceptKeyEvent:event toView:self]) {
+    // Pass command-key combos through WebCore if there is a key binding available for
+    // this event. This lets web pages have a crack at intercepting command-modified keypresses.
+    if ([self firstResponderIsSelfOrDescendantView] && [event _web_keyBindingManagerHasBinding]) {
+        [[self _bridge] interceptKeyEvent:event toView:self];
         return YES;
     }
-
     return [super performKeyEquivalent:event];
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list