Changeset 89194 in webkit


Ignore:
Timestamp:
Jun 18, 2011 11:50:53 AM (13 years ago)
Author:
weinig@apple.com
Message:

REGRESSION (r63854-63958): placeholder not shown for number inputs
https://bugs.webkit.org/show_bug.cgi?id=61095

Reviewed by Darin Adler.

Refactor HTMLInputElement supportsPlaceholder support to delegate to the
InputType. Make BaseTextInputType and NumberInputType return true, matching
the current HTML5 spec.

  • html/BaseTextInputType.cpp:

(WebCore::BaseTextInputType::supportsPlaceholder):

  • html/BaseTextInputType.h:

Add override implementation of supportsPlaceholder that returns true.

  • html/HTMLInputElement.cpp:

(WebCore::HTMLInputElement::supportsPlaceholder):
Delegate to the InputType.

  • html/InputType.cpp:

(WebCore::InputType::supportsPlaceholder):

  • html/InputType.h:

Add base implementation of supportsPlaceholder that returns false.

  • html/NumberInputType.cpp:

(WebCore::NumberInputType::supportsPlaceholder):

  • html/NumberInputType.h:

Add override implementation of supportsPlaceholder that returns true.

Location:
trunk/Source/WebCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r89191 r89194  
     12011-06-18  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        REGRESSION (r63854-63958): placeholder not shown for number inputs
     6        https://bugs.webkit.org/show_bug.cgi?id=61095
     7
     8        Refactor HTMLInputElement supportsPlaceholder support to delegate to the
     9        InputType. Make BaseTextInputType and NumberInputType return true, matching
     10        the current HTML5 spec.
     11
     12        * html/BaseTextInputType.cpp:
     13        (WebCore::BaseTextInputType::supportsPlaceholder):
     14        * html/BaseTextInputType.h:
     15        Add override implementation of supportsPlaceholder that returns true.
     16
     17        * html/HTMLInputElement.cpp:
     18        (WebCore::HTMLInputElement::supportsPlaceholder):
     19        Delegate to the InputType.
     20
     21        * html/InputType.cpp:
     22        (WebCore::InputType::supportsPlaceholder):
     23        * html/InputType.h:
     24        Add base implementation of supportsPlaceholder that returns false.
     25
     26        * html/NumberInputType.cpp:
     27        (WebCore::NumberInputType::supportsPlaceholder):
     28        * html/NumberInputType.h:
     29        Add override implementation of supportsPlaceholder that returns true.
     30
    1312011-06-18  Sheriff Bot  <webkit.review.bot@gmail.com>
    232
  • trunk/Source/WebCore/html/BaseTextInputType.cpp

    r86292 r89194  
    5151}
    5252
     53bool BaseTextInputType::supportsPlaceholder() const
     54{
     55    return true;
     56}
     57
    5358} // namespace WebCore
  • trunk/Source/WebCore/html/BaseTextInputType.h

    r74895 r89194  
    4545    virtual bool isTextType() const;
    4646    virtual bool patternMismatch(const String&) const;
     47    virtual bool supportsPlaceholder() const;
    4748};
    4849
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r88627 r89194  
    18041804bool HTMLInputElement::supportsPlaceholder() const
    18051805{
    1806     return isTextType();
     1806    return m_inputType->supportsPlaceholder();
    18071807}
    18081808
  • trunk/Source/WebCore/html/InputType.cpp

    r87371 r89194  
    650650}
    651651
     652bool InputType::supportsPlaceholder() const
     653{
     654    return false;
     655}
     656
    652657namespace InputTypeNames {
    653658
  • trunk/Source/WebCore/html/InputType.h

    r87881 r89194  
    223223    virtual bool isSteppable() const;
    224224    virtual bool shouldRespectHeightAndWidthAttributes();
     225    virtual bool supportsPlaceholder() const;
    225226
    226227    // Parses the specified string for the type, and return
  • trunk/Source/WebCore/html/NumberInputType.cpp

    r87371 r89194  
    265265}
    266266
     267bool NumberInputType::supportsPlaceholder() const
     268{
     269    return true;
     270}
     271
    267272bool NumberInputType::isNumberField() const
    268273{
  • trunk/Source/WebCore/html/NumberInputType.h

    r87371 r89194  
    7171    virtual bool hasUnacceptableValue();
    7272    virtual bool shouldRespectSpeechAttribute();
     73    virtual bool supportsPlaceholder() const;
    7374    virtual bool isNumberField() const;
    7475};
Note: See TracChangeset for help on using the changeset viewer.