Skip to content

[css-values-5][cssom] How should modifiers be used when fetching a stylesheet from an @import rule? #12086

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

Closed
weinig opened this issue Apr 16, 2025 · 2 comments · Fixed by #12261
Labels

Comments

@weinig
Copy link
Contributor

weinig commented Apr 16, 2025

As far as I can find, stylesheet fetching uses the algorithm in cssom, fetch a style sheet and does not include use of any of CSS Values 4, fetch a style resource.

As such, for an @import rule, which uses the production so can have URL modifiers, its not clear how exactly those modifiers should apply to the fetch.

(cc @noamr, @annevk, @tabatkins, @fantasai)

@AtkinsSJ
Copy link
Contributor

Further comments from #12148:


"Fetch an import" step 3 says:

  1. Let parsedUrl be the result of the URL parser steps with rule’s URL and parentStylesheet’s location. If the algorithm returns an error, return. [CSSOM]

The resulting parsedURL won't have any of the s that the original @import's URL may have had, when it is then passed to "fetch a style resource".

It's also confusing that we parse the URL here, and then step 3 of "fetch a style resource" parses the URL again:

  1. Let parsedUrl be the result of the URL parser steps with urlValue’s url and base. If the algorithm returns an error, return.

Maybe "fetch an import" step 3 is just redundant?

noamr added a commit to noamr/csswg-drafts that referenced this issue Jun 2, 2025
…s-4] [css-shapes-2] Clean up fetching

This fixes a few cases around fetching external URLs for style resources:
- The base URL is the sheet's base URL if exists, otherwise the sheet's location, otherwise the document
  base URL.
- The algorithm can take either a rule or declaration block, and derive the correct stylesheet and base
  URL from that.
  Updated the calling sites to take that onto account.

- Removed redundant URL parsing in "@import".

Closes w3c#12065
Closes w3c#12068
Closes w3c#12086
Closes w3c#12147
@noamr
Copy link
Collaborator

noamr commented Jun 2, 2025

@weinig I believe what you're looking for is fetch an import?

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