mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +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
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.
|
// 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) {
|
auto it = m_event_listener_list.find_if([&](auto& entry) {
|
||||||
return entry->type == listener.type
|
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;
|
&& entry->capture == listener.capture;
|
||||||
});
|
});
|
||||||
if (it == m_event_listener_list.end())
|
if (it == m_event_listener_list.end())
|
||||||
|
@ -191,7 +191,7 @@ void EventTarget::remove_event_listener(DeprecatedFlyString const& type, IDLEven
|
||||||
return true;
|
return true;
|
||||||
if (!entry.callback || !callback)
|
if (!entry.callback || !callback)
|
||||||
return false;
|
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) {
|
auto it = m_event_listener_list.find_if([&](auto& entry) {
|
||||||
return entry->type == type
|
return entry->type == type
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue