Index: third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp |
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp |
index adfb87636dd8fbc54cdfef1075e35e65ce607219..968c1489cdac414fc0ce5e079559c6107d76e427 100644 |
--- a/third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp |
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp |
@@ -42,9 +42,9 @@ CSSParserToken::CSSParserToken(CSSParserTokenType type, double numericValue, Num |
, m_numericValueType(numericValueType) |
, m_numericSign(sign) |
, m_unit(static_cast<unsigned>(CSSPrimitiveValue::UnitType::Number)) |
- , m_numericValue(numericValue) |
{ |
ASSERT(type == NumberToken); |
+ m_numericValue = clampTo<double>(numericValue, -std::numeric_limits<float>::max(), std::numeric_limits<float>::max()); |
} |
CSSParserToken::CSSParserToken(CSSParserTokenType type, UChar32 start, UChar32 end) |
@@ -288,15 +288,4 @@ void CSSParserToken::serialize(StringBuilder& builder) const |
} |
} |
-bool CSSParserToken::isValidNumericValue(double value) |
-{ |
- return value >= -std::numeric_limits<float>::max() |
- && value <= std::numeric_limits<float>::max(); |
-} |
- |
-bool CSSParserToken::isValidNumericValue() const |
-{ |
- return isValidNumericValue(numericValue()); |
-} |
- |
} // namespace blink |