summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/DOM
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-07-27 20:42:20 +0100
committerLinus Groh <mail@linusgroh.de>2022-07-29 17:15:49 +0100
commit200e111af0eeb619f22b25149dea7feb697cf239 (patch)
tree7e71618018fa82260ef9e4f9a75de7093608595e /Userland/Libraries/LibWeb/DOM
parentb456adcb59a45ddf849cb0b1565c7997adbbc547 (diff)
downloadserenity-200e111af0eeb619f22b25149dea7feb697cf239.zip
LibWeb: Extract the InnerHTML IDL mixin
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM')
-rw-r--r--Userland/Libraries/LibWeb/DOM/Element.idl4
-rw-r--r--Userland/Libraries/LibWeb/DOM/InnerHTML.idl7
-rw-r--r--Userland/Libraries/LibWeb/DOM/ShadowRoot.idl14
3 files changed, 17 insertions, 8 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Element.idl b/Userland/Libraries/LibWeb/DOM/Element.idl
index e2d461d8bb..0baea125da 100644
--- a/Userland/Libraries/LibWeb/DOM/Element.idl
+++ b/Userland/Libraries/LibWeb/DOM/Element.idl
@@ -1,6 +1,7 @@
#import <CSS/CSSStyleDeclaration.idl>
#import <DOM/ChildNode.idl>
#import <DOM/DOMTokenList.idl>
+#import <DOM/InnerHTML.idl>
#import <DOM/NamedNodeMap.idl>
#import <DOM/Node.idl>
#import <DOM/NodeList.idl>
@@ -29,9 +30,6 @@ interface Element : Node {
HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
HTMLCollection getElementsByClassName(DOMString className);
- // FIXME: This should come from a InnerHTML mixin.
- [LegacyNullToEmptyString, CEReactions] attribute DOMString innerHTML;
-
[Reflect] attribute DOMString id;
[Reflect=class] attribute DOMString className;
[SameObject, PutForwards=value] readonly attribute DOMTokenList classList;
diff --git a/Userland/Libraries/LibWeb/DOM/InnerHTML.idl b/Userland/Libraries/LibWeb/DOM/InnerHTML.idl
new file mode 100644
index 0000000000..5fce4cd4f5
--- /dev/null
+++ b/Userland/Libraries/LibWeb/DOM/InnerHTML.idl
@@ -0,0 +1,7 @@
+// https://w3c.github.io/DOM-Parsing/#the-innerhtml-mixin
+interface mixin InnerHTML {
+ [LegacyNullToEmptyString, CEReactions] attribute DOMString innerHTML;
+};
+
+Element includes InnerHTML;
+ShadowRoot includes InnerHTML;
diff --git a/Userland/Libraries/LibWeb/DOM/ShadowRoot.idl b/Userland/Libraries/LibWeb/DOM/ShadowRoot.idl
index 769bf4b3ac..d1efd129d0 100644
--- a/Userland/Libraries/LibWeb/DOM/ShadowRoot.idl
+++ b/Userland/Libraries/LibWeb/DOM/ShadowRoot.idl
@@ -1,11 +1,15 @@
#import <DOM/DocumentFragment.idl>
+#import <DOM/InnerHTML.idl>
+// https://dom.spec.whatwg.org/#shadowroot
interface ShadowRoot : DocumentFragment {
-
+ // FIXME: mode should return a ShadowRootMode
readonly attribute DOMString mode;
+ // FIXME: readonly attribute boolean delegatesFocus;
+ // FIXME: readonly attribute SlotAssignmentMode slotAssignment;
readonly attribute Element host;
-
- // FIXME: This should come from a InnerHTML mixin.
- [LegacyNullToEmptyString] attribute DOMString innerHTML;
-
+ // FIXME: attribute EventHandler onslotchange;
};
+
+enum ShadowRootMode { "open", "closed" };
+enum SlotAssignmentMode { "manual", "named" };