mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
LibWeb: Make sure we don't fire "once" event listeners twice
Spec bug: https://github.com/whatwg/dom/issues/1323
This commit is contained in:
parent
aa9ed71ff3
commit
69c84d3f63
Notes:
github-actions[bot]
2024-11-17 13:57:27 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/69c84d3f630 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2394
2 changed files with 6 additions and 3 deletions
|
@ -254,6 +254,10 @@ void EventTarget::remove_from_event_listener_list(DOMEventListener& listener)
|
|||
if (!m_data)
|
||||
return;
|
||||
m_data->event_listener_list.remove_first_matching([&](auto& entry) { return entry.ptr() == &listener; });
|
||||
|
||||
// FIXME: Update this when the spec is updated.
|
||||
// Spec bug: https://github.com/whatwg/dom/issues/1323
|
||||
listener.removed = true;
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent
|
||||
|
|
|
@ -6,8 +6,7 @@ Rerun
|
|||
|
||||
Found 2 tests
|
||||
|
||||
1 Pass
|
||||
1 Fail
|
||||
2 Pass
|
||||
Details
|
||||
Result Test Name MessagePass Removing all listeners and then adding a new one should work.
|
||||
Fail Nested usage of once listeners should work.
|
||||
Pass Nested usage of once listeners should work.
|
Loading…
Reference in a new issue