1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../resources/js-test.js"></script>
8 description("Custom events should propagate in disconnected DOM trees.");
10 var eventReceivedOnParent
= false;
11 var eventReceivedOnChild
= false;
13 var parent
= document
.createElement('div');
14 var child
= document
.createElement('div');
15 parent
.appendChild(child
);
16 parent
.addEventListener('foo', function(e
) { eventReceivedOnParent
= true; } );
17 child
.addEventListener('foo', function(e
) { eventReceivedOnChild
= true; } );
18 var event
= document
.createEvent('Event');
19 event
.initEvent('foo', true, true);
20 child
.dispatchEvent(event
);
22 shouldBeTrue("eventReceivedOnParent");
23 shouldBeTrue("eventReceivedOnChild");