5 <script src=
"../../../resources/js-test.js"></script>
10 description("Tests that the border-radius shorthand is computed properly.")
12 var testContainer
= document
.createElement("div");
13 testContainer
.contentEditable
= true;
14 document
.body
.appendChild(testContainer
);
16 testContainer
.innerHTML
= '<div style="width:100px;height:100px"><div id="test">hello</div></div>';
18 e
= document
.getElementById('test');
19 computedStyle
= window
.getComputedStyle(e
, null);
21 e
.style
.borderRadius
= "4em";
22 shouldBe("computedStyle.getPropertyValue('border-radius')", "'64px'");
24 e
.style
.borderRadius
= "2em 1em 4em / 0.5em 3em";
25 shouldBe("computedStyle.getPropertyValue('border-radius')", "'32px 16px 64px / 8px 48px'");
27 e
.style
.borderRadius
= "";
28 e
.style
.borderTopLeftRadius
= "4em";
29 e
.style
.borderTopRightRadius
= "4em";
30 e
.style
.borderBottomLeftRadius
= "4em";
31 e
.style
.borderBottomRightRadius
= "4em";
32 shouldBe("computedStyle.getPropertyValue('border-radius')", "'64px'");
34 e
.style
.borderRadius
= "1px 2px";
35 shouldBe("computedStyle.getPropertyValue('border-radius')", "'1px 2px'");
37 e
.style
.borderRadius
= "1px 2px 4px";
38 shouldBe("computedStyle.getPropertyValue('border-radius')", "'1px 2px 4px'");
40 e
.style
.borderRadius
= "1px 2px 4px 6px";
41 shouldBe("computedStyle.getPropertyValue('border-radius')", "'1px 2px 4px 6px'");
43 e
.style
.borderRadius
= "1px 2px 4px 6px / 4em";
44 shouldBe("computedStyle.getPropertyValue('border-radius')", "'1px 2px 4px 6px / 64px'");
46 e
.style
.borderRadius
= "1px 2px 4px 6px / 4em 3px";
47 shouldBe("computedStyle.getPropertyValue('border-radius')", "'1px 2px 4px 6px / 64px 3px'");
49 e
.style
.borderRadius
= "1px 2px 4px 6px / 4em 3px 7px";
50 shouldBe("computedStyle.getPropertyValue('border-radius')", "'1px 2px 4px 6px / 64px 3px 7px'");
52 e
.style
.borderRadius
= "1px 2px 4px 6px / 4em 3px 7px 8px";
53 shouldBe("computedStyle.getPropertyValue('border-radius')", "'1px 2px 4px 6px / 64px 3px 7px 8px'");
55 e
.style
.borderRadius
= "10px 20px 30px 40px / 15px 25px 35px 45px";
56 shouldBe("computedStyle.getPropertyValue('border-radius')", "'10px 20px 30px 40px / 15px 25px 35px 45px'");
58 e
.style
.borderRadius
= "10px 20px 30px 40px / 10px 25px 35px 45px";
59 shouldBe("computedStyle.getPropertyValue('border-radius')", "'10px 20px 30px 40px / 10px 25px 35px 45px'");
61 e
.style
.borderRadius
= "10px 20px 30px 40px / 10px 20px 35px 45px";
62 shouldBe("computedStyle.getPropertyValue('border-radius')", "'10px 20px 30px 40px / 10px 20px 35px 45px'");
64 e
.style
.borderRadius
= "10px 20px 30px 40px / 10px 20px 30px 45px";
65 shouldBe("computedStyle.getPropertyValue('border-radius')", "'10px 20px 30px 40px / 10px 20px 30px 45px'");
67 document
.body
.removeChild(testContainer
);