1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/Node.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,117 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + * 1.9 + * The origin of this IDL file is 1.10 + * http://www.w3.org/TR/2012/WD-dom-20120105/ 1.11 + * 1.12 + * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C 1.13 + * liability, trademark and document use rules apply. 1.14 + */ 1.15 + 1.16 +interface Principal; 1.17 +interface URI; 1.18 +interface UserDataHandler; 1.19 + 1.20 +interface Node : EventTarget { 1.21 + const unsigned short ELEMENT_NODE = 1; 1.22 + const unsigned short ATTRIBUTE_NODE = 2; // historical 1.23 + const unsigned short TEXT_NODE = 3; 1.24 + const unsigned short CDATA_SECTION_NODE = 4; // historical 1.25 + const unsigned short ENTITY_REFERENCE_NODE = 5; // historical 1.26 + const unsigned short ENTITY_NODE = 6; // historical 1.27 + const unsigned short PROCESSING_INSTRUCTION_NODE = 7; 1.28 + const unsigned short COMMENT_NODE = 8; 1.29 + const unsigned short DOCUMENT_NODE = 9; 1.30 + const unsigned short DOCUMENT_TYPE_NODE = 10; 1.31 + const unsigned short DOCUMENT_FRAGMENT_NODE = 11; 1.32 + const unsigned short NOTATION_NODE = 12; // historical 1.33 + [Constant] 1.34 + readonly attribute unsigned short nodeType; 1.35 + [Pure] 1.36 + readonly attribute DOMString nodeName; 1.37 + 1.38 + [Pure] 1.39 + readonly attribute DOMString? baseURI; 1.40 + 1.41 + [Pure] 1.42 + readonly attribute Document? ownerDocument; 1.43 + [Pure] 1.44 + readonly attribute Node? parentNode; 1.45 + [Pure] 1.46 + readonly attribute Element? parentElement; 1.47 + [Pure] 1.48 + boolean hasChildNodes(); 1.49 + [SameObject] 1.50 + readonly attribute NodeList childNodes; 1.51 + [Pure] 1.52 + readonly attribute Node? firstChild; 1.53 + [Pure] 1.54 + readonly attribute Node? lastChild; 1.55 + [Pure] 1.56 + readonly attribute Node? previousSibling; 1.57 + [Pure] 1.58 + readonly attribute Node? nextSibling; 1.59 + 1.60 + [SetterThrows, Pure] 1.61 + attribute DOMString? nodeValue; 1.62 + [SetterThrows, Pure] 1.63 + attribute DOMString? textContent; 1.64 + [Throws] 1.65 + Node insertBefore(Node node, Node? child); 1.66 + [Throws] 1.67 + Node appendChild(Node node); 1.68 + [Throws] 1.69 + Node replaceChild(Node node, Node child); 1.70 + [Throws] 1.71 + Node removeChild(Node child); 1.72 + void normalize(); 1.73 + 1.74 + [Throws] 1.75 + Node cloneNode(optional boolean deep = false); 1.76 + [Pure] 1.77 + boolean isEqualNode(Node? node); 1.78 + 1.79 + const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01; 1.80 + const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02; 1.81 + const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04; 1.82 + const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08; 1.83 + const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10; 1.84 + const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; // historical 1.85 + [Pure] 1.86 + unsigned short compareDocumentPosition(Node other); 1.87 + [Pure] 1.88 + boolean contains(Node? other); 1.89 + 1.90 + [Pure] 1.91 + DOMString? lookupPrefix(DOMString? namespace); 1.92 + [Pure] 1.93 + DOMString? lookupNamespaceURI(DOMString? prefix); 1.94 + [Pure] 1.95 + boolean isDefaultNamespace(DOMString? namespace); 1.96 + 1.97 + // Mozilla-specific stuff 1.98 + // These have been moved to Element in the spec. 1.99 + // If we move namespaceURI, prefix and localName to Element they should return 1.100 + // a non-nullable type. 1.101 + [Constant] 1.102 + readonly attribute DOMString? namespaceURI; 1.103 + [Constant] 1.104 + readonly attribute DOMString? prefix; 1.105 + [Constant] 1.106 + readonly attribute DOMString? localName; 1.107 + 1.108 + [Pure] 1.109 + boolean hasAttributes(); 1.110 + [Throws, Func="IsChromeOrXBL"] 1.111 + any setUserData(DOMString key, any data, UserDataHandler? handler); 1.112 + [Throws, Func="IsChromeOrXBL"] 1.113 + any getUserData(DOMString key); 1.114 + [ChromeOnly] 1.115 + readonly attribute Principal nodePrincipal; 1.116 + [ChromeOnly] 1.117 + readonly attribute URI? baseURIObject; 1.118 + [ChromeOnly] 1.119 + sequence<MutationObserver> getBoundMutationObservers(); 1.120 +};