Skip to content

Truly independent web browser

LibWeb+Compositor: Prune zero-length lines before stroking canvas paths

Andreas Kling025d7cf78ffd
diff --git a/Libraries/LibWeb/Bindings/Rust/src/html/canvas_rect.rs b/Libraries/LibWeb/Bindings/Rust/src/html/canvas_rect.rs
index c28405695b0..9c70463fc8d 100644
--- a/Libraries/LibWeb/Bindings/Rust/src/html/canvas_rect.rs
+++ b/Libraries/LibWeb/Bindings/Rust/src/html/canvas_rect.rs
@@ -52,7 +52,31 @@ impl<K: CanvasKind> RenderingContext2D<K> {
/// https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-strokerect
pub(crate) fn stroke_rect(&self, _: &mut CallContext, x: f64, y: f64, w: f64, h: f64) -> WebIdlResult<()> {
- self.stroke_internal(&rect_path(float(x), float(y), float(w), float(h)));
+ let (x, y, w, h) = (float(x), float(y), float(w), float(h));
+
+ // 1. If any of the arguments are infinite or NaN, then return.
+ if !x.is_finite() || !y.is_finite() || !w.is_finite() || !h.is_finite() {
+ return Ok(());
+ }
+
+ // 2. Take the result of tracing the path described below, using the CanvasPathDrawingStyles interface's line
+ // styles, and fill it with this's stroke style.
+
+ // If both w and h are zero, the path has a single subpath with just one point (x, y), and no lines, and this
+ // method thus has no effect (the trace a path algorithm returns an empty path in that case).
+
+ // If just one of either w or h is zero, then the path has a single subpath consisting of two points, with
+ // coordinates (x, y) and (x+w, y+h), in that order, connected by a single straight line.
+
+ // Otherwise, the path has a single subpath consisting of four points, with coordinates (x, y), (x+w, y),
+ // (x+w, y+h), and (x, y+h), connected to each other in that order by straight lines.
+
+ // INTEROP: The path is the closed outline of the rectangle in every case. Tracing it prunes zero-length
+ // lines, so a rectangle with just one of w and h zero strokes as a closed line, with joins and no
+ // caps, and a rectangle with both zero strokes nothing.
+ let mut path = rect_path(x, y, w, h);
+ path.close();
+ self.stroke_internal(&path);
Ok(())
}
}
diff --git a/Services/Compositor/PainterSkia.cpp b/Services/Compositor/PainterSkia.cpp
index 085cace0a9f..c6a114b445d 100644
--- a/Services/Compositor/PainterSkia.cpp
+++ b/Services/Compositor/PainterSkia.cpp
@@ -22,6 +22,7 @@
#include <core/SkFont.h>
#include <core/SkImage.h>
#include <core/SkPath.h>
+#include <core/SkPathBuilder.h>
#include <core/SkSurface.h>
#include <effects/SkBlurMaskFilter.h>
#include <effects/SkDashPathEffect.h>
@@ -179,6 +180,68 @@ static void draw_with_compositing_and_blending_operator(SkCanvas& canvas, SkPain
canvas.restore();
}
+// https://html.spec.whatwg.org/multipage/canvas.html#trace-a-path
+static SkPath prune_path_for_stroking(SkPath const& path)
+{
+ // 2. Prune all zero-length line segments from path.
+ // 3. Remove from path any subpaths containing no lines (i.e. subpaths with just one point).
+ // NB: Skia strokes a zero-length segment with caps, so such segments and the subpaths that are left with no
+ // lines are removed before the path is stroked.
+ auto is_zero_length = [](SkSpan<SkPoint const> points) {
+ for (size_t i = 1; i < points.size(); ++i) {
+ if (points[i] != points[0])
+ return false;
+ }
+ return true;
+ };
+
+ SkPathBuilder builder(path.getFillType());
+ bool subpath_has_lines = false;
+ auto iterator = path.iter();
+ while (auto record = iterator.next()) {
+ auto points = record->fPoints;
+ switch (record->fVerb) {
+ case SkPathVerb::kMove:
+ subpath_has_lines = false;
+ continue;
+ case SkPathVerb::kClose:
+ if (subpath_has_lines)
+ builder.close();
+ subpath_has_lines = false;
+ continue;
+ case SkPathVerb::kLine:
+ case SkPathVerb::kQuad:
+ case SkPathVerb::kConic:
+ case SkPathVerb::kCubic:
+ break;
+ }
+
+ if (is_zero_length(points))
+ continue;
+ if (!subpath_has_lines) {
+ builder.moveTo(points[0]);
+ subpath_has_lines = true;
+ }
+ switch (record->fVerb) {
+ case SkPathVerb::kLine:
+ builder.lineTo(points[1]);
+ break;
+ case SkPathVerb::kQuad:
+ builder.quadTo(points[1], points[2]);
+ break;
+ case SkPathVerb::kConic:
+ builder.conicTo(points[1], points[2], record->conicWeight());
+ break;
+ case SkPathVerb::kCubic:
+ builder.cubicTo(points[1], points[2], points[3]);
+ break;
+ default:
+ VERIFY_NOT_REACHED();
+ }
+ }
+ return builder.detach();
+}
+
PainterSkia::PainterSkia(NonnullRefPtr<Gfx::PaintingSurface> painting_surface)
: m_painting_surface(move(painting_surface))
{
@@ -264,7 +327,7 @@ void PainterSkia::stroke_path(Gfx::Path const& path, Gfx::Color color, float thi
paint.setStrokeJoin(to_skia_join(join_style));
paint.setStrokeMiter(miter_limit);
paint.setPathEffect(SkDashPathEffect::Make({ dash_array.data(), dash_array.size() }, dash_offset));
- auto sk_path = to_skia_path(path);
+ auto sk_path = prune_path_for_stroking(to_skia_path(path));
draw_with_compositing_and_blending_operator(m_painting_surface->canvas(), paint, compositing_and_blending_operator, [&](SkCanvas& canvas, SkPaint const& paint) {
canvas.drawPath(sk_path, paint);
});
@@ -276,7 +339,7 @@ void PainterSkia::stroke_path(Gfx::Path const& path, Gfx::PaintStyle const& pain
if (thickness <= 0)
return;
- auto sk_path = to_skia_path(path);
+ auto sk_path = prune_path_for_stroking(to_skia_path(path));
auto paint = to_skia_paint(paint_style, move(image_filter), color_space());
paint.setAntiAlias(true);
float alpha = paint.getAlphaf();
diff --git a/Tests/LibWeb/Screenshot/expected/canvas-shadow.png b/Tests/LibWeb/Screenshot/expected/canvas-shadow.png
index aff129a2fe5..b3bbd3ca598 100644
Binary files a/Tests/LibWeb/Screenshot/expected/canvas-shadow.png and b/Tests/LibWeb/Screenshot/expected/canvas-shadow.png differ
diff --git a/Tests/LibWeb/Screenshot/expected/canvas-stroke-styles.png b/Tests/LibWeb/Screenshot/expected/canvas-stroke-styles.png
index f278e06ed10..42c0bd5713b 100644
Binary files a/Tests/LibWeb/Screenshot/expected/canvas-stroke-styles.png and b/Tests/LibWeb/Screenshot/expected/canvas-stroke-styles.png differ
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.txt
index a00f814e1bb..466cb91440f 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail strokeRect of 0x0 pixels draws nothing, including caps and joins
\ No newline at end of file
+1 Pass
+Pass strokeRect of 0x0 pixels draws nothing, including caps and joins
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.txt
index 42689fe461c..03f357e2bf7 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail strokeRect of Nx0 pixels draws a closed line with no caps
\ No newline at end of file
+1 Pass
+Pass strokeRect of Nx0 pixels draws a closed line with no caps
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.txt
index 892776c8c04..3569c8c4bec 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail strokeRect of Nx0 pixels draws a closed line with joins
\ No newline at end of file
+1 Pass
+Pass strokeRect of Nx0 pixels draws a closed line with joins
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.arc.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.arc.txt
index 0f9e24c8568..5199be5c2e4 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.arc.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.arc.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail Zero-length line segments from arcTo and arc are removed before stroking
\ No newline at end of file
+1 Pass
+Pass Zero-length line segments from arcTo and arc are removed before stroking
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.closed.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.closed.txt
index ef6cc1682dc..5768b788ca6 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.closed.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.closed.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail Zero-length line segments from closed paths are removed before stroking
\ No newline at end of file
+1 Pass
+Pass Zero-length line segments from closed paths are removed before stroking
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.curve.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.curve.txt
index 86d8b6ad628..4fc56cc32ae 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.curve.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.curve.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail Zero-length line segments from quadraticCurveTo and bezierCurveTo are removed before stroking
\ No newline at end of file
+1 Pass
+Pass Zero-length line segments from quadraticCurveTo and bezierCurveTo are removed before stroking
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.line.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.line.txt
index 22c4779eaaa..637107a5d1c 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.line.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.line.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail Zero-length line segments from lineTo are removed before stroking
\ No newline at end of file
+1 Pass
+Pass Zero-length line segments from lineTo are removed before stroking
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.rect.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.rect.txt
index d17f9f12e0d..f2943ee41ea 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.rect.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/path-objects/2d.path.stroke.prune.rect.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail Zero-length line segments from rect and strokeRect are removed before stroking
\ No newline at end of file
+1 Pass
+Pass Zero-length line segments from rect and strokeRect are removed before stroking
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.txt
index a00f814e1bb..466cb91440f 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail strokeRect of 0x0 pixels draws nothing, including caps and joins
\ No newline at end of file
+1 Pass
+Pass strokeRect of 0x0 pixels draws nothing, including caps and joins
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.worker.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.worker.txt
index a00f814e1bb..466cb91440f 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.worker.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.worker.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail strokeRect of 0x0 pixels draws nothing, including caps and joins
\ No newline at end of file
+1 Pass
+Pass strokeRect of 0x0 pixels draws nothing, including caps and joins
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.txt
index 42689fe461c..03f357e2bf7 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail strokeRect of Nx0 pixels draws a closed line with no caps
\ No newline at end of file
+1 Pass
+Pass strokeRect of Nx0 pixels draws a closed line with no caps
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.worker.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.worker.txt
index 42689fe461c..03f357e2bf7 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.worker.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.worker.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail strokeRect of Nx0 pixels draws a closed line with no caps
\ No newline at end of file
+1 Pass
+Pass strokeRect of Nx0 pixels draws a closed line with no caps
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.txt
index 892776c8c04..3569c8c4bec 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail strokeRect of Nx0 pixels draws a closed line with joins
\ No newline at end of file
+1 Pass
+Pass strokeRect of Nx0 pixels draws a closed line with joins
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.worker.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.worker.txt
index 892776c8c04..3569c8c4bec 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.worker.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.worker.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail strokeRect of Nx0 pixels draws a closed line with joins
\ No newline at end of file
+1 Pass
+Pass strokeRect of Nx0 pixels draws a closed line with joins
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.arc.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.arc.txt
index 0f9e24c8568..5199be5c2e4 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.arc.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.arc.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail Zero-length line segments from arcTo and arc are removed before stroking
\ No newline at end of file
+1 Pass
+Pass Zero-length line segments from arcTo and arc are removed before stroking
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.arc.worker.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.arc.worker.txt
index 0f9e24c8568..5199be5c2e4 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.arc.worker.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.arc.worker.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail Zero-length line segments from arcTo and arc are removed before stroking
\ No newline at end of file
+1 Pass
+Pass Zero-length line segments from arcTo and arc are removed before stroking
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closed.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closed.txt
index ef6cc1682dc..5768b788ca6 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closed.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closed.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail Zero-length line segments from closed paths are removed before stroking
\ No newline at end of file
+1 Pass
+Pass Zero-length line segments from closed paths are removed before stroking
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closed.worker.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closed.worker.txt
index ef6cc1682dc..5768b788ca6 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closed.worker.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closed.worker.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail Zero-length line segments from closed paths are removed before stroking
\ No newline at end of file
+1 Pass
+Pass Zero-length line segments from closed paths are removed before stroking
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.curve.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.curve.txt
index 86d8b6ad628..4fc56cc32ae 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.curve.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.curve.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail Zero-length line segments from quadraticCurveTo and bezierCurveTo are removed before stroking
\ No newline at end of file
+1 Pass
+Pass Zero-length line segments from quadraticCurveTo and bezierCurveTo are removed before stroking
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.curve.worker.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.curve.worker.txt
index 86d8b6ad628..4fc56cc32ae 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.curve.worker.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.curve.worker.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail Zero-length line segments from quadraticCurveTo and bezierCurveTo are removed before stroking
\ No newline at end of file
+1 Pass
+Pass Zero-length line segments from quadraticCurveTo and bezierCurveTo are removed before stroking
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.line.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.line.txt
index 22c4779eaaa..637107a5d1c 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.line.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.line.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail Zero-length line segments from lineTo are removed before stroking
\ No newline at end of file
+1 Pass
+Pass Zero-length line segments from lineTo are removed before stroking
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.line.worker.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.line.worker.txt
index 22c4779eaaa..637107a5d1c 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.line.worker.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.line.worker.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail Zero-length line segments from lineTo are removed before stroking
\ No newline at end of file
+1 Pass
+Pass Zero-length line segments from lineTo are removed before stroking
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.rect.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.rect.txt
index d17f9f12e0d..f2943ee41ea 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.rect.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.rect.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail Zero-length line segments from rect and strokeRect are removed before stroking
\ No newline at end of file
+1 Pass
+Pass Zero-length line segments from rect and strokeRect are removed before stroking
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.rect.worker.txt b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.rect.worker.txt
index d17f9f12e0d..f2943ee41ea 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.rect.worker.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/canvas/offscreen/path-objects/2d.path.stroke.prune.rect.worker.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail Zero-length line segments from rect and strokeRect are removed before stroking
\ No newline at end of file
+1 Pass
+Pass Zero-length line segments from rect and strokeRect are removed before stroking
\ No newline at end of file