mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 04:27:41 +00:00
Bug 655926, Test even-odd fill rule. r=joe
This commit is contained in:
parent
377e990c19
commit
38a6987ed3
16
layout/reftests/canvas/evenodd-fill-1.html
Normal file
16
layout/reftests/canvas/evenodd-fill-1.html
Normal file
@ -0,0 +1,16 @@
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
window.onload = function() {
|
||||
var ctx = document.getElementById("c1").getContext("2d");
|
||||
ctx.mozFillRule = "evenodd";
|
||||
ctx.rect(50, 50, 200, 200);
|
||||
ctx.rect(100, 100, 100, 100);
|
||||
ctx.fill();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div><canvas id="c1" width="300" height="300"></canvas></div>
|
||||
</body>
|
||||
</html>
|
19
layout/reftests/canvas/evenodd-fill-2.html
Normal file
19
layout/reftests/canvas/evenodd-fill-2.html
Normal file
@ -0,0 +1,19 @@
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
window.onload = function() {
|
||||
var ctx = document.getElementById("c1").getContext("2d");
|
||||
ctx.mozFillRule = "evenodd";
|
||||
ctx.rect(50, 50, 200, 200);
|
||||
ctx.rect(100, 100, 100, 100);
|
||||
ctx.clip();
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.fillRect(0, 0, 300, 300);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div><canvas id="c1" width="300" height="300"></canvas></div>
|
||||
</body>
|
||||
</html>
|
27
layout/reftests/canvas/evenodd-fill-3.html
Normal file
27
layout/reftests/canvas/evenodd-fill-3.html
Normal file
@ -0,0 +1,27 @@
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
window.onload = function() {
|
||||
var ctx = document.getElementById("c1").getContext("2d");
|
||||
ctx.mozFillRule = "evenodd";
|
||||
|
||||
ctx.moveTo(50, 50);
|
||||
ctx.lineTo(250, 50);
|
||||
ctx.lineTo(250, 250);
|
||||
ctx.lineTo(50, 250);
|
||||
ctx.lineTo(50, 50);
|
||||
|
||||
ctx.moveTo(100, 100);
|
||||
ctx.lineTo(100, 200);
|
||||
ctx.lineTo(200, 200);
|
||||
ctx.lineTo(200, 100);
|
||||
ctx.lineTo(100, 100);
|
||||
|
||||
ctx.fill();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div><canvas id="c1" width="300" height="300"></canvas></div>
|
||||
</body>
|
||||
</html>
|
17
layout/reftests/canvas/evenodd-fill-ref.html
Normal file
17
layout/reftests/canvas/evenodd-fill-ref.html
Normal file
@ -0,0 +1,17 @@
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
window.onload = function() {
|
||||
var ctx = document.getElementById("c1").getContext("2d");
|
||||
ctx.rect(50, 50, 200, 50);
|
||||
ctx.rect(50, 50, 50, 200);
|
||||
ctx.rect(250, 250, -200, -50);
|
||||
ctx.rect(250, 250, -50, -200);
|
||||
ctx.fill();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div><canvas id="c1" width="300" height="300"></canvas></div>
|
||||
</body>
|
||||
</html>
|
43
layout/reftests/canvas/evenodd-fill-sanity.html
Normal file
43
layout/reftests/canvas/evenodd-fill-sanity.html
Normal file
@ -0,0 +1,43 @@
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
function assert(cond, msg) { if (!cond) { throw msg; } }
|
||||
window.onload = function() {
|
||||
try {
|
||||
var ctx = document.getElementById("c1").getContext("2d");
|
||||
|
||||
assert("nonzero" == ctx.mozFillRule,
|
||||
"Default fillRule is 'nonzero'");
|
||||
|
||||
ctx.mozFillRule = "evenodd";
|
||||
assert("evenodd" == ctx.mozFillRule,
|
||||
"fillRule understands 'evenodd'");
|
||||
ctx.mozFillRule = "nonzero";
|
||||
|
||||
ctx.mozFillRule = "garbageLSKJDF 29879234";
|
||||
assert("nonzero" == ctx.mozFillRule,
|
||||
"Garbage fillRule string has no effect");
|
||||
|
||||
ctx.mozFillRule = "evenodd";
|
||||
ctx.mozFillRule = "garbageLSKJDF 29879234";
|
||||
assert("evenodd" == ctx.mozFillRule,
|
||||
"Garbage fillRule string has no effect");
|
||||
ctx.mozFillRule = "nonzero";
|
||||
|
||||
ctx.save();
|
||||
ctx.mozFillRule = "evenodd";
|
||||
ctx.restore();
|
||||
assert("nonzero" == ctx.mozFillRule,
|
||||
"fillRule was saved then restored");
|
||||
} catch (e) {
|
||||
document.body.innerHTML = "FAIL: "+ e.toString();
|
||||
return;
|
||||
}
|
||||
document.body.innerHTML = "Pass";
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div><canvas id="c1" width="300" height="300"></canvas></div>
|
||||
</body>
|
||||
</html>
|
15
layout/reftests/canvas/nonzero-fill-1.html
Normal file
15
layout/reftests/canvas/nonzero-fill-1.html
Normal file
@ -0,0 +1,15 @@
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
window.onload = function() {
|
||||
var ctx = document.getElementById("c1").getContext("2d");
|
||||
ctx.rect(50, 50, 200, 200);
|
||||
ctx.rect(100, 100, 100, 100);
|
||||
ctx.fill();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div><canvas id="c1" width="300" height="300"></canvas></div>
|
||||
</body>
|
||||
</html>
|
26
layout/reftests/canvas/nonzero-fill-2.html
Normal file
26
layout/reftests/canvas/nonzero-fill-2.html
Normal file
@ -0,0 +1,26 @@
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
window.onload = function() {
|
||||
var ctx = document.getElementById("c1").getContext("2d");
|
||||
|
||||
ctx.moveTo(50, 50);
|
||||
ctx.lineTo(250, 50);
|
||||
ctx.lineTo(250, 250);
|
||||
ctx.lineTo(50, 250);
|
||||
ctx.lineTo(50, 50);
|
||||
|
||||
ctx.moveTo(100, 100);
|
||||
ctx.lineTo(100, 200);
|
||||
ctx.lineTo(200, 200);
|
||||
ctx.lineTo(200, 100);
|
||||
ctx.lineTo(100, 100);
|
||||
|
||||
ctx.fill();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div><canvas id="c1" width="300" height="300"></canvas></div>
|
||||
</body>
|
||||
</html>
|
@ -47,3 +47,9 @@ fails-if(Android) != text-font-lang.html text-font-lang-notref.html
|
||||
fails-if(cocoaWidget) == linear-gradient-1b.html linear-gradient-1-ref.html
|
||||
|
||||
== zero-dimensions.html zero-dimensions-ref.html
|
||||
|
||||
== evenodd-fill-sanity.html data:text/html,<body>Pass
|
||||
!= evenodd-fill-1.html nonzero-fill-1.html
|
||||
== evenodd-fill-1.html evenodd-fill-ref.html
|
||||
== evenodd-fill-2.html evenodd-fill-ref.html
|
||||
== evenodd-fill-3.html nonzero-fill-2.html
|
||||
|
Loading…
x
Reference in New Issue
Block a user