5 if (window
.testRunner
) {
6 testRunner
.dumpAsText();
7 testRunner
.waitUntilDone();
11 document
.getElementById("target").addEventListener("click", targetClick
, true);
13 if (window
.eventSender
) {
14 eventSender
.mouseMoveTo(52, 52);
15 eventSender
.mouseDown();
16 eventSender
.mouseUp();
17 window
.setTimeout(finish
, 0);
27 log("targetClickFired: " + targetClickFired
);
28 log("containerClickFired: " + containerClickFired
);
29 if (targetClickFired
&& !containerClickFired
)
33 if (window
.testRunner
)
34 testRunner
.notifyDone();
38 document
.getElementById("result").innerHTML
= document
.getElementById("result").innerHTML
+ text
+ "<br>";
41 var targetClickFired
= false;
42 var containerClickFired
= false;
44 function targetClick(e
) {
45 window
.setTimeout(finish
, 0);
46 targetClickFired
= true;
51 function containerClick(e
) {
52 window
.setTimeout(finish
, 0);
53 containerClickFired
= true;
59 <body onload=
"test()">
61 <p>This tests checks that capturing event handlers trigger on the node that is the target of the event, and that stopPropagation in such a handler prevents further bubble handlers from triggering.
</p>
62 <div onclick=
"containerClick(event)">
63 <div style=
"position:absolute; top: 40; left: 40; width: 100; height: 40; background-color: pink" id=
"target" onclick=
"targetClick(event)">Click here
</a>
66 <div id=
"result" style=
"position: absolute; top: 100; left: 50;"><br></div>