Setting HTMLInputElement.value to null to set its value to the empty string
https://bugs.webkit.org/show_bug.cgi?id=153519

Reviewed by Ryosuke Niwa.

Source/WebCore:

Setting HTMLInputElement.value to null to set its value to the empty string:
- https://html.spec.whatwg.org/#htmlinputelement
- http://heycam.github.io/webidl/#TreatNullAs

WebKit would previously unset the value attribute instead, which caused
it to fallback to input.defaultValue if set.

Firefox and Chrome behave correctly.

Test: fast/dom/HTMLInputElement/input-value-set-null.html

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setValue):

LayoutTests:

Add a layout test to make sure that setting HTMLInputElement.value to null
actually sets its value to the empty string.

* fast/dom/HTMLInputElement/input-value-set-null-expected.txt: Added.
* fast/dom/HTMLInputElement/input-value-set-null.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@195642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
5 files changed