summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-02-25 17:31:56 +0100
committerAndreas Kling <kling@serenityos.org>2022-02-25 19:38:31 +0100
commitd0ab546d7aa6b44153d162af00f1bc65eb60d669 (patch)
treeaf3f8db2ba56de5cb55267b7dd2887b5cde20778 /Userland
parent093e66afc092bd14402381b498bdcf11c6579834 (diff)
downloadserenity-d0ab546d7aa6b44153d162af00f1bc65eb60d669.zip
LibWeb: Implement UIEvent.initUIEvent()
1% progression on ACID3. :^)
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/UIEvents/UIEvent.h9
-rw-r--r--Userland/Libraries/LibWeb/UIEvents/UIEvent.idl3
2 files changed, 11 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/UIEvents/UIEvent.h b/Userland/Libraries/LibWeb/UIEvents/UIEvent.h
index 3393d0b2d6..d410922179 100644
--- a/Userland/Libraries/LibWeb/UIEvents/UIEvent.h
+++ b/Userland/Libraries/LibWeb/UIEvents/UIEvent.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
+ * Copyright (c) 2020-2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -36,6 +36,13 @@ public:
DOM::Window const* view() const { return m_view; }
int detail() const { return m_detail; }
+ void init_ui_event(String const& type, bool bubbles, bool cancelable, DOM::Window* view, int detail)
+ {
+ init_event(type, bubbles, cancelable);
+ m_view = view;
+ m_detail = detail;
+ }
+
protected:
explicit UIEvent(FlyString const& event_name)
: Event(event_name)
diff --git a/Userland/Libraries/LibWeb/UIEvents/UIEvent.idl b/Userland/Libraries/LibWeb/UIEvents/UIEvent.idl
index d317d3011a..94431c183f 100644
--- a/Userland/Libraries/LibWeb/UIEvents/UIEvent.idl
+++ b/Userland/Libraries/LibWeb/UIEvents/UIEvent.idl
@@ -4,6 +4,9 @@ interface UIEvent : Event {
constructor(DOMString type, optional UIEventInit eventInitDict = {});
readonly attribute Window? view;
readonly attribute long detail;
+
+ // NOTE: This is "deprecated, but supported for backwards-compatibility with widely-deployed implementations."
+ [ImplementedAs=init_ui_event] undefined initUIEvent(DOMString typeArg, optional boolean bubblesArg = false, optional boolean cancelableArg = false, optional Window? viewArg = null, optional long detailArg = 0);
};
dictionary UIEventInit : EventInit {