mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
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:
parent
14fb567a0f
commit
9e2e796f2d
Notes:
github-actions[bot]
2025-05-03 11:02:47 +00:00
Author: https://github.com/AtkinsSJ
Commit: 9e2e796f2d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4536
9 changed files with 38 additions and 31 deletions
|
@ -728,12 +728,15 @@ void dump_font_face_rule(StringBuilder& builder, CSS::CSSFontFaceRule const& rul
|
|||
|
||||
indent(builder, indent_levels + 1);
|
||||
builder.append("sources:\n"sv);
|
||||
for (auto const& source : font_face.sources()) {
|
||||
for (auto const& [local_or_url, format] : font_face.sources()) {
|
||||
indent(builder, indent_levels + 2);
|
||||
if (source.local_or_url.has<URL::URL>())
|
||||
builder.appendff("url={}, format={}\n", source.local_or_url.get<URL::URL>(), source.format.value_or("???"_string));
|
||||
else
|
||||
builder.appendff("local={}\n", source.local_or_url.get<FlyString>());
|
||||
local_or_url.visit(
|
||||
[&builder, &format](CSS::URL const& url) {
|
||||
builder.appendff("url={}, format={}\n", url, format.value_or("???"_string));
|
||||
},
|
||||
[&builder](FlyString const& local) {
|
||||
builder.appendff("local={}\n", local);
|
||||
});
|
||||
}
|
||||
|
||||
indent(builder, indent_levels + 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue