diff options
-rw-r--r-- | components/canvas/canvas_paint_task.rs | 15 | ||||
-rw-r--r-- | components/gfx/paint_context.rs | 2 | ||||
-rw-r--r-- | components/servo/Cargo.lock | 2 | ||||
-rw-r--r-- | ports/cef/Cargo.lock | 4 | ||||
-rw-r--r-- | ports/gonk/Cargo.lock | 4 | ||||
-rw-r--r-- | tests/wpt/metadata/2dcontext/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.html.ini | 5 |
6 files changed, 23 insertions, 9 deletions
diff --git a/components/canvas/canvas_paint_task.rs b/components/canvas/canvas_paint_task.rs index 0b5e96ff921..b316b5bcd7a 100644 --- a/components/canvas/canvas_paint_task.rs +++ b/components/canvas/canvas_paint_task.rs @@ -314,6 +314,21 @@ impl<'a> CanvasPaintTask<'a> { new_draw_target.stroke_rect(rect, self.state.stroke_style.to_pattern_ref(), &self.state.stroke_opts, &self.state.draw_options); }); + } else if rect.size.width == 0. || rect.size.height == 0. { + let cap = match self.state.stroke_opts.line_join { + JoinStyle::Round => CapStyle::Round, + _ => CapStyle::Butt + }; + + let stroke_opts = + StrokeOptions::new(self.state.stroke_opts.line_width, + self.state.stroke_opts.line_join, + cap, + self.state.stroke_opts.miter_limit, + self.state.stroke_opts.mDashPattern); + self.drawtarget.stroke_line(rect.origin, rect.bottom_right(), + self.state.stroke_style.to_pattern_ref(), + &stroke_opts, &self.state.draw_options); } else { self.drawtarget.stroke_rect(rect, self.state.stroke_style.to_pattern_ref(), &self.state.stroke_opts, &self.state.draw_options); diff --git a/components/gfx/paint_context.rs b/components/gfx/paint_context.rs index 361d2af2047..a6875dc7bec 100644 --- a/components/gfx/paint_context.rs +++ b/components/gfx/paint_context.rs @@ -706,7 +706,7 @@ impl<'a> PaintContext<'a> { self.draw_target.stroke_line(start, end, - &ColorPattern::new(color), + PatternRef::Color(&ColorPattern::new(color)), &stroke_opts, &draw_opts); } diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index 597c7170e9b..0be6201eca4 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -64,7 +64,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "azure" version = "0.1.0" -source = "git+https://github.com/servo/rust-azure#0ee76c98d92b0ff180f8b4474c4f4b7c80b67ecf" +source = "git+https://github.com/servo/rust-azure#a6d3af35eafe9a02af3fa58b1f1d30eb9cb57ccd" dependencies = [ "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index 67ac282bfec..c623028ec44 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -63,7 +63,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "azure" version = "0.1.0" -source = "git+https://github.com/servo/rust-azure#0ee76c98d92b0ff180f8b4474c4f4b7c80b67ecf" +source = "git+https://github.com/servo/rust-azure#a6d3af35eafe9a02af3fa58b1f1d30eb9cb57ccd" dependencies = [ "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -470,6 +470,7 @@ dependencies = [ "harfbuzz 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)", + "lazy_static 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", @@ -1490,6 +1491,7 @@ dependencies = [ "bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "js 0.1.0 (git+https://github.com/servo/rust-mozjs)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)", diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock index 1b45696a94e..a6e67d99833 100644 --- a/ports/gonk/Cargo.lock +++ b/ports/gonk/Cargo.lock @@ -50,7 +50,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "azure" version = "0.1.0" -source = "git+https://github.com/servo/rust-azure#0ee76c98d92b0ff180f8b4474c4f4b7c80b67ecf" +source = "git+https://github.com/servo/rust-azure#a6d3af35eafe9a02af3fa58b1f1d30eb9cb57ccd" dependencies = [ "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -443,6 +443,7 @@ dependencies = [ "harfbuzz 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)", + "lazy_static 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", @@ -1373,6 +1374,7 @@ dependencies = [ "bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "js 0.1.0 (git+https://github.com/servo/rust-mozjs)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)", diff --git a/tests/wpt/metadata/2dcontext/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.html.ini b/tests/wpt/metadata/2dcontext/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.html.ini deleted file mode 100644 index 31169ceaf88..00000000000 --- a/tests/wpt/metadata/2dcontext/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.strokeRect.zero.4.html] - type: testharness - [strokeRect of Nx0 pixels draws a closed line with no caps] - expected: FAIL - |