Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: LayoutTests/fast/events/dispatch-event-no-document.html

Issue 22880019: [DOM4] Doctypes now always have a node document and can be moved across document boundaries (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Improve tests Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <script> 1 <script>
2 function handleEvent(message) { 2 function handleEvent(message) {
3 document.getElementById("log").innerHTML = "FAIL: " + message + " handled.<b r>"; 3 document.getElementById("log").innerHTML = "PASS: " + message + " handled.<b r>";
4 } 4 }
5 5
6 function test() { 6 function test() {
7 if (window.testRunner) { 7 if (window.testRunner) {
8 testRunner.dumpAsText(); 8 testRunner.dumpAsText();
9 } 9 }
10 10
11 var doctype = document.implementation.createDocumentType( 11 var doctype = document.implementation.createDocumentType(
12 'html', 12 'html',
13 '-//W3C//DTD XHTML 1.0 Strict//EN', 13 '-//W3C//DTD XHTML 1.0 Strict//EN',
14 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd' 14 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'
15 ); 15 );
16 16
17 var evt = document.createEvent("Event"); 17 var evt = document.createEvent("Event");
18 evt.initEvent("generic", true, true); 18 evt.initEvent("generic", true, true);
19 doctype.addEventListener("generic", function () { handleEvent("generic")}, f alse); 19 doctype.addEventListener("generic", function () { handleEvent("generic")}, f alse);
20 doctype.dispatchEvent(evt); 20 doctype.dispatchEvent(evt);
21 } 21 }
22 </script> 22 </script>
23 <body onload="test()"> 23 <body onload="test()">
24 <p>The test verifies that EventTarget with an event listener but without ScriptE xecutionContext (not inserted into Document) does not crash during an attempt to dispatch an event. It should just not call the handler. This is what FF 3.5 is also doing.</p> 24 <p>The test verifies that EventTarget with an event listener not inserted into a Document does not crash during an attempt to dispatch an event.</p>
25 <p>Test passes if there is no crash, and event is not dispatched.</p> 25 <p>Test passes if there is no crash, and event is dispatched.</p>
26 <div id="log">PASS</div> 26 <div id="log">FAIL</div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698