diff --git a/Tests/LibWeb/Screenshot/expected/acid2-ref.html b/Tests/LibWeb/Screenshot/expected/acid2-ref.html deleted file mode 100644 index bc5ee050d8..0000000000 --- a/Tests/LibWeb/Screenshot/expected/acid2-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/acid2.png b/Tests/LibWeb/Screenshot/expected/acid2.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/acid2.png rename to Tests/LibWeb/Screenshot/expected/acid2.png diff --git a/Tests/LibWeb/Screenshot/expected/alt-frame-ref.html b/Tests/LibWeb/Screenshot/expected/alt-frame-ref.html deleted file mode 100644 index 8d1abcf9c1..0000000000 --- a/Tests/LibWeb/Screenshot/expected/alt-frame-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/alt-frame.png b/Tests/LibWeb/Screenshot/expected/alt-frame.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/alt-frame.png rename to Tests/LibWeb/Screenshot/expected/alt-frame.png diff --git a/Tests/LibWeb/Screenshot/expected/border-radius-ref.html b/Tests/LibWeb/Screenshot/expected/border-radius-ref.html deleted file mode 100644 index 34777b7156..0000000000 --- a/Tests/LibWeb/Screenshot/expected/border-radius-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/border-radius-ref.png b/Tests/LibWeb/Screenshot/expected/border-radius.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/border-radius-ref.png rename to Tests/LibWeb/Screenshot/expected/border-radius.png diff --git a/Tests/LibWeb/Screenshot/expected/can-load-images-in-sandboxed-iframe-with-no-scripting-ref.html b/Tests/LibWeb/Screenshot/expected/can-load-images-in-sandboxed-iframe-with-no-scripting-ref.html deleted file mode 100644 index 3370d8e0ae..0000000000 --- a/Tests/LibWeb/Screenshot/expected/can-load-images-in-sandboxed-iframe-with-no-scripting-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/can-load-images-in-sandboxed-iframe-with-no-scripting-ref.png b/Tests/LibWeb/Screenshot/expected/can-load-images-in-sandboxed-iframe-with-no-scripting.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/can-load-images-in-sandboxed-iframe-with-no-scripting-ref.png rename to Tests/LibWeb/Screenshot/expected/can-load-images-in-sandboxed-iframe-with-no-scripting.png diff --git a/Tests/LibWeb/Screenshot/expected/canvas-arcs-and-ellipses-ref.html b/Tests/LibWeb/Screenshot/expected/canvas-arcs-and-ellipses-ref.html deleted file mode 100644 index 80221606cd..0000000000 --- a/Tests/LibWeb/Screenshot/expected/canvas-arcs-and-ellipses-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/canvas-arcs-and-ellipses-ref.png b/Tests/LibWeb/Screenshot/expected/canvas-arcs-and-ellipses.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/canvas-arcs-and-ellipses-ref.png rename to Tests/LibWeb/Screenshot/expected/canvas-arcs-and-ellipses.png diff --git a/Tests/LibWeb/Screenshot/expected/canvas-fillstyle-gradients-ref.html b/Tests/LibWeb/Screenshot/expected/canvas-fillstyle-gradients-ref.html deleted file mode 100644 index d84af5164e..0000000000 --- a/Tests/LibWeb/Screenshot/expected/canvas-fillstyle-gradients-ref.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/canvas-fillstyle-gradients-ref.png b/Tests/LibWeb/Screenshot/expected/canvas-fillstyle-gradients.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/canvas-fillstyle-gradients-ref.png rename to Tests/LibWeb/Screenshot/expected/canvas-fillstyle-gradients.png diff --git a/Tests/LibWeb/Screenshot/expected/canvas-fillstyle-opacity-ref.html b/Tests/LibWeb/Screenshot/expected/canvas-fillstyle-opacity-ref.html deleted file mode 100644 index cb14bda9ea..0000000000 --- a/Tests/LibWeb/Screenshot/expected/canvas-fillstyle-opacity-ref.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/canvas-fillstyle-opacity.png b/Tests/LibWeb/Screenshot/expected/canvas-fillstyle-opacity.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/canvas-fillstyle-opacity.png rename to Tests/LibWeb/Screenshot/expected/canvas-fillstyle-opacity.png diff --git a/Tests/LibWeb/Screenshot/expected/canvas-fillstyle-rgb-ref.html b/Tests/LibWeb/Screenshot/expected/canvas-fillstyle-rgb-ref.html deleted file mode 100644 index 3aa038fc9a..0000000000 --- a/Tests/LibWeb/Screenshot/expected/canvas-fillstyle-rgb-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/expected/canvas-fillstyle-rgb.png b/Tests/LibWeb/Screenshot/expected/canvas-fillstyle-rgb.png new file mode 100644 index 0000000000..443e7b8d67 Binary files /dev/null and b/Tests/LibWeb/Screenshot/expected/canvas-fillstyle-rgb.png differ diff --git a/Tests/LibWeb/Screenshot/expected/canvas-filters-ref.html b/Tests/LibWeb/Screenshot/expected/canvas-filters-ref.html deleted file mode 100644 index 5ff3d5e540..0000000000 --- a/Tests/LibWeb/Screenshot/expected/canvas-filters-ref.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/canvas-filters-ref.png b/Tests/LibWeb/Screenshot/expected/canvas-filters.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/canvas-filters-ref.png rename to Tests/LibWeb/Screenshot/expected/canvas-filters.png diff --git a/Tests/LibWeb/Screenshot/expected/canvas-implict-moves-and-lines-ref.html b/Tests/LibWeb/Screenshot/expected/canvas-implict-moves-and-lines-ref.html deleted file mode 100644 index 6c98d495cd..0000000000 --- a/Tests/LibWeb/Screenshot/expected/canvas-implict-moves-and-lines-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/canvas-implict-moves-and-lines-ref.png b/Tests/LibWeb/Screenshot/expected/canvas-implict-moves-and-lines.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/canvas-implict-moves-and-lines-ref.png rename to Tests/LibWeb/Screenshot/expected/canvas-implict-moves-and-lines.png diff --git a/Tests/LibWeb/Screenshot/expected/canvas-path-rect-ref.html b/Tests/LibWeb/Screenshot/expected/canvas-path-rect-ref.html deleted file mode 100644 index 09e780625d..0000000000 --- a/Tests/LibWeb/Screenshot/expected/canvas-path-rect-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/canvas-path-rect-ref.png b/Tests/LibWeb/Screenshot/expected/canvas-path-rect.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/canvas-path-rect-ref.png rename to Tests/LibWeb/Screenshot/expected/canvas-path-rect.png diff --git a/Tests/LibWeb/Screenshot/expected/canvas-pattern-ref.html b/Tests/LibWeb/Screenshot/expected/canvas-pattern-ref.html deleted file mode 100644 index c39cc09f6f..0000000000 --- a/Tests/LibWeb/Screenshot/expected/canvas-pattern-ref.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/expected/canvas-pattern-transform-ref.html b/Tests/LibWeb/Screenshot/expected/canvas-pattern-transform-ref.html deleted file mode 100644 index 135d1cf6d6..0000000000 --- a/Tests/LibWeb/Screenshot/expected/canvas-pattern-transform-ref.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/canvas-pattern-transform-ref.png b/Tests/LibWeb/Screenshot/expected/canvas-pattern-transform.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/canvas-pattern-transform-ref.png rename to Tests/LibWeb/Screenshot/expected/canvas-pattern-transform.png diff --git a/Tests/LibWeb/Screenshot/images/canvas-pattern-ref.png b/Tests/LibWeb/Screenshot/expected/canvas-pattern.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/canvas-pattern-ref.png rename to Tests/LibWeb/Screenshot/expected/canvas-pattern.png diff --git a/Tests/LibWeb/Screenshot/expected/canvas-shadow-ref.html b/Tests/LibWeb/Screenshot/expected/canvas-shadow-ref.html deleted file mode 100644 index d74bf5ef81..0000000000 --- a/Tests/LibWeb/Screenshot/expected/canvas-shadow-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/canvas-shadow-ref.png b/Tests/LibWeb/Screenshot/expected/canvas-shadow.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/canvas-shadow-ref.png rename to Tests/LibWeb/Screenshot/expected/canvas-shadow.png diff --git a/Tests/LibWeb/Screenshot/expected/canvas-stroke-styles-ref.html b/Tests/LibWeb/Screenshot/expected/canvas-stroke-styles-ref.html deleted file mode 100644 index bfb6c5219e..0000000000 --- a/Tests/LibWeb/Screenshot/expected/canvas-stroke-styles-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/canvas-stroke-styles-ref.png b/Tests/LibWeb/Screenshot/expected/canvas-stroke-styles.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/canvas-stroke-styles-ref.png rename to Tests/LibWeb/Screenshot/expected/canvas-stroke-styles.png diff --git a/Tests/LibWeb/Screenshot/expected/canvas-text-ref.html b/Tests/LibWeb/Screenshot/expected/canvas-text-ref.html deleted file mode 100644 index 314a11b5ce..0000000000 --- a/Tests/LibWeb/Screenshot/expected/canvas-text-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/canvas-text-ref.png b/Tests/LibWeb/Screenshot/expected/canvas-text.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/canvas-text-ref.png rename to Tests/LibWeb/Screenshot/expected/canvas-text.png diff --git a/Tests/LibWeb/Screenshot/expected/canvas-unpremultiplied-image-ref.html b/Tests/LibWeb/Screenshot/expected/canvas-unpremultiplied-image-ref.html deleted file mode 100644 index 5459182b99..0000000000 --- a/Tests/LibWeb/Screenshot/expected/canvas-unpremultiplied-image-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/canvas-unpremultiplied-image-ref.png b/Tests/LibWeb/Screenshot/expected/canvas-unpremultiplied-image.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/canvas-unpremultiplied-image-ref.png rename to Tests/LibWeb/Screenshot/expected/canvas-unpremultiplied-image.png diff --git a/Tests/LibWeb/Screenshot/expected/clip-path-basic-shapes-ref.html b/Tests/LibWeb/Screenshot/expected/clip-path-basic-shapes-ref.html deleted file mode 100644 index ebffdcccf5..0000000000 --- a/Tests/LibWeb/Screenshot/expected/clip-path-basic-shapes-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/clip-path-basic-shapes-ref.png b/Tests/LibWeb/Screenshot/expected/clip-path-basic-shapes.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/clip-path-basic-shapes-ref.png rename to Tests/LibWeb/Screenshot/expected/clip-path-basic-shapes.png diff --git a/Tests/LibWeb/Screenshot/expected/clip-path-polygon-ref.html b/Tests/LibWeb/Screenshot/expected/clip-path-polygon-ref.html deleted file mode 100644 index ad11e04bcf..0000000000 --- a/Tests/LibWeb/Screenshot/expected/clip-path-polygon-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/clip-path-polygon-ref.png b/Tests/LibWeb/Screenshot/expected/clip-path-polygon.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/clip-path-polygon-ref.png rename to Tests/LibWeb/Screenshot/expected/clip-path-polygon.png diff --git a/Tests/LibWeb/Screenshot/expected/clip-path-transformed-ref.html b/Tests/LibWeb/Screenshot/expected/clip-path-transformed-ref.html deleted file mode 100644 index 7e66bc728e..0000000000 --- a/Tests/LibWeb/Screenshot/expected/clip-path-transformed-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/clip-path-transformed-ref.png b/Tests/LibWeb/Screenshot/expected/clip-path-transformed.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/clip-path-transformed-ref.png rename to Tests/LibWeb/Screenshot/expected/clip-path-transformed.png diff --git a/Tests/LibWeb/Screenshot/expected/color-scheme-ref.html b/Tests/LibWeb/Screenshot/expected/color-scheme-ref.html deleted file mode 100644 index 4057d2a0f5..0000000000 --- a/Tests/LibWeb/Screenshot/expected/color-scheme-ref.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/color-scheme-ref.png b/Tests/LibWeb/Screenshot/expected/color-scheme.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/color-scheme-ref.png rename to Tests/LibWeb/Screenshot/expected/color-scheme.png diff --git a/Tests/LibWeb/Screenshot/expected/css-background-blob-url-ref.html b/Tests/LibWeb/Screenshot/expected/css-background-blob-url-ref.html deleted file mode 100644 index 9ab4c8d8fc..0000000000 --- a/Tests/LibWeb/Screenshot/expected/css-background-blob-url-ref.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/css-background-blob-url-ref.png b/Tests/LibWeb/Screenshot/expected/css-background-blob-url.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/css-background-blob-url-ref.png rename to Tests/LibWeb/Screenshot/expected/css-background-blob-url.png diff --git a/Tests/LibWeb/Screenshot/expected/css-background-clip-text-ref.html b/Tests/LibWeb/Screenshot/expected/css-background-clip-text-ref.html deleted file mode 100644 index 37a50d08c8..0000000000 --- a/Tests/LibWeb/Screenshot/expected/css-background-clip-text-ref.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/css-background-clip-text.png b/Tests/LibWeb/Screenshot/expected/css-background-clip-text.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/css-background-clip-text.png rename to Tests/LibWeb/Screenshot/expected/css-background-clip-text.png diff --git a/Tests/LibWeb/Screenshot/expected/css-background-position-ref.html b/Tests/LibWeb/Screenshot/expected/css-background-position-ref.html deleted file mode 100644 index 6bc75c7181..0000000000 --- a/Tests/LibWeb/Screenshot/expected/css-background-position-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/css-background-position-ref.png b/Tests/LibWeb/Screenshot/expected/css-background-position.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/css-background-position-ref.png rename to Tests/LibWeb/Screenshot/expected/css-background-position.png diff --git a/Tests/LibWeb/Screenshot/expected/css-background-repeat-ref.html b/Tests/LibWeb/Screenshot/expected/css-background-repeat-ref.html deleted file mode 100644 index c153f2edc6..0000000000 --- a/Tests/LibWeb/Screenshot/expected/css-background-repeat-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - 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 deleted file mode 100644 index fdb1100a93..0000000000 --- a/Tests/LibWeb/Screenshot/expected/css-background-repeat-x-and-zoomed-ref.html +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/css-background-repeat-x-and-zoomed-ref.png b/Tests/LibWeb/Screenshot/expected/css-background-repeat-x-and-zoomed.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/css-background-repeat-x-and-zoomed-ref.png rename to Tests/LibWeb/Screenshot/expected/css-background-repeat-x-and-zoomed.png diff --git a/Tests/LibWeb/Screenshot/images/css-background-repeat-ref.png b/Tests/LibWeb/Screenshot/expected/css-background-repeat.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/css-background-repeat-ref.png rename to Tests/LibWeb/Screenshot/expected/css-background-repeat.png diff --git a/Tests/LibWeb/Screenshot/expected/css-backgrounds-ref.html b/Tests/LibWeb/Screenshot/expected/css-backgrounds-ref.html deleted file mode 100644 index 2ff6ca2113..0000000000 --- a/Tests/LibWeb/Screenshot/expected/css-backgrounds-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/css-backgrounds-ref.png b/Tests/LibWeb/Screenshot/expected/css-backgrounds.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/css-backgrounds-ref.png rename to Tests/LibWeb/Screenshot/expected/css-backgrounds.png diff --git a/Tests/LibWeb/Screenshot/expected/css-border-style-double-ref.html b/Tests/LibWeb/Screenshot/expected/css-border-style-double-ref.html deleted file mode 100644 index 53649bcdd1..0000000000 --- a/Tests/LibWeb/Screenshot/expected/css-border-style-double-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/css-border-style-double-ref.png b/Tests/LibWeb/Screenshot/expected/css-border-style-double.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/css-border-style-double-ref.png rename to Tests/LibWeb/Screenshot/expected/css-border-style-double.png diff --git a/Tests/LibWeb/Screenshot/expected/css-border-style-groove-ref.html b/Tests/LibWeb/Screenshot/expected/css-border-style-groove-ref.html deleted file mode 100644 index 21a24c5d35..0000000000 --- a/Tests/LibWeb/Screenshot/expected/css-border-style-groove-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/css-border-style-groove-ref.png b/Tests/LibWeb/Screenshot/expected/css-border-style-groove.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/css-border-style-groove-ref.png rename to Tests/LibWeb/Screenshot/expected/css-border-style-groove.png diff --git a/Tests/LibWeb/Screenshot/expected/css-border-style-ridge-ref.html b/Tests/LibWeb/Screenshot/expected/css-border-style-ridge-ref.html deleted file mode 100644 index 90c4bceae1..0000000000 --- a/Tests/LibWeb/Screenshot/expected/css-border-style-ridge-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/css-border-style-ridge-ref.png b/Tests/LibWeb/Screenshot/expected/css-border-style-ridge.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/css-border-style-ridge-ref.png rename to Tests/LibWeb/Screenshot/expected/css-border-style-ridge.png diff --git a/Tests/LibWeb/Screenshot/expected/css-color-functions-ref.html b/Tests/LibWeb/Screenshot/expected/css-color-functions-ref.html deleted file mode 100644 index da9d7a7f0e..0000000000 --- a/Tests/LibWeb/Screenshot/expected/css-color-functions-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/css-color-functions-ref.png b/Tests/LibWeb/Screenshot/expected/css-color-functions.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/css-color-functions-ref.png rename to Tests/LibWeb/Screenshot/expected/css-color-functions.png diff --git a/Tests/LibWeb/Screenshot/expected/css-compositing-ref.html b/Tests/LibWeb/Screenshot/expected/css-compositing-ref.html deleted file mode 100644 index 1ae7551af6..0000000000 --- a/Tests/LibWeb/Screenshot/expected/css-compositing-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/css-compositing-ref.png b/Tests/LibWeb/Screenshot/expected/css-compositing.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/css-compositing-ref.png rename to Tests/LibWeb/Screenshot/expected/css-compositing.png diff --git a/Tests/LibWeb/Screenshot/expected/css-filter-drop-shadow-ref.html b/Tests/LibWeb/Screenshot/expected/css-filter-drop-shadow-ref.html deleted file mode 100644 index e6a6ab2543..0000000000 --- a/Tests/LibWeb/Screenshot/expected/css-filter-drop-shadow-ref.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/css-filter-drop-shadow-ref.png b/Tests/LibWeb/Screenshot/expected/css-filter-drop-shadow.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/css-filter-drop-shadow-ref.png rename to Tests/LibWeb/Screenshot/expected/css-filter-drop-shadow.png diff --git a/Tests/LibWeb/Screenshot/expected/css-filter-ref.html b/Tests/LibWeb/Screenshot/expected/css-filter-ref.html deleted file mode 100644 index d9e065adf0..0000000000 --- a/Tests/LibWeb/Screenshot/expected/css-filter-ref.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/css-filter-ref.png b/Tests/LibWeb/Screenshot/expected/css-filter.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/css-filter-ref.png rename to Tests/LibWeb/Screenshot/expected/css-filter.png diff --git a/Tests/LibWeb/Screenshot/expected/css-gradients-ref.html b/Tests/LibWeb/Screenshot/expected/css-gradients-ref.html deleted file mode 100644 index 2c1a33e567..0000000000 --- a/Tests/LibWeb/Screenshot/expected/css-gradients-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/css-gradients-ref.png b/Tests/LibWeb/Screenshot/expected/css-gradients.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/css-gradients-ref.png rename to Tests/LibWeb/Screenshot/expected/css-gradients.png diff --git a/Tests/LibWeb/Screenshot/expected/css-transform-box-ref.html b/Tests/LibWeb/Screenshot/expected/css-transform-box-ref.html deleted file mode 100644 index 1c92e5d764..0000000000 --- a/Tests/LibWeb/Screenshot/expected/css-transform-box-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/css-transform-box-ref.png b/Tests/LibWeb/Screenshot/expected/css-transform-box.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/css-transform-box-ref.png rename to Tests/LibWeb/Screenshot/expected/css-transform-box.png diff --git a/Tests/LibWeb/Screenshot/expected/details-open-then-closed-ref.html b/Tests/LibWeb/Screenshot/expected/details-open-then-closed-ref.html deleted file mode 100644 index cc4b3cd8d4..0000000000 --- a/Tests/LibWeb/Screenshot/expected/details-open-then-closed-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/details-open-then-closed.png b/Tests/LibWeb/Screenshot/expected/details-open-then-closed.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/details-open-then-closed.png rename to Tests/LibWeb/Screenshot/expected/details-open-then-closed.png diff --git a/Tests/LibWeb/Screenshot/expected/font-variation-settings-applies-to-system-provided-font-ref.html b/Tests/LibWeb/Screenshot/expected/font-variation-settings-applies-to-system-provided-font-ref.html deleted file mode 100644 index 36be1d4141..0000000000 --- a/Tests/LibWeb/Screenshot/expected/font-variation-settings-applies-to-system-provided-font-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/font-variation-settings-applies-to-system-provided-font-ref.png b/Tests/LibWeb/Screenshot/expected/font-variation-settings-applies-to-system-provided-font.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/font-variation-settings-applies-to-system-provided-font-ref.png rename to Tests/LibWeb/Screenshot/expected/font-variation-settings-applies-to-system-provided-font.png diff --git a/Tests/LibWeb/Screenshot/expected/gradient-interpolation-method-ref.html b/Tests/LibWeb/Screenshot/expected/gradient-interpolation-method-ref.html deleted file mode 100644 index e2fda52b7b..0000000000 --- a/Tests/LibWeb/Screenshot/expected/gradient-interpolation-method-ref.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/gradient-interpolation-method-ref.png b/Tests/LibWeb/Screenshot/expected/gradient-interpolation-method.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/gradient-interpolation-method-ref.png rename to Tests/LibWeb/Screenshot/expected/gradient-interpolation-method.png diff --git a/Tests/LibWeb/Screenshot/expected/image-downscaling-ref.html b/Tests/LibWeb/Screenshot/expected/image-downscaling-ref.html deleted file mode 100644 index bf2c238f0b..0000000000 --- a/Tests/LibWeb/Screenshot/expected/image-downscaling-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/image-downscaling-ref.png b/Tests/LibWeb/Screenshot/expected/image-downscaling.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/image-downscaling-ref.png rename to Tests/LibWeb/Screenshot/expected/image-downscaling.png diff --git a/Tests/LibWeb/Screenshot/expected/image-transformation-anti-aliasing-ref.html b/Tests/LibWeb/Screenshot/expected/image-transformation-anti-aliasing-ref.html deleted file mode 100644 index e259bbb107..0000000000 --- a/Tests/LibWeb/Screenshot/expected/image-transformation-anti-aliasing-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/image-transformation-anti-aliasing-ref.png b/Tests/LibWeb/Screenshot/expected/image-transformation-anti-aliasing.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/image-transformation-anti-aliasing-ref.png rename to Tests/LibWeb/Screenshot/expected/image-transformation-anti-aliasing.png diff --git a/Tests/LibWeb/Screenshot/expected/image-unpremultiplied-data-ref.html b/Tests/LibWeb/Screenshot/expected/image-unpremultiplied-data-ref.html deleted file mode 100644 index 1c832cd820..0000000000 --- a/Tests/LibWeb/Screenshot/expected/image-unpremultiplied-data-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/image-unpremultiplied-data-ref.png b/Tests/LibWeb/Screenshot/expected/image-unpremultiplied-data.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/image-unpremultiplied-data-ref.png rename to Tests/LibWeb/Screenshot/expected/image-unpremultiplied-data.png diff --git a/Tests/LibWeb/Screenshot/expected/inline-node-ref.html b/Tests/LibWeb/Screenshot/expected/inline-node-ref.html deleted file mode 100644 index ccdbaff8fd..0000000000 --- a/Tests/LibWeb/Screenshot/expected/inline-node-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/inline-node-ref.png b/Tests/LibWeb/Screenshot/expected/inline-node.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/inline-node-ref.png rename to Tests/LibWeb/Screenshot/expected/inline-node.png diff --git a/Tests/LibWeb/Screenshot/expected/input-placeholder-ref.html b/Tests/LibWeb/Screenshot/expected/input-placeholder-ref.html deleted file mode 100644 index 35ee76c6e0..0000000000 --- a/Tests/LibWeb/Screenshot/expected/input-placeholder-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/input-placeholder-ref.png b/Tests/LibWeb/Screenshot/expected/input-placeholder.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/input-placeholder-ref.png rename to Tests/LibWeb/Screenshot/expected/input-placeholder.png diff --git a/Tests/LibWeb/Screenshot/expected/linear-gradient-dithering-ref.html b/Tests/LibWeb/Screenshot/expected/linear-gradient-dithering-ref.html deleted file mode 100644 index 1bd0710cfd..0000000000 --- a/Tests/LibWeb/Screenshot/expected/linear-gradient-dithering-ref.html +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/linear-gradient-dithering-ref.png b/Tests/LibWeb/Screenshot/expected/linear-gradient-dithering.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/linear-gradient-dithering-ref.png rename to Tests/LibWeb/Screenshot/expected/linear-gradient-dithering.png diff --git a/Tests/LibWeb/Screenshot/expected/meter-ref.html b/Tests/LibWeb/Screenshot/expected/meter-ref.html deleted file mode 100644 index df650789de..0000000000 --- a/Tests/LibWeb/Screenshot/expected/meter-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/meter-ref.png b/Tests/LibWeb/Screenshot/expected/meter.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/meter-ref.png rename to Tests/LibWeb/Screenshot/expected/meter.png diff --git a/Tests/LibWeb/Screenshot/expected/nested-boxes-with-hidden-overflow-and-border-radius-ref.html b/Tests/LibWeb/Screenshot/expected/nested-boxes-with-hidden-overflow-and-border-radius-ref.html deleted file mode 100644 index de919732c7..0000000000 --- a/Tests/LibWeb/Screenshot/expected/nested-boxes-with-hidden-overflow-and-border-radius-ref.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/nested-boxes-with-hidden-overflow-and-border-radius-ref.png b/Tests/LibWeb/Screenshot/expected/nested-boxes-with-hidden-overflow-and-border-radius.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/nested-boxes-with-hidden-overflow-and-border-radius-ref.png rename to Tests/LibWeb/Screenshot/expected/nested-boxes-with-hidden-overflow-and-border-radius.png diff --git a/Tests/LibWeb/Screenshot/expected/object-fit-position-ref.html b/Tests/LibWeb/Screenshot/expected/object-fit-position-ref.html deleted file mode 100644 index 7a67e27210..0000000000 --- a/Tests/LibWeb/Screenshot/expected/object-fit-position-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/object-fit-position-ref.png b/Tests/LibWeb/Screenshot/expected/object-fit-position.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/object-fit-position-ref.png rename to Tests/LibWeb/Screenshot/expected/object-fit-position.png diff --git a/Tests/LibWeb/Screenshot/expected/ol-render-node-append-group-reversed-ref.html b/Tests/LibWeb/Screenshot/expected/ol-render-node-append-group-reversed-ref.html deleted file mode 100644 index 0363aa0207..0000000000 --- a/Tests/LibWeb/Screenshot/expected/ol-render-node-append-group-reversed-ref.html +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/ol-render-node-append-group-reversed-ref.png b/Tests/LibWeb/Screenshot/expected/ol-render-node-append-group-reversed.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/ol-render-node-append-group-reversed-ref.png rename to Tests/LibWeb/Screenshot/expected/ol-render-node-append-group-reversed.png diff --git a/Tests/LibWeb/Screenshot/expected/ol-render-node-append-reversed-ref.html b/Tests/LibWeb/Screenshot/expected/ol-render-node-append-reversed-ref.html deleted file mode 100644 index ac232c9c9b..0000000000 --- a/Tests/LibWeb/Screenshot/expected/ol-render-node-append-reversed-ref.html +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/ol-render-node-append-reversed-ref.png b/Tests/LibWeb/Screenshot/expected/ol-render-node-append-reversed.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/ol-render-node-append-reversed-ref.png rename to Tests/LibWeb/Screenshot/expected/ol-render-node-append-reversed.png diff --git a/Tests/LibWeb/Screenshot/expected/ol-render-node-insert-last-group-reversed-ref.html b/Tests/LibWeb/Screenshot/expected/ol-render-node-insert-last-group-reversed-ref.html deleted file mode 100644 index 51ff412880..0000000000 --- a/Tests/LibWeb/Screenshot/expected/ol-render-node-insert-last-group-reversed-ref.html +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/ol-render-node-insert-last-group-reversed-ref.png b/Tests/LibWeb/Screenshot/expected/ol-render-node-insert-last-group-reversed.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/ol-render-node-insert-last-group-reversed-ref.png rename to Tests/LibWeb/Screenshot/expected/ol-render-node-insert-last-group-reversed.png diff --git a/Tests/LibWeb/Screenshot/expected/ol-render-node-insert-last-reversed-ref.html b/Tests/LibWeb/Screenshot/expected/ol-render-node-insert-last-reversed-ref.html deleted file mode 100644 index b4df294d0f..0000000000 --- a/Tests/LibWeb/Screenshot/expected/ol-render-node-insert-last-reversed-ref.html +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/ol-render-node-insert-last-reversed-ref.png b/Tests/LibWeb/Screenshot/expected/ol-render-node-insert-last-reversed.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/ol-render-node-insert-last-reversed-ref.png rename to Tests/LibWeb/Screenshot/expected/ol-render-node-insert-last-reversed.png diff --git a/Tests/LibWeb/Screenshot/expected/opacity-stacking-ref.html b/Tests/LibWeb/Screenshot/expected/opacity-stacking-ref.html deleted file mode 100644 index be142b8776..0000000000 --- a/Tests/LibWeb/Screenshot/expected/opacity-stacking-ref.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/opacity-stacking-ref.png b/Tests/LibWeb/Screenshot/expected/opacity-stacking.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/opacity-stacking-ref.png rename to Tests/LibWeb/Screenshot/expected/opacity-stacking.png diff --git a/Tests/LibWeb/Screenshot/expected/ordered-list-ref.html b/Tests/LibWeb/Screenshot/expected/ordered-list-ref.html deleted file mode 100644 index 4187bcaa28..0000000000 --- a/Tests/LibWeb/Screenshot/expected/ordered-list-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/ordered-list-ref.png b/Tests/LibWeb/Screenshot/expected/ordered-list.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/ordered-list-ref.png rename to Tests/LibWeb/Screenshot/expected/ordered-list.png diff --git a/Tests/LibWeb/Screenshot/expected/outer-box-shadow-ref.html b/Tests/LibWeb/Screenshot/expected/outer-box-shadow-ref.html deleted file mode 100644 index 21b7abcaaf..0000000000 --- a/Tests/LibWeb/Screenshot/expected/outer-box-shadow-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/outer-box-shadow-ref.png b/Tests/LibWeb/Screenshot/expected/outer-box-shadow.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/outer-box-shadow-ref.png rename to Tests/LibWeb/Screenshot/expected/outer-box-shadow.png diff --git a/Tests/LibWeb/Screenshot/expected/overlapping-inset-shape.html b/Tests/LibWeb/Screenshot/expected/overlapping-inset-shape.html deleted file mode 100644 index 401e219146..0000000000 --- a/Tests/LibWeb/Screenshot/expected/overlapping-inset-shape.html +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/overlapping-inset-shape.png b/Tests/LibWeb/Screenshot/expected/overlapping-inset-shape.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/overlapping-inset-shape.png rename to Tests/LibWeb/Screenshot/expected/overlapping-inset-shape.png diff --git a/Tests/LibWeb/Screenshot/expected/selection-partial-nodes-ref.html b/Tests/LibWeb/Screenshot/expected/selection-partial-nodes-ref.html deleted file mode 100644 index 6f347aa009..0000000000 --- a/Tests/LibWeb/Screenshot/expected/selection-partial-nodes-ref.html +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/selection-partial-nodes-ref.png b/Tests/LibWeb/Screenshot/expected/selection-partial-nodes.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/selection-partial-nodes-ref.png rename to Tests/LibWeb/Screenshot/expected/selection-partial-nodes.png diff --git a/Tests/LibWeb/Screenshot/images/selection-start-in-end-node-ref.png b/Tests/LibWeb/Screenshot/expected/selection-start-in-end-node-2.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/selection-start-in-end-node-ref.png rename to Tests/LibWeb/Screenshot/expected/selection-start-in-end-node-2.png diff --git a/Tests/LibWeb/Screenshot/expected/selection-start-in-end-node-3.png b/Tests/LibWeb/Screenshot/expected/selection-start-in-end-node-3.png new file mode 100644 index 0000000000..d3e3fda1b5 Binary files /dev/null and b/Tests/LibWeb/Screenshot/expected/selection-start-in-end-node-3.png differ diff --git a/Tests/LibWeb/Screenshot/expected/selection-start-in-end-node-ref.html b/Tests/LibWeb/Screenshot/expected/selection-start-in-end-node-ref.html deleted file mode 100644 index d647397b77..0000000000 --- a/Tests/LibWeb/Screenshot/expected/selection-start-in-end-node-ref.html +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/expected/selection-start-in-end-node.png b/Tests/LibWeb/Screenshot/expected/selection-start-in-end-node.png new file mode 100644 index 0000000000..d3e3fda1b5 Binary files /dev/null and b/Tests/LibWeb/Screenshot/expected/selection-start-in-end-node.png differ diff --git a/Tests/LibWeb/Screenshot/expected/selection-text-color-ref.html b/Tests/LibWeb/Screenshot/expected/selection-text-color-ref.html deleted file mode 100644 index 38686b7412..0000000000 --- a/Tests/LibWeb/Screenshot/expected/selection-text-color-ref.html +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/selection-text-color-ref.png b/Tests/LibWeb/Screenshot/expected/selection-text-color.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/selection-text-color-ref.png rename to Tests/LibWeb/Screenshot/expected/selection-text-color.png diff --git a/Tests/LibWeb/Screenshot/expected/selection-trailing-whitespace-ref.html b/Tests/LibWeb/Screenshot/expected/selection-trailing-whitespace-ref.html deleted file mode 100644 index 28b637ae8d..0000000000 --- a/Tests/LibWeb/Screenshot/expected/selection-trailing-whitespace-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/selection-trailing-whitespace-ref.png b/Tests/LibWeb/Screenshot/expected/selection-trailing-whitespace.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/selection-trailing-whitespace-ref.png rename to Tests/LibWeb/Screenshot/expected/selection-trailing-whitespace.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-axis-aligned-lines-ref.html b/Tests/LibWeb/Screenshot/expected/svg-axis-aligned-lines-ref.html deleted file mode 100644 index 341d20533f..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-axis-aligned-lines-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-axis-aligned-lines-ref.png b/Tests/LibWeb/Screenshot/expected/svg-axis-aligned-lines.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-axis-aligned-lines-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-axis-aligned-lines.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-background-no-natural-size-ref.html b/Tests/LibWeb/Screenshot/expected/svg-background-no-natural-size-ref.html deleted file mode 100644 index bc985ac3ae..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-background-no-natural-size-ref.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-background-no-natural-size-ref.png b/Tests/LibWeb/Screenshot/expected/svg-background-no-natural-size.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-background-no-natural-size-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-background-no-natural-size.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-clip-path-and-mask-ref.html b/Tests/LibWeb/Screenshot/expected/svg-clip-path-and-mask-ref.html deleted file mode 100644 index 96de745c8f..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-clip-path-and-mask-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-clip-path-and-mask-ref.png b/Tests/LibWeb/Screenshot/expected/svg-clip-path-and-mask.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-clip-path-and-mask-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-clip-path-and-mask.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-clip-path-transform-ref.html b/Tests/LibWeb/Screenshot/expected/svg-clip-path-transform-ref.html deleted file mode 100644 index b301885af8..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-clip-path-transform-ref.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-clip-path-transform-ref.png b/Tests/LibWeb/Screenshot/expected/svg-clip-path-transform.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-clip-path-transform-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-clip-path-transform.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-clip-rule-ref.html b/Tests/LibWeb/Screenshot/expected/svg-clip-rule-ref.html deleted file mode 100644 index b4613f6fa4..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-clip-rule-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-clip-rule-ref.png b/Tests/LibWeb/Screenshot/expected/svg-clip-rule.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-clip-rule-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-clip-rule.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-feTurbulence-fractalNoise-ref.html b/Tests/LibWeb/Screenshot/expected/svg-feTurbulence-fractalNoise-ref.html deleted file mode 100644 index f1be63bfc1..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-feTurbulence-fractalNoise-ref.html +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-feTurbulence-fractalNoise-ref.png b/Tests/LibWeb/Screenshot/expected/svg-feTurbulence-fractalNoise.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-feTurbulence-fractalNoise-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-feTurbulence-fractalNoise.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-feTurbulence-ref.html b/Tests/LibWeb/Screenshot/expected/svg-feTurbulence-ref.html deleted file mode 100644 index f5eb9bc97b..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-feTurbulence-ref.html +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-feTurbulence-ref.png b/Tests/LibWeb/Screenshot/expected/svg-feTurbulence.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-feTurbulence-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-feTurbulence.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-filters-lb-website-ref.html b/Tests/LibWeb/Screenshot/expected/svg-filters-lb-website-ref.html deleted file mode 100644 index e764282d43..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-filters-lb-website-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-filters-lb-website-ref.png b/Tests/LibWeb/Screenshot/expected/svg-filters-lb-website.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-filters-lb-website-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-filters-lb-website.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-foreign-object-mask-ref.html b/Tests/LibWeb/Screenshot/expected/svg-foreign-object-mask-ref.html deleted file mode 100644 index d282829b86..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-foreign-object-mask-ref.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-foreign-object-mask-ref.png b/Tests/LibWeb/Screenshot/expected/svg-foreign-object-mask.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-foreign-object-mask-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-foreign-object-mask.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-gradient-componentTransfer-ref.html b/Tests/LibWeb/Screenshot/expected/svg-gradient-componentTransfer-ref.html deleted file mode 100644 index 154c84fcc3..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-gradient-componentTransfer-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-gradient-componentTransfer-ref.png b/Tests/LibWeb/Screenshot/expected/svg-gradient-componentTransfer.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-gradient-componentTransfer-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-gradient-componentTransfer.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-gradient-objectBoundingBox-ref.html b/Tests/LibWeb/Screenshot/expected/svg-gradient-objectBoundingBox-ref.html deleted file mode 100644 index 8182b6f50d..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-gradient-objectBoundingBox-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-gradient-objectBoundingBox-ref.png b/Tests/LibWeb/Screenshot/expected/svg-gradient-objectBoundingBox.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-gradient-objectBoundingBox-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-gradient-objectBoundingBox.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-gradient-paint-transformation-ref.html b/Tests/LibWeb/Screenshot/expected/svg-gradient-paint-transformation-ref.html deleted file mode 100644 index 980d9a4ee0..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-gradient-paint-transformation-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-gradient-paint-transformation-ref.png b/Tests/LibWeb/Screenshot/expected/svg-gradient-paint-transformation.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-gradient-paint-transformation-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-gradient-paint-transformation.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-gradient-spreadMethod-ref.html b/Tests/LibWeb/Screenshot/expected/svg-gradient-spreadMethod-ref.html deleted file mode 100644 index c346da4fec..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-gradient-spreadMethod-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-gradient-spreadMethod-ref.png b/Tests/LibWeb/Screenshot/expected/svg-gradient-spreadMethod.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-gradient-spreadMethod-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-gradient-spreadMethod.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-gradient-userSpaceOnUse-ref.html b/Tests/LibWeb/Screenshot/expected/svg-gradient-userSpaceOnUse-ref.html deleted file mode 100644 index 38466d302d..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-gradient-userSpaceOnUse-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-gradient-userSpaceOnUse-ref.png b/Tests/LibWeb/Screenshot/expected/svg-gradient-userSpaceOnUse.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-gradient-userSpaceOnUse-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-gradient-userSpaceOnUse.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-maskContentUnits-ref.html b/Tests/LibWeb/Screenshot/expected/svg-maskContentUnits-ref.html deleted file mode 100644 index 056966f584..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-maskContentUnits-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-maskContentUnits-ref.png b/Tests/LibWeb/Screenshot/expected/svg-maskContentUnits.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-maskContentUnits-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-maskContentUnits.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-non-local-clip-path-ref.html b/Tests/LibWeb/Screenshot/expected/svg-non-local-clip-path-ref.html deleted file mode 100644 index b6c47a277b..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-non-local-clip-path-ref.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-non-local-clip-path-ref.png b/Tests/LibWeb/Screenshot/expected/svg-non-local-clip-path.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-non-local-clip-path-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-non-local-clip-path.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-path-offset-rounding-ref.html b/Tests/LibWeb/Screenshot/expected/svg-path-offset-rounding-ref.html deleted file mode 100644 index acdd668fea..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-path-offset-rounding-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-path-offset-rounding-ref.png b/Tests/LibWeb/Screenshot/expected/svg-path-offset-rounding.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-path-offset-rounding-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-path-offset-rounding.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-paths-cardinal-directions-less-than-1px-wide-ref.html b/Tests/LibWeb/Screenshot/expected/svg-paths-cardinal-directions-less-than-1px-wide-ref.html deleted file mode 100644 index 8c9a97aabf..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-paths-cardinal-directions-less-than-1px-wide-ref.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/Tests/LibWeb/Screenshot/expected/svg-paths-cardinal-directions-less-than-1px-wide.png b/Tests/LibWeb/Screenshot/expected/svg-paths-cardinal-directions-less-than-1px-wide.png new file mode 100644 index 0000000000..61cc55a9bf Binary files /dev/null and b/Tests/LibWeb/Screenshot/expected/svg-paths-cardinal-directions-less-than-1px-wide.png differ diff --git a/Tests/LibWeb/Screenshot/expected/svg-radialGradient-ref.html b/Tests/LibWeb/Screenshot/expected/svg-radialGradient-ref.html deleted file mode 100644 index bb854e11ce..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-radialGradient-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-radialGradient-ref.png b/Tests/LibWeb/Screenshot/expected/svg-radialGradient.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-radialGradient-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-radialGradient.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-rotation-anti-aliasing-ref.html b/Tests/LibWeb/Screenshot/expected/svg-rotation-anti-aliasing-ref.html deleted file mode 100644 index 88946c3e25..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-rotation-anti-aliasing-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-rotation-anti-aliasing-ref.png b/Tests/LibWeb/Screenshot/expected/svg-rotation-anti-aliasing.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-rotation-anti-aliasing-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-rotation-anti-aliasing.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-simple-clipPath-ref.html b/Tests/LibWeb/Screenshot/expected/svg-simple-clipPath-ref.html deleted file mode 100644 index facda443ff..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-simple-clipPath-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-simple-clipPath-ref.png b/Tests/LibWeb/Screenshot/expected/svg-simple-clipPath.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-simple-clipPath-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-simple-clipPath.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-stroke-paintstyle-with-opacity-ref.html b/Tests/LibWeb/Screenshot/expected/svg-stroke-paintstyle-with-opacity-ref.html deleted file mode 100644 index 7c1795f92a..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-stroke-paintstyle-with-opacity-ref.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-stroke-paintstyle-with-opacity-ref.png b/Tests/LibWeb/Screenshot/expected/svg-stroke-paintstyle-with-opacity.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-stroke-paintstyle-with-opacity-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-stroke-paintstyle-with-opacity.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-stroke-styles-ref.html b/Tests/LibWeb/Screenshot/expected/svg-stroke-styles-ref.html deleted file mode 100644 index 6d695cac1b..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-stroke-styles-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-stroke-styles-ref.png b/Tests/LibWeb/Screenshot/expected/svg-stroke-styles.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-stroke-styles-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-stroke-styles.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-text-effects-ref.html b/Tests/LibWeb/Screenshot/expected/svg-text-effects-ref.html deleted file mode 100644 index 46b6c8d776..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-text-effects-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-text-effects-ref.png b/Tests/LibWeb/Screenshot/expected/svg-text-effects.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-text-effects-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-text-effects.png diff --git a/Tests/LibWeb/Screenshot/expected/svg-textPath-ref.html b/Tests/LibWeb/Screenshot/expected/svg-textPath-ref.html deleted file mode 100644 index ab7c011d92..0000000000 --- a/Tests/LibWeb/Screenshot/expected/svg-textPath-ref.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/Tests/LibWeb/Screenshot/images/svg-textPath-ref.png b/Tests/LibWeb/Screenshot/expected/svg-textPath.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/svg-textPath-ref.png rename to Tests/LibWeb/Screenshot/expected/svg-textPath.png diff --git a/Tests/LibWeb/Screenshot/expected/text-decorations-ref.html b/Tests/LibWeb/Screenshot/expected/text-decorations-ref.html deleted file mode 100644 index 4ebf51c8f5..0000000000 --- a/Tests/LibWeb/Screenshot/expected/text-decorations-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/text-decorations.png b/Tests/LibWeb/Screenshot/expected/text-decorations.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/text-decorations.png rename to Tests/LibWeb/Screenshot/expected/text-decorations.png diff --git a/Tests/LibWeb/Screenshot/expected/text-direction-ref.html b/Tests/LibWeb/Screenshot/expected/text-direction-ref.html deleted file mode 100644 index 157c5c5d77..0000000000 --- a/Tests/LibWeb/Screenshot/expected/text-direction-ref.html +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/text-direction-ref.png b/Tests/LibWeb/Screenshot/expected/text-direction.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/text-direction-ref.png rename to Tests/LibWeb/Screenshot/expected/text-direction.png diff --git a/Tests/LibWeb/Screenshot/expected/text-shadow-ref.html b/Tests/LibWeb/Screenshot/expected/text-shadow-ref.html deleted file mode 100644 index 33d17cc678..0000000000 --- a/Tests/LibWeb/Screenshot/expected/text-shadow-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/text-shadow-ref.png b/Tests/LibWeb/Screenshot/expected/text-shadow.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/text-shadow-ref.png rename to Tests/LibWeb/Screenshot/expected/text-shadow.png diff --git a/Tests/LibWeb/Screenshot/expected/variable-font-weight-ref.html b/Tests/LibWeb/Screenshot/expected/variable-font-weight-ref.html deleted file mode 100644 index e023d169af..0000000000 --- a/Tests/LibWeb/Screenshot/expected/variable-font-weight-ref.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Tests/LibWeb/Screenshot/images/variable-font-weight-ref.png b/Tests/LibWeb/Screenshot/expected/variable-font-weight.png similarity index 100% rename from Tests/LibWeb/Screenshot/images/variable-font-weight-ref.png rename to Tests/LibWeb/Screenshot/expected/variable-font-weight.png diff --git a/Tests/LibWeb/Screenshot/images/canvas-fillstyle-rgb.png b/Tests/LibWeb/Screenshot/images/canvas-fillstyle-rgb.png deleted file mode 100644 index 98df06fd15..0000000000 Binary files a/Tests/LibWeb/Screenshot/images/canvas-fillstyle-rgb.png and /dev/null differ diff --git a/Tests/LibWeb/Screenshot/images/svg-paths-cardinal-directions-less-than-1px-wide-ref.png b/Tests/LibWeb/Screenshot/images/svg-paths-cardinal-directions-less-than-1px-wide-ref.png deleted file mode 100644 index 74051eb06e..0000000000 Binary files a/Tests/LibWeb/Screenshot/images/svg-paths-cardinal-directions-less-than-1px-wide-ref.png and /dev/null differ diff --git a/Tests/LibWeb/Screenshot/input/acid2.html b/Tests/LibWeb/Screenshot/input/acid2.html index fae7e9989e..44bdbffa21 100644 --- a/Tests/LibWeb/Screenshot/input/acid2.html +++ b/Tests/LibWeb/Screenshot/input/acid2.html @@ -5,8 +5,6 @@ - - The Second Acid Test diff --git a/Tests/LibWeb/Screenshot/input/canvas-arcs-and-ellipses.html b/Tests/LibWeb/Screenshot/input/canvas-arcs-and-ellipses.html index 8097b9197f..2c5aba5f9d 100644 --- a/Tests/LibWeb/Screenshot/input/canvas-arcs-and-ellipses.html +++ b/Tests/LibWeb/Screenshot/input/canvas-arcs-and-ellipses.html @@ -1,5 +1,4 @@ - - diff --git a/Tests/LibWeb/Screenshot/input/svg-background-no-natural-size.html b/Tests/LibWeb/Screenshot/input/svg-background-no-natural-size.html index b2a2257f02..17a8356a57 100644 --- a/Tests/LibWeb/Screenshot/input/svg-background-no-natural-size.html +++ b/Tests/LibWeb/Screenshot/input/svg-background-no-natural-size.html @@ -1,5 +1,4 @@ - @@ -97,17 +99,7 @@ def create_test(test_name: str, test_type: str, is_async: bool = False) -> None: """ - expected_boilerplate = f""" - - -""" + expected_boilerplate = "" # layout tests are async agnostic elif test_type == "Layout": @@ -131,10 +123,14 @@ to produce the expected output for this test # Create input and expected files input_boilerplate, expected_boilerplate = generate_boilerplate() input_file.write_text(input_boilerplate) - if has_output: + if has_output and expected_boilerplate: output_file.write_text(expected_boilerplate) print(f"{test_type} test '{Path(test_name).with_suffix('.html')}' created successfully.") + if test_type == "Screenshot": + print( + f"Run ./Meta/ladybird.py run test-web --rebaseline -f Screenshot/input/{Path(test_name).with_suffix('.html')} to generate the expected PNG" + ) def main(): diff --git a/Tests/LibWeb/test-web/TestWeb.h b/Tests/LibWeb/test-web/TestWeb.h index dc1286028b..125c9bdbbe 100644 --- a/Tests/LibWeb/test-web/TestWeb.h +++ b/Tests/LibWeb/test-web/TestWeb.h @@ -24,6 +24,7 @@ enum class TestMode { Layout, Text, Ref, + Screenshot, Crash, }; diff --git a/Tests/LibWeb/test-web/main.cpp b/Tests/LibWeb/test-web/main.cpp index 4f3b0396d0..49df1cb050 100644 --- a/Tests/LibWeb/test-web/main.cpp +++ b/Tests/LibWeb/test-web/main.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -394,6 +396,29 @@ static ErrorOr collect_ref_tests(Application const& app, Vector& tes return {}; } +static ErrorOr collect_screenshot_tests(Application const& app, Vector& tests, StringView path, StringView trail) +{ + Core::DirIterator it(ByteString::formatted("{}/input/{}", path, trail), Core::DirIterator::Flags::SkipDots); + while (it.has_next()) { + auto name = it.next_path(); + auto input_path = TRY(FileSystem::real_path(ByteString::formatted("{}/input/{}/{}", path, trail, name))); + + if (FileSystem::is_directory(input_path)) { + TRY(collect_screenshot_tests(app, tests, path, ByteString::formatted("{}/{}", trail, name))); + continue; + } + + if (!is_valid_test_name(name)) + continue; + + auto expectation_path = ByteString::formatted("{}/expected/{}/{}.png", path, trail, LexicalPath::title(name)); + auto relative_path = LexicalPath::relative_path(input_path, app.test_root_path).release_value(); + tests.append({ TestMode::Screenshot, input_path, move(expectation_path), relative_path, relative_path }); + } + + return {}; +} + static ErrorOr collect_crash_tests(Application const& app, Vector& tests, StringView path, StringView trail) { Core::DirIterator it(ByteString::formatted("{}/{}", path, trail), Core::DirIterator::Flags::SkipDots); @@ -458,6 +483,8 @@ static ByteString test_mode_to_string(TestMode mode) return "Text"sv; case TestMode::Ref: return "Ref"sv; + case TestMode::Screenshot: + return "Screenshot"sv; case TestMode::Crash: return "Crash"sv; } @@ -519,7 +546,7 @@ static ErrorOr generate_result_files(ReadonlySpan tests, ReadonlySpa test_mode_to_string(test.mode), has_stdout ? "true" : "false", has_stderr ? "true" : "false"); - if (test.mode == TestMode::Ref && test.diff_pixel_error_count > 0) + if ((test.mode == TestMode::Ref || test.mode == TestMode::Screenshot) && test.diff_pixel_error_count > 0) js.appendff(", \"pixelErrors\": {}, \"maxChannelDiff\": {}", test.diff_pixel_error_count, test.diff_maximum_error); js.append(" }"sv); } @@ -846,6 +873,47 @@ static void run_dump_test(TestWebView& view, TestRunContext& context, Test& test test.timeout_timer->start(); } +static ErrorOr dump_screenshot_to_file(Gfx::Bitmap const& bitmap, StringView path) +{ + auto screenshot_file = TRY(Core::File::open(path, Core::File::OpenMode::Write)); + auto encoded_data = TRY(Gfx::PNGWriter::encode(bitmap)); + TRY(screenshot_file->write_until_depleted(encoded_data)); + return {}; +} + +static ErrorOr write_screenshot_failure_results(Test& test, Gfx::Bitmap const& actual, Gfx::Bitmap const& expected) +{ + auto& app = Application::the(); + + auto output_dir = LexicalPath::join(app.results_directory, LexicalPath::dirname(test.safe_relative_path)).string(); + TRY(Core::Directory::create(output_dir, Core::Directory::CreateDirectories::Yes)); + + auto base_path = LexicalPath::join(app.results_directory, test.safe_relative_path).string(); + TRY(dump_screenshot_to_file(actual, ByteString::formatted("{}.actual.png", base_path))); + TRY(dump_screenshot_to_file(expected, ByteString::formatted("{}.expected.png", base_path))); + + // Generate a diff image and compute stats. + if (actual.width() == expected.width() && actual.height() == expected.height()) { + auto diff = actual.diff(expected); + test.diff_pixel_error_count = diff.pixel_error_count; + test.diff_maximum_error = diff.maximum_error; + + auto diff_bitmap = TRY(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, { actual.width(), actual.height() })); + for (int y = 0; y < actual.height(); ++y) { + for (int x = 0; x < actual.width(); ++x) { + auto pixel = actual.get_pixel(x, y); + if (pixel != expected.get_pixel(x, y)) + diff_bitmap->set_pixel(x, y, Gfx::Color(255, 0, 0)); + else + diff_bitmap->set_pixel(x, y, pixel.mixed_with(expected.get_pixel(x, y), 0.5f).mixed_with(Gfx::Color::White, 0.8f)); + } + } + TRY(dump_screenshot_to_file(*diff_bitmap, ByteString::formatted("{}.diff.png", base_path))); + } + + return {}; +} + static void run_ref_test(TestWebView& view, TestRunContext& context, Test& test, URL::URL const& url, int timeout_in_milliseconds) { auto test_index = test.index; @@ -862,43 +930,7 @@ static void run_ref_test(TestWebView& view, TestRunContext& context, Test& test, if (should_match == screenshot_matches) return TestResult::Pass; - auto& app = Application::the(); - auto const& actual = *test.actual_screenshot; - auto const& expected = *test.expectation_screenshot; - - auto dump_screenshot = [](Gfx::Bitmap const& bitmap, StringView path) -> ErrorOr { - auto screenshot_file = TRY(Core::File::open(path, Core::File::OpenMode::Write)); - auto encoded_data = TRY(Gfx::PNGWriter::encode(bitmap)); - TRY(screenshot_file->write_until_depleted(encoded_data)); - return {}; - }; - - auto output_dir = LexicalPath::join(app.results_directory, LexicalPath::dirname(test.safe_relative_path)).string(); - TRY(Core::Directory::create(output_dir, Core::Directory::CreateDirectories::Yes)); - - auto base_path = LexicalPath::join(app.results_directory, test.safe_relative_path).string(); - TRY(dump_screenshot(actual, ByteString::formatted("{}.actual.png", base_path))); - TRY(dump_screenshot(expected, ByteString::formatted("{}.expected.png", base_path))); - - // Generate a diff image and compute stats. - if (actual.width() == expected.width() && actual.height() == expected.height()) { - auto diff = actual.diff(expected); - test.diff_pixel_error_count = diff.pixel_error_count; - test.diff_maximum_error = diff.maximum_error; - - auto diff_bitmap = TRY(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, { actual.width(), actual.height() })); - for (int y = 0; y < actual.height(); ++y) { - for (int x = 0; x < actual.width(); ++x) { - auto pixel = actual.get_pixel(x, y); - if (pixel != expected.get_pixel(x, y)) - diff_bitmap->set_pixel(x, y, Gfx::Color(255, 0, 0)); - else - diff_bitmap->set_pixel(x, y, pixel.mixed_with(expected.get_pixel(x, y), 0.5f).mixed_with(Gfx::Color::White, 0.8f)); - } - } - TRY(dump_screenshot(*diff_bitmap, ByteString::formatted("{}.diff.png", base_path))); - } - + TRY(write_screenshot_failure_results(test, *test.actual_screenshot, *test.expectation_screenshot)); return TestResult::Fail; }; @@ -993,6 +1025,95 @@ static void run_ref_test(TestWebView& view, TestRunContext& context, Test& test, test.timeout_timer->start(); } +static void run_screenshot_test(TestWebView& view, TestRunContext& context, Test& test, URL::URL const& url, int timeout_in_milliseconds) +{ + auto test_index = test.index; + test.timeout_timer = Core::Timer::create_single_shot(timeout_in_milliseconds, [&view, test_index]() { + view.on_test_complete({ test_index, TestResult::Timeout }); + }); + + auto handle_completed_test = [&context, test_index, url]() -> ErrorOr { + auto& test = context.tests[test_index]; + auto& actual = *test.actual_screenshot; + + if (Application::the().rebaseline) { + TRY(Core::Directory::create(LexicalPath { test.expectation_path }.parent().string(), Core::Directory::CreateDirectories::Yes)); + TRY(dump_screenshot_to_file(actual, test.expectation_path)); + return TestResult::Pass; + } + + // Load expected PNG from disk. + auto expectation_file = TRY(Core::MappedFile::map(test.expectation_path)); + auto decoder = TRY(Gfx::ImageDecoder::try_create_for_raw_bytes(expectation_file->bytes())); + if (!decoder) + return Error::from_string_literal("Could not decode expected screenshot PNG"); + + auto frame = TRY(decoder->frame(0)); + test.expectation_screenshot = move(frame.image); + + auto const& expected = *test.expectation_screenshot; + auto screenshot_matches = fuzzy_screenshot_match(url, url, actual, expected, test.fuzzy_matches, true); + if (screenshot_matches) + return TestResult::Pass; + + TRY(write_screenshot_failure_results(test, actual, expected)); + return TestResult::Fail; + }; + + auto on_test_complete = [&view, test_index, handle_completed_test]() { + if (auto result = handle_completed_test(); result.is_error()) + view.on_test_complete({ test_index, TestResult::Fail }); + else + view.on_test_complete({ test_index, result.value() }); + }; + + view.on_load_finish = [&view](auto const&) { + view.run_javascript(wait_for_reftest_completion); + }; + + view.on_test_finish = [&view, &context, test_index, on_test_complete = move(on_test_complete)](auto const&) { + // Take a screenshot of the rendered test page. + view.take_screenshot()->when_resolved([&view, &context, test_index, on_test_complete = move(on_test_complete)](RefPtr screenshot) { + context.tests[test_index].actual_screenshot = move(screenshot); + view.reset_zoom(); + // Load reference test metadata for fuzzy matching config. + view.run_javascript("internals.loadReferenceTestMetadata();"_string); + + view.on_reference_test_metadata = [&context, test_index, on_test_complete = move(on_test_complete)](JsonValue const& metadata) { + auto& test = context.tests[test_index]; + auto metadata_object = metadata.as_object(); + + // Read fuzzy configurations (ignore match/mismatch references for Screenshot tests). + test.fuzzy_matches.clear_with_capacity(); + auto fuzzy_values = metadata_object.get_array("fuzzy"sv); + for (size_t i = 0; i < fuzzy_values->size(); ++i) { + auto fuzzy_configuration = fuzzy_values->at(i).as_object(); + + auto content = fuzzy_configuration.get_string("content"sv).release_value(); + auto fuzzy_match_or_error = parse_fuzzy_match({}, content); + if (fuzzy_match_or_error.is_error()) { + warnln("Failed to parse fuzzy configuration '{}': {}", content, fuzzy_match_or_error.error()); + continue; + } + + test.fuzzy_matches.append(fuzzy_match_or_error.release_value()); + } + + on_test_complete(); + }; + }); + }; + + view.on_set_test_timeout = [&context, test_index, timeout_in_milliseconds](double milliseconds) { + auto& test = context.tests[test_index]; + if (milliseconds > timeout_in_milliseconds) + test.timeout_timer->restart(milliseconds); + }; + + view.load(url); + test.timeout_timer->start(); +} + static void run_test(TestWebView& view, TestRunContext& context, size_t test_index, Application& app) { s_current_test_index_by_view.set(&view, test_index); @@ -1043,6 +1164,9 @@ static void run_test(TestWebView& view, TestRunContext& context, size_t test_ind case TestMode::Ref: run_ref_test(view, context, test, *url, app.per_test_timeout_in_seconds * 1000); return; + case TestMode::Screenshot: + run_screenshot_test(view, context, test, *url, app.per_test_timeout_in_seconds * 1000); + return; } VERIFY_NOT_REACHED(); @@ -1149,7 +1273,7 @@ static ErrorOr run_tests(Core::AnonymousBuffer const& theme, Web::DevicePix TRY(collect_dump_tests(app, tests, ByteString::formatted("{}/Text", app.test_root_path), "."sv, TestMode::Text)); TRY(collect_ref_tests(app, tests, ByteString::formatted("{}/Ref", app.test_root_path), "."sv)); TRY(collect_crash_tests(app, tests, ByteString::formatted("{}/Crash", app.test_root_path), "."sv)); - TRY(collect_ref_tests(app, tests, ByteString::formatted("{}/Screenshot", app.test_root_path), "."sv)); + TRY(collect_screenshot_tests(app, tests, ByteString::formatted("{}/Screenshot", app.test_root_path), "."sv)); tests.remove_all_matching([&](auto const& test) { static constexpr Array support_file_patterns { diff --git a/Tests/LibWeb/test-web/results-index.html b/Tests/LibWeb/test-web/results-index.html index 697a3202bc..e6c9031a54 100644 --- a/Tests/LibWeb/test-web/results-index.html +++ b/Tests/LibWeb/test-web/results-index.html @@ -641,7 +641,7 @@ tabs.push({ id: 'diff', label: 'Diff', file: `${test.name}.diff.html`, type: 'diff' }); tabs.push({ id: 'expected', label: 'Expected', file: `${test.name}.expected.txt`, type: 'text' }); tabs.push({ id: 'actual', label: 'Actual', file: `${test.name}.actual.txt`, type: 'text' }); - } else if (test.mode === 'Ref') { + } else if (test.mode === 'Ref' || test.mode === 'Screenshot') { tabs.push({ id: 'compare', label: 'Compare', expected: `${test.name}.expected.png`, actual: `${test.name}.actual.png`, diff: `${test.name}.diff.png`, pixelErrors: test.pixelErrors, maxChannelDiff: test.maxChannelDiff, type: 'imageDiff' }); }