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
Родитель cfcbaa66a6
Коммит 0882ee08d6
2 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

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

Просмотреть файл

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