mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +00:00
These classes only needed Window to get at its realm. Pass a realm directly to construct HTML classes.
25 lines
536 B
C++
25 lines
536 B
C++
/*
|
|
* Copyright (c) 2021, sin-ack <sin-ack@protonmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
|
#include <LibWeb/HTML/TextMetrics.h>
|
|
|
|
namespace Web::HTML {
|
|
|
|
JS::NonnullGCPtr<TextMetrics> TextMetrics::create(JS::Realm& realm)
|
|
{
|
|
return *realm.heap().allocate<TextMetrics>(realm, realm);
|
|
}
|
|
|
|
TextMetrics::TextMetrics(JS::Realm& realm)
|
|
: PlatformObject(realm)
|
|
{
|
|
set_prototype(&Bindings::cached_web_prototype(realm, "TextMetrics"));
|
|
}
|
|
|
|
TextMetrics::~TextMetrics() = default;
|
|
|
|
}
|