From a60c5166c69d6e3e423019706c9d1b722a9b15e0 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 15 Sep 2022 12:43:27 +0200 Subject: 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! :^) --- Userland/Libraries/LibWeb/CSS/StyleComputer.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Userland/Libraries') diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index 780dfc18da..88ad0a8685 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -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; -- cgit v1.2.3