Correct an unsound optimization in event dispatch.

This commit is contained in:
Ms2ger 2016-09-12 16:03:46 +02:00
parent 6cb43f213e
commit 3eaf1c1b89
3 changed files with 12 additions and 14 deletions

View file

@ -1,8 +0,0 @@
[Event-propagation.html]
type: testharness
[After stopPropagation()]
expected: FAIL
[After stopImmediatePropagation()]
expected: FAIL

View file

@ -11,6 +11,9 @@ function testPropagationFlag(ev, expected, desc) {
test(function() {
var called = false;
var callback = function() { called = true };
this.add_cleanup(function() {
document.head.removeEventListener("foo", callback)
});
document.head.addEventListener("foo", callback);
document.head.dispatchEvent(ev);
assert_equals(called, expected, "Propagation flag");
@ -18,7 +21,6 @@ function testPropagationFlag(ev, expected, desc) {
// the event the second time around.
document.head.dispatchEvent(ev);
assert_equals(called, true, "Propagation flag after first dispatch");
document.head.removeEventListener("foo", callback);
}, desc);
}