summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-07-27 21:14:16 +0100
committerLinus Groh <mail@linusgroh.de>2022-07-29 17:15:49 +0100
commitd6a5ddd3c0e146bfa45b54570cbb325a35137e1d (patch)
tree095057a8759809f31344c3214d6fd627ca2dc660 /Userland
parent6db558e0ae867867bae86608a93cef469fee3b05 (diff)
downloadserenity-d6a5ddd3c0e146bfa45b54570cbb325a35137e1d.zip
LibWeb: Extract the ChildNode IDL mixin
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/DOM/CharacterData.idl10
-rw-r--r--Userland/Libraries/LibWeb/DOM/ChildNode.idl13
-rw-r--r--Userland/Libraries/LibWeb/DOM/DocumentType.idl10
-rw-r--r--Userland/Libraries/LibWeb/DOM/Element.idl11
4 files changed, 20 insertions, 24 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/CharacterData.idl b/Userland/Libraries/LibWeb/DOM/CharacterData.idl
index 856f9c16a3..a018f53c59 100644
--- a/Userland/Libraries/LibWeb/DOM/CharacterData.idl
+++ b/Userland/Libraries/LibWeb/DOM/CharacterData.idl
@@ -1,8 +1,9 @@
+#import <DOM/ChildNode.idl>
#import <DOM/Element.idl>
#import <DOM/Node.idl>
+// https://dom.spec.whatwg.org/#characterdata
interface CharacterData : Node {
-
[LegacyNullToEmptyString] attribute DOMString data;
readonly attribute unsigned long length;
@@ -14,11 +15,4 @@ interface CharacterData : Node {
readonly attribute Element? nextElementSibling;
readonly attribute Element? previousElementSibling;
-
- // FIXME: These should come from a ChildNode mixin
- [CEReactions, Unscopable] undefined before((Node or DOMString)... nodes);
- [CEReactions, Unscopable] undefined after((Node or DOMString)... nodes);
- [CEReactions, Unscopable] undefined replaceWith((Node or DOMString)... nodes);
- [CEReactions, Unscopable, ImplementedAs=remove_binding] undefined remove();
-
};
diff --git a/Userland/Libraries/LibWeb/DOM/ChildNode.idl b/Userland/Libraries/LibWeb/DOM/ChildNode.idl
new file mode 100644
index 0000000000..0cb5cefcd3
--- /dev/null
+++ b/Userland/Libraries/LibWeb/DOM/ChildNode.idl
@@ -0,0 +1,13 @@
+#import <DOM/Node.idl>
+
+// https://dom.spec.whatwg.org/#childnode
+interface mixin ChildNode {
+ [CEReactions, Unscopable] undefined before((Node or DOMString)... nodes);
+ [CEReactions, Unscopable] undefined after((Node or DOMString)... nodes);
+ [CEReactions, Unscopable] undefined replaceWith((Node or DOMString)... nodes);
+ [CEReactions, Unscopable, ImplementedAs=remove_binding] undefined remove();
+};
+
+DocumentType includes ChildNode;
+Element includes ChildNode;
+CharacterData includes ChildNode;
diff --git a/Userland/Libraries/LibWeb/DOM/DocumentType.idl b/Userland/Libraries/LibWeb/DOM/DocumentType.idl
index bc1c622f5b..f2ea4fc0cb 100644
--- a/Userland/Libraries/LibWeb/DOM/DocumentType.idl
+++ b/Userland/Libraries/LibWeb/DOM/DocumentType.idl
@@ -1,15 +1,9 @@
+#import <DOM/ChildNode.idl>
#import <DOM/Node.idl>
+// https://dom.spec.whatwg.org/#documenttype
interface DocumentType : Node {
-
readonly attribute DOMString name;
readonly attribute DOMString publicId;
readonly attribute DOMString systemId;
-
- // FIXME: These should come from a ChildNode mixin
- [CEReactions, Unscopable] undefined before((Node or DOMString)... nodes);
- [CEReactions, Unscopable] undefined after((Node or DOMString)... nodes);
- [CEReactions, Unscopable] undefined replaceWith((Node or DOMString)... nodes);
- [CEReactions, Unscopable, ImplementedAs=remove_binding] undefined remove();
-
};
diff --git a/Userland/Libraries/LibWeb/DOM/Element.idl b/Userland/Libraries/LibWeb/DOM/Element.idl
index f86e2d4533..2f3ff86805 100644
--- a/Userland/Libraries/LibWeb/DOM/Element.idl
+++ b/Userland/Libraries/LibWeb/DOM/Element.idl
@@ -1,11 +1,13 @@
+#import <CSS/CSSStyleDeclaration.idl>
+#import <DOM/ChildNode.idl>
#import <DOM/DOMTokenList.idl>
#import <DOM/NamedNodeMap.idl>
#import <DOM/Node.idl>
#import <DOM/NodeList.idl>
#import <Geometry/DOMRect.idl>
#import <Geometry/DOMRectList.idl>
-#import <CSS/CSSStyleDeclaration.idl>
+// https://dom.spec.whatwg.org/#element
interface Element : Node {
readonly attribute DOMString? namespaceURI;
readonly attribute DOMString? prefix;
@@ -65,11 +67,4 @@ interface Element : Node {
readonly attribute long clientLeft;
readonly attribute long clientWidth;
readonly attribute long clientHeight;
-
- // FIXME: These should come from a ChildNode mixin
- [CEReactions, Unscopable] undefined before((Node or DOMString)... nodes);
- [CEReactions, Unscopable] undefined after((Node or DOMString)... nodes);
- [CEReactions, Unscopable] undefined replaceWith((Node or DOMString)... nodes);
- [CEReactions, Unscopable, ImplementedAs=remove_binding] undefined remove();
-
};