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

Side by Side Diff: WebCore/html/HTMLMeterElement.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 unified diff | Download patch
« no previous file with comments | « WebCore/html/HTMLMeterElement.h ('k') | WebCore/html/HTMLProgressElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 void HTMLMeterElement::parseMappedAttribute(Attribute* attribute) 63 void HTMLMeterElement::parseMappedAttribute(Attribute* attribute)
64 { 64 {
65 if (attribute->name() == valueAttr || attribute->name() == minAttr || attrib ute->name() == maxAttr || attribute->name() == lowAttr || attribute->name() == h ighAttr || attribute->name() == optimumAttr) { 65 if (attribute->name() == valueAttr || attribute->name() == minAttr || attrib ute->name() == maxAttr || attribute->name() == lowAttr || attribute->name() == h ighAttr || attribute->name() == optimumAttr) {
66 if (renderer()) 66 if (renderer())
67 renderer()->updateFromElement(); 67 renderer()->updateFromElement();
68 } else 68 } else
69 HTMLFormControlElement::parseMappedAttribute(attribute); 69 HTMLFormControlElement::parseMappedAttribute(attribute);
70 } 70 }
71 71
72 void HTMLMeterElement::attach()
73 {
74 HTMLFormControlElement::attach();
75 if (renderer())
76 renderer()->updateFromElement();
77 }
78
72 double HTMLMeterElement::min() const 79 double HTMLMeterElement::min() const
73 { 80 {
74 double min = 0; 81 double min = 0;
75 parseToDoubleForNumberType(getAttribute(minAttr), &min); 82 parseToDoubleForNumberType(getAttribute(minAttr), &min);
76 return min; 83 return min;
77 } 84 }
78 85
79 void HTMLMeterElement::setMin(double min, ExceptionCode& ec) 86 void HTMLMeterElement::setMin(double min, ExceptionCode& ec)
80 { 87 {
81 if (!isfinite(min)) { 88 if (!isfinite(min)) {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // The optimum range stays between high and low. 200 // The optimum range stays between high and low.
194 // According to the standard, <meter> never show GaugeRegionEvenLessGood in this case 201 // According to the standard, <meter> never show GaugeRegionEvenLessGood in this case
195 // because the value is never less or greater than min or max. 202 // because the value is never less or greater than min or max.
196 if (lowValue <= theValue && theValue <= highValue) 203 if (lowValue <= theValue && theValue <= highValue)
197 return GaugeRegionOptimum; 204 return GaugeRegionOptimum;
198 return GaugeRegionSuboptimal; 205 return GaugeRegionSuboptimal;
199 } 206 }
200 207
201 } // namespace 208 } // namespace
202 #endif 209 #endif
OLDNEW
« no previous file with comments | « WebCore/html/HTMLMeterElement.h ('k') | WebCore/html/HTMLProgressElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698