summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-03-18 16:37:09 +0100
committerAndreas Kling <kling@serenityos.org>2023-03-18 16:37:09 +0100
commit7f632ee6f8e7b97dd1d2d3fffc40236f926cd2a5 (patch)
tree7135764e1404b54e9c686c0c78824adbcb9b788f /Userland/Libraries
parent7d6bab2256f65c74f0328811c2b60be514763665 (diff)
downloadserenity-7f632ee6f8e7b97dd1d2d3fffc40236f926cd2a5.zip
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 7c0c1c8f4969abeec1436346f29081b3afbcdeab.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/DOM/EventTarget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/EventTarget.cpp b/Userland/Libraries/LibWeb/DOM/EventTarget.cpp
index 62e1196b1f..42915736db 100644
--- a/Userland/Libraries/LibWeb/DOM/EventTarget.cpp
+++ b/Userland/Libraries/LibWeb/DOM/EventTarget.cpp
@@ -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