Node.idl 2.6 KB

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