Changeset 90384 in webkit


Ignore:
Timestamp:
Jul 4, 2011 9:21:24 PM (13 years ago)
Author:
dominicc@chromium.org
Message:

2011-07-04 Dominic Cooney <dominicc@chromium.org>

Simplify <progress> element's isDeterminate logic.
https://bugs.webkit.org/show_bug.cgi?id=63889

Reviewed by Hajime Morita.

Covered by existing tests
fast/dom/HTMLProgressElement/indeterminate-progress-*.html

  • html/HTMLProgressElement.cpp: (WebCore::HTMLProgressElement::position): don't duplicate isDeterminate (WebCore::HTMLProgressElement::isDeterminate): remove redundant tests (WebCore::HTMLProgressElement::didElementStateChange): fix formatting
  • html/HTMLProgressElement.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r90382 r90384  
     12011-07-04  Dominic Cooney   <dominicc@chromium.org>
     2
     3        Simplify <progress> element's isDeterminate logic.
     4        https://bugs.webkit.org/show_bug.cgi?id=63889
     5
     6        Reviewed by Hajime Morita.
     7
     8        Covered by existing tests
     9        fast/dom/HTMLProgressElement/indeterminate-progress-*.html
     10
     11        * html/HTMLProgressElement.cpp:
     12        (WebCore::HTMLProgressElement::position): don't duplicate isDeterminate
     13        (WebCore::HTMLProgressElement::isDeterminate): remove redundant tests
     14        (WebCore::HTMLProgressElement::didElementStateChange): fix formatting
     15        * html/HTMLProgressElement.h:
     16
    1172011-07-04  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    218
  • trunk/Source/WebCore/html/HTMLProgressElement.cpp

    r90351 r90384  
    130130double HTMLProgressElement::position() const
    131131{
    132     if (!hasAttribute(valueAttr))
     132    if (!isDeterminate())
    133133        return HTMLProgressElement::IndeterminatePosition;
    134134    return value() / max();
    135135}
    136136
    137 bool HTMLProgressElement::isDeterminate()
     137bool HTMLProgressElement::isDeterminate() const
    138138{
    139     double currentPosition = position();
    140     return (HTMLProgressElement::IndeterminatePosition != currentPosition && HTMLProgressElement::InvalidPosition != currentPosition);
     139    return fastHasAttribute(valueAttr);
    141140}
    142141   
    143142void HTMLProgressElement::didElementStateChange()
    144143{
    145     m_value->setWidthPercentage(position()*100);
     144    m_value->setWidthPercentage(position() * 100);
    146145    if (renderer()) {
    147146        RenderProgress* render = toRenderProgress(renderer());
  • trunk/Source/WebCore/html/HTMLProgressElement.h

    r88793 r90384  
    4444    double position() const;
    4545
    46     bool isDeterminate();
     46    bool isDeterminate() const;
    4747   
    4848    virtual bool canContainRangeEndPoint() const { return false; }
Note: See TracChangeset for help on using the changeset viewer.