mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 11:36:22 +00:00
LibWeb: Short-circuit UIEvent.initMouseEvent if dispatched
This fixes some bugs on wpt.dom/events/Event-init-while-dispatching.html, although the test still fails due to [GH-23722]. [GH-23722]: https://github.com/SerenityOS/serenity/issues/23722
This commit is contained in:
parent
87880e9b81
commit
aefab1de38
Notes:
sideshowbarker
2024-07-18 02:43:45 +09:00
Author: https://github.com/jamierocks
Commit: aefab1de38
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/682
Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 10 additions and 1 deletions
|
@ -33,7 +33,16 @@ public:
|
||||||
|
|
||||||
void init_ui_event(String const& type, bool bubbles, bool cancelable, HTML::Window* view, int detail)
|
void init_ui_event(String const& type, bool bubbles, bool cancelable, HTML::Window* view, int detail)
|
||||||
{
|
{
|
||||||
init_event(type, bubbles, cancelable);
|
// Initializes attributes of an UIEvent object. This method has the same behavior as initEvent().
|
||||||
|
|
||||||
|
// 1. If this’s dispatch flag is set, then return.
|
||||||
|
if (dispatched())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// 2. Initialize this with type, bubbles, and cancelable.
|
||||||
|
initialize_event(type, bubbles, cancelable);
|
||||||
|
|
||||||
|
// Implementation Defined: Initialise other values.
|
||||||
m_view = view;
|
m_view = view;
|
||||||
m_detail = detail;
|
m_detail = detail;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue