mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 02:32:45 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			115 lines
		
	
	
	
		
			5.2 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			115 lines
		
	
	
	
		
			5.2 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| #import <Crypto/Crypto.idl>
 | |
| #import <CSS/MediaQueryList.idl>
 | |
| #import <CSS/Screen.idl>
 | |
| #import <DOM/Document.idl>
 | |
| #import <DOM/EventHandler.idl>
 | |
| #import <DOM/EventTarget.idl>
 | |
| #import <HighResolutionTime/Performance.idl>
 | |
| #import <HTML/AnimationFrameProvider.idl>
 | |
| #import <HTML/CustomElements/CustomElementRegistry.idl>
 | |
| #import <HTML/Navigator.idl>
 | |
| #import <HTML/WindowLocalStorage.idl>
 | |
| #import <HTML/WindowOrWorkerGlobalScope.idl>
 | |
| #import <HTML/WindowSessionStorage.idl>
 | |
| #import <RequestIdleCallback/IdleRequest.idl>
 | |
| 
 | |
| // https://html.spec.whatwg.org/multipage/nav-history-apis.html#window
 | |
| [Global=Window, Exposed=Window, LegacyUnenumerableNamedProperties, UseNewAKString]
 | |
| interface Window : EventTarget {
 | |
|     // the current browsing context
 | |
|     [LegacyUnforgeable] readonly attribute WindowProxy window;
 | |
|     [Replaceable] readonly attribute WindowProxy self;
 | |
|     [LegacyUnforgeable] readonly attribute Document document;
 | |
|     attribute DOMString name;
 | |
|     [PutForwards=href, LegacyUnforgeable] readonly attribute Location location;
 | |
|     readonly attribute History history;
 | |
|     readonly attribute CustomElementRegistry customElements;
 | |
|     undefined focus();
 | |
| 
 | |
|     // other browsing contexts
 | |
|     [Replaceable] readonly attribute WindowProxy frames;
 | |
|     [Replaceable] readonly attribute unsigned long length;
 | |
|     [LegacyUnforgeable] readonly attribute WindowProxy? top;
 | |
|     [Replaceable] readonly attribute WindowProxy? parent;
 | |
|     readonly attribute Element? frameElement;
 | |
|     WindowProxy? open(optional USVString url = "", optional DOMString target = "_blank", optional [LegacyNullToEmptyString] DOMString features = "");
 | |
| 
 | |
|     // the user agent
 | |
|     readonly attribute Navigator navigator;
 | |
|     [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);
 | |
|     // FIXME: undefined postMessage(any message, USVString targetOrigin, optional sequence<object> transfer = []);
 | |
|     // FIXME: undefined postMessage(any message, optional WindowPostMessageOptions options = {});
 | |
| 
 | |
|     // https://dom.spec.whatwg.org/#interface-window-extensions
 | |
|     [Replaceable] readonly attribute (Event or undefined) event; // legacy
 | |
| 
 | |
|     // https://w3c.github.io/csswg-drafts/cssom/#extensions-to-the-window-interface
 | |
|     [NewObject] CSSStyleDeclaration getComputedStyle(Element elt, optional CSSOMString? pseudoElt);
 | |
| 
 | |
|     // https://w3c.github.io/csswg-drafts/cssom-view/#extensions-to-the-window-interface
 | |
|     [NewObject] MediaQueryList matchMedia(CSSOMString query);
 | |
|     [SameObject, Replaceable] readonly attribute Screen screen;
 | |
| 
 | |
|     // 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;
 | |
|     undefined scroll(optional ScrollToOptions options = {});
 | |
|     undefined scroll(unrestricted double x, unrestricted double y);
 | |
|     [ImplementedAs=scroll] undefined scrollTo(optional ScrollToOptions options = {});
 | |
|     [ImplementedAs=scroll] undefined scrollTo(unrestricted double x, unrestricted double y);
 | |
|     undefined scrollBy(optional ScrollToOptions options = {});
 | |
|     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();
 | |
| 
 | |
|     // FIXME: Everything from here on should be shared through WindowOrWorkerGlobalScope
 | |
|     // https://w3c.github.io/hr-time/#the-performance-attribute
 | |
|     [Replaceable] readonly attribute Performance performance;
 | |
| 
 | |
|     // https://w3c.github.io/webcrypto/#crypto-interface
 | |
|     [SameObject] readonly attribute Crypto crypto;
 | |
| };
 | |
| Window includes AnimationFrameProvider;
 | |
| Window includes GlobalEventHandlers;
 | |
| 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;
 | |
| };
 | 
