WebCore:
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Jul 2004 14:56:53 +0000 (14:56 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Jul 2004 14:56:53 +0000 (14:56 +0000)
        Reviewed by Trey

        Remove handling of HTML editing key events from WebCore.
        This now happens in WebKit if an event passes all the
        way through WebCore without being handled by the DOM.

        In each case below, function were removed, as their
        only purpose was to handle editing key events.

        * khtml/xml/dom_elementimpl.cpp
        * khtml/xml/dom_elementimpl.h
        * kwq/KWQKHTMLPart.h
        * kwq/KWQKHTMLPart.mm
        * kwq/WebCoreBridge.h

WebKit:

        Reviewed by Trey

        * WebCoreSupport.subproj/WebBridge.m: Remove interceptEditingKeyEvent
        bridge call over. This method of handling editing key events is now
        obsolete.
        * WebView.subproj/WebHTMLView.m:
        (-[WebHTMLView performKeyEquivalent:]): Send key event over to the
        DOM if this view is or contains the first responder. This now
        happens unconditionally.
        (-[WebHTMLView keyDown:]): Send key event to the DOM, then see if
        the web view wants to interpret it an an editing key event. This
        is the new place to intercept key events for editing.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7087 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/khtml/xml/dom_elementimpl.cpp
WebCore/khtml/xml/dom_elementimpl.h
WebCore/kwq/KWQKHTMLPart.h
WebCore/kwq/KWQKHTMLPart.mm
WebCore/kwq/WebCoreBridge.h
WebKit/ChangeLog
WebKit/Plugins.subproj/npruntime.h
WebKit/WebCoreSupport.subproj/WebBridge.m
WebKit/WebView.subproj/WebHTMLView.m

index a3dd88dd017825b76c646c6b41c1b4e6ac3ff570..f93c85e6a47fd1be1d5fc5e131374223a50e2c6d 100644 (file)
@@ -1,3 +1,20 @@
+2004-07-21  Ken Kocienda  <kocienda@apple.com>
+
+        Reviewed by Trey
+
+        Remove handling of HTML editing key events from WebCore.
+        This now happens in WebKit if an event passes all the
+        way through WebCore without being handled by the DOM.
+
+        In each case below, function were removed, as their
+        only purpose was to handle editing key events.
+
+        * khtml/xml/dom_elementimpl.cpp
+        * khtml/xml/dom_elementimpl.h
+        * kwq/KWQKHTMLPart.h
+        * kwq/KWQKHTMLPart.mm
+        * kwq/WebCoreBridge.h
+
 2004-07-21  Ken Kocienda  <kocienda@apple.com>
 
         Reviewed by John
index 359ccfa64d56fcc9538d076fc5ae0f935ddb90ec..f4fbbde61e5ce82a260ccc0dc4e17ae4ad0af7e9 100644 (file)
@@ -373,18 +373,6 @@ bool ElementImpl::isURLAttribute(AttributeImpl *attr) const
     
 }
 
-void ElementImpl::defaultEventHandler(EventImpl *evt)
-{
-#if APPLE_CHANGES
-    if (evt->id() == EventImpl::KEYPRESS_EVENT && isContentEditable()) {
-        KHTMLPart *part = getDocument()->part();
-        if (part && KWQ(part)->interceptEditingKeyEvent())
-            evt->setDefaultHandled();
-    }
-#endif
-    NodeBaseImpl::defaultEventHandler(evt);
-}
-
 RenderStyle *ElementImpl::styleForRenderer(RenderObject *parentRenderer)
 {
     return getDocument()->styleSelector()->styleForElement(this);
index 0d2b29e51672328801e32070d4900912f211d32a..dbb55ddebdf3289e9b4c47cfb21c2bd81a177bed 100644 (file)
@@ -215,8 +215,6 @@ public:
 
     virtual DOMString toString() const;
 
-    virtual void defaultEventHandler(EventImpl *evt);
-    
     virtual bool isURLAttribute(AttributeImpl *attr) const;
     
 #ifndef NDEBUG
index b2690e09335166259209159a325a9572ecead578..dae015cc93ca97dde4523fac639adc4af12d6fdf 100644 (file)
@@ -299,7 +299,6 @@ public:
     void registerCommandForUndo(const khtml::EditCommand &);
     void registerCommandForRedo(const khtml::EditCommand &);
     void clearUndoRedoOperations();
-    bool interceptEditingKeyEvent();
     void issueUndoCommand();
     void issueRedoCommand();
     void issueCutCommand();
index 040fbe570b41706e6a5d4e9623d7c35c15bcf0a5..2a13757a0163f4525075acbcba92cfba65b2c3d0 100644 (file)
@@ -3429,11 +3429,6 @@ void KWQKHTMLPart::clearUndoRedoOperations()
     }
 }
 
-bool KWQKHTMLPart::interceptEditingKeyEvent()
-{
-    return [_bridge interceptEditingKeyEvent:_currentEvent];
-}
-
 void KWQKHTMLPart::issueUndoCommand()
 {
     if (canUndo())
index 0ea3b3d76f903f374076767454cc1e804de4e0ac..f0e86ed9891c5d191e6d5b73c776cbe4827e62b9 100644 (file)
@@ -482,7 +482,6 @@ typedef enum {
 - (void)issuePasteCommand;
 - (void)respondToChangedSelection;
 - (void)respondToChangedContents;
-- (BOOL)interceptEditingKeyEvent:(NSEvent *)event;
 - (void)setIsSelected:(BOOL)isSelected forView:(NSView *)view;
 - (BOOL)isEditable;
 - (BOOL)shouldBeginEditing:(DOMRange *)range;
index ff06b8d933ee32a4b017f57760f7ea22016dafe2..335c3e6538ed4793108d46a264f0d063356dcff0 100644 (file)
@@ -1,3 +1,18 @@
+2004-07-21  Ken Kocienda  <kocienda@apple.com>
+
+        Reviewed by Trey
+
+        * WebCoreSupport.subproj/WebBridge.m: Remove interceptEditingKeyEvent
+        bridge call over. This method of handling editing key events is now
+        obsolete.
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView performKeyEquivalent:]): Send key event over to the 
+        DOM if this view is or contains the first responder. This now
+        happens unconditionally.
+        (-[WebHTMLView keyDown:]): Send key event to the DOM, then see if
+        the web view wants to interpret it an an editing key event. This
+        is the new place to intercept key events for editing.
+
 2004-07-21  Ken Kocienda  <kocienda@apple.com>
 
         Reviewed by John
index 461f3f0a2e0c08899251e2d796fcaeb4d8ffeb6b..9cc7a08e1c2ca9a8d82d3dbf74aacf97b7c938d5 100644 (file)
@@ -171,11 +171,7 @@ void NPN_InitializeVariantWithVariant (NPVariant *destination, const NPVariant *
        NPVariant (with type NPVariantUndefinedType)          Undefined
        NPVariant (with type NPVariantNullType)               Null
        NPArray                                               Array (restricted)
-<<<<<<< npruntime.h
-       NPObject                                               Object or (NPObject wrapper)
-=======
        NObject                                               Object or (NPObject wrapper)
->>>>>>> 1.18
 
 */
 
index 32b0b00aaa7415200bfea72a1893e61c9454c32f..124bd0cfe8b841a84d5e930c5b94ebdd714cca7b 100644 (file)
@@ -1286,11 +1286,6 @@ static id <WebFormDelegate> formDelegate(WebBridge *self)
     return [[_frame webView] undoManager];
 }
 
-- (BOOL)interceptEditingKeyEvent:(NSEvent *)event
-{
-    return [[_frame webView] _interceptEditingKeyEvent:event];
-}
-
 - (void)issueCutCommand
 {
     [[_frame webView] cut:nil];
index 4dae157007f9175c1ceed35114dee274b09f94e5..3eae7305e79d8be66c8feeff67afede82a49ef9f 100644 (file)
@@ -40,6 +40,7 @@
 #import <WebKit/WebTextRendererFactory.h>
 #import <WebKit/WebUIDelegatePrivate.h>
 #import <WebKit/WebUnicode.h>
+#import <WebKit/WebViewInternal.h>
 #import <WebKit/WebViewPrivate.h>
 
 #import <AppKit/NSAccessibility.h>
@@ -2273,8 +2274,7 @@ static WebHTMLView *lastHitView = nil;
 {
     // 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];
+    if ([self firstResponderIsSelfOrDescendantView] && [[self _bridge] interceptKeyEvent:event toView:self]) {
         return YES;
     }
     return [super performKeyEquivalent:event];
@@ -2282,10 +2282,15 @@ static WebHTMLView *lastHitView = nil;
 
 - (void)keyDown:(NSEvent *)event
 {
-    BOOL intercepted = [[self _bridge] interceptKeyEvent:event toView:self];
-    if (!intercepted || [event _web_isTabKeyEvent]) {
-        [super keyDown:event];
-    }
+    WebBridge *bridge = [self _bridge];
+    if ([bridge interceptKeyEvent:event toView:self])
+        return;
+        
+    WebView *webView = [self _webView];
+    if (([webView isEditable] || [bridge isSelectionEditable]) && [webView _interceptEditingKeyEvent:event]) 
+        return;
+    
+    [super keyDown:event];
 }
 
 - (void)keyUp:(NSEvent *)event