Skip to content

Conversation

@shannonbooth
Copy link
Contributor

@shannonbooth shannonbooth commented Dec 24, 2025

cc @mikewest @annevk

Relating to whatwg/url#892 and whatwg/html#12058

One case which I didn't figure out a nice way of covering is opaque origin Worker which is not a data scheme URL

@shannonbooth
Copy link
Contributor Author

I pushed another commit to remove the file scheme URL test, as that has implementation defined behavior (discovered playing around making it not a tuple origin). Though actually, as I write this, maybe a test should instead be in a different file checking that:

const fileSchemeIsOpaque = new URL('file:///something/').origin === 'null' ;
assert_eq(fileSchemeIsOpaque, Origin.from('file:///something/').opaque);

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.

These are great @shannonbooth, thanks for writing them! I'll see if I need to change WebKit in a minute.

For file: URLs it seems reasonable to add .tentative test expecting an opaque origin.

I was hoping at some point we could at least agree that file: URL origins would always serialize as "null", but that didn't work out, but it might be time to try again.

@shannonbooth
Copy link
Contributor Author

shannonbooth commented Jan 7, 2026

For file: URLs it seems reasonable to add .tentative test expecting an opaque origin.

I was hoping at some point we could at least agree that file: URL origins would always serialize as "null", but that didn't work out, but it might be time to try again.

Sure, added a tentative test to check that a file URL has an opaque origin. I'm not certain if the same origin behavior would tentatively be the same as all other opaque origin schemes, but I also added tests for that.

FWIW I am trying to make progress on moving towards opaque file origins in ladybird (LadybirdBrowser/ladybird#7309 makes file origins opaque by default) to try and move closer to match other browsers behavior / security etc. The main point of investigation I have for this at the moment is on how to handle file scheme URLs in fetch, so hopefully I might be able to help making progress on whatwg/fetch#1195 depending on how far I manage to progress 😄

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.

Looks good modulo nit. Thanks again!

@shannonbooth shannonbooth force-pushed the origin-api-more-tests branch from b9217b3 to 901afb9 Compare January 7, 2026 18:17
Copy link
Member

@mikewest mikewest left a comment

Choose a reason for hiding this comment

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

LGTM too. I have small nits to improve clarity, but neither is important.

@shannonbooth shannonbooth force-pushed the origin-api-more-tests branch from 901afb9 to 5f23986 Compare January 8, 2026 11:54
@annevk annevk merged commit 2cb342f into web-platform-tests:master Jan 13, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants