blob: 67d7427582966c49463734b4dbe5e2d68f425f58 (
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
<?xml version="1.0"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <head>
<title>Test</title>
<script type="text/javascript"><![CDATA[
function onAttrModified(evt) {
// window.alert("Mutation event fired within the frame code.");
// evt.target.focus();
// evt.target.blur();
evt.target.style.background = 'green';
bounce(evt.target);
// evt.target.normalize();
// bounce(evt.target.parentNode);
}
function die(n) {
p = n.parentNode;
p.removeChild(n);
}
function bounce(n) {
p = n.parentNode;
p.removeChild(n);
p.appendChild(n);
}
function test_AttrModified() {
var x = document.getElementById("x");
x.addEventListener("DOMAttrModified", onAttrModified);
bounce(x);
}
function test() {
setTimeout(test_AttrModified, 3000);
}
]]></script>
</head>
<body onload="test()">
<h1>TestCase for unsafe mutable events from textarea</h1>
<p>Please wait for 3 seconds after document was loaded,
if your browser is vulnerable, it may stop responding
to keyboard and mouse event
and most likely it will eventually crash (may take a
while for debug builds).</p>
<p>
<textarea id="x"></textarea>
</p>
</body> </html>
|