mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255
This commit is contained in:
parent
b2a5225831
commit
1a81b18b9f
12321 changed files with 544385 additions and 6 deletions
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.angle.1</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.path.arc.angle.1</h1>
|
||||
<p class="desc">arc() draws pi/2 .. -pi anticlockwise correctly</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("arc() draws pi/2 .. -pi anticlockwise correctly");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 0);
|
||||
ctx.arc(100, 0, 150, Math.PI/2, -Math.PI, true);
|
||||
ctx.fill();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.angle.2</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.path.arc.angle.2</h1>
|
||||
<p class="desc">arc() draws -3pi/2 .. -pi anticlockwise correctly</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("arc() draws -3pi/2 .. -pi anticlockwise correctly");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 0);
|
||||
ctx.arc(100, 0, 150, -3*Math.PI/2, -Math.PI, true);
|
||||
ctx.fill();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.angle.3</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.path.arc.angle.3</h1>
|
||||
<p class="desc">arc() wraps angles mod 2pi when anticlockwise and end > start+2pi</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("arc() wraps angles mod 2pi when anticlockwise and end > start+2pi");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 0);
|
||||
ctx.arc(100, 0, 150, (512+1/2)*Math.PI, (1024-1)*Math.PI, true);
|
||||
ctx.fill();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.angle.4</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.path.arc.angle.4</h1>
|
||||
<p class="desc">arc() draws a full circle when clockwise and end > start+2pi</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("arc() draws a full circle when clockwise and end > start+2pi");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(50, 25);
|
||||
ctx.arc(50, 25, 60, (512+1/2)*Math.PI, (1024-1)*Math.PI, false);
|
||||
ctx.fill();
|
||||
_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.angle.5</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.path.arc.angle.5</h1>
|
||||
<p class="desc">arc() wraps angles mod 2pi when clockwise and start > end+2pi</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("arc() wraps angles mod 2pi when clockwise and start > end+2pi");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 0);
|
||||
ctx.arc(100, 0, 150, (1024-1)*Math.PI, (512+1/2)*Math.PI, false);
|
||||
ctx.fill();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.angle.6</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.path.arc.angle.6</h1>
|
||||
<p class="desc">arc() draws a full circle when anticlockwise and start > end+2pi</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("arc() draws a full circle when anticlockwise and start > end+2pi");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(50, 25);
|
||||
ctx.arc(50, 25, 60, (1024-1)*Math.PI, (512+1/2)*Math.PI, true);
|
||||
ctx.fill();
|
||||
_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.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.path.arc.default</h1>
|
||||
<p class="desc">arc() with missing last argument defaults to clockwise</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("arc() with missing last argument defaults to clockwise");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 0);
|
||||
ctx.arc(100, 0, 150, -Math.PI, Math.PI/2);
|
||||
ctx.fill();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.empty</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.path.arc.empty</h1>
|
||||
<p class="desc">arc() with an empty path does not draw a straight line to the start point</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("arc() with an empty path does not draw a straight line to the start point");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arc(200, 25, 5, 0, 2*Math.PI, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.end</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.path.arc.end</h1>
|
||||
<p class="desc">arc() adds the end point of the arc to the subpath</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("arc() adds the end point of the arc to the subpath");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-100, 0);
|
||||
ctx.arc(-100, 0, 25, -Math.PI/2, Math.PI/2, true);
|
||||
ctx.lineTo(100, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.negative</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.path.arc.negative</h1>
|
||||
<p class="desc">arc() with negative radius throws INDEX_SIZE_ERR</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("arc() with negative radius throws INDEX_SIZE_ERR");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
assert_throws("INDEX_SIZE_ERR", function() { ctx.arc(0, 0, -1, 0, 0, true); });
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.nonempty</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.path.arc.nonempty</h1>
|
||||
<p class="desc">arc() with a non-empty path does draw a straight line to the start point</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("arc() with a non-empty path does draw a straight line to the start point");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arc(200, 25, 5, 0, 2*Math.PI, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.nonfinite</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.path.arc.nonfinite</h1>
|
||||
<p class="desc">arc() with Infinity/NaN is ignored</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("arc() with Infinity/NaN is ignored");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.arc(Infinity, 0, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(-Infinity, 0, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(NaN, 0, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, Infinity, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, -Infinity, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, NaN, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, Infinity, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, -Infinity, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, NaN, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, 50, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, 50, -Infinity, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, 50, NaN, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, 50, 0, Infinity, true);
|
||||
ctx.arc(0, 0, 50, 0, -Infinity, true);
|
||||
ctx.arc(0, 0, 50, 0, NaN, true);
|
||||
ctx.arc(Infinity, Infinity, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, Infinity, Infinity, 0, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, Infinity, Infinity, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, Infinity, Infinity, Infinity, Infinity, true);
|
||||
ctx.arc(Infinity, Infinity, Infinity, 0, Infinity, true);
|
||||
ctx.arc(Infinity, Infinity, 50, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, Infinity, 50, Infinity, Infinity, true);
|
||||
ctx.arc(Infinity, Infinity, 50, 0, Infinity, true);
|
||||
ctx.arc(Infinity, 0, Infinity, 0, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, 0, Infinity, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, 0, Infinity, Infinity, Infinity, true);
|
||||
ctx.arc(Infinity, 0, Infinity, 0, Infinity, true);
|
||||
ctx.arc(Infinity, 0, 50, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, 0, 50, Infinity, Infinity, true);
|
||||
ctx.arc(Infinity, 0, 50, 0, Infinity, true);
|
||||
ctx.arc(0, Infinity, Infinity, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, Infinity, Infinity, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(0, Infinity, Infinity, Infinity, Infinity, true);
|
||||
ctx.arc(0, Infinity, Infinity, 0, Infinity, true);
|
||||
ctx.arc(0, Infinity, 50, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(0, Infinity, 50, Infinity, Infinity, true);
|
||||
ctx.arc(0, Infinity, 50, 0, Infinity, true);
|
||||
ctx.arc(0, 0, Infinity, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, Infinity, Infinity, Infinity, true);
|
||||
ctx.arc(0, 0, Infinity, 0, Infinity, true);
|
||||
ctx.arc(0, 0, 50, Infinity, Infinity, true);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.scale.1</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.path.arc.scale.1</h1>
|
||||
<p class="desc">Non-uniformly scaled arcs are the right shape</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("Non-uniformly scaled arcs are the right shape");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.scale(2, 0.5);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.arc(25, 50, 56, 0, 2*Math.PI, false);
|
||||
ctx.fill();
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-25, 50);
|
||||
ctx.arc(-25, 50, 24, 0, 2*Math.PI, false);
|
||||
ctx.moveTo(75, 50);
|
||||
ctx.arc(75, 50, 24, 0, 2*Math.PI, false);
|
||||
ctx.moveTo(25, -25);
|
||||
ctx.arc(25, -25, 24, 0, 2*Math.PI, false);
|
||||
ctx.moveTo(25, 125);
|
||||
ctx.arc(25, 125, 24, 0, 2*Math.PI, false);
|
||||
ctx.fill();
|
||||
|
||||
_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255");
|
||||
_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255");
|
||||
_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255");
|
||||
_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255");
|
||||
_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255");
|
||||
_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.scale.2</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.path.arc.scale.2</h1>
|
||||
<p class="desc">Highly scaled arcs are the right shape</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("Highly scaled arcs are the right shape");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.scale(100, 100);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 1.2;
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 0, 0.6, 0, Math.PI/2, false);
|
||||
ctx.stroke();
|
||||
|
||||
_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.selfintersect.1</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.path.arc.selfintersect.1</h1>
|
||||
<p class="desc">arc() with lineWidth > 2*radius is drawn sensibly</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("arc() with lineWidth > 2*radius is drawn sensibly");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 200;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arc(100, 50, 25, 0, -Math.PI/2, true);
|
||||
ctx.stroke();
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 0, 25, 0, -Math.PI/2, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.selfintersect.2</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.path.arc.selfintersect.2</h1>
|
||||
<p class="desc">arc() with lineWidth > 2*radius is drawn sensibly</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("arc() with lineWidth > 2*radius is drawn sensibly");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 180;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.arc(-50, 50, 25, 0, -Math.PI/2, true);
|
||||
ctx.stroke();
|
||||
ctx.beginPath();
|
||||
ctx.arc(100, 0, 25, 0, -Math.PI/2, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255");
|
||||
_assertPixel(canvas, 97,1, 0,255,0,255, "97,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 97,2, 0,255,0,255, "97,2", "0,255,0,255");
|
||||
_assertPixel(canvas, 97,3, 0,255,0,255, "97,3", "0,255,0,255");
|
||||
_assertPixel(canvas, 2,48, 0,255,0,255, "2,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.shape.1</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.path.arc.shape.1</h1>
|
||||
<p class="desc">arc() from 0 to pi does not draw anything in the wrong half</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("arc() from 0 to pi does not draw anything in the wrong half");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 50, 50, 0, Math.PI, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 20,48, 0,255,0,255, "20,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.shape.2</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.path.arc.shape.2</h1>
|
||||
<p class="desc">arc() from 0 to pi draws stuff in the right half</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("arc() from 0 to pi draws stuff in the right half");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 100;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 50, 50, 0, Math.PI, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 20,48, 0,255,0,255, "20,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.shape.3</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.path.arc.shape.3</h1>
|
||||
<p class="desc">arc() from 0 to -pi/2 does not draw anything in the wrong quadrant</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("arc() from 0 to -pi/2 does not draw anything in the wrong quadrant");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 100;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 50, 50, 0, -Math.PI/2, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.shape.4</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.path.arc.shape.4</h1>
|
||||
<p class="desc">arc() from 0 to -pi/2 draws stuff in the right quadrant</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("arc() from 0 to -pi/2 draws stuff in the right quadrant");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 150;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.arc(-50, 50, 100, 0, -Math.PI/2, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.shape.5</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.path.arc.shape.5</h1>
|
||||
<p class="desc">arc() from 0 to 5pi does not draw crazy things</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("arc() from 0 to 5pi does not draw crazy things");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 200;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arc(300, 0, 100, 0, 5*Math.PI, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.twopie.1</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.path.arc.twopie.1</h1>
|
||||
<p class="desc">arc() draws nothing when end = start + 2pi-e and anticlockwise</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("arc() draws nothing when end = start + 2pi-e and anticlockwise");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 2*Math.PI - 1e-4, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.twopie.2</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.path.arc.twopie.2</h1>
|
||||
<p class="desc">arc() draws a full circle when end = start + 2pi-e and clockwise</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("arc() draws a full circle when end = start + 2pi-e and clockwise");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 2*Math.PI - 1e-4, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.twopie.3</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.path.arc.twopie.3</h1>
|
||||
<p class="desc">arc() draws a full circle when end = start + 2pi+e and anticlockwise</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("arc() draws a full circle when end = start + 2pi+e and anticlockwise");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 2*Math.PI + 1e-4, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.twopie.4</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.path.arc.twopie.4</h1>
|
||||
<p class="desc">arc() draws nothing when end = start + 2pi+e and clockwise</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("arc() draws nothing when end = start + 2pi+e and clockwise");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 2*Math.PI + 1e-4, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.zero.1</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.path.arc.zero.1</h1>
|
||||
<p class="desc">arc() draws nothing when startAngle = endAngle and anticlockwise</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("arc() draws nothing when startAngle = endAngle and anticlockwise");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 0, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.zero.2</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.path.arc.zero.2</h1>
|
||||
<p class="desc">arc() draws nothing when startAngle = endAngle and clockwise</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("arc() draws nothing when startAngle = endAngle and clockwise");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 0, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arc.zeroradius</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.path.arc.zeroradius</h1>
|
||||
<p class="desc">arc() with zero radius draws a line to the start point</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("arc() with zero radius draws a line to the start point");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00'
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arc(200, 25, 0, 0, Math.PI, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arcTo.coincide.1</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.path.arcTo.coincide.1</h1>
|
||||
<p class="desc">arcTo() has no effect if P0 = P1</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("arcTo() has no effect if P0 = P1");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(0, 25, 50, 1000, 1);
|
||||
ctx.lineTo(100, 25);
|
||||
ctx.stroke();
|
||||
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(50, 25);
|
||||
ctx.arcTo(50, 25, 100, 25, 1);
|
||||
ctx.stroke();
|
||||
|
||||
_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arcTo.coincide.2</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.path.arcTo.coincide.2</h1>
|
||||
<p class="desc">arcTo() draws a straight line to P1 if P1 = P2</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("arcTo() draws a straight line to P1 if P1 = P2");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, 100, 25, 1);
|
||||
ctx.stroke();
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arcTo.collinear.1</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.path.arcTo.collinear.1</h1>
|
||||
<p class="desc">arcTo() with all points on a line, and P1 between P0/P2, draws a straight line to P1</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("arcTo() with all points on a line, and P1 between P0/P2, draws a straight line to P1");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, 200, 25, 1);
|
||||
ctx.stroke();
|
||||
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-100, 25);
|
||||
ctx.arcTo(0, 25, 100, 25, 1);
|
||||
ctx.stroke();
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arcTo.collinear.2</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.path.arcTo.collinear.2</h1>
|
||||
<p class="desc">arcTo() with all points on a line, and P2 between P0/P1, draws a straight line to P1</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("arcTo() with all points on a line, and P2 between P0/P1, draws a straight line to P1");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, 10, 25, 1);
|
||||
ctx.stroke();
|
||||
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 25);
|
||||
ctx.arcTo(200, 25, 110, 25, 1);
|
||||
ctx.stroke();
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arcTo.collinear.3</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.path.arcTo.collinear.3</h1>
|
||||
<p class="desc">arcTo() with all points on a line, and P0 between P1/P2, draws a straight line to P1</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("arcTo() with all points on a line, and P0 between P1/P2, draws a straight line to P1");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, -100, 25, 1);
|
||||
ctx.stroke();
|
||||
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 25);
|
||||
ctx.arcTo(200, 25, 0, 25, 1);
|
||||
ctx.stroke();
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-100, 25);
|
||||
ctx.arcTo(0, 25, -200, 25, 1);
|
||||
ctx.stroke();
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arcTo.ensuresubpath.1</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.path.arcTo.ensuresubpath.1</h1>
|
||||
<p class="desc">If there is no subpath, the first control point is added (and nothing is drawn up to it)</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("If there is no subpath, the first control point is added (and nothing is drawn up to it)");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arcTo(100, 50, 200, 50, 0.1);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arcTo.ensuresubpath.2</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.path.arcTo.ensuresubpath.2</h1>
|
||||
<p class="desc">If there is no subpath, the first control point is added</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("If there is no subpath, the first control point is added");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.arcTo(0, 25, 50, 250, 0.1); // adds (x1,y1), draws nothing
|
||||
ctx.lineTo(100, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arcTo.negative</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.path.arcTo.negative</h1>
|
||||
<p class="desc">arcTo() with negative radius throws an exception</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("arcTo() with negative radius throws an exception");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
assert_throws("INDEX_SIZE_ERR", function() { ctx.arcTo(0, 0, 0, 0, -1); });
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arcTo.nonfinite</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.path.arcTo.nonfinite</h1>
|
||||
<p class="desc">arcTo() with Infinity/NaN is ignored</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("arcTo() with Infinity/NaN is ignored");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.arcTo(Infinity, 50, 0, 50, 0);
|
||||
ctx.arcTo(-Infinity, 50, 0, 50, 0);
|
||||
ctx.arcTo(NaN, 50, 0, 50, 0);
|
||||
ctx.arcTo(0, Infinity, 0, 50, 0);
|
||||
ctx.arcTo(0, -Infinity, 0, 50, 0);
|
||||
ctx.arcTo(0, NaN, 0, 50, 0);
|
||||
ctx.arcTo(0, 50, Infinity, 50, 0);
|
||||
ctx.arcTo(0, 50, -Infinity, 50, 0);
|
||||
ctx.arcTo(0, 50, NaN, 50, 0);
|
||||
ctx.arcTo(0, 50, 0, Infinity, 0);
|
||||
ctx.arcTo(0, 50, 0, -Infinity, 0);
|
||||
ctx.arcTo(0, 50, 0, NaN, 0);
|
||||
ctx.arcTo(0, 50, 0, 50, Infinity);
|
||||
ctx.arcTo(0, 50, 0, 50, -Infinity);
|
||||
ctx.arcTo(0, 50, 0, 50, NaN);
|
||||
ctx.arcTo(Infinity, Infinity, 0, 50, 0);
|
||||
ctx.arcTo(Infinity, Infinity, Infinity, 50, 0);
|
||||
ctx.arcTo(Infinity, Infinity, Infinity, Infinity, 0);
|
||||
ctx.arcTo(Infinity, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.arcTo(Infinity, Infinity, Infinity, 50, Infinity);
|
||||
ctx.arcTo(Infinity, Infinity, 0, Infinity, 0);
|
||||
ctx.arcTo(Infinity, Infinity, 0, Infinity, Infinity);
|
||||
ctx.arcTo(Infinity, Infinity, 0, 50, Infinity);
|
||||
ctx.arcTo(Infinity, 50, Infinity, 50, 0);
|
||||
ctx.arcTo(Infinity, 50, Infinity, Infinity, 0);
|
||||
ctx.arcTo(Infinity, 50, Infinity, Infinity, Infinity);
|
||||
ctx.arcTo(Infinity, 50, Infinity, 50, Infinity);
|
||||
ctx.arcTo(Infinity, 50, 0, Infinity, 0);
|
||||
ctx.arcTo(Infinity, 50, 0, Infinity, Infinity);
|
||||
ctx.arcTo(Infinity, 50, 0, 50, Infinity);
|
||||
ctx.arcTo(0, Infinity, Infinity, 50, 0);
|
||||
ctx.arcTo(0, Infinity, Infinity, Infinity, 0);
|
||||
ctx.arcTo(0, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.arcTo(0, Infinity, Infinity, 50, Infinity);
|
||||
ctx.arcTo(0, Infinity, 0, Infinity, 0);
|
||||
ctx.arcTo(0, Infinity, 0, Infinity, Infinity);
|
||||
ctx.arcTo(0, Infinity, 0, 50, Infinity);
|
||||
ctx.arcTo(0, 50, Infinity, Infinity, 0);
|
||||
ctx.arcTo(0, 50, Infinity, Infinity, Infinity);
|
||||
ctx.arcTo(0, 50, Infinity, 50, Infinity);
|
||||
ctx.arcTo(0, 50, 0, Infinity, Infinity);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arcTo.scale</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.path.arcTo.scale</h1>
|
||||
<p class="desc">arcTo scales the curve, not just the control points</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("arcTo scales the curve, not just the control points");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 50);
|
||||
ctx.translate(100, 0);
|
||||
ctx.scale(0.1, 1);
|
||||
ctx.arcTo(50, 50, 50, 0, 50);
|
||||
ctx.lineTo(-1000, 0);
|
||||
ctx.fill();
|
||||
|
||||
_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255");
|
||||
_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255");
|
||||
_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255");
|
||||
_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255");
|
||||
_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255");
|
||||
_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arcTo.shape.curve1</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.path.arcTo.shape.curve1</h1>
|
||||
<p class="desc">arcTo() curves in the right kind of shape</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("arcTo() curves in the right kind of shape");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
var tol = 1.5; // tolerance to avoid antialiasing artifacts
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 10;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(10, 25);
|
||||
ctx.arcTo(75, 25, 75, 60, 20);
|
||||
ctx.stroke();
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.rect(10, 20, 45, 10);
|
||||
ctx.moveTo(80, 45);
|
||||
ctx.arc(55, 45, 25+tol, 0, -Math.PI/2, true);
|
||||
ctx.arc(55, 45, 15-tol, -Math.PI/2, 0, false);
|
||||
ctx.fill();
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 55,19, 0,255,0,255, "55,19", "0,255,0,255");
|
||||
_assertPixel(canvas, 55,20, 0,255,0,255, "55,20", "0,255,0,255");
|
||||
_assertPixel(canvas, 55,21, 0,255,0,255, "55,21", "0,255,0,255");
|
||||
_assertPixel(canvas, 64,22, 0,255,0,255, "64,22", "0,255,0,255");
|
||||
_assertPixel(canvas, 65,21, 0,255,0,255, "65,21", "0,255,0,255");
|
||||
_assertPixel(canvas, 72,28, 0,255,0,255, "72,28", "0,255,0,255");
|
||||
_assertPixel(canvas, 73,27, 0,255,0,255, "73,27", "0,255,0,255");
|
||||
_assertPixel(canvas, 78,36, 0,255,0,255, "78,36", "0,255,0,255");
|
||||
_assertPixel(canvas, 79,35, 0,255,0,255, "79,35", "0,255,0,255");
|
||||
_assertPixel(canvas, 80,44, 0,255,0,255, "80,44", "0,255,0,255");
|
||||
_assertPixel(canvas, 80,45, 0,255,0,255, "80,45", "0,255,0,255");
|
||||
_assertPixel(canvas, 80,46, 0,255,0,255, "80,46", "0,255,0,255");
|
||||
_assertPixel(canvas, 65,45, 0,255,0,255, "65,45", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arcTo.shape.curve2</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.path.arcTo.shape.curve2</h1>
|
||||
<p class="desc">arcTo() curves in the right kind of shape</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("arcTo() curves in the right kind of shape");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
var tol = 1.5; // tolerance to avoid antialiasing artifacts
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.rect(10, 20, 45, 10);
|
||||
ctx.moveTo(80, 45);
|
||||
ctx.arc(55, 45, 25-tol, 0, -Math.PI/2, true);
|
||||
ctx.arc(55, 45, 15+tol, -Math.PI/2, 0, false);
|
||||
ctx.fill();
|
||||
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 10;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(10, 25);
|
||||
ctx.arcTo(75, 25, 75, 60, 20);
|
||||
ctx.stroke();
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 55,19, 0,255,0,255, "55,19", "0,255,0,255");
|
||||
_assertPixel(canvas, 55,20, 0,255,0,255, "55,20", "0,255,0,255");
|
||||
_assertPixel(canvas, 55,21, 0,255,0,255, "55,21", "0,255,0,255");
|
||||
_assertPixel(canvas, 64,22, 0,255,0,255, "64,22", "0,255,0,255");
|
||||
_assertPixel(canvas, 65,21, 0,255,0,255, "65,21", "0,255,0,255");
|
||||
_assertPixel(canvas, 72,28, 0,255,0,255, "72,28", "0,255,0,255");
|
||||
_assertPixel(canvas, 73,27, 0,255,0,255, "73,27", "0,255,0,255");
|
||||
_assertPixel(canvas, 78,36, 0,255,0,255, "78,36", "0,255,0,255");
|
||||
_assertPixel(canvas, 79,35, 0,255,0,255, "79,35", "0,255,0,255");
|
||||
_assertPixel(canvas, 80,44, 0,255,0,255, "80,44", "0,255,0,255");
|
||||
_assertPixel(canvas, 80,45, 0,255,0,255, "80,45", "0,255,0,255");
|
||||
_assertPixel(canvas, 80,46, 0,255,0,255, "80,46", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arcTo.shape.end</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.path.arcTo.shape.end</h1>
|
||||
<p class="desc">arcTo() does not draw anything from P1 to P2</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("arcTo() does not draw anything from P1 to P2");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-100, -100);
|
||||
ctx.arcTo(-100, 25, 200, 25, 10);
|
||||
ctx.stroke();
|
||||
|
||||
_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arcTo.shape.start</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.path.arcTo.shape.start</h1>
|
||||
<p class="desc">arcTo() draws a straight line from P0 to P1</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("arcTo() draws a straight line from P0 to P1");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(200, 25, 200, 50, 10);
|
||||
ctx.stroke();
|
||||
|
||||
_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arcTo.transformation</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.path.arcTo.transformation</h1>
|
||||
<p class="desc">arcTo joins up to the last subpath point correctly</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("arcTo joins up to the last subpath point correctly");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 50);
|
||||
ctx.translate(100, 0);
|
||||
ctx.arcTo(50, 50, 50, 0, 50);
|
||||
ctx.lineTo(-100, 0);
|
||||
ctx.fill();
|
||||
|
||||
_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255");
|
||||
_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255");
|
||||
_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255");
|
||||
_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255");
|
||||
_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255");
|
||||
_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arcTo.zero.1</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.path.arcTo.zero.1</h1>
|
||||
<p class="desc">arcTo() with zero radius draws a straight line from P0 to P1</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("arcTo() with zero radius draws a straight line from P0 to P1");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, 100, 100, 0);
|
||||
ctx.stroke();
|
||||
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, -25);
|
||||
ctx.arcTo(50, -25, 50, 50, 0);
|
||||
ctx.stroke();
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.arcTo.zero.2</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.path.arcTo.zero.2</h1>
|
||||
<p class="desc">arcTo() with zero radius draws a straight line from P0 to P1, even when all points are collinear</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("arcTo() with zero radius draws a straight line from P0 to P1, even when all points are collinear");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, -100, 25, 0);
|
||||
ctx.stroke();
|
||||
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 25);
|
||||
ctx.arcTo(200, 25, 50, 25, 0);
|
||||
ctx.stroke();
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.beginPath</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.path.beginPath</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.rect(0, 0, 100, 50);
|
||||
ctx.beginPath();
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fill();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.bezierCurveTo.basic</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.path.bezierCurveTo.basic</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 = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.bezierCurveTo(100, 25, 100, 25, 100, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.bezierCurveTo.ensuresubpath.1</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.path.bezierCurveTo.ensuresubpath.1</h1>
|
||||
<p class="desc">If there is no subpath, the first control point is added (and nothing is drawn up to it)</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("If there is no subpath, the first control point is added (and nothing is drawn up to it)");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.bezierCurveTo(100, 50, 200, 50, 200, 50);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.bezierCurveTo.ensuresubpath.2</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.path.bezierCurveTo.ensuresubpath.2</h1>
|
||||
<p class="desc">If there is no subpath, the first control point is added</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("If there is no subpath, the first control point is added");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.bezierCurveTo(0, 25, 100, 25, 100, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.bezierCurveTo.nonfinite</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.path.bezierCurveTo.nonfinite</h1>
|
||||
<p class="desc">bezierCurveTo() with Infinity/NaN is ignored</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("bezierCurveTo() with Infinity/NaN is ignored");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(-Infinity, 50, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(NaN, 50, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, -Infinity, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, NaN, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, -Infinity, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, NaN, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, -Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, NaN, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, -Infinity, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, NaN, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, 0, -Infinity);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, 0, NaN);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, 50, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, 0, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, 0, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, Infinity, Infinity);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.bezierCurveTo.scaled</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.path.bezierCurveTo.scaled</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 = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.scale(1000, 1000);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 0.055;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-2, 3.1);
|
||||
ctx.bezierCurveTo(-2, -1, 2.1, -1, 2.1, 3.1);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.bezierCurveTo.shape</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.path.bezierCurveTo.shape</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 = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 55;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-2000, 3100);
|
||||
ctx.bezierCurveTo(-2000, -1000, 2100, -1000, 2100, 3100);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.clip.basic.1</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.path.clip.basic.1</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 = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.rect(0, 0, 100, 50);
|
||||
ctx.clip();
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.clip.basic.2</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.path.clip.basic.2</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.beginPath();
|
||||
ctx.rect(-100, 0, 100, 50);
|
||||
ctx.clip();
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.clip.empty</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.path.clip.empty</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.beginPath();
|
||||
ctx.clip();
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.clip.intersect</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.path.clip.intersect</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.beginPath();
|
||||
ctx.rect(0, 0, 50, 50);
|
||||
ctx.clip();
|
||||
ctx.beginPath();
|
||||
ctx.rect(50, 0, 50, 50)
|
||||
ctx.clip();
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.clip.unaffected</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.path.clip.unaffected</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 = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.clip();
|
||||
|
||||
ctx.lineTo(0, 0);
|
||||
ctx.fill();
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.clip.winding.1</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.path.clip.winding.1</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.beginPath();
|
||||
ctx.moveTo(-10, -10);
|
||||
ctx.lineTo(110, -10);
|
||||
ctx.lineTo(110, 60);
|
||||
ctx.lineTo(-10, 60);
|
||||
ctx.lineTo(-10, -10);
|
||||
ctx.lineTo(0, 0);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.clip();
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.clip.winding.2</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.path.clip.winding.2</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 = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-10, -10);
|
||||
ctx.lineTo(110, -10);
|
||||
ctx.lineTo(110, 60);
|
||||
ctx.lineTo(-10, 60);
|
||||
ctx.lineTo(-10, -10);
|
||||
ctx.clip();
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.lineTo(0, 0);
|
||||
ctx.clip();
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.closePath.empty</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.path.closePath.empty</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.closePath();
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fill();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.closePath.newline</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.path.closePath.newline</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 = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.moveTo(-100, 25);
|
||||
ctx.lineTo(-100, -100);
|
||||
ctx.lineTo(200, -100);
|
||||
ctx.lineTo(200, 25);
|
||||
ctx.closePath();
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.closePath.nextpoint</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.path.closePath.nextpoint</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 = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.moveTo(-100, 25);
|
||||
ctx.lineTo(-100, -1000);
|
||||
ctx.closePath();
|
||||
ctx.lineTo(1000, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.fill.closed.basic</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.path.fill.closed.basic</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 = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.fill();
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.fill.closed.unaffected</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.path.fill.closed.unaffected</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 = '#00f';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fill();
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
_assertPixel(canvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255");
|
||||
_assertPixel(canvas, 10,40, 0,255,0,255, "10,40", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.fill.overlap</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.path.fill.overlap</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.path.fill.overlap.png" class="output expected" id="expected" alt="">
|
||||
<ul id="d"></ul>
|
||||
<script>
|
||||
var t = async_test("");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#000';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
|
||||
ctx.rect(0, 0, 100, 50);
|
||||
ctx.closePath();
|
||||
ctx.rect(10, 10, 80, 30);
|
||||
ctx.fill();
|
||||
|
||||
_assertPixelApprox(canvas, 50,25, 0,127,0,255, "50,25", "0,127,0,255", 1);
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 205 B |
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.fill.winding.add</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.path.fill.winding.add</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 = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.moveTo(-10, -10);
|
||||
ctx.lineTo(110, -10);
|
||||
ctx.lineTo(110, 60);
|
||||
ctx.lineTo(-10, 60);
|
||||
ctx.lineTo(-10, -10);
|
||||
ctx.lineTo(0, 0);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.fill();
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.fill.winding.subtract.1</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.path.fill.winding.subtract.1</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 = '#f00';
|
||||
ctx.moveTo(-10, -10);
|
||||
ctx.lineTo(110, -10);
|
||||
ctx.lineTo(110, 60);
|
||||
ctx.lineTo(-10, 60);
|
||||
ctx.lineTo(-10, -10);
|
||||
ctx.lineTo(0, 0);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.fill();
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.fill.winding.subtract.2</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.path.fill.winding.subtract.2</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 = '#f00';
|
||||
ctx.moveTo(-10, -10);
|
||||
ctx.lineTo(110, -10);
|
||||
ctx.lineTo(110, 60);
|
||||
ctx.lineTo(-10, 60);
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.fill();
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.fill.winding.subtract.3</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.path.fill.winding.subtract.3</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 = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.moveTo(-10, -10);
|
||||
ctx.lineTo(110, -10);
|
||||
ctx.lineTo(110, 60);
|
||||
ctx.lineTo(-10, 60);
|
||||
ctx.lineTo(-10, -10);
|
||||
ctx.lineTo(-20, -20);
|
||||
ctx.lineTo(120, -20);
|
||||
ctx.lineTo(120, 70);
|
||||
ctx.lineTo(-20, 70);
|
||||
ctx.lineTo(-20, -20);
|
||||
ctx.lineTo(0, 0);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.fill();
|
||||
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.initial</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.path.initial</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.closePath();
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fill();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.isPointInPath.arc</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.path.isPointInPath.arc</h1>
|
||||
<p class="desc">isPointInPath() works on arcs</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("isPointInPath() works on arcs");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.arc(50, 25, 10, 0, Math.PI, false);
|
||||
_assertSame(ctx.isPointInPath(50, 10), false, "ctx.isPointInPath(50, 10)", "false");
|
||||
_assertSame(ctx.isPointInPath(50, 20), false, "ctx.isPointInPath(50, 20)", "false");
|
||||
_assertSame(ctx.isPointInPath(50, 30), true, "ctx.isPointInPath(50, 30)", "true");
|
||||
_assertSame(ctx.isPointInPath(50, 40), false, "ctx.isPointInPath(50, 40)", "false");
|
||||
_assertSame(ctx.isPointInPath(30, 20), false, "ctx.isPointInPath(30, 20)", "false");
|
||||
_assertSame(ctx.isPointInPath(70, 20), false, "ctx.isPointInPath(70, 20)", "false");
|
||||
_assertSame(ctx.isPointInPath(30, 30), false, "ctx.isPointInPath(30, 30)", "false");
|
||||
_assertSame(ctx.isPointInPath(70, 30), false, "ctx.isPointInPath(70, 30)", "false");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.isPointInPath.basic.1</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.path.isPointInPath.basic.1</h1>
|
||||
<p class="desc">isPointInPath() detects whether the point is inside the path</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("isPointInPath() detects whether the point is inside the path");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.rect(0, 0, 20, 20);
|
||||
_assertSame(ctx.isPointInPath(10, 10), true, "ctx.isPointInPath(10, 10)", "true");
|
||||
_assertSame(ctx.isPointInPath(30, 10), false, "ctx.isPointInPath(30, 10)", "false");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.isPointInPath.basic.2</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.path.isPointInPath.basic.2</h1>
|
||||
<p class="desc">isPointInPath() detects whether the point is inside the path</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("isPointInPath() detects whether the point is inside the path");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.rect(20, 0, 20, 20);
|
||||
_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false");
|
||||
_assertSame(ctx.isPointInPath(30, 10), true, "ctx.isPointInPath(30, 10)", "true");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.isPointInPath.bezier</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.path.isPointInPath.bezier</h1>
|
||||
<p class="desc">isPointInPath() works on Bezier curves</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("isPointInPath() works on Bezier curves");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.moveTo(25, 25);
|
||||
ctx.bezierCurveTo(50, -50, 50, 100, 75, 25);
|
||||
_assertSame(ctx.isPointInPath(25, 20), false, "ctx.isPointInPath(25, 20)", "false");
|
||||
_assertSame(ctx.isPointInPath(25, 30), false, "ctx.isPointInPath(25, 30)", "false");
|
||||
_assertSame(ctx.isPointInPath(30, 20), true, "ctx.isPointInPath(30, 20)", "true");
|
||||
_assertSame(ctx.isPointInPath(30, 30), false, "ctx.isPointInPath(30, 30)", "false");
|
||||
_assertSame(ctx.isPointInPath(40, 2), false, "ctx.isPointInPath(40, 2)", "false");
|
||||
_assertSame(ctx.isPointInPath(40, 20), true, "ctx.isPointInPath(40, 20)", "true");
|
||||
_assertSame(ctx.isPointInPath(40, 30), false, "ctx.isPointInPath(40, 30)", "false");
|
||||
_assertSame(ctx.isPointInPath(40, 47), false, "ctx.isPointInPath(40, 47)", "false");
|
||||
_assertSame(ctx.isPointInPath(45, 20), true, "ctx.isPointInPath(45, 20)", "true");
|
||||
_assertSame(ctx.isPointInPath(45, 30), false, "ctx.isPointInPath(45, 30)", "false");
|
||||
_assertSame(ctx.isPointInPath(55, 20), false, "ctx.isPointInPath(55, 20)", "false");
|
||||
_assertSame(ctx.isPointInPath(55, 30), true, "ctx.isPointInPath(55, 30)", "true");
|
||||
_assertSame(ctx.isPointInPath(60, 2), false, "ctx.isPointInPath(60, 2)", "false");
|
||||
_assertSame(ctx.isPointInPath(60, 20), false, "ctx.isPointInPath(60, 20)", "false");
|
||||
_assertSame(ctx.isPointInPath(60, 30), true, "ctx.isPointInPath(60, 30)", "true");
|
||||
_assertSame(ctx.isPointInPath(60, 47), false, "ctx.isPointInPath(60, 47)", "false");
|
||||
_assertSame(ctx.isPointInPath(70, 20), false, "ctx.isPointInPath(70, 20)", "false");
|
||||
_assertSame(ctx.isPointInPath(70, 30), true, "ctx.isPointInPath(70, 30)", "true");
|
||||
_assertSame(ctx.isPointInPath(75, 20), false, "ctx.isPointInPath(75, 20)", "false");
|
||||
_assertSame(ctx.isPointInPath(75, 30), false, "ctx.isPointInPath(75, 30)", "false");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.isPointInPath.bigarc</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.path.isPointInPath.bigarc</h1>
|
||||
<p class="desc">isPointInPath() works on unclosed arcs larger than 2pi</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("isPointInPath() works on unclosed arcs larger than 2pi");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.arc(50, 25, 10, 0, 7, false);
|
||||
_assertSame(ctx.isPointInPath(50, 10), false, "ctx.isPointInPath(50, 10)", "false");
|
||||
_assertSame(ctx.isPointInPath(50, 20), true, "ctx.isPointInPath(50, 20)", "true");
|
||||
_assertSame(ctx.isPointInPath(50, 30), true, "ctx.isPointInPath(50, 30)", "true");
|
||||
_assertSame(ctx.isPointInPath(50, 40), false, "ctx.isPointInPath(50, 40)", "false");
|
||||
_assertSame(ctx.isPointInPath(30, 20), false, "ctx.isPointInPath(30, 20)", "false");
|
||||
_assertSame(ctx.isPointInPath(70, 20), false, "ctx.isPointInPath(70, 20)", "false");
|
||||
_assertSame(ctx.isPointInPath(30, 30), false, "ctx.isPointInPath(30, 30)", "false");
|
||||
_assertSame(ctx.isPointInPath(70, 30), false, "ctx.isPointInPath(70, 30)", "false");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.isPointInPath.edge</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.path.isPointInPath.edge</h1>
|
||||
<p class="desc">isPointInPath() counts points on the path as being inside</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("isPointInPath() counts points on the path as being inside");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.rect(0, 0, 20, 20);
|
||||
_assertSame(ctx.isPointInPath(0, 0), true, "ctx.isPointInPath(0, 0)", "true");
|
||||
_assertSame(ctx.isPointInPath(10, 0), true, "ctx.isPointInPath(10, 0)", "true");
|
||||
_assertSame(ctx.isPointInPath(20, 0), true, "ctx.isPointInPath(20, 0)", "true");
|
||||
_assertSame(ctx.isPointInPath(20, 10), true, "ctx.isPointInPath(20, 10)", "true");
|
||||
_assertSame(ctx.isPointInPath(20, 20), true, "ctx.isPointInPath(20, 20)", "true");
|
||||
_assertSame(ctx.isPointInPath(10, 20), true, "ctx.isPointInPath(10, 20)", "true");
|
||||
_assertSame(ctx.isPointInPath(0, 20), true, "ctx.isPointInPath(0, 20)", "true");
|
||||
_assertSame(ctx.isPointInPath(0, 10), true, "ctx.isPointInPath(0, 10)", "true");
|
||||
_assertSame(ctx.isPointInPath(10, -0.01), false, "ctx.isPointInPath(10, -0.01)", "false");
|
||||
_assertSame(ctx.isPointInPath(10, 20.01), false, "ctx.isPointInPath(10, 20.01)", "false");
|
||||
_assertSame(ctx.isPointInPath(-0.01, 10), false, "ctx.isPointInPath(-0.01, 10)", "false");
|
||||
_assertSame(ctx.isPointInPath(20.01, 10), false, "ctx.isPointInPath(20.01, 10)", "false");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.isPointInPath.empty</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.path.isPointInPath.empty</h1>
|
||||
<p class="desc">isPointInPath() works when there is no path</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("isPointInPath() works when there is no path");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
_assertSame(ctx.isPointInPath(0, 0), false, "ctx.isPointInPath(0, 0)", "false");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.isPointInPath.nonfinite</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.path.isPointInPath.nonfinite</h1>
|
||||
<p class="desc">isPointInPath() returns false for non-finite arguments</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("isPointInPath() returns false for non-finite arguments");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.rect(-100, -50, 200, 100);
|
||||
_assertSame(ctx.isPointInPath(Infinity, 0), false, "ctx.isPointInPath(Infinity, 0)", "false");
|
||||
_assertSame(ctx.isPointInPath(-Infinity, 0), false, "ctx.isPointInPath(-Infinity, 0)", "false");
|
||||
_assertSame(ctx.isPointInPath(NaN, 0), false, "ctx.isPointInPath(NaN, 0)", "false");
|
||||
_assertSame(ctx.isPointInPath(0, Infinity), false, "ctx.isPointInPath(0, Infinity)", "false");
|
||||
_assertSame(ctx.isPointInPath(0, -Infinity), false, "ctx.isPointInPath(0, -Infinity)", "false");
|
||||
_assertSame(ctx.isPointInPath(0, NaN), false, "ctx.isPointInPath(0, NaN)", "false");
|
||||
_assertSame(ctx.isPointInPath(NaN, NaN), false, "ctx.isPointInPath(NaN, NaN)", "false");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.isPointInPath.outside</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.path.isPointInPath.outside</h1>
|
||||
<p class="desc">isPointInPath() works on paths outside the canvas</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("isPointInPath() works on paths outside the canvas");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.rect(0, -100, 20, 20);
|
||||
ctx.rect(20, -10, 20, 20);
|
||||
_assertSame(ctx.isPointInPath(10, -110), false, "ctx.isPointInPath(10, -110)", "false");
|
||||
_assertSame(ctx.isPointInPath(10, -90), true, "ctx.isPointInPath(10, -90)", "true");
|
||||
_assertSame(ctx.isPointInPath(10, -70), false, "ctx.isPointInPath(10, -70)", "false");
|
||||
_assertSame(ctx.isPointInPath(30, -20), false, "ctx.isPointInPath(30, -20)", "false");
|
||||
_assertSame(ctx.isPointInPath(30, 0), true, "ctx.isPointInPath(30, 0)", "true");
|
||||
_assertSame(ctx.isPointInPath(30, 20), false, "ctx.isPointInPath(30, 20)", "false");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.isPointInPath.subpath</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.path.isPointInPath.subpath</h1>
|
||||
<p class="desc">isPointInPath() uses the current path, not just the subpath</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("isPointInPath() uses the current path, not just the subpath");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.rect(0, 0, 20, 20);
|
||||
ctx.beginPath();
|
||||
ctx.rect(20, 0, 20, 20);
|
||||
ctx.closePath();
|
||||
ctx.rect(40, 0, 20, 20);
|
||||
_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false");
|
||||
_assertSame(ctx.isPointInPath(30, 10), true, "ctx.isPointInPath(30, 10)", "true");
|
||||
_assertSame(ctx.isPointInPath(50, 10), true, "ctx.isPointInPath(50, 10)", "true");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.isPointInPath.transform.1</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.path.isPointInPath.transform.1</h1>
|
||||
<p class="desc">isPointInPath() handles transformations correctly</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("isPointInPath() handles transformations correctly");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.translate(50, 0);
|
||||
ctx.rect(0, 0, 20, 20);
|
||||
_assertSame(ctx.isPointInPath(-40, 10), false, "ctx.isPointInPath(-40, 10)", "false");
|
||||
_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false");
|
||||
_assertSame(ctx.isPointInPath(49, 10), false, "ctx.isPointInPath(49, 10)", "false");
|
||||
_assertSame(ctx.isPointInPath(51, 10), true, "ctx.isPointInPath(51, 10)", "true");
|
||||
_assertSame(ctx.isPointInPath(69, 10), true, "ctx.isPointInPath(69, 10)", "true");
|
||||
_assertSame(ctx.isPointInPath(71, 10), false, "ctx.isPointInPath(71, 10)", "false");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.isPointInPath.transform.2</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.path.isPointInPath.transform.2</h1>
|
||||
<p class="desc">isPointInPath() handles transformations correctly</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("isPointInPath() handles transformations correctly");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.rect(50, 0, 20, 20);
|
||||
ctx.translate(50, 0);
|
||||
_assertSame(ctx.isPointInPath(-40, 10), false, "ctx.isPointInPath(-40, 10)", "false");
|
||||
_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false");
|
||||
_assertSame(ctx.isPointInPath(49, 10), false, "ctx.isPointInPath(49, 10)", "false");
|
||||
_assertSame(ctx.isPointInPath(51, 10), true, "ctx.isPointInPath(51, 10)", "true");
|
||||
_assertSame(ctx.isPointInPath(69, 10), true, "ctx.isPointInPath(69, 10)", "true");
|
||||
_assertSame(ctx.isPointInPath(71, 10), false, "ctx.isPointInPath(71, 10)", "false");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.isPointInPath.transform.3</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.path.isPointInPath.transform.3</h1>
|
||||
<p class="desc">isPointInPath() handles transformations correctly</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("isPointInPath() handles transformations correctly");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.scale(-1, 1);
|
||||
ctx.rect(-70, 0, 20, 20);
|
||||
_assertSame(ctx.isPointInPath(-40, 10), false, "ctx.isPointInPath(-40, 10)", "false");
|
||||
_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false");
|
||||
_assertSame(ctx.isPointInPath(49, 10), false, "ctx.isPointInPath(49, 10)", "false");
|
||||
_assertSame(ctx.isPointInPath(51, 10), true, "ctx.isPointInPath(51, 10)", "true");
|
||||
_assertSame(ctx.isPointInPath(69, 10), true, "ctx.isPointInPath(69, 10)", "true");
|
||||
_assertSame(ctx.isPointInPath(71, 10), false, "ctx.isPointInPath(71, 10)", "false");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.isPointInPath.transform.4</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.path.isPointInPath.transform.4</h1>
|
||||
<p class="desc">isPointInPath() handles transformations correctly</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("isPointInPath() handles transformations correctly");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.translate(50, 0);
|
||||
ctx.rect(50, 0, 20, 20);
|
||||
ctx.translate(0, 50);
|
||||
_assertSame(ctx.isPointInPath(60, 10), false, "ctx.isPointInPath(60, 10)", "false");
|
||||
_assertSame(ctx.isPointInPath(110, 10), true, "ctx.isPointInPath(110, 10)", "true");
|
||||
_assertSame(ctx.isPointInPath(110, 60), false, "ctx.isPointInPath(110, 60)", "false");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.isPointInPath.unclosed</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.path.isPointInPath.unclosed</h1>
|
||||
<p class="desc">isPointInPath() works on unclosed subpaths</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("isPointInPath() works on unclosed subpaths");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(20, 0);
|
||||
ctx.lineTo(20, 20);
|
||||
ctx.lineTo(0, 20);
|
||||
_assertSame(ctx.isPointInPath(10, 10), true, "ctx.isPointInPath(10, 10)", "true");
|
||||
_assertSame(ctx.isPointInPath(30, 10), false, "ctx.isPointInPath(30, 10)", "false");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.isPointInPath.winding</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.path.isPointInPath.winding</h1>
|
||||
<p class="desc">isPointInPath() uses the non-zero winding number rule</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("isPointInPath() uses the non-zero winding number rule");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
// Create a square ring, using opposite windings to make a hole in the centre
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(50, 0);
|
||||
ctx.lineTo(50, 50);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.lineTo(0, 0);
|
||||
ctx.lineTo(10, 10);
|
||||
ctx.lineTo(10, 40);
|
||||
ctx.lineTo(40, 40);
|
||||
ctx.lineTo(40, 10);
|
||||
ctx.lineTo(10, 10);
|
||||
|
||||
_assertSame(ctx.isPointInPath(5, 5), true, "ctx.isPointInPath(5, 5)", "true");
|
||||
_assertSame(ctx.isPointInPath(25, 5), true, "ctx.isPointInPath(25, 5)", "true");
|
||||
_assertSame(ctx.isPointInPath(45, 5), true, "ctx.isPointInPath(45, 5)", "true");
|
||||
_assertSame(ctx.isPointInPath(5, 25), true, "ctx.isPointInPath(5, 25)", "true");
|
||||
_assertSame(ctx.isPointInPath(25, 25), false, "ctx.isPointInPath(25, 25)", "false");
|
||||
_assertSame(ctx.isPointInPath(45, 25), true, "ctx.isPointInPath(45, 25)", "true");
|
||||
_assertSame(ctx.isPointInPath(5, 45), true, "ctx.isPointInPath(5, 45)", "true");
|
||||
_assertSame(ctx.isPointInPath(25, 45), true, "ctx.isPointInPath(25, 45)", "true");
|
||||
_assertSame(ctx.isPointInPath(45, 45), true, "ctx.isPointInPath(45, 45)", "true");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.lineTo.basic</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.path.lineTo.basic</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 = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.lineTo(100, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.lineTo.ensuresubpath.1</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.path.lineTo.ensuresubpath.1</h1>
|
||||
<p class="desc">If there is no subpath, the point is added and nothing is drawn</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("If there is no subpath, the point is added and nothing is drawn");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.lineTo.ensuresubpath.2</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.path.lineTo.ensuresubpath.2</h1>
|
||||
<p class="desc">If there is no subpath, the point is added and used for subsequent drawing</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("If there is no subpath, the point is added and used for subsequent drawing");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.lineTo(0, 25);
|
||||
ctx.lineTo(100, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.lineTo.nextpoint</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.path.lineTo.nextpoint</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 = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-100, -100);
|
||||
ctx.lineTo(0, 25);
|
||||
ctx.lineTo(100, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.lineTo.nonfinite</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.path.lineTo.nonfinite</h1>
|
||||
<p class="desc">lineTo() with Infinity/NaN is ignored</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("lineTo() with Infinity/NaN is ignored");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.lineTo(Infinity, 50);
|
||||
ctx.lineTo(-Infinity, 50);
|
||||
ctx.lineTo(NaN, 50);
|
||||
ctx.lineTo(0, Infinity);
|
||||
ctx.lineTo(0, -Infinity);
|
||||
ctx.lineTo(0, NaN);
|
||||
ctx.lineTo(Infinity, Infinity);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.moveTo.basic</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.path.moveTo.basic</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 = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.rect(0, 0, 10, 50);
|
||||
ctx.moveTo(100, 0);
|
||||
ctx.lineTo(10, 0);
|
||||
ctx.lineTo(10, 50);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
_assertPixel(canvas, 90,25, 0,255,0,255, "90,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.moveTo.multiple</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.path.moveTo.multiple</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 = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.moveTo(100, 25);
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.lineTo(100, 25);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.moveTo.newsubpath</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.path.moveTo.newsubpath</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.beginPath();
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.moveTo(100, 0);
|
||||
ctx.moveTo(100, 50);
|
||||
ctx.moveTo(0, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fill();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.moveTo.nonfinite</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.path.moveTo.nonfinite</h1>
|
||||
<p class="desc">moveTo() with Infinity/NaN is ignored</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("moveTo() with Infinity/NaN is ignored");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.moveTo(Infinity, 50);
|
||||
ctx.moveTo(-Infinity, 50);
|
||||
ctx.moveTo(NaN, 50);
|
||||
ctx.moveTo(0, Infinity);
|
||||
ctx.moveTo(0, -Infinity);
|
||||
ctx.moveTo(0, NaN);
|
||||
ctx.moveTo(Infinity, Infinity);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.quadraticCurveTo.basic</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.path.quadraticCurveTo.basic</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 = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.quadraticCurveTo(100, 25, 100, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.quadraticCurveTo.ensuresubpath.1</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.path.quadraticCurveTo.ensuresubpath.1</h1>
|
||||
<p class="desc">If there is no subpath, the first control point is added (and nothing is drawn up to it)</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("If there is no subpath, the first control point is added (and nothing is drawn up to it)");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.quadraticCurveTo(100, 50, 200, 50);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.quadraticCurveTo.ensuresubpath.2</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.path.quadraticCurveTo.ensuresubpath.2</h1>
|
||||
<p class="desc">If there is no subpath, the first control point is added</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("If there is no subpath, the first control point is added");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.quadraticCurveTo(0, 25, 100, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue