summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/beforeload/pi-before-load.xhtml
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/fast/dom/beforeload/pi-before-load.xhtml')
-rw-r--r--LayoutTests/fast/dom/beforeload/pi-before-load.xhtml41
1 files changed, 41 insertions, 0 deletions
diff --git a/LayoutTests/fast/dom/beforeload/pi-before-load.xhtml b/LayoutTests/fast/dom/beforeload/pi-before-load.xhtml
new file mode 100644
index 0000000..58c19e1
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/pi-before-load.xhtml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<style>
+.block {
+ width: 100px;
+ height: 100px;
+ background-color: green;
+}
+</style>
+<script src="resources/print.js"></script>
+<script>
+function test()
+{
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ if (document.getElementById('block').offsetWidth == 100)
+ print("PASS", "green");
+ else
+ print("FAIL", "red");
+}
+</script>
+</head>
+<body onload="test()">
+<div id="block" class="block"></div>
+<script>
+function beforeLoadFunc()
+{
+ event.preventDefault();
+}
+
+document.addEventListener("beforeload", beforeLoadFunc, true);
+
+var pi = document.createProcessingInstruction("xml-stylesheet", "type=\"text/css\" href=\"resources/fail.css\"");
+document.insertBefore(pi, document.documentElement);
+</script>
+<hr/>
+<div id="console"></div>
+</body>
+</html>