diff --git a/content/canvas/src/nsCanvasRenderingContext2D.cpp b/content/canvas/src/nsCanvasRenderingContext2D.cpp index a651ee0b610..b57bc39752e 100644 --- a/content/canvas/src/nsCanvasRenderingContext2D.cpp +++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp @@ -3078,8 +3078,8 @@ nsCanvasRenderingContext2D::MozTextAlongPath(const nsAString& textToDraw, PRBool NS_IMETHODIMP nsCanvasRenderingContext2D::SetLineWidth(float width) { - if (!FloatValidate(width)) - return NS_ERROR_DOM_SYNTAX_ERR; + if (!FloatValidate(width) || width <= 0.0) + return NS_OK; mThebes->SetLineWidth(width); return NS_OK; diff --git a/content/canvas/test/test_canvas.html b/content/canvas/test/test_canvas.html index 0e055a1a03c..e0069fc1c70 100644 --- a/content/canvas/test/test_canvas.html +++ b/content/canvas/test/test_canvas.html @@ -10119,28 +10119,28 @@ ok(ctx.lineWidth === 1.5, "ctx.lineWidth === 1.5"); ctx.lineWidth = 1.5; ctx.lineWidth = 0; -todo(ctx.lineWidth === 1.5, "ctx.lineWidth === 1.5"); +ok(ctx.lineWidth === 1.5, "ctx.lineWidth === 1.5"); ctx.lineWidth = 1.5; ctx.lineWidth = -1; -todo(ctx.lineWidth === 1.5, "ctx.lineWidth === 1.5"); +ok(ctx.lineWidth === 1.5, "ctx.lineWidth === 1.5"); ctx.lineWidth = 1.5; ctx.lineWidth = Infinity; -todo(ctx.lineWidth === 1.5, "ctx.lineWidth === 1.5"); +ok(ctx.lineWidth === 1.5, "ctx.lineWidth === 1.5"); ctx.lineWidth = 1.5; ctx.lineWidth = -Infinity; -todo(ctx.lineWidth === 1.5, "ctx.lineWidth === 1.5"); +ok(ctx.lineWidth === 1.5, "ctx.lineWidth === 1.5"); ctx.lineWidth = 1.5; ctx.lineWidth = NaN; -todo(ctx.lineWidth === 1.5, "ctx.lineWidth === 1.5"); +ok(ctx.lineWidth === 1.5, "ctx.lineWidth === 1.5"); } catch (e) { _thrown_outer = true; } -todo(!_thrown_outer, 'should not throw exception'); +ok(!_thrown_outer, 'should not throw exception'); }