servo: Merge #13703 - Replacing Node.rootNode for Node.getRootNode (from Rafagd:my_changes); r=Ms2ger
authorRafael Gomes Dantas <rafagd@gmail.com>
Fri, 14 Oct 2016 14:07:12 -0500
changeset 386566 a0f7690bb1bdf9acec15f4d7032ae2478c586d73
parent 386565 ee789bf43dda98c80067f2b3f23e757ec5f796a9
child 386567 fae9a347734a2c005d60ab0b4ee7c7c7564a8c94
push id7198
push userjlorenzo@mozilla.com
push dateTue, 18 Apr 2017 12:07:49 +0000
treeherdermozilla-beta@d57aa49c3948 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMs2ger
servo: Merge #13703 - Replacing Node.rootNode for Node.getRootNode (from Rafagd:my_changes); r=Ms2ger - 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. --> Source-Repo: https://github.com/servo/servo Source-Revision: 697e1979855426e4efee7e949d7b7804a9d67d0a
servo/components/script/dom/node.rs
servo/components/script/dom/webidls/Node.webidl
--- a/servo/components/script/dom/node.rs
+++ b/servo/components/script/dom/node.rs
@@ -1930,18 +1930,18 @@ impl NodeMethods for Node {
             NodeTypeId::CharacterData(..) |
             NodeTypeId::Element(..) |
             NodeTypeId::DocumentType |
             NodeTypeId::DocumentFragment => Some(self.owner_doc()),
             NodeTypeId::Document(_) => None
         }
     }
 
-    // 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()
     }
 
     // https://dom.spec.whatwg.org/#dom-node-parentnode
     fn GetParentNode(&self) -> Option<Root<Node>> {
         self.parent_node.get()
     }
 
@@ -2699,8 +2699,9 @@ impl Into<LayoutElementType> for Element
             ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTextAreaElement) =>
                 LayoutElementType::HTMLTextAreaElement,
             ElementTypeId::SVGElement(SVGElementTypeId::SVGGraphicsElement(SVGGraphicsElementTypeId::SVGSVGElement)) =>
                 LayoutElementType::SVGSVGElement,
             _ => LayoutElementType::Element,
         }
     }
 }
+
--- a/servo/components/script/dom/webidls/Node.webidl
+++ b/servo/components/script/dom/webidls/Node.webidl
@@ -25,18 +25,20 @@ interface Node : EventTarget {
   [Pure]
   readonly attribute DOMString nodeName;
 
   [Pure]
   readonly attribute USVString baseURI;
 
   [Pure]
   readonly attribute Document? ownerDocument;
+
   [Pure]
-  readonly attribute Node rootNode;
+  Node getRootNode();
+
   [Pure]
   readonly attribute Node? parentNode;
   [Pure]
   readonly attribute Element? parentElement;
   [Pure]
   boolean hasChildNodes();
   [SameObject]
   readonly attribute NodeList childNodes;