blob: 58f725719ad21a36c8737a87b01be60c61c117ab [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../../../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'");
shouldBe("computedStyle.getPropertyCSSValue('border-style').toString()", "'[object CSSValueList]'");
shouldBe("computedStyle.getPropertyCSSValue('border-style').length", "2");
shouldBe("computedStyle.getPropertyCSSValue('border-style').cssText", "'solid dotted'");
shouldBe("computedStyle.getPropertyCSSValue('border-style').item(0).getStringValue()", "'solid'");
shouldBe("computedStyle.getPropertyCSSValue('border-style').item(1).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="../../../resources/js-test-post.js"></script>
</body>
</html>