Victor Porof | 6e09692 | 2022-06-10 13:01:05 +0000 | [diff] [blame] | 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 (https://drafts.csswg.org/cssom-view/) |
| 5 | |
| 6 | enum ScrollBehavior { "auto", "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 | |
| 20 | // browsing context |
| 21 | undefined moveTo(long x, long y); |
| 22 | undefined moveBy(long x, long y); |
| 23 | undefined resizeTo(long width, long height); |
| 24 | undefined resizeBy(long x, long y); |
| 25 | |
| 26 | // viewport |
| 27 | [Replaceable] readonly attribute long innerWidth; |
| 28 | [Replaceable] readonly attribute long innerHeight; |
| 29 | |
| 30 | // viewport scrolling |
| 31 | [Replaceable] readonly attribute double scrollX; |
| 32 | [Replaceable] readonly attribute double pageXOffset; |
| 33 | [Replaceable] readonly attribute double scrollY; |
| 34 | [Replaceable] readonly attribute double pageYOffset; |
| 35 | undefined scroll(optional ScrollToOptions options = {}); |
| 36 | undefined scroll(unrestricted double x, unrestricted double y); |
| 37 | undefined scrollTo(optional ScrollToOptions options = {}); |
| 38 | undefined scrollTo(unrestricted double x, unrestricted double y); |
| 39 | undefined scrollBy(optional ScrollToOptions options = {}); |
| 40 | undefined scrollBy(unrestricted double x, unrestricted double y); |
| 41 | |
| 42 | // client |
| 43 | [Replaceable] readonly attribute long screenX; |
| 44 | [Replaceable] readonly attribute long screenLeft; |
| 45 | [Replaceable] readonly attribute long screenY; |
| 46 | [Replaceable] readonly attribute long screenTop; |
| 47 | [Replaceable] readonly attribute long outerWidth; |
| 48 | [Replaceable] readonly attribute long outerHeight; |
| 49 | [Replaceable] readonly attribute double devicePixelRatio; |
| 50 | }; |
| 51 | |
| 52 | [Exposed=Window] |
| 53 | interface MediaQueryList : EventTarget { |
| 54 | readonly attribute CSSOMString media; |
| 55 | readonly attribute boolean matches; |
| 56 | undefined addListener(EventListener? callback); |
| 57 | undefined removeListener(EventListener? callback); |
| 58 | attribute EventHandler onchange; |
| 59 | }; |
| 60 | |
| 61 | [Exposed=Window] |
| 62 | interface MediaQueryListEvent : Event { |
| 63 | constructor(CSSOMString type, optional MediaQueryListEventInit eventInitDict = {}); |
| 64 | readonly attribute CSSOMString media; |
| 65 | readonly attribute boolean matches; |
| 66 | }; |
| 67 | |
| 68 | dictionary MediaQueryListEventInit : EventInit { |
| 69 | CSSOMString media = ""; |
| 70 | boolean matches = false; |
| 71 | }; |
| 72 | |
| 73 | [Exposed=Window] |
| 74 | interface Screen { |
| 75 | readonly attribute long availWidth; |
| 76 | readonly attribute long availHeight; |
| 77 | readonly attribute long width; |
| 78 | readonly attribute long height; |
| 79 | readonly attribute unsigned long colorDepth; |
| 80 | readonly attribute unsigned long pixelDepth; |
| 81 | }; |
| 82 | |
| 83 | partial interface Document { |
| 84 | Element? elementFromPoint(double x, double y); |
| 85 | sequence<Element> elementsFromPoint(double x, double y); |
| 86 | CaretPosition? caretPositionFromPoint(double x, double y); |
| 87 | readonly attribute Element? scrollingElement; |
| 88 | }; |
| 89 | |
| 90 | [Exposed=Window] |
| 91 | interface CaretPosition { |
| 92 | readonly attribute Node offsetNode; |
| 93 | readonly attribute unsigned long offset; |
| 94 | [NewObject] DOMRect? getClientRect(); |
| 95 | }; |
| 96 | |
| 97 | enum ScrollLogicalPosition { "start", "center", "end", "nearest" }; |
| 98 | dictionary ScrollIntoViewOptions : ScrollOptions { |
| 99 | ScrollLogicalPosition block = "start"; |
| 100 | ScrollLogicalPosition inline = "nearest"; |
| 101 | }; |
| 102 | |
| 103 | dictionary IsVisibleOptions { |
| 104 | boolean checkInert = false; |
| 105 | boolean checkOpacity = false; |
| 106 | boolean checkVisibilityCSS = false; |
| 107 | }; |
| 108 | |
| 109 | partial interface Element { |
| 110 | DOMRectList getClientRects(); |
| 111 | [NewObject] DOMRect getBoundingClientRect(); |
| 112 | |
| 113 | boolean isVisible(optional IsVisibleOptions options = {}); |
| 114 | |
| 115 | undefined scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg = {}); |
| 116 | undefined scroll(optional ScrollToOptions options = {}); |
| 117 | undefined scroll(unrestricted double x, unrestricted double y); |
| 118 | undefined scrollTo(optional ScrollToOptions options = {}); |
| 119 | undefined scrollTo(unrestricted double x, unrestricted double y); |
| 120 | undefined scrollBy(optional ScrollToOptions options = {}); |
| 121 | undefined scrollBy(unrestricted double x, unrestricted double y); |
| 122 | attribute unrestricted double scrollTop; |
| 123 | attribute unrestricted double scrollLeft; |
| 124 | readonly attribute long scrollWidth; |
| 125 | readonly attribute long scrollHeight; |
| 126 | readonly attribute long clientTop; |
| 127 | readonly attribute long clientLeft; |
| 128 | readonly attribute long clientWidth; |
| 129 | readonly attribute long clientHeight; |
| 130 | }; |
| 131 | |
| 132 | partial interface HTMLElement { |
| 133 | readonly attribute Element? offsetParent; |
| 134 | readonly attribute long offsetTop; |
| 135 | readonly attribute long offsetLeft; |
| 136 | readonly attribute long offsetWidth; |
| 137 | readonly attribute long offsetHeight; |
| 138 | }; |
| 139 | |
| 140 | partial interface HTMLImageElement { |
| 141 | readonly attribute long x; |
| 142 | readonly attribute long y; |
| 143 | }; |
| 144 | |
| 145 | partial interface Range { |
| 146 | DOMRectList getClientRects(); |
| 147 | [NewObject] DOMRect getBoundingClientRect(); |
| 148 | }; |
| 149 | |
| 150 | partial interface MouseEvent { |
| 151 | readonly attribute double pageX; |
| 152 | readonly attribute double pageY; |
| 153 | readonly attribute double x; |
| 154 | readonly attribute double y; |
| 155 | readonly attribute double offsetX; |
| 156 | readonly attribute double offsetY; |
| 157 | }; |
| 158 | |
| 159 | enum CSSBoxType { "margin", "border", "padding", "content" }; |
| 160 | dictionary BoxQuadOptions { |
| 161 | CSSBoxType box = "border"; |
| 162 | GeometryNode relativeTo; // XXX default document (i.e. viewport) |
| 163 | }; |
| 164 | |
| 165 | dictionary ConvertCoordinateOptions { |
| 166 | CSSBoxType fromBox = "border"; |
| 167 | CSSBoxType toBox = "border"; |
| 168 | }; |
| 169 | |
| 170 | interface mixin GeometryUtils { |
| 171 | sequence<DOMQuad> getBoxQuads(optional BoxQuadOptions options = {}); |
| 172 | DOMQuad convertQuadFromNode(DOMQuadInit quad, GeometryNode from, optional ConvertCoordinateOptions options = {}); |
| 173 | DOMQuad convertRectFromNode(DOMRectReadOnly rect, GeometryNode from, optional ConvertCoordinateOptions options = {}); |
| 174 | DOMPoint convertPointFromNode(DOMPointInit point, GeometryNode from, optional ConvertCoordinateOptions options = {}); // XXX z,w turns into 0 |
| 175 | }; |
| 176 | |
| 177 | Text includes GeometryUtils; // like Range |
| 178 | Element includes GeometryUtils; |
| 179 | CSSPseudoElement includes GeometryUtils; |
| 180 | Document includes GeometryUtils; |
| 181 | |
| 182 | typedef (Text or Element or CSSPseudoElement or Document) GeometryNode; |