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:
parent
429b2e5860
commit
10020ba182
Notes:
sideshowbarker
2024-07-17 04:10:16 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/10020ba182 Pull-request: https://github.com/SerenityOS/serenity/pull/20622
1 changed files with 1 additions and 1 deletions
|
@ -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());
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue