getComputedStyle for border-style is not implemented.
authoralexis.menard@openbossa.org <alexis.menard@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Dec 2011 20:18:03 +0000 (20:18 +0000)
committeralexis.menard@openbossa.org <alexis.menard@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Dec 2011 20:18:03 +0000 (20:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=75312

Reviewed by Andreas Kling.

Source/WebCore:

Implement getComputedStyle for border-style.

Test: fast/css/getComputedStyle/getComputedStyle-border-style-shorthand.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):

LayoutTests:

Add test to cover that we return correct values.

* fast/css/getComputedStyle/getComputedStyle-border-style-shorthand-expected.txt: Added.
* fast/css/getComputedStyle/getComputedStyle-border-style-shorthand.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/css/getComputedStyle/getComputedStyle-border-style-shorthand-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/getComputedStyle/getComputedStyle-border-style-shorthand.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp

index 4285216..4e20698 100644 (file)
@@ -1,5 +1,17 @@
 2011-12-28  Alexis Menard  <alexis.menard@openbossa.org>
 
+        getComputedStyle for border-style is not implemented.
+        https://bugs.webkit.org/show_bug.cgi?id=75312
+
+        Reviewed by Andreas Kling.
+
+        Add test to cover that we return correct values.
+
+        * fast/css/getComputedStyle/getComputedStyle-border-style-shorthand-expected.txt: Added.
+        * fast/css/getComputedStyle/getComputedStyle-border-style-shorthand.html: Added.
+
+2011-12-28  Alexis Menard  <alexis.menard@openbossa.org>
+
         getComputedStyle for border-bottom, border-top, border-left, border-right is not implemented.
         https://bugs.webkit.org/show_bug.cgi?id=74743
 
diff --git a/LayoutTests/fast/css/getComputedStyle/getComputedStyle-border-style-shorthand-expected.txt b/LayoutTests/fast/css/getComputedStyle/getComputedStyle-border-style-shorthand-expected.txt
new file mode 100644 (file)
index 0000000..bbed22e
--- /dev/null
@@ -0,0 +1,25 @@
+Test to make sure border-style shorthand property returns CSSValueList properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS computedStyle.getPropertyValue('border-style') is 'solid dotted solid dotted'
+PASS computedStyle.getPropertyCSSValue('border-style').toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('border-style').length is 4
+PASS computedStyle.getPropertyCSSValue('border-style').cssText is 'solid dotted solid dotted'
+PASS computedStyle.getPropertyCSSValue('border-style').item(0).getStringValue() is 'solid'
+PASS computedStyle.getPropertyCSSValue('border-style').item(1).getStringValue() is 'dotted'
+PASS computedStyle.getPropertyCSSValue('border-style').item(2).getStringValue() is 'solid'
+PASS computedStyle.getPropertyCSSValue('border-style').item(3).getStringValue() is 'dotted'
+PASS computedStyle.getPropertyValue('border-style') is 'solid dotted groove dashed'
+PASS computedStyle.getPropertyCSSValue('border-style').toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('border-style').length is 4
+PASS computedStyle.getPropertyCSSValue('border-style').cssText is 'solid dotted groove dashed'
+PASS computedStyle.getPropertyCSSValue('border-style').item(0).getStringValue() is 'solid'
+PASS computedStyle.getPropertyCSSValue('border-style').item(1).getStringValue() is 'dotted'
+PASS computedStyle.getPropertyCSSValue('border-style').item(2).getStringValue() is 'groove'
+PASS computedStyle.getPropertyCSSValue('border-style').item(3).getStringValue() is 'dashed'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/css/getComputedStyle/getComputedStyle-border-style-shorthand.html b/LayoutTests/fast/css/getComputedStyle/getComputedStyle-border-style-shorthand.html
new file mode 100644 (file)
index 0000000..81d09d6
--- /dev/null
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<script>
+
+description("Test to make sure border-style shorthand property returns CSSValueList properly.")
+
+var testContainer = document.createElement("div");
+testContainer.contentEditable = true;
+document.body.appendChild(testContainer);
+
+testContainer.innerHTML = '<div id="test">hello</div>';
+
+e = document.getElementById('test');
+computedStyle = window.getComputedStyle(e, null);
+
+e.style.borderStyle = "solid dotted";
+shouldBe("computedStyle.getPropertyValue('border-style')", "'solid dotted solid dotted'");
+shouldBe("computedStyle.getPropertyCSSValue('border-style').toString()", "'[object CSSValueList]'");
+shouldBe("computedStyle.getPropertyCSSValue('border-style').length", "4");
+shouldBe("computedStyle.getPropertyCSSValue('border-style').cssText", "'solid dotted solid dotted'");
+shouldBe("computedStyle.getPropertyCSSValue('border-style').item(0).getStringValue()", "'solid'");
+shouldBe("computedStyle.getPropertyCSSValue('border-style').item(1).getStringValue()", "'dotted'");
+shouldBe("computedStyle.getPropertyCSSValue('border-style').item(2).getStringValue()", "'solid'");
+shouldBe("computedStyle.getPropertyCSSValue('border-style').item(3).getStringValue()", "'dotted'");
+
+e.style.borderStyle = "solid dotted groove dashed";
+shouldBe("computedStyle.getPropertyValue('border-style')", "'solid dotted groove dashed'");
+shouldBe("computedStyle.getPropertyCSSValue('border-style').toString()", "'[object CSSValueList]'");
+shouldBe("computedStyle.getPropertyCSSValue('border-style').length", "4");
+shouldBe("computedStyle.getPropertyCSSValue('border-style').cssText", "'solid dotted groove dashed'");
+shouldBe("computedStyle.getPropertyCSSValue('border-style').item(0).getStringValue()", "'solid'");
+shouldBe("computedStyle.getPropertyCSSValue('border-style').item(1).getStringValue()", "'dotted'");
+shouldBe("computedStyle.getPropertyCSSValue('border-style').item(2).getStringValue()", "'groove'");
+shouldBe("computedStyle.getPropertyCSSValue('border-style').item(3).getStringValue()", "'dashed'");
+
+document.body.removeChild(testContainer);
+
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
index c147f0b..462a2b8 100644 (file)
@@ -1,5 +1,19 @@
 2011-12-28  Alexis Menard  <alexis.menard@openbossa.org>
 
+        getComputedStyle for border-style is not implemented.
+        https://bugs.webkit.org/show_bug.cgi?id=75312
+
+        Reviewed by Andreas Kling.
+
+        Implement getComputedStyle for border-style.
+
+        Test: fast/css/getComputedStyle/getComputedStyle-border-style-shorthand.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+
+2011-12-28  Alexis Menard  <alexis.menard@openbossa.org>
+
         getComputedStyle for border-bottom, border-top, border-left, border-right is not implemented.
         https://bugs.webkit.org/show_bug.cgi?id=74743
 
index 973df66..b4f0764 100644 (file)
@@ -2159,8 +2159,11 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
                                         CSSPropertyBorderRightColor };
             return getCSSPropertyValuesForShorthandProperties(properties, WTF_ARRAY_LENGTH(properties));
         }
-        case CSSPropertyBorderStyle:
-            break;
+        case CSSPropertyBorderStyle: {
+            const int properties[4] = { CSSPropertyBorderTopStyle, CSSPropertyBorderRightStyle,
+                                        CSSPropertyBorderBottomStyle, CSSPropertyBorderLeftStyle };
+            return getCSSPropertyValuesForShorthandProperties(properties, WTF_ARRAY_LENGTH(properties));
+        }
         case CSSPropertyBorderTop: {
             const int properties[3] = { CSSPropertyBorderTopWidth, CSSPropertyBorderTopStyle,
                                         CSSPropertyBorderTopColor };