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 michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "domstubs.idl" michael@0: michael@0: interface nsIVariant; michael@0: interface nsIDOMUserDataHandler; michael@0: michael@0: /** michael@0: * The nsIDOMNode interface is the primary datatype for the entire michael@0: * Document Object Model. michael@0: * It represents a single node in the document tree. michael@0: * michael@0: * For more information on this interface please see michael@0: * http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html michael@0: */ michael@0: michael@0: [scriptable, uuid(56545150-a001-484e-9ed4-cb319eebd7b3)] michael@0: interface nsIDOMNode : nsISupports michael@0: { michael@0: const unsigned short ELEMENT_NODE = 1; michael@0: const unsigned short ATTRIBUTE_NODE = 2; michael@0: const unsigned short TEXT_NODE = 3; michael@0: const unsigned short CDATA_SECTION_NODE = 4; michael@0: const unsigned short ENTITY_REFERENCE_NODE = 5; michael@0: const unsigned short ENTITY_NODE = 6; 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; michael@0: michael@0: readonly attribute DOMString nodeName; michael@0: attribute DOMString nodeValue; michael@0: // raises(DOMException) on setting michael@0: // raises(DOMException) on retrieval michael@0: readonly attribute unsigned short nodeType; michael@0: readonly attribute nsIDOMNode parentNode; michael@0: readonly attribute nsIDOMElement parentElement; michael@0: readonly attribute nsIDOMNodeList childNodes; michael@0: readonly attribute nsIDOMNode firstChild; michael@0: readonly attribute nsIDOMNode lastChild; michael@0: readonly attribute nsIDOMNode previousSibling; michael@0: readonly attribute nsIDOMNode nextSibling; michael@0: // Modified in DOM Level 2: michael@0: readonly attribute nsIDOMDocument ownerDocument; michael@0: nsIDOMNode insertBefore(in nsIDOMNode newChild, michael@0: in nsIDOMNode refChild) michael@0: raises(DOMException); michael@0: nsIDOMNode replaceChild(in nsIDOMNode newChild, michael@0: in nsIDOMNode oldChild) michael@0: raises(DOMException); michael@0: nsIDOMNode removeChild(in nsIDOMNode oldChild) michael@0: raises(DOMException); michael@0: nsIDOMNode appendChild(in nsIDOMNode newChild) michael@0: raises(DOMException); michael@0: boolean hasChildNodes(); michael@0: // Modified in DOM Level 4: michael@0: [optional_argc] nsIDOMNode cloneNode([optional] in boolean deep); michael@0: // Modified in DOM Level 2: michael@0: void normalize(); michael@0: // Introduced in DOM Level 2: michael@0: readonly attribute DOMString namespaceURI; michael@0: // Modified in DOM Core michael@0: readonly attribute DOMString prefix; michael@0: michael@0: // Introduced in DOM Level 2: michael@0: readonly attribute DOMString localName; michael@0: // Introduced in DOM Level 2: michael@0: boolean hasAttributes(); michael@0: michael@0: // Introduced in DOM Level 3: michael@0: // This uses a binaryname to avoid warnings due to name collision with michael@0: // nsINode::GetBaseURI michael@0: [binaryname(DOMBaseURI)] readonly attribute DOMString baseURI; michael@0: michael@0: // DocumentPosition 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; michael@0: michael@0: // Introduced in DOM Level 3: michael@0: unsigned short compareDocumentPosition(in nsIDOMNode other) michael@0: raises(DOMException); michael@0: // Introduced in DOM Level 3: michael@0: attribute DOMString textContent; michael@0: // raises(DOMException) on setting michael@0: // raises(DOMException) on retrieval michael@0: michael@0: // Introduced in DOM Level 3: michael@0: DOMString lookupPrefix(in DOMString namespaceURI); michael@0: // Introduced in DOM Level 3: michael@0: boolean isDefaultNamespace(in DOMString namespaceURI); michael@0: // Introduced in DOM Level 3: michael@0: DOMString lookupNamespaceURI(in DOMString prefix); michael@0: // Introduced in DOM Level 3: michael@0: boolean isEqualNode(in nsIDOMNode arg); michael@0: // Introduced in DOM Level 3: michael@0: nsIVariant setUserData(in DOMString key, michael@0: in nsIVariant data, michael@0: in nsIDOMUserDataHandler handler); michael@0: // Introduced in DOM Level 3: michael@0: nsIVariant getUserData(in DOMString key); michael@0: michael@0: boolean contains(in nsIDOMNode aOther); michael@0: };