CSSStyleSelector: Dodge parser when creating default LTR/RTL declarations.
authorkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jan 2012 12:57:00 +0000 (12:57 +0000)
committerkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jan 2012 12:57:00 +0000 (12:57 +0000)
<http://webkit.org/b/76374>

Reviewed by Antti Koivisto.

Pass CSSValueLtr/CSSValueRtl directly to setProperty() instead of parsing "ltr"/"rtl".

* css/CSSStyleSelector.cpp:
(WebCore::leftToRightDeclaration):
(WebCore::rightToLeftDeclaration):

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

Source/WebCore/ChangeLog
Source/WebCore/css/CSSStyleSelector.cpp

index 16dded7..b69dff4 100644 (file)
@@ -1,3 +1,16 @@
+2012-01-16  Andreas Kling  <awesomekling@apple.com>
+
+        CSSStyleSelector: Dodge parser when creating default LTR/RTL declarations.
+        <http://webkit.org/b/76374>
+
+        Reviewed by Antti Koivisto.
+
+        Pass CSSValueLtr/CSSValueRtl directly to setProperty() instead of parsing "ltr"/"rtl".
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::leftToRightDeclaration):
+        (WebCore::rightToLeftDeclaration):
+
 2012-01-16  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         Unreviewed. Fix make distcheck.
index 69f7414..c612533 100644 (file)
@@ -313,20 +313,16 @@ static const MediaQueryEvaluator& printEval()
 static CSSMutableStyleDeclaration* leftToRightDeclaration()
 {
     DEFINE_STATIC_LOCAL(RefPtr<CSSMutableStyleDeclaration>, leftToRightDecl, (CSSMutableStyleDeclaration::create()));
-    if (!leftToRightDecl->length()) {
-        leftToRightDecl->setProperty(CSSPropertyDirection, "ltr", false);
-        leftToRightDecl->setStrictParsing(false);
-    }
+    if (!leftToRightDecl->length())
+        leftToRightDecl->setProperty(CSSPropertyDirection, CSSValueLtr);
     return leftToRightDecl.get();
 }
 
 static CSSMutableStyleDeclaration* rightToLeftDeclaration()
 {
     DEFINE_STATIC_LOCAL(RefPtr<CSSMutableStyleDeclaration>, rightToLeftDecl, (CSSMutableStyleDeclaration::create()));
-    if (!rightToLeftDecl->length()) {
-        rightToLeftDecl->setProperty(CSSPropertyDirection, "rtl", false);
-        rightToLeftDecl->setStrictParsing(false);
-    }
+    if (!rightToLeftDecl->length())
+        rightToLeftDecl->setProperty(CSSPropertyDirection, CSSValueRtl);
     return rightToLeftDecl.get();
 }