REGRESSION(r89915): <input type=email multiple> don't show the default value
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Oct 2011 07:34:55 +0000 (07:34 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Oct 2011 07:34:55 +0000 (07:34 +0000)
commitf70af7a63230d4954ab73280285689f2f1a2bb7f
tree19f05daf836f6c4f7d63ea39e06b653190a029a8
parent447b8c118b5378309e4b6a19e76fb825f7127f75
REGRESSION(r89915): <input type=email multiple> don't show the default value
https://bugs.webkit.org/show_bug.cgi?id=69895

Reviewed by Hajime Morita.

Source/WebCore:

m_valueIfDirty became unexpectedly empty because
EmailInputType::sanitizeValue() returned an empty string for a
null input string.

To solve this issue, HTMLInputElement::sanitizeValue() checks
nullness, and remove the null check of sanitizeValue() of
InputType subclasses.
Also, we make InputType::sanitizeValue() const.

* html/ColorInputType.cpp:
(WebCore::ColorInputType::sanitizeValue):
- Make this const.
- Remove null check.
* html/ColorInputType.h: Make sanitizeValue() const.
* html/EmailInputType.cpp:
(WebCore::EmailInputType::sanitizeValue): Make this const.
* html/EmailInputType.h: Make sanitizeValue() const.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::sanitizeValue):
(WebCore::HTMLInputElement::updateValueIfNeeded):
* html/InputType.cpp:
(WebCore::InputType::sanitizeValue):
Returns a null string if the input string is null, and
don't call InputType::sanitizeValue() in this case.
* html/InputType.h: Make sanitizeValue() const.
* html/NumberInputType.cpp:
(WebCore::NumberInputType::sanitizeValue): Make this const.
* html/NumberInputType.h: Make sanitizeValue() const.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::sanitizeValue):
- Make this const.
- Remove null check.
* html/RangeInputType.h: Make sanitizeValue() const.
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::sanitizeValue): Make this const.
* html/TextFieldInputType.h: Make sanitizeValue() const.

LayoutTests:

* fast/forms/input-value-sanitization-expected.txt:
* fast/forms/input-value-sanitization.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97351 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/input-value-sanitization-expected.txt
LayoutTests/fast/forms/input-value-sanitization.html
Source/WebCore/ChangeLog
Source/WebCore/html/ColorInputType.cpp
Source/WebCore/html/ColorInputType.h
Source/WebCore/html/EmailInputType.cpp
Source/WebCore/html/EmailInputType.h
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/InputType.cpp
Source/WebCore/html/InputType.h
Source/WebCore/html/NumberInputType.cpp
Source/WebCore/html/NumberInputType.h
Source/WebCore/html/RangeInputType.cpp
Source/WebCore/html/RangeInputType.h
Source/WebCore/html/TextFieldInputType.cpp
Source/WebCore/html/TextFieldInputType.h