mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibWeb: Fix bogus callback comparisons in EventTarget
When CallbackType::callback was converted from Object& to NNGCP<Object>,
we started comparing the addresses of NNGCPs instead of the addresses of
Objects.
That broke the Discord login form, and this patch fixes it.
Regression from 7c0c1c8f49
.
This commit is contained in:
parent
7d6bab2256
commit
7f632ee6f8
Notes:
sideshowbarker
2024-07-17 05:01:20 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/7f632ee6f8
1 changed files with 2 additions and 2 deletions
|
@ -162,7 +162,7 @@ void EventTarget::add_an_event_listener(DOMEventListener& listener)
|
|||
// and capture is listener’s capture, then append listener to eventTarget’s event listener list.
|
||||
auto it = m_event_listener_list.find_if([&](auto& entry) {
|
||||
return entry->type == listener.type
|
||||
&& &entry->callback->callback().callback == &listener.callback->callback().callback
|
||||
&& entry->callback->callback().callback == listener.callback->callback().callback
|
||||
&& entry->capture == listener.capture;
|
||||
});
|
||||
if (it == m_event_listener_list.end())
|
||||
|
@ -191,7 +191,7 @@ void EventTarget::remove_event_listener(DeprecatedFlyString const& type, IDLEven
|
|||
return true;
|
||||
if (!entry.callback || !callback)
|
||||
return false;
|
||||
return &entry.callback->callback().callback == &callback->callback().callback;
|
||||
return entry.callback->callback().callback == callback->callback().callback;
|
||||
};
|
||||
auto it = m_event_listener_list.find_if([&](auto& entry) {
|
||||
return entry->type == type
|
||||
|
|
Loading…
Add table
Reference in a new issue