summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorSimon Wanner <simon+git@skyrising.xyz>2023-03-20 19:31:13 +0100
committerTim Flynn <trflynn89@pm.me>2023-03-20 20:37:40 -0400
commit03c225b02309872398f977c9a25cc0ea75aff77b (patch)
tree2f3d01d69d3c87e14c0a7267d227cbfb2b09067d /Userland
parent63ca149be546d9871f295b2bafae6812a0583c35 (diff)
downloadserenity-03c225b02309872398f977c9a25cc0ea75aff77b.zip
LibWeb: Move Element.prototype.style to ElementCSSInlineStyle mixin
Also adds the `PutForwards` extended attribute allowing setting the style property.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/CSS/ElementCSSInlineStyle.idl6
-rw-r--r--Userland/Libraries/LibWeb/DOM/Element.idl3
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLElement.idl3
-rw-r--r--Userland/Libraries/LibWeb/SVG/SVGElement.idl2
4 files changed, 11 insertions, 3 deletions
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 <CSS/CSSStyleDeclaration.idl>
+
+// 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 <ARIA/ARIAMixin.idl>
-#import <CSS/CSSStyleDeclaration.idl>
#import <DOM/Attr.idl>
#import <DOM/ChildNode.idl>
#import <DOM/DOMTokenList.idl>
@@ -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 <CSS/ElementCSSInlineStyle.idl>
#import <HTML/DOMStringMap.idl>
#import <DOM/EventHandler.idl>
@@ -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 <CSS/ElementCSSInlineStyle.idl>
#import <DOM/Element.idl>
#import <HTML/HTMLElement.idl>
#import <HTML/DOMStringMap.idl>
@@ -8,3 +9,4 @@ interface SVGElement : Element {
};
SVGElement includes HTMLOrSVGElement;
+SVGElement includes ElementCSSInlineStyle;