Changeset 84156 in webkit


Ignore:
Timestamp:
Apr 18, 2011 10:14:03 AM (13 years ago)
Author:
morrita@google.com
Message:

2011-04-15 MORITA Hajime <morrita@google.com>

Reviewed by Adam Barth.

REGRESSION: <progress> doesn't animate if it doesn't have value
https://bugs.webkit.org/show_bug.cgi?id=58693

The initial value of RenderProgress::m_position is accidentally same as
the indeterminate value, that makes update code on updateFromElement() skipped.
This change set unique invalid value for the initial value of m_position.

No new tests. Testing animated bar is not possible with DRT.

  • html/HTMLProgressElement.cpp: (WebCore::HTMLProgressElement::position):
  • html/HTMLProgressElement.h:
  • rendering/RenderProgress.cpp: (WebCore::RenderProgress::RenderProgress): (WebCore::RenderProgress::isDeterminate):
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r84152 r84156  
     12011-04-15  MORITA Hajime  <morrita@google.com>
     2
     3        Reviewed by Adam Barth.
     4
     5        REGRESSION: <progress> doesn't animate if it doesn't have value
     6        https://bugs.webkit.org/show_bug.cgi?id=58693
     7
     8        The initial value of RenderProgress::m_position is accidentally same as
     9        the indeterminate value, that makes update code on updateFromElement() skipped.
     10        This change set unique invalid value for the initial value of m_position.
     11       
     12        No new tests. Testing animated bar is not possible with DRT.
     13
     14        * html/HTMLProgressElement.cpp:
     15        (WebCore::HTMLProgressElement::position):
     16        * html/HTMLProgressElement.h:
     17        * rendering/RenderProgress.cpp:
     18        (WebCore::RenderProgress::RenderProgress):
     19        (WebCore::RenderProgress::isDeterminate):
     20
    1212011-04-18  MORITA Hajime  <morrita@google.com>
    222
  • trunk/Source/WebCore/html/HTMLProgressElement.cpp

    r83256 r84156  
    3939
    4040using namespace HTMLNames;
     41
     42const double HTMLProgressElement::IndeterminatePosition = -1;
     43const double HTMLProgressElement::InvalidPosition = -2;
    4144
    4245HTMLProgressElement::HTMLProgressElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
     
    124127{
    125128    if (!hasAttribute(valueAttr))
    126         return -1;
     129        return HTMLProgressElement::IndeterminatePosition;
    127130    return value() / max();
    128131}
  • trunk/Source/WebCore/html/HTMLProgressElement.h

    r83065 r84156  
    3131class HTMLProgressElement : public HTMLFormControlElement {
    3232public:
     33    static const double IndeterminatePosition;
     34    static const double InvalidPosition;
     35
    3336    static PassRefPtr<HTMLProgressElement> create(const QualifiedName&, Document*, HTMLFormElement*);
    3437
  • trunk/Source/WebCore/rendering/RenderProgress.cpp

    r83065 r84156  
    3939RenderProgress::RenderProgress(HTMLProgressElement* element)
    4040    : RenderBlock(element)
    41     , m_position(-1)
     41    , m_position(HTMLProgressElement::InvalidPosition)
    4242    , m_animationStartTime(0)
    4343    , m_animationRepeatInterval(0)
     
    7070bool RenderProgress::isDeterminate() const
    7171{
    72     return 0 <= position();
     72    return (HTMLProgressElement::IndeterminatePosition != position()
     73            && HTMLProgressElement::InvalidPosition != position());
    7374}
    7475
Note: See TracChangeset for help on using the changeset viewer.