diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-12-11 10:12:52 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-11 10:12:52 -0500 |
commit | fc97a53a9413b1b72c8eb25f9a38a26bdd5beefe (patch) | |
tree | a855602ea9bc9cd68edfbe78bb36a918e090dfbf | |
parent | aa268e154f5bd1c57c0e49f7564a060dc1c1b09a (diff) | |
parent | e501eaaa5b43961883ef8ef1427790f6c9bb1804 (diff) | |
download | servo-fc97a53a9413b1b72c8eb25f9a38a26bdd5beefe.tar.gz servo-fc97a53a9413b1b72c8eb25f9a38a26bdd5beefe.zip |
Auto merge of #25240 - pshaughn:unspecial_mouseover, r=SimonSapin
Took out the special mouseover cancel case
<!-- Please describe your changes on the following line: -->
eventtarget.rs was checking the event type to see if it was a mouseover; now it doesn't. Other special-case events like error and beforeunload go down other code paths entirely, so this one has no special cases left.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #25190
<!-- Either: -->
- [X] There are tests for these changes
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
-rw-r--r-- | components/script/dom/eventtarget.rs | 13 | ||||
-rw-r--r-- | tests/wpt/metadata/html/webappapis/scripting/events/event-handler-processing-algorithm.html.ini | 13 |
2 files changed, 6 insertions, 20 deletions
diff --git a/components/script/dom/eventtarget.rs b/components/script/dom/eventtarget.rs index 12cf7d0253b..ea259a6d2d7 100644 --- a/components/script/dom/eventtarget.rs +++ b/components/script/dom/eventtarget.rs @@ -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 { + // FIXME: spec says to set the cancelled flag directly + // here, not just to prevent default; + // can that ever make a difference? event.PreventDefault(); } } diff --git a/tests/wpt/metadata/html/webappapis/scripting/events/event-handler-processing-algorithm.html.ini b/tests/wpt/metadata/html/webappapis/scripting/events/event-handler-processing-algorithm.html.ini index 4940ff4ac62..656089c1f0d 100644 --- a/tests/wpt/metadata/html/webappapis/scripting/events/event-handler-processing-algorithm.html.ini +++ b/tests/wpt/metadata/html/webappapis/scripting/events/event-handler-processing-algorithm.html.ini @@ -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 - |