diff --git a/Tests/LibWeb/Screenshot/css-filter-drop-shadow.html b/Tests/LibWeb/Screenshot/css-filter-drop-shadow.html new file mode 100644 index 00000000000..84a285d8eb7 --- /dev/null +++ b/Tests/LibWeb/Screenshot/css-filter-drop-shadow.html @@ -0,0 +1,22 @@ + + + + +
+
+
+
+
+
+
+
+
+
diff --git a/Tests/LibWeb/Screenshot/images/css-filter-drop-shadow-ref.png b/Tests/LibWeb/Screenshot/images/css-filter-drop-shadow-ref.png new file mode 100644 index 00000000000..991ddf9c9cb Binary files /dev/null and b/Tests/LibWeb/Screenshot/images/css-filter-drop-shadow-ref.png differ diff --git a/Tests/LibWeb/Screenshot/reference/css-filter-drop-shadow-ref.html b/Tests/LibWeb/Screenshot/reference/css-filter-drop-shadow-ref.html new file mode 100644 index 00000000000..9c95cd8f72b --- /dev/null +++ b/Tests/LibWeb/Screenshot/reference/css-filter-drop-shadow-ref.html @@ -0,0 +1,10 @@ + + diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index a945d2318df..8af7a1069b8 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -5455,6 +5455,7 @@ RefPtr Parser::parse_filter_value_list_value(TokenStream maybe_radius = {}; auto maybe_color = parse_color_value(tokens); + tokens.discard_whitespace(); auto x_offset = parse_length(tokens); tokens.discard_whitespace(); if (!x_offset.has_value() || !tokens.has_next_token()) @@ -5476,8 +5477,12 @@ RefPtr Parser::parse_filter_value_list_value(TokenStream color = {}; + if (maybe_color) + color = maybe_color->to_color({}); + // FIXME: Support calculated offsets and radius - return if_no_more_tokens_return(FilterOperation::DropShadow { x_offset->value(), y_offset->value(), maybe_radius.map([](auto& it) { return it.value(); }), maybe_color->to_color({}) }); + return if_no_more_tokens_return(FilterOperation::DropShadow { x_offset->value(), y_offset->value(), maybe_radius.map([](auto& it) { return it.value(); }), color }); } else if (filter_token == FilterToken::HueRotate) { // hue-rotate( [ | ]? ) if (!tokens.has_next_token())