mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 19:57:45 +03:00
LibWeb: Handle custom ident values for the CSS font-family property
We were parsing these all right, but ignoring them in StyleComputer. No test unfortunately, since we don't currently have a way to delay the load event until a @font-face has been fully loaded. (Any test of this right now would be flaky.)
This commit is contained in:
parent
1f69e9cddf
commit
675d919dd2
Notes:
sideshowbarker
2024-07-17 08:45:34 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/675d919dd2 Pull-request: https://github.com/SerenityOS/serenity/pull/21140 Reviewed-by: https://github.com/AtkinsSJ ✅
@ -36,6 +36,7 @@
|
||||
#include <LibWeb/CSS/StyleValues/BorderStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/ColorStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/CompositeStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/CustomIdentStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/DisplayStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/EasingStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/FilterValueListStyleValue.h>
|
||||
@ -2136,6 +2137,8 @@ RefPtr<Gfx::Font const> StyleComputer::compute_font_for_style_values(DOM::Elemen
|
||||
found_font = find_generic_font(family->to_identifier());
|
||||
} else if (family->is_string()) {
|
||||
found_font = find_font(family->as_string().string_value());
|
||||
} else if (family->is_custom_ident()) {
|
||||
found_font = find_font(family->as_custom_ident().custom_ident());
|
||||
}
|
||||
if (found_font)
|
||||
break;
|
||||
@ -2144,6 +2147,8 @@ RefPtr<Gfx::Font const> StyleComputer::compute_font_for_style_values(DOM::Elemen
|
||||
found_font = find_generic_font(font_family.to_identifier());
|
||||
} else if (font_family.is_string()) {
|
||||
found_font = find_font(font_family.as_string().string_value());
|
||||
} else if (font_family.is_custom_ident()) {
|
||||
found_font = find_font(font_family.as_custom_ident().custom_ident());
|
||||
}
|
||||
|
||||
if (!found_font) {
|
||||
|
Loading…
Reference in New Issue
Block a user