mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibWeb: Use font with space in range for first_available_computed_font
This commit is contained in:
parent
55769be9c6
commit
79c22e0d86
Notes:
github-actions[bot]
2025-04-09 11:15:05 +00:00
Author: https://github.com/mkljczk Commit: https://github.com/LadybirdBrowser/ladybird/commit/79c22e0d863 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3970 Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 10 additions and 2 deletions
|
@ -186,17 +186,24 @@ public:
|
|||
FillRule fill_rule() const;
|
||||
ClipRule clip_rule() const;
|
||||
|
||||
Gfx::Font const& first_available_computed_font() const { return m_font_list->first(); }
|
||||
|
||||
Gfx::FontCascadeList const& computed_font_list() const
|
||||
{
|
||||
VERIFY(m_font_list);
|
||||
return *m_font_list;
|
||||
}
|
||||
|
||||
Gfx::Font const& first_available_computed_font() const
|
||||
{
|
||||
VERIFY(m_first_available_computed_font);
|
||||
return *m_first_available_computed_font;
|
||||
}
|
||||
|
||||
void set_computed_font_list(NonnullRefPtr<Gfx::FontCascadeList> font_list) const
|
||||
{
|
||||
m_font_list = move(font_list);
|
||||
// https://drafts.csswg.org/css-fonts/#first-available-font
|
||||
// First font for which the character U+0020 (space) is not excluded by a unicode-range
|
||||
m_first_available_computed_font = m_font_list->font_for_code_point(' ');
|
||||
}
|
||||
|
||||
[[nodiscard]] CSSPixels compute_line_height(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const;
|
||||
|
@ -245,6 +252,7 @@ private:
|
|||
|
||||
int m_math_depth { InitialValues::math_depth() };
|
||||
mutable RefPtr<Gfx::FontCascadeList> m_font_list;
|
||||
mutable RefPtr<Gfx::Font> m_first_available_computed_font;
|
||||
|
||||
Optional<CSSPixels> m_line_height;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue