LibWeb: Don't add range data for FontCascadeList with no Unicode ranges

This fixes a bunch of WPT crashes in /html/canvas/offscreen/text/
This commit is contained in:
Andreas Kling 2025-07-15 00:16:06 +02:00 committed by Andreas Kling
commit a4fb21308d
Notes: github-actions[bot] 2025-07-15 08:07:50 +00:00

View file

@ -15,6 +15,10 @@ void FontCascadeList::add(NonnullRefPtr<Font const> font)
void FontCascadeList::add(NonnullRefPtr<Font const> font, Vector<UnicodeRange> unicode_ranges)
{
if (unicode_ranges.is_empty()) {
m_fonts.append({ move(font), {} });
return;
}
u32 lowest_code_point = 0xFFFFFFFF;
u32 highest_code_point = 0;