Bug 630062 - Don't throw on setting lineWidth and ignore non-positive values; r+a=roc

This commit is contained in:
Ms2ger 2011-02-02 08:47:24 +13:00
parent efa9ee5a7b
commit 057761e85c
2 changed files with 8 additions and 8 deletions

View File

@ -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;

View File

@ -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');
}