ladybird/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp
Andreas Kling 6f433c8656 LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocated
This is a monster patch that turns all EventTargets into GC-allocated
PlatformObjects. Their C++ wrapper classes are removed, and the LibJS
garbage collector is now responsible for their lifetimes.

There's a fair amount of hacks and band-aids in this patch, and we'll
have a lot of cleanup to do after this.
2022-09-06 00:27:09 +02:00

39 lines
1.1 KiB
C++

/*
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/CSSFontFaceRulePrototype.h>
#include <LibWeb/CSS/CSSFontFaceRule.h>
#include <LibWeb/HTML/Window.h>
namespace Web::CSS {
CSSFontFaceRule* CSSFontFaceRule::create(HTML::Window& window_object, FontFace&& font_face)
{
return window_object.heap().allocate<CSSFontFaceRule>(window_object.realm(), window_object, move(font_face));
}
CSSFontFaceRule::CSSFontFaceRule(HTML::Window& window_object, FontFace&& font_face)
: CSSRule(window_object)
, m_font_face(move(font_face))
{
set_prototype(&window_object.ensure_web_prototype<Bindings::CSSFontFaceRulePrototype>("CSSFontFaceRule"));
}
CSSStyleDeclaration* CSSFontFaceRule::style()
{
// FIXME: Return a CSSStyleDeclaration subclass that directs changes to the FontFace.
return nullptr;
}
// https://www.w3.org/TR/cssom/#ref-for-cssfontfacerule
String CSSFontFaceRule::serialized() const
{
// FIXME: Implement this!
return "@font-face { /* FIXME: Implement CSSFontFaceRule::serialized()! */ }";
}
}