Skip to content

Commit 3ebbf4f

Browse files
Bashamegasaschanaz
andauthored
override scroll methods to return void until browser implementation changes (#2237)
Co-authored-by: Kagami Sascha Rosylight <saschanaz@outlook.com>
1 parent 93d8936 commit 3ebbf4f

File tree

6 files changed

+125
-87
lines changed

6 files changed

+125
-87
lines changed

baselines/dom.generated.d.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13237,28 +13237,28 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp
1323713237
*
1323813238
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scroll)
1323913239
*/
13240-
scroll(options?: ScrollToOptions): Promise<void>;
13241-
scroll(x: number, y: number): Promise<void>;
13240+
scroll(options?: ScrollToOptions): void;
13241+
scroll(x: number, y: number): void;
1324213242
/**
1324313243
* The **`scrollBy()`** method of the Element interface scrolls an element by the given amount.
1324413244
*
1324513245
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollBy)
1324613246
*/
13247-
scrollBy(options?: ScrollToOptions): Promise<void>;
13248-
scrollBy(x: number, y: number): Promise<void>;
13247+
scrollBy(options?: ScrollToOptions): void;
13248+
scrollBy(x: number, y: number): void;
1324913249
/**
1325013250
* The Element interface's **`scrollIntoView()`** method scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
1325113251
*
1325213252
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView)
1325313253
*/
13254-
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): Promise<void>;
13254+
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
1325513255
/**
1325613256
* The **`scrollTo()`** method of the Element interface scrolls to a particular set of coordinates inside a given element.
1325713257
*
1325813258
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollTo)
1325913259
*/
13260-
scrollTo(options?: ScrollToOptions): Promise<void>;
13261-
scrollTo(x: number, y: number): Promise<void>;
13260+
scrollTo(options?: ScrollToOptions): void;
13261+
scrollTo(x: number, y: number): void;
1326213262
/**
1326313263
* The **`setAttribute()`** method of the Element interface sets the value of an attribute on the specified element. If the attribute already exists, the value is updated; otherwise a new attribute is added with the specified name and value.
1326413264
*
@@ -39325,22 +39325,22 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler
3932539325
*
3932639326
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scroll)
3932739327
*/
39328-
scroll(options?: ScrollToOptions): Promise<void>;
39329-
scroll(x: number, y: number): Promise<void>;
39328+
scroll(options?: ScrollToOptions): void;
39329+
scroll(x: number, y: number): void;
3933039330
/**
3933139331
* The **`Window.scrollBy()`** method scrolls the document in the window by the given amount.
3933239332
*
3933339333
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scrollBy)
3933439334
*/
39335-
scrollBy(options?: ScrollToOptions): Promise<void>;
39336-
scrollBy(x: number, y: number): Promise<void>;
39335+
scrollBy(options?: ScrollToOptions): void;
39336+
scrollBy(x: number, y: number): void;
3933739337
/**
3933839338
* **`Window.scrollTo()`** scrolls to a particular set of coordinates in the document.
3933939339
*
3934039340
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scrollTo)
3934139341
*/
39342-
scrollTo(options?: ScrollToOptions): Promise<void>;
39343-
scrollTo(x: number, y: number): Promise<void>;
39342+
scrollTo(options?: ScrollToOptions): void;
39343+
scrollTo(x: number, y: number): void;
3934439344
/**
3934539345
* The **`window.stop()`** stops further resource loading in the current browsing context, equivalent to the stop button in the browser.
3934639346
*
@@ -41489,22 +41489,22 @@ declare function resizeTo(width: number, height: number): void;
4148941489
*
4149041490
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scroll)
4149141491
*/
41492-
declare function scroll(options?: ScrollToOptions): Promise<void>;
41493-
declare function scroll(x: number, y: number): Promise<void>;
41492+
declare function scroll(options?: ScrollToOptions): void;
41493+
declare function scroll(x: number, y: number): void;
4149441494
/**
4149541495
* The **`Window.scrollBy()`** method scrolls the document in the window by the given amount.
4149641496
*
4149741497
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scrollBy)
4149841498
*/
41499-
declare function scrollBy(options?: ScrollToOptions): Promise<void>;
41500-
declare function scrollBy(x: number, y: number): Promise<void>;
41499+
declare function scrollBy(options?: ScrollToOptions): void;
41500+
declare function scrollBy(x: number, y: number): void;
4150141501
/**
4150241502
* **`Window.scrollTo()`** scrolls to a particular set of coordinates in the document.
4150341503
*
4150441504
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scrollTo)
4150541505
*/
41506-
declare function scrollTo(options?: ScrollToOptions): Promise<void>;
41507-
declare function scrollTo(x: number, y: number): Promise<void>;
41506+
declare function scrollTo(options?: ScrollToOptions): void;
41507+
declare function scrollTo(x: number, y: number): void;
4150841508
/**
4150941509
* The **`window.stop()`** stops further resource loading in the current browsing context, equivalent to the stop button in the browser.
4151041510
*

baselines/ts5.5/dom.generated.d.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13224,28 +13224,28 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp
1322413224
*
1322513225
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scroll)
1322613226
*/
13227-
scroll(options?: ScrollToOptions): Promise<void>;
13228-
scroll(x: number, y: number): Promise<void>;
13227+
scroll(options?: ScrollToOptions): void;
13228+
scroll(x: number, y: number): void;
1322913229
/**
1323013230
* The **`scrollBy()`** method of the Element interface scrolls an element by the given amount.
1323113231
*
1323213232
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollBy)
1323313233
*/
13234-
scrollBy(options?: ScrollToOptions): Promise<void>;
13235-
scrollBy(x: number, y: number): Promise<void>;
13234+
scrollBy(options?: ScrollToOptions): void;
13235+
scrollBy(x: number, y: number): void;
1323613236
/**
1323713237
* The Element interface's **`scrollIntoView()`** method scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
1323813238
*
1323913239
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView)
1324013240
*/
13241-
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): Promise<void>;
13241+
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
1324213242
/**
1324313243
* The **`scrollTo()`** method of the Element interface scrolls to a particular set of coordinates inside a given element.
1324413244
*
1324513245
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollTo)
1324613246
*/
13247-
scrollTo(options?: ScrollToOptions): Promise<void>;
13248-
scrollTo(x: number, y: number): Promise<void>;
13247+
scrollTo(options?: ScrollToOptions): void;
13248+
scrollTo(x: number, y: number): void;
1324913249
/**
1325013250
* The **`setAttribute()`** method of the Element interface sets the value of an attribute on the specified element. If the attribute already exists, the value is updated; otherwise a new attribute is added with the specified name and value.
1325113251
*
@@ -39299,22 +39299,22 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler
3929939299
*
3930039300
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scroll)
3930139301
*/
39302-
scroll(options?: ScrollToOptions): Promise<void>;
39303-
scroll(x: number, y: number): Promise<void>;
39302+
scroll(options?: ScrollToOptions): void;
39303+
scroll(x: number, y: number): void;
3930439304
/**
3930539305
* The **`Window.scrollBy()`** method scrolls the document in the window by the given amount.
3930639306
*
3930739307
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scrollBy)
3930839308
*/
39309-
scrollBy(options?: ScrollToOptions): Promise<void>;
39310-
scrollBy(x: number, y: number): Promise<void>;
39309+
scrollBy(options?: ScrollToOptions): void;
39310+
scrollBy(x: number, y: number): void;
3931139311
/**
3931239312
* **`Window.scrollTo()`** scrolls to a particular set of coordinates in the document.
3931339313
*
3931439314
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scrollTo)
3931539315
*/
39316-
scrollTo(options?: ScrollToOptions): Promise<void>;
39317-
scrollTo(x: number, y: number): Promise<void>;
39316+
scrollTo(options?: ScrollToOptions): void;
39317+
scrollTo(x: number, y: number): void;
3931839318
/**
3931939319
* The **`window.stop()`** stops further resource loading in the current browsing context, equivalent to the stop button in the browser.
3932039320
*
@@ -41463,22 +41463,22 @@ declare function resizeTo(width: number, height: number): void;
4146341463
*
4146441464
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scroll)
4146541465
*/
41466-
declare function scroll(options?: ScrollToOptions): Promise<void>;
41467-
declare function scroll(x: number, y: number): Promise<void>;
41466+
declare function scroll(options?: ScrollToOptions): void;
41467+
declare function scroll(x: number, y: number): void;
4146841468
/**
4146941469
* The **`Window.scrollBy()`** method scrolls the document in the window by the given amount.
4147041470
*
4147141471
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scrollBy)
4147241472
*/
41473-
declare function scrollBy(options?: ScrollToOptions): Promise<void>;
41474-
declare function scrollBy(x: number, y: number): Promise<void>;
41473+
declare function scrollBy(options?: ScrollToOptions): void;
41474+
declare function scrollBy(x: number, y: number): void;
4147541475
/**
4147641476
* **`Window.scrollTo()`** scrolls to a particular set of coordinates in the document.
4147741477
*
4147841478
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scrollTo)
4147941479
*/
41480-
declare function scrollTo(options?: ScrollToOptions): Promise<void>;
41481-
declare function scrollTo(x: number, y: number): Promise<void>;
41480+
declare function scrollTo(options?: ScrollToOptions): void;
41481+
declare function scrollTo(x: number, y: number): void;
4148241482
/**
4148341483
* The **`window.stop()`** stops further resource loading in the current browsing context, equivalent to the stop button in the browser.
4148441484
*

baselines/ts5.6/dom.generated.d.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13234,28 +13234,28 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp
1323413234
*
1323513235
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scroll)
1323613236
*/
13237-
scroll(options?: ScrollToOptions): Promise<void>;
13238-
scroll(x: number, y: number): Promise<void>;
13237+
scroll(options?: ScrollToOptions): void;
13238+
scroll(x: number, y: number): void;
1323913239
/**
1324013240
* The **`scrollBy()`** method of the Element interface scrolls an element by the given amount.
1324113241
*
1324213242
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollBy)
1324313243
*/
13244-
scrollBy(options?: ScrollToOptions): Promise<void>;
13245-
scrollBy(x: number, y: number): Promise<void>;
13244+
scrollBy(options?: ScrollToOptions): void;
13245+
scrollBy(x: number, y: number): void;
1324613246
/**
1324713247
* The Element interface's **`scrollIntoView()`** method scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
1324813248
*
1324913249
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView)
1325013250
*/
13251-
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): Promise<void>;
13251+
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
1325213252
/**
1325313253
* The **`scrollTo()`** method of the Element interface scrolls to a particular set of coordinates inside a given element.
1325413254
*
1325513255
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollTo)
1325613256
*/
13257-
scrollTo(options?: ScrollToOptions): Promise<void>;
13258-
scrollTo(x: number, y: number): Promise<void>;
13257+
scrollTo(options?: ScrollToOptions): void;
13258+
scrollTo(x: number, y: number): void;
1325913259
/**
1326013260
* The **`setAttribute()`** method of the Element interface sets the value of an attribute on the specified element. If the attribute already exists, the value is updated; otherwise a new attribute is added with the specified name and value.
1326113261
*
@@ -39322,22 +39322,22 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler
3932239322
*
3932339323
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scroll)
3932439324
*/
39325-
scroll(options?: ScrollToOptions): Promise<void>;
39326-
scroll(x: number, y: number): Promise<void>;
39325+
scroll(options?: ScrollToOptions): void;
39326+
scroll(x: number, y: number): void;
3932739327
/**
3932839328
* The **`Window.scrollBy()`** method scrolls the document in the window by the given amount.
3932939329
*
3933039330
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scrollBy)
3933139331
*/
39332-
scrollBy(options?: ScrollToOptions): Promise<void>;
39333-
scrollBy(x: number, y: number): Promise<void>;
39332+
scrollBy(options?: ScrollToOptions): void;
39333+
scrollBy(x: number, y: number): void;
3933439334
/**
3933539335
* **`Window.scrollTo()`** scrolls to a particular set of coordinates in the document.
3933639336
*
3933739337
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scrollTo)
3933839338
*/
39339-
scrollTo(options?: ScrollToOptions): Promise<void>;
39340-
scrollTo(x: number, y: number): Promise<void>;
39339+
scrollTo(options?: ScrollToOptions): void;
39340+
scrollTo(x: number, y: number): void;
3934139341
/**
3934239342
* The **`window.stop()`** stops further resource loading in the current browsing context, equivalent to the stop button in the browser.
3934339343
*
@@ -41486,22 +41486,22 @@ declare function resizeTo(width: number, height: number): void;
4148641486
*
4148741487
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scroll)
4148841488
*/
41489-
declare function scroll(options?: ScrollToOptions): Promise<void>;
41490-
declare function scroll(x: number, y: number): Promise<void>;
41489+
declare function scroll(options?: ScrollToOptions): void;
41490+
declare function scroll(x: number, y: number): void;
4149141491
/**
4149241492
* The **`Window.scrollBy()`** method scrolls the document in the window by the given amount.
4149341493
*
4149441494
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scrollBy)
4149541495
*/
41496-
declare function scrollBy(options?: ScrollToOptions): Promise<void>;
41497-
declare function scrollBy(x: number, y: number): Promise<void>;
41496+
declare function scrollBy(options?: ScrollToOptions): void;
41497+
declare function scrollBy(x: number, y: number): void;
4149841498
/**
4149941499
* **`Window.scrollTo()`** scrolls to a particular set of coordinates in the document.
4150041500
*
4150141501
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scrollTo)
4150241502
*/
41503-
declare function scrollTo(options?: ScrollToOptions): Promise<void>;
41504-
declare function scrollTo(x: number, y: number): Promise<void>;
41503+
declare function scrollTo(options?: ScrollToOptions): void;
41504+
declare function scrollTo(x: number, y: number): void;
4150541505
/**
4150641506
* The **`window.stop()`** stops further resource loading in the current browsing context, equivalent to the stop button in the browser.
4150741507
*

baselines/ts5.9/dom.generated.d.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13234,28 +13234,28 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp
1323413234
*
1323513235
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scroll)
1323613236
*/
13237-
scroll(options?: ScrollToOptions): Promise<void>;
13238-
scroll(x: number, y: number): Promise<void>;
13237+
scroll(options?: ScrollToOptions): void;
13238+
scroll(x: number, y: number): void;
1323913239
/**
1324013240
* The **`scrollBy()`** method of the Element interface scrolls an element by the given amount.
1324113241
*
1324213242
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollBy)
1324313243
*/
13244-
scrollBy(options?: ScrollToOptions): Promise<void>;
13245-
scrollBy(x: number, y: number): Promise<void>;
13244+
scrollBy(options?: ScrollToOptions): void;
13245+
scrollBy(x: number, y: number): void;
1324613246
/**
1324713247
* The Element interface's **`scrollIntoView()`** method scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
1324813248
*
1324913249
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView)
1325013250
*/
13251-
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): Promise<void>;
13251+
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
1325213252
/**
1325313253
* The **`scrollTo()`** method of the Element interface scrolls to a particular set of coordinates inside a given element.
1325413254
*
1325513255
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollTo)
1325613256
*/
13257-
scrollTo(options?: ScrollToOptions): Promise<void>;
13258-
scrollTo(x: number, y: number): Promise<void>;
13257+
scrollTo(options?: ScrollToOptions): void;
13258+
scrollTo(x: number, y: number): void;
1325913259
/**
1326013260
* The **`setAttribute()`** method of the Element interface sets the value of an attribute on the specified element. If the attribute already exists, the value is updated; otherwise a new attribute is added with the specified name and value.
1326113261
*
@@ -39322,22 +39322,22 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler
3932239322
*
3932339323
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scroll)
3932439324
*/
39325-
scroll(options?: ScrollToOptions): Promise<void>;
39326-
scroll(x: number, y: number): Promise<void>;
39325+
scroll(options?: ScrollToOptions): void;
39326+
scroll(x: number, y: number): void;
3932739327
/**
3932839328
* The **`Window.scrollBy()`** method scrolls the document in the window by the given amount.
3932939329
*
3933039330
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scrollBy)
3933139331
*/
39332-
scrollBy(options?: ScrollToOptions): Promise<void>;
39333-
scrollBy(x: number, y: number): Promise<void>;
39332+
scrollBy(options?: ScrollToOptions): void;
39333+
scrollBy(x: number, y: number): void;
3933439334
/**
3933539335
* **`Window.scrollTo()`** scrolls to a particular set of coordinates in the document.
3933639336
*
3933739337
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scrollTo)
3933839338
*/
39339-
scrollTo(options?: ScrollToOptions): Promise<void>;
39340-
scrollTo(x: number, y: number): Promise<void>;
39339+
scrollTo(options?: ScrollToOptions): void;
39340+
scrollTo(x: number, y: number): void;
3934139341
/**
3934239342
* The **`window.stop()`** stops further resource loading in the current browsing context, equivalent to the stop button in the browser.
3934339343
*
@@ -41486,22 +41486,22 @@ declare function resizeTo(width: number, height: number): void;
4148641486
*
4148741487
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scroll)
4148841488
*/
41489-
declare function scroll(options?: ScrollToOptions): Promise<void>;
41490-
declare function scroll(x: number, y: number): Promise<void>;
41489+
declare function scroll(options?: ScrollToOptions): void;
41490+
declare function scroll(x: number, y: number): void;
4149141491
/**
4149241492
* The **`Window.scrollBy()`** method scrolls the document in the window by the given amount.
4149341493
*
4149441494
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scrollBy)
4149541495
*/
41496-
declare function scrollBy(options?: ScrollToOptions): Promise<void>;
41497-
declare function scrollBy(x: number, y: number): Promise<void>;
41496+
declare function scrollBy(options?: ScrollToOptions): void;
41497+
declare function scrollBy(x: number, y: number): void;
4149841498
/**
4149941499
* **`Window.scrollTo()`** scrolls to a particular set of coordinates in the document.
4150041500
*
4150141501
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/scrollTo)
4150241502
*/
41503-
declare function scrollTo(options?: ScrollToOptions): Promise<void>;
41504-
declare function scrollTo(x: number, y: number): Promise<void>;
41503+
declare function scrollTo(options?: ScrollToOptions): void;
41504+
declare function scrollTo(x: number, y: number): void;
4150541505
/**
4150641506
* The **`window.stop()`** stops further resource loading in the current browsing context, equivalent to the stop button in the browser.
4150741507
*

inputfiles/patches/cssom-view.kdl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,23 @@ interface-mixin DocumentOrShadowRoot {
1414
param y type=long
1515
}
1616
}
17+
18+
// No implementation of Promise return values as of 2025-11
19+
interface Element {
20+
method scroll returns=void signatureIndex=0
21+
method scroll returns=void signatureIndex=1
22+
method scrollBy returns=void signatureIndex=0
23+
method scrollBy returns=void signatureIndex=1
24+
method scrollTo returns=void signatureIndex=0
25+
method scrollTo returns=void signatureIndex=1
26+
method scrollIntoView returns=void signatureIndex=0
27+
}
28+
29+
interface Window {
30+
method scroll returns=void signatureIndex=0
31+
method scroll returns=void signatureIndex=1
32+
method scrollBy returns=void signatureIndex=0
33+
method scrollBy returns=void signatureIndex=1
34+
method scrollTo returns=void signatureIndex=0
35+
method scrollTo returns=void signatureIndex=1
36+
}

0 commit comments

Comments
 (0)