mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Fix some of the remove-event-handler problems
This commit is contained in:
parent
6d220d02de
commit
2874c62d35
2 changed files with 9 additions and 10 deletions
|
@ -404,9 +404,15 @@ impl EventTarget {
|
||||||
});
|
});
|
||||||
|
|
||||||
match idx {
|
match idx {
|
||||||
Some(idx) => {
|
Some(idx) => match listener {
|
||||||
entries[idx].listener =
|
// Replace if there's something to replace with,
|
||||||
EventListenerType::Inline(listener.unwrap_or(InlineEventListener::Null));
|
// but remove entirely if there isn't.
|
||||||
|
Some(listener) => {
|
||||||
|
entries[idx].listener = EventListenerType::Inline(listener);
|
||||||
|
},
|
||||||
|
None => {
|
||||||
|
entries.remove(idx);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
if let Some(listener) = listener {
|
if let Some(listener) = listener {
|
||||||
|
|
|
@ -1,10 +1,3 @@
|
||||||
[event-handler-removal.window.html]
|
[event-handler-removal.window.html]
|
||||||
[Event handler set through content attribute should be deactivated when the content attribute is removed.]
|
[Event handler set through content attribute should be deactivated when the content attribute is removed.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Event handler set through IDL should be deactivated when the IDL attribute is set to null.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Event handler set through content attribute should be removed when they are set to null.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue