LibWeb/CSS: Use CSS::URL for font-fetching

ParsedFontFace and FontLoader now both keep track of which
CSSStyleSheet (if any) was the source of the font-face, so the URLs can
be completed correctly.
This commit is contained in:
Sam Atkins 2025-05-02 12:07:22 +01:00
parent 14fb567a0f
commit 9e2e796f2d
Notes: github-actions[bot] 2025-05-03 11:02:47 +00:00
9 changed files with 38 additions and 31 deletions

View file

@ -3813,10 +3813,6 @@ RefPtr<FontSourceStyleValue const> Parser::parse_font_source_value(TokenStream<C
auto url = parse_url_function(tokens);
if (!url.has_value())
return nullptr;
// FIXME: Stop completing the URL here
auto completed_url = complete_url(url->url());
if (!completed_url.has_value())
return nullptr;
Optional<FlyString> format;
@ -3859,7 +3855,7 @@ RefPtr<FontSourceStyleValue const> Parser::parse_font_source_value(TokenStream<C
// FIXME: [ tech( <font-tech>#)]?
transaction.commit();
return FontSourceStyleValue::create(completed_url.release_value(), move(format));
return FontSourceStyleValue::create(url.release_value(), move(format));
}
NonnullRefPtr<CSSStyleValue const> Parser::resolve_unresolved_style_value(ParsingParams const& context, DOM::Element& element, Optional<PseudoElement> pseudo_element, PropertyID property_id, UnresolvedStyleValue const& unresolved)