Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: WebCore/rendering/RenderProgress.cpp

Issue 5772004: Merge 73488 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « WebCore/rendering/RenderProgress.h ('k') | WebCore/rendering/ShadowElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/rendering/RenderProgress.cpp
===================================================================
--- WebCore/rendering/RenderProgress.cpp (revision 73789)
+++ WebCore/rendering/RenderProgress.cpp (working copy)
@@ -54,6 +54,17 @@
void RenderProgress::updateFromElement()
{
+ if (!m_valuePart) {
+ m_valuePart = ShadowBlockElement::createForPart(static_cast<HTMLElement*>(node()), PROGRESS_BAR_VALUE);
+ if (m_valuePart->renderer())
+ addChild(m_valuePart->renderer());
+ }
+
+ if (shouldHaveParts())
+ style()->setAppearance(NoControlPart);
+ else if (m_valuePart->renderer())
+ m_valuePart->renderer()->style()->setVisibility(HIDDEN);
+
HTMLProgressElement* element = progressElement();
if (m_position == element->position())
return;
@@ -90,9 +101,7 @@
void RenderProgress::layoutParts()
{
- updatePartsState();
- if (m_valuePart)
- m_valuePart->layoutAsPart(valuePartRect());
+ m_valuePart->layoutAsPart(valuePartRect());
updateAnimationState();
}
@@ -105,18 +114,6 @@
return false;
}
-void RenderProgress::updatePartsState()
-{
- if (shouldHaveParts() && !m_valuePart) {
- style()->setAppearance(NoControlPart);
- m_valuePart = ShadowBlockElement::createForPart(static_cast<HTMLElement*>(node()), PROGRESS_BAR_VALUE);
- addChild(m_valuePart->renderer());
- } else if (!shouldHaveParts() && m_valuePart) {
- m_valuePart->detach();
- m_valuePart = 0;
- }
-}
-
void RenderProgress::updateAnimationState()
{
m_animationDuration = theme()->animationDurationForProgressBar(this);
« no previous file with comments | « WebCore/rendering/RenderProgress.h ('k') | WebCore/rendering/ShadowElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698