2010-09-16 takano takumi <takano1@asia.apple.com>
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Sep 2010 06:20:48 +0000 (06:20 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Sep 2010 06:20:48 +0000 (06:20 +0000)
        Reviewed by Kent Tamura.

        https://bugs.webkit.org/show_bug.cgi?id=45020
        Support "block-flow" and "writing-mode": interpret properties into RenderStyle

        Fixed a regression in SVG test introduced by my previous change.

        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::operator EWritingMode):
        * css/SVGCSSParser.cpp:
        (WebCore::CSSParser::parseSVGValue):

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

WebCore/ChangeLog
WebCore/css/CSSPrimitiveValueMappings.h
WebCore/css/SVGCSSParser.cpp

index bffaa02..e13807d 100644 (file)
@@ -1,3 +1,17 @@
+2010-09-16  takano takumi  <takano1@asia.apple.com>
+
+        Reviewed by Kent Tamura.
+
+        https://bugs.webkit.org/show_bug.cgi?id=45020
+        Support "block-flow" and "writing-mode": interpret properties into RenderStyle
+
+        Fixed a regression in SVG test introduced by my previous change.
+
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::operator EWritingMode):
+        * css/SVGCSSParser.cpp:
+        (WebCore::CSSParser::parseSVGValue):
+
 2010-09-16  Kenneth Russell  <kbr@google.com>
 
         Reviewed by James Robinson.
index 2183c3c..a452733 100644 (file)
@@ -2684,7 +2684,23 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWritingMode e)
 
 template<> inline CSSPrimitiveValue::operator EWritingMode() const
 {
-    return static_cast<EWritingMode>(m_value.ident - CSSValueLrTb);
+    switch (m_value.ident) {
+    case CSSValueLrTb:
+        return WM_LRTB;
+    case CSSValueLr:
+        return WM_LR;
+    case CSSValueRlTb:
+        return WM_RLTB;
+    case CSSValueRl:
+        return WM_RL;
+    case CSSValueTbRl:
+        return WM_TBRL;
+    case CSSValueTb:
+        return WM_TB;
+    default:
+        ASSERT_NOT_REACHED();
+        return WM_LRTB;
+    }
 }
 
 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EVectorEffect e)
index 535b273..3c42d40 100644 (file)
@@ -232,7 +232,7 @@ bool CSSParser::parseSVGValue(int propId, bool important)
 
     case CSSPropertyWritingMode:
     // lr-tb | rl_tb | tb-rl | lr | rl | tb | inherit
-        if (id >= CSSValueLrTb && id <= CSSValueTb)
+        if (id == CSSValueLrTb || id == CSSValueRlTb || id == CSSValueTbRl || id == CSSValueLr || id == CSSValueRl || id == CSSValueTb)
             valid_primitive = true;
         break;