From cfe5d63a1e77ec264a4d78616be4865121681d5f Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 22 Apr 2022 14:13:37 +0100 Subject: LibWeb: Add CSSGroupingRule wrapper --- Userland/Libraries/LibWeb/CSS/CSSGroupingRule.h | 7 +++++-- Userland/Libraries/LibWeb/CSS/CSSGroupingRule.idl | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'Userland/Libraries/LibWeb/CSS') 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 + * Copyright (c) 2021-2022, Sam Atkins * * 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 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 #import +[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); }; -- cgit v1.2.3