Changeset 175622 in webkit
- Timestamp:
- Nov 5, 2014 9:41:08 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r175617 r175622 1 2014-11-05 Chris Dumez <cdumez@apple.com> 2 3 Stop special-casing the empty string in HTMLInputElement.type setter 4 https://bugs.webkit.org/show_bug.cgi?id=138403 5 6 Reviewed by Ryosuke Niwa. 7 8 Add layout test to check the functionality of the HTMLInputElement.type 9 getter and setter. 10 11 * fast/dom/HTMLInputElement/input-type-attribute-expected.txt: Added. 12 * fast/dom/HTMLInputElement/input-type-attribute.html: Added. 13 1 14 2014-11-05 Andreas Kling <akling@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r175621 r175622 1 2014-11-05 Chris Dumez <cdumez@apple.com> 2 3 Stop special-casing the empty string in HTMLInputElement.type setter 4 https://bugs.webkit.org/show_bug.cgi?id=138403 5 6 Reviewed by Ryosuke Niwa. 7 8 Stop special-casing the empty string in HTMLInputElement.type setter. 9 Previously, if input.type is set to "", we would remove the type 10 attribute. This is inconsistent with the specification and the behavior 11 of other browsers (tested Firefox 33 and Chrome 38). Instead, we should 12 set the attribute to the empty string. 13 14 Also stop treating null as a null string to align with the 15 specification and other browsers (tested Firefox 33 and Chrome 38). 16 17 Finally, update HTMLInputElement::setType() to take an AtomicString in 18 argument instead of a String as it ends up calling setAttribute(), and 19 thus needing an AtomicString. 20 21 22 Test: fast/dom/HTMLInputElement/input-type-attribute.html 23 24 * html/FileInputType.cpp: 25 (WebCore::UploadButtonElement::UploadButtonElement): 26 * html/HTMLInputElement.cpp: 27 (WebCore::HTMLInputElement::setType): 28 * html/HTMLInputElement.h: 29 * html/HTMLInputElement.idl: 30 1 31 2014-11-05 peavo@outlook.com <peavo@outlook.com> 2 32 -
trunk/Source/WebCore/html/FileInputType.cpp
r171833 r175622 72 72 : HTMLInputElement(inputTag, document, 0, false) 73 73 { 74 setType(A SCIILiteral("button"));74 setType(AtomicString("button", AtomicString::ConstructFromLiteral)); 75 75 setPseudo(AtomicString("-webkit-file-upload-button", AtomicString::ConstructFromLiteral)); 76 76 } -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r175212 r175622 426 426 } 427 427 428 void HTMLInputElement::setType(const String& type) 429 { 430 // FIXME: This should just call setAttribute. No reason to handle the empty string specially. 431 // We should write a test case to show that setting to the empty string does not remove the 432 // attribute in other browsers and then fix this. Note that setting to null *does* remove 433 // the attribute and setAttribute implements that. 434 if (type.isEmpty()) 435 removeAttribute(typeAttr); 436 else 437 setAttribute(typeAttr, type); 428 void HTMLInputElement::setType(const AtomicString& type) 429 { 430 setAttribute(typeAttr, type); 438 431 } 439 432 -
trunk/Source/WebCore/html/HTMLInputElement.h
r175328 r175622 168 168 float decorationWidth() const; 169 169 170 void setType(const String&);170 void setType(const AtomicString&); 171 171 172 172 virtual String value() const override; -
trunk/Source/WebCore/html/HTMLInputElement.idl
r172259 r175622 55 55 [Reflect, URL] attribute DOMString src; 56 56 [Reflect] attribute DOMString step; 57 [TreatNullAs=NullString]attribute DOMString type; // readonly dropped as part of DOM level 257 attribute DOMString type; // readonly dropped as part of DOM level 2 58 58 [TreatNullAs=NullString] attribute DOMString defaultValue; 59 59 // See the discussion in https://bugs.webkit.org/show_bug.cgi?id=100085
Note: See TracChangeset
for help on using the changeset viewer.