Skip to content

Conversation

@recvfrom
Copy link
Contributor

@recvfrom recvfrom commented Nov 14, 2025

Implements the fetch spec side of bypassing partitioning when a top-level blob URL document attempts to fetch itself. For more info see: w3c/FileAPI#210

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


Preview | Diff

Implements the fetch spec sid of bypassing partitioning when
a top-level blob URL document attempts to fetch itself. For
more info see: w3c/FileAPI#210
fetch.bs Outdated
<ul class=brief>
<li><p><var>global</var> is a {{Window}} object;

<li><p><var>global</var>'s <a for=Window>navigable</a> is not null;
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if there are cases where this would be null and you can get this far into a fetch. Hmm.

Copy link
Member

@domfarolino domfarolino Nov 19, 2025

Choose a reason for hiding this comment

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

Specifically where client is non-null but not associated with a Window object? Would worker fetches count here? Maybe even navigation requests themselves, with their reserved client machinery...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mirrored this off of the logic in https://fetch.spec.whatwg.org/#populate-request-from-client, but I'm not certain that the cases there are possible here as well...

fetch.bs Outdated
Comment on lines 5384 to 5385
<li><p><var>requestEnvironment</var>'s <a for="environment">creation URL</a>
<a for=url>equals</a> <var>request</var>'s <a for=request>current URL</a>,
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to ignore fragment identifiers here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, what are your thoughts on this?

In Chrome we implemented exact matching because that's how the media fetch breakage we were aiming to work around presented itself (when navigating to a blob URL with a media mime type, the media element src is always exactly the URL you navigated to, fragment included if present)... But for other cases I could see ignoring the fragment identifier be a reasonable thing to do.

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 okay with keeping it strict.

recvfrom and others added 2 commits November 19, 2025 17:05
Co-authored-by: Anne van Kesteren <annevk@annevk.nl>

<li><p>Let <var>blob</var> be the result of <a>obtaining a blob object</a> given
<var>blobURLEntry</var> and <var>navigationOrEnvironment</var>.
<var>blobURLEntry</var> and <var>stringOrEnvironment</var>.
Copy link
Member

Choose a reason for hiding this comment

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

Just realized that stringOrEnvironment is undefined when request's client is null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants