diff options
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibWeb/Bindings/WindowObjectHelper.h | 3 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSGroupingRule.h | 7 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSGroupingRule.idl | 3 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Forward.h | 2 |
5 files changed, 13 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/Bindings/WindowObjectHelper.h b/Userland/Libraries/LibWeb/Bindings/WindowObjectHelper.h index 9073de1fd1..4a0df4cc05 100644 --- a/Userland/Libraries/LibWeb/Bindings/WindowObjectHelper.h +++ b/Userland/Libraries/LibWeb/Bindings/WindowObjectHelper.h @@ -17,6 +17,8 @@ #include <LibWeb/Bindings/AudioConstructor.h> #include <LibWeb/Bindings/CSSFontFaceRuleConstructor.h> #include <LibWeb/Bindings/CSSFontFaceRulePrototype.h> +#include <LibWeb/Bindings/CSSGroupingRuleConstructor.h> +#include <LibWeb/Bindings/CSSGroupingRulePrototype.h> #include <LibWeb/Bindings/CSSRuleConstructor.h> #include <LibWeb/Bindings/CSSRuleListConstructor.h> #include <LibWeb/Bindings/CSSRuleListPrototype.h> @@ -358,6 +360,7 @@ ADD_WINDOW_OBJECT_INTERFACE(AbstractRange) \ ADD_WINDOW_OBJECT_INTERFACE(Crypto) \ ADD_WINDOW_OBJECT_INTERFACE(CSSFontFaceRule) \ + ADD_WINDOW_OBJECT_INTERFACE(CSSGroupingRule) \ ADD_WINDOW_OBJECT_INTERFACE(CSSRule) \ ADD_WINDOW_OBJECT_INTERFACE(CSSRuleList) \ ADD_WINDOW_OBJECT_INTERFACE(CSSStyleDeclaration) \ diff --git a/Userland/Libraries/LibWeb/CMakeLists.txt b/Userland/Libraries/LibWeb/CMakeLists.txt index 2d7bd9e890..cc04d4f56b 100644 --- a/Userland/Libraries/LibWeb/CMakeLists.txt +++ b/Userland/Libraries/LibWeb/CMakeLists.txt @@ -452,6 +452,7 @@ endfunction() libweb_js_wrapper(Crypto/Crypto) libweb_js_wrapper(Crypto/SubtleCrypto) libweb_js_wrapper(CSS/CSSFontFaceRule) +libweb_js_wrapper(CSS/CSSGroupingRule) libweb_js_wrapper(CSS/CSSRule) libweb_js_wrapper(CSS/CSSRuleList) libweb_js_wrapper(CSS/CSSStyleDeclaration) diff --git a/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.h b/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.h index 7161c7edaf..4d28f42ee7 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org> + * Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ @@ -19,10 +19,13 @@ class CSSGroupingRule : public CSSRule { AK_MAKE_NONMOVABLE(CSSGroupingRule); public: - ~CSSGroupingRule() = default; + using WrapperType = Bindings::CSSGroupingRuleWrapper; + + virtual ~CSSGroupingRule() = default; CSSRuleList const& css_rules() const { return m_rules; } CSSRuleList& css_rules() { return m_rules; } + NonnullRefPtr<CSSRuleList> css_rules_for_bindings() { return m_rules; } size_t insert_rule(StringView rule, size_t index = 0); void delete_rule(size_t index); diff --git a/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.idl b/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.idl index 9d942b4407..6f8280a0fd 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.idl +++ b/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.idl @@ -1,8 +1,9 @@ #import <CSS/CSSRule.idl> #import <CSS/CSSRuleList.idl> +[Exposed=Window] interface CSSGroupingRule : CSSRule { - [SameObject] readonly attribute CSSRuleList cssRules; + [SameObject, ImplementedAs=css_rules_for_bindings] readonly attribute CSSRuleList cssRules; unsigned long insertRule(CSSOMString rule, optional unsigned long index = 0); undefined deleteRule(unsigned long index); }; diff --git a/Userland/Libraries/LibWeb/Forward.h b/Userland/Libraries/LibWeb/Forward.h index f6f4282747..ed1019e9f9 100644 --- a/Userland/Libraries/LibWeb/Forward.h +++ b/Userland/Libraries/LibWeb/Forward.h @@ -35,6 +35,7 @@ class BorderStyleValue; class CalculatedStyleValue; class ColorStyleValue; class ContentStyleValue; +class CSSGroupingRule; class CSSImportRule; class CSSFontFaceRule; class CSSMediaRule; @@ -407,6 +408,7 @@ class CloseEventWrapper; class CommentWrapper; class CryptoWrapper; class CSSFontFaceRuleWrapper; +class CSSGroupingRuleWrapper; class CSSRuleListWrapper; class CSSRuleWrapper; class CSSStyleDeclarationWrapper; |