dom/webidl/Node.webidl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
michael@0 4 * You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 5 *
michael@0 6 * The origin of this IDL file is
michael@0 7 * http://www.w3.org/TR/2012/WD-dom-20120105/
michael@0 8 *
michael@0 9 * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
michael@0 10 * liability, trademark and document use rules apply.
michael@0 11 */
michael@0 12
michael@0 13 interface Principal;
michael@0 14 interface URI;
michael@0 15 interface UserDataHandler;
michael@0 16
michael@0 17 interface Node : EventTarget {
michael@0 18 const unsigned short ELEMENT_NODE = 1;
michael@0 19 const unsigned short ATTRIBUTE_NODE = 2; // historical
michael@0 20 const unsigned short TEXT_NODE = 3;
michael@0 21 const unsigned short CDATA_SECTION_NODE = 4; // historical
michael@0 22 const unsigned short ENTITY_REFERENCE_NODE = 5; // historical
michael@0 23 const unsigned short ENTITY_NODE = 6; // historical
michael@0 24 const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
michael@0 25 const unsigned short COMMENT_NODE = 8;
michael@0 26 const unsigned short DOCUMENT_NODE = 9;
michael@0 27 const unsigned short DOCUMENT_TYPE_NODE = 10;
michael@0 28 const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
michael@0 29 const unsigned short NOTATION_NODE = 12; // historical
michael@0 30 [Constant]
michael@0 31 readonly attribute unsigned short nodeType;
michael@0 32 [Pure]
michael@0 33 readonly attribute DOMString nodeName;
michael@0 34
michael@0 35 [Pure]
michael@0 36 readonly attribute DOMString? baseURI;
michael@0 37
michael@0 38 [Pure]
michael@0 39 readonly attribute Document? ownerDocument;
michael@0 40 [Pure]
michael@0 41 readonly attribute Node? parentNode;
michael@0 42 [Pure]
michael@0 43 readonly attribute Element? parentElement;
michael@0 44 [Pure]
michael@0 45 boolean hasChildNodes();
michael@0 46 [SameObject]
michael@0 47 readonly attribute NodeList childNodes;
michael@0 48 [Pure]
michael@0 49 readonly attribute Node? firstChild;
michael@0 50 [Pure]
michael@0 51 readonly attribute Node? lastChild;
michael@0 52 [Pure]
michael@0 53 readonly attribute Node? previousSibling;
michael@0 54 [Pure]
michael@0 55 readonly attribute Node? nextSibling;
michael@0 56
michael@0 57 [SetterThrows, Pure]
michael@0 58 attribute DOMString? nodeValue;
michael@0 59 [SetterThrows, Pure]
michael@0 60 attribute DOMString? textContent;
michael@0 61 [Throws]
michael@0 62 Node insertBefore(Node node, Node? child);
michael@0 63 [Throws]
michael@0 64 Node appendChild(Node node);
michael@0 65 [Throws]
michael@0 66 Node replaceChild(Node node, Node child);
michael@0 67 [Throws]
michael@0 68 Node removeChild(Node child);
michael@0 69 void normalize();
michael@0 70
michael@0 71 [Throws]
michael@0 72 Node cloneNode(optional boolean deep = false);
michael@0 73 [Pure]
michael@0 74 boolean isEqualNode(Node? node);
michael@0 75
michael@0 76 const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
michael@0 77 const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
michael@0 78 const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
michael@0 79 const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
michael@0 80 const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
michael@0 81 const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; // historical
michael@0 82 [Pure]
michael@0 83 unsigned short compareDocumentPosition(Node other);
michael@0 84 [Pure]
michael@0 85 boolean contains(Node? other);
michael@0 86
michael@0 87 [Pure]
michael@0 88 DOMString? lookupPrefix(DOMString? namespace);
michael@0 89 [Pure]
michael@0 90 DOMString? lookupNamespaceURI(DOMString? prefix);
michael@0 91 [Pure]
michael@0 92 boolean isDefaultNamespace(DOMString? namespace);
michael@0 93
michael@0 94 // Mozilla-specific stuff
michael@0 95 // These have been moved to Element in the spec.
michael@0 96 // If we move namespaceURI, prefix and localName to Element they should return
michael@0 97 // a non-nullable type.
michael@0 98 [Constant]
michael@0 99 readonly attribute DOMString? namespaceURI;
michael@0 100 [Constant]
michael@0 101 readonly attribute DOMString? prefix;
michael@0 102 [Constant]
michael@0 103 readonly attribute DOMString? localName;
michael@0 104
michael@0 105 [Pure]
michael@0 106 boolean hasAttributes();
michael@0 107 [Throws, Func="IsChromeOrXBL"]
michael@0 108 any setUserData(DOMString key, any data, UserDataHandler? handler);
michael@0 109 [Throws, Func="IsChromeOrXBL"]
michael@0 110 any getUserData(DOMString key);
michael@0 111 [ChromeOnly]
michael@0 112 readonly attribute Principal nodePrincipal;
michael@0 113 [ChromeOnly]
michael@0 114 readonly attribute URI? baseURIObject;
michael@0 115 [ChromeOnly]
michael@0 116 sequence<MutationObserver> getBoundMutationObservers();
michael@0 117 };

mercurial