dom/interfaces/core/nsIDOMNode.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/interfaces/core/nsIDOMNode.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,112 @@
     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
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "domstubs.idl"
    1.10 +
    1.11 +interface nsIVariant;
    1.12 +interface nsIDOMUserDataHandler;
    1.13 +
    1.14 +/**
    1.15 + * The nsIDOMNode interface is the primary datatype for the entire 
    1.16 + * Document Object Model.
    1.17 + * It represents a single node in the document tree.
    1.18 + *
    1.19 + * For more information on this interface please see 
    1.20 + * http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
    1.21 + */
    1.22 +
    1.23 +[scriptable, uuid(56545150-a001-484e-9ed4-cb319eebd7b3)]
    1.24 +interface nsIDOMNode : nsISupports
    1.25 +{
    1.26 +  const unsigned short      ELEMENT_NODE       = 1;
    1.27 +  const unsigned short      ATTRIBUTE_NODE     = 2;
    1.28 +  const unsigned short      TEXT_NODE          = 3;
    1.29 +  const unsigned short      CDATA_SECTION_NODE = 4;
    1.30 +  const unsigned short      ENTITY_REFERENCE_NODE = 5;
    1.31 +  const unsigned short      ENTITY_NODE        = 6;
    1.32 +  const unsigned short      PROCESSING_INSTRUCTION_NODE = 7;
    1.33 +  const unsigned short      COMMENT_NODE       = 8;
    1.34 +  const unsigned short      DOCUMENT_NODE      = 9;
    1.35 +  const unsigned short      DOCUMENT_TYPE_NODE = 10;
    1.36 +  const unsigned short      DOCUMENT_FRAGMENT_NODE = 11;
    1.37 +  const unsigned short      NOTATION_NODE      = 12;
    1.38 +
    1.39 +  readonly attribute DOMString        nodeName;
    1.40 +           attribute DOMString        nodeValue;
    1.41 +                                          // raises(DOMException) on setting
    1.42 +                                          // raises(DOMException) on retrieval
    1.43 +  readonly attribute unsigned short   nodeType;
    1.44 +  readonly attribute nsIDOMNode       parentNode;
    1.45 +  readonly attribute nsIDOMElement    parentElement;
    1.46 +  readonly attribute nsIDOMNodeList   childNodes;
    1.47 +  readonly attribute nsIDOMNode       firstChild;
    1.48 +  readonly attribute nsIDOMNode       lastChild;
    1.49 +  readonly attribute nsIDOMNode       previousSibling;
    1.50 +  readonly attribute nsIDOMNode       nextSibling;
    1.51 +  // Modified in DOM Level 2:
    1.52 +  readonly attribute nsIDOMDocument   ownerDocument;
    1.53 +  nsIDOMNode                insertBefore(in nsIDOMNode newChild, 
    1.54 +                                         in nsIDOMNode refChild)
    1.55 +                                          raises(DOMException);
    1.56 +  nsIDOMNode                replaceChild(in nsIDOMNode newChild, 
    1.57 +                                         in nsIDOMNode oldChild)
    1.58 +                                          raises(DOMException);
    1.59 +  nsIDOMNode                removeChild(in nsIDOMNode oldChild)
    1.60 +                                         raises(DOMException);
    1.61 +  nsIDOMNode                appendChild(in nsIDOMNode newChild)
    1.62 +                                         raises(DOMException);
    1.63 +  boolean                   hasChildNodes();
    1.64 +  // Modified in DOM Level 4:
    1.65 +  [optional_argc] nsIDOMNode                cloneNode([optional] in boolean deep);
    1.66 +  // Modified in DOM Level 2:
    1.67 +  void                      normalize();
    1.68 +  // Introduced in DOM Level 2:
    1.69 +  readonly attribute DOMString        namespaceURI;
    1.70 +  // Modified in DOM Core
    1.71 +  readonly attribute DOMString        prefix;
    1.72 +
    1.73 +  // Introduced in DOM Level 2:
    1.74 +  readonly attribute DOMString        localName;
    1.75 +  // Introduced in DOM Level 2:
    1.76 +  boolean            hasAttributes();
    1.77 +
    1.78 +  // Introduced in DOM Level 3:
    1.79 +  // This uses a binaryname to avoid warnings due to name collision with
    1.80 +  // nsINode::GetBaseURI
    1.81 +  [binaryname(DOMBaseURI)] readonly attribute DOMString baseURI;
    1.82 +
    1.83 +  // DocumentPosition
    1.84 +  const unsigned short      DOCUMENT_POSITION_DISCONNECTED = 0x01;
    1.85 +  const unsigned short      DOCUMENT_POSITION_PRECEDING    = 0x02;
    1.86 +  const unsigned short      DOCUMENT_POSITION_FOLLOWING    = 0x04;
    1.87 +  const unsigned short      DOCUMENT_POSITION_CONTAINS     = 0x08;
    1.88 +  const unsigned short      DOCUMENT_POSITION_CONTAINED_BY = 0x10;
    1.89 +  const unsigned short      DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
    1.90 +
    1.91 +  // Introduced in DOM Level 3:
    1.92 +  unsigned short     compareDocumentPosition(in nsIDOMNode other)
    1.93 +                                        raises(DOMException);
    1.94 +  // Introduced in DOM Level 3:
    1.95 +           attribute DOMString       textContent;
    1.96 +                                        // raises(DOMException) on setting
    1.97 +                                        // raises(DOMException) on retrieval
    1.98 +
    1.99 +  // Introduced in DOM Level 3:
   1.100 +  DOMString          lookupPrefix(in DOMString namespaceURI);
   1.101 +  // Introduced in DOM Level 3:
   1.102 +  boolean            isDefaultNamespace(in DOMString namespaceURI);
   1.103 +  // Introduced in DOM Level 3:
   1.104 +  DOMString          lookupNamespaceURI(in DOMString prefix);
   1.105 +  // Introduced in DOM Level 3:
   1.106 +  boolean            isEqualNode(in nsIDOMNode arg);
   1.107 +  // Introduced in DOM Level 3:
   1.108 +  nsIVariant         setUserData(in DOMString key, 
   1.109 +                                 in nsIVariant data, 
   1.110 +                                 in nsIDOMUserDataHandler handler);
   1.111 +  // Introduced in DOM Level 3:
   1.112 +  nsIVariant         getUserData(in DOMString key);
   1.113 +
   1.114 +  boolean            contains(in nsIDOMNode aOther);
   1.115 +};

mercurial