Changeset 100965 in webkit
- Timestamp:
- Nov 21, 2011 3:13:00 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r100962 r100965 1 2011-11-21 Rakesh KN <rakesh.kn@motorola.com> 2 3 Need support for dirname attribute 4 https://bugs.webkit.org/show_bug.cgi?id=65542 5 6 Reviewed by Eric Seidel. 7 8 Implemented 'dirname' form attribute. 9 10 * fast/forms/form-dirname-attribute-expected.txt: Added. 11 * fast/forms/form-dirname-attribute.html: Added. 12 * fast/forms/submit-form-with-dirname-attribute-expected.txt: Added. 13 * fast/forms/submit-form-with-dirname-attribute-with-ancestor-dir-attribute-expected.txt: Added. 14 * fast/forms/submit-form-with-dirname-attribute-with-ancestor-dir-attribute.html: Added. 15 * fast/forms/submit-form-with-dirname-attribute-with-nonhtml-ancestor-expected.txt: Added. 16 * fast/forms/submit-form-with-dirname-attribute-with-nonhtml-ancestor.html: Added. 17 * fast/forms/submit-form-with-dirname-attribute.html: Added. 18 1 19 2011-11-21 Adam Klein <adamk@chromium.org> 2 20 -
trunk/Source/WebCore/ChangeLog
r100959 r100965 1 2011-11-21 Rakesh KN <rakesh.kn@motorola.com> 2 3 Need support for dirname attribute 4 https://bugs.webkit.org/show_bug.cgi?id=65542 5 6 Reviewed by Eric Seidel. 7 8 Implemented 'dirname' form attribute. 9 10 Tests: fast/forms/form-dirname-attribute.html 11 fast/forms/submit-form-with-dirname-attribute-with-ancestor-dir-attribute.html 12 fast/forms/submit-form-with-dirname-attribute-with-nonhtml-ancestor.html 13 fast/forms/submit-form-with-dirname-attribute.html 14 15 * html/HTMLAttributeNames.in: 16 Added "dirname" attribute. 17 * html/HTMLInputElement.idl: 18 Add "dirName" property to HTMLInputElement interface. 19 * html/HTMLTextAreaElement.cpp: 20 (WebCore::HTMLTextAreaElement::appendFormData): 21 Append dirname form data. 22 * html/HTMLTextAreaElement.idl: 23 Add "dirName" property to HTMLTextAreaElement interface. 24 * html/HTMLTextFormControlElement.cpp: 25 (WebCore::parentHTMLElement): 26 Helper function which returns only HTML parent element. 27 (WebCore::HTMLTextFormControlElement::directionForFormData): 28 Helper function for finding directionality of the Element. 29 * html/HTMLTextFormControlElement.h: 30 Helper function for finding directionality of the Element. 31 * html/TextFieldInputType.cpp: 32 (WebCore::TextFieldInputType::appendFormData): 33 Append dirname form data. 34 * html/TextFieldInputType.h: 35 Append dirname form data. 36 1 37 2011-11-21 Joshua Bell <jsbell@chromium.org> 2 38 -
trunk/Source/WebCore/html/HTMLAttributeNames.in
r100159 r100965 91 91 dir 92 92 direction 93 dirname 93 94 disabled 94 95 download -
trunk/Source/WebCore/html/HTMLInputElement.idl
r100805 r100965 24 24 attribute [ConvertNullToNullString] DOMString defaultValue; 25 25 attribute [Reflect=checked] boolean defaultChecked; 26 attribute [Reflect] DOMString dirName; 26 27 readonly attribute HTMLFormElement form; 27 28 attribute [Reflect, URL] DOMString formAction; -
trunk/Source/WebCore/html/HTMLTextAreaElement.cpp
r99821 r100965 174 174 const String& text = (m_wrap == HardWrap) ? valueWithHardLineBreaks() : value(); 175 175 encoding.appendData(name(), text); 176 return true; 176 177 const AtomicString& dirnameAttrValue = fastGetAttribute(dirnameAttr); 178 if (!dirnameAttrValue.isNull()) 179 encoding.appendData(dirnameAttrValue, directionForFormData()); 180 return true; 177 181 } 178 182 -
trunk/Source/WebCore/html/HTMLTextAreaElement.idl
r100805 r100965 27 27 readonly attribute ValidityState validity; 28 28 attribute long cols; 29 attribute [Reflect] DOMString dirName; 29 30 attribute [Reflect] boolean disabled; 30 31 attribute [Reflect] boolean autofocus; -
trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp
r99821 r100965 571 571 } 572 572 573 static const Element* parentHTMLElement(const Element* element) 574 { 575 while (element) { 576 element = element->parentElement(); 577 if (element && element->isHTMLElement()) 578 return element; 579 } 580 return 0; 581 } 582 583 String HTMLTextFormControlElement::directionForFormData() const 584 { 585 for (const Element* element = this; element; element = parentHTMLElement(element)) { 586 const AtomicString& dirAttributeValue = element->fastGetAttribute(dirAttr); 587 if (dirAttributeValue.isNull()) 588 continue; 589 590 if (equalIgnoringCase(dirAttributeValue, "rtl") || equalIgnoringCase(dirAttributeValue, "ltr")) 591 return dirAttributeValue; 592 593 if (equalIgnoringCase(dirAttributeValue, "auto")) { 594 bool isAuto; 595 TextDirection textDirection = static_cast<const HTMLElement*>(element)->directionalityIfhasDirAutoAttribute(isAuto); 596 return textDirection == RTL ? "rtl" : "ltr"; 597 } 598 } 599 600 return "ltr"; 601 } 602 573 603 } // namespace Webcore -
trunk/Source/WebCore/html/HTMLTextFormControlElement.h
r99821 r100965 80 80 String innerTextValue() const; 81 81 82 String directionForFormData() const; 83 82 84 protected: 83 85 HTMLTextFormControlElement(const QualifiedName&, Document*, HTMLFormElement*); -
trunk/Source/WebCore/html/TextFieldInputType.cpp
r99821 r100965 34 34 35 35 #include "BeforeTextInsertedEvent.h" 36 #include "FormDataList.h" 36 37 #include "Frame.h" 37 38 #include "HTMLInputElement.h" 39 #include "HTMLNames.h" 38 40 #include "KeyboardEvent.h" 39 41 #include "Page.h" … … 50 52 namespace WebCore { 51 53 54 using namespace HTMLNames; 55 52 56 TextFieldInputType::TextFieldInputType(HTMLInputElement* element) 53 57 : InputType(element) … … 365 369 } 366 370 371 bool TextFieldInputType::appendFormData(FormDataList& list, bool multipart) const 372 { 373 InputType::appendFormData(list, multipart); 374 const AtomicString& dirnameAttrValue = element()->fastGetAttribute(dirnameAttr); 375 if (!dirnameAttrValue.isNull()) 376 list.appendData(dirnameAttrValue, element()->directionForFormData()); 377 return true; 378 } 379 367 380 } // namespace WebCore -
trunk/Source/WebCore/html/TextFieldInputType.h
r99821 r100965 36 36 namespace WebCore { 37 37 38 class FormDataList; 38 39 class SpinButtonElement; 39 40 … … 78 79 virtual HTMLElement* placeholderElement() const; 79 80 virtual void updatePlaceholderText(); 81 virtual bool appendFormData(FormDataList&, bool multipart) const; 80 82 81 83 RefPtr<HTMLElement> m_container;
Note: See TracChangeset
for help on using the changeset viewer.