dom/interfaces/core/nsIDOMNode.idl

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
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "domstubs.idl"
michael@0 7
michael@0 8 interface nsIVariant;
michael@0 9 interface nsIDOMUserDataHandler;
michael@0 10
michael@0 11 /**
michael@0 12 * The nsIDOMNode interface is the primary datatype for the entire
michael@0 13 * Document Object Model.
michael@0 14 * It represents a single node in the document tree.
michael@0 15 *
michael@0 16 * For more information on this interface please see
michael@0 17 * http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
michael@0 18 */
michael@0 19
michael@0 20 [scriptable, uuid(56545150-a001-484e-9ed4-cb319eebd7b3)]
michael@0 21 interface nsIDOMNode : nsISupports
michael@0 22 {
michael@0 23 const unsigned short ELEMENT_NODE = 1;
michael@0 24 const unsigned short ATTRIBUTE_NODE = 2;
michael@0 25 const unsigned short TEXT_NODE = 3;
michael@0 26 const unsigned short CDATA_SECTION_NODE = 4;
michael@0 27 const unsigned short ENTITY_REFERENCE_NODE = 5;
michael@0 28 const unsigned short ENTITY_NODE = 6;
michael@0 29 const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
michael@0 30 const unsigned short COMMENT_NODE = 8;
michael@0 31 const unsigned short DOCUMENT_NODE = 9;
michael@0 32 const unsigned short DOCUMENT_TYPE_NODE = 10;
michael@0 33 const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
michael@0 34 const unsigned short NOTATION_NODE = 12;
michael@0 35
michael@0 36 readonly attribute DOMString nodeName;
michael@0 37 attribute DOMString nodeValue;
michael@0 38 // raises(DOMException) on setting
michael@0 39 // raises(DOMException) on retrieval
michael@0 40 readonly attribute unsigned short nodeType;
michael@0 41 readonly attribute nsIDOMNode parentNode;
michael@0 42 readonly attribute nsIDOMElement parentElement;
michael@0 43 readonly attribute nsIDOMNodeList childNodes;
michael@0 44 readonly attribute nsIDOMNode firstChild;
michael@0 45 readonly attribute nsIDOMNode lastChild;
michael@0 46 readonly attribute nsIDOMNode previousSibling;
michael@0 47 readonly attribute nsIDOMNode nextSibling;
michael@0 48 // Modified in DOM Level 2:
michael@0 49 readonly attribute nsIDOMDocument ownerDocument;
michael@0 50 nsIDOMNode insertBefore(in nsIDOMNode newChild,
michael@0 51 in nsIDOMNode refChild)
michael@0 52 raises(DOMException);
michael@0 53 nsIDOMNode replaceChild(in nsIDOMNode newChild,
michael@0 54 in nsIDOMNode oldChild)
michael@0 55 raises(DOMException);
michael@0 56 nsIDOMNode removeChild(in nsIDOMNode oldChild)
michael@0 57 raises(DOMException);
michael@0 58 nsIDOMNode appendChild(in nsIDOMNode newChild)
michael@0 59 raises(DOMException);
michael@0 60 boolean hasChildNodes();
michael@0 61 // Modified in DOM Level 4:
michael@0 62 [optional_argc] nsIDOMNode cloneNode([optional] in boolean deep);
michael@0 63 // Modified in DOM Level 2:
michael@0 64 void normalize();
michael@0 65 // Introduced in DOM Level 2:
michael@0 66 readonly attribute DOMString namespaceURI;
michael@0 67 // Modified in DOM Core
michael@0 68 readonly attribute DOMString prefix;
michael@0 69
michael@0 70 // Introduced in DOM Level 2:
michael@0 71 readonly attribute DOMString localName;
michael@0 72 // Introduced in DOM Level 2:
michael@0 73 boolean hasAttributes();
michael@0 74
michael@0 75 // Introduced in DOM Level 3:
michael@0 76 // This uses a binaryname to avoid warnings due to name collision with
michael@0 77 // nsINode::GetBaseURI
michael@0 78 [binaryname(DOMBaseURI)] readonly attribute DOMString baseURI;
michael@0 79
michael@0 80 // DocumentPosition
michael@0 81 const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
michael@0 82 const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
michael@0 83 const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
michael@0 84 const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
michael@0 85 const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
michael@0 86 const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
michael@0 87
michael@0 88 // Introduced in DOM Level 3:
michael@0 89 unsigned short compareDocumentPosition(in nsIDOMNode other)
michael@0 90 raises(DOMException);
michael@0 91 // Introduced in DOM Level 3:
michael@0 92 attribute DOMString textContent;
michael@0 93 // raises(DOMException) on setting
michael@0 94 // raises(DOMException) on retrieval
michael@0 95
michael@0 96 // Introduced in DOM Level 3:
michael@0 97 DOMString lookupPrefix(in DOMString namespaceURI);
michael@0 98 // Introduced in DOM Level 3:
michael@0 99 boolean isDefaultNamespace(in DOMString namespaceURI);
michael@0 100 // Introduced in DOM Level 3:
michael@0 101 DOMString lookupNamespaceURI(in DOMString prefix);
michael@0 102 // Introduced in DOM Level 3:
michael@0 103 boolean isEqualNode(in nsIDOMNode arg);
michael@0 104 // Introduced in DOM Level 3:
michael@0 105 nsIVariant setUserData(in DOMString key,
michael@0 106 in nsIVariant data,
michael@0 107 in nsIDOMUserDataHandler handler);
michael@0 108 // Introduced in DOM Level 3:
michael@0 109 nsIVariant getUserData(in DOMString key);
michael@0 110
michael@0 111 boolean contains(in nsIDOMNode aOther);
michael@0 112 };

mercurial