Changeset 56637 in webkit
- Timestamp:
- Mar 26, 2010 12:40:40 PM (14 years ago)
- Location:
- trunk/WebKit/chromium
- Files:
-
- 4 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/chromium/ChangeLog
r56630 r56637 1 2010-03-24 James Hawkins <jhawkins@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 [Chromium] Implement WebFormControlElement and WebSelectElement. Add 6 a getFormControlElements method to WebFormElement. 7 8 https://bugs.webkit.org/show_bug.cgi?id=36562 9 10 * WebKit.gyp: 11 * public/WebElement.h: 12 * public/WebFormControlElement.h: Added. 13 * public/WebFormElement.h: 14 * public/WebInputElement.h: 15 (WebKit::WebInputElement::WebInputElement): 16 (WebKit::WebInputElement::operator=): 17 (WebKit::WebInputElement::assign): 18 * public/WebSelectElement.h: Added. 19 * src/WebElement.cpp: 20 (WebKit::WebElement::isFormControlElement): 21 * src/WebFormControlElement.cpp: Added. 22 * src/WebFormElement.cpp: 23 (WebKit::WebFormElement::getFormControlElements): 24 * src/WebInputElement.cpp: 25 (WebKit::WebInputElement::WebInputElement): 26 * src/WebSelectElement.cpp: Added. 27 1 28 2010-03-26 Andrey Kosyakov <caseq@chromium.org> 2 29 -
trunk/WebKit/chromium/WebKit.gyp
r56579 r56637 121 121 'public/WebFrameClient.h', 122 122 'public/WebFontCache.h', 123 'public/WebFormControlElement.h', 123 124 'public/WebFormElement.h', 124 125 'public/WebGlyphCache.h', … … 173 174 'public/WebSecurityOrigin.h', 174 175 'public/WebSecurityPolicy.h', 176 'public/WebSelectElement.h', 175 177 'public/WebSerializedScriptValue.h', 176 178 'public/WebSettings.h', … … 312 314 'src/WebFileChooserCompletionImpl.h', 313 315 'src/WebFontCache.cpp', 316 'src/WebFormControlElement.cpp', 314 317 'src/WebFormElement.cpp', 315 318 'src/WebFrameImpl.cpp', … … 359 362 'src/WebSecurityOrigin.cpp', 360 363 'src/WebSecurityPolicy.cpp', 364 'src/WebSelectElement.cpp', 361 365 'src/WebSerializedScriptValue.cpp', 362 366 'src/WebSettingsImpl.cpp', -
trunk/WebKit/chromium/public/WebElement.h
r55866 r56637 48 48 void assign(const WebElement& e) { WebNode::assign(e); } 49 49 50 WEBKIT_API bool isFormControlElement() const; 50 51 WEBKIT_API WebString tagName() const; 51 52 WEBKIT_API bool hasTagName(const WebString&) const; -
trunk/WebKit/chromium/public/WebFormElement.h
r55866 r56637 32 32 #define WebFormElement_h 33 33 34 #include "Web InputElement.h"34 #include "WebElement.h" 35 35 #include "WebVector.h" 36 36 … … 40 40 41 41 namespace WebKit { 42 43 class WebInputElement; 44 class WebFormControlElement; 45 42 46 // A container for passing around a reference to a form element. Provides 43 47 // some information about the form. … … 63 67 // FIXME: Deprecate and replace with WebVector<WebElement>. 64 68 WEBKIT_API void getNamedElements(const WebString&, WebVector<WebNode>&); 69 // DEPRECATED: Replaced by getFormControlElements. 65 70 WEBKIT_API void getInputElements(WebVector<WebInputElement>&) const; 71 WEBKIT_API void getFormControlElements(WebVector<WebFormControlElement>&) const; 66 72 67 73 #if WEBKIT_IMPLEMENTATION -
trunk/WebKit/chromium/public/WebInputElement.h
r55866 r56637 32 32 #define WebInputElement_h 33 33 34 #include "Web Element.h"34 #include "WebFormControlElement.h" 35 35 36 36 #if WEBKIT_IMPLEMENTATION … … 41 41 42 42 // Provides readonly access to some properties of a DOM input element node. 43 class WebInputElement : public Web Element {43 class WebInputElement : public WebFormControlElement { 44 44 public: 45 WebInputElement() : Web Element() { }46 WebInputElement(const WebInputElement& n) : WebElement(n) { }45 WebInputElement() : WebFormControlElement() { } 46 WebInputElement(const WebInputElement& e) : WebFormControlElement(e) { } 47 47 48 WebInputElement& operator=(const WebInputElement& n) { WebElement::assign(n); return *this; } 49 WEBKIT_API void assign(const WebInputElement& n) { WebElement::assign(n); } 48 WebInputElement& operator=(const WebInputElement& e) 49 { 50 WebFormControlElement::assign(e); 51 return *this; 52 } 53 WEBKIT_API void assign(const WebInputElement& e) { WebFormControlElement::assign(e); } 50 54 51 55 enum InputType { … … 79 83 WEBKIT_API bool isEnabledFormControl() const; 80 84 WEBKIT_API InputType inputType() const; 81 WEBKIT_API WebString formControlType() const;82 85 WEBKIT_API bool isActivatedSubmit() const; 83 86 WEBKIT_API void setActivatedSubmit(bool); … … 87 90 WEBKIT_API void dispatchFormControlChangeEvent(); 88 91 WEBKIT_API void setSelectionRange(int, int); 92 // DEPRECATED: The following two methods have been moved to WebFormControlElement. 89 93 WEBKIT_API WebString name() const; 90 94 // Returns the name that should be used for the specified |element| when 91 // storing autofill data. This is either the field name or its id, an empty92 // string if it has no name and no id.95 // storing AutoFill data. This is either the field name or its id, an 96 // empty string if it has no name and no id. 93 97 WEBKIT_API WebString nameForAutofill() const; 94 98 -
trunk/WebKit/chromium/src/WebElement.cpp
r55866 r56637 38 38 39 39 namespace WebKit { 40 41 bool WebElement::isFormControlElement() const 42 { 43 return constUnwrap<Element>()->isFormControlElement(); 44 } 40 45 41 46 WebString WebElement::tagName() const -
trunk/WebKit/chromium/src/WebFormElement.cpp
r55866 r56637 36 36 #include "HTMLInputElement.h" 37 37 #include "HTMLNames.h" 38 #include "WebFormControlElement.h" 39 #include "WebInputElement.h" 38 40 #include "WebString.h" 39 41 #include "WebURL.h" … … 89 91 } 90 92 93 void WebFormElement::getFormControlElements(WebVector<WebFormControlElement>& result) const 94 { 95 const HTMLFormElement* form = constUnwrap<HTMLFormElement>(); 96 Vector<RefPtr<HTMLFormControlElement> > tempVector; 97 for (size_t i = 0; i < form->formElements.size(); i++) { 98 if (form->formElements[i]->hasLocalName(HTMLNames::inputTag) 99 || form->formElements[i]->hasLocalName(HTMLNames::selectTag)) 100 tempVector.append(form->formElements[i]); 101 } 102 result.assign(tempVector); 103 } 104 91 105 WebFormElement::WebFormElement(const PassRefPtr<HTMLFormElement>& e) 92 106 : WebElement(e) -
trunk/WebKit/chromium/src/WebInputElement.cpp
r55866 r56637 56 56 } 57 57 58 WebString WebInputElement::formControlType() const59 {60 return constUnwrap<HTMLInputElement>()->formControlType();61 }62 63 58 bool WebInputElement::isActivatedSubmit() const 64 59 { … … 115 110 116 111 WebInputElement::WebInputElement(const PassRefPtr<HTMLInputElement>& elem) 117 : Web Element(elem)112 : WebFormControlElement(elem) 118 113 { 119 114 }
Note: See TracChangeset
for help on using the changeset viewer.