Document.idl 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. #import <CSS/StyleSheetList.idl>
  2. #import <DOM/Comment.idl>
  3. #import <DOM/DOMImplementation.idl>
  4. #import <DOM/DocumentFragment.idl>
  5. #import <DOM/DocumentType.idl>
  6. #import <DOM/Element.idl>
  7. #import <DOM/Event.idl>
  8. #import <DOM/EventHandler.idl>
  9. #import <DOM/HTMLCollection.idl>
  10. #import <DOM/Node.idl>
  11. #import <DOM/NodeFilter.idl>
  12. #import <DOM/NodeIterator.idl>
  13. #import <DOM/NodeList.idl>
  14. #import <DOM/ParentNode.idl>
  15. #import <DOM/ProcessingInstruction.idl>
  16. #import <DOM/Range.idl>
  17. #import <DOM/Text.idl>
  18. #import <DOM/TreeWalker.idl>
  19. #import <HTML/HTMLElement.idl>
  20. #import <HTML/HTMLHeadElement.idl>
  21. #import <HTML/HTMLScriptElement.idl>
  22. #import <HTML/Location.idl>
  23. #import <Selection/Selection.idl>
  24. // https://dom.spec.whatwg.org/#document
  25. [Exposed=Window]
  26. interface Document : Node {
  27. constructor();
  28. boolean hasFocus();
  29. [PutForwards=href, LegacyUnforgeable] readonly attribute Location? location;
  30. attribute USVString domain;
  31. readonly attribute DOMImplementation implementation;
  32. [ImplementedAs=url_string] readonly attribute USVString URL;
  33. readonly attribute USVString documentURI;
  34. readonly attribute DOMString characterSet;
  35. readonly attribute DOMString charset;
  36. readonly attribute DOMString inputEncoding;
  37. readonly attribute DOMString contentType;
  38. readonly attribute Window? defaultView;
  39. [CEReactions] Document open(optional DOMString unused1, optional DOMString unused2);
  40. WindowProxy? open(USVString url, DOMString name, DOMString features);
  41. [CEReactions] undefined close();
  42. [CEReactions] undefined write(DOMString... text);
  43. [CEReactions] undefined writeln(DOMString... text);
  44. attribute DOMString cookie;
  45. readonly attribute USVString referrer;
  46. readonly attribute Element? activeElement;
  47. Element? getElementById(DOMString id);
  48. HTMLCollection getElementsByName(DOMString name);
  49. HTMLCollection getElementsByTagName(DOMString tagName);
  50. HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
  51. HTMLCollection getElementsByClassName(DOMString className);
  52. [SameObject] readonly attribute HTMLCollection applets;
  53. [SameObject] readonly attribute HTMLCollection anchors;
  54. [SameObject] readonly attribute HTMLCollection images;
  55. [SameObject] readonly attribute HTMLCollection embeds;
  56. [SameObject] readonly attribute HTMLCollection plugins;
  57. [SameObject] readonly attribute HTMLCollection links;
  58. [SameObject] readonly attribute HTMLCollection forms;
  59. [SameObject] readonly attribute HTMLCollection scripts;
  60. // FIXME: Should return an HTMLAllCollection
  61. readonly attribute HTMLCollection all;
  62. [CEReactions, NewObject] Element createElement(DOMString tagName, optional (DOMString or ElementCreationOptions) options = {});
  63. [CEReactions, NewObject] Element createElementNS(DOMString? namespace, DOMString qualifiedName, optional (DOMString or ElementCreationOptions) options = {});
  64. DocumentFragment createDocumentFragment();
  65. Text createTextNode(DOMString data);
  66. Comment createComment(DOMString data);
  67. [NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
  68. [NewObject] Attr createAttribute(DOMString localName);
  69. [NewObject] Attr createAttributeNS(DOMString? namespace, DOMString qualifiedName);
  70. Range createRange();
  71. Event createEvent(DOMString interface);
  72. [CEReactions, NewObject] Node importNode(Node node, optional boolean deep = false);
  73. [CEReactions, ImplementedAs=adopt_node_binding] Node adoptNode(Node node);
  74. [ImplementedAs=style_sheets_for_bindings] readonly attribute StyleSheetList styleSheets;
  75. readonly attribute DOMString compatMode;
  76. readonly attribute DocumentType? doctype;
  77. readonly attribute Element? documentElement;
  78. [CEReactions] attribute HTMLElement? body;
  79. readonly attribute HTMLHeadElement? head;
  80. readonly attribute HTMLScriptElement? currentScript;
  81. readonly attribute DOMString readyState;
  82. [CEReactions] attribute DOMString title;
  83. boolean queryCommandSupported(DOMString commandId);
  84. readonly boolean hidden;
  85. readonly DOMString visibilityState;
  86. [NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
  87. [NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
  88. Selection? getSelection();
  89. };
  90. dictionary ElementCreationOptions {
  91. DOMString is;
  92. };
  93. Document includes ParentNode;
  94. Document includes GlobalEventHandlers;