Bug 629870 - Drop support for globalCompositeOperation=over,clear; r=sicking

This commit is contained in:
Ms2ger 2011-06-02 14:56:46 +02:00
parent 86e18547a1
commit 63b9ab3636
2 changed files with 4 additions and 10 deletions

View File

@ -3457,8 +3457,7 @@ nsCanvasRenderingContext2D::SetGlobalCompositeOperation(const nsAString& op)
if (op.EqualsLiteral(cvsop)) \
thebes_op = gfxContext::OPERATOR_##thebesop;
CANVAS_OP_TO_THEBES_OP("clear", CLEAR)
else CANVAS_OP_TO_THEBES_OP("copy", SOURCE)
CANVAS_OP_TO_THEBES_OP("copy", SOURCE)
else CANVAS_OP_TO_THEBES_OP("destination-atop", DEST_ATOP)
else CANVAS_OP_TO_THEBES_OP("destination-in", DEST_IN)
else CANVAS_OP_TO_THEBES_OP("destination-out", DEST_OUT)
@ -3469,8 +3468,6 @@ nsCanvasRenderingContext2D::SetGlobalCompositeOperation(const nsAString& op)
else CANVAS_OP_TO_THEBES_OP("source-out", OUT)
else CANVAS_OP_TO_THEBES_OP("source-over", OVER)
else CANVAS_OP_TO_THEBES_OP("xor", XOR)
// not part of spec, kept here for compat
else CANVAS_OP_TO_THEBES_OP("over", OVER)
// XXX ERRMSG we need to report an error to developers here! (bug 329026)
else return NS_OK;
@ -3489,10 +3486,7 @@ nsCanvasRenderingContext2D::GetGlobalCompositeOperation(nsAString& op)
if (thebes_op == gfxContext::OPERATOR_##thebesop) \
op.AssignLiteral(cvsop);
// XXX "darker" isn't really correct
CANVAS_OP_TO_THEBES_OP("clear", CLEAR)
else CANVAS_OP_TO_THEBES_OP("copy", SOURCE)
else CANVAS_OP_TO_THEBES_OP("darker", SATURATE) // XXX
CANVAS_OP_TO_THEBES_OP("copy", SOURCE)
else CANVAS_OP_TO_THEBES_OP("destination-atop", DEST_ATOP)
else CANVAS_OP_TO_THEBES_OP("destination-in", DEST_IN)
else CANVAS_OP_TO_THEBES_OP("destination-out", DEST_OUT)

View File

@ -1486,7 +1486,7 @@ var ctx = canvas.getContext('2d');
ctx.globalCompositeOperation = 'xor';
ctx.globalCompositeOperation = 'clear';
todo(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'");
ok(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'");
}
@ -1619,7 +1619,7 @@ var ctx = canvas.getContext('2d');
ctx.globalCompositeOperation = 'xor';
ctx.globalCompositeOperation = 'over';
todo(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'");
ok(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'");
}