Skip to content
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

Enable URLPattern tests in ShadowRealm #49323

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

Conversation

ptomato
Copy link
Contributor

@ptomato ptomato commented Nov 22, 2024

Requires using fetch_json to download the test data.

See whatwg/urlpattern#236 for spec decision.

@wpt-pr-bot
Copy link
Collaborator

There are no reviewers for this pull request. Please reach out on the chat room to get help with this. Thank you!

Copy link
Contributor

@jeremyroman jeremyroman left a comment

Choose a reason for hiding this comment

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

Have you checked to see if these tests pass today (in any engines which implement this today, which might still be Chromium)? Can you file implementation bugs against any browser where they don't pass?

When I try patching this in, I get this failure inside the WPT manifest code:

AssertionError: duplicate URL 'urlpattern/urlpattern-compare.tentative.https.any.shadowrealm-in-audioworklet.html

Possibly shadowrealm causes the non-https one to also generate such a file, and therefore it should only be listed in the .https one? (I'm not very familiar with how the WPT shadowrealm environment is generated.)

@@ -1,2 +1,2 @@
// META: global=window,worker
// META: global=window,worker,shadowrealm-in-window,shadowrealm-in-shadowrealm,shadowrealm-in-dedicatedworker,shadowrealm-in-sharedworker
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do most of these specify shadowrealm but this one specifies this list instead? What is the difference?

Copy link
Contributor

Choose a reason for hiding this comment

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

So these are the subset of shadowrealm? Maybe it's better to set shadowrealm.

"shadowrealm": {"longhand": {
"shadowrealm-in-window",
"shadowrealm-in-shadowrealm",
"shadowrealm-in-dedicatedworker",
"shadowrealm-in-sharedworker",
"shadowrealm-in-serviceworker",
"shadowrealm-in-audioworklet",

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 left out shadowrealm-in-serviceworker and shadowrealm-in-audioworklet because service workers and audio worklets can only be created in an HTTPS context, so they'd be generated with .https. anyway, and then be duplicates of the ones generated from shadowrealm.https.any.js.

Requires using fetch_json to download the test data.
@ptomato
Copy link
Contributor Author

ptomato commented Feb 11, 2025

Have you checked to see if these tests pass today (in any engines which implement this today, which might still be Chromium)?

Unfortunately, the intersection of engines which implement URLPattern and engines which implement ShadowRealm currently seems to be nil 😄 I'll tag @lukewarlow in here who was working on an experimental Chromium implementation of ShadowRealm at one point, to see if it had progressed far enough to check whether these tests pass.

Can you file implementation bugs against any browser where they don't pass?

Sure, will do as part of the checklist in whatwg/urlpattern#236.

When I try patching this in, I get this failure inside the WPT manifest code:

AssertionError: duplicate URL 'urlpattern/urlpattern-compare.tentative.https.any.shadowrealm-in-audioworklet.html

Possibly shadowrealm causes the non-https one to also generate such a file, and therefore it should only be listed in the .https one? (I'm not very familiar with how the WPT shadowrealm environment is generated.)

I think I missed that the urlpattern-compare test also comes in https and non-https flavours. We'll need to omit the https-only shadowrealm scopes in the non-https test, as I did with urlpattern.any.js. I'll update this PR to do that.

@lukewarlow
Copy link
Member

URLPattern should be exposed in chrome if you enable the right flag. But chrome doesn't support importValue or dynamic imports in shadow realms so can't run WPTs unfortunately.

It also doesn't yet support shadow realm (or other Exposed=* APIs) in worklets

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

Successfully merging this pull request may close these issues.

5 participants