Document.idl 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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/Range.idl>
  16. #import <DOM/Text.idl>
  17. #import <DOM/TreeWalker.idl>
  18. #import <HTML/HTMLElement.idl>
  19. #import <HTML/HTMLHeadElement.idl>
  20. #import <HTML/HTMLScriptElement.idl>
  21. // https://dom.spec.whatwg.org/#document
  22. interface Document : Node {
  23. constructor();
  24. boolean hasFocus();
  25. // FIXME: These attributes currently don't do anything.
  26. [PutForwards=href, LegacyUnforgeable] readonly attribute Location? location;
  27. attribute USVString domain;
  28. readonly attribute DOMImplementation implementation;
  29. [ImplementedAs=url_string] readonly attribute USVString URL;
  30. readonly attribute USVString documentURI;
  31. readonly attribute DOMString characterSet;
  32. readonly attribute DOMString charset;
  33. readonly attribute DOMString inputEncoding;
  34. readonly attribute DOMString contentType;
  35. readonly attribute Window? defaultView;
  36. [CEReactions] Document open(optional DOMString unused1, optional DOMString unused2);
  37. // FIXME: implement ExceptionOr<HTML::Window> Document::open(...)
  38. // WindowProxy? open(USVString url, DOMString name, DOMString features);
  39. [CEReactions] undefined close();
  40. [CEReactions] undefined write(DOMString... text);
  41. [CEReactions] undefined writeln(DOMString... text);
  42. attribute DOMString cookie;
  43. readonly attribute USVString referrer;
  44. readonly attribute Element? activeElement;
  45. Element? getElementById(DOMString id);
  46. HTMLCollection getElementsByName(DOMString name);
  47. HTMLCollection getElementsByTagName(DOMString tagName);
  48. HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
  49. HTMLCollection getElementsByClassName(DOMString className);
  50. readonly attribute HTMLCollection applets;
  51. readonly attribute HTMLCollection anchors;
  52. readonly attribute HTMLCollection images;
  53. readonly attribute HTMLCollection embeds;
  54. readonly attribute HTMLCollection plugins;
  55. readonly attribute HTMLCollection links;
  56. readonly attribute HTMLCollection forms;
  57. readonly attribute HTMLCollection scripts;
  58. // FIXME: Should return an HTMLAllCollection
  59. readonly attribute HTMLCollection all;
  60. Element createElement(DOMString tagName);
  61. Element createElementNS(DOMString? namespace, DOMString qualifiedName);
  62. DocumentFragment createDocumentFragment();
  63. Text createTextNode(DOMString data);
  64. Comment createComment(DOMString data);
  65. Range createRange();
  66. Event createEvent(DOMString interface);
  67. [CEReactions, NewObject] Node importNode(Node node, optional boolean deep = false);
  68. [CEReactions, ImplementedAs=adopt_node_binding] Node adoptNode(Node node);
  69. [ImplementedAs=style_sheets_for_bindings] readonly attribute StyleSheetList styleSheets;
  70. readonly attribute DOMString compatMode;
  71. readonly attribute DocumentType? doctype;
  72. readonly attribute Element? documentElement;
  73. attribute HTMLElement? body;
  74. readonly attribute HTMLHeadElement? head;
  75. readonly attribute HTMLScriptElement? currentScript;
  76. readonly attribute DOMString readyState;
  77. attribute DOMString title;
  78. readonly boolean hidden;
  79. readonly DOMString visibilityState;
  80. [NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
  81. [NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
  82. };
  83. Document includes ParentNode;
  84. Document includes GlobalEventHandlers;