mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb: Fix check for too many 'normal' values in font declaration
I had the values backwards, oops!
This commit is contained in:
parent
b64b97ef88
commit
b7aba70a28
Notes:
sideshowbarker
2024-07-18 05:33:12 +09:00
Author: https://github.com/AtkinsSJ
Commit: b7aba70a28
Pull-request: https://github.com/SerenityOS/serenity/pull/9421
Reviewed-by: https://github.com/TobyAsE
1 changed files with 1 additions and 2 deletions
|
@ -2400,14 +2400,13 @@ RefPtr<StyleValue> Parser::parse_font_value(ParsingContext const& context, Vecto
|
|||
font_families = maybe_font_families.release_nonnull();
|
||||
break;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Since normal is the default value for all the properties that can have it, we don't have to actually
|
||||
// set anything to normal here. It'll be set when we create the FontStyleValue below.
|
||||
// We just need to make sure we were not given more normals than will fit.
|
||||
int unset_value_count = (font_style ? 1 : 0) + (font_weight ? 1 : 0);
|
||||
int unset_value_count = (font_style ? 0 : 1) + (font_weight ? 0 : 1);
|
||||
if (unset_value_count < normal_count)
|
||||
return nullptr;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue