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

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: Take feedback into consideration (getting AppEngine errors...) 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..9138ab1f1020591a699e07fab941893d7b8c73c5 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,22 @@ 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
eseidel 2013/11/25 00:46:43 This is the same as the next function. We just ne
Inactive 2013/11/25 01:19:38 parseToDoubleForNumberType() uses std::numeric_lim
Inactive 2013/11/25 01:28:13 Done.
+{
+ return parseToDoubleForNumberType(getAttribute(attributeName), fallbackValue);
+}
+
+double Element::getFloatingPointAttribute(const QualifiedName& attributeName) const
+{
+ return parseToDoubleForNumberType(getAttribute(attributeName));
+}
+
+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