1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:48:10 +00:00

LibWeb: Don't ignore data: URLs in @font-face src

Since data: URLs don't have a path, we shouldn't be checking for a TTF
or WOFF extension.

Thanks Timon for pointing this out! :^)
This commit is contained in:
Andreas Kling 2022-09-15 12:43:27 +02:00
parent 4910cc1879
commit a60c5166c6

View file

@ -1366,10 +1366,12 @@ void StyleComputer::load_fonts_from_sheet(CSSStyleSheet const& sheet)
if (!source.url.is_valid())
continue;
auto path = source.url.path();
if (!path.ends_with(".woff"sv, AK::CaseSensitivity::CaseInsensitive)
&& !path.ends_with(".ttf"sv, AK::CaseSensitivity::CaseInsensitive)) {
continue;
if (source.url.protocol() != "data") {
auto path = source.url.path();
if (!path.ends_with(".woff"sv, AK::CaseSensitivity::CaseInsensitive)
&& !path.ends_with(".ttf"sv, AK::CaseSensitivity::CaseInsensitive)) {
continue;
}
}
candidate_url = source.url;