Editorial: clarify FetchEvent clientId, resultingClientId, and replacesClientId initialization#1832
Merged
Merged
Conversation
…esClientId initialization Aligns the Create Fetch Event and Dispatch algorithm with actual browser behavior (Chrome, Firefox, Safari) and MDN documentation: - FetchEvent.clientId is now only initialized for subresource requests when the request has a non-null client. For navigation and other non-subresource requests it stays at the IDL default (empty string). This matches wanderview's suggestion in issue w3c#1267. - FetchEvent.resultingClientId now also checks that reservedClient is not null before initializing, and drops the redundant explicit `and to the empty string otherwise'' clause (the attribute default handles it). - FetchEvent.replacesClientId drops the redundant `and to the empty string otherwise'' clause for consistency with the other two. - Adds explanatory notes to the FetchEvent.clientId and FetchEvent.resultingClientId attribute sections describing the empty-string cases. Fixes w3c#1267
monica-ch
marked this pull request as ready for review
July 13, 2026 19:45
Collaborator
Author
|
@yoshisatoyanagisawa Could you review these changes and let me know if this is the right approach for updating the spec? |
yoshisatoyanagisawa
approved these changes
Jul 16, 2026
yoshisatoyanagisawa
left a comment
Collaborator
There was a problem hiding this comment.
lgtm!
Thank you.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Aligns the Create Fetch Event and Dispatch algorithm and the
FetchEvent.clientId/resultingClientIdattribute definitions with actual browser behavior (Chrome, Firefox, Safari) and MDN.Fixes #1267.
Changes
1.
FetchEvent.clientIdalgorithm stepPreviously the spec unconditionally initialized
clientIdfromrequest's client, including for navigations. However, all major browsers return an empty string forclientIdon navigation requests. Per @wanderview's suggestion:Before:
After:
2.
FetchEvent.resultingClientIdalgorithm stepAdds an explicit
reservedClientnull check and removes the redundant "and to the empty string otherwise" clause (the IDL default already provides"").3.
FetchEvent.replacesClientIdalgorithm stepRemoves the redundant "and to the empty string otherwise" clause for consistency with the sibling attributes.
4. Explanatory notes
Added descriptive notes for both
FetchEvent.clientIdandFetchEvent.resultingClientIdattribute sections, documenting all cases where the value is the empty string. These match MDN's documented behavior.Preview | Diff