Title: [144647] trunk
Revision
144647
Author
[email protected]
Date
2013-03-04 10:59:31 -0800 (Mon, 04 Mar 2013)

Log Message

getComputedStyle not implemented for -webkit-columns shorthand
https://bugs.webkit.org/show_bug.cgi?id=111236

Patch by Uday Kiran <[email protected]> on 2013-03-04
Reviewed by Alexis Menard.

Source/WebCore:

Implement getComputedStyle for -webkit-columns shorthand.

Test: fast/css/getComputedStyle/getComputedStyle-webkit-columns-shorthand.html

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

LayoutTests:

Add test to check getComputedStyle for -webkit-columns.

* fast/css/getComputedStyle/getComputedStyle-webkit-columns-shorthand-expected.txt: Added.
* fast/css/getComputedStyle/getComputedStyle-webkit-columns-shorthand.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (144646 => 144647)


--- trunk/LayoutTests/ChangeLog	2013-03-04 18:56:53 UTC (rev 144646)
+++ trunk/LayoutTests/ChangeLog	2013-03-04 18:59:31 UTC (rev 144647)
@@ -1,3 +1,15 @@
+2013-03-04  Uday Kiran  <[email protected]>
+
+        getComputedStyle not implemented for -webkit-columns shorthand
+        https://bugs.webkit.org/show_bug.cgi?id=111236
+
+        Reviewed by Alexis Menard.
+
+        Add test to check getComputedStyle for -webkit-columns.
+
+        * fast/css/getComputedStyle/getComputedStyle-webkit-columns-shorthand-expected.txt: Added.
+        * fast/css/getComputedStyle/getComputedStyle-webkit-columns-shorthand.html: Added.
+
 2013-03-04  Alexis Menard  <[email protected]>
 
         transition-property property and transition shorthand property doesn't accept "all, all".

Added: trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-webkit-columns-shorthand-expected.txt (0 => 144647)


--- trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-webkit-columns-shorthand-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-webkit-columns-shorthand-expected.txt	2013-03-04 18:59:31 UTC (rev 144647)
@@ -0,0 +1,45 @@
+Test to make sure -webkit-columns property returns CSSValueList properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS computedStyle.getPropertyValue('-webkit-columns') is "10px 2"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').toString() is "[object CSSValueList]"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').cssText is "10px 2"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').length is 2
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getFloatValue(CSSPrimitiveValue.CSS_PX) is 10
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 2
+PASS computedStyle.getPropertyValue('-webkit-columns') is "10px auto"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').toString() is "[object CSSValueList]"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').cssText is "10px auto"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').length is 2
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getFloatValue(CSSPrimitiveValue.CSS_PX) is 10
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getStringValue() is "auto"
+PASS computedStyle.getPropertyValue('-webkit-columns') is "auto 2"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').toString() is "[object CSSValueList]"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').cssText is "auto 2"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').length is 2
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getStringValue() is "auto"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 2
+PASS computedStyle.getPropertyValue('-webkit-columns') is "auto 2"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').toString() is "[object CSSValueList]"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').cssText is "auto 2"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').length is 2
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getStringValue() is "auto"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 2
+PASS computedStyle.getPropertyValue('-webkit-columns') is "auto auto"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').toString() is "[object CSSValueList]"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').cssText is "auto auto"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').length is 2
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getStringValue() is "auto"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getStringValue() is "auto"
+PASS computedStyle.getPropertyValue('-webkit-columns') is "10px auto"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').toString() is "[object CSSValueList]"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').cssText is "10px auto"
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').length is 2
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getFloatValue(CSSPrimitiveValue.CSS_PX) is 10
+PASS computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getStringValue() is "auto"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-webkit-columns-shorthand.html (0 => 144647)


--- trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-webkit-columns-shorthand.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-webkit-columns-shorthand.html	2013-03-04 18:59:31 UTC (rev 144647)
@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src=""
+</head>
+<body>
+<script>
+
+description("Test to make sure -webkit-columns property returns CSSValueList properly.")
+
+var testContainer = document.createElement("div");
+testContainer.contentEditable = true;
+document.body.appendChild(testContainer);
+
+testContainer.innerHTML = '<div id="test" style="-webkit-columns: 10px 2;">hello</div>';
+
+e = document.getElementById('test');
+computedStyle = window.getComputedStyle(e, null);
+
+shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", '10px 2');
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').toString()", '[object CSSValueList]');
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').cssText", '10px 2');
+shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').length", "2");
+shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getFloatValue(CSSPrimitiveValue.CSS_PX)", "10");
+shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "2");
+
+e.style.webkitColumns="10px";
+shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", '10px auto');
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').toString()", '[object CSSValueList]');
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').cssText", '10px auto');
+shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').length", "2");
+shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getFloatValue(CSSPrimitiveValue.CSS_PX)", "10");
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getStringValue()", "auto");
+
+e.style.webkitColumns=""
+e.style.webkitColumnCount="2"
+shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", 'auto 2');
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').toString()", '[object CSSValueList]');
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').cssText", 'auto 2');
+shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').length", "2");
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getStringValue()", 'auto');
+shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "2");
+
+e.style.webkitColumns="auto 2"
+shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", 'auto 2');
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').toString()", '[object CSSValueList]');
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').cssText", 'auto 2');
+shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').length", "2");
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getStringValue()", 'auto');
+shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "2");
+
+e.style.webkitColumnCount="auto";
+shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", 'auto auto');
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').toString()", '[object CSSValueList]');
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').cssText", 'auto auto');
+shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').length", "2");
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getStringValue()", 'auto');
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getStringValue()", 'auto');
+
+e.style.webkitColumnWidth="10px";
+shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", '10px auto');
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').toString()", '[object CSSValueList]');
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').cssText", '10px auto');
+shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').length", "2");
+shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getFloatValue(CSSPrimitiveValue.CSS_PX)", "10");
+shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getStringValue()", 'auto');
+
+document.body.removeChild(testContainer);
+
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (144646 => 144647)


--- trunk/Source/WebCore/ChangeLog	2013-03-04 18:56:53 UTC (rev 144646)
+++ trunk/Source/WebCore/ChangeLog	2013-03-04 18:59:31 UTC (rev 144647)
@@ -1,3 +1,17 @@
+2013-03-04  Uday Kiran  <[email protected]>
+
+        getComputedStyle not implemented for -webkit-columns shorthand
+        https://bugs.webkit.org/show_bug.cgi?id=111236
+
+        Reviewed by Alexis Menard.
+
+        Implement getComputedStyle for -webkit-columns shorthand.
+
+        Test: fast/css/getComputedStyle/getComputedStyle-webkit-columns-shorthand.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+
 2013-03-04  Levi Weintraub  <[email protected]>
 
         Add support for 8 bit TextRuns on Chromium Linux & Mac

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (144646 => 144647)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2013-03-04 18:56:53 UTC (rev 144646)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2013-03-04 18:59:31 UTC (rev 144647)
@@ -2682,6 +2682,8 @@
             return getCSSPropertyValuesForSidesShorthand(borderWidthShorthand());
         case CSSPropertyWebkitColumnRule:
             return getCSSPropertyValuesForShorthandProperties(webkitColumnRuleShorthand());
+        case CSSPropertyWebkitColumns:
+            return getCSSPropertyValuesForShorthandProperties(webkitColumnsShorthand());
         case CSSPropertyListStyle:
             return getCSSPropertyValuesForShorthandProperties(listStyleShorthand());
         case CSSPropertyMargin:
@@ -2763,7 +2765,6 @@
         /* Unimplemented -webkit- properties */
         case CSSPropertyWebkitAnimation:
         case CSSPropertyWebkitBorderRadius:
-        case CSSPropertyWebkitColumns:
         case CSSPropertyWebkitMarginCollapse:
         case CSSPropertyWebkitMarquee:
         case CSSPropertyWebkitMarqueeSpeed:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to