mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
LibWeb: Only make certain <body> and <frameset> events apply to Window
Previously we forwarded all event handler attributes to Window from these two elements, however, we are only supposed to forward blur, error, focus, load, resize and scroll.
This commit is contained in:
@@ -14,4 +14,15 @@ HTMLFrameSetElement::HTMLFrameSetElement(DOM::Document& document, DOM::Qualified
|
||||
}
|
||||
|
||||
HTMLFrameSetElement::~HTMLFrameSetElement() = default;
|
||||
|
||||
DOM::EventTarget& HTMLFrameSetElement::global_event_handlers_to_event_target(FlyString const& event_name)
|
||||
{
|
||||
// NOTE: This is a little weird, but IIUC document.body.onload actually refers to window.onload
|
||||
// NOTE: document.body can return either a HTMLBodyElement or HTMLFrameSetElement, so both these elements must support this mapping.
|
||||
if (DOM::is_window_reflecting_body_element_event_handler(event_name))
|
||||
return document().window();
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user