From aae89d4b9bc4f75c7626de9bd8d87fae33fcdf59 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Thu, 16 Jan 2025 16:36:56 +0100 Subject: [PATCH 1/2] Align navigate and reload with the HTML spec --- index.bs | 45 +++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/index.bs b/index.bs index ea638529..083e31ab 100644 --- a/index.bs +++ b/index.bs @@ -208,10 +208,12 @@ spec: HTML; urlPrefix: https://html.spec.whatwg.org/multipage/ text: navigable; for:window; url: nav-history-apis.html#window-navigable text: navigables; url: document-sequences.html#navigables text: navigation id; url: browsing-the-web.html#navigation-id + text: ongoing navigation; url: browsing-the-web.html#ongoing-navigation text: origin-clean; url: canvas.html#concept-canvas-origin-clean text: parent; for:navigable; url: document-sequences.html#nav-parent text: prompt to unload; url: browsing-the-web.html#prompt-to-unload-a-document text: prompt; url: timers-and-user-prompts.html#dom-prompt + text: reload; url: browsing-the-web.html#reload text: report an error; url: webappapis.html#report-the-error text: run the animation frame callbacks; url: imagebitmap-and-animations.html#run-the-animation-frame-callbacks text: same origin domain; url: browsers.html#same-origin-domain @@ -3086,23 +3088,7 @@ To get the navigable info given |navigable|,
-To await a navigation given |navigable|, |request|, |wait condition|, and optionally -|history handling| (default: "default") and |ignore cache| (default: false): - -1. Let |navigation id| be the string representation of a - [[!RFC9562|UUID]] based on truly random, or pseudo-random numbers. - -1. [=Navigate=] |navigable| with resource |request|, and using - |navigable|'s [=active document=] as the source - {{Document}}, with [=navigation id=] |navigation id|, and [=history - handling behavior=] |history handling|. If |ignore cache| is true, - the navigation must not load resources from the HTTP cache. - - Issue: property specify how the |ignore cache| flag works. This needs to - consider whether only the first load of a resource bypasses the cache - (i.e. whether this is like initially clearing the cache and proceeding like - normal), or whether resources not directly loaded by the HTML parser - (e.g. loads initiated by scripts or stylesheets) also bypass the cache. +To await a navigation given |navigation id| and |wait condition|: 1. Let (|event received|, |navigate status|) be [=await=] given «"navigation started", "navigation failed", @@ -4384,10 +4370,13 @@ The [=remote end steps=] with session and |command parameters| 1. If |url record| is failure, return [=error=] with [=error code=] [=invalid argument=]. -1. Let |request| be a new [=/request=] whose URL is |url record|. +1. [=Navigate=] |navigable| to [=/URL=] |url record| using + |navigable|'s [=active document=] as the source + {{Document}} with userInvolvement "browser UI". -1. Return the result of [=await a navigation=] with |navigable|, |request| and - |wait condition|. +1. Let |navigation id| be |navigable|'s [=ongoing navigation=]. + +1. Return the result of [=await a navigation=] with |navigation id| and |wait condition|.
@@ -4586,15 +4575,19 @@ The [=remote end steps=] with |command parameters| are: 1. Let |wait condition| be the value of the wait field of |command parameters| if present, or "none" otherwise. -1. Let |document| be |navigable|'s [=active document=]. +1. [=Reload=] |navigable| with userInvolvement "browser UI". + If |ignore cache| is true, the navigation must not load resources from the HTTP cache. -1. Let |url| be |document|'s URL. + Issue: property specify how the |ignore cache| flag works. This needs to + consider whether only the first load of a resource bypasses the cache + (i.e. whether this is like initially clearing the cache and proceeding like + normal), or whether resources not directly loaded by the HTML parser + (e.g. loads initiated by scripts or stylesheets) also bypass the cache. -1. Let |request| be a new [=/request=] whose URL is |url|. +1. Let |navigation id| be |navigable|'s [=ongoing navigation=]. -1. Return the result of [=await a navigation=] with |navigable|, |request|, |wait - condition|, history handling "reload", and ignore - cache |ignore cache|. +1. Return the result of [=await a navigation=] with |navigation id| and + |wait condition|. From c7c8f7da4aa65f2affb336955b31eb0def1675a3 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Fri, 17 Jan 2025 14:03:40 +0100 Subject: [PATCH 2/2] do not use reload yet --- index.bs | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/index.bs b/index.bs index 083e31ab..8d545ea0 100644 --- a/index.bs +++ b/index.bs @@ -208,12 +208,10 @@ spec: HTML; urlPrefix: https://html.spec.whatwg.org/multipage/ text: navigable; for:window; url: nav-history-apis.html#window-navigable text: navigables; url: document-sequences.html#navigables text: navigation id; url: browsing-the-web.html#navigation-id - text: ongoing navigation; url: browsing-the-web.html#ongoing-navigation text: origin-clean; url: canvas.html#concept-canvas-origin-clean text: parent; for:navigable; url: document-sequences.html#nav-parent text: prompt to unload; url: browsing-the-web.html#prompt-to-unload-a-document text: prompt; url: timers-and-user-prompts.html#dom-prompt - text: reload; url: browsing-the-web.html#reload text: report an error; url: webappapis.html#report-the-error text: run the animation frame callbacks; url: imagebitmap-and-animations.html#run-the-animation-frame-callbacks text: same origin domain; url: browsers.html#same-origin-domain @@ -4370,11 +4368,12 @@ The [=remote end steps=] with session and |command parameters| 1. If |url record| is failure, return [=error=] with [=error code=] [=invalid argument=]. -1. [=Navigate=] |navigable| to [=/URL=] |url record| using +1. Run [=navigate=] |navigable| to [=/URL=] |url| using |navigable|'s [=active document=] as the source - {{Document}} with userInvolvement "browser UI". - -1. Let |navigation id| be |navigable|'s [=ongoing navigation=]. + {{Document}} with userInvolvement "browser UI" + until a [=navigation id=] |navigation id| is generated + and pause the [=Navigate=] algorithm until the [=await a navigation=] + steps are invoked. 1. Return the result of [=await a navigation=] with |navigation id| and |wait condition|. @@ -4575,7 +4574,15 @@ The [=remote end steps=] with |command parameters| are: 1. Let |wait condition| be the value of the wait field of |command parameters| if present, or "none" otherwise. -1. [=Reload=] |navigable| with userInvolvement "browser UI". +1. Let |url| be |navigable|'s [=active document=]'s URL. + +1. Run [=navigate=] |navigable| to [=/URL=] |url| using + |navigable|'s [=active document=] as the source + {{Document}} with userInvolvement "browser UI" + until a [=navigation id=] |navigation id| is generated + and pause the [=Navigate=] algorithm until the [=await a navigation=] + steps are invoked. + If |ignore cache| is true, the navigation must not load resources from the HTTP cache. Issue: property specify how the |ignore cache| flag works. This needs to @@ -4584,7 +4591,8 @@ The [=remote end steps=] with |command parameters| are: normal), or whether resources not directly loaded by the HTML parser (e.g. loads initiated by scripts or stylesheets) also bypass the cache. -1. Let |navigation id| be |navigable|'s [=ongoing navigation=]. + Issue: we should probably call the reload algorithm in the HTML spec + but it is missing required integration steps for WebDriver BiDi. 1. Return the result of [=await a navigation=] with |navigation id| and |wait condition|.