5 <script src=
"../../resources/js-test.js"></script>
10 description("Verify that the priority parameter is a case-insensitive match to 'important' or the empty string.");
12 var testContainer
= document
.createElement("div");
13 document
.body
.appendChild(testContainer
);
15 testContainer
.innerHTML
= '<div id="test">hello</div>';
17 e
= document
.getElementById('test');
19 // Test "important" strictness
20 e
.style
.borderBottomStyle
= "";
21 e
.style
.setProperty("border-bottom-style", "solid", "!important");
22 shouldBeEqualToString("e.style.getPropertyValue('border-bottom-style')", "");
23 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''");
25 e
.style
.borderBottomStyle
= "";
26 e
.style
.setProperty("border-bottom-style", "solid", "very important");
27 shouldBeEqualToString("e.style.getPropertyValue('border-bottom-style')", "");
28 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''");
30 e
.style
.borderBottomStyle
= "";
31 e
.style
.setProperty("border-bottom-style", "solid", "impORTANT");
32 shouldBe("e.style.getPropertyValue('border-bottom-style')", "'solid'");
33 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "'important'");
35 e
.style
.borderBottomStyle
= "";
36 e
.style
.setProperty("border-bottom-style", "solid", "random");
37 shouldBeEqualToString("e.style.getPropertyValue('border-bottom-style')", "");
38 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''");
40 e
.style
.borderBottomStyle
= "";
41 e
.style
.setProperty("border-bottom-style", "solid", "undefined");
42 shouldBeEqualToString("e.style.getPropertyValue('border-bottom-style')", "");
43 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''");
45 e
.style
.borderBottomStyle
= "";
46 e
.style
.setProperty("border-bottom-style", "solid", undefined);
47 shouldBe("e.style.getPropertyValue('border-bottom-style')", "'solid'");
48 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''");
50 document
.body
.removeChild(testContainer
);