mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01:00
Correct an unsound optimization in event dispatch.
This commit is contained in:
parent
6cb43f213e
commit
3eaf1c1b89
3 changed files with 12 additions and 14 deletions
|
@ -1,8 +0,0 @@
|
|||
[Event-propagation.html]
|
||||
type: testharness
|
||||
[After stopPropagation()]
|
||||
expected: FAIL
|
||||
|
||||
[After stopImmediatePropagation()]
|
||||
expected: FAIL
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue