summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/2dcontext/compositing
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/2dcontext/compositing')
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/.gitkeep0
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.copy.html38
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.copy.pngbin0 -> 220 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-atop.html38
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-atop.pngbin0 -> 221 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-in.html38
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-in.pngbin0 -> 220 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-out.html38
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-out.pngbin0 -> 220 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-over.html38
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-over.pngbin0 -> 223 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.lighter.html38
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.lighter.pngbin0 -> 209 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-atop.html38
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-atop.pngbin0 -> 223 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-in.html38
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-in.pngbin0 -> 220 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-out.html38
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-out.pngbin0 -> 220 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-over.html38
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-over.pngbin0 -> 223 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.xor.html38
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.xor.pngbin0 -> 223 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.copy.html36
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.destination-atop.html36
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.destination-in.html36
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.destination-out.html36
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.destination-over.html36
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.lighter.html36
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.source-atop.html36
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.source-in.html36
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.source-out.html36
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.source-over.html36
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.xor.html36
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.canvas.html38
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.canvaspattern.html39
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.default.html27
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.fill.html32
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.image.html32
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.imagepattern.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.invalid.html34
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.range.html36
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.copy.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.copy.pngbin0 -> 220 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-atop.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-atop.pngbin0 -> 221 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-in.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-in.pngbin0 -> 220 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-out.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-out.pngbin0 -> 220 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-over.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-over.pngbin0 -> 223 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.lighter.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.lighter.pngbin0 -> 209 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-atop.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-atop.pngbin0 -> 223 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-in.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-in.pngbin0 -> 220 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-out.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-out.pngbin0 -> 220 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-over.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-over.pngbin0 -> 223 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.xor.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.image.xor.pngbin0 -> 223 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.casesensitive.html29
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.clear.html29
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.darker.html29
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.default.html27
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.get.html34
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.highlight.html29
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.nullsuffix.html29
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.over.html29
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.unrecognised.html29
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.copy.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.copy.pngbin0 -> 205 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-atop.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-atop.pngbin0 -> 206 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-in.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-in.pngbin0 -> 206 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-out.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-out.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-over.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-over.pngbin0 -> 206 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.lighter.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.lighter.pngbin0 -> 207 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-atop.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-atop.pngbin0 -> 205 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-in.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-in.pngbin0 -> 205 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-out.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-out.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-over.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-over.pngbin0 -> 205 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.xor.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.xor.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.copy.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.copy.pngbin0 -> 221 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-atop.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-atop.pngbin0 -> 220 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-in.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-in.pngbin0 -> 221 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-out.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-out.pngbin0 -> 221 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-over.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-over.pngbin0 -> 222 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.lighter.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.lighter.pngbin0 -> 208 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-atop.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-atop.pngbin0 -> 222 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-in.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-in.pngbin0 -> 221 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-out.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-out.pngbin0 -> 221 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-over.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-over.pngbin0 -> 223 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.xor.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.xor.pngbin0 -> 222 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.copy.html34
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.copy.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.destination-atop.html34
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.destination-atop.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.destination-in.html34
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.destination-in.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.source-in.html34
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.source-in.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.source-out.html34
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.source-out.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.copy.html34
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.copy.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.destination-atop.html34
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.destination-atop.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.destination-in.html34
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.destination-in.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.source-in.html34
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.source-in.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.source-out.html34
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.source-out.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.copy.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.copy.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.destination-atop.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.destination-atop.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.destination-in.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.destination-in.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.source-in.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.source-in.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.source-out.html33
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.source-out.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.copy.html34
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.copy.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.destination-atop.html34
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.destination-atop.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.destination-in.html34
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.destination-in.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.source-in.html34
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.source-in.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.source-out.html34
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.source-out.pngbin0 -> 117 bytes
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/canvas_compositing_globalcompositeoperation_001-ref.htm11
-rw-r--r--testing/web-platform/tests/2dcontext/compositing/canvas_compositing_globalcompositeoperation_001.htm32
159 files changed, 3156 insertions, 0 deletions
diff --git a/testing/web-platform/tests/2dcontext/compositing/.gitkeep b/testing/web-platform/tests/2dcontext/compositing/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/.gitkeep
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.copy.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.copy.html
new file mode 100644
index 000000000..5f32421fb
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.copy.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.canvas.copy</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.canvas.copy</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.copy.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 255,255,0,191, "50,25", "255,255,0,191", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.copy.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.copy.png
new file mode 100644
index 000000000..8e0668efb
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.copy.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-atop.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-atop.html
new file mode 100644
index 000000000..14261d0be
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-atop.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.canvas.destination-atop</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.canvas.destination-atop</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.destination-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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-atop';
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 128,255,128,191, "50,25", "128,255,128,191", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-atop.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-atop.png
new file mode 100644
index 000000000..59bdc91e9
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-atop.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-in.html
new file mode 100644
index 000000000..2320064fa
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-in.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.canvas.destination-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.canvas.destination-in</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.destination-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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-in';
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,255,96, "50,25", "0,255,255,96", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-in.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-in.png
new file mode 100644
index 000000000..790e418a6
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-in.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-out.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-out.html
new file mode 100644
index 000000000..5d392eebc
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-out.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.canvas.destination-out</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.canvas.destination-out</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.destination-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,255,255,32, "50,25", "0,255,255,32", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-out.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-out.png
new file mode 100644
index 000000000..7f5ed1a83
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-out.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-over.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-over.html
new file mode 100644
index 000000000..130cbba8f
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-over.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.canvas.destination-over</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.canvas.destination-over</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.destination-over.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 109,255,146,223, "50,25", "109,255,146,223", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-over.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-over.png
new file mode 100644
index 000000000..ac8689223
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.destination-over.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.lighter.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.lighter.html
new file mode 100644
index 000000000..bab811861
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.lighter.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.canvas.lighter</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.canvas.lighter</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.lighter.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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 = 'lighter';
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 191,255,128,255, "50,25", "191,255,128,255", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.lighter.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.lighter.png
new file mode 100644
index 000000000..9ffde4198
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.lighter.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-atop.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-atop.html
new file mode 100644
index 000000000..3d19701dd
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-atop.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.canvas.source-atop</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.canvas.source-atop</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.source-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 191,255,64,128, "50,25", "191,255,64,128", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-atop.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-atop.png
new file mode 100644
index 000000000..1ef963019
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-atop.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-in.html
new file mode 100644
index 000000000..dfc1a5af8
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-in.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.canvas.source-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.canvas.source-in</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.source-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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-in';
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 255,255,0,96, "50,25", "255,255,0,96", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-in.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-in.png
new file mode 100644
index 000000000..c26cdccf0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-in.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-out.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-out.html
new file mode 100644
index 000000000..a4bd322be
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-out.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.canvas.source-out</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.canvas.source-out</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.source-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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-out';
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 255,255,0,96, "50,25", "255,255,0,96", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-out.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-out.png
new file mode 100644
index 000000000..c26cdccf0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-out.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-over.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-over.html
new file mode 100644
index 000000000..ff8dc528b
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-over.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.canvas.source-over</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.canvas.source-over</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.source-over.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 219,255,36,223, "50,25", "219,255,36,223", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-over.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-over.png
new file mode 100644
index 000000000..5437608a8
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.source-over.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.xor.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.xor.html
new file mode 100644
index 000000000..f39a023f6
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.xor.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.canvas.xor</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.canvas.xor</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.xor.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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 = 'xor';
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 191,255,64,128, "50,25", "191,255,64,128", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.xor.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.xor.png
new file mode 100644
index 000000000..1ef963019
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.canvas.xor.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.copy.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.copy.html
new file mode 100644
index 000000000..08096cf1f
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.copy.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.clip.copy</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.clip.copy</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("fill() does not affect pixels outside the clip region.");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.destination-atop.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.destination-atop.html
new file mode 100644
index 000000000..c05cd34b5
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.destination-atop.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.clip.destination-atop</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.clip.destination-atop</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("fill() does not affect pixels outside the clip region.");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.destination-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.destination-in.html
new file mode 100644
index 000000000..24aff70cd
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.destination-in.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.clip.destination-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.clip.destination-in</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("fill() does not affect pixels outside the clip region.");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.destination-out.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.destination-out.html
new file mode 100644
index 000000000..afeb00984
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.destination-out.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.clip.destination-out</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.clip.destination-out</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("fill() does not affect pixels outside the clip region.");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.destination-over.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.destination-over.html
new file mode 100644
index 000000000..7a258836d
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.destination-over.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.clip.destination-over</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.clip.destination-over</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("fill() does not affect pixels outside the clip region.");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.lighter.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.lighter.html
new file mode 100644
index 000000000..ffc864b7b
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.lighter.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.clip.lighter</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.clip.lighter</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("fill() does not affect pixels outside the clip region.");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'lighter';
+ctx.rect(-20, -20, 10, 10);
+ctx.clip();
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.source-atop.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.source-atop.html
new file mode 100644
index 000000000..4580b5429
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.source-atop.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.clip.source-atop</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.clip.source-atop</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("fill() does not affect pixels outside the clip region.");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.source-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.source-in.html
new file mode 100644
index 000000000..79c4e16a6
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.source-in.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.clip.source-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.clip.source-in</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("fill() does not affect pixels outside the clip region.");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.source-out.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.source-out.html
new file mode 100644
index 000000000..53456660d
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.source-out.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.clip.source-out</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.clip.source-out</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("fill() does not affect pixels outside the clip region.");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.source-over.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.source-over.html
new file mode 100644
index 000000000..98b446a1f
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.source-over.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.clip.source-over</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.clip.source-over</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("fill() does not affect pixels outside the clip region.");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.xor.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.xor.html
new file mode 100644
index 000000000..b6e36bc11
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.clip.xor.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.clip.xor</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.clip.xor</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("fill() does not affect pixels outside the clip region.");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'xor';
+ctx.rect(-20, -20, 10, 10);
+ctx.clip();
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.canvas.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.canvas.html
new file mode 100644
index 000000000..0b6df4930
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.canvas.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.globalAlpha.canvas</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.globalAlpha.canvas</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+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);
+_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.canvaspattern.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.canvaspattern.html
new file mode 100644
index 000000000..eeb2442bf
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.canvaspattern.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.globalAlpha.canvaspattern</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.globalAlpha.canvaspattern</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+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);
+_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.default.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.default.html
new file mode 100644
index 000000000..f84a340fe
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.default.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.globalAlpha.default</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.globalAlpha.default</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+_assertSame(ctx.globalAlpha, 1.0, "ctx.globalAlpha", "1.0");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.fill.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.fill.html
new file mode 100644
index 000000000..591fb6b5a
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.fill.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.globalAlpha.fill</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.globalAlpha.fill</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+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);
+_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.image.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.image.html
new file mode 100644
index 000000000..b796992de
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.image.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.globalAlpha.image</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.globalAlpha.image</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+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);
+_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2);
+
+
+});
+</script>
+<img src="/images/red.png" id="red.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.imagepattern.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.imagepattern.html
new file mode 100644
index 000000000..ab8633952
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.imagepattern.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.globalAlpha.imagepattern</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.globalAlpha.imagepattern</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+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);
+_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2);
+
+
+});
+</script>
+<img src="/images/red.png" id="red.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.invalid.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.invalid.html
new file mode 100644
index 000000000..980ef8380
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.invalid.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.globalAlpha.invalid</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.globalAlpha.invalid</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+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 = Infinity;
+_assertSame(ctx.globalAlpha, a, "ctx.globalAlpha", "a");
+ctx.globalAlpha = -Infinity;
+_assertSame(ctx.globalAlpha, a, "ctx.globalAlpha", "a");
+ctx.globalAlpha = NaN;
+_assertSame(ctx.globalAlpha, a, "ctx.globalAlpha", "a");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.range.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.range.html
new file mode 100644
index 000000000..14926e6eb
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.globalAlpha.range.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.globalAlpha.range</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.globalAlpha.range</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+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;
+_assertSame(ctx.globalAlpha, a, "ctx.globalAlpha", "a");
+ctx.globalAlpha = -0.1;
+_assertSame(ctx.globalAlpha, a, "ctx.globalAlpha", "a");
+ctx.globalAlpha = 0;
+_assertSame(ctx.globalAlpha, 0, "ctx.globalAlpha", "0");
+ctx.globalAlpha = 1;
+_assertSame(ctx.globalAlpha, 1, "ctx.globalAlpha", "1");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.copy.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.copy.html
new file mode 100644
index 000000000..96492347b
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.copy.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.image.copy</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.image.copy</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.copy.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 255,255,0,191, "50,25", "255,255,0,191", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.copy.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.copy.png
new file mode 100644
index 000000000..8e0668efb
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.copy.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-atop.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-atop.html
new file mode 100644
index 000000000..221e7b205
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-atop.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.image.destination-atop</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.image.destination-atop</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.destination-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 128,255,128,191, "50,25", "128,255,128,191", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-atop.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-atop.png
new file mode 100644
index 000000000..59bdc91e9
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-atop.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-in.html
new file mode 100644
index 000000000..b52860205
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-in.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.image.destination-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.image.destination-in</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.destination-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-in';
+ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,255,96, "50,25", "0,255,255,96", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-in.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-in.png
new file mode 100644
index 000000000..790e418a6
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-in.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-out.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-out.html
new file mode 100644
index 000000000..572ad859a
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-out.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.image.destination-out</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.image.destination-out</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.destination-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,255,255,32, "50,25", "0,255,255,32", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-out.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-out.png
new file mode 100644
index 000000000..7f5ed1a83
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-out.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-over.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-over.html
new file mode 100644
index 000000000..16131412b
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-over.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.image.destination-over</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.image.destination-over</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.destination-over.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 109,255,146,223, "50,25", "109,255,146,223", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-over.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-over.png
new file mode 100644
index 000000000..ac8689223
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.destination-over.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.lighter.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.lighter.html
new file mode 100644
index 000000000..f44d6dc32
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.lighter.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.image.lighter</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.image.lighter</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.lighter.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'lighter';
+ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 191,255,128,255, "50,25", "191,255,128,255", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.lighter.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.lighter.png
new file mode 100644
index 000000000..9ffde4198
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.lighter.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-atop.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-atop.html
new file mode 100644
index 000000000..2d3a88a86
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-atop.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.image.source-atop</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.image.source-atop</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.source-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 191,255,64,128, "50,25", "191,255,64,128", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-atop.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-atop.png
new file mode 100644
index 000000000..1ef963019
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-atop.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-in.html
new file mode 100644
index 000000000..a8c1b5848
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-in.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.image.source-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.image.source-in</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.source-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-in';
+ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 255,255,0,96, "50,25", "255,255,0,96", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-in.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-in.png
new file mode 100644
index 000000000..c26cdccf0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-in.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-out.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-out.html
new file mode 100644
index 000000000..079d342c0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-out.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.image.source-out</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.image.source-out</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.source-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-out';
+ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 255,255,0,96, "50,25", "255,255,0,96", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-out.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-out.png
new file mode 100644
index 000000000..c26cdccf0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-out.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-over.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-over.html
new file mode 100644
index 000000000..bbb00e2e8
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-over.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.image.source-over</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.image.source-over</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.source-over.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 219,255,36,223, "50,25", "219,255,36,223", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-over.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-over.png
new file mode 100644
index 000000000..5437608a8
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.source-over.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.xor.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.xor.html
new file mode 100644
index 000000000..a38ece5dd
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.xor.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.image.xor</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.image.xor</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.xor.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'xor';
+ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 191,255,64,128, "50,25", "191,255,64,128", 5);
+
+
+});
+</script>
+<img src="/images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.xor.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.xor.png
new file mode 100644
index 000000000..1ef963019
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.image.xor.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.casesensitive.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.casesensitive.html
new file mode 100644
index 000000000..81b72375b
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.casesensitive.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.operation.casesensitive</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.operation.casesensitive</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'xor';
+ctx.globalCompositeOperation = 'Source-over';
+_assertSame(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.clear.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.clear.html
new file mode 100644
index 000000000..7212cd05f
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.clear.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.operation.clear</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.operation.clear</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'xor';
+ctx.globalCompositeOperation = 'clear';
+_assertSame(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.darker.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.darker.html
new file mode 100644
index 000000000..ac155ab04
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.darker.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.operation.darker</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.operation.darker</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'xor';
+ctx.globalCompositeOperation = 'darker';
+_assertSame(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.default.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.default.html
new file mode 100644
index 000000000..165e8b833
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.default.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.operation.default</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.operation.default</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+_assertSame(ctx.globalCompositeOperation, 'source-over', "ctx.globalCompositeOperation", "'source-over'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.get.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.get.html
new file mode 100644
index 000000000..53762dafe
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.get.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.operation.get</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.operation.get</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+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];
+ _assertSame(ctx.globalCompositeOperation, modes[i], "ctx.globalCompositeOperation", "modes[\""+(i)+"\"]");
+}
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.highlight.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.highlight.html
new file mode 100644
index 000000000..8a3bcf753
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.highlight.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.operation.highlight</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.operation.highlight</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'xor';
+ctx.globalCompositeOperation = 'highlight';
+_assertSame(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.nullsuffix.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.nullsuffix.html
new file mode 100644
index 000000000..aa3f8ccd5
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.nullsuffix.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.operation.nullsuffix</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.operation.nullsuffix</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'xor';
+ctx.globalCompositeOperation = 'source-over\0';
+_assertSame(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.over.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.over.html
new file mode 100644
index 000000000..e9b91e83d
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.over.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.operation.over</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.operation.over</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'xor';
+ctx.globalCompositeOperation = 'over';
+_assertSame(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.unrecognised.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.unrecognised.html
new file mode 100644
index 000000000..ced2accc4
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.operation.unrecognised.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.operation.unrecognised</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.operation.unrecognised</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'xor';
+ctx.globalCompositeOperation = 'nonexistent';
+_assertSame(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'");
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.copy.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.copy.html
new file mode 100644
index 000000000..8bf99f3f8
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.copy.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.solid.copy</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.solid.copy</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.copy.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.copy.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.copy.png
new file mode 100644
index 000000000..fc0883e74
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.copy.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-atop.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-atop.html
new file mode 100644
index 000000000..045caaa02
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-atop.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.solid.destination-atop</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.solid.destination-atop</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.destination-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-atop.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-atop.png
new file mode 100644
index 000000000..dd04072ba
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-atop.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-in.html
new file mode 100644
index 000000000..ec27d60b4
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-in.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.solid.destination-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.solid.destination-in</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.destination-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-in.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-in.png
new file mode 100644
index 000000000..dd04072ba
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-in.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-out.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-out.html
new file mode 100644
index 000000000..d96ce76ca
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-out.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.solid.destination-out</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.solid.destination-out</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.destination-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-out.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-out.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-out.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-over.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-over.html
new file mode 100644
index 000000000..08a02387d
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-over.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.solid.destination-over</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.solid.destination-over</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.destination-over.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-over.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-over.png
new file mode 100644
index 000000000..dd04072ba
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.destination-over.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.lighter.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.lighter.html
new file mode 100644
index 000000000..0ffdcbb0f
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.lighter.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.solid.lighter</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.solid.lighter</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.lighter.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'lighter';
+ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 255,255,255,255, "50,25", "255,255,255,255", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.lighter.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.lighter.png
new file mode 100644
index 000000000..bf48767a8
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.lighter.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-atop.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-atop.html
new file mode 100644
index 000000000..a122e437d
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-atop.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.solid.source-atop</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.solid.source-atop</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.source-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-atop.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-atop.png
new file mode 100644
index 000000000..fc0883e74
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-atop.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-in.html
new file mode 100644
index 000000000..ae3124ffa
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-in.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.solid.source-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.solid.source-in</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.source-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-in.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-in.png
new file mode 100644
index 000000000..fc0883e74
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-in.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-out.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-out.html
new file mode 100644
index 000000000..8ea16796c
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-out.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.solid.source-out</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.solid.source-out</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.source-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-out.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-out.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-out.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-over.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-over.html
new file mode 100644
index 000000000..e038d557b
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-over.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.solid.source-over</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.solid.source-over</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.source-over.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-over.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-over.png
new file mode 100644
index 000000000..fc0883e74
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.source-over.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.xor.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.xor.html
new file mode 100644
index 000000000..a7b4e821e
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.xor.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.solid.xor</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.solid.xor</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.xor.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'xor';
+ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.xor.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.xor.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.solid.xor.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.copy.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.copy.html
new file mode 100644
index 000000000..ede88859e
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.copy.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.transparent.copy</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.transparent.copy</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.copy.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,0,255,191, "50,25", "0,0,255,191", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.copy.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.copy.png
new file mode 100644
index 000000000..170e88183
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.copy.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-atop.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-atop.html
new file mode 100644
index 000000000..350fe2be3
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-atop.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.transparent.destination-atop</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.transparent.destination-atop</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.destination-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,128,128,191, "50,25", "0,128,128,191", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-atop.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-atop.png
new file mode 100644
index 000000000..57bbf64ac
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-atop.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-in.html
new file mode 100644
index 000000000..b2e907d2a
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-in.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.transparent.destination-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.transparent.destination-in</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.destination-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,255,0,96, "50,25", "0,255,0,96", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-in.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-in.png
new file mode 100644
index 000000000..c6895de98
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-in.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-out.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-out.html
new file mode 100644
index 000000000..aca47b8bd
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-out.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.transparent.destination-out</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.transparent.destination-out</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.destination-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,255,0,32, "50,25", "0,255,0,32", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-out.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-out.png
new file mode 100644
index 000000000..873a9c45d
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-out.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-over.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-over.html
new file mode 100644
index 000000000..676278df7
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-over.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.transparent.destination-over</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.transparent.destination-over</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.destination-over.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,146,109,223, "50,25", "0,146,109,223", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-over.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-over.png
new file mode 100644
index 000000000..c0f0326d2
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.destination-over.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.lighter.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.lighter.html
new file mode 100644
index 000000000..9aba34c48
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.lighter.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.transparent.lighter</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.transparent.lighter</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.lighter.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'lighter';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,128,191,255, "50,25", "0,128,191,255", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.lighter.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.lighter.png
new file mode 100644
index 000000000..bcb8ab408
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.lighter.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-atop.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-atop.html
new file mode 100644
index 000000000..18229d6ae
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-atop.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.transparent.source-atop</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.transparent.source-atop</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.source-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,64,191,128, "50,25", "0,64,191,128", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-atop.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-atop.png
new file mode 100644
index 000000000..e0afff6b0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-atop.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-in.html
new file mode 100644
index 000000000..57124d886
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-in.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.transparent.source-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.transparent.source-in</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.source-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,0,255,96, "50,25", "0,0,255,96", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-in.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-in.png
new file mode 100644
index 000000000..1459b5e54
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-in.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-out.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-out.html
new file mode 100644
index 000000000..9b4b9d309
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-out.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.transparent.source-out</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.transparent.source-out</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.source-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,0,255,96, "50,25", "0,0,255,96", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-out.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-out.png
new file mode 100644
index 000000000..1459b5e54
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-out.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-over.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-over.html
new file mode 100644
index 000000000..6299e8c8e
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-over.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.transparent.source-over</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.transparent.source-over</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.source-over.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,36,219,223, "50,25", "0,36,219,223", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-over.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-over.png
new file mode 100644
index 000000000..c92cd9563
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.source-over.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.xor.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.xor.html
new file mode 100644
index 000000000..b53d14048
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.xor.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.transparent.xor</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.transparent.xor</h1>
+<p class="desc"></p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.xor.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'xor';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,64,191,128, "50,25", "0,64,191,128", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.xor.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.xor.png
new file mode 100644
index 000000000..e0afff6b0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.transparent.xor.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.copy.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.copy.html
new file mode 100644
index 000000000..966d7265d
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.copy.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.fill.copy</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.fill.copy</h1>
+<p class="desc">fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.fill.copy.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.copy.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.copy.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.copy.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.destination-atop.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.destination-atop.html
new file mode 100644
index 000000000..8ffc8db3f
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.destination-atop.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.fill.destination-atop</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.fill.destination-atop</h1>
+<p class="desc">fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.fill.destination-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+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.translate(0, 25);
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.destination-atop.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.destination-atop.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.destination-atop.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.destination-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.destination-in.html
new file mode 100644
index 000000000..040fdf351
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.destination-in.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.fill.destination-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.fill.destination-in</h1>
+<p class="desc">fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.fill.destination-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+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.translate(0, 25);
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.destination-in.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.destination-in.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.destination-in.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.source-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.source-in.html
new file mode 100644
index 000000000..4d64f9094
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.source-in.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.fill.source-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.fill.source-in</h1>
+<p class="desc">fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.fill.source-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+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.translate(0, 25);
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.source-in.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.source-in.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.source-in.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.source-out.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.source-out.html
new file mode 100644
index 000000000..d1f39baff
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.source-out.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.fill.source-out</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.fill.source-out</h1>
+<p class="desc">fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.fill.source-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+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.translate(0, 25);
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.source-out.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.source-out.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.fill.source-out.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.copy.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.copy.html
new file mode 100644
index 000000000..43e070dc3
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.copy.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.image.copy</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.image.copy</h1>
+<p class="desc">drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.image.copy.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="/images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.copy.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.copy.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.copy.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.destination-atop.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.destination-atop.html
new file mode 100644
index 000000000..e59e8aa89
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.destination-atop.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.image.destination-atop</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.image.destination-atop</h1>
+<p class="desc">drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.image.destination-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10);
+_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="/images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.destination-atop.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.destination-atop.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.destination-atop.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.destination-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.destination-in.html
new file mode 100644
index 000000000..2872fd236
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.destination-in.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.image.destination-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.image.destination-in</h1>
+<p class="desc">drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.image.destination-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-in';
+ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10);
+_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="/images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.destination-in.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.destination-in.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.destination-in.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.source-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.source-in.html
new file mode 100644
index 000000000..234e92472
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.source-in.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.image.source-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.image.source-in</h1>
+<p class="desc">drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.image.source-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-in';
+ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10);
+_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="/images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.source-in.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.source-in.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.source-in.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.source-out.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.source-out.html
new file mode 100644
index 000000000..4ab233a48
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.source-out.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.image.source-out</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.image.source-out</h1>
+<p class="desc">drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.image.source-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-out';
+ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10);
+_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="/images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.source-out.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.source-out.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.image.source-out.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.copy.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.copy.html
new file mode 100644
index 000000000..68a936692
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.copy.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.nocontext.copy</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.nocontext.copy</h1>
+<p class="desc">drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.nocontext.copy.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'copy';
+var canvas2 = document.createElement('canvas');
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.copy.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.copy.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.copy.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.destination-atop.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.destination-atop.html
new file mode 100644
index 000000000..ad11e21d9
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.destination-atop.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.nocontext.destination-atop</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.nocontext.destination-atop</h1>
+<p class="desc">drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.nocontext.destination-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-atop';
+var canvas2 = document.createElement('canvas');
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.destination-atop.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.destination-atop.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.destination-atop.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.destination-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.destination-in.html
new file mode 100644
index 000000000..0412a7aa3
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.destination-in.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.nocontext.destination-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.nocontext.destination-in</h1>
+<p class="desc">drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.nocontext.destination-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-in';
+var canvas2 = document.createElement('canvas');
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.destination-in.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.destination-in.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.destination-in.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.source-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.source-in.html
new file mode 100644
index 000000000..d6136630e
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.source-in.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.nocontext.source-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.nocontext.source-in</h1>
+<p class="desc">drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.nocontext.source-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-in';
+var canvas2 = document.createElement('canvas');
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.source-in.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.source-in.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.source-in.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.source-out.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.source-out.html
new file mode 100644
index 000000000..be5d6bf12
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.source-out.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.nocontext.source-out</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.nocontext.source-out</h1>
+<p class="desc">drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.nocontext.source-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-out';
+var canvas2 = document.createElement('canvas');
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.source-out.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.source-out.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.nocontext.source-out.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.copy.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.copy.html
new file mode 100644
index 000000000..8c38388c2
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.copy.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.pattern.copy</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.pattern.copy</h1>
+<p class="desc">Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.pattern.copy.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+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);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="/images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.copy.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.copy.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.copy.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.destination-atop.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.destination-atop.html
new file mode 100644
index 000000000..7ad35f48d
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.destination-atop.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.pattern.destination-atop</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.pattern.destination-atop</h1>
+<p class="desc">Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.pattern.destination-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat');
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="/images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.destination-atop.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.destination-atop.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.destination-atop.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.destination-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.destination-in.html
new file mode 100644
index 000000000..085851c91
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.destination-in.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.pattern.destination-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.pattern.destination-in</h1>
+<p class="desc">Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.pattern.destination-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-in';
+ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat');
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="/images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.destination-in.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.destination-in.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.destination-in.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.source-in.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.source-in.html
new file mode 100644
index 000000000..7e0b8795c
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.source-in.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.pattern.source-in</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.pattern.source-in</h1>
+<p class="desc">Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.pattern.source-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-in';
+ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat');
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="/images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.source-in.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.source-in.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.source-in.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.source-out.html b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.source-out.html
new file mode 100644
index 000000000..0d34f693c
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.source-out.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.composite.uncovered.pattern.source-out</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.composite.uncovered.pattern.source-out</h1>
+<p class="desc">Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.pattern.source-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.");
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-out';
+ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat');
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="/images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.source-out.png b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.source-out.png
new file mode 100644
index 000000000..eeedd0ff0
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/2d.composite.uncovered.pattern.source-out.png
Binary files differ
diff --git a/testing/web-platform/tests/2dcontext/compositing/canvas_compositing_globalcompositeoperation_001-ref.htm b/testing/web-platform/tests/2dcontext/compositing/canvas_compositing_globalcompositeoperation_001-ref.htm
new file mode 100644
index 000000000..70196fb36
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/canvas_compositing_globalcompositeoperation_001-ref.htm
@@ -0,0 +1,11 @@
+<!doctype HTML>
+<html>
+ <head>
+ <title>HTML5 Canvas Test: globalCompositeOperation "destination-over"</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com" />
+ </head>
+ <body>
+ <p>Description: If the globalCompositeOperation is set to "destination-over", display the destination image wherever the destination image is opaque.</p>
+ <div><img alt='black rectangle' src="/images/black-rectangle.png"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/2dcontext/compositing/canvas_compositing_globalcompositeoperation_001.htm b/testing/web-platform/tests/2dcontext/compositing/canvas_compositing_globalcompositeoperation_001.htm
new file mode 100644
index 000000000..8d6208eb3
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/compositing/canvas_compositing_globalcompositeoperation_001.htm
@@ -0,0 +1,32 @@
+<!doctype HTML>
+<html>
+ <head>
+ <title>HTML5 Canvas Test: globalCompositeOperation "destination-over"</title>
+ <link rel="match" href="canvas_compositing_globalcompositeoperation_001-ref.htm">
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com" />
+ <link rel="help" href="http://www.w3.org/TR/2dcontext/#dom-context-2d-globalcompositeoperation" />
+ <meta name="assert" content="If the globalCompositeOperation is set to 'destination-over', display the destination image wherever the destination image is opaque." />
+ <script type="text/javascript">
+ function runTest()
+ {
+ var canvas = document.getElementById("canvas1");
+ var ctx = canvas.getContext("2d");
+
+ // Source image.
+ ctx.fillStyle = "rgba(0, 0, 0, 1.0)";
+ ctx.fillRect(0, 0, 100, 50);
+
+ // Assign the globalCompositeOperation.
+ ctx.globalCompositeOperation = "destination-over";
+
+ // Destination image.
+ ctx.fillStyle = "rgba(255, 0, 0, 1.0)";
+ ctx.fillRect(0, 0, 100, 50);
+ }
+ </script>
+ </head>
+ <body onload="runTest()">
+ <p>Description: If the globalCompositeOperation is set to "destination-over", display the destination image wherever the destination image is opaque.</p>
+ <canvas id="canvas1" width="300" height="150">Browser does not support HTML5 Canvas.</canvas>
+ </body>
+</html>