Changeset 106792 in webkit


Ignore:
Timestamp:
Feb 6, 2012 2:18:57 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

https://bugs.webkit.org/show_bug.cgi?id=76995.
WebKit fails IETC :indeterminate and input type=radio test.

All input types should respect indeterminate property(getter and setter). This is true with other browsers.
Indeterminate appearance for radio input type is supported by IOS platform. Webkit need not support indeterminate appearance
for radio input type on other platforms.

Patch by Joe Thomas <joethomas@motorola.com> on 2012-02-06
Reviewed by Kent Tamura.

Source/WebCore:

Test: fast/forms/indeterminate-input-types.html

  • html/CheckboxInputType.cpp:

(WebCore::CheckboxInputType::supportsIndeterminateAppearance): Checks indeterminate appearance is supported.
(WebCore):

  • html/CheckboxInputType.h:

(CheckboxInputType):

  • html/HTMLInputElement.cpp:

(WebCore::HTMLInputElement::setIndeterminate): Removed the check isCheckable().
(WebCore::HTMLInputElement::isIndeterminate): Checks indeterminate appearance is supported.
(WebCore):

  • html/HTMLInputElement.h:

(HTMLInputElement):

  • html/InputType.cpp:

(WebCore::InputType::supportsIndeterminateAppearance): Checks indeterminate appearance is supported.
(WebCore):

  • html/InputType.h:

(InputType):

  • html/RadioInputType.cpp:

(WebCore::RadioInputType::willDispatchClick): Indeterminate related code is moved to IOS specific.
(WebCore::RadioInputType::didDispatchClick): Ditto.
(WebCore::RadioInputType::supportsIndeterminateAppearance): Checks indeterminate appearance is supported.
(WebCore):

  • html/RadioInputType.h:

(RadioInputType):

LayoutTests:

  • fast/forms/indeterminate-input-types-expected.txt: Added.
  • fast/forms/indeterminate-input-types.html: Added.
  • fast/forms/indeterminate-radio.html:
Location:
trunk
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r106789 r106792  
     12012-02-06  Joe Thomas  <joethomas@motorola.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=76995.
     4        WebKit fails IETC :indeterminate and input type=radio test.
     5
     6        All input types should respect indeterminate property(getter and setter). This is true with other browsers.
     7        Indeterminate appearance for radio input type is supported by IOS platform. Webkit need not support indeterminate appearance
     8        for radio input type on other platforms.
     9
     10        Reviewed by Kent Tamura.
     11
     12        * fast/forms/indeterminate-input-types-expected.txt: Added.
     13        * fast/forms/indeterminate-input-types.html: Added.
     14        * fast/forms/indeterminate-radio.html:
     15
    1162012-02-06  Nikolas Zimmermann  <nzimmermann@rim.com>
    217
  • trunk/LayoutTests/fast/forms/indeterminate-radio.html

    r105980 r106792  
    66    div
    77    {
    8         color: red;
     8        color: green;
    99    }
    1010    input:indeterminate + #test
    1111    {
    12         color: green;
     12        color: red;
    1313    }
    1414</style>
  • trunk/Source/WebCore/ChangeLog

    r106791 r106792  
     12012-02-06  Joe Thomas  <joethomas@motorola.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=76995.
     4        WebKit fails IETC :indeterminate and input type=radio test.
     5
     6        All input types should respect indeterminate property(getter and setter). This is true with other browsers.
     7        Indeterminate appearance for radio input type is supported by IOS platform. Webkit need not support indeterminate appearance
     8        for radio input type on other platforms.
     9
     10        Reviewed by Kent Tamura.
     11
     12        Test: fast/forms/indeterminate-input-types.html
     13
     14        * html/CheckboxInputType.cpp:
     15        (WebCore::CheckboxInputType::supportsIndeterminateAppearance): Checks indeterminate appearance is supported.
     16        (WebCore):
     17        * html/CheckboxInputType.h:
     18        (CheckboxInputType):
     19        * html/HTMLInputElement.cpp:
     20        (WebCore::HTMLInputElement::setIndeterminate): Removed the check isCheckable().
     21        (WebCore::HTMLInputElement::isIndeterminate): Checks indeterminate appearance is supported.
     22        (WebCore):
     23        * html/HTMLInputElement.h:
     24        (HTMLInputElement):
     25        * html/InputType.cpp:
     26        (WebCore::InputType::supportsIndeterminateAppearance): Checks indeterminate appearance is supported.
     27        (WebCore):
     28        * html/InputType.h:
     29        (InputType):
     30        * html/RadioInputType.cpp:
     31        (WebCore::RadioInputType::willDispatchClick): Indeterminate related code is moved to IOS specific.
     32        (WebCore::RadioInputType::didDispatchClick): Ditto.
     33        (WebCore::RadioInputType::supportsIndeterminateAppearance): Checks indeterminate appearance is supported.
     34        (WebCore):
     35        * html/RadioInputType.h:
     36        (RadioInputType):
     37
    1382012-02-06  Robin Cao  <robin.cao@torchmobile.com.cn>
    239
  • trunk/Source/WebCore/html/CheckboxInputType.cpp

    r105710 r106792  
    102102}
    103103
     104bool CheckboxInputType::supportsIndeterminateAppearance() const
     105{
     106    return true;
     107}
     108
    104109} // namespace WebCore
  • trunk/Source/WebCore/html/CheckboxInputType.h

    r103400 r106792  
    4949    virtual void didDispatchClick(Event*, const ClickHandlingState&) OVERRIDE;
    5050    virtual bool isCheckbox() const OVERRIDE;
     51    virtual bool supportsIndeterminateAppearance() const OVERRIDE;
    5152};
    5253
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r106769 r106792  
    935935void HTMLInputElement::setIndeterminate(bool newValue)
    936936{
    937     if (!m_inputType->isCheckable() || indeterminate() == newValue)
     937    if (indeterminate() == newValue)
    938938        return;
    939939
     
    18181818}
    18191819
     1820bool HTMLInputElement::isIndeterminate() const
     1821{
     1822    return m_inputType->supportsIndeterminateAppearance() && indeterminate();
     1823}
     1824
    18201825} // namespace
  • trunk/Source/WebCore/html/HTMLInputElement.h

    r106769 r106792  
    129129    // shouldAppearChecked is used by the rendering tree/CSS while checked() is used by JS to determine checked state
    130130    bool shouldAppearChecked() const;
    131     virtual bool isIndeterminate() const { return indeterminate(); }
     131    virtual bool isIndeterminate() const;
    132132
    133133    int size() const;
  • trunk/Source/WebCore/html/InputType.cpp

    r105937 r106792  
    732732}
    733733
     734bool InputType::supportsIndeterminateAppearance() const
     735{
     736    return false;
     737}
     738
    734739namespace InputTypeNames {
    735740
  • trunk/Source/WebCore/html/InputType.h

    r105937 r106792  
    264264    virtual String serialize(double) const;
    265265
     266    virtual bool supportsIndeterminateAppearance() const;
     267
    266268protected:
    267269    InputType(HTMLInputElement* element) : m_element(element) { }
  • trunk/Source/WebCore/html/RadioInputType.cpp

    r105710 r106792  
    153153
    154154    state->checked = element()->checked();
     155    state->checkedRadioButton = element()->checkedRadioButtons().checkedButtonForGroup(element()->name());
     156
     157#if PLATFORM(IOS)
    155158    state->indeterminate = element()->indeterminate();
    156     state->checkedRadioButton = element()->checkedRadioButtons().checkedButtonForGroup(element()->name());
    157159
    158160    if (element()->indeterminate())
    159161        element()->setIndeterminate(false);
     162#endif
     163
    160164    element()->setChecked(true, true);
    161165
     
    175179            checkedRadioButton->setChecked(true);
    176180        }
     181
     182#if PLATFORM(IOS)       
    177183        element()->setIndeterminate(state.indeterminate);
     184#endif
     185
    178186    }
    179187
     
    187195}
    188196
     197bool RadioInputType::supportsIndeterminateAppearance() const
     198{
     199#if PLATFORM(IOS)
     200    return true;
     201#else
     202    return false;
     203#endif
     204}
     205
    189206} // namespace WebCore
  • trunk/Source/WebCore/html/RadioInputType.h

    r105710 r106792  
    5353    virtual void didDispatchClick(Event*, const ClickHandlingState&) OVERRIDE;
    5454    virtual bool isRadioButton() const OVERRIDE;
     55    virtual bool supportsIndeterminateAppearance() const OVERRIDE;
    5556};
    5657
Note: See TracChangeset for help on using the changeset viewer.