1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:57:35 +00:00

LibWeb: Make document.createEvent("UIEvent") actually create a UIEvent

There were two things preventing this from working right:

- UIEvents::UIEvent::create() was actually just DOM::Event::create()
- We didn't return the right JavaScript wrapper type for UIEvent
This commit is contained in:
Andreas Kling 2022-02-25 17:30:39 +01:00
parent 31508b2788
commit 093e66afc0
2 changed files with 8 additions and 1 deletions

View file

@ -21,6 +21,11 @@ class UIEvent : public DOM::Event {
public:
using WrapperType = Bindings::UIEventWrapper;
static NonnullRefPtr<UIEvent> create(FlyString const& type)
{
return adopt_ref(*new UIEvent(type));
}
static NonnullRefPtr<UIEvent> create_with_global_object(Bindings::WindowObject&, FlyString const& event_name, UIEventInit const& event_init)
{
return adopt_ref(*new UIEvent(event_name, event_init));