Bug 138403 - Stop special-casing the empty string in HTMLInputElement.type setter
Summary: Stop special-casing the empty string in HTMLInputElement.type setter
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://html.spec.whatwg.org/multipag...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-04 20:39 PST by Chris Dumez
Modified: 2014-11-05 09:41 PST (History)
4 users (show)

See Also:


Attachments
Patch (8.68 KB, patch)
2014-11-04 21:40 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (8.90 KB, patch)
2014-11-05 09:23 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.