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

Unified Diff: Source/core/html/HTMLMeterElement.cpp

Issue 84713002: Add number() static methods to AtomicString class (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Pass NaN as default argument 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLInputElement.cpp ('k') | Source/core/html/HTMLOListElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMeterElement.cpp
diff --git a/Source/core/html/HTMLMeterElement.cpp b/Source/core/html/HTMLMeterElement.cpp
index 63b3c9c7ee70963db1c559def1cad349c396a0bb..b946ffe44e51ba42f78fa0b9b2a61b652d26e8df 100644
--- a/Source/core/html/HTMLMeterElement.cpp
+++ b/Source/core/html/HTMLMeterElement.cpp
@@ -72,7 +72,7 @@ void HTMLMeterElement::parseAttribute(const QualifiedName& name, const AtomicStr
double HTMLMeterElement::min() const
{
- return parseToDoubleForNumberType(getAttribute(minAttr), 0);
+ return getFloatingPointAttribute(minAttr, 0);
}
void HTMLMeterElement::setMin(double min, ExceptionState& exceptionState)
@@ -81,12 +81,12 @@ void HTMLMeterElement::setMin(double min, ExceptionState& exceptionState)
exceptionState.throwUninformativeAndGenericDOMException(NotSupportedError);
return;
}
- setAttribute(minAttr, String::number(min));
+ setFloatingPointAttribute(minAttr, min);
}
double HTMLMeterElement::max() const
{
- return std::max(parseToDoubleForNumberType(getAttribute(maxAttr), std::max(1.0, min())), min());
+ return std::max(getFloatingPointAttribute(maxAttr, std::max(1.0, min())), min());
}
void HTMLMeterElement::setMax(double max, ExceptionState& exceptionState)
@@ -95,12 +95,12 @@ void HTMLMeterElement::setMax(double max, ExceptionState& exceptionState)
exceptionState.throwUninformativeAndGenericDOMException(NotSupportedError);
return;
}
- setAttribute(maxAttr, String::number(max));
+ setFloatingPointAttribute(maxAttr, max);
}
double HTMLMeterElement::value() const
{
- double value = parseToDoubleForNumberType(getAttribute(valueAttr), 0);
+ double value = getFloatingPointAttribute(valueAttr, 0);
return std::min(std::max(value, min()), max());
}
@@ -110,12 +110,12 @@ void HTMLMeterElement::setValue(double value, ExceptionState& exceptionState)
exceptionState.throwUninformativeAndGenericDOMException(NotSupportedError);
return;
}
- setAttribute(valueAttr, String::number(value));
+ setFloatingPointAttribute(valueAttr, value);
}
double HTMLMeterElement::low() const
{
- double low = parseToDoubleForNumberType(getAttribute(lowAttr), min());
+ double low = getFloatingPointAttribute(lowAttr, min());
return std::min(std::max(low, min()), max());
}
@@ -125,12 +125,12 @@ void HTMLMeterElement::setLow(double low, ExceptionState& exceptionState)
exceptionState.throwUninformativeAndGenericDOMException(NotSupportedError);
return;
}
- setAttribute(lowAttr, String::number(low));
+ setFloatingPointAttribute(lowAttr, low);
}
double HTMLMeterElement::high() const
{
- double high = parseToDoubleForNumberType(getAttribute(highAttr), max());
+ double high = getFloatingPointAttribute(highAttr, max());
return std::min(std::max(high, low()), max());
}
@@ -140,12 +140,12 @@ void HTMLMeterElement::setHigh(double high, ExceptionState& exceptionState)
exceptionState.throwUninformativeAndGenericDOMException(NotSupportedError);
return;
}
- setAttribute(highAttr, String::number(high));
+ setFloatingPointAttribute(highAttr, high);
}
double HTMLMeterElement::optimum() const
{
- double optimum = parseToDoubleForNumberType(getAttribute(optimumAttr), (max() + min()) / 2);
+ double optimum = getFloatingPointAttribute(optimumAttr, (max() + min()) / 2);
return std::min(std::max(optimum, min()), max());
}
@@ -155,7 +155,7 @@ void HTMLMeterElement::setOptimum(double optimum, ExceptionState& exceptionState
exceptionState.throwUninformativeAndGenericDOMException(NotSupportedError);
return;
}
- setAttribute(optimumAttr, String::number(optimum));
+ setFloatingPointAttribute(optimumAttr, optimum);
}
HTMLMeterElement::GaugeRegion HTMLMeterElement::gaugeRegion() const
« no previous file with comments | « Source/core/html/HTMLInputElement.cpp ('k') | Source/core/html/HTMLOListElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698