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

Unified Diff: Source/core/html/parser/HTMLParserIdioms.h

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/HTMLViewSourceDocument.cpp ('k') | Source/core/html/parser/HTMLParserIdioms.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLParserIdioms.h
diff --git a/Source/core/html/parser/HTMLParserIdioms.h b/Source/core/html/parser/HTMLParserIdioms.h
index 5c3e9df9e845bade07147fe35bf9b533b0edf985..903ca5a37cd3a19b3e93bb5ef9dddd212368ff2b 100644
--- a/Source/core/html/parser/HTMLParserIdioms.h
+++ b/Source/core/html/parser/HTMLParserIdioms.h
@@ -27,13 +27,12 @@
#include "core/dom/QualifiedName.h"
#include "core/html/parser/HTMLIdentifier.h"
+#include "platform/Decimal.h"
#include "wtf/Forward.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
-class Decimal;
-
// Space characters as defined by the HTML specification.
bool isHTMLSpace(UChar);
bool isHTMLLineBreak(UChar);
@@ -54,10 +53,8 @@ String serializeForNumberType(double);
// Convert the specified string to a decimal/double. If the conversion fails, the return value is fallback value or NaN if not specified.
// Leading or trailing illegal characters cause failure, as does passing an empty string.
// The double* parameter may be 0 to check if the string can be parsed without getting the result.
-Decimal parseToDecimalForNumberType(const String&);
-Decimal parseToDecimalForNumberType(const String&, const Decimal& fallbackValue);
-double parseToDoubleForNumberType(const String&);
-double parseToDoubleForNumberType(const String&, double fallbackValue);
+Decimal parseToDecimalForNumberType(const String&, const Decimal& fallbackValue = Decimal::nan());
+double parseToDoubleForNumberType(const String&, double fallbackValue = std::numeric_limits<double>::quiet_NaN());
// http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-integers
bool parseHTMLInteger(const String&, int&);
« no previous file with comments | « Source/core/html/HTMLViewSourceDocument.cpp ('k') | Source/core/html/parser/HTMLParserIdioms.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698