Implement post-landing feedback for WebKitCSSTransformValue::customCSSText().
authormacpherson@chromium.org <macpherson@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 May 2012 03:30:23 +0000 (03:30 +0000)
committermacpherson@chromium.org <macpherson@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 May 2012 03:30:23 +0000 (03:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=87684

Reviewed by Darin Adler.

Darin provided some style suggesting on https://bugs.webkit.org/show_bug.cgi?id=87462 after it landed.
This patch incorporates those suggestions, namely using 0 instead of empty string for UnknownTransformOperation
and WTF_ARRAY_LENGTH instead of hard coding the array length.

Covered by existing transform tests.

* css/WebKitCSSTransformValue.cpp:
(WebCore):
(WebCore::WebKitCSSTransformValue::customCssText):

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

Source/WebCore/ChangeLog
Source/WebCore/css/WebKitCSSTransformValue.cpp

index 68782cd..cc13ea8 100644 (file)
@@ -1,3 +1,20 @@
+2012-05-29  Luke Macpherson  <macpherson@chromium.org>
+
+        Implement post-landing feedback for WebKitCSSTransformValue::customCSSText().
+        https://bugs.webkit.org/show_bug.cgi?id=87684
+
+        Reviewed by Darin Adler.
+
+        Darin provided some style suggesting on https://bugs.webkit.org/show_bug.cgi?id=87462 after it landed.
+        This patch incorporates those suggestions, namely using 0 instead of empty string for UnknownTransformOperation
+        and WTF_ARRAY_LENGTH instead of hard coding the array length.
+
+        Covered by existing transform tests.
+
+        * css/WebKitCSSTransformValue.cpp:
+        (WebCore):
+        (WebCore::WebKitCSSTransformValue::customCssText):
+
 2012-05-29  Eric Seidel  <eric@webkit.org>
 
         Fix ENABLE_IFRAME_SEAMLESS to actually fully disable <iframe seamless>
index 8580226..f853190 100644 (file)
@@ -33,9 +33,9 @@
 
 namespace WebCore {
 
-const int transformNameSize = 22;
-const char* const transformName[transformNameSize] = {
-     "",
+// These names must be kept in sync with TransformOperationType.
+const char* const transformName[] = {
+     0,
      "translate",
      "translateX",
      "translateY",
@@ -69,7 +69,7 @@ String WebKitCSSTransformValue::customCssText() const
 {
     StringBuilder result;
     if (m_type != UnknownTransformOperation) {
-        ASSERT(m_type < transformNameSize);
+        ASSERT(static_cast<size_t>(m_type) < WTF_ARRAY_LENGTH(transformName));
         result.append(transformName[m_type]);
         result.append('(');
         result.append(CSSValueList::customCssText());