diff options
author | Andreas Kling <kling@serenityos.org> | 2022-09-15 12:43:27 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-09-15 12:45:00 +0200 |
commit | a60c5166c69d6e3e423019706c9d1b722a9b15e0 (patch) | |
tree | ded414fecd928fd38015d4eb865b95a7814fb058 /Userland/Libraries | |
parent | 4910cc1879975d605678367c1d0eb085ce24d890 (diff) | |
download | serenity-a60c5166c69d6e3e423019706c9d1b722a9b15e0.zip |
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! :^)
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleComputer.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
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; |