[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:10 UTC 2009


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

            Reviewed by Richard
    
            Fix for this bug:
    
            <rdar://problem/3707504> HTMLCompose: key events are stolen by Web(HTML)View
    
            * Misc.subproj/WebNSViewExtras.h:
            * Misc.subproj/WebNSViewExtras.m:
            (-[NSView firstResponderIsSelfOrDescendantView]): New helper to
            (-[WebHTMLView performKeyEquivalent:]): Do not pass key events through to the editing
            key handler unless the WebHTMLView is first responder or contains the first responder.
            This prevents the "stealing" of key events mentioned in the bug.
            * WebView.subproj/WebView.m:
            (-[WebView _performResponderOperation:with:]): Uses the new firstResponderIsSelfOrDescendantView
            helper. The code I replaced used the same logic as the new helper.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7051 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index f964c16..385c4ca 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,21 @@
+2004-07-19  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by Richard
+
+        Fix for this bug:
+        
+        <rdar://problem/3707504> HTMLCompose: key events are stolen by Web(HTML)View
+
+        * Misc.subproj/WebNSViewExtras.h:
+        * Misc.subproj/WebNSViewExtras.m:
+        (-[NSView firstResponderIsSelfOrDescendantView]): New helper to 
+        (-[WebHTMLView performKeyEquivalent:]): Do not pass key events through to the editing
+        key handler unless the WebHTMLView is first responder or contains the first responder.
+        This prevents the "stealing" of key events mentioned in the bug.
+        * WebView.subproj/WebView.m:
+        (-[WebView _performResponderOperation:with:]): Uses the new firstResponderIsSelfOrDescendantView
+        helper. The code I replaced used the same logic as the new helper.
+
 === Safari-152 ===
 
 2004-07-12  Maciej Stachowiak  <mjs at apple.com>
diff --git a/WebKit/Misc.subproj/WebNSViewExtras.h b/WebKit/Misc.subproj/WebNSViewExtras.h
index a456abd..e385310 100644
--- a/WebKit/Misc.subproj/WebNSViewExtras.h
+++ b/WebKit/Misc.subproj/WebNSViewExtras.h
@@ -48,4 +48,6 @@
                 source:(id)source
                 offset:(NSPoint *)dragImageOffset;
 
+- (BOOL)firstResponderIsSelfOrDescendantView;
+
 @end
diff --git a/WebKit/Misc.subproj/WebNSViewExtras.m b/WebKit/Misc.subproj/WebNSViewExtras.m
index 47430a1..c40ced6 100644
--- a/WebKit/Misc.subproj/WebNSViewExtras.m
+++ b/WebKit/Misc.subproj/WebNSViewExtras.m
@@ -223,4 +223,12 @@
     [self dragImage:dragImage at:origin offset:NSZeroSize event:event pasteboard:pasteboard source:source slideBack:YES];
 }
 
+- (BOOL)firstResponderIsSelfOrDescendantView
+{
+    NSResponder *responder = [[self window] firstResponder];
+    return (responder && 
+           (responder == self || 
+           ([responder isKindOfClass:[NSView class]] && [(NSView *)responder isDescendantOf:self])));
+}
+
 @end
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index a428f1f..2eb393f 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -2259,7 +2259,7 @@ static WebHTMLView *lastHitView = nil;
     // 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 _bridge] interceptKeyEvent:event toView:self]) {
+    if ([self firstResponderIsSelfOrDescendantView] && [[self _bridge] interceptKeyEvent:event toView:self]) {
         return YES;
     }
 
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index efe7af5..dbd7bfc 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -2594,7 +2594,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
 
     // Pass this selector down to the first responder.
     NSResponder *responder = [[self window] firstResponder];
-    if (!responder || ![responder isKindOfClass:[NSView class]] || ![(NSView *)responder isDescendantOf:self]) {
+    if (![self firstResponderIsSelfOrDescendantView]) {
         responder = [[[self mainFrame] frameView] documentView];
         if (!responder) {
             responder = [[self mainFrame] frameView];

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list