getPropertyValue for -webkit-text-stroke returns null, should compute the shorthand...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2013 07:44:47 +0000 (07:44 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2013 07:44:47 +0000 (07:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=111018

Patch by Uday Kiran <udaykiran@motorola.com> on 2013-03-04
Reviewed by Alexander Pavlov.

Source/WebCore:

Test: fast/css/getPropertyValue-webkit-text-stroke.html

* css/StylePropertySet.cpp:
(WebCore::StylePropertySet::getPropertyValue):

LayoutTests:

Added test for getPropertyValue("-webkit-text-stroke").

* fast/css/getPropertyValue-webkit-text-stroke-expected.txt: Added.
* fast/css/getPropertyValue-webkit-text-stroke.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/css/getPropertyValue-webkit-text-stroke-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/getPropertyValue-webkit-text-stroke.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/StylePropertySet.cpp

index 2ac47ab..ea3c3a0 100644 (file)
@@ -1,5 +1,17 @@
 2013-03-04  Uday Kiran  <udaykiran@motorola.com>
 
+        getPropertyValue for -webkit-text-stroke returns null, should compute the shorthand value
+        https://bugs.webkit.org/show_bug.cgi?id=111018
+
+        Reviewed by Alexander Pavlov.
+
+        Added test for getPropertyValue("-webkit-text-stroke").
+
+        * fast/css/getPropertyValue-webkit-text-stroke-expected.txt: Added.
+        * fast/css/getPropertyValue-webkit-text-stroke.html: Added.
+
+2013-03-04  Uday Kiran  <udaykiran@motorola.com>
+
         getPropertyValue for -webkit-columns returns null, should compute the shorthand value
         https://bugs.webkit.org/show_bug.cgi?id=111011
 
diff --git a/LayoutTests/fast/css/getPropertyValue-webkit-text-stroke-expected.txt b/LayoutTests/fast/css/getPropertyValue-webkit-text-stroke-expected.txt
new file mode 100644 (file)
index 0000000..2890999
--- /dev/null
@@ -0,0 +1,18 @@
+Bug 111018: getPropertyValue for -webkit-text-stroke returns null, should compute the shorthand value
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS webkitTextStrokeValue("text-stroke1") is "thin red"
+PASS webkitTextStrokeValue("text-stroke2") is "green"
+PASS webkitTextStrokeValue("text-stroke3") is "thin"
+PASS webkitTextStrokeValue("text-stroke4") is "1px red"
+PASS webkitTextStrokeValue("text-stroke5") is "1px black"
+NOTE: 'foo' is an illegal CSS value for '-webkit-text-stroke'.
+PASS webkitTextStrokeValue("text-stroke6") is null
+NOTE: If only few longhand properties are specified, getPropertyValue for shorthand property returns null.
+PASS webkitTextStrokeValue("text-stroke7") is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/css/getPropertyValue-webkit-text-stroke.html b/LayoutTests/fast/css/getPropertyValue-webkit-text-stroke.html
new file mode 100644 (file)
index 0000000..b7bfd0c
--- /dev/null
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML>
+</html>
+  <head>
+    <title>-webkit-text-stroke shorthand getPropertyValue test</title>
+    <style>
+      .test {
+        width: 5em;
+        height: 10em;
+      }
+    </style>
+    <script src="../js/resources/js-test-pre.js"></script>
+    <script>
+      if (window.testRunner)
+        testRunner.dumpAsText();
+    </script>
+  </head>
+  <body>
+    <div id="text-stroke1" class="test" style="-webkit-text-stroke: thin red;"></div>
+    <div id="text-stroke2" class="test" style="-webkit-text-stroke: green;"></div>
+    <div id="text-stroke3" class="test" style="-webkit-text-stroke: thin;"></div>
+    <div id="text-stroke4" class="test" style="-webkit-text-stroke: 1px red;"></div>
+    <div id="text-stroke5" class="test" style="-webkit-text-stroke-width: 1px; -webkit-text-stroke-color: black;"></div>
+    <div id="text-stroke6" class="test" style="-webkit-text-stroke: foo;"></div>
+    <div id="text-stroke7" class="test" style="-webkit-text-stroke-color: green;"></div>
+    <script>
+      description("<a href=\"https://bugs.webkit.org/show_bug.cgi?id=111018\">Bug 111018: getPropertyValue for -webkit-text-stroke returns null, should compute the shorthand value</a>");
+
+      function webkitTextStrokeValue(id) {
+        var element = document.getElementById(id);
+        return element.style.getPropertyValue("-webkit-text-stroke");
+      }
+
+      shouldBeEqualToString('webkitTextStrokeValue("text-stroke1")', 'thin red');
+      shouldBeEqualToString('webkitTextStrokeValue("text-stroke2")', 'green');
+      shouldBeEqualToString('webkitTextStrokeValue("text-stroke3")', 'thin');
+      shouldBeEqualToString('webkitTextStrokeValue("text-stroke4")', '1px red');
+      shouldBeEqualToString('webkitTextStrokeValue("text-stroke5")', '1px black');
+      debug("NOTE: 'foo' is an illegal CSS value for '-webkit-text-stroke'.");
+      shouldBe('webkitTextStrokeValue("text-stroke6")', "null");
+      debug("NOTE: If only few longhand properties are specified, getPropertyValue for shorthand property returns null.")
+      shouldBe('webkitTextStrokeValue("text-stroke7")', "null");
+    </script>
+    <script src="../js/resources/js-test-post.js"></script>
+  </body>
+</html>
index 9ee4e11..1233350 100644 (file)
@@ -1,5 +1,17 @@
 2013-03-04  Uday Kiran  <udaykiran@motorola.com>
 
+        getPropertyValue for -webkit-text-stroke returns null, should compute the shorthand value
+        https://bugs.webkit.org/show_bug.cgi?id=111018
+
+        Reviewed by Alexander Pavlov.
+
+        Test: fast/css/getPropertyValue-webkit-text-stroke.html
+
+        * css/StylePropertySet.cpp:
+        (WebCore::StylePropertySet::getPropertyValue):
+
+2013-03-04  Uday Kiran  <udaykiran@motorola.com>
+
         getPropertyValue for -webkit-columns returns null, should compute the shorthand value
         https://bugs.webkit.org/show_bug.cgi?id=111011
 
index 79ba97d..2dfff84 100644 (file)
@@ -192,6 +192,8 @@ String StylePropertySet::getPropertyValue(CSSPropertyID propertyID) const
         return getLayeredShorthandValue(webkitMaskShorthand());
     case CSSPropertyWebkitTextEmphasis:
         return getShorthandValue(webkitTextEmphasisShorthand());
+    case CSSPropertyWebkitTextStroke:
+        return getShorthandValue(webkitTextStrokeShorthand());
     case CSSPropertyWebkitTransformOrigin:
         return getShorthandValue(webkitTransformOriginShorthand());
     case CSSPropertyWebkitTransition: