ladybird/Libraries/LibWeb/HTML/Window.idl

126 lines
5.6 KiB
Text
Raw Permalink Normal View History

// https://html.spec.whatwg.org/multipage/nav-history-apis.html#window
[Global=Window, Exposed=Window, LegacyUnenumerableNamedProperties]
interface Window : EventTarget {
2023-03-05 15:36:43 -03:00
// the current browsing context
[LegacyUnforgeable] readonly attribute WindowProxy window;
2023-03-05 15:38:29 -03:00
[Replaceable] readonly attribute WindowProxy self;
[LegacyUnforgeable] readonly attribute Document document;
2023-03-05 16:02:16 -03:00
attribute DOMString name;
2023-12-04 15:52:04 -03:00
attribute DOMString status;
undefined close();
readonly attribute boolean closed;
[PutForwards=href, LegacyUnforgeable] readonly attribute Location location;
readonly attribute History history;
2023-08-23 13:58:09 -03:00
readonly attribute Navigation navigation;
readonly attribute CustomElementRegistry customElements;
undefined stop();
undefined focus();
undefined blur();
2023-03-05 15:36:43 -03:00
[Replaceable] readonly attribute BarProp locationbar;
[Replaceable] readonly attribute BarProp menubar;
[Replaceable] readonly attribute BarProp personalbar;
[Replaceable] readonly attribute BarProp scrollbars;
[Replaceable] readonly attribute BarProp statusbar;
[Replaceable] readonly attribute BarProp toolbar;
2023-03-05 15:48:45 -03:00
// other browsing contexts
[Replaceable] readonly attribute WindowProxy frames;
2023-03-05 17:37:41 -03:00
[Replaceable] readonly attribute unsigned long length;
2023-03-05 17:43:53 -03:00
[LegacyUnforgeable] readonly attribute WindowProxy? top;
attribute any opener;
2023-03-05 18:01:54 -03:00
[Replaceable] readonly attribute WindowProxy? parent;
readonly attribute Element? frameElement;
2023-03-05 18:56:26 -03:00
WindowProxy? open(optional USVString url = "", optional DOMString target = "_blank", optional [LegacyNullToEmptyString] DOMString features = "");
2023-03-05 15:48:45 -03:00
// Since this is the global object, the IDL named getter adds a NamedPropertiesObject exotic
// object on the prototype chain. Indeed, this does not make the global object an exotic object.
// Indexed access is taken care of by the WindowProxy exotic object.
getter object (DOMString name);
// the user agent
readonly attribute Navigator navigator;
[Replaceable, ImplementedAs=navigator] readonly attribute Navigator clientInformation; // legacy alias of .navigator
// user prompts
undefined alert();
undefined alert(DOMString message);
boolean confirm(optional DOMString message = "");
DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
undefined postMessage(any message, USVString targetOrigin, optional sequence<object> transfer = []);
undefined postMessage(any message, optional WindowPostMessageOptions options = {});
2023-03-06 16:50:29 -03:00
// https://dom.spec.whatwg.org/#interface-window-extensions
[Replaceable] readonly attribute (Event or undefined) event; // legacy
// https://drafts.csswg.org/cssom/#extensions-to-the-window-interface
[NewObject] CSSStyleProperties getComputedStyle(Element elt, optional CSSOMString? pseudoElt);
// https://w3c.github.io/csswg-drafts/cssom-view/#extensions-to-the-window-interface
[NewObject] MediaQueryList matchMedia(CSSOMString query);
2023-03-06 16:51:16 -03:00
[SameObject, Replaceable] readonly attribute Screen screen;
[SameObject, Replaceable] readonly attribute VisualViewport? visualViewport;
undefined moveTo(long x, long y);
undefined moveBy(long x, long y);
undefined resizeTo(long x, long y);
undefined resizeBy(long x, long y);
// viewport
[Replaceable] readonly attribute long innerWidth;
[Replaceable] readonly attribute long innerHeight;
// viewport scrolling
[Replaceable] readonly attribute double scrollX;
[Replaceable, ImplementedAs=scroll_x] readonly attribute double pageXOffset;
[Replaceable] readonly attribute double scrollY;
[Replaceable, ImplementedAs=scroll_y] readonly attribute double pageYOffset;
Promise<undefined> scroll(optional ScrollToOptions options = {});
Promise<undefined> scroll(unrestricted double x, unrestricted double y);
[ImplementedAs=scroll] Promise<undefined> scrollTo(optional ScrollToOptions options = {});
[ImplementedAs=scroll] Promise<undefined> scrollTo(unrestricted double x, unrestricted double y);
Promise<undefined> scrollBy(optional ScrollToOptions options = {});
Promise<undefined> scrollBy(unrestricted double x, unrestricted double y);
// client
[Replaceable] readonly attribute long screenX;
[Replaceable, ImplementedAs=screen_x] readonly attribute long screenLeft;
[Replaceable] readonly attribute long screenY;
[Replaceable, ImplementedAs=screen_y] readonly attribute long screenTop;
[Replaceable] readonly attribute long outerWidth;
[Replaceable] readonly attribute long outerHeight;
[Replaceable] readonly attribute double devicePixelRatio;
// https://w3c.github.io/requestidlecallback/#window_extensions
unsigned long requestIdleCallback(IdleRequestCallback callback, optional IdleRequestOptions options = {});
undefined cancelIdleCallback(unsigned long handle);
// https://w3c.github.io/selection-api/#extensions-to-window-interface
Selection? getSelection();
// This function is non-standard.
boolean find(optional DOMString string = "");
};
Window includes AnimationFrameProvider;
Window includes GlobalEventHandlers;
Window includes UniversalGlobalScope;
Window includes WindowEventHandlers;
Window includes WindowLocalStorage;
Window includes WindowSessionStorage;
Window includes WindowOrWorkerGlobalScope;
enum ScrollBehavior { "auto", "instant", "smooth" };
dictionary ScrollOptions {
ScrollBehavior behavior = "auto";
};
dictionary ScrollToOptions : ScrollOptions {
unrestricted double left;
unrestricted double top;
};
dictionary WindowPostMessageOptions : StructuredSerializeOptions {
USVString targetOrigin = "/";
};