Introduce an internal feature for a fixed placeholder
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Apr 2012 08:36:38 +0000 (08:36 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Apr 2012 08:36:38 +0000 (08:36 +0000)
commit6f547be300c67b5ec5ffc277d2cf06cca6d88b96
tree04c0f7e5567076c9986d327e9378cbbe2d1237cf
parent5284a78eaa5143c9f5e1a467589dbacb6c962b97
Introduce an internal feature for a fixed placeholder
https://bugs.webkit.org/show_bug.cgi?id=84009

Reviewed by Hajime Morita.

This change adds a framework to support fixed placeholder string for
textfield-like <input> without the palceholder attribute support. This
doesn't change any behavior of input types which support the
'placeholder' attribute.

According to the standard, <input type=date> doesn't support the
'placeholder' attribute. However it is a kind of text field in WebKit
platforms with ENABLE_CALENDAR_PICKER, and we may show something useful
information as the default placeholder.

No new tests because of no behavior changes.

* html/HTMLTextFormControlElement.h:
(HTMLTextFormControlElement): Make isPlaceholderEmpty() virtual.
* html/HTMLInputElement.h:
(HTMLInputElement): Overrides isPlaceholderEmpty().
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isPlaceholderEmpty):
Check InputType::defaultPlaceholder() if InputType::usesFixedPlaceholder().
* html/InputType.cpp:
(WebCore::InputType::usesFixedPlaceholder): Added. Returns false.
(WebCore::InputType::fixedPlaceholder): Added. Returns a null string.
* html/InputType.h:
(InputType): Add usesFixedPlaceholder() and fixedPlaceholder().
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::updatePlaceholderText):
Uses fixedPlaceholder() instead of strippedPlaceholder() if usesFixedPlaceholder().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114360 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/HTMLTextFormControlElement.h
Source/WebCore/html/InputType.cpp
Source/WebCore/html/InputType.h
Source/WebCore/html/TextFieldInputType.cpp