Node.idl 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #import <DOM/Document.idl>
  2. #import <DOM/Element.idl>
  3. #import <DOM/EventTarget.idl>
  4. interface Node : EventTarget {
  5. readonly attribute unsigned short nodeType;
  6. readonly attribute DOMString nodeName;
  7. readonly attribute USVString baseURI;
  8. boolean hasChildNodes();
  9. [SameObject] readonly attribute NodeList childNodes;
  10. readonly attribute Node? firstChild;
  11. readonly attribute Node? lastChild;
  12. readonly attribute Node? previousSibling;
  13. readonly attribute Node? nextSibling;
  14. readonly attribute Node? parentNode;
  15. readonly attribute Element? parentElement;
  16. readonly attribute boolean isConnected;
  17. readonly attribute Document? ownerDocument;
  18. Node getRootNode(optional GetRootNodeOptions options = {});
  19. [CEReactions] attribute DOMString? nodeValue;
  20. // FIXME: [LegacyNullToEmptyString] is not allowed on nullable types as per the Web IDL spec.
  21. // However, we only apply it to setters, so this works as a stop gap.
  22. // Replace this with something like a special cased [LegacyNullToEmptyString].
  23. [LegacyNullToEmptyString] attribute DOMString? textContent;
  24. Node appendChild(Node node);
  25. [ImplementedAs=pre_insert] Node insertBefore(Node node, Node? child);
  26. Node replaceChild(Node node, Node child);
  27. [ImplementedAs=pre_remove] Node removeChild(Node child);
  28. [ImplementedAs=clone_node_binding] Node cloneNode(optional boolean deep = false);
  29. boolean contains(Node? other);
  30. boolean isEqualNode(Node? otherNode);
  31. boolean isSameNode(Node? otherNode);
  32. const unsigned short ELEMENT_NODE = 1;
  33. const unsigned short ATTRIBUTE_NODE = 2;
  34. const unsigned short TEXT_NODE = 3;
  35. const unsigned short CDATA_SECTION_NODE = 4;
  36. const unsigned short ENTITY_REFERENCE_NODE = 5;
  37. const unsigned short ENTITY_NODE = 6;
  38. const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
  39. const unsigned short COMMENT_NODE = 8;
  40. const unsigned short DOCUMENT_NODE = 9;
  41. const unsigned short DOCUMENT_TYPE_NODE = 10;
  42. const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
  43. const unsigned short NOTATION_NODE = 12;
  44. unsigned short compareDocumentPosition(Node? otherNode);
  45. // Node.compareDocumentPosition() constants
  46. const unsigned short DOCUMENT_POSITION_DISCONNECTED = 1;
  47. const unsigned short DOCUMENT_POSITION_PRECEDING = 2;
  48. const unsigned short DOCUMENT_POSITION_FOLLOWING = 4;
  49. const unsigned short DOCUMENT_POSITION_CONTAINS = 8;
  50. const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 16;
  51. const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32;
  52. };
  53. dictionary GetRootNodeOptions {
  54. boolean composed = false;
  55. };