From 3128474be3953db04b5fb26c71e77ba209a3b691 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Tue, 12 Sep 2023 17:16:35 -0400 Subject: [PATCH 1/5] Editorial: formalize screenshot waiting algorithm --- index.bs | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/index.bs b/index.bs index 2a272d29..cbf1099b 100644 --- a/index.bs +++ b/index.bs @@ -179,7 +179,7 @@ spec: HTML; urlPrefix: https://html.spec.whatwg.org/multipage/ text: prompt to unload; url: browsing-the-web.html#prompt-to-unload-a-document text: report an error; url: webappapis.html#report-the-error text: remove a browsing context; url: browsers.html#bcg-remove - text: run the animation frame callbacks; url: imagebitmap-and-animations.html#run-the-animation-frame-callbacks + text: requestAnimationFrame; url: imagebitmap-and-animations.html#dom-animationframeprovider-requestanimationframe text: same origin domain; url: browsers.html#same-origin-domain text: session history; url: history.html#session-history text: set up a window environment settings object; url: window-object.html#set-up-a-window-environment-settings-object @@ -2369,6 +2369,24 @@ To render viewport to a canvas given |viewport| and |rect|: +
+To await the next animation frame given |window|: + +1. Let |render id| be the string representation of a + [[!RFC4122|UUID]] based on truly random, or pseudo-random numbers. + +1. Let |steps| be the following steps: + + 1. [=Resume=] with "animation frame", |render id|, and (). + +1. Let |callback| be [=CreateBuiltinFunction=](|steps|, 0, "", « »). + +1. [=Call=]([=requestAnimationFrame=], |window|, «|callback|»). + +1. [=Await=] with «"animation frame"», and |render id|. + +
+ The [=remote end steps=] with session and |command parameters| are: 1. Let |context id| be |command parameters|["context"]. @@ -2383,11 +2401,9 @@ The [=remote end steps=] with session and |command parameters| 1. Let |viewport| be |document|'s [=visual viewport=]. -1. Immediately after the next invocation of the [=run the animation frame - callbacks=] algorithm for |document|: +1. Let |window| be |context|'s [=active window=]. - Issue: This ought to be integrated into the update rendering algorithm - in some more explicit way. +1. [=Await the next animation frame=] with |window|. 1. Let |viewport rect| be a {{DOMRectReadOnly}} with [=x coordinate=] 0, [=y coordinate=] 0, [=width dimension=] |viewport| width, and [=height @@ -2875,11 +2891,9 @@ Note: The minimum page size is 1 point, which is (2.54 / 72) cm as per 1. Let |document| be |context|'s [=active document=]. -1. Immediately after the next invocation of the [=run the animation frame - callbacks=] algorithm for |document|: +1. Let |window| be |context|'s [=active window=]. - Issue: This ought to be integrated into the update rendering algorithm - in some more explicit way. +1. [=Await the next animation frame=] with |window|. 1. Let |pdf data| be the result taking UA-specific steps to generate a paginated representation of |document|, with the CSS [=media type=] set to From 2a989e583dec7e7436e96d3f0660b16f9056a10e Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Tue, 26 Sep 2023 17:53:52 -0400 Subject: [PATCH 2/5] fixup! Editorial: formalize screenshot waiting algorithm --- index.bs | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/index.bs b/index.bs index cbf1099b..b981ae38 100644 --- a/index.bs +++ b/index.bs @@ -179,7 +179,6 @@ spec: HTML; urlPrefix: https://html.spec.whatwg.org/multipage/ text: prompt to unload; url: browsing-the-web.html#prompt-to-unload-a-document text: report an error; url: webappapis.html#report-the-error text: remove a browsing context; url: browsers.html#bcg-remove - text: requestAnimationFrame; url: imagebitmap-and-animations.html#dom-animationframeprovider-requestanimationframe text: same origin domain; url: browsers.html#same-origin-domain text: session history; url: history.html#session-history text: set up a window environment settings object; url: window-object.html#set-up-a-window-environment-settings-object @@ -1888,6 +1887,11 @@ implicitly set when the context is created. For browsing contexts with an associated WebDriver [=window handle=] the [=/browsing context id=] must be the same as the [=window handle=]. +Each [=/browsing context=] has an associated list of suspended rendering +ids, which is initially an empty list. It is used to track pending +invocations of [=browsingContext.captureScreenshot=] and +[=browsingContext.print=]. +
To get a browsing context given |context id|: @@ -1902,6 +1906,17 @@ To get a browsing context given |context id|:
+
+To resume suspended renderings for a given |browsing context|. + +1. Let |rendering ids| be |browsing context|'s [=list of suspended rendering ids=]. + +1. For each |rendering id| in |rendering ids|: + + 1. [=Resume=] with "animation frame", |rendering id|, and (). + +
+ #### The browsingContext.Info Type #### {#type-browsingContext-Info} [=local end definition=] @@ -2370,20 +2385,13 @@ To render viewport to a canvas given |viewport| and |rect|:
-To await the next animation frame given |window|: - -1. Let |render id| be the string representation of a - [[!RFC4122|UUID]] based on truly random, or pseudo-random numbers. - -1. Let |steps| be the following steps: +To await the next animation frame given |browsing context|: - 1. [=Resume=] with "animation frame", |render id|, and (). +1. Let |rendering id| be a new unique opaque string. -1. Let |callback| be [=CreateBuiltinFunction=](|steps|, 0, "", « »). +1. [=list/Append=] |rendering id| to |browsing context|'s [=list of suspended rendering ids=]. -1. [=Call=]([=requestAnimationFrame=], |window|, «|callback|»). - -1. [=Await=] with «"animation frame"», and |render id|. +1. [=Await=] with «"animation frame"», and |rendering id|.
@@ -2401,9 +2409,7 @@ The [=remote end steps=] with session and |command parameters| 1. Let |viewport| be |document|'s [=visual viewport=]. -1. Let |window| be |context|'s [=active window=]. - -1. [=Await the next animation frame=] with |window|. +1. [=Await the next animation frame=] with |context|. 1. Let |viewport rect| be a {{DOMRectReadOnly}} with [=x coordinate=] 0, [=y coordinate=] 0, [=width dimension=] |viewport| width, and [=height @@ -2891,9 +2897,7 @@ Note: The minimum page size is 1 point, which is (2.54 / 72) cm as per 1. Let |document| be |context|'s [=active document=]. -1. Let |window| be |context|'s [=active window=]. - -1. [=Await the next animation frame=] with |window|. +1. [=Await the next animation frame=] with |context|. 1. Let |pdf data| be the result taking UA-specific steps to generate a paginated representation of |document|, with the CSS [=media type=] set to From 46279fa2e151eba715674be99f3838b6d0eaa219 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 27 Sep 2023 18:34:38 -0400 Subject: [PATCH 3/5] fixup! Editorial: formalize screenshot waiting algorithm --- index.bs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.bs b/index.bs index 222e74da..c8fa314b 100644 --- a/index.bs +++ b/index.bs @@ -1913,6 +1913,8 @@ To resume suspended renderings for a given |browsing context|. 1. [=Resume=] with "animation frame", |rendering id|, and (). +1. [=list/Empty=] |rendering ids|. + #### The browsingContext.Info Type #### {#type-browsingContext-Info} From 69f240c7d8ee3578bf5e4878c3841defed22851c Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 20 Nov 2023 21:42:07 -0500 Subject: [PATCH 4/5] Include proposed extension to HTML --- index.bs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/index.bs b/index.bs index c8fa314b..21281f6a 100644 --- a/index.bs +++ b/index.bs @@ -172,6 +172,7 @@ spec: HTML; urlPrefix: https://html.spec.whatwg.org/multipage/ text: create a new browsing context; url: browsers.html#creating-a-new-browsing-context text: default classic script fetch options; url: webappapis.html#default-classic-script-fetch-options text: environment settings object's Realm; url: webappapis.html#environment-settings-object's-realm + text: event loop processing model; url: event-loop-processing-model text: focused area of the document; url: document-sequences.html#focused-area-of-the-document text: handled; url: webappapis.html#concept-error-handled text: hidden; url: document-sequences.html#system-visibility-state @@ -9061,6 +9062,17 @@ end: ignore>col, message, and true if the error is [=handled=], or false otherwise. + + +The [=event loop processing model=] is modified to insert a step at the end of +the sub-steps labeled [=update the rendering=]: + +
+ +1. For each [=fully active=] Document |doc| in docs run [=resume suspended renderings=] given |doc|'s + [=/browsing context=]. WEBDRIVERBIDI +
## Console ## {#patches-console} From a5aec8b2dfa35be9a09413ce949b8ffd5616ea88 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 20 Nov 2023 21:51:21 -0500 Subject: [PATCH 5/5] Remove `ref` element --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index ee6b3768..fe84345c 100644 --- a/index.bs +++ b/index.bs @@ -9657,7 +9657,7 @@ the sub-steps labeled [=update the rendering=]: 1. For each [=fully active=] Document |doc| in docs run [=resume suspended renderings=] given |doc|'s - [=/browsing context=]. WEBDRIVERBIDI + [=/browsing context=]. WEBDRIVERBIDI ## Console ## {#patches-console}