[CSS Parser] Don't use CSS_PARSER_INTEGER unit for resolved integer calcs.
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Dec 2016 17:28:23 +0000 (17:28 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Dec 2016 17:28:23 +0000 (17:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=165379

Reviewed by Dean Jackson.

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209319 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp

index 7e77167..ce95c95 100644 (file)
@@ -1,5 +1,15 @@
 2016-12-05  Dave Hyatt  <hyatt@apple.com>
 
+        [CSS Parser] Don't use CSS_PARSER_INTEGER unit for resolved integer calcs.
+        https://bugs.webkit.org/show_bug.cgi?id=165379
+
+        Reviewed by Dean Jackson.
+
+        * css/parser/CSSPropertyParserHelpers.cpp:
+        (WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
+
+2016-12-05  Dave Hyatt  <hyatt@apple.com>
+
         [CSS Parser] Add parseValue support to new parser. Use new parser for UA sheet too if useNewParser is set.
         https://bugs.webkit.org/show_bug.cgi?id=165376
 
index df58567..c03d028 100644 (file)
@@ -100,8 +100,7 @@ public:
         if (!m_calcValue)
             return nullptr;
         m_sourceRange = m_range;
-        CSSPrimitiveValue::UnitTypes unitType = m_calcValue->isInt() ? CSSPrimitiveValue::UnitTypes::CSS_PARSER_INTEGER : CSSPrimitiveValue::UnitTypes::CSS_NUMBER;
-        return CSSValuePool::singleton().createValue(m_calcValue->doubleValue(), unitType);
+        return CSSValuePool::singleton().createValue(m_calcValue->doubleValue(), CSSPrimitiveValue::UnitTypes::CSS_NUMBER);
     }
 
     bool consumeNumberRaw(double& result)