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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLMeterElement.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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 break; 56 break;
57 case NoControlPart: 57 case NoControlPart:
58 UseCounter::count(document(), UseCounter::MeterElementWithNoneAppearance); 58 UseCounter::count(document(), UseCounter::MeterElementWithNoneAppearance);
59 break; 59 break;
60 default: 60 default:
61 break; 61 break;
62 } 62 }
63 return LabelableElement::createLayoutObject(style); 63 return LabelableElement::createLayoutObject(style);
64 } 64 }
65 65
66 void HTMLMeterElement::parseAttribute(const QualifiedName& name, 66 void HTMLMeterElement::parseAttribute(
67 const AtomicString& oldValue, 67 const AttributeModificationParams& params) {
68 const AtomicString& value) { 68 const QualifiedName& name = params.name;
69 if (name == valueAttr || name == minAttr || name == maxAttr || 69 if (name == valueAttr || name == minAttr || name == maxAttr ||
70 name == lowAttr || name == highAttr || name == optimumAttr) 70 name == lowAttr || name == highAttr || name == optimumAttr)
71 didElementStateChange(); 71 didElementStateChange();
72 else 72 else
73 LabelableElement::parseAttribute(name, oldValue, value); 73 LabelableElement::parseAttribute(params);
74 } 74 }
75 75
76 double HTMLMeterElement::value() const { 76 double HTMLMeterElement::value() const {
77 double value = getFloatingPointAttribute(valueAttr, 0); 77 double value = getFloatingPointAttribute(valueAttr, 0);
78 return std::min(std::max(value, min()), max()); 78 return std::min(std::max(value, min()), max());
79 } 79 }
80 80
81 void HTMLMeterElement::setValue(double value) { 81 void HTMLMeterElement::setValue(double value) {
82 setFloatingPointAttribute(valueAttr, value); 82 setFloatingPointAttribute(valueAttr, value);
83 } 83 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 document().updateStyleAndLayoutTreeForNode(this); 221 document().updateStyleAndLayoutTreeForNode(this);
222 return computedStyle() && !computedStyle()->hasAppearance(); 222 return computedStyle() && !computedStyle()->hasAppearance();
223 } 223 }
224 224
225 DEFINE_TRACE(HTMLMeterElement) { 225 DEFINE_TRACE(HTMLMeterElement) {
226 visitor->trace(m_value); 226 visitor->trace(m_value);
227 LabelableElement::trace(visitor); 227 LabelableElement::trace(visitor);
228 } 228 }
229 229
230 } // namespace blink 230 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMeterElement.h ('k') | third_party/WebKit/Source/core/html/HTMLOListElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698