[csswg-drafts] [css-cascade-4] [css-values-4] [css-fonts-4] [css-font-loading] Further issues with URLs and fetching (#12288)

AtkinsSJ has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-cascade-4] [css-values-4] [css-fonts-4] [css-font-loading] Further issues with URLs and fetching ==
Apologies, I should have tried actually implementing the PR'ed changes before approving them. I've found a few other issues, I think this is everything though:

---

[fetch an @import](https://drafts.csswg.org/css-cascade-4/#fetch-an-import) now refers to `parsedUrl` which isn't set anywhere.

The fetch response does have a URL attached, is that safe to use here?

---

Previously [fetch a style resource](https://drafts.csswg.org/css-values-4/#fetch-a-style-resource) would return an error if parsing the URL failed, now it just returns:

> 1. Let parsedUrl be the result of [resolving](https://drafts.csswg.org/css-values-4/#resolve-a-style-resource-url) urlValue given cssRuleOrDeclaration. If that failed, return.

---

Also in [fetch a style resource](https://drafts.csswg.org/css-values-4/#fetch-a-style-resource), `sheet` is no longer defined, but it's used in steps 6 and 7. For now I've just duplicated steps 1-3 from [style resource base URL](https://drafts.csswg.org/css-values-4/#style-resource-base-url).

---

@trflynn89 had noticed that what is now step 7 of [fetch a style resource](https://drafts.csswg.org/css-values-4/#fetch-a-style-resource) needs to also set an initiator type when the resource isn't associated with a stylesheet, so that it's observable through a PerformanceObserver. So Ladybird had some ad-hoc code for setting that to "script" when there is no sheet. [Relevant Ladybird PR](https://github.com/LadybirdBrowser/ladybird/pull/4625). (Pinging you Tim because this isn't an area I'm familiar with.)

---

Perhaps most awkwardly, [fetch a font](https://drafts.csswg.org/css-fonts-4/#fetch-a-font) makes the assumption that there is a `@font` rule as the source, but it may be from a [`FontFace`](https://drafts.csswg.org/css-font-loading/#dom-fontface-load) instead.

> 4. Using the value of font face’s [[[Urls]]](https://drafts.csswg.org/css-font-loading/#dom-fontface-urls-slot) slot, attempt to load a font as defined in [[CSS-FONTS-3]](https://drafts.csswg.org/css-font-loading/#biblio-css-fonts-3), as if it was the value of a [@font-face](https://www.w3.org/TR/css-fonts-5/#at-font-face-rule) rule’s src descriptor.

---

@noamr 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12288 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 5 June 2025 14:51:56 UTC