mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Store font-width in ComputedProperties in computed form
This commit is contained in:
parent
073d10c6d1
commit
335c8c7ffb
Notes:
github-actions[bot]
2025-09-19 09:08:05 +00:00
Author: https://github.com/Calme1709
Commit: 335c8c7ffb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6072
Reviewed-by: https://github.com/AtkinsSJ ✅
10 changed files with 264 additions and 200 deletions
|
|
@ -10,6 +10,7 @@
|
|||
#include <LibWeb/CSS/StyleComputer.h>
|
||||
#include <LibWeb/CSS/StyleValues/LengthStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/NumberStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/PercentageStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/ShorthandStyleValue.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasState.h>
|
||||
|
|
@ -126,13 +127,14 @@ public:
|
|||
|
||||
auto const& computed_font_size = CSS::StyleComputer::compute_font_size(font_size, computed_math_depth, inherited_font_size, inherited_math_depth, length_resolution_context);
|
||||
auto const& computed_font_weight = CSS::StyleComputer::compute_font_weight(font_weight, inherited_font_weight, length_resolution_context);
|
||||
auto const& computed_font_width = CSS::StyleComputer::compute_font_width(font_width, length_resolution_context);
|
||||
|
||||
return document->style_computer().compute_font_for_style_values(
|
||||
font_family,
|
||||
computed_font_size->as_length().length().absolute_length_to_px(),
|
||||
font_style,
|
||||
computed_font_weight->as_number().number(),
|
||||
font_width);
|
||||
computed_font_width->as_percentage().percentage());
|
||||
},
|
||||
[](HTML::WorkerGlobalScope*) -> RefPtr<Gfx::FontCascadeList const> {
|
||||
// FIXME: implement computing the font for HTML::WorkerGlobalScope
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue