WebCore:
authorcblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Nov 2004 19:11:49 +0000 (19:11 +0000)
committercblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Nov 2004 19:11:49 +0000 (19:11 +0000)
Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus

        Reviewed by john.

        * kwq/KWQTextField.mm:
        (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
        * kwq/WebCoreBridge.h:

WebKit:

Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus

        Reviewed by john.

        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge control:textView:shouldHandleEvent:]): new
        * WebView.subproj/WebFormDelegate.h:
        * WebView.subproj/WebFormDelegate.m:
        (-[WebFormDelegate control:textView:shouldHandleEvent:inFrame:]): new

WebBrowser:

Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus

        Reviewed by john.

        * BrowserWebController.m:
        (-[FormDelegate control:textView:shouldHandleEvent:inFrame:]): new
        * CompletionController.h:
        * CompletionController.m:
        (-[CompletionController handleInsertNewline]): new, factored out from next method
        (-[CompletionController control:textView:doCommandBySelector:]): call handleInsertNewline
        * FormCompletionController.h:
        * FormCompletionController.m:
        (-[FormCompletionController control:textView:shouldHandleEvent:]): new, call handleInsertNewline so that WebCore does not submit the form when a newline is entered

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

WebCore/ChangeLog-2005-08-23
WebCore/kwq/KWQTextField.mm
WebCore/kwq/WebCoreBridge.h
WebKit/ChangeLog
WebKit/WebCoreSupport.subproj/WebBridge.m
WebKit/WebView.subproj/WebFormDelegate.h
WebKit/WebView.subproj/WebFormDelegate.m

index 44e66cc..b7b4e69 100644 (file)
@@ -1,3 +1,13 @@
+2004-11-08  Chris Blumenberg  <cblu@apple.com>
+
+       Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
+
+        Reviewed by john.
+
+        * kwq/KWQTextField.mm:
+        (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
+        * kwq/WebCoreBridge.h:
+
 2004-11-08  David Harrison  <harrison@apple.com>
 
         Reviewed by Darin.
index 57f725f..71c5abe 100644 (file)
     if ((type == NSKeyDown || type == NSKeyUp) && 
        ![[NSInputManager currentInputManager] hasMarkedText]) {
         WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
-        BOOL intercepted = [bridge interceptKeyEvent:event toView:view];
+        BOOL intercepted = [bridge control:field textView:view shouldHandleEvent:event];
+        if (!intercepted) {
+            intercepted = [bridge interceptKeyEvent:event toView:view];
+        }
         // Always return NO for key up events because we don't want them
         // passed along the responder chain. This is arguably a bug in
         // NSTextView; see Radar 3507083.
index 4a1e018..e7d3e9c 100644 (file)
@@ -504,6 +504,7 @@ typedef enum {
 - (void)control:(NSControl *)control didFailToValidatePartialString:(NSString *)string errorDescription:(NSString *)error;
 - (BOOL)control:(NSControl *)control isValidObject:(id)obj;
 - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector;
+- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView shouldHandleEvent:(NSEvent *)event;
 
 - (NSView <WebCoreFileButton> *)fileButtonWithDelegate:(id <WebCoreFileButtonDelegate>)delegate;
 
index 8a82aac..e8a8a21 100644 (file)
@@ -1,3 +1,15 @@
+2004-11-08  Chris Blumenberg  <cblu@apple.com>
+
+       Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
+
+        Reviewed by john.
+
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge control:textView:shouldHandleEvent:]): new
+        * WebView.subproj/WebFormDelegate.h:
+        * WebView.subproj/WebFormDelegate.m:
+        (-[WebFormDelegate control:textView:shouldHandleEvent:inFrame:]): new
+
 2004-11-05  Chris Blumenberg  <cblu@apple.com>
 
        Fixed: <rdar://problem/3854218> Safari is sometimes really slow because of increased null events to plug-ins
index f51fac4..85ae5e3 100644 (file)
@@ -1180,6 +1180,12 @@ static id <WebFormDelegate> formDelegate(WebBridge *self)
     return [formDelegate(self) control:control textView:textView doCommandBySelector:commandSelector inFrame:_frame];
 }
 
+- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView shouldHandleEvent:(NSEvent *)event
+{
+    FormDelegateLog(control);
+    return [formDelegate(self) control:control textView:textView shouldHandleEvent:event inFrame:_frame];
+}
+
 - (void)frameDetached
 {
     // Put _frame into a local variable because _detachFromParent
index 3b56ae6..f1d5a5f 100644 (file)
@@ -1,8 +1,6 @@
 /*
         WebFormDelegate.h
         Copyright 2003, Apple Computer, Inc.
-        
-        Public header file.
 */
 
 #import <AppKit/AppKit.h>
@@ -39,6 +37,7 @@
 - (BOOL)control:(NSControl *)control isValidObject:(id)obj inFrame:(WebFrame *)frame;
 
 - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector inFrame:(WebFrame *)frame;
+- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView shouldHandleEvent:(NSEvent *)event inFrame:(WebFrame *)frame;
 
 // Sent when a form is just about to be submitted (before the load is started)
 // listener must be sent continue when the delegate is done.
index 8486580..be2d3a2 100644 (file)
@@ -57,6 +57,11 @@ static WebFormDelegate *sharedDelegate = nil;
     return NO;
 }
 
+- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView shouldHandleEvent:(NSEvent *)event inFrame:(WebFrame *)frame
+{
+    return NO;
+}
+
 - (void)frame:(WebFrame *)frame sourceFrame:(WebFrame *)sourceFrame willSubmitForm:(DOMElement *)form withValues:(NSDictionary *)values submissionListener:(id <WebFormSubmissionListener>)listener
 {
     [listener continue];