1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 03:37:35 +00:00

LibWeb: Make factory methods of UIEvents::UIEvent fallible

This affects calls to FocusEvent::create() since FocusEvent does not
implement its own create() method.
This commit is contained in:
Kenneth Myhra 2023-02-19 10:38:20 +01:00 committed by Andreas Kling
parent a401cff4e2
commit 587cf355ed
4 changed files with 12 additions and 12 deletions

View file

@ -1290,7 +1290,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Event>> Document::create_event(DeprecatedSt
|| Infra::is_ascii_case_insensitive_match(interface, "events"sv)) {
event = TRY(Event::create(realm, ""));
} else if (Infra::is_ascii_case_insensitive_match(interface, "focusevent"sv)) {
event = UIEvents::FocusEvent::create(realm, "");
event = TRY(UIEvents::FocusEvent::create(realm, ""));
} else if (Infra::is_ascii_case_insensitive_match(interface, "hashchangeevent"sv)) {
event = TRY(Event::create(realm, "")); // FIXME: Create HashChangeEvent
} else if (Infra::is_ascii_case_insensitive_match(interface, "htmlevents"sv)) {
@ -1312,7 +1312,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Event>> Document::create_event(DeprecatedSt
event = TRY(Event::create(realm, "")); // FIXME: Create TouchEvent
} else if (Infra::is_ascii_case_insensitive_match(interface, "uievent"sv)
|| Infra::is_ascii_case_insensitive_match(interface, "uievents"sv)) {
event = UIEvents::UIEvent::create(realm, "");
event = TRY(UIEvents::UIEvent::create(realm, ""));
}
// 3. If constructor is null, then throw a "NotSupportedError" DOMException.