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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLProgressElement.cpp

Issue 2623513005: Introduce Element::AttributeModificationParams (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
OLDNEW
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 UseCounter::ProgressElementWithProgressBarAppearance); 61 UseCounter::ProgressElementWithProgressBarAppearance);
62 return new LayoutProgress(this); 62 return new LayoutProgress(this);
63 } 63 }
64 64
65 LayoutProgress* HTMLProgressElement::layoutProgress() const { 65 LayoutProgress* HTMLProgressElement::layoutProgress() const {
66 if (layoutObject() && layoutObject()->isProgress()) 66 if (layoutObject() && layoutObject()->isProgress())
67 return toLayoutProgress(layoutObject()); 67 return toLayoutProgress(layoutObject());
68 return nullptr; 68 return nullptr;
69 } 69 }
70 70
71 void HTMLProgressElement::parseAttribute(const QualifiedName& name, 71 void HTMLProgressElement::parseAttribute(
72 const AtomicString& oldValue, 72 const AttributeModificationParams& params) {
73 const AtomicString& value) { 73 if (params.name == valueAttr) {
74 if (name == valueAttr) { 74 if (params.oldValue.isNull() != params.newValue.isNull())
75 if (oldValue.isNull() != value.isNull())
76 pseudoStateChanged(CSSSelector::PseudoIndeterminate); 75 pseudoStateChanged(CSSSelector::PseudoIndeterminate);
77 didElementStateChange(); 76 didElementStateChange();
78 } else if (name == maxAttr) { 77 } else if (params.name == maxAttr) {
79 didElementStateChange(); 78 didElementStateChange();
80 } else { 79 } else {
81 LabelableElement::parseAttribute(name, oldValue, value); 80 LabelableElement::parseAttribute(params);
82 } 81 }
83 } 82 }
84 83
85 void HTMLProgressElement::attachLayoutTree(const AttachContext& context) { 84 void HTMLProgressElement::attachLayoutTree(const AttachContext& context) {
86 LabelableElement::attachLayoutTree(context); 85 LabelableElement::attachLayoutTree(context);
87 if (LayoutProgressItem layoutItem = LayoutProgressItem(layoutProgress())) 86 if (LayoutProgressItem layoutItem = LayoutProgressItem(layoutProgress()))
88 layoutItem.updateFromElement(); 87 layoutItem.updateFromElement();
89 } 88 }
90 89
91 double HTMLProgressElement::value() const { 90 double HTMLProgressElement::value() const {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 visitor->trace(m_value); 156 visitor->trace(m_value);
158 LabelableElement::trace(visitor); 157 LabelableElement::trace(visitor);
159 } 158 }
160 159
161 void HTMLProgressElement::setValueWidthPercentage(double width) const { 160 void HTMLProgressElement::setValueWidthPercentage(double width) const {
162 m_value->setInlineStyleProperty(CSSPropertyWidth, width, 161 m_value->setInlineStyleProperty(CSSPropertyWidth, width,
163 CSSPrimitiveValue::UnitType::Percentage); 162 CSSPrimitiveValue::UnitType::Percentage);
164 } 163 }
165 164
166 } // namespace blink 165 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLProgressElement.h ('k') | third_party/WebKit/Source/core/html/HTMLScriptElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698