зеркало из https://github.com/mozilla/gecko-dev.git
Bug 467988 - delete unused test files after speeding up canvas mochitests, r=roc
This commit is contained in:
Родитель
37fdf0cb2f
Коммит
e3c12a40d1
|
@ -1,27 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.canvas.readonly</title>
|
||||
<!-- Testing: CanvasRenderingContext2D.canvas is readonly -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var c = document.createElement('canvas');
|
||||
var d = ctx.canvas;
|
||||
ok(c !== d, "c !== d");
|
||||
try { ctx.canvas = c; } catch (e) {} // not sure whether this should throw or not...
|
||||
ok(ctx.canvas === d, "ctx.canvas === d");
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.canvas.reference</title>
|
||||
<!-- Testing: CanvasRenderingContext2D.canvas refers back to its canvas -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ok(ctx.canvas === canvas, "ctx.canvas === canvas");
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.clearRect.basic</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.clearRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.clearRect.clip</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.rect(0, 0, 16, 16);
|
||||
ctx.clip();
|
||||
|
||||
ctx.clearRect(0, 0, 100, 50);
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 16, 16);
|
||||
|
||||
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.clearRect.globalalpha</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalAlpha = 0.1;
|
||||
ctx.clearRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.clearRect.globalcomposite</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-atop';
|
||||
ctx.clearRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.clearRect.negative</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.clearRect(0, 0, 50, 25);
|
||||
ctx.clearRect(100, 0, -50, 25);
|
||||
ctx.clearRect(0, 50, 50, -25);
|
||||
ctx.clearRect(100, 50, -50, -25);
|
||||
isPixel(ctx, 25,12, 0,0,0,0, "25,12", "0,0,0,0", 0);
|
||||
isPixel(ctx, 75,12, 0,0,0,0, "75,12", "0,0,0,0", 0);
|
||||
isPixel(ctx, 25,37, 0,0,0,0, "25,37", "0,0,0,0", 0);
|
||||
isPixel(ctx, 75,37, 0,0,0,0, "75,37", "0,0,0,0", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.clearRect.nonfinite</title>
|
||||
<!-- Testing: clearRect() with Infinity/NaN is ignored -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var _thrown_outer = false;
|
||||
try {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.clearRect(Infinity, 0, 100, 50);
|
||||
ctx.clearRect(-Infinity, 0, 100, 50);
|
||||
ctx.clearRect(NaN, 0, 100, 50);
|
||||
ctx.clearRect(0, Infinity, 100, 50);
|
||||
ctx.clearRect(0, -Infinity, 100, 50);
|
||||
ctx.clearRect(0, NaN, 100, 50);
|
||||
ctx.clearRect(0, 0, Infinity, 50);
|
||||
ctx.clearRect(0, 0, -Infinity, 50);
|
||||
ctx.clearRect(0, 0, NaN, 50);
|
||||
ctx.clearRect(0, 0, 100, Infinity);
|
||||
ctx.clearRect(0, 0, 100, -Infinity);
|
||||
ctx.clearRect(0, 0, 100, NaN);
|
||||
ctx.clearRect(Infinity, Infinity, 100, 50);
|
||||
ctx.clearRect(Infinity, Infinity, Infinity, 50);
|
||||
ctx.clearRect(Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.clearRect(Infinity, Infinity, 100, Infinity);
|
||||
ctx.clearRect(Infinity, 0, Infinity, 50);
|
||||
ctx.clearRect(Infinity, 0, Infinity, Infinity);
|
||||
ctx.clearRect(Infinity, 0, 100, Infinity);
|
||||
ctx.clearRect(0, Infinity, Infinity, 50);
|
||||
ctx.clearRect(0, Infinity, Infinity, Infinity);
|
||||
ctx.clearRect(0, Infinity, 100, Infinity);
|
||||
ctx.clearRect(0, 0, Infinity, Infinity);
|
||||
|
||||
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 0);
|
||||
|
||||
} catch (e) {
|
||||
_thrown_outer = true;
|
||||
}
|
||||
todo(!_thrown_outer, 'should not throw exception');
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.clearRect.path</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.rect(0, 0, 100, 50);
|
||||
ctx.clearRect(0, 0, 16, 16);
|
||||
ctx.fill();
|
||||
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.clearRect.shadow</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.shadowColor = '#f00';
|
||||
ctx.shadowBlur = 0;
|
||||
ctx.shadowOffsetX = 0;
|
||||
ctx.shadowOffsetY = 50;
|
||||
ctx.clearRect(0, -50, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.clearRect.transform</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.scale(10, 10);
|
||||
ctx.translate(0, 5);
|
||||
ctx.clearRect(0, -5, 10, 5);
|
||||
isPixel(ctx, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.clearRect.zero</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.clearRect(0, 0, 100, 0);
|
||||
ctx.clearRect(0, 0, 0, 50);
|
||||
ctx.clearRect(0, 0, 0, 0);
|
||||
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.canvas.copy</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
var canvas2 = document.createElement('canvas');
|
||||
canvas2.width = canvas.width;
|
||||
canvas2.height = canvas.height;
|
||||
var ctx2 = canvas2.getContext('2d');
|
||||
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'copy';
|
||||
ctx.drawImage(canvas2, 0, 0);
|
||||
isPixel(ctx, 50,25, 255,255,0,191, "50,25", "255,255,0,191", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_yellow75.png" id="yellow75.png" class="resource">
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.canvas.destination-out</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
var canvas2 = document.createElement('canvas');
|
||||
canvas2.width = canvas.width;
|
||||
canvas2.height = canvas.height;
|
||||
var ctx2 = canvas2.getContext('2d');
|
||||
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-out';
|
||||
ctx.drawImage(canvas2, 0, 0);
|
||||
isPixel(ctx, 50,25, 0,255,255,31, "50,25", "0,255,255,31", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_yellow75.png" id="yellow75.png" class="resource">
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.canvas.destination-over</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
var canvas2 = document.createElement('canvas');
|
||||
canvas2.width = canvas.width;
|
||||
canvas2.height = canvas.height;
|
||||
var ctx2 = canvas2.getContext('2d');
|
||||
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-over';
|
||||
ctx.drawImage(canvas2, 0, 0);
|
||||
isPixel(ctx, 50,25, 109,255,145,223, "50,25", "109,255,145,223", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_yellow75.png" id="yellow75.png" class="resource">
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.canvas.source-atop</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
var canvas2 = document.createElement('canvas');
|
||||
canvas2.width = canvas.width;
|
||||
canvas2.height = canvas.height;
|
||||
var ctx2 = canvas2.getContext('2d');
|
||||
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'source-atop';
|
||||
ctx.drawImage(canvas2, 0, 0);
|
||||
isPixel(ctx, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_yellow75.png" id="yellow75.png" class="resource">
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.canvas.source-over</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
var canvas2 = document.createElement('canvas');
|
||||
canvas2.width = canvas.width;
|
||||
canvas2.height = canvas.height;
|
||||
var ctx2 = canvas2.getContext('2d');
|
||||
ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'source-over';
|
||||
ctx.drawImage(canvas2, 0, 0);
|
||||
isPixel(ctx, 50,25, 218,255,36,223, "50,25", "218,255,36,223", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_yellow75.png" id="yellow75.png" class="resource">
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.clip.copy</title>
|
||||
<!-- Testing: fill() does not affect pixels outside the clip region. -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'copy';
|
||||
ctx.rect(-20, -20, 10, 10);
|
||||
ctx.clip();
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 50, 50);
|
||||
isPixel(ctx, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 0);
|
||||
isPixel(ctx, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.clip.destination-atop</title>
|
||||
<!-- Testing: fill() does not affect pixels outside the clip region. -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-atop';
|
||||
ctx.rect(-20, -20, 10, 10);
|
||||
ctx.clip();
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 50, 50);
|
||||
isPixel(ctx, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 0);
|
||||
isPixel(ctx, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.clip.destination-in</title>
|
||||
<!-- Testing: fill() does not affect pixels outside the clip region. -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-in';
|
||||
ctx.rect(-20, -20, 10, 10);
|
||||
ctx.clip();
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 50, 50);
|
||||
isPixel(ctx, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 0);
|
||||
isPixel(ctx, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.clip.destination-out</title>
|
||||
<!-- Testing: fill() does not affect pixels outside the clip region. -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-out';
|
||||
ctx.rect(-20, -20, 10, 10);
|
||||
ctx.clip();
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 50, 50);
|
||||
isPixel(ctx, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 0);
|
||||
isPixel(ctx, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.clip.destination-over</title>
|
||||
<!-- Testing: fill() does not affect pixels outside the clip region. -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-over';
|
||||
ctx.rect(-20, -20, 10, 10);
|
||||
ctx.clip();
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 50, 50);
|
||||
isPixel(ctx, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 0);
|
||||
isPixel(ctx, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.clip.source-atop</title>
|
||||
<!-- Testing: fill() does not affect pixels outside the clip region. -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'source-atop';
|
||||
ctx.rect(-20, -20, 10, 10);
|
||||
ctx.clip();
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 50, 50);
|
||||
isPixel(ctx, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 0);
|
||||
isPixel(ctx, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.clip.source-in</title>
|
||||
<!-- Testing: fill() does not affect pixels outside the clip region. -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'source-in';
|
||||
ctx.rect(-20, -20, 10, 10);
|
||||
ctx.clip();
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 50, 50);
|
||||
isPixel(ctx, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 0);
|
||||
isPixel(ctx, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.clip.source-out</title>
|
||||
<!-- Testing: fill() does not affect pixels outside the clip region. -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'source-out';
|
||||
ctx.rect(-20, -20, 10, 10);
|
||||
ctx.clip();
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 50, 50);
|
||||
isPixel(ctx, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 0);
|
||||
isPixel(ctx, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.clip.source-over</title>
|
||||
<!-- Testing: fill() does not affect pixels outside the clip region. -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'source-over';
|
||||
ctx.rect(-20, -20, 10, 10);
|
||||
ctx.clip();
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 50, 50);
|
||||
isPixel(ctx, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 0);
|
||||
isPixel(ctx, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.globalAlpha.canvas</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var canvas2 = document.createElement('canvas');
|
||||
canvas2.width = 100;
|
||||
canvas2.height = 50;
|
||||
var ctx2 = canvas2.getContext('2d');
|
||||
ctx2.fillStyle = '#f00';
|
||||
ctx2.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations
|
||||
ctx.drawImage(canvas2, 0, 0);
|
||||
isPixel(ctx, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.globalAlpha.canvaspattern - bug 401790</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
todo(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var canvas2 = document.createElement('canvas');
|
||||
canvas2.width = 100;
|
||||
canvas2.height = 50;
|
||||
var ctx2 = canvas2.getContext('2d');
|
||||
ctx2.fillStyle = '#f00';
|
||||
ctx2.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = ctx.createPattern(canvas2, 'no-repeat');
|
||||
ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.globalAlpha.default</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ok(ctx.globalAlpha === 1.0, "ctx.globalAlpha === 1.0");
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.globalAlpha.fill</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.globalAlpha.image</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0);
|
||||
isPixel(ctx, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_red.png" id="red.png" class="resource">
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.globalAlpha.imagepattern - bug 401790</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
todo(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = ctx.createPattern(document.getElementById('red.png'), 'no-repeat');
|
||||
ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_red.png" id="red.png" class="resource">
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.globalAlpha.invalid</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.globalAlpha = 0.5;
|
||||
var a = ctx.globalAlpha; // might not be exactly 0.5, if it is rounded/quantised, so remember for future comparisons
|
||||
var _thrown = undefined; try {
|
||||
ctx.globalAlpha = Infinity;
|
||||
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
|
||||
ok(ctx.globalAlpha == a, "ctx.globalAlpha == a");
|
||||
var _thrown = undefined; try {
|
||||
ctx.globalAlpha = -Infinity;
|
||||
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
|
||||
ok(ctx.globalAlpha == a, "ctx.globalAlpha == a");
|
||||
var _thrown = undefined; try {
|
||||
ctx.globalAlpha = NaN;
|
||||
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
|
||||
ok(ctx.globalAlpha == a, "ctx.globalAlpha == a");
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.globalAlpha.range</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.globalAlpha = 0.5;
|
||||
var a = ctx.globalAlpha; // might not be exactly 0.5, if it is rounded/quantised, so remember for future comparisons
|
||||
ctx.globalAlpha = 1.1;
|
||||
ok(ctx.globalAlpha == a, "ctx.globalAlpha == a");
|
||||
ctx.globalAlpha = -0.1;
|
||||
ok(ctx.globalAlpha == a, "ctx.globalAlpha == a");
|
||||
ctx.globalAlpha = 0;
|
||||
ok(ctx.globalAlpha == 0, "ctx.globalAlpha == 0");
|
||||
ctx.globalAlpha = 1;
|
||||
ok(ctx.globalAlpha == 1, "ctx.globalAlpha == 1");
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.image.copy</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'copy';
|
||||
ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
|
||||
isPixel(ctx, 50,25, 255,255,0,191, "50,25", "255,255,0,191", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_yellow75.png" id="yellow75.png" class="resource">
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.image.destination-out</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-out';
|
||||
ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
|
||||
isPixel(ctx, 50,25, 0,255,255,31, "50,25", "0,255,255,31", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_yellow75.png" id="yellow75.png" class="resource">
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.image.destination-over</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-over';
|
||||
ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
|
||||
isPixel(ctx, 50,25, 109,255,145,223, "50,25", "109,255,145,223", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_yellow75.png" id="yellow75.png" class="resource">
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.image.source-atop</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'source-atop';
|
||||
ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
|
||||
isPixel(ctx, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_yellow75.png" id="yellow75.png" class="resource">
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.image.source-over</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'source-over';
|
||||
ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
|
||||
isPixel(ctx, 50,25, 218,255,36,223, "50,25", "218,255,36,223", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_yellow75.png" id="yellow75.png" class="resource">
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.operation.casesensitive - bug 401788</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var _thrown_outer = false;
|
||||
try {
|
||||
|
||||
ctx.globalCompositeOperation = 'xor';
|
||||
ctx.globalCompositeOperation = 'Source-over';
|
||||
ok(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'");
|
||||
|
||||
} catch (e) {
|
||||
_thrown_outer = true;
|
||||
}
|
||||
todo(!_thrown_outer, 'should not throw exception');
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.operation.clear</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.globalCompositeOperation = 'xor';
|
||||
ctx.globalCompositeOperation = 'clear';
|
||||
todo(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'");
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.operation.darker</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.globalCompositeOperation = 'xor';
|
||||
ctx.globalCompositeOperation = 'darker';
|
||||
todo(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'");
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.operation.default</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ok(ctx.globalCompositeOperation == 'source-over', "ctx.globalCompositeOperation == 'source-over'");
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.operation.get</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var modes = ['source-atop', 'source-in', 'source-out', 'source-over',
|
||||
'destination-atop', 'destination-in', 'destination-out', 'destination-over',
|
||||
'lighter', 'copy', 'xor'];
|
||||
for (var i = 0; i < modes.length; ++i)
|
||||
{
|
||||
ctx.globalCompositeOperation = modes[i];
|
||||
ok(ctx.globalCompositeOperation == modes[i], "ctx.globalCompositeOperation == modes[\""+(i)+"\"]");
|
||||
}
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.operation.highlight - bug 401788</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var _thrown_outer = false;
|
||||
try {
|
||||
|
||||
ctx.globalCompositeOperation = 'xor';
|
||||
ctx.globalCompositeOperation = 'highlight';
|
||||
ok(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'");
|
||||
|
||||
} catch (e) {
|
||||
_thrown_outer = true;
|
||||
}
|
||||
todo(!_thrown_outer, 'should not throw exception');
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.operation.nullsuffix - bug 401788</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var _thrown_outer = false;
|
||||
try {
|
||||
|
||||
ctx.globalCompositeOperation = 'xor';
|
||||
ctx.globalCompositeOperation = 'source-over\0';
|
||||
ok(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'");
|
||||
|
||||
} catch (e) {
|
||||
_thrown_outer = true;
|
||||
}
|
||||
todo(!_thrown_outer, 'should not throw exception');
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.operation.over</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.globalCompositeOperation = 'xor';
|
||||
ctx.globalCompositeOperation = 'over';
|
||||
todo(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'");
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.operation.unrecognised - bug 401788</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var _thrown_outer = false;
|
||||
try {
|
||||
|
||||
ctx.globalCompositeOperation = 'xor';
|
||||
ctx.globalCompositeOperation = 'nonexistent';
|
||||
ok(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'");
|
||||
|
||||
} catch (e) {
|
||||
_thrown_outer = true;
|
||||
}
|
||||
todo(!_thrown_outer, 'should not throw exception');
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.solid.copy</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'copy';
|
||||
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.solid.destination-atop</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-atop';
|
||||
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.solid.destination-in</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-in';
|
||||
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.solid.destination-out</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-out';
|
||||
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.solid.destination-over</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-over';
|
||||
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.solid.source-atop</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'source-atop';
|
||||
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.solid.source-in</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'source-in';
|
||||
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.solid.source-out</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'source-out';
|
||||
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.solid.source-over</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'source-over';
|
||||
ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.transparent.copy</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'copy';
|
||||
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,0,255,191, "50,25", "0,0,255,191", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.transparent.destination-atop</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-atop';
|
||||
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,127,127,191, "50,25", "0,127,127,191", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.transparent.destination-in</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-in';
|
||||
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,255,0,95, "50,25", "0,255,0,95", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.transparent.destination-out</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-out';
|
||||
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,255,0,31, "50,25", "0,255,0,31", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.transparent.destination-over</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-over';
|
||||
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,145,109,223, "50,25", "0,145,109,223", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.transparent.source-atop</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'source-atop';
|
||||
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,63,191,127, "50,25", "0,63,191,127", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.transparent.source-in</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'source-in';
|
||||
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,0,255,95, "50,25", "0,0,255,95", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.transparent.source-out</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'source-out';
|
||||
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,0,255,95, "50,25", "0,0,255,95", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.transparent.source-over</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'source-over';
|
||||
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,36,218,223, "50,25", "0,36,218,223", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.uncovered.fill.copy</title>
|
||||
<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
todo(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'copy';
|
||||
ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
|
||||
ctx.translate(0, 25);
|
||||
ctx.fillRect(0, 50, 100, 50);
|
||||
todo_isPixel(ctx, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.uncovered.image.copy</title>
|
||||
<!-- Testing: drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
todo(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'copy';
|
||||
ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10)
|
||||
todo_isPixel(ctx, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5);
|
||||
todo_isPixel(ctx, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_yellow.png" id="yellow.png" class="resource">
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.composite.uncovered.pattern.copy</title>
|
||||
<!-- Testing: Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
todo(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'copy';
|
||||
ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat');
|
||||
ctx.fillRect(0, 50, 100, 50);
|
||||
todo_isPixel(ctx, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_yellow.png" id="yellow.png" class="resource">
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.3arg</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.drawImage(document.getElementById('green.png'), 0, 0);
|
||||
ctx.drawImage(document.getElementById('red.png'), -100, 0);
|
||||
ctx.drawImage(document.getElementById('red.png'), 100, 0);
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, -50);
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 50);
|
||||
|
||||
isPixel(ctx, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_red.png" id="red.png" class="resource">
|
||||
<img src="image_green.png" id="green.png" class="resource">
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.5arg</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.drawImage(document.getElementById('green.png'), 50, 0, 50, 50);
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0, 50, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 50, 50);
|
||||
|
||||
isPixel(ctx, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_red.png" id="red.png" class="resource">
|
||||
<img src="image_green.png" id="green.png" class="resource">
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.9arg.basic</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.drawImage(document.getElementById('green.png'), 0, 0, 100, 50, 0, 0, 100, 50);
|
||||
isPixel(ctx, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_green.png" id="green.png" class="resource">
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.9arg.destpos</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.drawImage(document.getElementById('green.png'), 0, 0, 100, 50, 0, 0, 100, 50);
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, -100, 0, 100, 50);
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 100, 0, 100, 50);
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 0, -50, 100, 50);
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 0, 50, 100, 50);
|
||||
isPixel(ctx, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_red.png" id="red.png" class="resource">
|
||||
<img src="image_green.png" id="green.png" class="resource">
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.9arg.destsize</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.drawImage(document.getElementById('green.png'), 1, 1, 1, 1, 0, 0, 100, 50);
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, -50, 0, 50, 50);
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 100, 0, 50, 50);
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 0, -25, 100, 25);
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 0, 50, 100, 25);
|
||||
isPixel(ctx, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_red.png" id="red.png" class="resource">
|
||||
<img src="image_green.png" id="green.png" class="resource">
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.9arg.sourcepos</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.drawImage(document.getElementById('rgrg-256x256.png'), 140, 20, 100, 50, 0, 0, 100, 50);
|
||||
isPixel(ctx, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_rgrg-256x256.png" id="rgrg-256x256.png" class="resource">
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.9arg.sourcesize</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.drawImage(document.getElementById('rgrg-256x256.png'), 0, 0, 256, 256, 0, 0, 100, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 51, 26);
|
||||
ctx.fillRect(49, 24, 51, 26);
|
||||
isPixel(ctx, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
|
||||
isPixel(ctx, 20,20, 0,255,0,255, "20,20", "0,255,0,255", 2);
|
||||
isPixel(ctx, 80,20, 0,255,0,255, "80,20", "0,255,0,255", 2);
|
||||
isPixel(ctx, 20,30, 0,255,0,255, "20,30", "0,255,0,255", 2);
|
||||
isPixel(ctx, 80,30, 0,255,0,255, "80,30", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_rgrg-256x256.png" id="rgrg-256x256.png" class="resource">
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.alpha</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalAlpha = 0;
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0);
|
||||
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_red.png" id="red.png" class="resource">
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.animated.apng</title>
|
||||
<!-- Testing: drawImage() of an APNG with no poster frame draws the first frame -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
todo(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
function deferTest() {
|
||||
_deferred = true;
|
||||
}
|
||||
function wrapFunction(f) {
|
||||
return function () {
|
||||
f.apply(null, arguments);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
deferTest();
|
||||
setTimeout(wrapFunction(function () {
|
||||
ctx.drawImage(document.getElementById('anim-gr.png'), 0, 0);
|
||||
todo_isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
|
||||
}), 500);
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_anim-gr.png" id="anim-gr.png" class="resource">
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.animated.gif</title>
|
||||
<!-- Testing: drawImage() of an animated GIF draws the first frame -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
todo(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
function deferTest() {
|
||||
_deferred = true;
|
||||
}
|
||||
function wrapFunction(f) {
|
||||
return function () {
|
||||
f.apply(null, arguments);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
deferTest();
|
||||
setTimeout(wrapFunction(function () {
|
||||
ctx.drawImage(document.getElementById('anim-gr.gif'), 0, 0);
|
||||
todo_isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
|
||||
}), 500);
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_anim-gr.gif" id="anim-gr.gif" class="resource">
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.animated.poster</title>
|
||||
<!-- Testing: drawImage() of an APNG draws the poster frame -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
todo(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.drawImage(document.getElementById('anim-poster-gr.png'), 0, 0);
|
||||
todo_isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_anim-poster-gr.png" id="anim-poster-gr.png" class="resource">
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.broken</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var img = document.getElementById('broken.png');
|
||||
todo(img.complete === false, "img.complete === false");
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage(img, 0, 0);
|
||||
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw INVALID_STATE_ERR");
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_broken.png" id="broken.png" class="resource">
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.canvas</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var canvas2 = document.createElement('canvas');
|
||||
canvas2.width = 100;
|
||||
canvas2.height = 50;
|
||||
var ctx2 = canvas2.getContext('2d');
|
||||
ctx2.fillStyle = '#0f0';
|
||||
ctx2.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.drawImage(canvas2, 0, 0);
|
||||
|
||||
isPixel(ctx, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.clip</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.rect(-10, -10, 1, 1);
|
||||
ctx.clip();
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0);
|
||||
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_red.png" id="red.png" class="resource">
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.composite</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.globalCompositeOperation = 'destination-over';
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0);
|
||||
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_red.png" id="red.png" class="resource">
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.floatsource</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.drawImage(document.getElementById('green.png'), 10.1, 10.1, 0.1, 0.1, 0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_green.png" id="green.png" class="resource">
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.incomplete</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var img = new Image();
|
||||
todo(img.complete === false, "img.complete === false");
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage(img, 0, 0);
|
||||
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw INVALID_STATE_ERR");
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.negativedest</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var _thrown_outer = false;
|
||||
try {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.drawImage(document.getElementById('ggrr-256x256.png'), 100, 78, 50, 50, 0, 50, 50, -50);
|
||||
ctx.drawImage(document.getElementById('ggrr-256x256.png'), 100, 128, 50, -50, 100, 50, -50, -50);
|
||||
isPixel(ctx, 1,1, 0,255,0,255, "1,1", "0,255,0,255", 2);
|
||||
isPixel(ctx, 1,48, 0,255,0,255, "1,48", "0,255,0,255", 2);
|
||||
isPixel(ctx, 98,1, 0,255,0,255, "98,1", "0,255,0,255", 2);
|
||||
isPixel(ctx, 98,48, 0,255,0,255, "98,48", "0,255,0,255", 2);
|
||||
isPixel(ctx, 48,1, 0,255,0,255, "48,1", "0,255,0,255", 2);
|
||||
isPixel(ctx, 48,48, 0,255,0,255, "48,48", "0,255,0,255", 2);
|
||||
isPixel(ctx, 51,1, 0,255,0,255, "51,1", "0,255,0,255", 2);
|
||||
isPixel(ctx, 51,48, 0,255,0,255, "51,48", "0,255,0,255", 2);
|
||||
isPixel(ctx, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
|
||||
isPixel(ctx, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
|
||||
|
||||
} catch (e) {
|
||||
_thrown_outer = true;
|
||||
}
|
||||
todo(!_thrown_outer, 'should not throw exception');
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_ggrr-256x256.png" id="ggrr-256x256.png" class="resource">
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.negativesource</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var _thrown_outer = false;
|
||||
try {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.drawImage(document.getElementById('ggrr-256x256.png'), 100, 78, -100, 50, 0, 0, 50, 50);
|
||||
ctx.drawImage(document.getElementById('ggrr-256x256.png'), 100, 128, -100, -50, 50, 0, 50, 50);
|
||||
isPixel(ctx, 1,1, 0,255,0,255, "1,1", "0,255,0,255", 2);
|
||||
isPixel(ctx, 1,48, 0,255,0,255, "1,48", "0,255,0,255", 2);
|
||||
isPixel(ctx, 98,1, 0,255,0,255, "98,1", "0,255,0,255", 2);
|
||||
isPixel(ctx, 98,48, 0,255,0,255, "98,48", "0,255,0,255", 2);
|
||||
isPixel(ctx, 48,1, 0,255,0,255, "48,1", "0,255,0,255", 2);
|
||||
isPixel(ctx, 48,48, 0,255,0,255, "48,48", "0,255,0,255", 2);
|
||||
isPixel(ctx, 51,1, 0,255,0,255, "51,1", "0,255,0,255", 2);
|
||||
isPixel(ctx, 51,48, 0,255,0,255, "51,48", "0,255,0,255", 2);
|
||||
isPixel(ctx, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
|
||||
isPixel(ctx, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
|
||||
|
||||
} catch (e) {
|
||||
_thrown_outer = true;
|
||||
}
|
||||
todo(!_thrown_outer, 'should not throw exception');
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_ggrr-256x256.png" id="ggrr-256x256.png" class="resource">
|
||||
|
|
@ -1,348 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.nonfinite</title>
|
||||
<!-- Testing: drawImage() with Infinity/NaN is ignored -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var _thrown_outer = false;
|
||||
try {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
var red = document.getElementById('red.png');
|
||||
ctx.drawImage(red, Infinity, 0);
|
||||
ctx.drawImage(red, -Infinity, 0);
|
||||
ctx.drawImage(red, NaN, 0);
|
||||
ctx.drawImage(red, 0, Infinity);
|
||||
ctx.drawImage(red, 0, -Infinity);
|
||||
ctx.drawImage(red, 0, NaN);
|
||||
ctx.drawImage(red, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, -Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, NaN, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, -Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, NaN, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, -Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, NaN, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, -Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, NaN);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, -Infinity, 0, 100, 50, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, NaN, 0, 100, 50, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, -Infinity, 100, 50, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, NaN, 100, 50, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, -Infinity, 50, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, NaN, 50, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, -Infinity, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, NaN, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, -Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, NaN, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, 0, -Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, 0, NaN, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, 0, 0, Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, 0, 0, -Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, 0, 0, NaN, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, -Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, NaN);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 100, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 100, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, 100, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, 100, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, 100, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, 100, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, 100, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, 100, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, 100, 50);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, 100, 50);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, 100, 50);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, 100, 50);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, 100, 50);
|
||||
ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, 100, 50);
|
||||
ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, 100, 50);
|
||||
ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, 100, 50);
|
||||
ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, Infinity, 50);
|
||||
ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 50);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, Infinity, 50);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, Infinity, 50);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, Infinity, 50);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, Infinity, 50);
|
||||
ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, Infinity, 50);
|
||||
ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, Infinity, 50);
|
||||
ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, Infinity, 50);
|
||||
ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, 100, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, Infinity, 50);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, Infinity, Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, 100, Infinity);
|
||||
ctx.drawImage(red, 0, 0, 100, 50, 0, 0, Infinity, Infinity);
|
||||
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 0);
|
||||
|
||||
} catch (e) {
|
||||
_thrown_outer = true;
|
||||
}
|
||||
todo(!_thrown_outer, 'should not throw exception');
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_red.png" id="red.png" class="resource">
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.nowrap</title>
|
||||
<!-- Testing: Stretched images do not get pixels wrapping around the edges -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.drawImage(document.getElementById('redtransparent.png'), -1950, 0, 2000, 50);
|
||||
isPixel(ctx, 45,25, 0,255,0,255, "45,25", "0,255,0,255", 2);
|
||||
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
|
||||
isPixel(ctx, 55,25, 0,255,0,255, "55,25", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_redtransparent.png" id="redtransparent.png" class="resource">
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.null</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage(null, 0, 0);
|
||||
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TYPE_MISMATCH_ERR");
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.outsidesource</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
todo(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var _thrown_outer = false;
|
||||
try {
|
||||
|
||||
ctx.drawImage(document.getElementById('green.png'), 10.5, 10.5, 89.5, 39.5, 0, 0, 100, 50);
|
||||
ctx.drawImage(document.getElementById('green.png'), 5.5, 5.5, -5.5, -5.5, 0, 0, 100, 50);
|
||||
ctx.drawImage(document.getElementById('green.png'), 100, 50, -5, -5, 0, 0, 100, 50);
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage(document.getElementById('red.png'), -0.001, 0, 100, 50, 0, 0, 100, 50);
|
||||
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, -0.001, 100, 50, 0, 0, 100, 50);
|
||||
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0, 100.001, 50, 0, 0, 100, 50);
|
||||
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50.001, 0, 0, 100, 50);
|
||||
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage(document.getElementById('red.png'), 50, 0, 50.001, 50, 0, 0, 100, 50);
|
||||
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0, -5, 5, 0, 0, 100, 50);
|
||||
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0, 5, -5, 0, 0, 100, 50);
|
||||
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage(document.getElementById('red.png'), 110, 60, -20, -20, 0, 0, 100, 50);
|
||||
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
|
||||
todo_isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
|
||||
|
||||
} catch (e) {
|
||||
_thrown_outer = true;
|
||||
}
|
||||
todo(!_thrown_outer, 'should not throw exception');
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_green.png" id="green.png" class="resource">
|
||||
<img src="image_red.png" id="red.png" class="resource">
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.path</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.rect(0, 0, 100, 50);
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0);
|
||||
ctx.fill();
|
||||
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_red.png" id="red.png" class="resource">
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.self.1 - bug 433235</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 50, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(50, 0, 50, 50);
|
||||
ctx.drawImage(canvas, 50, 0);
|
||||
|
||||
isPixel(ctx, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.self.2 - bug 433235</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 1, 100, 49);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 1);
|
||||
ctx.drawImage(canvas, 0, 1);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 2);
|
||||
|
||||
isPixel(ctx, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
|
||||
isPixel(ctx, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
|
||||
isPixel(ctx, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.transform</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.translate(100, 0);
|
||||
ctx.drawImage(document.getElementById('red.png'), 0, 0);
|
||||
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_red.png" id="red.png" class="resource">
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.wrongtype</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage(undefined, 0, 0);
|
||||
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TYPE_MISMATCH_ERR");
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage(0, 0, 0);
|
||||
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TYPE_MISMATCH_ERR");
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage("", 0, 0);
|
||||
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TYPE_MISMATCH_ERR");
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage(document.createElement('p'), 0, 0);
|
||||
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TYPE_MISMATCH_ERR");
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.drawImage.zerosource</title>
|
||||
<!-- Testing: drawImage with zero-sized source rectangle throws INDEX_SIZE_ERR -->
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 1, 0, 0, 100, 50);
|
||||
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage(document.getElementById('red.png'), 10, 10, 1, 0, 0, 0, 100, 50);
|
||||
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
|
||||
var _thrown = undefined; try {
|
||||
ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 0, 0, 0, 100, 50);
|
||||
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
|
||||
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_red.png" id="red.png" class="resource">
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.fillRect.basic</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Canvas test: 2d.fillRect.clip</title>
|
||||
<script src="/MochiKit/packed.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<body>
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
|
||||
var pixel = ctx.getImageData(x, y, 1, 1);
|
||||
var pr = pixel.data[0],
|
||||
pg = pixel.data[1],
|
||||
pb = pixel.data[2],
|
||||
pa = pixel.data[3];
|
||||
ok(r-d <= pr && pr <= r+d &&
|
||||
g-d <= pg && pg <= g+d &&
|
||||
b-d <= pb && pb <= b+d &&
|
||||
a-d <= pa && pa <= a+d,
|
||||
"pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.rect(0, 0, 16, 16);
|
||||
ctx.clip();
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 16, 16);
|
||||
|
||||
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче