Description
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 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 would return an error if parsing the URL failed, now it just returns:
- Let parsedUrl be the result of resolving urlValue given cssRuleOrDeclaration. If that failed, return.
Also in 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.
@trflynn89 had noticed that what is now step 7 of 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. (Pinging you Tim because this isn't an area I'm familiar with.)
Perhaps most awkwardly, fetch a font makes the assumption that there is a @font
rule as the source, but it may be from a FontFace
instead.
- Using the value of font face’s [[Urls]] slot, attempt to load a font as defined in [CSS-FONTS-3], as if it was the value of a @font-face rule’s src descriptor.