summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/beforeload/script-before-load-xhtml.xhtml
blob: 247c74380c683fc67e0bc769e9bee899aba0e074 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="resources/print.js"></script>
</head>

<body>
<p>This page tests the beforeload event on script elements.  You should see a PASS message below if everything
works.</p>
<hr/>
<div id="console"></div>

<script>
if (window.layoutTestController)
    layoutTestController.dumpAsText();
    
function beforeLoadFunc()
{
    print("PASS", "green");
    event.preventDefault();
}

document.body.addEventListener("beforeload", beforeLoadFunc, true);
</script>
<script src="resources/fail.js"></script>

</body>
</html>