5 <script src=
"../../../resources/js-test.js"></script>
10 description("Tests that the border-width shorthand is computed properly.")
12 var testContainer
= document
.createElement("div");
13 testContainer
.contentEditable
= true;
14 document
.body
.appendChild(testContainer
);
16 testContainer
.innerHTML
= '<div id="test" style="border-width: 10px 5px 4px 3px; border-style: solid solid;">hello</div>';
18 e
= document
.getElementById('test');
19 computedStyle
= window
.getComputedStyle(e
, null);
21 shouldBe("computedStyle.getPropertyValue('border-width')", "'10px 5px 4px 3px'");
23 e
.style
.borderWidth
="20em 10em 4em 5em";
24 shouldBe("computedStyle.getPropertyValue('border-width')", "'320px 160px 64px 80px'");
26 e
.style
.borderWidth
=""
27 e
.style
.borderStyle
=""
28 e
.style
.borderTop
= "10px solid"
29 shouldBe("computedStyle.getPropertyValue('border-width')", "'10px 0px 0px'");
32 e
.style
.borderWidth
="10px 5px 4px 3px"
33 e
.style
.borderStyle
="none";
34 shouldBe("computedStyle.getPropertyValue('border-width')", "'0px'");
36 e
.style
.borderStyle
="hidden";
37 shouldBe("computedStyle.getPropertyValue('border-width')", "'0px'");
39 document
.body
.removeChild(testContainer
);