summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-04-22 14:13:37 +0100
committerAndreas Kling <kling@serenityos.org>2022-05-11 20:16:10 +0200
commitcfe5d63a1e77ec264a4d78616be4865121681d5f (patch)
tree11fa77e843141b941009698ed055bd7b48055ef9 /Userland/Libraries/LibWeb/CSS
parentbc4c185aef7d6f28144633a235ad6e8dad4e78e3 (diff)
downloadserenity-cfe5d63a1e77ec264a4d78616be4865121681d5f.zip
LibWeb: Add CSSGroupingRule wrapper
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS')
-rw-r--r--Userland/Libraries/LibWeb/CSS/CSSGroupingRule.h7
-rw-r--r--Userland/Libraries/LibWeb/CSS/CSSGroupingRule.idl3
2 files changed, 7 insertions, 3 deletions
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);
};