Auto merge of #13245 - servo:reset-stop-propagation, r=nox

Correct an unsound optimization in event dispatch.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13245)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-09-12 13:22:18 -05:00 committed by GitHub
commit bb53da6957
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);
}