mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
LibWeb: Make Event.currentTarget return WindowProxy instead of Window
Make WindowProxy implement the EventTarget interface. Add a new method current_target_for_bindings() that returns a WindowProxy object instead of directly exposing the Window object. These changes fixes several WPT tests that contain `window === currentTarget`.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
373b2838db
commit
d4df0e1db9
Notes:
github-actions[bot]
2025-10-15 13:38:06 +00:00
Author: https://github.com/mikiubo Commit: https://github.com/LadybirdBrowser/ladybird/commit/d4df0e1db98 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6207 Reviewed-by: https://github.com/gmta ✅
@@ -11,6 +11,7 @@
|
||||
#include <LibJS/Runtime/PropertyDescriptor.h>
|
||||
#include <LibJS/Runtime/PropertyKey.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/EventTarget.h>
|
||||
#include <LibWeb/HTML/CrossOrigin/AbstractOperations.h>
|
||||
#include <LibWeb/HTML/CrossOrigin/Reporting.h>
|
||||
#include <LibWeb/HTML/Scripting/Environments.h>
|
||||
@@ -24,7 +25,7 @@ GC_DEFINE_ALLOCATOR(WindowProxy);
|
||||
|
||||
// 7.4 The WindowProxy exotic object, https://html.spec.whatwg.org/multipage/window-object.html#the-windowproxy-exotic-object
|
||||
WindowProxy::WindowProxy(JS::Realm& realm)
|
||||
: JS::Object(realm, nullptr, MayInterfereWithIndexedPropertyAccess::Yes)
|
||||
: DOM::EventTarget(realm, MayInterfereWithIndexedPropertyAccess::Yes)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user