Window.idl 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #import <DOM/Document.idl>
  2. #import <DOM/EventHandler.idl>
  3. #import <DOM/EventTarget.idl>
  4. #import <HTML/Navigator.idl>
  5. // https://html.spec.whatwg.org/multipage/nav-history-apis.html#window
  6. [Global=Window, Exposed=Window, LegacyUnenumerableNamedProperties, UseNewAKString]
  7. interface Window : EventTarget {
  8. // the current browsing context
  9. [LegacyUnforgeable] readonly attribute WindowProxy window;
  10. [Replaceable] readonly attribute WindowProxy self;
  11. [LegacyUnforgeable] readonly attribute Document document;
  12. attribute DOMString name;
  13. [PutForwards=href, LegacyUnforgeable] readonly attribute Location location;
  14. readonly attribute History history;
  15. // other browsing contexts
  16. [Replaceable] readonly attribute WindowProxy frames;
  17. [Replaceable] readonly attribute unsigned long length;
  18. [LegacyUnforgeable] readonly attribute WindowProxy? top;
  19. [Replaceable] readonly attribute WindowProxy? parent;
  20. readonly attribute Element? frameElement;
  21. WindowProxy? open(optional USVString url = "", optional DOMString target = "_blank", optional [LegacyNullToEmptyString] DOMString features = "");
  22. // the user agent
  23. readonly attribute Navigator navigator;
  24. [ImplementedAs=navigator] readonly attribute Navigator clientInformation; // legacy alias of .navigator
  25. // user prompts
  26. undefined alert();
  27. undefined alert(DOMString message);
  28. boolean confirm(optional DOMString message = "");
  29. DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
  30. undefined postMessage(any message, USVString targetOrigin);
  31. // FIXME: undefined postMessage(any message, USVString targetOrigin, optional sequence<object> transfer = []);
  32. // FIXME: undefined postMessage(any message, optional WindowPostMessageOptions options = {});
  33. // FIXME: Replace these with 'Window includes WindowOrWorkerGlobalScope;' once we have feature parity
  34. [Replaceable] readonly attribute USVString origin;
  35. readonly attribute boolean isSecureContext;
  36. DOMString btoa(DOMString data);
  37. ByteString atob(DOMString data);
  38. };
  39. Window includes GlobalEventHandlers;
  40. Window includes WindowEventHandlers;