michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: * michael@0: * The origin of this IDL file is michael@0: * http://www.w3.org/TR/2012/WD-dom-20120105/ michael@0: * michael@0: * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C michael@0: * liability, trademark and document use rules apply. michael@0: */ michael@0: michael@0: interface Principal; michael@0: interface URI; michael@0: interface UserDataHandler; michael@0: michael@0: interface Node : EventTarget { michael@0: const unsigned short ELEMENT_NODE = 1; michael@0: const unsigned short ATTRIBUTE_NODE = 2; // historical michael@0: const unsigned short TEXT_NODE = 3; michael@0: const unsigned short CDATA_SECTION_NODE = 4; // historical michael@0: const unsigned short ENTITY_REFERENCE_NODE = 5; // historical michael@0: const unsigned short ENTITY_NODE = 6; // historical michael@0: const unsigned short PROCESSING_INSTRUCTION_NODE = 7; michael@0: const unsigned short COMMENT_NODE = 8; michael@0: const unsigned short DOCUMENT_NODE = 9; michael@0: const unsigned short DOCUMENT_TYPE_NODE = 10; michael@0: const unsigned short DOCUMENT_FRAGMENT_NODE = 11; michael@0: const unsigned short NOTATION_NODE = 12; // historical michael@0: [Constant] michael@0: readonly attribute unsigned short nodeType; michael@0: [Pure] michael@0: readonly attribute DOMString nodeName; michael@0: michael@0: [Pure] michael@0: readonly attribute DOMString? baseURI; michael@0: michael@0: [Pure] michael@0: readonly attribute Document? ownerDocument; michael@0: [Pure] michael@0: readonly attribute Node? parentNode; michael@0: [Pure] michael@0: readonly attribute Element? parentElement; michael@0: [Pure] michael@0: boolean hasChildNodes(); michael@0: [SameObject] michael@0: readonly attribute NodeList childNodes; michael@0: [Pure] michael@0: readonly attribute Node? firstChild; michael@0: [Pure] michael@0: readonly attribute Node? lastChild; michael@0: [Pure] michael@0: readonly attribute Node? previousSibling; michael@0: [Pure] michael@0: readonly attribute Node? nextSibling; michael@0: michael@0: [SetterThrows, Pure] michael@0: attribute DOMString? nodeValue; michael@0: [SetterThrows, Pure] michael@0: attribute DOMString? textContent; michael@0: [Throws] michael@0: Node insertBefore(Node node, Node? child); michael@0: [Throws] michael@0: Node appendChild(Node node); michael@0: [Throws] michael@0: Node replaceChild(Node node, Node child); michael@0: [Throws] michael@0: Node removeChild(Node child); michael@0: void normalize(); michael@0: michael@0: [Throws] michael@0: Node cloneNode(optional boolean deep = false); michael@0: [Pure] michael@0: boolean isEqualNode(Node? node); michael@0: michael@0: const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01; michael@0: const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02; michael@0: const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04; michael@0: const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08; michael@0: const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10; michael@0: const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; // historical michael@0: [Pure] michael@0: unsigned short compareDocumentPosition(Node other); michael@0: [Pure] michael@0: boolean contains(Node? other); michael@0: michael@0: [Pure] michael@0: DOMString? lookupPrefix(DOMString? namespace); michael@0: [Pure] michael@0: DOMString? lookupNamespaceURI(DOMString? prefix); michael@0: [Pure] michael@0: boolean isDefaultNamespace(DOMString? namespace); michael@0: michael@0: // Mozilla-specific stuff michael@0: // These have been moved to Element in the spec. michael@0: // If we move namespaceURI, prefix and localName to Element they should return michael@0: // a non-nullable type. michael@0: [Constant] michael@0: readonly attribute DOMString? namespaceURI; michael@0: [Constant] michael@0: readonly attribute DOMString? prefix; michael@0: [Constant] michael@0: readonly attribute DOMString? localName; michael@0: michael@0: [Pure] michael@0: boolean hasAttributes(); michael@0: [Throws, Func="IsChromeOrXBL"] michael@0: any setUserData(DOMString key, any data, UserDataHandler? handler); michael@0: [Throws, Func="IsChromeOrXBL"] michael@0: any getUserData(DOMString key); michael@0: [ChromeOnly] michael@0: readonly attribute Principal nodePrincipal; michael@0: [ChromeOnly] michael@0: readonly attribute URI? baseURIObject; michael@0: [ChromeOnly] michael@0: sequence getBoundMutationObservers(); michael@0: };