mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +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:
parent
a50a48f6b4
commit
ebf2184636
Notes:
sideshowbarker
2024-07-17 09:52:38 +09:00
Author: https://github.com/Lubrsi
Commit: ebf2184636
Pull-request: https://github.com/SerenityOS/serenity/pull/14406
Reviewed-by: https://github.com/linusg
11 changed files with 37 additions and 16 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue