diff --git a/dom/imptests/failures/html/dom/test_interfaces.html.json b/dom/imptests/failures/html/dom/test_interfaces.html.json
index 2e818d05c21..12672756a3b 100644
--- a/dom/imptests/failures/html/dom/test_interfaces.html.json
+++ b/dom/imptests/failures/html/dom/test_interfaces.html.json
@@ -26,11 +26,11 @@
"DocumentType interface: operation before([object Object],[object Object])": true,
"DocumentType interface: operation after([object Object],[object Object])": true,
"DocumentType interface: operation replace([object Object],[object Object])": true,
- "DocumentType interface: document.doctype must inherit property \"before\" with the proper type (5)": true,
+ "DocumentType interface: document.doctype must inherit property \"before\" with the proper type (3)": true,
"DocumentType interface: calling before([object Object],[object Object]) on document.doctype with too few arguments must throw TypeError": true,
- "DocumentType interface: document.doctype must inherit property \"after\" with the proper type (6)": true,
+ "DocumentType interface: document.doctype must inherit property \"after\" with the proper type (4)": true,
"DocumentType interface: calling after([object Object],[object Object]) on document.doctype with too few arguments must throw TypeError": true,
- "DocumentType interface: document.doctype must inherit property \"replace\" with the proper type (7)": true,
+ "DocumentType interface: document.doctype must inherit property \"replace\" with the proper type (5)": true,
"DocumentType interface: calling replace([object Object],[object Object]) on document.doctype with too few arguments must throw TypeError": true,
"Element interface: existence and properties of interface object": true,
"Element interface: attribute namespaceURI": true,
@@ -47,11 +47,11 @@
"Element interface: calling prepend([object Object],[object Object]) on element with too few arguments must throw TypeError": true,
"Element interface: element must inherit property \"append\" with the proper type (24)": true,
"Element interface: calling append([object Object],[object Object]) on element with too few arguments must throw TypeError": true,
- "Element interface: element must inherit property \"before\" with the proper type (27)": true,
+ "Element interface: element must inherit property \"before\" with the proper type (25)": true,
"Element interface: calling before([object Object],[object Object]) on element with too few arguments must throw TypeError": true,
- "Element interface: element must inherit property \"after\" with the proper type (28)": true,
+ "Element interface: element must inherit property \"after\" with the proper type (26)": true,
"Element interface: calling after([object Object],[object Object]) on element with too few arguments must throw TypeError": true,
- "Element interface: element must inherit property \"replace\" with the proper type (29)": true,
+ "Element interface: element must inherit property \"replace\" with the proper type (27)": true,
"Element interface: calling replace([object Object],[object Object]) on element with too few arguments must throw TypeError": true,
"Attr interface: existence and properties of interface object": true,
"Attr interface: existence and properties of interface prototype object": true,
@@ -60,25 +60,25 @@
"CharacterData interface: operation after([object Object],[object Object])": true,
"CharacterData interface: operation replace([object Object],[object Object])": true,
"Text interface: existence and properties of interface object": true,
- "CharacterData interface: document.createTextNode(\"abc\") must inherit property \"before\" with the proper type (9)": true,
+ "CharacterData interface: document.createTextNode(\"abc\") must inherit property \"before\" with the proper type (7)": true,
"CharacterData interface: calling before([object Object],[object Object]) on document.createTextNode(\"abc\") with too few arguments must throw TypeError": true,
- "CharacterData interface: document.createTextNode(\"abc\") must inherit property \"after\" with the proper type (10)": true,
+ "CharacterData interface: document.createTextNode(\"abc\") must inherit property \"after\" with the proper type (8)": true,
"CharacterData interface: calling after([object Object],[object Object]) on document.createTextNode(\"abc\") with too few arguments must throw TypeError": true,
- "CharacterData interface: document.createTextNode(\"abc\") must inherit property \"replace\" with the proper type (11)": true,
+ "CharacterData interface: document.createTextNode(\"abc\") must inherit property \"replace\" with the proper type (9)": true,
"CharacterData interface: calling replace([object Object],[object Object]) on document.createTextNode(\"abc\") with too few arguments must throw TypeError": true,
"ProcessingInstruction interface: existence and properties of interface object": true,
- "CharacterData interface: xmlDoc.createProcessingInstruction(\"abc\", \"def\") must inherit property \"before\" with the proper type (9)": true,
+ "CharacterData interface: xmlDoc.createProcessingInstruction(\"abc\", \"def\") must inherit property \"before\" with the proper type (7)": true,
"CharacterData interface: calling before([object Object],[object Object]) on xmlDoc.createProcessingInstruction(\"abc\", \"def\") with too few arguments must throw TypeError": true,
- "CharacterData interface: xmlDoc.createProcessingInstruction(\"abc\", \"def\") must inherit property \"after\" with the proper type (10)": true,
+ "CharacterData interface: xmlDoc.createProcessingInstruction(\"abc\", \"def\") must inherit property \"after\" with the proper type (8)": true,
"CharacterData interface: calling after([object Object],[object Object]) on xmlDoc.createProcessingInstruction(\"abc\", \"def\") with too few arguments must throw TypeError": true,
- "CharacterData interface: xmlDoc.createProcessingInstruction(\"abc\", \"def\") must inherit property \"replace\" with the proper type (11)": true,
+ "CharacterData interface: xmlDoc.createProcessingInstruction(\"abc\", \"def\") must inherit property \"replace\" with the proper type (9)": true,
"CharacterData interface: calling replace([object Object],[object Object]) on xmlDoc.createProcessingInstruction(\"abc\", \"def\") with too few arguments must throw TypeError": true,
"Comment interface: existence and properties of interface object": true,
- "CharacterData interface: document.createComment(\"abc\") must inherit property \"before\" with the proper type (9)": true,
+ "CharacterData interface: document.createComment(\"abc\") must inherit property \"before\" with the proper type (7)": true,
"CharacterData interface: calling before([object Object],[object Object]) on document.createComment(\"abc\") with too few arguments must throw TypeError": true,
- "CharacterData interface: document.createComment(\"abc\") must inherit property \"after\" with the proper type (10)": true,
+ "CharacterData interface: document.createComment(\"abc\") must inherit property \"after\" with the proper type (8)": true,
"CharacterData interface: calling after([object Object],[object Object]) on document.createComment(\"abc\") with too few arguments must throw TypeError": true,
- "CharacterData interface: document.createComment(\"abc\") must inherit property \"replace\" with the proper type (11)": true,
+ "CharacterData interface: document.createComment(\"abc\") must inherit property \"replace\" with the proper type (9)": true,
"CharacterData interface: calling replace([object Object],[object Object]) on document.createComment(\"abc\") with too few arguments must throw TypeError": true,
"NodeFilter interface: existence and properties of interface object": true,
"NodeList interface: existence and properties of interface prototype object": true,
diff --git a/dom/imptests/html/dom/test_interfaces.html b/dom/imptests/html/dom/test_interfaces.html
index 52fde27b0d6..df1231ca309 100644
--- a/dom/imptests/html/dom/test_interfaces.html
+++ b/dom/imptests/html/dom/test_interfaces.html
@@ -109,9 +109,6 @@ Element implements ParentNode;
[NoInterfaceObject]
interface ChildNode {
- readonly attribute Element? previousElementSibling;
- readonly attribute Element? nextElementSibling;
-
void before((Node or DOMString)... nodes);
void after((Node or DOMString)... nodes);
void replace((Node or DOMString)... nodes);
@@ -121,6 +118,14 @@ DocumentType implements ChildNode;
Element implements ChildNode;
CharacterData implements ChildNode;
+[NoInterfaceObject]
+interface NonDocumentTypeChildNode {
+ readonly attribute Element? previousElementSibling;
+ readonly attribute Element? nextElementSibling;
+};
+Element implements NonDocumentTypeChildNode;
+CharacterData implements NonDocumentTypeChildNode;
+
[Constructor(MutationCallback callback)]
interface MutationObserver {
void observe(Node target, MutationObserverInit options);
diff --git a/dom/webidl/CharacterData.webidl b/dom/webidl/CharacterData.webidl
index 5d1ae3ef921..8d6a214e58e 100644
--- a/dom/webidl/CharacterData.webidl
+++ b/dom/webidl/CharacterData.webidl
@@ -28,3 +28,4 @@ interface CharacterData : Node {
};
CharacterData implements ChildNode;
+CharacterData implements NonDocumentTypeChildNode;
diff --git a/dom/webidl/ChildNode.webidl b/dom/webidl/ChildNode.webidl
index 76d448656e1..0895011fe48 100644
--- a/dom/webidl/ChildNode.webidl
+++ b/dom/webidl/ChildNode.webidl
@@ -9,14 +9,17 @@
[NoInterfaceObject]
interface ChildNode {
- [Pure]
- readonly attribute Element? previousElementSibling;
- [Pure]
- readonly attribute Element? nextElementSibling;
-
// Not implemented yet:
// void before((Node or DOMString)... nodes);
// void after((Node or DOMString)... nodes);
// void replace((Node or DOMString)... nodes);
void remove();
};
+
+[NoInterfaceObject]
+interface NonDocumentTypeChildNode {
+ [Pure]
+ readonly attribute Element? previousElementSibling;
+ [Pure]
+ readonly attribute Element? nextElementSibling;
+};
diff --git a/dom/webidl/Element.webidl b/dom/webidl/Element.webidl
index 1e741312ef9..7892949e01e 100644
--- a/dom/webidl/Element.webidl
+++ b/dom/webidl/Element.webidl
@@ -189,4 +189,5 @@ partial interface Element {
};
Element implements ChildNode;
+Element implements NonDocumentTypeChildNode;
Element implements ParentNode;