[webkit-changes] cvs commit: WebCore/kwq DOMExtensions.h DOMHTML.mm DOMPrivate.h

John sullivan at opensource.apple.com
Mon Aug 1 09:12:04 PDT 2005


sullivan    05/08/01 09:12:03

  Modified:    .        ChangeLog
               kwq      DOMExtensions.h DOMHTML.mm DOMPrivate.h
  Log:
          Reviewed by Beth Dakin.
  
          Test cases added: none, this only affects Safari forms autofill
  
          Moved the recently-added isTextField method out of the public DOMExtensions.h
          and into the private DOMPrivate.h for now, and renamed it with a leading
          underscore. We want to make some sort of public API that covers this, but not
          necessarily this exact method, so we'll leave it out of the public API until we've
          thought about this more.
  
          * kwq/DOMExtensions.h:
          remove isTextField
          * kwq/DOMPrivate.h:
          add _isTextField. Also added some #imports that make this file more standalone.
          * kwq/DOMHTML.mm:
          (-[DOMHTMLInputElement _isTextField]):
          moved this method and added leading underscore.
  
  Revision  Changes    Path
  1.4513    +20 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4512
  retrieving revision 1.4513
  diff -u -r1.4512 -r1.4513
  --- ChangeLog	1 Aug 2005 09:06:28 -0000	1.4512
  +++ ChangeLog	1 Aug 2005 16:11:54 -0000	1.4513
  @@ -1,3 +1,23 @@
  +2005-08-01  John Sullivan  <sullivan at apple.com>
  +
  +        Reviewed by Beth Dakin.
  +
  +        Test cases added: none, this only affects Safari forms autofill
  +        
  +        Moved the recently-added isTextField method out of the public DOMExtensions.h
  +        and into the private DOMPrivate.h for now, and renamed it with a leading
  +        underscore. We want to make some sort of public API that covers this, but not
  +        necessarily this exact method, so we'll leave it out of the public API until we've
  +        thought about this more.
  +
  +        * kwq/DOMExtensions.h:
  +        remove isTextField
  +        * kwq/DOMPrivate.h:
  +        add _isTextField. Also added some #imports that make this file more standalone.
  +        * kwq/DOMHTML.mm:
  +        (-[DOMHTMLInputElement _isTextField]):
  +        moved this method and added leading underscore.
  +
   2005-08-01  Eric Seidel  <eseidel at apple.com>
   
           Reviewed by darin.
  
  
  
  1.11      +0 -4      WebCore/kwq/DOMExtensions.h
  
  Index: DOMExtensions.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/DOMExtensions.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DOMExtensions.h	22 Jul 2005 18:09:21 -0000	1.10
  +++ DOMExtensions.h	1 Aug 2005 16:12:03 -0000	1.11
  @@ -62,10 +62,6 @@
   - (void)setWidth:(long)width;
   @end
   
  - at interface DOMHTMLInputElement (DOMHTMLInputElementExtensions)
  -- (BOOL)isTextField;
  - at end
  -
   @interface DOMRGBColor (DOMRGBColorExtensions)
   - (DOMCSSPrimitiveValue *)alpha;
   @end
  
  
  
  1.25      +31 -34    WebCore/kwq/DOMHTML.mm
  
  Index: DOMHTML.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/DOMHTML.mm,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- DOMHTML.mm	30 Jul 2005 02:33:09 -0000	1.24
  +++ DOMHTML.mm	1 Aug 2005 16:12:03 -0000	1.25
  @@ -1461,40 +1461,6 @@
   
   @end
   
  - at implementation DOMHTMLInputElement (DOMHTMLInputElementExtensions)
  -
  -- (BOOL)isTextField
  -{
  -    static NSArray *textInputTypes = nil;
  -#ifndef NDEBUG
  -    static NSArray *nonTextInputTypes = nil;
  -#endif
  -    
  -    NSString *type = [self type];
  -    
  -    // No type at all is treated as text type
  -    if ([type length] == 0)
  -        return YES;
  -    
  -    if (textInputTypes == nil)
  -        textInputTypes = [[NSSet alloc] initWithObjects:@"text", @"password", @"search", nil];
  -    
  -    BOOL isText = [textInputTypes containsObject:[type lowercaseString]];
  -    
  -#ifndef NDEBUG
  -    if (nonTextInputTypes == nil)
  -        nonTextInputTypes = [[NSSet alloc] initWithObjects:@"isindex", @"checkbox", @"radio", @"submit", @"reset", @"file", @"hidden", @"image", @"button", @"range", nil];
  -    
  -    // Catch cases where a new input type has been added that's not in these lists.
  -    ASSERT(isText || [nonTextInputTypes containsObject:[type lowercaseString]]);
  -#endif    
  -    
  -    return isText;
  -}
  -
  - at end
  -
  -
   @implementation DOMHTMLTextAreaElement
   
   - (HTMLTextAreaElementImpl *)_textAreaElementImpl
  @@ -4024,6 +3990,37 @@
       return [(NSTextField *)viewForElement(self) stringValue];
   }
   
  +- (BOOL)_isTextField
  +{
  +    // We could make this public API as-is, or we could change it into a method that returns whether
  +    // the element is a text field or a button or ... ?
  +    static NSArray *textInputTypes = nil;
  +#ifndef NDEBUG
  +    static NSArray *nonTextInputTypes = nil;
  +#endif
  +    
  +    NSString *type = [self type];
  +    
  +    // No type at all is treated as text type
  +    if ([type length] == 0)
  +        return YES;
  +    
  +    if (textInputTypes == nil)
  +        textInputTypes = [[NSSet alloc] initWithObjects:@"text", @"password", @"search", nil];
  +    
  +    BOOL isText = [textInputTypes containsObject:[type lowercaseString]];
  +    
  +#ifndef NDEBUG
  +    if (nonTextInputTypes == nil)
  +        nonTextInputTypes = [[NSSet alloc] initWithObjects:@"isindex", @"checkbox", @"radio", @"submit", @"reset", @"file", @"hidden", @"image", @"button", @"range", nil];
  +    
  +    // Catch cases where a new input type has been added that's not in these lists.
  +    ASSERT(isText || [nonTextInputTypes containsObject:[type lowercaseString]]);
  +#endif    
  +    
  +    return isText;
  +}
  +
   - (void)_setDisplayedValue:(NSString *)newValue
   {
       // This method is used by autofill and needs to work even when the field is currently being edited.
  
  
  
  1.8       +3 -0      WebCore/kwq/DOMPrivate.h
  
  Index: DOMPrivate.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/DOMPrivate.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DOMPrivate.h	29 Jul 2005 21:16:51 -0000	1.7
  +++ DOMPrivate.h	1 Aug 2005 16:12:03 -0000	1.8
  @@ -23,6 +23,8 @@
    * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    */
   
  +#import <WebCore/DOMCSS.h>
  +#import <WebCore/DOMHTML.h>
   #import <WebCore/DOMRange.h>
   
   @interface DOMRange (WebPrivate)
  @@ -56,6 +58,7 @@
   // and these will be deleted.
   @interface DOMHTMLInputElement(FormsAutoFillTransition)
   - (NSString *)_displayedValue; // the string currently displayed in the field, even when the field is being edited
  +- (BOOL)_isTextField;
   - (void)_setDisplayedValue:(NSString *)newValue; // set the value displayed, even when the field is being edited
   - (NSRect)_rectOnScreen; // bounding box of the text field, in screen coordinates
   - (void)_replaceCharactersInRange:(NSRange)targetRange withString:(NSString *)replacementString selectingFromIndex:(int)index;
  
  
  



More information about the webkit-changes mailing list