Title: [209341] trunk/Source/WebCore
Revision
209341
Author
[email protected]
Date
2016-12-05 12:26:22 -0800 (Mon, 05 Dec 2016)

Log Message

[CSS Parser] Make sure the transform fast path uses WebKitCSSTransformValue
https://bugs.webkit.org/show_bug.cgi?id=165399

Reviewed by Dean Jackson.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::parseTransformTranslateArguments):
(WebCore::parseTransformNumberArguments):
(WebCore::parseSimpleTransformValue):
(WebCore::parseSimpleTransformList):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (209340 => 209341)


--- trunk/Source/WebCore/ChangeLog	2016-12-05 20:17:35 UTC (rev 209340)
+++ trunk/Source/WebCore/ChangeLog	2016-12-05 20:26:22 UTC (rev 209341)
@@ -1,5 +1,18 @@
 2016-12-05  Dave Hyatt  <[email protected]>
 
+        [CSS Parser] Make sure the transform fast path uses WebKitCSSTransformValue
+        https://bugs.webkit.org/show_bug.cgi?id=165399
+
+        Reviewed by Dean Jackson.
+
+        * css/parser/CSSParserFastPaths.cpp:
+        (WebCore::parseTransformTranslateArguments):
+        (WebCore::parseTransformNumberArguments):
+        (WebCore::parseSimpleTransformValue):
+        (WebCore::parseSimpleTransformList):
+
+2016-12-05  Dave Hyatt  <[email protected]>
+
         [CSS Parser] Fix calc() with -webkit-line-clamp
         https://bugs.webkit.org/show_bug.cgi?id=165398
 

Modified: trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp (209340 => 209341)


--- trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp	2016-12-05 20:17:35 UTC (rev 209340)
+++ trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp	2016-12-05 20:26:22 UTC (rev 209341)
@@ -43,6 +43,7 @@
 #include "StyleColor.h"
 #include "StylePropertyShorthand.h"
 #include "StyleSheetContents.h"
+#include "WebKitCSSTransformValue.h"
 
 namespace WebCore {
 
@@ -1059,7 +1060,7 @@
 }
 
 template <typename CharType>
-static bool parseTransformTranslateArguments(CharType*& pos, CharType* end, unsigned expectedCount, CSSFunctionValue* transformValue)
+static bool parseTransformTranslateArguments(CharType*& pos, CharType* end, unsigned expectedCount, WebKitCSSTransformValue* transformValue)
 {
     while (expectedCount) {
         size_t delimiter = WTF::find(pos, end - pos, expectedCount == 1 ? ')' : ',');
@@ -1080,7 +1081,7 @@
 }
 
 template <typename CharType>
-static bool parseTransformNumberArguments(CharType*& pos, CharType* end, unsigned expectedCount, CSSFunctionValue* transformValue)
+static bool parseTransformNumberArguments(CharType*& pos, CharType* end, unsigned expectedCount, WebKitCSSTransformValue* transformValue)
 {
     while (expectedCount) {
         size_t delimiter = WTF::find(pos, end - pos, expectedCount == 1 ? ')' : ',');
@@ -1100,8 +1101,9 @@
 
 static const int kShortestValidTransformStringLength = 12;
 
+// FIXME-NEWPARSER: Should use CSSFunctionValue and ditch WebkitCSSTransformValue.
 template <typename CharType>
-static RefPtr<CSSFunctionValue> parseSimpleTransformValue(CharType*& pos, CharType* end)
+static RefPtr<WebKitCSSTransformValue> parseSimpleTransformValue(CharType*& pos, CharType* end)
 {
     if (end - pos < kShortestValidTransformStringLength)
         return nullptr;
@@ -1117,22 +1119,22 @@
         && toASCIILower(pos[8]) == 'e';
 
     if (isTranslate) {
-        CSSValueID transformType;
+        WebKitCSSTransformValue::TransformOperationType transformType;
         unsigned expectedArgumentCount = 1;
         unsigned argumentStart = 11;
         CharType c9 = toASCIILower(pos[9]);
         if (c9 == 'x' && pos[10] == '(') {
-            transformType = CSSValueTranslatex;
+            transformType = WebKitCSSTransformValue::TranslateXTransformOperation;
         } else if (c9 == 'y' && pos[10] == '(') {
-            transformType = CSSValueTranslatey;
+            transformType = WebKitCSSTransformValue::TranslateYTransformOperation;
         } else if (c9 == 'z' && pos[10] == '(') {
-            transformType = CSSValueTranslatez;
+            transformType = WebKitCSSTransformValue::TranslateZTransformOperation;
         } else if (c9 == '(') {
-            transformType = CSSValueTranslate;
+            transformType = WebKitCSSTransformValue::TranslateTransformOperation;
             expectedArgumentCount = 2;
             argumentStart = 10;
         } else if (c9 == '3' && toASCIILower(pos[10]) == 'd' && pos[11] == '(') {
-            transformType = CSSValueTranslate3d;
+            transformType = WebKitCSSTransformValue::Translate3DTransformOperation;
             expectedArgumentCount = 3;
             argumentStart = 12;
         } else {
@@ -1139,7 +1141,7 @@
             return nullptr;
         }
         pos += argumentStart;
-        RefPtr<CSSFunctionValue> transformValue = CSSFunctionValue::create(transformType);
+        RefPtr<WebKitCSSTransformValue> transformValue = WebKitCSSTransformValue::create(transformType);
         if (!parseTransformTranslateArguments(pos, end, expectedArgumentCount, transformValue.get()))
             return nullptr;
         return transformValue;
@@ -1157,7 +1159,7 @@
 
     if (isMatrix3d) {
         pos += 9;
-        RefPtr<CSSFunctionValue> transformValue = CSSFunctionValue::create(CSSValueMatrix3d);
+        RefPtr<WebKitCSSTransformValue> transformValue = WebKitCSSTransformValue::create(WebKitCSSTransformValue::Matrix3DTransformOperation);
         if (!parseTransformNumberArguments(pos, end, 16, transformValue.get()))
             return nullptr;
         return transformValue;
@@ -1174,7 +1176,7 @@
 
     if (isScale3d) {
         pos += 8;
-        RefPtr<CSSFunctionValue> transformValue = CSSFunctionValue::create(CSSValueScale3d);
+        RefPtr<WebKitCSSTransformValue> transformValue = WebKitCSSTransformValue::create(WebKitCSSTransformValue::Scale3DTransformOperation);
         if (!parseTransformNumberArguments(pos, end, 3, transformValue.get()))
             return nullptr;
         return transformValue;
@@ -1243,7 +1245,7 @@
             ++pos;
         if (pos >= end)
             break;
-        RefPtr<CSSFunctionValue> transformValue = parseSimpleTransformValue(pos, end);
+        RefPtr<WebKitCSSTransformValue> transformValue = parseSimpleTransformValue(pos, end);
         if (!transformValue)
             return nullptr;
         if (!transformList)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to