Node.idl 2.3 KB

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