Browse Source

LibWeb: Update `<general-enclosed>` definition to match spec change

See https://github.com/w3c/csswg-drafts/pull/6799
Sam Atkins 3 years ago
parent
commit
0a8e289f37
1 changed files with 4 additions and 7 deletions
  1. 4 7
      Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp

+ 4 - 7
Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp

@@ -1130,16 +1130,13 @@ Optional<GeneralEnclosed> Parser::parse_general_enclosed(TokenStream<StyleCompon
 
 
     auto& first_token = tokens.next_token();
     auto& first_token = tokens.next_token();
 
 
-    // `[ <function-token> <any-value> ) ]`
+    // `[ <function-token> <any-value>? ) ]`
     if (first_token.is_function())
     if (first_token.is_function())
         return GeneralEnclosed { first_token.to_string() };
         return GeneralEnclosed { first_token.to_string() };
 
 
-    // `( <ident> <any-value> )`
-    if (first_token.is_block() && first_token.block().is_paren()) {
-        auto& block = first_token.block();
-        if (!block.values().is_empty() && block.values().first().is(Token::Type::Ident))
-            return GeneralEnclosed { first_token.to_string() };
-    }
+    // `( <any-value>? )`
+    if (first_token.is_block() && first_token.block().is_paren())
+        return GeneralEnclosed { first_token.to_string() };
 
 
     tokens.rewind_to_position(start_position);
     tokens.rewind_to_position(start_position);
     return {};
     return {};