mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 06:37:52 +00:00
LibWeb: Ignore window-forwarded document.body.onfoo in detached DOM
Normally, assigning to e.g document.body.onload will forward to window.onload. However, in a detached DOM tree, there is no associated window, so we have nowhere to forward to, making this a no-op. The bulk of this change is making Document::window() return a nullable pointer, as documents created by DOMParser or DOMImplementation do not have an associated window object, and so must be able to return null from here.
This commit is contained in:
@@ -218,10 +218,10 @@ private:
|
||||
virtual void finalize() override;
|
||||
|
||||
// ^HTML::GlobalEventHandlers
|
||||
virtual DOM::EventTarget& global_event_handlers_to_event_target(FlyString const&) override { return *this; }
|
||||
virtual JS::GCPtr<DOM::EventTarget> global_event_handlers_to_event_target(FlyString const&) override { return *this; }
|
||||
|
||||
// ^HTML::WindowEventHandlers
|
||||
virtual DOM::EventTarget& window_event_handlers_to_event_target() override { return *this; }
|
||||
virtual JS::GCPtr<DOM::EventTarget> window_event_handlers_to_event_target() override { return *this; }
|
||||
|
||||
void invoke_idle_callbacks();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user