Changeset 146860 in webkit


Ignore:
Timestamp:
Mar 26, 2013 1:26:04 AM (11 years ago)
Author:
tkent@chromium.org
Message:

Rename HTMLInputElement::isIndeterminate to Element::shouldAppearIndeterminate
https://bugs.webkit.org/show_bug.cgi?id=113264

Reviewed by Kentaro Hara.

HTMLInputElement had indeterminate() and isIndeterminate(). It's very
confusing.

Because indeterminate is a public DOM function and isIndeterminate is
for CSS and rendering, we rename isIndetermiante to
shouldAppearIndeterminate. Also, HTMLProgressElement, which support
:indeterminate pseudo class, should follow it. We add
shouldAppearIndeterminate to Element.

No new tests. Just a refactoring.

  • dom/Element.cpp:

(WebCore::Element::shouldAppearIndeterminate): Added. Returns false.

  • dom/Element.h:

(Element): Declare shouldAppearIndeterminate.

  • html/HTMLInputElement.cpp:

(WebCore::HTMLInputElement::shouldAppearIndeterminate):
Renamed from isIndeterminate.

  • html/HTMLInputElement.h:

(HTMLInputElement): Rename isIndeterminate to shouldAppearIndeterminate,
and overrides Element::shouldAppearIndeterminate.

  • html/HTMLProgressElement.cpp:

(WebCore::HTMLProgressElement::shouldAppearIndeterminate): Added.

  • html/HTMLProgressElement.h: Add shouldAppearIndeterminate.
  • accessibility/AccessibilityNodeObject.cpp:

(WebCore::AccessibilityNodeObject::isIndeterminate):
Use shouldAppearIndeterminate.

  • css/SelectorChecker.cpp:

(WebCore::SelectorChecker::checkOne): Ditto.

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::canShareStyleWithControl): Ditto.

  • rendering/RenderTheme.cpp:

(WebCore::RenderTheme::isIndeterminate): Ditto.

Location:
trunk/Source/WebCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r146858 r146860  
     12013-03-26  Kent Tamura  <tkent@chromium.org>
     2
     3        Rename HTMLInputElement::isIndeterminate to Element::shouldAppearIndeterminate
     4        https://bugs.webkit.org/show_bug.cgi?id=113264
     5
     6        Reviewed by Kentaro Hara.
     7
     8        HTMLInputElement had indeterminate() and isIndeterminate(). It's very
     9        confusing.
     10
     11        Because indeterminate is a public DOM function and isIndeterminate is
     12        for CSS and rendering, we rename isIndetermiante to
     13        shouldAppearIndeterminate. Also, HTMLProgressElement, which support
     14        :indeterminate pseudo class, should follow it. We add
     15        shouldAppearIndeterminate to Element.
     16
     17        No new tests. Just a refactoring.
     18
     19        * dom/Element.cpp:
     20        (WebCore::Element::shouldAppearIndeterminate): Added. Returns false.
     21        * dom/Element.h:
     22        (Element): Declare shouldAppearIndeterminate.
     23        * html/HTMLInputElement.cpp:
     24        (WebCore::HTMLInputElement::shouldAppearIndeterminate):
     25        Renamed from isIndeterminate.
     26        * html/HTMLInputElement.h:
     27        (HTMLInputElement): Rename isIndeterminate to shouldAppearIndeterminate,
     28        and overrides Element::shouldAppearIndeterminate.
     29        * html/HTMLProgressElement.cpp:
     30        (WebCore::HTMLProgressElement::shouldAppearIndeterminate): Added.
     31        * html/HTMLProgressElement.h: Add shouldAppearIndeterminate.
     32
     33        * accessibility/AccessibilityNodeObject.cpp:
     34        (WebCore::AccessibilityNodeObject::isIndeterminate):
     35        Use shouldAppearIndeterminate.
     36        * css/SelectorChecker.cpp:
     37        (WebCore::SelectorChecker::checkOne): Ditto.
     38        * css/StyleResolver.cpp:
     39        (WebCore::StyleResolver::canShareStyleWithControl): Ditto.
     40        * rendering/RenderTheme.cpp:
     41        (WebCore::RenderTheme::isIndeterminate): Ditto.
     42
    1432013-03-26  Pan Deng  <pan.deng@intel.com>
    244
  • trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp

    r145866 r146860  
    612612        return false;
    613613
    614     return inputElement->isIndeterminate();
     614    return inputElement->shouldAppearIndeterminate();
    615615}
    616616
  • trunk/Source/WebCore/css/SelectorChecker.cpp

    r145691 r146860  
    645645                // obey the CSS spec here in the test for matching the pseudo.
    646646                HTMLInputElement* inputElement = element->toInputElement();
    647                 if (inputElement && inputElement->shouldAppearChecked() && !inputElement->isIndeterminate())
     647                if (inputElement && inputElement->shouldAppearChecked() && !inputElement->shouldAppearIndeterminate())
    648648                    return true;
    649649                if (element->hasTagName(optionTag) && toHTMLOptionElement(element)->selected())
     
    652652            }
    653653        case CSSSelector::PseudoIndeterminate:
    654             {
    655                 if (!element)
    656                     break;
    657 #if ENABLE(PROGRESS_ELEMENT)
    658                 if (element->hasTagName(progressTag)) {
    659                     HTMLProgressElement* progress = toHTMLProgressElement(element);
    660                     if (progress && !progress->isDeterminate())
    661                         return true;
    662                     break;
    663                 }
    664 #endif
    665                 HTMLInputElement* inputElement = element->toInputElement();
    666                 if (inputElement && inputElement->isIndeterminate())
    667                     return true;
    668                 break;
    669             }
     654            return element && element->shouldAppearIndeterminate();
    670655        case CSSSelector::PseudoRoot:
    671656            if (element == element->document()->documentElement())
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r146529 r146860  
    544544    if (thisInputElement->shouldAppearChecked() != otherInputElement->shouldAppearChecked())
    545545        return false;
    546     if (thisInputElement->isIndeterminate() != otherInputElement->isIndeterminate())
     546    if (thisInputElement->shouldAppearIndeterminate() != otherInputElement->shouldAppearIndeterminate())
    547547        return false;
    548548    if (thisInputElement->isRequired() != otherInputElement->isRequired())
  • trunk/Source/WebCore/dom/Element.cpp

    r146744 r146860  
    23832383}
    23842384
     2385bool Element::shouldAppearIndeterminate() const
     2386{
     2387    return false;
     2388}
     2389
    23852390DOMTokenList* Element::classList()
    23862391{
  • trunk/Source/WebCore/dom/Element.h

    r146744 r146860  
    514514    virtual bool matchesReadWritePseudoClass() const;
    515515    bool webkitMatchesSelector(const String& selectors, ExceptionCode&);
     516    virtual bool shouldAppearIndeterminate() const;
    516517
    517518    DOMTokenList* classList();
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r146726 r146860  
    17981798}
    17991799
    1800 bool HTMLInputElement::isIndeterminate() const
     1800bool HTMLInputElement::shouldAppearIndeterminate() const
    18011801{
    18021802    return m_inputType->supportsIndeterminateAppearance() && indeterminate();
  • trunk/Source/WebCore/html/HTMLInputElement.h

    r145423 r146860  
    147147    // shouldAppearChecked is used by the rendering tree/CSS while checked() is used by JS to determine checked state
    148148    bool shouldAppearChecked() const;
    149     virtual bool isIndeterminate() const;
     149    virtual bool shouldAppearIndeterminate() const OVERRIDE;
    150150
    151151    int size() const;
  • trunk/Source/WebCore/html/HTMLProgressElement.cpp

    r146417 r146860  
    169169}
    170170
     171bool HTMLProgressElement::shouldAppearIndeterminate() const
     172{
     173    return !isDeterminate();
     174}
     175
    171176} // namespace
    172177#endif
  • trunk/Source/WebCore/html/HTMLProgressElement.h

    r146417 r146860  
    5454
    5555    virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; }
    56 
     56    virtual bool shouldAppearIndeterminate() const OVERRIDE;
    5757    virtual bool supportLabels() const OVERRIDE { return true; }
    5858
  • trunk/Source/WebCore/rendering/RenderTheme.cpp

    r145596 r146860  
    781781        return false;
    782782
    783     return inputElement->isIndeterminate();
     783    return inputElement->shouldAppearIndeterminate();
    784784}
    785785
Note: See TracChangeset for help on using the changeset viewer.