[webkit-changes] cvs commit: WebKit/WebView.subproj
WebHTMLRepresentation.h WebHTMLRepresentation.m
John
sullivan at opensource.apple.com
Fri Jul 22 11:09:26 PDT 2005
sullivan 05/07/22 11:09:26
Modified: . ChangeLog
kwq DOMExtensions.h DOMHTML.mm WebCoreBridge.h
WebCoreBridge.mm
. ChangeLog PublicHeaderChangesFromTiger.txt
WebView.subproj WebHTMLRepresentation.h
WebHTMLRepresentation.m
Log:
WebCore:
Reviewed by Chris Blumenberg.
Test cases added: none, this only affects Safari autocomplete; it doesn't affect any
web pages.
- some changes in the direction of weaning all the form-related SPI from NSView
* kwq/DOMExtensions.h:
added -[DOMHTMLInputElement isTextField]
* kwq/DOMHTML.mm:
(-[DOMHTMLInputElement isTextField]):
new method that returns YES if this element is one of the types that's represented
by a text field (as opposed to a button, slider, etc.). I could have put this method
in Safari, but it seems useful for other WebKit clients.
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge viewForElement:]):
added viewForElement: as a stopgap measure. This allowed me to convert controlsInForm:
to return DOMElements rather than NSViews, while keeping autocomplete working in
Safari tip of tree. When I finish the SPI conversion I'll delete this method. Note that
from this point on, autocomplete will not work in Tiger Safari with tip of tree WebKit
(it will always fail to find anything to autocomplete)
(-[WebCoreBridge controlsInForm:]):
now returns an array of DOMElement* rather than an array of NSView*
WebKit:
Reviewed by Chris Blumenberg.
- some changes in the direction of weaning all the form-related SPI from NSView
* PublicHeaderChangesFromTiger.txt:
noted that the WebCore change to add -[DOMHTMLInputElement isTextField] to
DOMExtensions.h is a public header change.
* WebView.subproj/WebHTMLRepresentation.h:
* WebView.subproj/WebHTMLRepresentation.m:
(-[WebHTMLRepresentation viewForElement:]):
added viewForElement: as a stopgap measure. This allowed me to convert controlsInForm:
to return DOMElements rather than NSViews, while keeping autocomplete working in
Safari tip of tree. When I finish the SPI conversion I'll delete this method. Note that
from this point on, autocomplete will not work in Tiger Safari with tip of tree WebKit
(it will always fail to find anything to autocomplete)
Revision Changes Path
1.4460 +26 -14 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.4459
retrieving revision 1.4460
diff -u -r1.4459 -r1.4460
--- ChangeLog 21 Jul 2005 20:33:49 -0000 1.4459
+++ ChangeLog 22 Jul 2005 18:09:18 -0000 1.4460
@@ -1,33 +1,45 @@
-2005-07-21 Geoffrey Garen <ggaren at apple.com>
+2005-07-22 John Sullivan <sullivan at apple.com>
- Reviewed by NOBODY (OOPS!).
+ Reviewed by Chris Blumenberg.
+
+ Test cases added: none, this only affects Safari autocomplete; it doesn't affect any
+ web pages.
- Test cases added: (NONE)
+ - some changes in the direction of weaning all the form-related SPI from NSView
- * WebCore.pbproj/project.pbxproj: Removed.
+ * kwq/DOMExtensions.h:
+ added -[DOMHTMLInputElement isTextField]
+ * kwq/DOMHTML.mm:
+ (-[DOMHTMLInputElement isTextField]):
+ new method that returns YES if this element is one of the types that's represented
+ by a text field (as opposed to a button, slider, etc.). I could have put this method
+ in Safari, but it seems useful for other WebKit clients.
+
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge viewForElement:]):
+ added viewForElement: as a stopgap measure. This allowed me to convert controlsInForm:
+ to return DOMElements rather than NSViews, while keeping autocomplete working in
+ Safari tip of tree. When I finish the SPI conversion I'll delete this method. Note that
+ from this point on, autocomplete will not work in Tiger Safari with tip of tree WebKit
+ (it will always fail to find anything to autocomplete)
+ (-[WebCoreBridge controlsInForm:]):
+ now returns an array of DOMElement* rather than an array of NSView*
2005-07-21 Geoffrey Garen <ggaren at apple.com>
- Reviewed by NOBODY (OOPS!).
+ * WebCore.pbproj/project.pbxproj: Removed.
- Test cases added: (NONE)
+2005-07-21 Geoffrey Garen <ggaren at apple.com>
* WebCore.xcodeproj/.cvsignore: Added.
2005-07-21 Geoffrey Garen <ggaren at apple.com>
- Reviewed by NOBODY (OOPS!).
-
- Test cases added: (NONE)
-
* WebCore.xcodeproj/project.pbxproj: Added.
2005-07-21 Geoffrey Garen <ggaren at apple.com>
- Reviewed by NOBODY (OOPS!).
-
- Test cases added: (NONE)
-
* Makefile.am:
2005-07-21 Beth Dakin <bdakin at apple.com>
1.10 +4 -0 WebCore/kwq/DOMExtensions.h
Index: DOMExtensions.h
===================================================================
RCS file: /cvs/root/WebCore/kwq/DOMExtensions.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- DOMExtensions.h 25 May 2004 21:00:02 -0000 1.9
+++ DOMExtensions.h 22 Jul 2005 18:09:21 -0000 1.10
@@ -62,6 +62,10 @@
- (void)setWidth:(long)width;
@end
+ at interface DOMHTMLInputElement (DOMHTMLInputElementExtensions)
+- (BOOL)isTextField;
+ at end
+
@interface DOMRGBColor (DOMRGBColorExtensions)
- (DOMCSSPrimitiveValue *)alpha;
@end
1.22 +34 -0 WebCore/kwq/DOMHTML.mm
Index: DOMHTML.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/DOMHTML.mm,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- DOMHTML.mm 18 Jul 2005 21:52:35 -0000 1.21
+++ DOMHTML.mm 22 Jul 2005 18:09:22 -0000 1.22
@@ -1462,6 +1462,40 @@
@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
1.340 +1 -0 WebCore/kwq/WebCoreBridge.h
Index: WebCoreBridge.h
===================================================================
RCS file: /cvs/root/WebCore/kwq/WebCoreBridge.h,v
retrieving revision 1.339
retrieving revision 1.340
diff -u -r1.339 -r1.340
--- WebCoreBridge.h 20 Jul 2005 22:55:00 -0000 1.339
+++ WebCoreBridge.h 22 Jul 2005 18:09:22 -0000 1.340
@@ -283,6 +283,7 @@
- (DOMElement *)elementWithName:(NSString *)name inForm:(DOMElement *)form;
- (DOMElement *)elementForView:(NSView *)view;
+- (NSView *)viewForElement:(DOMElement *)view; // introduced temporarily to ease transition to view-free form SPI
- (BOOL)elementDoesAutoComplete:(DOMElement *)element;
- (BOOL)elementIsPassword:(DOMElement *)element;
- (DOMElement *)formForElement:(DOMElement *)element;
1.404 +10 -7 WebCore/kwq/WebCoreBridge.mm
Index: WebCoreBridge.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/WebCoreBridge.mm,v
retrieving revision 1.403
retrieving revision 1.404
diff -u -r1.403 -r1.404
--- WebCoreBridge.mm 18 Jul 2005 21:52:36 -0000 1.403
+++ WebCoreBridge.mm 22 Jul 2005 18:09:22 -0000 1.404
@@ -909,6 +909,11 @@
return nil;
}
+- (NSView *)viewForElement:(DOMElement *)element
+{
+ return viewForElement([element _elementImpl]);
+}
+
static HTMLInputElementImpl *inputElementFromDOMElement(DOMElement *element)
{
NodeImpl *node = [element _nodeImpl];
@@ -989,13 +994,11 @@
QPtrVector<HTMLGenericFormElementImpl> &elements = formElement->formElements;
for (unsigned int i = 0; i < elements.count(); i++) {
if (elements.at(i)->isEnumeratable()) { // Skip option elements, other duds
- NSView *view = viewForElement(elements.at(i));
- if (view) {
- if (!results) {
- results = [NSMutableArray arrayWithObject:view];
- } else {
- [results addObject:view];
- }
+ DOMElement *de = [DOMElement _elementWithImpl:elements.at(i)];
+ if (!results) {
+ results = [NSMutableArray arrayWithObject:de];
+ } else {
+ [results addObject:de];
}
}
}
1.3250 +19 -8 WebKit/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebKit/ChangeLog,v
retrieving revision 1.3249
retrieving revision 1.3250
diff -u -r1.3249 -r1.3250
--- ChangeLog 22 Jul 2005 01:56:58 -0000 1.3249
+++ ChangeLog 22 Jul 2005 18:09:23 -0000 1.3250
@@ -1,3 +1,22 @@
+2005-07-22 John Sullivan <sullivan at apple.com>
+
+ Reviewed by Chris Blumenberg.
+
+ - some changes in the direction of weaning all the form-related SPI from NSView
+
+ * PublicHeaderChangesFromTiger.txt:
+ noted that the WebCore change to add -[DOMHTMLInputElement isTextField] to
+ DOMExtensions.h is a public header change.
+
+ * WebView.subproj/WebHTMLRepresentation.h:
+ * WebView.subproj/WebHTMLRepresentation.m:
+ (-[WebHTMLRepresentation viewForElement:]):
+ added viewForElement: as a stopgap measure. This allowed me to convert controlsInForm:
+ to return DOMElements rather than NSViews, while keeping autocomplete working in
+ Safari tip of tree. When I finish the SPI conversion I'll delete this method. Note that
+ from this point on, autocomplete will not work in Tiger Safari with tip of tree WebKit
+ (it will always fail to find anything to autocomplete)
+
2005-07-21 Adele Peterson <adele at apple.com>
Reviewed by Darin.
@@ -24,26 +43,18 @@
2005-07-21 Geoffrey Garen <ggaren at apple.com>
- Reviewed by NOBODY (OOPS!).
-
* WebKit.pbproj/project.pbxproj: Removed.
2005-07-21 Geoffrey Garen <ggaren at apple.com>
- Reviewed by NOBODY (OOPS!).
-
* WebKit.xcodeproj/.cvsignore: Added.
2005-07-21 Geoffrey Garen <ggaren at apple.com>
- Reviewed by NOBODY (OOPS!).
-
* WebKit.xcodeproj/project.pbxproj: Added.
2005-07-21 Geoffrey Garen <ggaren at apple.com>
- Reviewed by NOBODY (OOPS!).
-
* Makefile.am:
2005-07-20 John Sullivan <sullivan at apple.com>
1.2 +6 -0 WebKit/PublicHeaderChangesFromTiger.txt
Index: PublicHeaderChangesFromTiger.txt
===================================================================
RCS file: /cvs/root/WebKit/PublicHeaderChangesFromTiger.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PublicHeaderChangesFromTiger.txt 22 Jun 2005 21:32:06 -0000 1.1
+++ PublicHeaderChangesFromTiger.txt 22 Jul 2005 18:09:24 -0000 1.2
@@ -3,6 +3,12 @@
When you make changes to public header files, please update this file, in the same general style as the ChangeLog file (new entries at top).
===============================================
+2005-07-22 John Sullivan <sullivan at apple.com>
+
+Added -[DOMHTMLInputElement isTextField] to DOMExtensions.h (in WebCore, copied by build steps to WebKit).
+This is used by autocomplete code in Safari and could be moved there, but is a better fit in WebKit and
+is useful for developers.
+
2005-06-22 John Sullivan <sullivan at apple.com>
Added the following values to the enum of WebMenuItem tags in WebUIDelegate.h:
1.28 +1 -0 WebKit/WebView.subproj/WebHTMLRepresentation.h
Index: WebHTMLRepresentation.h
===================================================================
RCS file: /cvs/root/WebKit/WebView.subproj/WebHTMLRepresentation.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- WebHTMLRepresentation.h 5 Jun 2005 17:54:47 -0000 1.27
+++ WebHTMLRepresentation.h 22 Jul 2005 18:09:25 -0000 1.28
@@ -52,6 +52,7 @@
- (DOMElement *)elementWithName:(NSString *)name inForm:(DOMElement *)form;
- (DOMElement *)elementForView:(NSView *)view;
+- (NSView *)viewForElement:(DOMElement *)element; // introduced temporarily to ease transition to view-free form SPI
- (BOOL)elementDoesAutoComplete:(DOMElement *)element;
- (BOOL)elementIsPassword:(DOMElement *)element;
- (DOMElement *)formForElement:(DOMElement *)element;
1.55 +5 -0 WebKit/WebView.subproj/WebHTMLRepresentation.m
Index: WebHTMLRepresentation.m
===================================================================
RCS file: /cvs/root/WebKit/WebView.subproj/WebHTMLRepresentation.m,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- WebHTMLRepresentation.m 13 Jun 2005 03:28:08 -0000 1.54
+++ WebHTMLRepresentation.m 22 Jul 2005 18:09:25 -0000 1.55
@@ -213,6 +213,11 @@
return [_private->bridge elementForView:view];
}
+- (NSView *)viewForElement:(DOMElement *)element
+{
+ return [_private->bridge viewForElement:element];
+}
+
- (BOOL)elementDoesAutoComplete:(DOMElement *)element
{
return [_private->bridge elementDoesAutoComplete:element];
More information about the webkit-changes
mailing list