2021-12-30 22:15:38 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, sin-ack <sin-ack@protonmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
2022-09-25 16:38:21 -06:00
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
2022-09-02 23:58:31 +02:00
|
|
|
#include <LibWeb/HTML/TextMetrics.h>
|
2023-02-15 19:12:53 +01:00
|
|
|
#include <LibWeb/WebIDL/ExceptionOr.h>
|
2021-12-30 22:15:38 +00:00
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
2023-02-15 19:12:53 +01:00
|
|
|
WebIDL::ExceptionOr<JS::NonnullGCPtr<TextMetrics>> TextMetrics::create(JS::Realm& realm)
|
2021-12-30 22:15:38 +00:00
|
|
|
{
|
2023-02-15 19:12:53 +01:00
|
|
|
return MUST_OR_THROW_OOM(realm.heap().allocate<TextMetrics>(realm, realm));
|
2021-12-30 22:15:38 +00:00
|
|
|
}
|
|
|
|
|
2022-09-25 16:38:21 -06:00
|
|
|
TextMetrics::TextMetrics(JS::Realm& realm)
|
|
|
|
: PlatformObject(realm)
|
2022-09-02 23:58:31 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
TextMetrics::~TextMetrics() = default;
|
|
|
|
|
2023-08-07 08:41:28 +02:00
|
|
|
void TextMetrics::initialize(JS::Realm& realm)
|
2023-01-10 06:28:20 -05:00
|
|
|
{
|
2023-08-07 08:41:28 +02:00
|
|
|
Base::initialize(realm);
|
2023-01-10 06:28:20 -05:00
|
|
|
set_prototype(&Bindings::ensure_web_prototype<Bindings::TextMetricsPrototype>(realm, "TextMetrics"));
|
|
|
|
}
|
|
|
|
|
2021-12-30 22:15:38 +00:00
|
|
|
}
|