Auto merge of #7592 - nox:nonelementparentnode, r=jdm

Introduce NonElementParentNode

This is the interface where Document.getElementById() belong.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7592)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-09-10 07:29:47 -06:00
commit 4c64c870c6
5 changed files with 27 additions and 10 deletions

View file

@ -26,7 +26,6 @@ interface Document : Node {
HTMLCollection getElementsByTagName(DOMString localName);
HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
HTMLCollection getElementsByClassName(DOMString classNames);
Element? getElementById(DOMString elementId);
[NewObject, Throws]
Element createElement(DOMString localName);
@ -65,6 +64,8 @@ interface Document : Node {
TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF,
optional NodeFilter? filter = null);
};
Document implements NonElementParentNode;
Document implements ParentNode;
enum DocumentReadyState { "loading", "interactive", "complete" };

View file

@ -8,4 +8,5 @@
interface DocumentFragment : Node {
};
DocumentFragment implements NonElementParentNode;
DocumentFragment implements ParentNode;

View file

@ -0,0 +1,11 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// https://dom.spec.whatwg.org/#nonelementparentnode
[NoInterfaceObject,
Exposed=Window]
interface NonElementParentNode {
Element? getElementById(DOMString elementId);
};