mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:07:47 +00:00
LibWeb: Allow '0' as a CSS dimension value
The comment mentions that zero is let through, but then immediately errors out if it sees any number outside quirks mode. This commit makes that check let zeros through.
This commit is contained in:
parent
e47f81d954
commit
5cd01bd644
1 changed files with 1 additions and 1 deletions
|
@ -3683,7 +3683,7 @@ ErrorOr<RefPtr<StyleValue>> Parser::parse_dimension_value(ComponentValue const&
|
|||
// 2) It's a 0.
|
||||
// We handle case 1 here. Case 2 is handled by NumericStyleValue pretending to be a LengthStyleValue if it is 0.
|
||||
|
||||
if (component_value.is(Token::Type::Number) && !(m_context.in_quirks_mode() && property_has_quirk(m_context.current_property_id(), Quirk::UnitlessLength)))
|
||||
if (component_value.is(Token::Type::Number) && component_value.token().number_value() != 0 && !(m_context.in_quirks_mode() && property_has_quirk(m_context.current_property_id(), Quirk::UnitlessLength)))
|
||||
return nullptr;
|
||||
|
||||
auto dimension = parse_dimension(component_value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue