Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / event-fired-after-removal.html
blob29dff485e7fa45aacc3130ef3fd3a4e6736e7806
1 <p>This page verifies that queued event listeners keep firing even after a node has been removed from the document.</p>
2 <p>If the test passes, you'll see a PASS message below.</p>
4 <pre id="console"></pre>
6 <div id="div"></div>
8 <script>
9 if (window.testRunner)
10 testRunner.dumpAsText();
12 function log(s)
14 document.getElementById("console").appendChild(document.createTextNode(s + "\n"));
17 var result = [ ];
19 function reportResult(expected)
21 var passed = true;
22 var end = result.length > expected.length ? result.length : expected.length;
23 for (var i = 0; i < end; ++i) {
24 if (result[i] != expected[i]) {
25 log("FAIL: " + name + " result[" + i + "] should be " + expected[i] + " but instead is " + result[i] + ".");
26 passed = false;
29 if (passed)
30 log("PASS: result should be " + expected + " and is.");
33 var div = document.getElementById("div");
34 div.addEventListener("click", function f1() {
35 result.push(arguments.callee.name);
36 div.parentNode.removeChild(div);
37 }, false);
39 div.addEventListener("click", function f2() {
40 result.push(arguments.callee.name);
41 }, false);
43 var event = document.createEvent("MouseEvent");
44 event.initMouseEvent("click", true, true, document.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, document);
45 div.dispatchEvent(event);
47 reportResult([ "f1", "f2" ]);
48 </script>