浏览代码

LibWeb: Fix `filter: drop-shadow` argument parsing

We were not discarding enough whitespace to actually get to the radius
and color values.
Jelle Raaijmakers 8 月之前
父节点
当前提交
c99fad77e1
共有 1 个文件被更改,包括 6 次插入5 次删除
  1. 6 5
      Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp

+ 6 - 5
Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp

@@ -5221,18 +5221,19 @@ RefPtr<CSSStyleValue> Parser::parse_filter_value_list_value(TokenStream<Componen
             auto maybe_color = parse_color_value(tokens);
             auto maybe_color = parse_color_value(tokens);
             auto x_offset = parse_length(tokens);
             auto x_offset = parse_length(tokens);
             tokens.discard_whitespace();
             tokens.discard_whitespace();
-            if (!x_offset.has_value() || !tokens.has_next_token()) {
+            if (!x_offset.has_value() || !tokens.has_next_token())
                 return {};
                 return {};
-            }
+
             auto y_offset = parse_length(tokens);
             auto y_offset = parse_length(tokens);
-            if (!y_offset.has_value()) {
+            tokens.discard_whitespace();
+            if (!y_offset.has_value())
                 return {};
                 return {};
-            }
+
             if (tokens.has_next_token()) {
             if (tokens.has_next_token()) {
                 maybe_radius = parse_length(tokens);
                 maybe_radius = parse_length(tokens);
+                tokens.discard_whitespace();
                 if (!maybe_color && (!maybe_radius.has_value() || tokens.has_next_token())) {
                 if (!maybe_color && (!maybe_radius.has_value() || tokens.has_next_token())) {
                     maybe_color = parse_color_value(tokens);
                     maybe_color = parse_color_value(tokens);
-                    tokens.discard_whitespace();
                     if (!maybe_color)
                     if (!maybe_color)
                         return {};
                         return {};
                 } else if (!maybe_radius.has_value()) {
                 } else if (!maybe_radius.has_value()) {