mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 22:30:31 +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
|
@ -249,17 +249,6 @@ void EventTarget::remove_an_event_listener(DOMEventListener& listener)
|
|||
m_data->event_listener_list.remove_first_matching([&](auto& entry) { return entry.ptr() == &listener; });
|
||||
}
|
||||
|
||||
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
|
||||
WebIDL::ExceptionOr<bool> EventTarget::dispatch_event_binding(Event& event)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue