mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 01:51:03 +09:00
LibWeb: Distinguish between integer and float in NumericStyleValue
We have this information when parsing, and some properties specifically only allow integers, so it makes sense to keep that around.
This commit is contained in:
parent
450b782c18
commit
78e57096e2
Notes:
sideshowbarker
2024-07-18 02:09:44 +09:00
Author: https://github.com/AtkinsSJ
Commit: 78e57096e2
Pull-request: https://github.com/SerenityOS/serenity/pull/10540
7 changed files with 55 additions and 30 deletions
|
@ -665,8 +665,8 @@ void StyleComputer::compute_font(StyleProperties& style, DOM::Element const* ele
|
|||
default:
|
||||
break;
|
||||
}
|
||||
} else if (font_weight->is_numeric()) {
|
||||
int font_weight_integer = roundf(static_cast<NumericStyleValue const&>(*font_weight).value());
|
||||
} else if (font_weight->has_integer()) {
|
||||
int font_weight_integer = font_weight->to_integer();
|
||||
if (font_weight_integer <= Gfx::FontWeight::Regular)
|
||||
weight = Gfx::FontWeight::Regular;
|
||||
else if (font_weight_integer <= Gfx::FontWeight::Bold)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue