From e14be3927a2952228d0dc54faae44f87efa4079d Mon Sep 17 00:00:00 2001 From: Kenneth Myhra Date: Thu, 9 Mar 2023 21:17:20 +0100 Subject: [PATCH] LibWeb: Port FocusEvent to new String --- Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp | 6 +++--- Userland/Libraries/LibWeb/UIEvents/FocusEvent.h | 5 +++-- Userland/Libraries/LibWeb/UIEvents/FocusEvent.idl | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp index 60ea1fb0c4..7e72932a60 100644 --- a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp @@ -9,13 +9,13 @@ namespace Web::UIEvents { -WebIDL::ExceptionOr> FocusEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, FocusEventInit const& event_init) +WebIDL::ExceptionOr> FocusEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, FocusEventInit const& event_init) { return MUST_OR_THROW_OOM(realm.heap().allocate(realm, realm, event_name, event_init)); } -FocusEvent::FocusEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, FocusEventInit const& event_init) - : UIEvent(realm, event_name) +FocusEvent::FocusEvent(JS::Realm& realm, FlyString const& event_name, FocusEventInit const& event_init) + : UIEvent(realm, event_name.to_deprecated_fly_string()) { set_related_target(const_cast(event_init.related_target.ptr())); } diff --git a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h index 48a2ab326d..156f0f58f6 100644 --- a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h @@ -6,6 +6,7 @@ #pragma once +#include #include namespace Web::UIEvents { @@ -18,12 +19,12 @@ class FocusEvent final : public UIEvent { WEB_PLATFORM_OBJECT(FocusEvent, UIEvent); public: - static WebIDL::ExceptionOr> construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, FocusEventInit const& event_init); + static WebIDL::ExceptionOr> construct_impl(JS::Realm&, FlyString const& event_name, FocusEventInit const& event_init); virtual ~FocusEvent() override; private: - FocusEvent(JS::Realm&, DeprecatedFlyString const& event_name, FocusEventInit const&); + FocusEvent(JS::Realm&, FlyString const& event_name, FocusEventInit const&); virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; }; diff --git a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.idl b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.idl index 1cba0af8fd..945a03006f 100644 --- a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.idl +++ b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.idl @@ -1,6 +1,6 @@ #import -[Exposed=Window] +[Exposed=Window, UseNewAKString] interface FocusEvent : UIEvent { constructor(DOMString type, optional FocusEventInit eventInitDict = {});