Document.idl 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. #import <Animations/DocumentTimeline.idl>
  2. #import <CSS/FontFaceSet.idl>
  3. #import <CSS/StyleSheetList.idl>
  4. #import <DOM/CDATASection.idl>
  5. #import <DOM/Comment.idl>
  6. #import <DOM/DOMImplementation.idl>
  7. #import <DOM/DocumentFragment.idl>
  8. #import <DOM/DocumentOrShadowRoot.idl>
  9. #import <DOM/DocumentType.idl>
  10. #import <DOM/Element.idl>
  11. #import <DOM/Event.idl>
  12. #import <DOM/EventHandler.idl>
  13. #import <DOM/HTMLCollection.idl>
  14. #import <DOM/Node.idl>
  15. #import <DOM/NodeFilter.idl>
  16. #import <DOM/NodeIterator.idl>
  17. #import <DOM/NodeList.idl>
  18. #import <DOM/ParentNode.idl>
  19. #import <DOM/ProcessingInstruction.idl>
  20. #import <DOM/Range.idl>
  21. #import <DOM/Text.idl>
  22. #import <DOM/TreeWalker.idl>
  23. #import <HTML/HTMLAllCollection.idl>
  24. #import <HTML/HTMLElement.idl>
  25. #import <HTML/HTMLHeadElement.idl>
  26. #import <HTML/HTMLScriptElement.idl>
  27. #import <HTML/Location.idl>
  28. #import <Selection/Selection.idl>
  29. // https://dom.spec.whatwg.org/#document
  30. // https://html.spec.whatwg.org/multipage/dom.html#the-document-object
  31. [Exposed=Window, LegacyOverrideBuiltins]
  32. interface Document : Node {
  33. constructor();
  34. boolean hasFocus();
  35. [PutForwards=href, LegacyUnforgeable] readonly attribute Location? location;
  36. attribute USVString domain;
  37. readonly attribute DOMImplementation implementation;
  38. [ImplementedAs=url_string] readonly attribute USVString URL;
  39. readonly attribute USVString documentURI;
  40. readonly attribute DOMString characterSet;
  41. readonly attribute DOMString charset;
  42. readonly attribute DOMString inputEncoding;
  43. readonly attribute DOMString contentType;
  44. readonly attribute WindowProxy? defaultView;
  45. [CEReactions] Document open(optional DOMString unused1, optional DOMString unused2);
  46. WindowProxy? open(USVString url, DOMString name, DOMString features);
  47. [CEReactions] undefined close();
  48. [CEReactions] undefined write(DOMString... text);
  49. [CEReactions] undefined writeln(DOMString... text);
  50. // FIXME: static Document parseHTMLUnsafe((TrustedHTML or DOMString) html);
  51. static Document parseHTMLUnsafe(DOMString html);
  52. attribute DOMString cookie;
  53. // https://html.spec.whatwg.org/#Document-partial
  54. [CEReactions, LegacyNullToEmptyString] attribute DOMString fgColor;
  55. [CEReactions, LegacyNullToEmptyString] attribute DOMString linkColor;
  56. [CEReactions, LegacyNullToEmptyString] attribute DOMString vlinkColor;
  57. [CEReactions, LegacyNullToEmptyString] attribute DOMString alinkColor;
  58. [CEReactions, LegacyNullToEmptyString] attribute DOMString bgColor;
  59. readonly attribute USVString referrer;
  60. readonly attribute Element? activeElement;
  61. Element? getElementById(DOMString id);
  62. NodeList getElementsByName([FlyString] DOMString name);
  63. HTMLCollection getElementsByTagName([FlyString] DOMString tagName);
  64. HTMLCollection getElementsByTagNameNS([FlyString] DOMString? namespace, [FlyString] DOMString localName);
  65. HTMLCollection getElementsByClassName(DOMString className);
  66. [SameObject] readonly attribute HTMLCollection applets;
  67. [SameObject] readonly attribute HTMLCollection anchors;
  68. [SameObject] readonly attribute HTMLCollection images;
  69. [SameObject] readonly attribute HTMLCollection embeds;
  70. [SameObject] readonly attribute HTMLCollection plugins;
  71. [SameObject] readonly attribute HTMLCollection links;
  72. [SameObject] readonly attribute HTMLCollection forms;
  73. [SameObject] readonly attribute HTMLCollection scripts;
  74. readonly attribute HTMLAllCollection all;
  75. undefined clear();
  76. undefined captureEvents();
  77. undefined releaseEvents();
  78. [CEReactions, NewObject] Element createElement(DOMString tagName, optional (DOMString or ElementCreationOptions) options = {});
  79. [CEReactions, NewObject] Element createElementNS([FlyString] DOMString? namespace, DOMString qualifiedName, optional (DOMString or ElementCreationOptions) options = {});
  80. DocumentFragment createDocumentFragment();
  81. Text createTextNode(DOMString data);
  82. [NewObject] CDATASection createCDATASection(DOMString data);
  83. Comment createComment(DOMString data);
  84. [NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
  85. [NewObject] Attr createAttribute(DOMString localName);
  86. [NewObject] Attr createAttributeNS([FlyString] DOMString? namespace, DOMString qualifiedName);
  87. Range createRange();
  88. Event createEvent(DOMString interface);
  89. [CEReactions, NewObject] Node importNode(Node node, optional boolean deep = false);
  90. [CEReactions, ImplementedAs=adopt_node_binding] Node adoptNode(Node node);
  91. readonly attribute DOMString compatMode;
  92. readonly attribute DocumentType? doctype;
  93. readonly attribute Element? documentElement;
  94. [CEReactions] attribute DOMString dir;
  95. [CEReactions] attribute HTMLElement? body;
  96. readonly attribute HTMLHeadElement? head;
  97. readonly attribute HTMLScriptElement? currentScript;
  98. readonly attribute DOMString lastModified;
  99. readonly attribute DOMString readyState;
  100. [CEReactions] attribute DOMString title;
  101. readonly attribute boolean hidden;
  102. readonly attribute DOMString visibilityState;
  103. [NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
  104. [NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
  105. Selection? getSelection();
  106. [CEReactions] attribute DOMString designMode;
  107. // https://www.w3.org/TR/web-animations-1/#extensions-to-the-document-interface
  108. readonly attribute DocumentTimeline timeline;
  109. // https://drafts.csswg.org/cssom-view/#extensions-to-the-document-interface
  110. Element? elementFromPoint(double x, double y);
  111. sequence<Element> elementsFromPoint(double x, double y);
  112. readonly attribute Element? scrollingElement;
  113. // https://w3c.github.io/editing/docs/execCommand/
  114. [CEReactions] boolean execCommand(DOMString commandId, optional boolean showUI = false, optional DOMString value = "");
  115. boolean queryCommandEnabled(DOMString commandId);
  116. boolean queryCommandIndeterm(DOMString commandId);
  117. boolean queryCommandState(DOMString commandId);
  118. boolean queryCommandSupported(DOMString commandId);
  119. DOMString queryCommandValue(DOMString commandId);
  120. // special event handler IDL attributes that only apply to Document objects
  121. [LegacyLenientThis] attribute EventHandler onreadystatechange;
  122. attribute EventHandler onvisibilitychange;
  123. };
  124. dictionary ElementCreationOptions {
  125. DOMString is;
  126. };
  127. Document includes ParentNode;
  128. Document includes GlobalEventHandlers;
  129. Document includes DocumentOrShadowRoot;
  130. Document includes FontFaceSource;