mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-24 03:52:58 +00:00
LibWeb/CSS: Only attempt to load valid @font-face
fonts
These must have a `font-family` and `src` set to be included in font-matching. Otherwise they should be ignored, but still exist in the CSSOM.
This commit is contained in:
parent
f87b454fa9
commit
9cce791424
Notes:
github-actions[bot]
2025-04-04 09:41:32 +00:00
Author: https://github.com/AtkinsSJ
Commit: 9cce791424
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4206
4 changed files with 17 additions and 2 deletions
|
@ -3061,8 +3061,10 @@ void StyleComputer::load_fonts_from_sheet(CSSStyleSheet& sheet)
|
|||
for (auto const& rule : sheet.rules()) {
|
||||
if (!is<CSSFontFaceRule>(*rule))
|
||||
continue;
|
||||
auto font_loader = load_font_face(static_cast<CSSFontFaceRule const&>(*rule).font_face());
|
||||
if (font_loader.has_value()) {
|
||||
auto const& font_face_rule = static_cast<CSSFontFaceRule const&>(*rule);
|
||||
if (!font_face_rule.is_valid())
|
||||
continue;
|
||||
if (auto font_loader = load_font_face(font_face_rule.font_face()); font_loader.has_value()) {
|
||||
sheet.add_associated_font_loader(font_loader.value());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue