blob: c0e00ca859eaaa1f61c83e8dfaaf90949ccc8c69 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../../resources/js-test.js"></script>
</head>
<body>
<script>
description("Verify that the priority parameter is a case-insensitive match to 'important' or the empty string.");
var testContainer = document.createElement("div");
document.body.appendChild(testContainer);
testContainer.innerHTML = '<div id="test">hello</div>';
e = document.getElementById('test');
// Test "important" strictness
e.style.borderBottomStyle = "";
e.style.setProperty("border-bottom-style", "solid", "!important");
shouldBeEqualToString("e.style.getPropertyValue('border-bottom-style')", "");
shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''");
e.style.borderBottomStyle = "";
e.style.setProperty("border-bottom-style", "solid", "very important");
shouldBeEqualToString("e.style.getPropertyValue('border-bottom-style')", "");
shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''");
e.style.borderBottomStyle = "";
e.style.setProperty("border-bottom-style", "solid", "impORTANT");
shouldBe("e.style.getPropertyValue('border-bottom-style')", "'solid'");
shouldBe("e.style.getPropertyPriority('border-bottom-style')", "'important'");
e.style.borderBottomStyle = "";
e.style.setProperty("border-bottom-style", "solid", "random");
shouldBeEqualToString("e.style.getPropertyValue('border-bottom-style')", "");
shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''");
e.style.borderBottomStyle = "";
e.style.setProperty("border-bottom-style", "solid", "undefined");
shouldBeEqualToString("e.style.getPropertyValue('border-bottom-style')", "");
shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''");
e.style.borderBottomStyle = "";
e.style.setProperty("border-bottom-style", "solid", undefined);
shouldBe("e.style.getPropertyValue('border-bottom-style')", "'solid'");
shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''");
document.body.removeChild(testContainer);
</script>
</body>
</html>