<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"/> | |
<meta http-equiv="pragma" content="no-cache"/> | |
<meta http-equiv="expires" content="0"/> | |
<script src="resources/print.js"></script> | |
<script> | |
function test() | |
{ | |
if (window.testRunner) { | |
testRunner.dumpAsText(); | |
testRunner.waitUntilDone(); | |
} | |
frame = document.createElement("iframe"); | |
frame.setAttribute("src", "resources/content.xhtml"); | |
frame.addEventListener("load", function(){ | |
setTimeout(step2, 0); | |
}, { once: true }); | |
document.body.appendChild(frame); | |
function step2(){ | |
ins = 'href="test.xsl?a=1" type="text/xsl"'; | |
pi = frame.contentDocument.createProcessingInstruction('xml-stylesheet', ins); | |
pi.addEventListener("beforeload", function(){ pi.data = 'href="test.xsl?b=1" type="text/xsl"'; }, { once: true }); | |
frame.contentDocument.insertBefore(pi, frame.contentDocument.firstChild); | |
frame.contentDocument.removeChild(pi); | |
pi = null; | |
print("PASS: No assertions hit.", "green"); | |
if (window.testRunner) | |
testRunner.notifyDone(); | |
} | |
} | |
</script> | |
</head> | |
<body onload="test()"> | |
<p>This test confirms that XSL stylesheets are properly handled if loaded during 'beforeload' events. It passes if no debug assertions are fired.</p> | |
<div id="console"></div> | |
</body> | |
</html> |