mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
LibWeb: Update handling of "once" event listeners now that spec is fixed
https://github.com/whatwg/dom/issues/1323 was fixed, and the solution ended up slightly different from what we had, so let's follow the spec.
This commit is contained in:
parent
9f541c363d
commit
e28e4f6700
Notes:
github-actions[bot]
2024-11-18 19:21:51 +00:00
Author: https://github.com/awesomekling
Commit: e28e4f6700
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2426
3 changed files with 2 additions and 14 deletions
|
@ -56,9 +56,9 @@ bool EventDispatcher::inner_invoke(Event& event, Vector<GC::Root<DOM::DOMEventLi
|
|||
if (phase == Event::Phase::BubblingPhase && listener->capture)
|
||||
continue;
|
||||
|
||||
// 5. If listener’s once is true, then remove listener from event’s currentTarget attribute value’s event listener list.
|
||||
// 5. If listener’s once is true, then remove an event listener given event’s currentTarget attribute value and listener.
|
||||
if (listener->once)
|
||||
event.current_target()->remove_from_event_listener_list(*listener);
|
||||
event.current_target()->remove_an_event_listener(*listener);
|
||||
|
||||
// 6. Let global be listener callback’s associated Realm’s global object.
|
||||
auto& callback = listener->callback->callback();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue