mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-27 02:20:17 +00: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:
parent
373b2838db
commit
d4df0e1db9
Notes:
github-actions[bot]
2025-10-15 13:38:06 +00:00
Author: https://github.com/mikiubo
Commit: d4df0e1db9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6207
Reviewed-by: https://github.com/gmta ✅
17 changed files with 103 additions and 27 deletions
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue