Replacing Node.prototype.rootNode for Node.prototype.getRootNode.

This commit is contained in:
Rafael Gomes Dantas 2016-10-11 21:17:28 +01:00 committed by Rafael Dantas
parent 3916d1d613
commit 0074d2a7a8
5 changed files with 6 additions and 73 deletions

View file

@ -1934,8 +1934,8 @@ impl NodeMethods for Node {
} }
} }
// https://dom.spec.whatwg.org/#dom-node-rootnode // https://dom.spec.whatwg.org/#dom-node-getrootnode
fn RootNode(&self) -> Root<Node> { fn GetRootNode(&self) -> Root<Node> {
self.inclusive_ancestors().last().unwrap() self.inclusive_ancestors().last().unwrap()
} }
@ -2703,3 +2703,4 @@ impl Into<LayoutElementType> for ElementTypeId {
} }
} }
} }

View file

@ -30,8 +30,10 @@ interface Node : EventTarget {
[Pure] [Pure]
readonly attribute Document? ownerDocument; readonly attribute Document? ownerDocument;
[Pure] [Pure]
readonly attribute Node rootNode; Node getRootNode();
[Pure] [Pure]
readonly attribute Node? parentNode; readonly attribute Node? parentNode;
[Pure] [Pure]

View file

@ -1,5 +0,0 @@
[historical.html]
type: testharness
[Node member must be nuked: rootNode]
expected: FAIL

View file

@ -384,39 +384,6 @@
[CDATASection interface: existence and properties of interface prototype object's "constructor" property] [CDATASection interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL expected: FAIL
[Node interface: operation getRootNode(GetRootNodeOptions)]
expected: FAIL
[Node interface: new Document() must inherit property "getRootNode" with the proper type (17)]
expected: FAIL
[Node interface: calling getRootNode(GetRootNodeOptions) on new Document() with too few arguments must throw TypeError]
expected: FAIL
[Node interface: xmlDoc must inherit property "getRootNode" with the proper type (17)]
expected: FAIL
[Node interface: calling getRootNode(GetRootNodeOptions) on xmlDoc with too few arguments must throw TypeError]
expected: FAIL
[Node interface: document.doctype must inherit property "getRootNode" with the proper type (17)]
expected: FAIL
[Node interface: calling getRootNode(GetRootNodeOptions) on document.doctype with too few arguments must throw TypeError]
expected: FAIL
[Node interface: document.createDocumentFragment() must inherit property "getRootNode" with the proper type (17)]
expected: FAIL
[Node interface: calling getRootNode(GetRootNodeOptions) on document.createDocumentFragment() with too few arguments must throw TypeError]
expected: FAIL
[Node interface: element must inherit property "getRootNode" with the proper type (17)]
expected: FAIL
[Node interface: calling getRootNode(GetRootNodeOptions) on element with too few arguments must throw TypeError]
expected: FAIL
[Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "getRootNode" with the proper type (17)] [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "getRootNode" with the proper type (17)]
expected: FAIL expected: FAIL
@ -504,21 +471,3 @@
[Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "removeChild" with the proper type (46)] [Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "removeChild" with the proper type (46)]
expected: FAIL expected: FAIL
[Node interface: document.createTextNode("abc") must inherit property "getRootNode" with the proper type (17)]
expected: FAIL
[Node interface: calling getRootNode(GetRootNodeOptions) on document.createTextNode("abc") with too few arguments must throw TypeError]
expected: FAIL
[Node interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "getRootNode" with the proper type (17)]
expected: FAIL
[Node interface: calling getRootNode(GetRootNodeOptions) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError]
expected: FAIL
[Node interface: document.createComment("abc") must inherit property "getRootNode" with the proper type (17)]
expected: FAIL
[Node interface: calling getRootNode(GetRootNodeOptions) on document.createComment("abc") with too few arguments must throw TypeError]
expected: FAIL

View file

@ -1,14 +0,0 @@
[rootNode.html]
type: testharness
[getRootNode() must return the context object when it does not have any parent]
expected: FAIL
[getRootNode() must return the parent node of the context object when the context object has a single ancestor not in a document]
expected: FAIL
[getRootNode() must return the document when a node is in document]
expected: FAIL
[getRootNode() must return a document fragment when a node is in the fragment]
expected: FAIL