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

Unified Diff: third_party/WebKit/Source/core/html/HTMLProgressElement.cpp

Issue 1947423004: Simplify HTMLProgressElement::didElementStateChange. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLProgressElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLProgressElement.cpp b/third_party/WebKit/Source/core/html/HTMLProgressElement.cpp
index 623205444fe6a1faee6054b07174037e376f3649..4a91dc4a1b0c761a4c224d89018d1e8b88db8135 100644
--- a/third_party/WebKit/Source/core/html/HTMLProgressElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLProgressElement.cpp
@@ -75,12 +75,15 @@ LayoutProgress* HTMLProgressElement::layoutProgress() const
void HTMLProgressElement::parseAttribute(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& value)
{
- if (name == valueAttr)
+ if (name == valueAttr) {
+ if (oldValue.isNull() != value.isNull())
+ pseudoStateChanged(CSSSelector::PseudoIndeterminate);
didElementStateChange();
- else if (name == maxAttr)
+ } else if (name == maxAttr) {
didElementStateChange();
- else
+ } else {
LabelableElement::parseAttribute(name, oldValue, value);
+ }
}
void HTMLProgressElement::attach(const AttachContext& context)
@@ -136,12 +139,8 @@ bool HTMLProgressElement::isDeterminate() const
void HTMLProgressElement::didElementStateChange()
{
m_value->setWidthPercentage(position() * 100);
- if (LayoutProgressItem layoutItem = LayoutProgressItem(layoutProgress())) {
- bool wasDeterminate = layoutItem.isDeterminate();
+ if (LayoutProgressItem layoutItem = LayoutProgressItem(layoutProgress()))
layoutItem.updateFromElement();
- if (wasDeterminate != isDeterminate())
- pseudoStateChanged(CSSSelector::PseudoIndeterminate);
- }
}
void HTMLProgressElement::didAddUserAgentShadowRoot(ShadowRoot& root)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698