[webkit-changes] cvs commit: WebKit/WebView.subproj WebFormDelegate.h WebFormDelegate.m

John sullivan at opensource.apple.com
Tue Jul 26 09:34:18 PDT 2005


sullivan    05/07/26 09:34:17

  Modified:    .        ChangeLog
               kwq      KWQTextArea.mm KWQTextField.mm WebCoreBridge.h
               .        ChangeLog
               WebCoreSupport.subproj WebBridge.m
               WebView.subproj WebFormDelegate.h WebFormDelegate.m
  Log:
  WebCore:
  
          Reviewed by Darin Adler.
  
          Test cases added: none, only affects Safari autofill
  
          - big hunk of weaning form-related SPI from NSView; autofill continues to
          work (but only on tip of tree Safari)
  
          * kwq/KWQTextArea.mm:
          (-[KWQTextArea textDidChange:]):
          call renamed bridge method, passing DOMElement* instead of NSView*
  
          * kwq/KWQTextField.mm:
          (-[KWQTextFieldController controlTextDidBeginEditing:]):
          call renamed bridge method, passing DOMElement* instead of NSView*
          (-[KWQTextFieldController controlTextDidEndEditing:]):
          ditto
          (-[KWQTextFieldController controlTextDidChange:]):
          ditto
          (-[KWQTextFieldController control:textShouldBeginEditing:]):
          don't call through to bridge form-delegate-related method; I deleted it because it was
          not being used
          (-[KWQTextFieldController control:textShouldEndEditing:]):
          ditto
          (-[KWQTextFieldController textView:shouldHandleEvent:]):
          call renamed bridge method, passing DOMElement* instead of NSView*
  
          * kwq/WebCoreBridge.h:
          Remove textShouldBeginEditing and textShouldEndEditing methods since they weren't being used.
          Rename other methods and made them take DOMElement* instead of NSView*
  
  WebKit:
  
          Reviewed by Darin Adler.
  
          - big hunk of weaning form-related SPI from NSView; autofill continues to
          work (but only on tip of tree Safari)
  
          * WebCoreSupport.subproj/WebBridge.m:
          (-[WebBridge textFieldDidBeginEditing:]):
          changed name from controlTextXXX:, now takes a DOMHTMLInputElement*
          (-[WebBridge textFieldDidEndEditing:]):
          ditto
          (-[WebBridge textDidChangeInTextField:]):
          ditto
          (-[WebBridge textDidChangeInTextArea:]):
          changed name from textDidChange:, now takes a DOMHTMLTextAreaElement*
          (-[WebBridge control:textShouldBeginEditing:]):
          removed this method as it wasn't being used by autofill, and did nothing in WebKit
          (-[WebBridge control:textShouldEndEditing:]):
          ditto
          (-[WebBridge textField:shouldHandleEvent:]):
          changed name from control:textView:shouldHandleEvent:, now takes a DOMHTMLInputElement*.
          The textView parameter wasn't being used, so I eliminated it.
  
          * WebView.subproj/WebFormDelegate.h:
          * WebView.subproj/WebFormDelegate.m:
          (-[WebFormDelegate textFieldDidBeginEditing:inFrame:]):
          (-[WebFormDelegate textFieldDidEndEditing:inFrame:]):
          (-[WebFormDelegate control:textShouldBeginEditing:inFrame:]):
          (-[WebFormDelegate control:textShouldEndEditing:inFrame:]):
          (-[WebFormDelegate textDidChangeInTextField:inFrame:]):
          (-[WebFormDelegate textDidChangeInTextArea:inFrame:]):
          (-[WebFormDelegate textField:shouldHandleEvent:inFrame:]):
          These all changed in the same way as the WebBridge methods
  
  Revision  Changes    Path
  1.4471    +32 -2     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4470
  retrieving revision 1.4471
  diff -u -r1.4470 -r1.4471
  --- ChangeLog	26 Jul 2005 08:31:36 -0000	1.4470
  +++ ChangeLog	26 Jul 2005 16:34:09 -0000	1.4471
  @@ -1,3 +1,35 @@
  +2005-07-26  John Sullivan  <sullivan at apple.com>
  +
  +        Reviewed by Darin Adler.
  +
  +        Test cases added: none, only affects Safari autofill
  +        
  +        - big hunk of weaning form-related SPI from NSView; autofill continues to
  +        work (but only on tip of tree Safari)        
  +
  +        * kwq/KWQTextArea.mm:
  +        (-[KWQTextArea textDidChange:]):
  +        call renamed bridge method, passing DOMElement* instead of NSView*
  +        
  +        * kwq/KWQTextField.mm:
  +        (-[KWQTextFieldController controlTextDidBeginEditing:]):
  +        call renamed bridge method, passing DOMElement* instead of NSView*
  +        (-[KWQTextFieldController controlTextDidEndEditing:]):
  +        ditto
  +        (-[KWQTextFieldController controlTextDidChange:]):
  +        ditto
  +        (-[KWQTextFieldController control:textShouldBeginEditing:]):
  +        don't call through to bridge form-delegate-related method; I deleted it because it was
  +        not being used
  +        (-[KWQTextFieldController control:textShouldEndEditing:]):
  +        ditto
  +        (-[KWQTextFieldController textView:shouldHandleEvent:]):
  +        call renamed bridge method, passing DOMElement* instead of NSView*
  +        
  +        * kwq/WebCoreBridge.h:
  +        Remove textShouldBeginEditing and textShouldEndEditing methods since they weren't being used.
  +        Rename other methods and made them take DOMElement* instead of NSView*
  +
   2005-07-26  Maciej Stachowiak  <mjs at apple.com>
   
           - imported much of the w3c DOM test suite:
  @@ -9,8 +41,6 @@
   
   	For now I left out the XHTML versions.
   
  -        Test cases added: (NONE)
  -
           * layout-tests/dom/html/level1/core/*
   	* layout-tests/dom/html/level2/core/*
           * layout-tests/dom/html/level2/events/*
  
  
  
  1.87      +1 -1      WebCore/kwq/KWQTextArea.mm
  
  Index: KWQTextArea.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQTextArea.mm,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- KWQTextArea.mm	14 Jul 2005 23:53:33 -0000	1.86
  +++ KWQTextArea.mm	26 Jul 2005 16:34:13 -0000	1.87
  @@ -214,7 +214,7 @@
           widget->textChanged();
       
       WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
  -    [bridge textDidChange:notification];
  +    [bridge textDidChangeInTextArea:(DOMHTMLTextAreaElement *)[bridge elementForView:self]];
   }
   
   - (void)setWordWrap:(BOOL)f
  
  
  
  1.83      +7 -10     WebCore/kwq/KWQTextField.mm
  
  Index: KWQTextField.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQTextField.mm,v
  retrieving revision 1.82
  retrieving revision 1.83
  diff -u -r1.82 -r1.83
  --- KWQTextField.mm	20 Jul 2005 22:55:00 -0000	1.82
  +++ KWQTextField.mm	26 Jul 2005 16:34:13 -0000	1.83
  @@ -159,7 +159,7 @@
   	return;
       
       WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
  -    [bridge controlTextDidBeginEditing:notification];
  +    [bridge textFieldDidBeginEditing:(DOMHTMLInputElement *)[bridge elementForView:field]];
   }
   
   - (void)controlTextDidEndEditing:(NSNotification *)notification
  @@ -168,7 +168,7 @@
   	return;
       
       WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
  -    [bridge controlTextDidEndEditing:notification];
  +    [bridge textFieldDidEndEditing:(DOMHTMLInputElement *)[bridge elementForView:field]];
       
       if (widget && [[[notification userInfo] objectForKey:@"NSTextMovement"] intValue] == NSReturnTextMovement)
           widget->returnPressed();
  @@ -183,7 +183,7 @@
           return;
       
       WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
  -    [bridge controlTextDidChange:notification];
  +    [bridge textDidChangeInTextField:(DOMHTMLInputElement *)[bridge elementForView:field]];
       
       edited = YES;
       if (widget) {
  @@ -194,9 +194,7 @@
   - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor
   {
       if (!widget)
  -        return NO;
  -    
  -    WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
  +        return NO;    
       
       // In WebHTMLView, we set a clip. This is not typical to do in an
       // NSView, and while correct for any one invocation of drawRect:,
  @@ -210,7 +208,7 @@
       [fieldEditor releaseGState];
       [[fieldEditor superview] releaseGState];
       
  -    return [bridge control:control textShouldBeginEditing:fieldEditor];
  +    return YES;
   }
   
   - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor
  @@ -218,8 +216,7 @@
       if (!widget)
   	return NO;
       
  -    WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
  -    return [bridge control:control textShouldEndEditing:fieldEditor];
  +    return YES;
   }
   
   - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector
  @@ -278,7 +275,7 @@
   
           QWidget::setDeferFirstResponderChanges(true);
   
  -        BOOL intercepted = [bridge control:field textView:view shouldHandleEvent:event];
  +        BOOL intercepted = [bridge textField:(DOMHTMLInputElement *)[bridge elementForView:field] shouldHandleEvent:event];
           if (!intercepted) {
               intercepted = [bridge interceptKeyEvent:event toView:view];
           }
  
  
  
  1.341     +7 -7      WebCore/kwq/WebCoreBridge.h
  
  Index: WebCoreBridge.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/WebCoreBridge.h,v
  retrieving revision 1.340
  retrieving revision 1.341
  diff -u -r1.340 -r1.341
  --- WebCoreBridge.h	22 Jul 2005 18:09:22 -0000	1.340
  +++ WebCoreBridge.h	26 Jul 2005 16:34:13 -0000	1.341
  @@ -56,8 +56,10 @@
   @class DOMDocumentFragment;
   @class DOMElement;
   @class DOMHTMLElement;
  + at class DOMHTMLInputElement;
   @class DOMNode;
   @class DOMRange;
  + at class DOMHTMLTextAreaElement;
   @class WebCoreSettings;
   @class WebScriptObject;
   
  @@ -584,15 +586,13 @@
   - (void)goBackOrForward:(int)distance;
   - (BOOL)canGoBackOrForward:(int)distance;
   
  -- (void)controlTextDidBeginEditing:(NSNotification *)obj;
  -- (void)controlTextDidEndEditing:(NSNotification *)obj;
  -- (void)controlTextDidChange:(NSNotification *)obj;
  -- (void)textDidChange:(NSNotification *)obj;
  +- (void)textFieldDidBeginEditing:(DOMHTMLInputElement *)element;
  +- (void)textFieldDidEndEditing:(DOMHTMLInputElement *)element;
  +- (void)textDidChangeInTextField:(DOMHTMLInputElement *)element;
  +- (void)textDidChangeInTextArea:(DOMHTMLTextAreaElement *)element;
   
  -- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor;
  -- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
   - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector;
  -- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView shouldHandleEvent:(NSEvent *)event;
  +- (BOOL)textField:(DOMHTMLInputElement *)element shouldHandleEvent:(NSEvent *)event;
   
   - (NSView <WebCoreFileButton> *)fileButtonWithDelegate:(id <WebCoreFileButtonDelegate>)delegate;
   
  
  
  
  1.3258    +36 -0     WebKit/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKit/ChangeLog,v
  retrieving revision 1.3257
  retrieving revision 1.3258
  diff -u -r1.3257 -r1.3258
  --- ChangeLog	26 Jul 2005 00:11:30 -0000	1.3257
  +++ ChangeLog	26 Jul 2005 16:34:14 -0000	1.3258
  @@ -1,3 +1,39 @@
  +2005-07-25  John Sullivan  <sullivan at apple.com>
  +
  +        Reviewed by Darin Adler.
  +        
  +        - big hunk of weaning form-related SPI from NSView; autofill continues to
  +        work (but only on tip of tree Safari)
  +        
  +        * WebCoreSupport.subproj/WebBridge.m:
  +        (-[WebBridge textFieldDidBeginEditing:]):
  +        changed name from controlTextXXX:, now takes a DOMHTMLInputElement*
  +        (-[WebBridge textFieldDidEndEditing:]):
  +        ditto
  +        (-[WebBridge textDidChangeInTextField:]):
  +        ditto
  +        (-[WebBridge textDidChangeInTextArea:]):
  +        changed name from textDidChange:, now takes a DOMHTMLTextAreaElement*
  +        (-[WebBridge control:textShouldBeginEditing:]):
  +        removed this method as it wasn't being used by autofill, and did nothing in WebKit
  +        (-[WebBridge control:textShouldEndEditing:]):
  +        ditto
  +        (-[WebBridge textField:shouldHandleEvent:]):
  +        changed name from control:textView:shouldHandleEvent:, now takes a DOMHTMLInputElement*.
  +        The textView parameter wasn't being used, so I eliminated it.
  +        
  +        * WebView.subproj/WebFormDelegate.h:
  +        * WebView.subproj/WebFormDelegate.m:
  +        (-[WebFormDelegate textFieldDidBeginEditing:inFrame:]):
  +        (-[WebFormDelegate textFieldDidEndEditing:inFrame:]):
  +        (-[WebFormDelegate control:textShouldBeginEditing:inFrame:]):
  +        (-[WebFormDelegate control:textShouldEndEditing:inFrame:]):
  +        (-[WebFormDelegate textDidChangeInTextField:inFrame:]):
  +        (-[WebFormDelegate textDidChangeInTextArea:inFrame:]):
  +        (-[WebFormDelegate textField:shouldHandleEvent:inFrame:]):
  +        These all changed in the same way as the WebBridge methods
  +        
  +
   2005-07-25  Vicki Murley <vicki at apple.com>
   
           Reviewed by Darin.
  
  
  
  1.363     +15 -27    WebKit/WebCoreSupport.subproj/WebBridge.m
  
  Index: WebBridge.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebCoreSupport.subproj/WebBridge.m,v
  retrieving revision 1.362
  retrieving revision 1.363
  diff -u -r1.362 -r1.363
  --- WebBridge.m	20 Jul 2005 22:55:06 -0000	1.362
  +++ WebBridge.m	26 Jul 2005 16:34:16 -0000	1.363
  @@ -1229,40 +1229,28 @@
   
   #define FormDelegateLog(ctrl)  LOG(FormDelegate, "control=%@", ctrl)
   
  -- (void)controlTextDidBeginEditing:(NSNotification *)obj
  +- (void)textFieldDidBeginEditing:(DOMHTMLInputElement *)element
   {
  -    FormDelegateLog([obj object]);
  -    [formDelegate(self) controlTextDidBeginEditing:obj inFrame:_frame];
  +    FormDelegateLog(element);
  +    [formDelegate(self) textFieldDidBeginEditing:element inFrame:_frame];
   }
   
  -- (void)controlTextDidEndEditing:(NSNotification *)obj
  +- (void)textFieldDidEndEditing:(DOMHTMLInputElement *)element
   {
  -    FormDelegateLog([obj object]);
  -    [formDelegate(self) controlTextDidEndEditing:obj inFrame:_frame];
  +    FormDelegateLog(element);
  +    [formDelegate(self) textFieldDidEndEditing:element inFrame:_frame];
   }
   
  -- (void)controlTextDidChange:(NSNotification *)obj
  +- (void)textDidChangeInTextField:(DOMHTMLInputElement *)element
   {
  -    FormDelegateLog([obj object]);
  -    [formDelegate(self) controlTextDidChange:obj inFrame:_frame];
  +    FormDelegateLog(element);
  +    [formDelegate(self) textDidChangeInTextField:(DOMHTMLInputElement *)element inFrame:_frame];
   }
   
  -- (void)textDidChange:(NSNotification *)obj
  +- (void)textDidChangeInTextArea:(DOMHTMLTextAreaElement *)element
   {
  -    FormDelegateLog([obj object]);
  -    [formDelegate(self) textDidChange:obj inFrame:_frame];
  -}
  -
  -- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor
  -{
  -    FormDelegateLog(control);
  -    return [formDelegate(self) control:control textShouldBeginEditing:fieldEditor inFrame:_frame];
  -}
  -
  -- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor
  -{
  -    FormDelegateLog(control);
  -    return [formDelegate(self) control:control textShouldEndEditing:fieldEditor inFrame:_frame];
  +    FormDelegateLog(element);
  +    [formDelegate(self) textDidChangeInTextArea:element inFrame:_frame];
   }
   
   - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector
  @@ -1271,10 +1259,10 @@
       return [formDelegate(self) control:control textView:textView doCommandBySelector:commandSelector inFrame:_frame];
   }
   
  -- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView shouldHandleEvent:(NSEvent *)event
  +- (BOOL)textField:(DOMHTMLInputElement *)element shouldHandleEvent:(NSEvent *)event
   {
  -    FormDelegateLog(control);
  -    return [formDelegate(self) control:control textView:textView shouldHandleEvent:event inFrame:_frame];
  +    FormDelegateLog(element);
  +    return [formDelegate(self) textField:element shouldHandleEvent:event inFrame:_frame];
   }
   
   - (void)frameDetached
  
  
  
  1.13      +7 -8      WebKit/WebView.subproj/WebFormDelegate.h
  
  Index: WebFormDelegate.h
  ===================================================================
  RCS file: /cvs/root/WebKit/WebView.subproj/WebFormDelegate.h,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- WebFormDelegate.h	20 Jul 2005 22:55:07 -0000	1.12
  +++ WebFormDelegate.h	26 Jul 2005 16:34:17 -0000	1.13
  @@ -34,6 +34,8 @@
   #import <AppKit/AppKit.h>
   
   @class DOMElement;
  + at class DOMHTMLInputElement;
  + at class DOMHTMLTextAreaElement;
   @class WebFrame;
   
   /*!
  @@ -54,16 +56,13 @@
   // analogous to similar methods in AppKit/NSControl.h.
   // These methods are forwarded from widgets used in forms to the WebFormDelegate.
   
  -- (void)controlTextDidBeginEditing:(NSNotification *)obj inFrame:(WebFrame *)frame;
  -- (void)controlTextDidEndEditing:(NSNotification *)obj inFrame:(WebFrame *)frame;
  -- (void)controlTextDidChange:(NSNotification *)obj inFrame:(WebFrame *)frame;
  -- (void)textDidChange:(NSNotification *)obj inFrame:(WebFrame *)frame;
  -
  -- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor inFrame:(WebFrame *)frame;
  -- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor inFrame:(WebFrame *)frame;
  +- (void)textFieldDidBeginEditing:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame;
  +- (void)textFieldDidEndEditing:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame;
  +- (void)textDidChangeInTextField:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame;
  +- (void)textDidChangeInTextArea:(DOMHTMLTextAreaElement *)element 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;
  +- (BOOL)textField:(DOMHTMLInputElement *)element 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.
  
  
  
  1.14      +5 -15     WebKit/WebView.subproj/WebFormDelegate.m
  
  Index: WebFormDelegate.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebView.subproj/WebFormDelegate.m,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- WebFormDelegate.m	20 Jul 2005 22:55:07 -0000	1.13
  +++ WebFormDelegate.m	26 Jul 2005 16:34:17 -0000	1.14
  @@ -45,30 +45,20 @@
       return sharedDelegate;
   }
       
  -- (void)controlTextDidBeginEditing:(NSNotification *)obj inFrame:(WebFrame *)frame { }
  +- (void)textFieldDidBeginEditing:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame { }
   
  -- (void)controlTextDidEndEditing:(NSNotification *)obj inFrame:(WebFrame *)frame { }
  +- (void)textFieldDidEndEditing:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame { }
   
  -- (void)controlTextDidChange:(NSNotification *)obj inFrame:(WebFrame *)frame { }
  +- (void)textDidChangeInTextField:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame { }
   
  -- (void)textDidChange:(NSNotification *)obj inFrame:(WebFrame *)frame { }
  -
  -- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor inFrame:(WebFrame *)frame
  -{
  -    return YES;
  -}
  -
  -- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor inFrame:(WebFrame *)frame
  -{
  -    return YES;
  -}
  +- (void)textDidChangeInTextArea:(DOMHTMLTextAreaElement *)element inFrame:(WebFrame *)frame { }
   
   - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector inFrame:(WebFrame *)frame
   {
       return NO;
   }
   
  -- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView shouldHandleEvent:(NSEvent *)event inFrame:(WebFrame *)frame
  +- (BOOL)textField:(DOMHTMLInputElement *)element shouldHandleEvent:(NSEvent *)event inFrame:(WebFrame *)frame
   {
       return NO;
   }
  
  
  



More information about the webkit-changes mailing list