From 1951873a5d7f640ad9994d7b0c21d13c2cbf78e9 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 22 Apr 2022 14:14:16 +0100 Subject: [PATCH] LibWeb: Add CSSConditionRule wrapper --- Userland/Libraries/LibWeb/Bindings/WindowObjectHelper.h | 5 ++++- Userland/Libraries/LibWeb/CMakeLists.txt | 1 + Userland/Libraries/LibWeb/CSS/CSSConditionRule.h | 6 ++++-- Userland/Libraries/LibWeb/CSS/CSSConditionRule.idl | 1 + Userland/Libraries/LibWeb/Forward.h | 2 ++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/Bindings/WindowObjectHelper.h b/Userland/Libraries/LibWeb/Bindings/WindowObjectHelper.h index 4a0df4cc050..9f16e6bb9d6 100644 --- a/Userland/Libraries/LibWeb/Bindings/WindowObjectHelper.h +++ b/Userland/Libraries/LibWeb/Bindings/WindowObjectHelper.h @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include #include #include @@ -358,7 +360,7 @@ ADD_WINDOW_OBJECT_INTERFACE(AbortController) \ ADD_WINDOW_OBJECT_INTERFACE(AbortSignal) \ ADD_WINDOW_OBJECT_INTERFACE(AbstractRange) \ - ADD_WINDOW_OBJECT_INTERFACE(Crypto) \ + ADD_WINDOW_OBJECT_INTERFACE(CSSConditionRule) \ ADD_WINDOW_OBJECT_INTERFACE(CSSFontFaceRule) \ ADD_WINDOW_OBJECT_INTERFACE(CSSGroupingRule) \ ADD_WINDOW_OBJECT_INTERFACE(CSSRule) \ @@ -371,6 +373,7 @@ ADD_WINDOW_OBJECT_INTERFACE(CharacterData) \ ADD_WINDOW_OBJECT_INTERFACE(CloseEvent) \ ADD_WINDOW_OBJECT_INTERFACE(Comment) \ + ADD_WINDOW_OBJECT_INTERFACE(Crypto) \ ADD_WINDOW_OBJECT_INTERFACE(CustomEvent) \ ADD_WINDOW_OBJECT_INTERFACE(DocumentFragment) \ ADD_WINDOW_OBJECT_INTERFACE(Document) \ diff --git a/Userland/Libraries/LibWeb/CMakeLists.txt b/Userland/Libraries/LibWeb/CMakeLists.txt index cc04d4f56b7..91d7d3205a5 100644 --- a/Userland/Libraries/LibWeb/CMakeLists.txt +++ b/Userland/Libraries/LibWeb/CMakeLists.txt @@ -451,6 +451,7 @@ endfunction() libweb_js_wrapper(Crypto/Crypto) libweb_js_wrapper(Crypto/SubtleCrypto) +libweb_js_wrapper(CSS/CSSConditionRule) libweb_js_wrapper(CSS/CSSFontFaceRule) libweb_js_wrapper(CSS/CSSGroupingRule) libweb_js_wrapper(CSS/CSSRule) diff --git a/Userland/Libraries/LibWeb/CSS/CSSConditionRule.h b/Userland/Libraries/LibWeb/CSS/CSSConditionRule.h index 78f58a9655c..6cf61c2219e 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSConditionRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSConditionRule.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Sam Atkins + * Copyright (c) 2021-2022, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ @@ -17,7 +17,9 @@ class CSSConditionRule : public CSSGroupingRule { AK_MAKE_NONMOVABLE(CSSConditionRule); public: - ~CSSConditionRule() = default; + using WrapperType = Bindings::CSSConditionRuleWrapper; + + virtual ~CSSConditionRule() = default; virtual String condition_text() const = 0; virtual void set_condition_text(String) = 0; diff --git a/Userland/Libraries/LibWeb/CSS/CSSConditionRule.idl b/Userland/Libraries/LibWeb/CSS/CSSConditionRule.idl index a5bbf70e278..73c336eaaae 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSConditionRule.idl +++ b/Userland/Libraries/LibWeb/CSS/CSSConditionRule.idl @@ -1,5 +1,6 @@ #import +[Exposed=Window] interface CSSConditionRule : CSSGroupingRule { attribute CSSOMString conditionText; }; diff --git a/Userland/Libraries/LibWeb/Forward.h b/Userland/Libraries/LibWeb/Forward.h index ed1019e9f94..6bbf21a3418 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 CSSConditionRule; class CSSGroupingRule; class CSSImportRule; class CSSFontFaceRule; @@ -407,6 +408,7 @@ class CharacterDataWrapper; class CloseEventWrapper; class CommentWrapper; class CryptoWrapper; +class CSSConditionRuleWrapper; class CSSFontFaceRuleWrapper; class CSSGroupingRuleWrapper; class CSSRuleListWrapper;