LibWeb: Correctly implement event listeners default passive attribute

This commit implements the default value of the passive attribute of
event listeners according to the spec.
This commit is contained in:
Glenn Skrzypczak
2024-12-24 17:52:52 +01:00
committed by Tim Ledbetter
parent 4c7cd05078
commit 08589741f5
Notes: github-actions[bot] 2024-12-25 14:58:22 +00:00
6 changed files with 82 additions and 49 deletions

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2020-2022, Andreas Kling <andreas@ladybird.org>
* Copyright (c) 2024, Glenn Skrzypczak <glenn.skrzypczak@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -81,7 +82,7 @@ bool EventDispatcher::inner_invoke(Event& event, Vector<GC::Root<DOM::DOMEventLi
}
// 9. If listeners passive is true, then set events in passive listener flag.
if (listener->passive)
if (listener->passive == true)
event.set_in_passive_listener(true);
// FIXME: 10. If global is a Window object, then record timing info for event listener given event and listener.