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


The following commit has been merged in the debian/unstable branch:
commit 33763a8f8003103cec997f8b1d623d7856634fea
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed May 19 18:36:56 2004 +0000

    WebCore:
    
            Reviewed by Hyatt and Darin
    
            Fix for this bug:
    
            <rdar://problem/3643230>: "can't tab out of contentEditable Elements"
    
            * khtml/xml/dom_elementimpl.cpp: Now checks if key event was intercepted by the editing
            key-handler before setting the event as defaultHandled.
            (ElementImpl::defaultEventHandler):
            * kwq/KWQKHTMLPart.h: Name change from editingKeyEvent.
            Also now returns a BOOL to report whether the event was handled or not.
            * kwq/KWQKHTMLPart.mm:
            (KWQKHTMLPart::interceptEditingKeyEvent): Ditto.
            * kwq/WebCoreBridge.h: Renamed from _editingKeyDown.
    
    WebKit:
    
            Reviewed by Hyatt and Darin
    
            Fix for this bug:
    
            <rdar://problem/3643230>: "can't tab out of contentEditable Elements"
    
            * WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge interceptEditingKeyEvent:]): Renamed from _editingKeyDown. Also now returns
            a BOOL to report whether the event was handled or not.
            * WebView.subproj/WebView.m:
            (-[WebView _interceptEditingKeyEvent:]): Also renamed from _editingKeyDown. Now includes
            a check if the web view is editable and whether the event is a tab key event. If the former
            is not true and the latter is, the key is not intercepted. This causes the tab to shift once
            the key is processed by other non-editing key-handling mechanisms.
            * WebView.subproj/WebViewPrivate.h: Changed declaration due to name change.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6642 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index bc3b2e7..f217dc7 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,22 @@
 2004-05-19  Ken Kocienda  <kocienda at apple.com>
 
+        Reviewed by Hyatt and Darin
+
+        Fix for this bug:
+        
+        <rdar://problem/3643230>: "can't tab out of contentEditable Elements"
+
+        * khtml/xml/dom_elementimpl.cpp: Now checks if key event was intercepted by the editing
+        key-handler before setting the event as defaultHandled.
+        (ElementImpl::defaultEventHandler):
+        * kwq/KWQKHTMLPart.h: Name change from editingKeyEvent.
+        Also now returns a BOOL to report whether the event was handled or not.
+        * kwq/KWQKHTMLPart.mm: 
+        (KWQKHTMLPart::interceptEditingKeyEvent): Ditto.
+        * kwq/WebCoreBridge.h: Renamed from _editingKeyDown.
+
+2004-05-19  Ken Kocienda  <kocienda at apple.com>
+
         Reviewed by John
 
         Fix for this bug:
diff --git a/WebCore/khtml/xml/dom_elementimpl.cpp b/WebCore/khtml/xml/dom_elementimpl.cpp
index 464b7d5..090e5de 100644
--- a/WebCore/khtml/xml/dom_elementimpl.cpp
+++ b/WebCore/khtml/xml/dom_elementimpl.cpp
@@ -379,10 +379,8 @@ void ElementImpl::defaultEventHandler(EventImpl *evt)
     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)->editingKeyEvent();
+        if (part && !static_cast<KeyboardEventImpl*>(evt)->metaKey() && KWQ(part)->interceptEditingKeyEvent())
             evt->setDefaultHandled();
-        }
     }
 #endif
     NodeBaseImpl::defaultEventHandler(evt);
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index be94f97..f0a748a 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -275,7 +275,7 @@ public:
     void registerCommandForUndo(const khtml::EditCommand &);
     void registerCommandForRedo(const khtml::EditCommand &);
     void clearUndoRedoOperations();
-    void editingKeyEvent();
+    bool interceptEditingKeyEvent();
     void issueUndoCommand();
     void issueRedoCommand();
     void issueCutCommand();
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index ae6a60b..49f512c 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -2937,9 +2937,9 @@ void KWQKHTMLPart::clearUndoRedoOperations()
     [_bridge clearUndoRedoOperations];
 }
 
-void KWQKHTMLPart::editingKeyEvent()
+bool KWQKHTMLPart::interceptEditingKeyEvent()
 {
-    [_bridge editingKeyDown:_currentEvent];
+    return [_bridge interceptEditingKeyEvent:_currentEvent];
 }
 
 void KWQKHTMLPart::issueUndoCommand()
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 0d5450e..2a9ad8a 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -445,7 +445,7 @@ typedef enum {
 - (void)issuePasteCommand;
 - (void)postDidChangeSelectionNotification;
 - (void)postDidChangeNotification;
-- (void)editingKeyDown:(NSEvent *)event;
+- (BOOL)interceptEditingKeyEvent:(NSEvent *)event;
 - (void)setIsSelected:(BOOL)isSelected forView:(NSView *)view;
 - (BOOL)isEditable;
 
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 874a2cc..c645a30 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,23 @@
 2004-05-19  Ken Kocienda  <kocienda at apple.com>
 
+        Reviewed by Hyatt and Darin
+
+        Fix for this bug:
+        
+        <rdar://problem/3643230>: "can't tab out of contentEditable Elements"
+
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge interceptEditingKeyEvent:]): Renamed from _editingKeyDown. Also now returns
+        a BOOL to report whether the event was handled or not.
+        * WebView.subproj/WebView.m:
+        (-[WebView _interceptEditingKeyEvent:]): Also renamed from _editingKeyDown. Now includes
+        a check if the web view is editable and whether the event is a tab key event. If the former
+        is not true and the latter is, the key is not intercepted. This causes the tab to shift once
+        the key is processed by other non-editing key-handling mechanisms.
+        * WebView.subproj/WebViewPrivate.h: Changed declaration due to name change.
+
+2004-05-19  Ken Kocienda  <kocienda at apple.com>
+
         Reviewed by Hyatt
 
         * WebCoreSupport.subproj/WebBridge.m:
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 842cc2d..70da412 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -1230,9 +1230,9 @@ static id <WebFormDelegate> formDelegate(WebBridge *self)
     }
 }
 
-- (void)editingKeyDown:(NSEvent *)event
+- (BOOL)interceptEditingKeyEvent:(NSEvent *)event
 {
-    [[_frame webView] _editingKeyDown:event];
+    return [[_frame webView] _interceptEditingKeyEvent:event];
 }
 
 - (void)issueUndoCommand
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index 8fe9772..23c3a44 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -38,6 +38,7 @@
 #import <WebKit/WebKitStatisticsPrivate.h>
 #import <WebKit/WebNSPasteboardExtras.h>
 #import "WebNSPrintOperationExtras.h"
+#import <WebKit/WebNSEventExtras.h>
 #import <WebKit/WebNSURLExtras.h>
 #import <WebKit/WebNSViewExtras.h>
 #import <WebKit/WebPluginDatabase.h>
@@ -2327,14 +2328,24 @@ static NSFont *_fontFromStyle(DOMCSSStyleDeclaration *style)
 
 @implementation WebView (WebViewEditing)
 
-- (void)_editingKeyDown:(NSEvent *)event
+- (BOOL)_interceptEditingKeyEvent:(NSEvent *)event
 {   
     // Work around this bug:
     // <rdar://problem/3630640>: "Calling interpretKeyEvents: in a custom text view can fail to process keys right after app startup"
     [NSKeyBindingManager sharedKeyBindingManager];
     
+    // Use the isEditable state to determine whether or not to process tab key events.
+    // The idea here is that isEditable will be NO when this WebView is being used
+    // in a browser, and we desire the behavior where tab moves to the next element
+    // in tab order. If isEditable is YES, it is likely that the WebView is being
+    // embedded as the whole view, as in Mail, and tabs should input tabs as expected
+    // in a text editor.
+    if (![self isEditable] && [event _web_isTabKeyEvent]) 
+        return NO;
+    
     // Now process the key normally
     [self interpretKeyEvents:[NSArray arrayWithObject:event]];
+    return YES;
 }
 
 - (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index 672b8a3..b5bbd8b 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -310,7 +310,7 @@ Could be worth adding to the API.
 
 
 @interface WebView (WebViewEditingExtras)
-- (void)_editingKeyDown:(NSEvent *)event;
+- (BOOL)_interceptEditingKeyEvent:(NSEvent *)event;
 - (DOMDocument *)DOMDocument;
 @end
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list