1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:28:11 +00:00

LibWeb: Port FocusEvent to new String

This commit is contained in:
Kenneth Myhra 2023-03-09 21:17:20 +01:00 committed by Andreas Kling
parent d527edf0ab
commit e14be3927a
3 changed files with 7 additions and 6 deletions

View file

@ -9,13 +9,13 @@
namespace Web::UIEvents {
WebIDL::ExceptionOr<JS::NonnullGCPtr<FocusEvent>> FocusEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, FocusEventInit const& event_init)
WebIDL::ExceptionOr<JS::NonnullGCPtr<FocusEvent>> FocusEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, FocusEventInit const& event_init)
{
return MUST_OR_THROW_OOM(realm.heap().allocate<FocusEvent>(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<DOM::EventTarget*>(event_init.related_target.ptr()));
}

View file

@ -6,6 +6,7 @@
#pragma once
#include <AK/FlyString.h>
#include <LibWeb/UIEvents/UIEvent.h>
namespace Web::UIEvents {
@ -18,12 +19,12 @@ class FocusEvent final : public UIEvent {
WEB_PLATFORM_OBJECT(FocusEvent, UIEvent);
public:
static WebIDL::ExceptionOr<JS::NonnullGCPtr<FocusEvent>> construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, FocusEventInit const& event_init);
static WebIDL::ExceptionOr<JS::NonnullGCPtr<FocusEvent>> 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<void> initialize(JS::Realm&) override;
};

View file

@ -1,6 +1,6 @@
#import <UIEvents/UIEvent.idl>
[Exposed=Window]
[Exposed=Window, UseNewAKString]
interface FocusEvent : UIEvent {
constructor(DOMString type, optional FocusEventInit eventInitDict = {});