summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h')
-rw-r--r--Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h
index 80b8866dc3..5967add8fc 100644
--- a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h
+++ b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
+ * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -14,26 +15,21 @@ namespace Web::CSS {
class CSSFontFaceRule final : public CSSRule {
AK_MAKE_NONCOPYABLE(CSSFontFaceRule);
AK_MAKE_NONMOVABLE(CSSFontFaceRule);
+ JS_OBJECT(CSSFontFaceRule, CSSRule);
public:
- using WrapperType = Bindings::CSSFontFaceRuleWrapper;
-
- static NonnullRefPtr<CSSFontFaceRule> create(FontFace&& font_face)
- {
- return adopt_ref(*new CSSFontFaceRule(move(font_face)));
- }
+ static CSSFontFaceRule* create(Bindings::WindowObject&, FontFace&&);
+ explicit CSSFontFaceRule(Bindings::WindowObject&, FontFace&&);
virtual ~CSSFontFaceRule() override = default;
+ CSSFontFaceRule& impl() { return *this; }
- virtual StringView class_name() const override { return "CSSFontFaceRule"sv; }
virtual Type type() const override { return Type::FontFace; }
FontFace const& font_face() const { return m_font_face; }
CSSStyleDeclaration* style();
private:
- explicit CSSFontFaceRule(FontFace&&);
-
virtual String serialized() const override;
FontFace m_font_face;
@@ -43,3 +39,8 @@ template<>
inline bool CSSRule::fast_is<CSSFontFaceRule>() const { return type() == CSSRule::Type::FontFace; }
}
+
+namespace Web::Bindings {
+inline JS::Object* wrap(JS::Realm&, Web::CSS::CSSFontFaceRule& object) { return &object; }
+using CSSFontFaceRuleWrapper = Web::CSS::CSSFontFaceRule;
+}