<html> | |
<head> | |
<title>HIERARCHY_REQUEST_ERR raised if @import rule inserted after a regular rule</title> | |
<style type="text/css"> | |
body {color: Blue; } | |
div {color: Red; } | |
</style> | |
<script> | |
if (window.testRunner) | |
window.testRunner.dumpAsText(); | |
</script> | |
</head> | |
<body> | |
<div>This text should be red and the page should have no other style.</div> | |
<div id="testresult">Fail</div> | |
<script type="text/javascript"> | |
try | |
{ | |
document.styleSheets[0].insertRule("@import url(testStyle1.css);", 1); | |
} | |
catch(e) | |
{ | |
if(window.getComputedStyle(document.body, "").getPropertyValue("background-color") == "rgba(0, 0, 0, 0)" && document.styleSheets[0].cssRules.length == 2) | |
{ | |
document.getElementById("testresult").innerHTML = "Pass"; | |
} | |
} | |
</script> | |
</body> | |
</html> |