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

Side by Side Diff: Source/core/html/HTMLMeterElement.cpp

Issue 72363002: Rename es => exceptionState in other than bindings/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Retry Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLMediaElement.cpp ('k') | Source/core/html/HTMLOptionElement.cpp » ('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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 didElementStateChange(); 68 didElementStateChange();
69 else 69 else
70 LabelableElement::parseAttribute(name, value); 70 LabelableElement::parseAttribute(name, value);
71 } 71 }
72 72
73 double HTMLMeterElement::min() const 73 double HTMLMeterElement::min() const
74 { 74 {
75 return parseToDoubleForNumberType(getAttribute(minAttr), 0); 75 return parseToDoubleForNumberType(getAttribute(minAttr), 0);
76 } 76 }
77 77
78 void HTMLMeterElement::setMin(double min, ExceptionState& es) 78 void HTMLMeterElement::setMin(double min, ExceptionState& exceptionState)
79 { 79 {
80 if (!std::isfinite(min)) { 80 if (!std::isfinite(min)) {
81 es.throwUninformativeAndGenericDOMException(NotSupportedError); 81 exceptionState.throwUninformativeAndGenericDOMException(NotSupportedErro r);
82 return; 82 return;
83 } 83 }
84 setAttribute(minAttr, String::number(min)); 84 setAttribute(minAttr, String::number(min));
85 } 85 }
86 86
87 double HTMLMeterElement::max() const 87 double HTMLMeterElement::max() const
88 { 88 {
89 return std::max(parseToDoubleForNumberType(getAttribute(maxAttr), std::max(1 .0, min())), min()); 89 return std::max(parseToDoubleForNumberType(getAttribute(maxAttr), std::max(1 .0, min())), min());
90 } 90 }
91 91
92 void HTMLMeterElement::setMax(double max, ExceptionState& es) 92 void HTMLMeterElement::setMax(double max, ExceptionState& exceptionState)
93 { 93 {
94 if (!std::isfinite(max)) { 94 if (!std::isfinite(max)) {
95 es.throwUninformativeAndGenericDOMException(NotSupportedError); 95 exceptionState.throwUninformativeAndGenericDOMException(NotSupportedErro r);
96 return; 96 return;
97 } 97 }
98 setAttribute(maxAttr, String::number(max)); 98 setAttribute(maxAttr, String::number(max));
99 } 99 }
100 100
101 double HTMLMeterElement::value() const 101 double HTMLMeterElement::value() const
102 { 102 {
103 double value = parseToDoubleForNumberType(getAttribute(valueAttr), 0); 103 double value = parseToDoubleForNumberType(getAttribute(valueAttr), 0);
104 return std::min(std::max(value, min()), max()); 104 return std::min(std::max(value, min()), max());
105 } 105 }
106 106
107 void HTMLMeterElement::setValue(double value, ExceptionState& es) 107 void HTMLMeterElement::setValue(double value, ExceptionState& exceptionState)
108 { 108 {
109 if (!std::isfinite(value)) { 109 if (!std::isfinite(value)) {
110 es.throwUninformativeAndGenericDOMException(NotSupportedError); 110 exceptionState.throwUninformativeAndGenericDOMException(NotSupportedErro r);
111 return; 111 return;
112 } 112 }
113 setAttribute(valueAttr, String::number(value)); 113 setAttribute(valueAttr, String::number(value));
114 } 114 }
115 115
116 double HTMLMeterElement::low() const 116 double HTMLMeterElement::low() const
117 { 117 {
118 double low = parseToDoubleForNumberType(getAttribute(lowAttr), min()); 118 double low = parseToDoubleForNumberType(getAttribute(lowAttr), min());
119 return std::min(std::max(low, min()), max()); 119 return std::min(std::max(low, min()), max());
120 } 120 }
121 121
122 void HTMLMeterElement::setLow(double low, ExceptionState& es) 122 void HTMLMeterElement::setLow(double low, ExceptionState& exceptionState)
123 { 123 {
124 if (!std::isfinite(low)) { 124 if (!std::isfinite(low)) {
125 es.throwUninformativeAndGenericDOMException(NotSupportedError); 125 exceptionState.throwUninformativeAndGenericDOMException(NotSupportedErro r);
126 return; 126 return;
127 } 127 }
128 setAttribute(lowAttr, String::number(low)); 128 setAttribute(lowAttr, String::number(low));
129 } 129 }
130 130
131 double HTMLMeterElement::high() const 131 double HTMLMeterElement::high() const
132 { 132 {
133 double high = parseToDoubleForNumberType(getAttribute(highAttr), max()); 133 double high = parseToDoubleForNumberType(getAttribute(highAttr), max());
134 return std::min(std::max(high, low()), max()); 134 return std::min(std::max(high, low()), max());
135 } 135 }
136 136
137 void HTMLMeterElement::setHigh(double high, ExceptionState& es) 137 void HTMLMeterElement::setHigh(double high, ExceptionState& exceptionState)
138 { 138 {
139 if (!std::isfinite(high)) { 139 if (!std::isfinite(high)) {
140 es.throwUninformativeAndGenericDOMException(NotSupportedError); 140 exceptionState.throwUninformativeAndGenericDOMException(NotSupportedErro r);
141 return; 141 return;
142 } 142 }
143 setAttribute(highAttr, String::number(high)); 143 setAttribute(highAttr, String::number(high));
144 } 144 }
145 145
146 double HTMLMeterElement::optimum() const 146 double HTMLMeterElement::optimum() const
147 { 147 {
148 double optimum = parseToDoubleForNumberType(getAttribute(optimumAttr), (max( ) + min()) / 2); 148 double optimum = parseToDoubleForNumberType(getAttribute(optimumAttr), (max( ) + min()) / 2);
149 return std::min(std::max(optimum, min()), max()); 149 return std::min(std::max(optimum, min()), max());
150 } 150 }
151 151
152 void HTMLMeterElement::setOptimum(double optimum, ExceptionState& es) 152 void HTMLMeterElement::setOptimum(double optimum, ExceptionState& exceptionState )
153 { 153 {
154 if (!std::isfinite(optimum)) { 154 if (!std::isfinite(optimum)) {
155 es.throwUninformativeAndGenericDOMException(NotSupportedError); 155 exceptionState.throwUninformativeAndGenericDOMException(NotSupportedErro r);
156 return; 156 return;
157 } 157 }
158 setAttribute(optimumAttr, String::number(optimum)); 158 setAttribute(optimumAttr, String::number(optimum));
159 } 159 }
160 160
161 HTMLMeterElement::GaugeRegion HTMLMeterElement::gaugeRegion() const 161 HTMLMeterElement::GaugeRegion HTMLMeterElement::gaugeRegion() const
162 { 162 {
163 double lowValue = low(); 163 double lowValue = low();
164 double highValue = high(); 164 double highValue = high();
165 double theValue = value(); 165 double theValue = value();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 RefPtr<MeterBarElement> bar = MeterBarElement::create(document()); 230 RefPtr<MeterBarElement> bar = MeterBarElement::create(document());
231 m_value = MeterValueElement::create(document()); 231 m_value = MeterValueElement::create(document());
232 m_value->setWidthPercentage(0); 232 m_value->setWidthPercentage(0);
233 m_value->updatePseudo(); 233 m_value->updatePseudo();
234 bar->appendChild(m_value); 234 bar->appendChild(m_value);
235 235
236 inner->appendChild(bar); 236 inner->appendChild(bar);
237 } 237 }
238 238
239 } // namespace 239 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMediaElement.cpp ('k') | Source/core/html/HTMLOptionElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698