Node.idl 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. attribute DOMString textContent;
  16. Node appendChild(Node node);
  17. [ImplementedAs=pre_insert] Node insertBefore(Node node, Node? child);
  18. Node replaceChild(Node node, Node child);
  19. [ImplementedAs=pre_remove] Node removeChild(Node child);
  20. [ImplementedAs=clone_node_binding] Node cloneNode(optional boolean deep = false);
  21. boolean contains(Node? other);
  22. const unsigned short ELEMENT_NODE = 1;
  23. const unsigned short ATTRIBUTE_NODE = 2;
  24. const unsigned short TEXT_NODE = 3;
  25. const unsigned short CDATA_SECTION_NODE = 4;
  26. const unsigned short ENTITY_REFERENCE_NODE = 5;
  27. const unsigned short ENTITY_NODE = 6;
  28. const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
  29. const unsigned short COMMENT_NODE = 8;
  30. const unsigned short DOCUMENT_NODE = 9;
  31. const unsigned short DOCUMENT_TYPE_NODE = 10;
  32. const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
  33. const unsigned short NOTATION_NODE = 12;
  34. unsigned short compareDocumentPosition(Node? otherNode);
  35. // Node.compareDocumentPosition() constants
  36. const unsigned short DOCUMENT_POSITION_DISCONNECTED = 1;
  37. const unsigned short DOCUMENT_POSITION_PRECEDING = 2;
  38. const unsigned short DOCUMENT_POSITION_FOLLOWING = 4;
  39. const unsigned short DOCUMENT_POSITION_CONTAINS = 8;
  40. const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 16;
  41. const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32;
  42. };