Took out the special mouseover cancel case

This commit is contained in:
Patrick Shaughnessy 2019-12-10 21:50:47 -05:00
parent b19b778fef
commit f35a870f55
2 changed files with 6 additions and 20 deletions

View file

@ -227,14 +227,13 @@ impl CompiledEventListener {
rooted!(in(*cx) let value = value);
let value = value.handle();
//Step 4
let should_cancel = match event.type_() {
atom!("mouseover") => {
value.is_boolean() && value.to_boolean() == true
},
_ => value.is_boolean() && value.to_boolean() == false,
};
//Step 5
let should_cancel = value.is_boolean() && value.to_boolean() == false;
if should_cancel {
// spec says to set the cancelled flag directly
// here, not just to prevent default;
// can that ever make a difference?
event.PreventDefault();
}
}

View file

@ -3,16 +3,3 @@
[beforeunload listener returning null cancels event]
bug: https://github.com/servo/servo/issues/10787
expected: FAIL
[mouseover listener returning false cancels event (using Event)]
expected: FAIL
[mouseover listener returning false cancels event (using MouseEvent)]
expected: FAIL
[mouseover listener returning true doesn't cancel event (using Event)]
expected: FAIL
[mouseover listener returning true doesn't cancel event (using MouseEvent)]
expected: FAIL