1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:18:11 +00:00
serenity/Userland/Libraries/LibWeb/Bindings
Andreas Kling 0639e77898 LibWeb: Make the Window object "inherit" from EventTarget :^)
Since Web::Bindings::WindowObject inherits from JS::GlobalObject, it
cannot also inherit from Web::Bindings::EventTargetWrapper.

However, that's not actually necessary. Instead, we simply set the
Window object's prototype to the EventTargetPrototype, and add a little
extra branch in the impl_from() function that turns the JS "this" value
into a DOM::EventTarget*.

With this, you can now call window.addEventListener()! Very cool :^)

Fixes #4758.
2021-01-18 12:18:29 +01:00
..
EventListenerWrapper.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
EventListenerWrapper.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
EventTargetWrapperFactory.cpp LibWeb: Make the Window object "inherit" from EventTarget :^) 2021-01-18 12:18:29 +01:00
EventTargetWrapperFactory.h LibWeb: Make the Window object "inherit" from EventTarget :^) 2021-01-18 12:18:29 +01:00
EventWrapperFactory.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
EventWrapperFactory.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LocationObject.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LocationObject.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
NavigatorObject.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
NavigatorObject.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
NodeWrapperFactory.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
NodeWrapperFactory.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
RangeConstructor.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
RangeConstructor.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
RangePrototype.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
RangePrototype.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
RangeWrapper.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
RangeWrapper.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
ScriptExecutionContext.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
ScriptExecutionContext.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
WindowObject.cpp LibWeb: Make the Window object "inherit" from EventTarget :^) 2021-01-18 12:18:29 +01:00
WindowObject.h LibWeb: Move IDL attributes and functions to the prototype 2021-01-18 12:18:29 +01:00
WindowObjectHelper.h LibWeb: Construct the IDL interface prototype chains automatically 2021-01-18 12:18:29 +01:00
Wrappable.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Wrappable.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Wrapper.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
XMLHttpRequestConstructor.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
XMLHttpRequestConstructor.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
XMLHttpRequestPrototype.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
XMLHttpRequestPrototype.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
XMLHttpRequestWrapper.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
XMLHttpRequestWrapper.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00