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

Unified Diff: Source/core/dom/Element.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/dom/Element.h ('k') | Source/core/editing/BreakBlockquoteCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index eb460333e5b95235ed2704f3e89e9b50ffecbc31..3cff1907866a48d432655c4a4a2cdeabc0288d0b 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -2752,8 +2752,7 @@ int Element::getIntegralAttribute(const QualifiedName& attributeName) const
void Element::setIntegralAttribute(const QualifiedName& attributeName, int value)
{
- // FIXME: Need an AtomicString version of String::number.
- setAttribute(attributeName, String::number(value));
+ setAttribute(attributeName, AtomicString::number(value));
}
unsigned Element::getUnsignedIntegralAttribute(const QualifiedName& attributeName) const
@@ -2763,8 +2762,17 @@ unsigned Element::getUnsignedIntegralAttribute(const QualifiedName& attributeNam
void Element::setUnsignedIntegralAttribute(const QualifiedName& attributeName, unsigned value)
{
- // FIXME: Need an AtomicString version of String::number.
- setAttribute(attributeName, String::number(value));
+ setAttribute(attributeName, AtomicString::number(value));
+}
+
+double Element::getFloatingPointAttribute(const QualifiedName& attributeName, double fallbackValue) const
+{
+ return parseToDoubleForNumberType(getAttribute(attributeName), fallbackValue);
+}
+
+void Element::setFloatingPointAttribute(const QualifiedName& attributeName, double value)
+{
+ setAttribute(attributeName, AtomicString::number(value));
}
bool Element::childShouldCreateRenderer(const Node& child) const
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/editing/BreakBlockquoteCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698