LibWeb: Don't override computed font-weight with value from used font

The CSS font-weight is king, even if we load a font that has another
weight value in its OpenType tables.
This commit is contained in:
Andreas Kling 2023-08-17 19:10:47 +02:00
parent 429b2e5860
commit 10020ba182
Notes: sideshowbarker 2024-07-17 04:10:16 +09:00

View file

@ -2321,7 +2321,7 @@ void StyleComputer::compute_font(StyleProperties& style, DOM::Element const* ele
auto found_font = compute_font_for_style_values(element, pseudo_element, font_family, font_size, font_style, font_weight, font_stretch);
style.set_property(CSS::PropertyID::FontSize, LengthStyleValue::create(CSS::Length::make_px(found_font->pixel_size())).release_value_but_fixme_should_propagate_errors(), nullptr);
style.set_property(CSS::PropertyID::FontWeight, NumberStyleValue::create(found_font->weight()).release_value_but_fixme_should_propagate_errors(), nullptr);
style.set_property(CSS::PropertyID::FontWeight, NumberStyleValue::create(font_weight->to_font_weight()).release_value_but_fixme_should_propagate_errors());
style.set_computed_font(found_font.release_nonnull());