Auto merge of #13703 - Rafagd:my_changes, r=Ms2ger

Replacing Node.rootNode for Node.getRootNode.

- Changed the specification for the Node element to reflect the new standard.
- Changed the implementation of the NodeMethod.

I'm still waiting for some answers for the questions I've posted on #13699, but I'm already doing the pull request so I can get some feedback as well.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #13699 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13703)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-10-14 14:07:12 -05:00 committed by GitHub
commit 697e197985
5 changed files with 6 additions and 73 deletions

View file

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

View file

@ -30,8 +30,10 @@ interface Node : EventTarget {
[Pure]
readonly attribute Document? ownerDocument;
[Pure]
readonly attribute Node rootNode;
Node getRootNode();
[Pure]
readonly attribute Node? parentNode;
[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]
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)]
expected: FAIL
@ -504,21 +471,3 @@
[Node interface: document.querySelector("[id\]").attributes[0\] must inherit property "removeChild" with the proper type (46)]
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