Ver código fonte

LibWeb: Remove duplicate check for unitless lengths and zero

We call `parse_dimension()` immediately after this, which already deals
with lengths that have no unit. Also the comment here is woefully
outdated.
Sam Atkins 1 ano atrás
pai
commit
4ee3090a7d
1 arquivos alterados com 0 adições e 8 exclusões
  1. 0 8
      Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp

+ 0 - 8
Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp

@@ -2134,14 +2134,6 @@ Optional<Gfx::UnicodeRange> Parser::parse_unicode_range(StringView text)
 
 RefPtr<StyleValue> Parser::parse_dimension_value(ComponentValue const& component_value)
 {
-    // Numbers with no units can be lengths, in two situations:
-    // 1) We're in quirks mode, and it's an integer.
-    // 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) && 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);
     if (!dimension.has_value())
         return nullptr;