5 <script src="../../js/resources/js-test-pre.js"></script>
10 description("Test to make sure -webkit-columns property returns CSSValueList properly.")
12 var testContainer = document.createElement("div");
13 testContainer.contentEditable = true;
14 document.body.appendChild(testContainer);
16 testContainer.innerHTML = '<div id="test" style="-webkit-columns: 10px 2;">hello</div>';
18 e = document.getElementById('test');
19 computedStyle = window.getComputedStyle(e, null);
21 shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", '10px 2');
22 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').toString()", '[object CSSValueList]');
23 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').cssText", '10px 2');
24 shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').length", "2");
25 shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getFloatValue(CSSPrimitiveValue.CSS_PX)", "10");
26 shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "2");
28 e.style.webkitColumns="10px";
29 shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", '10px auto');
30 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').toString()", '[object CSSValueList]');
31 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').cssText", '10px auto');
32 shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').length", "2");
33 shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getFloatValue(CSSPrimitiveValue.CSS_PX)", "10");
34 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getStringValue()", "auto");
36 e.style.webkitColumns=""
37 e.style.webkitColumnCount="2"
38 shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", 'auto 2');
39 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').toString()", '[object CSSValueList]');
40 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').cssText", 'auto 2');
41 shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').length", "2");
42 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getStringValue()", 'auto');
43 shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "2");
45 e.style.webkitColumns="auto 2"
46 shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", 'auto 2');
47 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').toString()", '[object CSSValueList]');
48 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').cssText", 'auto 2');
49 shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').length", "2");
50 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getStringValue()", 'auto');
51 shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "2");
53 e.style.webkitColumnCount="auto";
54 shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", 'auto auto');
55 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').toString()", '[object CSSValueList]');
56 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').cssText", 'auto auto');
57 shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').length", "2");
58 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getStringValue()", 'auto');
59 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getStringValue()", 'auto');
61 e.style.webkitColumnWidth="10px";
62 shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", '10px auto');
63 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').toString()", '[object CSSValueList]');
64 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').cssText", '10px auto');
65 shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').length", "2");
66 shouldBe("computedStyle.getPropertyCSSValue('-webkit-columns').item(0).getFloatValue(CSSPrimitiveValue.CSS_PX)", "10");
67 shouldBeEqualToString("computedStyle.getPropertyCSSValue('-webkit-columns').item(1).getStringValue()", 'auto');
69 document.body.removeChild(testContainer);
72 <script src="../../js/resources/js-test-post.js"></script>