From e3612708c7df1b3593d85f3b82b6bd45eb373ede Mon Sep 17 00:00:00 2001 From: Caoimhe Date: Tue, 20 Jun 2023 16:19:40 +0100 Subject: [PATCH] LibWeb: Generate JavaScript bindings for `CSSKeyframeRule` We still need to do a bit of work. For example: `set_key_text` isn't implemented due to its requirements being quite complex, but it's a start. --- Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.h | 10 ++++++++++ Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.idl | 2 +- Userland/Libraries/LibWeb/idl_files.cmake | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.h b/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.h index 843f3a9aac2..e812a161e60 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.h @@ -32,6 +32,16 @@ public: CSS::Percentage key() const { return m_key; } JS::NonnullGCPtr style() const { return m_declarations; } + DeprecatedString key_text() const + { + return m_key.to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string(); + } + + void set_key_text(DeprecatedString const& key_text) + { + dbgln("FIXME: CSSKeyframeRule::set_key_text is not implemented: {}", key_text); + } + private: CSSKeyframeRule(JS::Realm& realm, CSS::Percentage key, CSSStyleDeclaration& declarations) : CSSRule(realm) diff --git a/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.idl b/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.idl index fd9c8de99fd..4cf2c131e3c 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.idl +++ b/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.idl @@ -1,6 +1,6 @@ #import -[Exposed = Window] +[Exposed=Window] interface CSSKeyframeRule : CSSRule { attribute CSSOMString keyText; [SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style; diff --git a/Userland/Libraries/LibWeb/idl_files.cmake b/Userland/Libraries/LibWeb/idl_files.cmake index 75a88e8b81d..69168c7884b 100644 --- a/Userland/Libraries/LibWeb/idl_files.cmake +++ b/Userland/Libraries/LibWeb/idl_files.cmake @@ -7,6 +7,7 @@ libweb_js_bindings(CSS/CSSConditionRule) libweb_js_bindings(CSS/CSSFontFaceRule) libweb_js_bindings(CSS/CSSGroupingRule) libweb_js_bindings(CSS/CSSImportRule) +libweb_js_bindings(CSS/CSSKeyframeRule) libweb_js_bindings(CSS/CSSMediaRule) libweb_js_bindings(CSS/CSS NAMESPACE) libweb_js_bindings(CSS/CSSRule)