1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:07:34 +00:00

LibWeb: Implement initial CSSFontFaceRule and FontFace classes

For now, this is the bare minimum that's needed: font-family and src.
This commit is contained in:
Sam Atkins 2022-03-28 20:30:26 +01:00 committed by Andreas Kling
parent 1dcde57922
commit 804b8c85e8
13 changed files with 173 additions and 6 deletions

View file

@ -0,0 +1,29 @@
/*
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/CSS/CSSFontFaceRule.h>
namespace Web::CSS {
CSSFontFaceRule::CSSFontFaceRule(FontFace&& font_face)
: m_font_face(move(font_face))
{
}
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()! */ }";
}
}