| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 } | 45 } |
| 46 | 46 |
| 47 void RenderProgress::updateFromElement() | 47 void RenderProgress::updateFromElement() |
| 48 { | 48 { |
| 49 HTMLProgressElement* element = progressElement(); | 49 HTMLProgressElement* element = progressElement(); |
| 50 if (m_position == element->position()) | 50 if (m_position == element->position()) |
| 51 return; | 51 return; |
| 52 m_position = element->position(); | 52 m_position = element->position(); |
| 53 | 53 |
| 54 updateAnimationState(); | 54 updateAnimationState(); |
| 55 paintInvalidationForWholeRenderer(); | 55 setShouldDoFullPaintInvalidation(true); |
| 56 RenderBlockFlow::updateFromElement(); | 56 RenderBlockFlow::updateFromElement(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 double RenderProgress::animationProgress() const | 59 double RenderProgress::animationProgress() const |
| 60 { | 60 { |
| 61 return m_animating ? (fmod((currentTime() - m_animationStartTime), m_animati
onDuration) / m_animationDuration) : 0; | 61 return m_animating ? (fmod((currentTime() - m_animationStartTime), m_animati
onDuration) / m_animationDuration) : 0; |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool RenderProgress::isDeterminate() const | 64 bool RenderProgress::isDeterminate() const |
| 65 { | 65 { |
| 66 return (HTMLProgressElement::IndeterminatePosition != position() | 66 return (HTMLProgressElement::IndeterminatePosition != position() |
| 67 && HTMLProgressElement::InvalidPosition != position()); | 67 && HTMLProgressElement::InvalidPosition != position()); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void RenderProgress::animationTimerFired(Timer<RenderProgress>*) | 70 void RenderProgress::animationTimerFired(Timer<RenderProgress>*) |
| 71 { | 71 { |
| 72 paintInvalidationForWholeRenderer(); | 72 setShouldDoFullPaintInvalidation(true); |
| 73 if (!m_animationTimer.isActive() && m_animating) | 73 if (!m_animationTimer.isActive() && m_animating) |
| 74 m_animationTimer.startOneShot(m_animationRepeatInterval, FROM_HERE); | 74 m_animationTimer.startOneShot(m_animationRepeatInterval, FROM_HERE); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void RenderProgress::updateAnimationState() | 77 void RenderProgress::updateAnimationState() |
| 78 { | 78 { |
| 79 m_animationDuration = RenderTheme::theme().animationDurationForProgressBar(t
his); | 79 m_animationDuration = RenderTheme::theme().animationDurationForProgressBar(t
his); |
| 80 m_animationRepeatInterval = RenderTheme::theme().animationRepeatIntervalForP
rogressBar(this); | 80 m_animationRepeatInterval = RenderTheme::theme().animationRepeatIntervalForP
rogressBar(this); |
| 81 | 81 |
| 82 bool animating = style()->hasAppearance() && m_animationDuration > 0; | 82 bool animating = style()->hasAppearance() && m_animationDuration > 0; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 97 return 0; | 97 return 0; |
| 98 | 98 |
| 99 if (isHTMLProgressElement(*node())) | 99 if (isHTMLProgressElement(*node())) |
| 100 return toHTMLProgressElement(node()); | 100 return toHTMLProgressElement(node()); |
| 101 | 101 |
| 102 ASSERT(node()->shadowHost()); | 102 ASSERT(node()->shadowHost()); |
| 103 return toHTMLProgressElement(node()->shadowHost()); | 103 return toHTMLProgressElement(node()->shadowHost()); |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // namespace blink | 106 } // namespace blink |
| OLD | NEW |