Window.idl 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #import <Crypto/Crypto.idl>
  2. #import <CSS/MediaQueryList.idl>
  3. #import <DOM/Document.idl>
  4. #import <DOM/EventHandler.idl>
  5. #import <DOM/EventTarget.idl>
  6. #import <HighResolutionTime/Performance.idl>
  7. #import <HTML/Navigator.idl>
  8. #import <HTML/WindowOrWorkerGlobalScope.idl>
  9. // https://html.spec.whatwg.org/multipage/nav-history-apis.html#window
  10. [Global=Window, Exposed=Window, LegacyUnenumerableNamedProperties, UseNewAKString]
  11. interface Window : EventTarget {
  12. // the current browsing context
  13. [LegacyUnforgeable] readonly attribute WindowProxy window;
  14. [Replaceable] readonly attribute WindowProxy self;
  15. [LegacyUnforgeable] readonly attribute Document document;
  16. attribute DOMString name;
  17. [PutForwards=href, LegacyUnforgeable] readonly attribute Location location;
  18. readonly attribute History history;
  19. // other browsing contexts
  20. [Replaceable] readonly attribute WindowProxy frames;
  21. [Replaceable] readonly attribute unsigned long length;
  22. [LegacyUnforgeable] readonly attribute WindowProxy? top;
  23. [Replaceable] readonly attribute WindowProxy? parent;
  24. readonly attribute Element? frameElement;
  25. WindowProxy? open(optional USVString url = "", optional DOMString target = "_blank", optional [LegacyNullToEmptyString] DOMString features = "");
  26. // the user agent
  27. readonly attribute Navigator navigator;
  28. [ImplementedAs=navigator] readonly attribute Navigator clientInformation; // legacy alias of .navigator
  29. // user prompts
  30. undefined alert();
  31. undefined alert(DOMString message);
  32. boolean confirm(optional DOMString message = "");
  33. DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
  34. undefined postMessage(any message, USVString targetOrigin);
  35. // FIXME: undefined postMessage(any message, USVString targetOrigin, optional sequence<object> transfer = []);
  36. // FIXME: undefined postMessage(any message, optional WindowPostMessageOptions options = {});
  37. // https://dom.spec.whatwg.org/#interface-window-extensions
  38. [Replaceable] readonly attribute (Event or undefined) event; // legacy
  39. // https://w3c.github.io/csswg-drafts/cssom-view/#extensions-to-the-window-interface
  40. [NewObject] MediaQueryList matchMedia(CSSOMString query);
  41. // FIXME: Everything from here on should be shared through WindowOrWorkerGlobalScope
  42. // https://w3c.github.io/hr-time/#the-performance-attribute
  43. [Replaceable] readonly attribute Performance performance;
  44. // https://w3c.github.io/webcrypto/#crypto-interface
  45. [SameObject] readonly attribute Crypto crypto;
  46. };
  47. Window includes GlobalEventHandlers;
  48. Window includes WindowEventHandlers;
  49. Window includes WindowOrWorkerGlobalScope;