From 03c225b02309872398f977c9a25cc0ea75aff77b Mon Sep 17 00:00:00 2001 From: Simon Wanner Date: Mon, 20 Mar 2023 19:31:13 +0100 Subject: [PATCH] LibWeb: Move Element.prototype.style to ElementCSSInlineStyle mixin Also adds the `PutForwards` extended attribute allowing setting the style property. --- Userland/Libraries/LibWeb/CSS/ElementCSSInlineStyle.idl | 6 ++++++ Userland/Libraries/LibWeb/DOM/Element.idl | 3 --- Userland/Libraries/LibWeb/HTML/HTMLElement.idl | 3 +++ Userland/Libraries/LibWeb/SVG/SVGElement.idl | 2 ++ 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 Userland/Libraries/LibWeb/CSS/ElementCSSInlineStyle.idl diff --git a/Userland/Libraries/LibWeb/CSS/ElementCSSInlineStyle.idl b/Userland/Libraries/LibWeb/CSS/ElementCSSInlineStyle.idl new file mode 100644 index 0000000000..15147bad4a --- /dev/null +++ b/Userland/Libraries/LibWeb/CSS/ElementCSSInlineStyle.idl @@ -0,0 +1,6 @@ +#import + +// https://w3c.github.io/csswg-drafts/cssom/#elementcssinlinestyle +interface mixin ElementCSSInlineStyle { + [SameObject, PutForwards=cssText, ImplementedAs=style_for_bindings] readonly attribute CSSStyleDeclaration style; +}; diff --git a/Userland/Libraries/LibWeb/DOM/Element.idl b/Userland/Libraries/LibWeb/DOM/Element.idl index c933976cf1..aeecf4d9ce 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.idl +++ b/Userland/Libraries/LibWeb/DOM/Element.idl @@ -1,5 +1,4 @@ #import -#import #import #import #import @@ -62,8 +61,6 @@ interface Element : Node { readonly attribute Element? nextElementSibling; readonly attribute Element? previousElementSibling; - [ImplementedAs=style_for_bindings] readonly attribute CSSStyleDeclaration style; - DOMRect getBoundingClientRect(); DOMRectList getClientRects(); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.idl b/Userland/Libraries/LibWeb/HTML/HTMLElement.idl index 9347592a86..6bc60b41a5 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.idl +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.idl @@ -1,3 +1,4 @@ +#import #import #import @@ -37,3 +38,5 @@ interface mixin HTMLOrSVGElement { [CEReactions, Reflect] attribute boolean autofocus; [CEReactions] attribute long tabIndex; }; + +HTMLElement includes ElementCSSInlineStyle; diff --git a/Userland/Libraries/LibWeb/SVG/SVGElement.idl b/Userland/Libraries/LibWeb/SVG/SVGElement.idl index 6e69c7bd15..09b1e68ce0 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGElement.idl +++ b/Userland/Libraries/LibWeb/SVG/SVGElement.idl @@ -1,3 +1,4 @@ +#import #import #import #import @@ -8,3 +9,4 @@ interface SVGElement : Element { }; SVGElement includes HTMLOrSVGElement; +SVGElement includes ElementCSSInlineStyle;