From 12b069802b771c145fd3b1917c5b82f2a8c1ff9f Mon Sep 17 00:00:00 2001 From: Jinho Bang Date: Tue, 19 Dec 2017 19:22:26 +0900 Subject: [PATCH] Use interface mixins in IDL IDL recently introduced dedicated syntax for mixins in https://github.com/heycam/webidl/commit/45e8173d40ddff8dcf81697326e094bcf8b92920. So, we can replace [NoInterfaceObject] and implements with interface mixin and includes. This following interfaces are impacted by this change: - NonElementParentNode - DocumentOrShadowRoot - ParentNode - NonDocumentTypeChildNode - ChildNode - Slotable Tests: https://github.com/w3c/web-platform-tests/pull/8700. Fixes #532. --- dom.bs | 53 +++++++++++++++++++++-------------------------------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/dom.bs b/dom.bs index 3e4121389..be8fdf3e8 100644 --- a/dom.bs +++ b/dom.bs @@ -2598,13 +2598,11 @@ with an optional suppress observers flag, run these steps: method from being exposed on elements (and therefore on {{ParentNode}}).
-[NoInterfaceObject,
- Exposed=Window]
-interface NonElementParentNode {
+interface mixin NonElementParentNode {
   Element? getElementById(DOMString elementId);
 };
-Document implements NonElementParentNode;
-DocumentFragment implements NonElementParentNode;
+Document includes NonElementParentNode;
+DocumentFragment includes NonElementParentNode;
 
@@ -2622,12 +2620,10 @@ null if there is no such element otherwise.

Mixin {{DocumentOrShadowRoot}}

-[NoInterfaceObject,
- Exposed=Window]
-interface DocumentOrShadowRoot {
+interface mixin DocumentOrShadowRoot {
 };
-Document implements DocumentOrShadowRoot;
-ShadowRoot implements DocumentOrShadowRoot;
+Document includes DocumentOrShadowRoot;
+ShadowRoot includes DocumentOrShadowRoot;
 

The {{DocumentOrShadowRoot}} mixin is expected to be used by other @@ -2658,9 +2654,7 @@ To convert nodes into a node

-[NoInterfaceObject,
- Exposed=Window]
-interface ParentNode {
+interface mixin ParentNode {
   [SameObject] readonly attribute HTMLCollection children;
   readonly attribute Element? firstElementChild;
   readonly attribute Element? lastElementChild;
@@ -2672,9 +2666,9 @@ interface ParentNode {
   Element? querySelector(DOMString selectors);
   [NewObject] NodeList querySelectorAll(DOMString selectors);
 };
-Document implements ParentNode;
-DocumentFragment implements ParentNode;
-Element implements ParentNode;
+Document includes ParentNode;
+DocumentFragment includes ParentNode;
+Element includes ParentNode;