cssom-view.idl (7322B)
1 // GENERATED CONTENT - DO NOT EDIT 2 // Content was automatically extracted by Reffy into webref 3 // (https://github.com/w3c/webref) 4 // Source: CSSOM View Module Level 1 (https://drafts.csswg.org/cssom-view-1/) 5 6 enum ScrollBehavior { "auto", "instant", "smooth" }; 7 8 dictionary ScrollOptions { 9 ScrollBehavior behavior = "auto"; 10 }; 11 dictionary ScrollToOptions : ScrollOptions { 12 unrestricted double left; 13 unrestricted double top; 14 }; 15 16 partial interface Window { 17 [NewObject] MediaQueryList matchMedia(CSSOMString query); 18 [SameObject, Replaceable] readonly attribute Screen screen; 19 [SameObject, Replaceable] readonly attribute VisualViewport? visualViewport; 20 21 // browsing context 22 undefined moveTo(long x, long y); 23 undefined moveBy(long x, long y); 24 undefined resizeTo(long width, long height); 25 undefined resizeBy(long x, long y); 26 27 // viewport 28 [Replaceable] readonly attribute long innerWidth; 29 [Replaceable] readonly attribute long innerHeight; 30 31 // viewport scrolling 32 [Replaceable] readonly attribute double scrollX; 33 [Replaceable] readonly attribute double pageXOffset; 34 [Replaceable] readonly attribute double scrollY; 35 [Replaceable] readonly attribute double pageYOffset; 36 Promise<undefined> scroll(optional ScrollToOptions options = {}); 37 Promise<undefined> scroll(unrestricted double x, unrestricted double y); 38 Promise<undefined> scrollTo(optional ScrollToOptions options = {}); 39 Promise<undefined> scrollTo(unrestricted double x, unrestricted double y); 40 Promise<undefined> scrollBy(optional ScrollToOptions options = {}); 41 Promise<undefined> scrollBy(unrestricted double x, unrestricted double y); 42 43 // client 44 [Replaceable] readonly attribute long screenX; 45 [Replaceable] readonly attribute long screenLeft; 46 [Replaceable] readonly attribute long screenY; 47 [Replaceable] readonly attribute long screenTop; 48 [Replaceable] readonly attribute long outerWidth; 49 [Replaceable] readonly attribute long outerHeight; 50 [Replaceable] readonly attribute double devicePixelRatio; 51 }; 52 53 [Exposed=Window] 54 interface MediaQueryList : EventTarget { 55 readonly attribute CSSOMString media; 56 readonly attribute boolean matches; 57 undefined addListener(EventListener? callback); 58 undefined removeListener(EventListener? callback); 59 attribute EventHandler onchange; 60 }; 61 62 [Exposed=Window] 63 interface MediaQueryListEvent : Event { 64 constructor(CSSOMString type, optional MediaQueryListEventInit eventInitDict = {}); 65 readonly attribute CSSOMString media; 66 readonly attribute boolean matches; 67 }; 68 69 dictionary MediaQueryListEventInit : EventInit { 70 CSSOMString media = ""; 71 boolean matches = false; 72 }; 73 74 [Exposed=Window] 75 interface Screen { 76 readonly attribute long availWidth; 77 readonly attribute long availHeight; 78 readonly attribute long width; 79 readonly attribute long height; 80 readonly attribute unsigned long colorDepth; 81 readonly attribute unsigned long pixelDepth; 82 }; 83 84 partial interface Document { 85 Element? elementFromPoint(double x, double y); 86 sequence<Element> elementsFromPoint(double x, double y); 87 CaretPosition? caretPositionFromPoint(double x, double y, optional CaretPositionFromPointOptions options = {}); 88 readonly attribute Element? scrollingElement; 89 }; 90 91 dictionary CaretPositionFromPointOptions { 92 sequence<ShadowRoot> shadowRoots = []; 93 }; 94 95 [Exposed=Window] 96 interface CaretPosition { 97 readonly attribute Node offsetNode; 98 readonly attribute unsigned long offset; 99 [NewObject] DOMRect? getClientRect(); 100 }; 101 102 enum ScrollLogicalPosition { "start", "center", "end", "nearest" }; 103 dictionary ScrollIntoViewOptions : ScrollOptions { 104 ScrollLogicalPosition block = "start"; 105 ScrollLogicalPosition inline = "nearest"; 106 ScrollIntoViewContainer container = "all"; 107 }; 108 109 enum ScrollIntoViewContainer { "all", "nearest" }; 110 111 dictionary CheckVisibilityOptions { 112 boolean checkOpacity = false; 113 boolean checkVisibilityCSS = false; 114 boolean contentVisibilityAuto = false; 115 boolean opacityProperty = false; 116 boolean visibilityProperty = false; 117 }; 118 119 partial interface Element { 120 DOMRectList getClientRects(); 121 [NewObject] DOMRect getBoundingClientRect(); 122 123 boolean checkVisibility(optional CheckVisibilityOptions options = {}); 124 125 Promise<undefined> scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg = {}); 126 Promise<undefined> scroll(optional ScrollToOptions options = {}); 127 Promise<undefined> scroll(unrestricted double x, unrestricted double y); 128 Promise<undefined> scrollTo(optional ScrollToOptions options = {}); 129 Promise<undefined> scrollTo(unrestricted double x, unrestricted double y); 130 Promise<undefined> scrollBy(optional ScrollToOptions options = {}); 131 Promise<undefined> scrollBy(unrestricted double x, unrestricted double y); 132 attribute unrestricted double scrollTop; 133 attribute unrestricted double scrollLeft; 134 readonly attribute long scrollWidth; 135 readonly attribute long scrollHeight; 136 readonly attribute long clientTop; 137 readonly attribute long clientLeft; 138 readonly attribute long clientWidth; 139 readonly attribute long clientHeight; 140 readonly attribute double currentCSSZoom; 141 }; 142 143 partial interface HTMLElement { 144 readonly attribute Element? scrollParent; 145 readonly attribute Element? offsetParent; 146 readonly attribute long offsetTop; 147 readonly attribute long offsetLeft; 148 readonly attribute long offsetWidth; 149 readonly attribute long offsetHeight; 150 }; 151 152 partial interface HTMLImageElement { 153 readonly attribute long x; 154 readonly attribute long y; 155 }; 156 157 partial interface Range { 158 DOMRectList getClientRects(); 159 [NewObject] DOMRect getBoundingClientRect(); 160 }; 161 162 partial interface MouseEvent { 163 readonly attribute double pageX; 164 readonly attribute double pageY; 165 readonly attribute double x; 166 readonly attribute double y; 167 readonly attribute double offsetX; 168 readonly attribute double offsetY; 169 }; 170 171 enum CSSBoxType { "margin", "border", "padding", "content" }; 172 dictionary BoxQuadOptions { 173 CSSBoxType box = "border"; 174 GeometryNode relativeTo; // XXX default document (i.e. viewport) 175 }; 176 177 dictionary ConvertCoordinateOptions { 178 CSSBoxType fromBox = "border"; 179 CSSBoxType toBox = "border"; 180 }; 181 182 interface mixin GeometryUtils { 183 sequence<DOMQuad> getBoxQuads(optional BoxQuadOptions options = {}); 184 DOMQuad convertQuadFromNode(DOMQuadInit quad, GeometryNode from, optional ConvertCoordinateOptions options = {}); 185 DOMQuad convertRectFromNode(DOMRectReadOnly rect, GeometryNode from, optional ConvertCoordinateOptions options = {}); 186 DOMPoint convertPointFromNode(DOMPointInit point, GeometryNode from, optional ConvertCoordinateOptions options = {}); // XXX z,w turns into 0 187 }; 188 189 Text includes GeometryUtils; // like Range 190 Element includes GeometryUtils; 191 CSSPseudoElement includes GeometryUtils; 192 Document includes GeometryUtils; 193 194 typedef (Text or Element or CSSPseudoElement or Document) GeometryNode; 195 196 [Exposed=Window] 197 interface VisualViewport : EventTarget { 198 readonly attribute double offsetLeft; 199 readonly attribute double offsetTop; 200 201 readonly attribute double pageLeft; 202 readonly attribute double pageTop; 203 204 readonly attribute double width; 205 readonly attribute double height; 206 207 readonly attribute double scale; 208 209 attribute EventHandler onresize; 210 attribute EventHandler onscroll; 211 attribute EventHandler onscrollend; 212 };