mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb: Find font that has whitespace glyph in first_available_font()
Fixes https://github.com/SerenityOS/serenity/issues/22853
This commit is contained in:
parent
6685e4cb61
commit
1294cfb55c
Notes:
sideshowbarker
2024-07-17 03:27:40 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/1294cfb55c Pull-request: https://github.com/SerenityOS/serenity/pull/22893 Issue: https://github.com/SerenityOS/serenity/issues/22853
3 changed files with 25 additions and 3 deletions
|
@ -0,0 +1,14 @@
|
|||
<!doctype html><link rel="match" href="reference/first-available-font-should-include-whitespace-ref.html" /><style>
|
||||
* {
|
||||
outline: 1px solid black;
|
||||
font-family: HashFont, SerenitySans;
|
||||
}
|
||||
div {
|
||||
width: min-content;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'HashFont';
|
||||
src: url('assets/HashSans.woff');
|
||||
unicode-range: U+0;
|
||||
}
|
||||
</style><div class="test">hello friends
|
|
@ -0,0 +1,9 @@
|
|||
<!doctype html><style>
|
||||
* {
|
||||
outline: 1px solid black;
|
||||
font-family: SerenitySans;
|
||||
}
|
||||
div {
|
||||
width: min-content;
|
||||
}
|
||||
</style><div class="test">hello friends
|
|
@ -306,9 +306,8 @@ inline NodeWithStyle* Node::parent()
|
|||
inline Gfx::Font const& NodeWithStyle::first_available_font() const
|
||||
{
|
||||
// https://drafts.csswg.org/css-fonts/#first-available-font
|
||||
// FIXME: Should be be the first font for which the character U+0020 (space) instead of
|
||||
// any first font in the list
|
||||
return computed_values().font_list().first();
|
||||
// First font for which the character U+0020 (space) is not excluded by a unicode-range
|
||||
return computed_values().font_list().font_for_code_point(' ');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue