5 <script src=
"../../../resources/js-test.js"></script>
10 description("Tests that border shorthands are computed properly.")
12 var testContainer
= document
.createElement("div");
13 testContainer
.contentEditable
= true;
14 document
.body
.appendChild(testContainer
);
16 testContainer
.innerHTML
= '<div id="test">hello</div>';
18 e
= document
.getElementById('test');
19 computedStyle
= window
.getComputedStyle(e
, null);
21 var properties
= new Array("border-bottom","border-top","border-right", "border-left");
23 for (i
= 0; i
< properties
.length
; ++i
) {
24 e
.style
.cssText
= properties
[i
] + ": 10px solid red;";
25 shouldBe("computedStyle.getPropertyValue('" + properties
[i
] + "')", "'10px solid rgb(255, 0, 0)'");
27 e
.style
.cssText
= properties
[i
] + ": 20em solid blue;";
28 shouldBe("computedStyle.getPropertyValue('" + properties
[i
] + "')", "'320px solid rgb(0, 0, 255)'");
30 e
.style
.cssText
= properties
[i
] + ": 10px none green;";
31 shouldBe("computedStyle.getPropertyValue('" + properties
[i
] + "')", "'0px none rgb(0, 128, 0)'");
35 e
.style
.border
= "20em solid red";
36 shouldBe("computedStyle.getPropertyValue('border')", "'320px solid rgb(255, 0, 0)'");
38 e
.style
.border
= "20em solid red";
39 e
.style
.borderTop
= "10px groove blue";
40 shouldBe("computedStyle.getPropertyValue('border')", "''");
43 document
.body
.removeChild(testContainer
);