зеркало из https://github.com/mozilla/gecko-dev.git
Bug 630062 - Don't throw on setting lineWidth and ignore non-positive values; r+a=roc
This commit is contained in:
Родитель
cfcbaa66a6
Коммит
0882ee08d6
|
@ -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');
|
||||
|
||||
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче