Bug 138403

Summary: Stop special-casing the empty string in HTMLInputElement.type setter
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue, kling, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: https://html.spec.whatwg.org/multipage/forms.html#dom-input-type
Attachments:
Description Flags
Patch
none
Patch none

Description Chris Dumez 2014-11-04 20:39:49 PST
We should stop special-casing the empty string in HTMLInputElement.type setter. Currently, if input.type is set to "", we will remove the type attribute. This is inconsistent with the spec and other browsers (tested Firefox 33 and Chrome 38). We should set the attribute to the empty string instead of removing it.
Comment 1 Chris Dumez 2014-11-04 21:40:08 PST
Created attachment 241002 [details]
Patch
Comment 2 Ryosuke Niwa 2014-11-04 22:52:40 PST
Comment on attachment 241002 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=241002&action=review

> LayoutTests/fast/dom/HTMLInputElement/input-type-attribute.html:13
> +input.type = "button";
> +shouldBeEqualToString("input.type", "button");

We should do the assignment inside shouldBeEqualToString or in evalAndLog so that it's visible in the expected result.
Comment 3 Chris Dumez 2014-11-05 09:23:04 PST
Created attachment 241033 [details]
Patch
Comment 4 WebKit Commit Bot 2014-11-05 09:41:03 PST
Comment on attachment 241033 [details]
Patch

Clearing flags on attachment: 241033

Committed r175622: <http://trac.webkit.org/changeset/175622>
Comment 5 WebKit Commit Bot 2014-11-05 09:41:07 PST
All reviewed patches have been landed.  Closing bug.