nsIDOMNode.idl 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "domstubs.idl"
  6. interface nsIVariant;
  7. /**
  8. * The nsIDOMNode interface is the primary datatype for the entire
  9. * Document Object Model.
  10. * It represents a single node in the document tree.
  11. *
  12. * For more information on this interface please see
  13. * http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
  14. */
  15. [uuid(cc35b412-009b-46a3-9be0-76448f12548d)]
  16. interface nsIDOMNode : nsISupports
  17. {
  18. const unsigned short ELEMENT_NODE = 1;
  19. const unsigned short ATTRIBUTE_NODE = 2;
  20. const unsigned short TEXT_NODE = 3;
  21. const unsigned short CDATA_SECTION_NODE = 4;
  22. const unsigned short ENTITY_REFERENCE_NODE = 5;
  23. const unsigned short ENTITY_NODE = 6;
  24. const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
  25. const unsigned short COMMENT_NODE = 8;
  26. const unsigned short DOCUMENT_NODE = 9;
  27. const unsigned short DOCUMENT_TYPE_NODE = 10;
  28. const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
  29. const unsigned short NOTATION_NODE = 12;
  30. readonly attribute DOMString nodeName;
  31. attribute DOMString nodeValue;
  32. // raises(DOMException) on setting
  33. // raises(DOMException) on retrieval
  34. readonly attribute unsigned short nodeType;
  35. readonly attribute nsIDOMNode parentNode;
  36. readonly attribute nsIDOMElement parentElement;
  37. readonly attribute nsIDOMNodeList childNodes;
  38. readonly attribute nsIDOMNode firstChild;
  39. readonly attribute nsIDOMNode lastChild;
  40. readonly attribute nsIDOMNode previousSibling;
  41. readonly attribute nsIDOMNode nextSibling;
  42. // Modified in DOM Level 2:
  43. readonly attribute nsIDOMDocument ownerDocument;
  44. nsIDOMNode insertBefore(in nsIDOMNode newChild,
  45. in nsIDOMNode refChild)
  46. raises(DOMException);
  47. nsIDOMNode replaceChild(in nsIDOMNode newChild,
  48. in nsIDOMNode oldChild)
  49. raises(DOMException);
  50. nsIDOMNode removeChild(in nsIDOMNode oldChild)
  51. raises(DOMException);
  52. nsIDOMNode appendChild(in nsIDOMNode newChild)
  53. raises(DOMException);
  54. boolean hasChildNodes();
  55. // Modified in DOM Level 4:
  56. [optional_argc] nsIDOMNode cloneNode([optional] in boolean deep);
  57. // Modified in DOM Level 2:
  58. void normalize();
  59. // Introduced in DOM Level 2:
  60. readonly attribute DOMString namespaceURI;
  61. // Modified in DOM Core
  62. readonly attribute DOMString prefix;
  63. // Introduced in DOM Level 2:
  64. readonly attribute DOMString localName;
  65. // For vtable compatibility (see bug 1078674)
  66. [noscript] bool unusedPlaceholder();
  67. // Introduced in DOM Level 3:
  68. // This uses a binaryname to avoid warnings due to name collision with
  69. // nsINode::GetBaseURI
  70. [binaryname(DOMBaseURI)] readonly attribute DOMString baseURI;
  71. // DocumentPosition
  72. const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
  73. const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
  74. const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
  75. const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
  76. const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
  77. const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
  78. // Introduced in DOM Level 3:
  79. unsigned short compareDocumentPosition(in nsIDOMNode other)
  80. raises(DOMException);
  81. // Introduced in DOM Level 3:
  82. attribute DOMString textContent;
  83. // raises(DOMException) on setting
  84. // raises(DOMException) on retrieval
  85. // Introduced in DOM Level 3:
  86. DOMString lookupPrefix(in DOMString namespaceURI);
  87. // Introduced in DOM Level 3:
  88. boolean isDefaultNamespace(in DOMString namespaceURI);
  89. // Introduced in DOM Level 3:
  90. DOMString lookupNamespaceURI(in DOMString prefix);
  91. // Introduced in DOM Level 3:
  92. boolean isEqualNode(in nsIDOMNode arg);
  93. // Introduced in DOM Level 3:
  94. nsIVariant setUserData(in DOMString key,
  95. in nsIVariant data);
  96. // Introduced in DOM Level 3:
  97. nsIVariant getUserData(in DOMString key);
  98. boolean contains(in nsIDOMNode aOther);
  99. };