diff --git a/Libraries/LibWeb/Painting/BackgroundPainting.cpp b/Libraries/LibWeb/Painting/BackgroundPainting.cpp index 1d676c3c901..4faed6b75e2 100644 --- a/Libraries/LibWeb/Painting/BackgroundPainting.cpp +++ b/Libraries/LibWeb/Painting/BackgroundPainting.cpp @@ -295,7 +295,7 @@ void paint_background(PaintContext& context, PaintableBox const& paintable_box, fill_rect.unite(image_device_rect); }); display_list_recorder.fill_rect(fill_rect.to_type(), color.value()); - } else if (is(image) && repeat_x && repeat_y && !repeat_x_has_gap && !repeat_y_has_gap) { + } else if (is(image) && (repeat_x || repeat_y) && !repeat_x_has_gap && !repeat_y_has_gap) { // Use a dedicated painting command for repeated images instead of recording a separate command for each instance // of a repeated background, so the painter has the opportunity to optimize the painting of repeated images. auto dest_rect = context.rounded_device_rect(image_rect); diff --git a/Tests/LibWeb/Screenshot/expected/css-background-repeat-x-and-zoomed-ref.html b/Tests/LibWeb/Screenshot/expected/css-background-repeat-x-and-zoomed-ref.html new file mode 100644 index 00000000000..fdb1100a93d --- /dev/null +++ b/Tests/LibWeb/Screenshot/expected/css-background-repeat-x-and-zoomed-ref.html @@ -0,0 +1,7 @@ + + + diff --git a/Tests/LibWeb/Screenshot/images/css-background-repeat-x-and-zoomed-ref.png b/Tests/LibWeb/Screenshot/images/css-background-repeat-x-and-zoomed-ref.png new file mode 100644 index 00000000000..fa053f30e7f Binary files /dev/null and b/Tests/LibWeb/Screenshot/images/css-background-repeat-x-and-zoomed-ref.png differ diff --git a/Tests/LibWeb/Screenshot/input/css-background-repeat-x-and-zoomed.html b/Tests/LibWeb/Screenshot/input/css-background-repeat-x-and-zoomed.html new file mode 100644 index 00000000000..36398adba05 --- /dev/null +++ b/Tests/LibWeb/Screenshot/input/css-background-repeat-x-and-zoomed.html @@ -0,0 +1,15 @@ + + + + + +
+