Skip to content

Replace request's "window" with "traversable for user prompts" #1823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

domenic
Copy link
Member

@domenic domenic commented May 9, 2025

After much discussion in #1820 and #1821, this seems to be more correct. Closes #1820. Closes #1821. Helps whatwg/html#11250 specify browser-initiated navigations better.

  • At least two implementers are interested (and none opposed):
    • This seems to match all browser behavior.
  • Tests are written and can be reviewed and commented upon at:
  • Implementation bugs are filed:
    • Chromium: N/A
    • Gecko: N/A, although maybe a bug to encourage the blanking-out behavior would be appreciated?
    • WebKit: N/A, although maybe a bug to encourage the blanking-out behavior would be appreciated?
    • Deno (not for CORS changes): N/A
  • MDN issue is filed: N/A
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)


Marking as "do not merge yet" as we should prepare PRs for all of https://dontcallmedom.github.io/webdex/w.html#window%40%40request%40dfn . But I don't want to do that until we've confirmed this is the right path, since it's my third attempt 😅


Preview | Diff

After much discussion in #1820 and #1821, this seems to be more correct. Closes #1820. Closes #1821. Helps whatwg/html#11250 specify browser-initiated navigations better.
@domenic domenic added the do not merge yet Pull request must not be merged per rationale in comment label May 9, 2025
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me modulo some comments. @ricea and @noamr are maybe willing to review this too.

<a for="environment settings object">global object</a> is a
{{Window}} object). Unless stated otherwise it is
"<code>client</code>".
<dfn export for=request id=concept-request-window>traversable for user prompts</dfn>, that is
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to write out "end user" where I can myself. I'm not actually sure where we are consistency-wise, but is that something we can strife for? I'm happy to document it as the term to use.

agent should avoid displaying content from the request's initiator in the
<a for=request>traversable for user prompts</a>, especially in the case of cross-origin requests.
Displaying a blank page behind such prompts is a good way to fulfill these requirements. Failing to
follow these guidelines can confuse users as to which origin is responsible for the prompt.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
follow these guidelines can confuse users as to which origin is responsible for the prompt.
follow these guidelines can confuse end users as to which origin is responsible for the prompt.

"<code>no-traversable</code>".

<li>
<p>If <var>request</var>'s <a for=request>client</a> is non-null, then:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p>If <var>request</var>'s <a for=request>client</a> is non-null, then:
<p>If <var>request</var>'s <a for=request>client</a> is non-null:

<li><p>Let <var>global</var> be <var>request</var>'s <a for=request>client</a>'s
<a for="environment settings object">global object</a>.

<li><p>If <var>global</var> is a {{Window}} object, and <var>global</var>'s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<li><p>If <var>global</var> is a {{Window}} object, and <var>global</var>'s
<li><p>If <var>global</var> is a {{Window}} object and <var>global</var>'s

<var>httpFetchParams</var> to <var>fetchParams</var> and <var>httpRequest</var> to
<var>request</var>.
<li>
<p>If <var>request</var>'s <a for=request>traversable for user prompts</a> is "<code>no-traversable</code>" and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exceeds 100 columns jingle

<var>httpFetchParams</var> to <var>fetchParams</var> and <var>httpRequest</var> to
<var>request</var>.

<p class=note>If user prompts are possible, then we need to clone <var>request</var> because ???
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it's one of the scenarios where we might have to repeat request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge yet Pull request must not be merged per rationale in comment
Development

Successfully merging this pull request may close these issues.

2 participants