From 0af5f64cad259c71a8c7cf81a8b5fbc167793016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 11 Oct 2025 19:04:56 +0200 Subject: [PATCH 1/2] [cssom-view] Escape Promise properly. Closes #12930 --- cssom-view-1/Overview.bs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cssom-view-1/Overview.bs b/cssom-view-1/Overview.bs index 14d91a48f4b..994150ad6ef 100644 --- a/cssom-view-1/Overview.bs +++ b/cssom-view-1/Overview.bs @@ -590,12 +590,12 @@ partial interface Window { [Replaceable] readonly attribute double pageXOffset; [Replaceable] readonly attribute double scrollY; [Replaceable] readonly attribute double pageYOffset; - Promise scroll(optional ScrollToOptions options = {}); - Promise scroll(unrestricted double x, unrestricted double y); - Promise scrollTo(optional ScrollToOptions options = {}); - Promise scrollTo(unrestricted double x, unrestricted double y); - Promise scrollBy(optional ScrollToOptions options = {}); - Promise scrollBy(unrestricted double x, unrestricted double y); + Promise<undefined> scroll(optional ScrollToOptions options = {}); + Promise<undefined> scroll(unrestricted double x, unrestricted double y); + Promise<undefined> scrollTo(optional ScrollToOptions options = {}); + 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; @@ -1320,13 +1320,13 @@ partial interface Element { boolean checkVisibility(optional CheckVisibilityOptions options = {}); - Promise scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg = {}); - Promise scroll(optional ScrollToOptions options = {}); - Promise scroll(unrestricted double x, unrestricted double y); - Promise scrollTo(optional ScrollToOptions options = {}); - Promise scrollTo(unrestricted double x, unrestricted double y); - Promise scrollBy(optional ScrollToOptions options = {}); - Promise scrollBy(unrestricted double x, unrestricted double y); + Promise<undefined> scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg = {}); + Promise<undefined> scroll(optional ScrollToOptions options = {}); + Promise<undefined> scroll(unrestricted double x, unrestricted double y); + Promise<undefined> scrollTo(optional ScrollToOptions options = {}); + Promise<undefined> scrollTo(unrestricted double x, unrestricted double y); + Promise<undefined> scrollBy(optional ScrollToOptions options = {}); + Promise<undefined> scrollBy(unrestricted double x, unrestricted double y); attribute unrestricted double scrollTop; attribute unrestricted double scrollLeft; readonly attribute long scrollWidth; From 9dcfc7230ec6ab72a655ee4dd2c2362759961274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 11 Oct 2025 19:05:58 +0200 Subject: [PATCH 2/2] [cssom-view] Fix up other bikeshed issues. --- cssom-view-1/Overview.bs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cssom-view-1/Overview.bs b/cssom-view-1/Overview.bs index 994150ad6ef..983a6be3ec3 100644 --- a/cssom-view-1/Overview.bs +++ b/cssom-view-1/Overview.bs @@ -446,13 +446,13 @@ the following steps must be run: 1. Let scrollPromise be a new {{Promise}}. 1. Return scrollPromise, and run the remaining steps in parallel. 1. If the user agent honors the 'scroll-behavior' property and one of the following is true: -
    -
  • behavior is "auto" and element is not null and its computed value of the - 'scroll-behavior' property is ''scroll-behavior/smooth'', or -
  • behavior is smooth -
- then perform a smooth scroll of box to position; - otherwise, perform an instant scroll of box to position. +
    +
  • behavior is "auto" and element is not null and its computed value of the + 'scroll-behavior' property is ''scroll-behavior/smooth'', or +
  • behavior is smooth +
+ then perform a smooth scroll of box to position; + otherwise, perform an instant scroll of box to position. 1. Wait until either the position has finished updating, or scrollPromise has been resolved. 1. If scrollPromise is still in the pending state: 1. If the scroll position changed as a result of this call, emit the scrollend event. @@ -1851,6 +1851,7 @@ means to run these steps: 1. Let scrollPromise be a new {{Promise}}. 1. Return scrollPromise, and run the remaining steps in parallel. 1. Resolve scrollPromise when all {{Promise}}s in ancestorPromises have settled. +