summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/RenderThemeChromiumWin.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-06-15 19:36:43 +0100
committerBen Murdoch <benm@google.com>2010-06-16 14:52:28 +0100
commit545e470e52f0ac6a3a072bf559c796b42c6066b6 (patch)
treec0c14763654d84d37577dde512c3d3b4699a9e86 /WebCore/rendering/RenderThemeChromiumWin.cpp
parent719298a66237d38ea5c05f1547123ad8aacbc237 (diff)
downloadexternal_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.zip
external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.tar.gz
external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.tar.bz2
Merge webkit.org at r61121: Initial merge by git.
Change-Id: Icd6db395c62285be384d137164d95d7466c98760
Diffstat (limited to 'WebCore/rendering/RenderThemeChromiumWin.cpp')
-rw-r--r--WebCore/rendering/RenderThemeChromiumWin.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/WebCore/rendering/RenderThemeChromiumWin.cpp b/WebCore/rendering/RenderThemeChromiumWin.cpp
index cc7570c..d82fddc 100644
--- a/WebCore/rendering/RenderThemeChromiumWin.cpp
+++ b/WebCore/rendering/RenderThemeChromiumWin.cpp
@@ -679,21 +679,13 @@ void RenderThemeChromiumWin::adjustProgressBarStyle(CSSStyleSelector*, RenderSty
bool RenderThemeChromiumWin::paintProgressBar(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
{
- RenderProgress* renderProgress = toRenderProgress(o);
-
- IntRect valueRect;
- if (renderProgress->isDeterminate()) {
- int dx = r.width() * renderProgress->position();
- if (renderProgress->style()->direction() == RTL)
- valueRect = IntRect(r.x() + r.width() - dx, r.y(), dx, r.height());
- else
- valueRect = IntRect(r.x(), r.y(), dx, r.height());
- } else {
- // For indeterminate bar, valueRect is ignored and it is computed by the theme engine
- // because the animation is a platform detail and WebKit doesn't need to know how.
- valueRect = IntRect(0, 0, 0, 0);
- }
+ if (!o->isProgress())
+ return true;
+ RenderProgress* renderProgress = toRenderProgress(o);
+ // For indeterminate bar, valueRect is ignored and it is computed by the theme engine
+ // because the animation is a platform detail and WebKit doesn't need to know how.
+ IntRect valueRect = renderProgress->isDeterminate() ? determinateProgressValueRectFor(renderProgress, r) : IntRect(0, 0, 0, 0);
double animatedSeconds = renderProgress->animationStartTime() ? WTF::currentTime() - renderProgress->animationStartTime() : 0;
ThemePainter painter(i.context, r);
ChromiumBridge::paintProgressBar(painter.context(), r, valueRect, renderProgress->isDeterminate(), animatedSeconds);