1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/canvas/test/test_canvas.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,24924 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<title>Canvas Tests</title> 1.6 +<script src="/tests/SimpleTest/SimpleTest.js"></script> 1.7 +<link rel="stylesheet" href="/tests/SimpleTest/test.css"> 1.8 +<body> 1.9 +<script> 1.10 + 1.11 +SimpleTest.waitForExplicitFinish(); 1.12 +const Cc = SpecialPowers.Cc; 1.13 +const Cr = SpecialPowers.Cr; 1.14 + 1.15 +function IsD2DEnabled() { 1.16 + var enabled = false; 1.17 + 1.18 + try { 1.19 + enabled = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).D2DEnabled; 1.20 + } catch(e) {} 1.21 + 1.22 + return enabled; 1.23 +} 1.24 + 1.25 +function IsLinux() { 1.26 + var os = ""; 1.27 + 1.28 + try { 1.29 + os = Cc["@mozilla.org/xre/app-info;1"] 1.30 + .getService(SpecialPowers.Ci.nsIXULRuntime).OS; 1.31 + } catch (e) {} 1.32 + 1.33 + return os.indexOf("Linux") == 0 && 1.34 + navigator.appVersion.indexOf("Android") == -1; 1.35 +} 1.36 + 1.37 +function IsMacOSX10_5orOlder() { 1.38 + var is105orOlder = false; 1.39 + 1.40 + if (navigator.platform.indexOf("Mac") == 0) { 1.41 + var version = Cc["@mozilla.org/system-info;1"] 1.42 + .getService(SpecialPowers.Ci.nsIPropertyBag2) 1.43 + .getProperty("version"); 1.44 + // the next line is correct: Mac OS 10.6 corresponds to Darwin version 10 ! 1.45 + // Mac OS 10.5 would be Darwin version 9. the |version| string we've got here 1.46 + // is the Darwin version. 1.47 + is105orOlder = (parseFloat(version) < 10.0); 1.48 + } 1.49 + return is105orOlder; 1.50 +} 1.51 + 1.52 + 1.53 +function IsAzureSkia() { 1.54 + var enabled = false; 1.55 + 1.56 + try { 1.57 + var backend = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).getInfo().AzureCanvasBackend; 1.58 + enabled = (backend == "skia"); 1.59 + } catch (e) { } 1.60 + 1.61 + return enabled; 1.62 +} 1.63 + 1.64 +function IsAcceleratedSkia() { 1.65 + var enabled = false; 1.66 + 1.67 + try { 1.68 + var props = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).getInfo(); 1.69 + enabled = props.AzureCanvasBackend == "skia" && props.AzureSkiaAccelerated; 1.70 + } catch(e) { } 1.71 + 1.72 + return enabled; 1.73 +} 1.74 + 1.75 +function IsAzureCairo() { 1.76 + var enabled = false; 1.77 + 1.78 + try { 1.79 + var backend = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).getInfo().AzureCanvasBackend; 1.80 + enabled = (backend == "cairo"); 1.81 + } catch (e) { } 1.82 + 1.83 + return enabled; 1.84 +} 1.85 + 1.86 +</script> 1.87 +<!-- Includes all the tests in the content/canvas/tests except for test_bug397524.html --> 1.88 + 1.89 +<!-- [[[ test_2d.canvas.readonly.html ]]] --> 1.90 + 1.91 +<p>Canvas test: 2d.canvas.readonly</p> 1.92 +<!-- Testing: CanvasRenderingContext2D.canvas is readonly --> 1.93 +<canvas id="c1" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.94 +<script> 1.95 + 1.96 +function test_2d_canvas_readonly() { 1.97 + 1.98 +var canvas = document.getElementById('c1'); 1.99 +var ctx = canvas.getContext('2d'); 1.100 + 1.101 +var c = document.createElement('canvas'); 1.102 +var d = ctx.canvas; 1.103 +ok(c !== d, "c !== d"); 1.104 +try { ctx.canvas = c; } catch (e) {} // not sure whether this should throw or not... 1.105 +ok(ctx.canvas === d, "ctx.canvas === d"); 1.106 + 1.107 + 1.108 +} 1.109 +</script> 1.110 + 1.111 +<!-- [[[ test_2d.canvas.reference.html ]]] --> 1.112 + 1.113 +<p>Canvas test: 2d.canvas.reference</p> 1.114 +<!-- Testing: CanvasRenderingContext2D.canvas refers back to its canvas --> 1.115 +<canvas id="c2" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.116 +<script> 1.117 + 1.118 +function test_2d_canvas_reference() { 1.119 + 1.120 +var canvas = document.getElementById('c2'); 1.121 +var ctx = canvas.getContext('2d'); 1.122 + 1.123 +ok(ctx.canvas === canvas, "ctx.canvas === canvas"); 1.124 + 1.125 + 1.126 +} 1.127 +</script> 1.128 + 1.129 +<!-- [[[ test_2d.clearRect.basic.html ]]] --> 1.130 + 1.131 +<p>Canvas test: 2d.clearRect.basic</p> 1.132 +<canvas id="c3" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.133 +<script> 1.134 +function isPixel(ctx, x,y, r,g,b,a, d) { 1.135 + var pos = x + "," + y; 1.136 + var colour = r + "," + g + "," + b + "," + a; 1.137 + var pixel = ctx.getImageData(x, y, 1, 1); 1.138 + var pr = pixel.data[0], 1.139 + pg = pixel.data[1], 1.140 + pb = pixel.data[2], 1.141 + pa = pixel.data[3]; 1.142 + ok(r-d <= pr && pr <= r+d && 1.143 + g-d <= pg && pg <= g+d && 1.144 + b-d <= pb && pb <= b+d && 1.145 + a-d <= pa && pa <= a+d, 1.146 + "pixel "+pos+" of "+ctx.canvas.id+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d); 1.147 +} 1.148 + 1.149 +function test_2d_clearRect_basic() { 1.150 + 1.151 +var canvas = document.getElementById('c3'); 1.152 +var ctx = canvas.getContext('2d'); 1.153 + 1.154 +ctx.fillStyle = '#f00'; 1.155 +ctx.fillRect(0, 0, 100, 50); 1.156 +ctx.clearRect(0, 0, 100, 50); 1.157 +isPixel(ctx, 50,25, 0,0,0,0, 0); 1.158 + 1.159 + 1.160 +} 1.161 +</script> 1.162 + 1.163 +<!-- [[[ test_2d.clearRect.clip.html ]]] --> 1.164 + 1.165 +<p>Canvas test: 2d.clearRect.clip</p> 1.166 +<canvas id="c4" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.167 +<script> 1.168 + 1.169 + 1.170 +function test_2d_clearRect_clip() { 1.171 + 1.172 +var canvas = document.getElementById('c4'); 1.173 +var ctx = canvas.getContext('2d'); 1.174 + 1.175 +ctx.fillStyle = '#0f0'; 1.176 +ctx.fillRect(0, 0, 100, 50); 1.177 + 1.178 +ctx.beginPath(); 1.179 +ctx.rect(0, 0, 16, 16); 1.180 +ctx.clip(); 1.181 + 1.182 +ctx.clearRect(0, 0, 100, 50); 1.183 + 1.184 +ctx.fillStyle = '#0f0'; 1.185 +ctx.fillRect(0, 0, 16, 16); 1.186 + 1.187 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.188 + 1.189 + 1.190 +} 1.191 +</script> 1.192 + 1.193 +<!-- [[[ test_2d.clearRect.globalalpha.html ]]] --> 1.194 + 1.195 +<p>Canvas test: 2d.clearRect.globalalpha</p> 1.196 +<canvas id="c5" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.197 +<script> 1.198 + 1.199 + 1.200 +function test_2d_clearRect_globalalpha() { 1.201 + 1.202 +var canvas = document.getElementById('c5'); 1.203 +var ctx = canvas.getContext('2d'); 1.204 + 1.205 +ctx.fillStyle = '#f00'; 1.206 +ctx.fillRect(0, 0, 100, 50); 1.207 +ctx.globalAlpha = 0.1; 1.208 +ctx.clearRect(0, 0, 100, 50); 1.209 +isPixel(ctx, 50,25, 0,0,0,0, 0); 1.210 + 1.211 + 1.212 +} 1.213 +</script> 1.214 + 1.215 +<!-- [[[ test_2d.clearRect.globalcomposite.html ]]] --> 1.216 + 1.217 +<p>Canvas test: 2d.clearRect.globalcomposite</p> 1.218 +<canvas id="c6" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.219 +<script> 1.220 + 1.221 + 1.222 +function test_2d_clearRect_globalcomposite() { 1.223 + 1.224 +var canvas = document.getElementById('c6'); 1.225 +var ctx = canvas.getContext('2d'); 1.226 + 1.227 +ctx.fillStyle = '#f00'; 1.228 +ctx.fillRect(0, 0, 100, 50); 1.229 +ctx.globalCompositeOperation = 'destination-atop'; 1.230 +ctx.clearRect(0, 0, 100, 50); 1.231 +isPixel(ctx, 50,25, 0,0,0,0, 0); 1.232 + 1.233 + 1.234 +} 1.235 +</script> 1.236 + 1.237 +<!-- [[[ test_2d.clearRect.negative.html ]]] --> 1.238 + 1.239 +<p>Canvas test: 2d.clearRect.negative</p> 1.240 +<canvas id="c7" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.241 +<script> 1.242 + 1.243 + 1.244 +function test_2d_clearRect_negative() { 1.245 + 1.246 +var canvas = document.getElementById('c7'); 1.247 +var ctx = canvas.getContext('2d'); 1.248 + 1.249 +ctx.fillStyle = '#f00'; 1.250 +ctx.fillRect(0, 0, 100, 50); 1.251 +ctx.clearRect(0, 0, 50, 25); 1.252 +ctx.clearRect(100, 0, -50, 25); 1.253 +ctx.clearRect(0, 50, 50, -25); 1.254 +ctx.clearRect(100, 50, -50, -25); 1.255 +isPixel(ctx, 25,12, 0,0,0,0, 0); 1.256 +isPixel(ctx, 75,12, 0,0,0,0, 0); 1.257 +isPixel(ctx, 25,37, 0,0,0,0, 0); 1.258 +isPixel(ctx, 75,37, 0,0,0,0, 0); 1.259 + 1.260 + 1.261 +} 1.262 +</script> 1.263 + 1.264 +<!-- [[[ test_2d.clearRect.nonfinite.html ]]] --> 1.265 + 1.266 +<p>Canvas test: 2d.clearRect.nonfinite</p> 1.267 +<!-- Testing: clearRect() with Infinity/NaN is ignored --> 1.268 +<canvas id="c8" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.269 +<script> 1.270 + 1.271 + 1.272 +function test_2d_clearRect_nonfinite() { 1.273 + 1.274 +var canvas = document.getElementById('c8'); 1.275 +var ctx = canvas.getContext('2d'); 1.276 + 1.277 +var _thrown_outer = false; 1.278 +try { 1.279 + 1.280 +ctx.fillStyle = '#0f0'; 1.281 +ctx.fillRect(0, 0, 100, 50); 1.282 + 1.283 +ctx.clearRect(Infinity, 0, 100, 50); 1.284 +ctx.clearRect(-Infinity, 0, 100, 50); 1.285 +ctx.clearRect(NaN, 0, 100, 50); 1.286 +ctx.clearRect(0, Infinity, 100, 50); 1.287 +ctx.clearRect(0, -Infinity, 100, 50); 1.288 +ctx.clearRect(0, NaN, 100, 50); 1.289 +ctx.clearRect(0, 0, Infinity, 50); 1.290 +ctx.clearRect(0, 0, -Infinity, 50); 1.291 +ctx.clearRect(0, 0, NaN, 50); 1.292 +ctx.clearRect(0, 0, 100, Infinity); 1.293 +ctx.clearRect(0, 0, 100, -Infinity); 1.294 +ctx.clearRect(0, 0, 100, NaN); 1.295 +ctx.clearRect(Infinity, Infinity, 100, 50); 1.296 +ctx.clearRect(Infinity, Infinity, Infinity, 50); 1.297 +ctx.clearRect(Infinity, Infinity, Infinity, Infinity); 1.298 +ctx.clearRect(Infinity, Infinity, 100, Infinity); 1.299 +ctx.clearRect(Infinity, 0, Infinity, 50); 1.300 +ctx.clearRect(Infinity, 0, Infinity, Infinity); 1.301 +ctx.clearRect(Infinity, 0, 100, Infinity); 1.302 +ctx.clearRect(0, Infinity, Infinity, 50); 1.303 +ctx.clearRect(0, Infinity, Infinity, Infinity); 1.304 +ctx.clearRect(0, Infinity, 100, Infinity); 1.305 +ctx.clearRect(0, 0, Infinity, Infinity); 1.306 + 1.307 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.308 + 1.309 +} catch (e) { 1.310 + _thrown_outer = true; 1.311 +} 1.312 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.313 + 1.314 + 1.315 +} 1.316 +</script> 1.317 + 1.318 +<!-- [[[ test_2d.clearRect.path.html ]]] --> 1.319 + 1.320 +<p>Canvas test: 2d.clearRect.path</p> 1.321 +<canvas id="c9" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.322 +<script> 1.323 + 1.324 + 1.325 +function test_2d_clearRect_path() { 1.326 + 1.327 +var canvas = document.getElementById('c9'); 1.328 +var ctx = canvas.getContext('2d'); 1.329 + 1.330 +ctx.fillStyle = '#0f0'; 1.331 +ctx.beginPath(); 1.332 +ctx.rect(0, 0, 100, 50); 1.333 +ctx.clearRect(0, 0, 16, 16); 1.334 +ctx.fill(); 1.335 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.336 + 1.337 + 1.338 +} 1.339 +</script> 1.340 + 1.341 +<!-- [[[ test_2d.clearRect.shadow.html ]]] --> 1.342 + 1.343 +<p>Canvas test: 2d.clearRect.shadow</p> 1.344 +<canvas id="c10" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.345 +<script> 1.346 + 1.347 + 1.348 +function test_2d_clearRect_shadow() { 1.349 + 1.350 +var canvas = document.getElementById('c10'); 1.351 +var ctx = canvas.getContext('2d'); 1.352 + 1.353 +ctx.fillStyle = '#0f0'; 1.354 +ctx.fillRect(0, 0, 100, 50); 1.355 +ctx.shadowColor = '#f00'; 1.356 +ctx.shadowBlur = 0; 1.357 +ctx.shadowOffsetX = 0; 1.358 +ctx.shadowOffsetY = 50; 1.359 +ctx.clearRect(0, -50, 100, 50); 1.360 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.361 + 1.362 + 1.363 +} 1.364 +</script> 1.365 + 1.366 +<!-- [[[ test_2d.clearRect.transform.html ]]] --> 1.367 + 1.368 +<p>Canvas test: 2d.clearRect.transform</p> 1.369 +<canvas id="c11" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.370 +<script> 1.371 + 1.372 + 1.373 +function test_2d_clearRect_transform() { 1.374 + 1.375 +var canvas = document.getElementById('c11'); 1.376 +var ctx = canvas.getContext('2d'); 1.377 + 1.378 +ctx.fillStyle = '#f00'; 1.379 +ctx.fillRect(0, 0, 100, 50); 1.380 +ctx.scale(10, 10); 1.381 +ctx.translate(0, 5); 1.382 +ctx.clearRect(0, -5, 10, 5); 1.383 +isPixel(ctx, 50,25, 0,0,0,0, 0); 1.384 + 1.385 + 1.386 +} 1.387 +</script> 1.388 + 1.389 +<!-- [[[ test_2d.clearRect.zero.html ]]] --> 1.390 + 1.391 +<p>Canvas test: 2d.clearRect.zero</p> 1.392 +<canvas id="c12" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.393 +<script> 1.394 + 1.395 + 1.396 +function test_2d_clearRect_zero() { 1.397 + 1.398 +var canvas = document.getElementById('c12'); 1.399 +var ctx = canvas.getContext('2d'); 1.400 + 1.401 +ctx.fillStyle = '#0f0'; 1.402 +ctx.fillRect(0, 0, 100, 50); 1.403 +ctx.clearRect(0, 0, 100, 0); 1.404 +ctx.clearRect(0, 0, 0, 50); 1.405 +ctx.clearRect(0, 0, 0, 0); 1.406 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.407 + 1.408 + 1.409 +} 1.410 +</script> 1.411 + 1.412 +<!-- [[[ test_2d.composite.canvas.copy.html ]]] --> 1.413 + 1.414 +<p>Canvas test: 2d.composite.canvas.copy</p> 1.415 +<canvas id="c13" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.416 +<script> 1.417 + 1.418 + 1.419 +function test_2d_composite_canvas_copy() { 1.420 + 1.421 +var canvas = document.getElementById('c13'); 1.422 +var ctx = canvas.getContext('2d'); 1.423 + 1.424 + 1.425 +var canvas2 = document.createElement('canvas'); 1.426 +canvas2.width = canvas.width; 1.427 +canvas2.height = canvas.height; 1.428 +var ctx2 = canvas2.getContext('2d'); 1.429 +ctx2.drawImage(document.getElementById('yellow75_1.png'), 0, 0); 1.430 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.431 +ctx.fillRect(0, 0, 100, 50); 1.432 +ctx.globalCompositeOperation = 'copy'; 1.433 +ctx.drawImage(canvas2, 0, 0); 1.434 +isPixel(ctx, 50,25, 255,255,0,191, 5); 1.435 + 1.436 + 1.437 +} 1.438 +</script> 1.439 +<img src="image_yellow75.png" id="yellow75_1.png" class="resource"> 1.440 + 1.441 +<!-- [[[ test_2d.composite.canvas.destination-atop.html ]]] --> 1.442 + 1.443 +<p>Canvas test: 2d.composite.canvas.destination-atop</p> 1.444 +<canvas id="c14" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.445 +<script> 1.446 + 1.447 + 1.448 +function test_2d_composite_canvas_destination_atop() { 1.449 + 1.450 +var canvas = document.getElementById('c14'); 1.451 +var ctx = canvas.getContext('2d'); 1.452 + 1.453 + 1.454 +var canvas2 = document.createElement('canvas'); 1.455 +canvas2.width = canvas.width; 1.456 +canvas2.height = canvas.height; 1.457 +var ctx2 = canvas2.getContext('2d'); 1.458 +ctx2.drawImage(document.getElementById('yellow75_2.png'), 0, 0); 1.459 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.460 +ctx.fillRect(0, 0, 100, 50); 1.461 +ctx.globalCompositeOperation = 'destination-atop'; 1.462 +ctx.drawImage(canvas2, 0, 0); 1.463 +isPixel(ctx, 50,25, 127,255,127,191, 5); 1.464 + 1.465 + 1.466 +} 1.467 +</script> 1.468 +<img src="image_yellow75.png" id="yellow75_2.png" class="resource"> 1.469 + 1.470 +<!-- [[[ test_2d.composite.canvas.destination-in.html ]]] --> 1.471 + 1.472 +<p>Canvas test: 2d.composite.canvas.destination-in</p> 1.473 +<canvas id="c15" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.474 +<script> 1.475 + 1.476 + 1.477 +function test_2d_composite_canvas_destination_in() { 1.478 + 1.479 +var canvas = document.getElementById('c15'); 1.480 +var ctx = canvas.getContext('2d'); 1.481 + 1.482 + 1.483 +var canvas2 = document.createElement('canvas'); 1.484 +canvas2.width = canvas.width; 1.485 +canvas2.height = canvas.height; 1.486 +var ctx2 = canvas2.getContext('2d'); 1.487 +ctx2.drawImage(document.getElementById('yellow75_3.png'), 0, 0); 1.488 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.489 +ctx.fillRect(0, 0, 100, 50); 1.490 +ctx.globalCompositeOperation = 'destination-in'; 1.491 +ctx.drawImage(canvas2, 0, 0); 1.492 +isPixel(ctx, 50,25, 0,255,255,95, 5); 1.493 + 1.494 + 1.495 +} 1.496 +</script> 1.497 +<img src="image_yellow75.png" id="yellow75_3.png" class="resource"> 1.498 + 1.499 +<!-- [[[ test_2d.composite.canvas.destination-out.html ]]] --> 1.500 + 1.501 +<p>Canvas test: 2d.composite.canvas.destination-out</p> 1.502 +<canvas id="c16" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.503 +<script> 1.504 + 1.505 + 1.506 +function test_2d_composite_canvas_destination_out() { 1.507 + 1.508 +var canvas = document.getElementById('c16'); 1.509 +var ctx = canvas.getContext('2d'); 1.510 + 1.511 + 1.512 +var canvas2 = document.createElement('canvas'); 1.513 +canvas2.width = canvas.width; 1.514 +canvas2.height = canvas.height; 1.515 +var ctx2 = canvas2.getContext('2d'); 1.516 +ctx2.drawImage(document.getElementById('yellow75_4.png'), 0, 0); 1.517 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.518 +ctx.fillRect(0, 0, 100, 50); 1.519 +ctx.globalCompositeOperation = 'destination-out'; 1.520 +ctx.drawImage(canvas2, 0, 0); 1.521 +isPixel(ctx, 50,25, 0,255,255,31, 5); 1.522 + 1.523 + 1.524 +} 1.525 +</script> 1.526 +<img src="image_yellow75.png" id="yellow75_4.png" class="resource"> 1.527 + 1.528 +<!-- [[[ test_2d.composite.canvas.destination-over.html ]]] --> 1.529 + 1.530 +<p>Canvas test: 2d.composite.canvas.destination-over</p> 1.531 +<canvas id="c17" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.532 +<script> 1.533 + 1.534 + 1.535 +function test_2d_composite_canvas_destination_over() { 1.536 + 1.537 +var canvas = document.getElementById('c17'); 1.538 +var ctx = canvas.getContext('2d'); 1.539 + 1.540 + 1.541 +var canvas2 = document.createElement('canvas'); 1.542 +canvas2.width = canvas.width; 1.543 +canvas2.height = canvas.height; 1.544 +var ctx2 = canvas2.getContext('2d'); 1.545 +ctx2.drawImage(document.getElementById('yellow75_5.png'), 0, 0); 1.546 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.547 +ctx.fillRect(0, 0, 100, 50); 1.548 +ctx.globalCompositeOperation = 'destination-over'; 1.549 +ctx.drawImage(canvas2, 0, 0); 1.550 +isPixel(ctx, 50,25, 109,255,145,223, 5); 1.551 + 1.552 + 1.553 +} 1.554 +</script> 1.555 +<img src="image_yellow75.png" id="yellow75_5.png" class="resource"> 1.556 + 1.557 +<!-- [[[ test_2d.composite.canvas.lighter.html ]]] --> 1.558 + 1.559 +<p>Canvas test: 2d.composite.canvas.lighter</p> 1.560 +<canvas id="c18" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.561 +<script> 1.562 + 1.563 + 1.564 +function test_2d_composite_canvas_lighter() { 1.565 + 1.566 +var canvas = document.getElementById('c18'); 1.567 +var ctx = canvas.getContext('2d'); 1.568 + 1.569 + 1.570 +var canvas2 = document.createElement('canvas'); 1.571 +canvas2.width = canvas.width; 1.572 +canvas2.height = canvas.height; 1.573 +var ctx2 = canvas2.getContext('2d'); 1.574 +ctx2.drawImage(document.getElementById('yellow75_6.png'), 0, 0); 1.575 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.576 +ctx.fillRect(0, 0, 100, 50); 1.577 +ctx.globalCompositeOperation = 'lighter'; 1.578 +ctx.drawImage(canvas2, 0, 0); 1.579 +isPixel(ctx, 50,25, 191,255,127,255, 5); 1.580 + 1.581 + 1.582 +} 1.583 +</script> 1.584 +<img src="image_yellow75.png" id="yellow75_6.png" class="resource"> 1.585 + 1.586 +<!-- [[[ test_2d.composite.canvas.source-atop.html ]]] --> 1.587 + 1.588 +<p>Canvas test: 2d.composite.canvas.source-atop</p> 1.589 +<canvas id="c19" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.590 +<script> 1.591 + 1.592 + 1.593 +function test_2d_composite_canvas_source_atop() { 1.594 + 1.595 +var canvas = document.getElementById('c19'); 1.596 +var ctx = canvas.getContext('2d'); 1.597 + 1.598 + 1.599 +var canvas2 = document.createElement('canvas'); 1.600 +canvas2.width = canvas.width; 1.601 +canvas2.height = canvas.height; 1.602 +var ctx2 = canvas2.getContext('2d'); 1.603 +ctx2.drawImage(document.getElementById('yellow75_7.png'), 0, 0); 1.604 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.605 +ctx.fillRect(0, 0, 100, 50); 1.606 +ctx.globalCompositeOperation = 'source-atop'; 1.607 +ctx.drawImage(canvas2, 0, 0); 1.608 +isPixel(ctx, 50,25, 191,255,63,127, 5); 1.609 + 1.610 + 1.611 +} 1.612 +</script> 1.613 +<img src="image_yellow75.png" id="yellow75_7.png" class="resource"> 1.614 + 1.615 +<!-- [[[ test_2d.composite.canvas.source-in.html ]]] --> 1.616 + 1.617 +<p>Canvas test: 2d.composite.canvas.source-in</p> 1.618 +<canvas id="c20" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.619 +<script> 1.620 + 1.621 + 1.622 +function test_2d_composite_canvas_source_in() { 1.623 + 1.624 +var canvas = document.getElementById('c20'); 1.625 +var ctx = canvas.getContext('2d'); 1.626 + 1.627 + 1.628 +var canvas2 = document.createElement('canvas'); 1.629 +canvas2.width = canvas.width; 1.630 +canvas2.height = canvas.height; 1.631 +var ctx2 = canvas2.getContext('2d'); 1.632 +ctx2.drawImage(document.getElementById('yellow75_8.png'), 0, 0); 1.633 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.634 +ctx.fillRect(0, 0, 100, 50); 1.635 +ctx.globalCompositeOperation = 'source-in'; 1.636 +ctx.drawImage(canvas2, 0, 0); 1.637 +isPixel(ctx, 50,25, 255,255,0,95, 5); 1.638 + 1.639 + 1.640 +} 1.641 +</script> 1.642 +<img src="image_yellow75.png" id="yellow75_8.png" class="resource"> 1.643 + 1.644 +<!-- [[[ test_2d.composite.canvas.source-out.html ]]] --> 1.645 + 1.646 +<p>Canvas test: 2d.composite.canvas.source-out</p> 1.647 +<canvas id="c21" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.648 +<script> 1.649 + 1.650 + 1.651 +function test_2d_composite_canvas_source_out() { 1.652 + 1.653 +var canvas = document.getElementById('c21'); 1.654 +var ctx = canvas.getContext('2d'); 1.655 + 1.656 + 1.657 +var canvas2 = document.createElement('canvas'); 1.658 +canvas2.width = canvas.width; 1.659 +canvas2.height = canvas.height; 1.660 +var ctx2 = canvas2.getContext('2d'); 1.661 +ctx2.drawImage(document.getElementById('yellow75_9.png'), 0, 0); 1.662 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.663 +ctx.fillRect(0, 0, 100, 50); 1.664 +ctx.globalCompositeOperation = 'source-out'; 1.665 +ctx.drawImage(canvas2, 0, 0); 1.666 +isPixel(ctx, 50,25, 255,255,0,95, 5); 1.667 + 1.668 + 1.669 +} 1.670 +</script> 1.671 +<img src="image_yellow75.png" id="yellow75_9.png" class="resource"> 1.672 + 1.673 +<!-- [[[ test_2d.composite.canvas.source-over.html ]]] --> 1.674 + 1.675 +<p>Canvas test: 2d.composite.canvas.source-over</p> 1.676 +<canvas id="c22" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.677 +<script> 1.678 + 1.679 + 1.680 +function test_2d_composite_canvas_source_over() { 1.681 + 1.682 +var canvas = document.getElementById('c22'); 1.683 +var ctx = canvas.getContext('2d'); 1.684 + 1.685 + 1.686 +var canvas2 = document.createElement('canvas'); 1.687 +canvas2.width = canvas.width; 1.688 +canvas2.height = canvas.height; 1.689 +var ctx2 = canvas2.getContext('2d'); 1.690 +ctx2.drawImage(document.getElementById('yellow75_10.png'), 0, 0); 1.691 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.692 +ctx.fillRect(0, 0, 100, 50); 1.693 +ctx.globalCompositeOperation = 'source-over'; 1.694 +ctx.drawImage(canvas2, 0, 0); 1.695 +isPixel(ctx, 50,25, 218,255,36,223, 5); 1.696 + 1.697 + 1.698 +} 1.699 +</script> 1.700 +<img src="image_yellow75.png" id="yellow75_10.png" class="resource"> 1.701 + 1.702 +<!-- [[[ test_2d.composite.canvas.xor.html ]]] --> 1.703 + 1.704 +<p>Canvas test: 2d.composite.canvas.xor</p> 1.705 +<canvas id="c23" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.706 +<script> 1.707 + 1.708 + 1.709 +function test_2d_composite_canvas_xor() { 1.710 + 1.711 +var canvas = document.getElementById('c23'); 1.712 +var ctx = canvas.getContext('2d'); 1.713 + 1.714 + 1.715 +var canvas2 = document.createElement('canvas'); 1.716 +canvas2.width = canvas.width; 1.717 +canvas2.height = canvas.height; 1.718 +var ctx2 = canvas2.getContext('2d'); 1.719 +ctx2.drawImage(document.getElementById('yellow75_11.png'), 0, 0); 1.720 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.721 +ctx.fillRect(0, 0, 100, 50); 1.722 +ctx.globalCompositeOperation = 'xor'; 1.723 +ctx.drawImage(canvas2, 0, 0); 1.724 +isPixel(ctx, 50,25, 191,255,63,127, 5); 1.725 + 1.726 + 1.727 +} 1.728 +</script> 1.729 +<img src="image_yellow75.png" id="yellow75_11.png" class="resource"> 1.730 + 1.731 +<!-- [[[ test_2d.composite.clip.copy.html ]]] --> 1.732 + 1.733 +<p>Canvas test: 2d.composite.clip.copy</p> 1.734 +<!-- Testing: fill() does not affect pixels outside the clip region. --> 1.735 +<canvas id="c24" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.736 +<script> 1.737 + 1.738 + 1.739 +function test_2d_composite_clip_copy() { 1.740 + 1.741 +var canvas = document.getElementById('c24'); 1.742 +var ctx = canvas.getContext('2d'); 1.743 + 1.744 + 1.745 +ctx.fillStyle = '#0f0'; 1.746 +ctx.fillRect(0, 0, 100, 50); 1.747 +ctx.globalCompositeOperation = 'copy'; 1.748 +ctx.rect(-20, -20, 10, 10); 1.749 +ctx.clip(); 1.750 +ctx.fillStyle = '#f00'; 1.751 +ctx.fillRect(0, 0, 50, 50); 1.752 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.753 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.754 + 1.755 + 1.756 +} 1.757 +</script> 1.758 + 1.759 +<!-- [[[ test_2d.composite.clip.destination-atop.html ]]] --> 1.760 + 1.761 +<p>Canvas test: 2d.composite.clip.destination-atop</p> 1.762 +<!-- Testing: fill() does not affect pixels outside the clip region. --> 1.763 +<canvas id="c25" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.764 +<script> 1.765 + 1.766 + 1.767 +function test_2d_composite_clip_destination_atop() { 1.768 + 1.769 +var canvas = document.getElementById('c25'); 1.770 +var ctx = canvas.getContext('2d'); 1.771 + 1.772 + 1.773 +ctx.fillStyle = '#0f0'; 1.774 +ctx.fillRect(0, 0, 100, 50); 1.775 +ctx.globalCompositeOperation = 'destination-atop'; 1.776 +ctx.rect(-20, -20, 10, 10); 1.777 +ctx.clip(); 1.778 +ctx.fillStyle = '#f00'; 1.779 +ctx.fillRect(0, 0, 50, 50); 1.780 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.781 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.782 + 1.783 + 1.784 +} 1.785 +</script> 1.786 + 1.787 +<!-- [[[ test_2d.composite.clip.destination-in.html ]]] --> 1.788 + 1.789 +<p>Canvas test: 2d.composite.clip.destination-in</p> 1.790 +<!-- Testing: fill() does not affect pixels outside the clip region. --> 1.791 +<canvas id="c26" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.792 +<script> 1.793 + 1.794 + 1.795 +function test_2d_composite_clip_destination_in() { 1.796 + 1.797 +var canvas = document.getElementById('c26'); 1.798 +var ctx = canvas.getContext('2d'); 1.799 + 1.800 + 1.801 +ctx.fillStyle = '#0f0'; 1.802 +ctx.fillRect(0, 0, 100, 50); 1.803 +ctx.globalCompositeOperation = 'destination-in'; 1.804 +ctx.rect(-20, -20, 10, 10); 1.805 +ctx.clip(); 1.806 +ctx.fillStyle = '#f00'; 1.807 +ctx.fillRect(0, 0, 50, 50); 1.808 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.809 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.810 + 1.811 + 1.812 +} 1.813 +</script> 1.814 + 1.815 +<!-- [[[ test_2d.composite.clip.destination-out.html ]]] --> 1.816 + 1.817 +<p>Canvas test: 2d.composite.clip.destination-out</p> 1.818 +<!-- Testing: fill() does not affect pixels outside the clip region. --> 1.819 +<canvas id="c27" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.820 +<script> 1.821 + 1.822 + 1.823 +function test_2d_composite_clip_destination_out() { 1.824 + 1.825 +var canvas = document.getElementById('c27'); 1.826 +var ctx = canvas.getContext('2d'); 1.827 + 1.828 + 1.829 +ctx.fillStyle = '#0f0'; 1.830 +ctx.fillRect(0, 0, 100, 50); 1.831 +ctx.globalCompositeOperation = 'destination-out'; 1.832 +ctx.rect(-20, -20, 10, 10); 1.833 +ctx.clip(); 1.834 +ctx.fillStyle = '#f00'; 1.835 +ctx.fillRect(0, 0, 50, 50); 1.836 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.837 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.838 + 1.839 + 1.840 +} 1.841 +</script> 1.842 + 1.843 +<!-- [[[ test_2d.composite.clip.destination-over.html ]]] --> 1.844 + 1.845 +<p>Canvas test: 2d.composite.clip.destination-over</p> 1.846 +<!-- Testing: fill() does not affect pixels outside the clip region. --> 1.847 +<canvas id="c28" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.848 +<script> 1.849 + 1.850 + 1.851 +function test_2d_composite_clip_destination_over() { 1.852 + 1.853 +var canvas = document.getElementById('c28'); 1.854 +var ctx = canvas.getContext('2d'); 1.855 + 1.856 + 1.857 +ctx.fillStyle = '#0f0'; 1.858 +ctx.fillRect(0, 0, 100, 50); 1.859 +ctx.globalCompositeOperation = 'destination-over'; 1.860 +ctx.rect(-20, -20, 10, 10); 1.861 +ctx.clip(); 1.862 +ctx.fillStyle = '#f00'; 1.863 +ctx.fillRect(0, 0, 50, 50); 1.864 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.865 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.866 + 1.867 + 1.868 +} 1.869 +</script> 1.870 + 1.871 +<!-- [[[ test_2d.composite.clip.lighter.html ]]] --> 1.872 + 1.873 +<p>Canvas test: 2d.composite.clip.lighter</p> 1.874 +<!-- Testing: fill() does not affect pixels outside the clip region. --> 1.875 +<canvas id="c29" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.876 +<script> 1.877 + 1.878 + 1.879 +function test_2d_composite_clip_lighter() { 1.880 + 1.881 +var canvas = document.getElementById('c29'); 1.882 +var ctx = canvas.getContext('2d'); 1.883 + 1.884 + 1.885 +ctx.fillStyle = '#0f0'; 1.886 +ctx.fillRect(0, 0, 100, 50); 1.887 +ctx.globalCompositeOperation = 'lighter'; 1.888 +ctx.rect(-20, -20, 10, 10); 1.889 +ctx.clip(); 1.890 +ctx.fillStyle = '#f00'; 1.891 +ctx.fillRect(0, 0, 50, 50); 1.892 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.893 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.894 + 1.895 + 1.896 +} 1.897 +</script> 1.898 + 1.899 +<!-- [[[ test_2d.composite.clip.source-atop.html ]]] --> 1.900 + 1.901 +<p>Canvas test: 2d.composite.clip.source-atop</p> 1.902 +<!-- Testing: fill() does not affect pixels outside the clip region. --> 1.903 +<canvas id="c30" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.904 +<script> 1.905 + 1.906 + 1.907 +function test_2d_composite_clip_source_atop() { 1.908 + 1.909 +var canvas = document.getElementById('c30'); 1.910 +var ctx = canvas.getContext('2d'); 1.911 + 1.912 + 1.913 +ctx.fillStyle = '#0f0'; 1.914 +ctx.fillRect(0, 0, 100, 50); 1.915 +ctx.globalCompositeOperation = 'source-atop'; 1.916 +ctx.rect(-20, -20, 10, 10); 1.917 +ctx.clip(); 1.918 +ctx.fillStyle = '#f00'; 1.919 +ctx.fillRect(0, 0, 50, 50); 1.920 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.921 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.922 + 1.923 + 1.924 +} 1.925 +</script> 1.926 + 1.927 +<!-- [[[ test_2d.composite.clip.source-in.html ]]] --> 1.928 + 1.929 +<p>Canvas test: 2d.composite.clip.source-in</p> 1.930 +<!-- Testing: fill() does not affect pixels outside the clip region. --> 1.931 +<canvas id="c31" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.932 +<script> 1.933 + 1.934 + 1.935 +function test_2d_composite_clip_source_in() { 1.936 + 1.937 +var canvas = document.getElementById('c31'); 1.938 +var ctx = canvas.getContext('2d'); 1.939 + 1.940 + 1.941 +ctx.fillStyle = '#0f0'; 1.942 +ctx.fillRect(0, 0, 100, 50); 1.943 +ctx.globalCompositeOperation = 'source-in'; 1.944 +ctx.rect(-20, -20, 10, 10); 1.945 +ctx.clip(); 1.946 +ctx.fillStyle = '#f00'; 1.947 +ctx.fillRect(0, 0, 50, 50); 1.948 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.949 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.950 + 1.951 + 1.952 +} 1.953 +</script> 1.954 + 1.955 +<!-- [[[ test_2d.composite.clip.source-out.html ]]] --> 1.956 + 1.957 +<p>Canvas test: 2d.composite.clip.source-out</p> 1.958 +<!-- Testing: fill() does not affect pixels outside the clip region. --> 1.959 +<canvas id="c32" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.960 +<script> 1.961 + 1.962 + 1.963 +function test_2d_composite_clip_source_out() { 1.964 + 1.965 +var canvas = document.getElementById('c32'); 1.966 +var ctx = canvas.getContext('2d'); 1.967 + 1.968 + 1.969 +ctx.fillStyle = '#0f0'; 1.970 +ctx.fillRect(0, 0, 100, 50); 1.971 +ctx.globalCompositeOperation = 'source-out'; 1.972 +ctx.rect(-20, -20, 10, 10); 1.973 +ctx.clip(); 1.974 +ctx.fillStyle = '#f00'; 1.975 +ctx.fillRect(0, 0, 50, 50); 1.976 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.977 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.978 + 1.979 + 1.980 +} 1.981 +</script> 1.982 + 1.983 +<!-- [[[ test_2d.composite.clip.source-over.html ]]] --> 1.984 + 1.985 +<p>Canvas test: 2d.composite.clip.source-over</p> 1.986 +<!-- Testing: fill() does not affect pixels outside the clip region. --> 1.987 +<canvas id="c33" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.988 +<script> 1.989 + 1.990 + 1.991 +function test_2d_composite_clip_source_over() { 1.992 + 1.993 +var canvas = document.getElementById('c33'); 1.994 +var ctx = canvas.getContext('2d'); 1.995 + 1.996 + 1.997 +ctx.fillStyle = '#0f0'; 1.998 +ctx.fillRect(0, 0, 100, 50); 1.999 +ctx.globalCompositeOperation = 'source-over'; 1.1000 +ctx.rect(-20, -20, 10, 10); 1.1001 +ctx.clip(); 1.1002 +ctx.fillStyle = '#f00'; 1.1003 +ctx.fillRect(0, 0, 50, 50); 1.1004 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.1005 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.1006 + 1.1007 + 1.1008 +} 1.1009 +</script> 1.1010 + 1.1011 +<!-- [[[ test_2d.composite.clip.xor.html ]]] --> 1.1012 + 1.1013 +<p>Canvas test: 2d.composite.clip.xor</p> 1.1014 +<!-- Testing: fill() does not affect pixels outside the clip region. --> 1.1015 +<canvas id="c34" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1016 +<script> 1.1017 + 1.1018 + 1.1019 +function test_2d_composite_clip_xor() { 1.1020 + 1.1021 +var canvas = document.getElementById('c34'); 1.1022 +var ctx = canvas.getContext('2d'); 1.1023 + 1.1024 + 1.1025 +ctx.fillStyle = '#0f0'; 1.1026 +ctx.fillRect(0, 0, 100, 50); 1.1027 +ctx.globalCompositeOperation = 'xor'; 1.1028 +ctx.rect(-20, -20, 10, 10); 1.1029 +ctx.clip(); 1.1030 +ctx.fillStyle = '#f00'; 1.1031 +ctx.fillRect(0, 0, 50, 50); 1.1032 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.1033 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.1034 + 1.1035 + 1.1036 +} 1.1037 +</script> 1.1038 + 1.1039 +<!-- [[[ test_2d.composite.globalAlpha.canvas.html ]]] --> 1.1040 + 1.1041 +<p>Canvas test: 2d.composite.globalAlpha.canvas</p> 1.1042 +<canvas id="c35" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1043 +<script> 1.1044 + 1.1045 + 1.1046 +function test_2d_composite_globalAlpha_canvas() { 1.1047 + 1.1048 +var canvas = document.getElementById('c35'); 1.1049 +var ctx = canvas.getContext('2d'); 1.1050 + 1.1051 +var canvas2 = document.createElement('canvas'); 1.1052 +canvas2.width = 100; 1.1053 +canvas2.height = 50; 1.1054 +var ctx2 = canvas2.getContext('2d'); 1.1055 +ctx2.fillStyle = '#f00'; 1.1056 +ctx2.fillRect(0, 0, 100, 50); 1.1057 + 1.1058 +ctx.fillStyle = '#0f0'; 1.1059 +ctx.fillRect(0, 0, 100, 50); 1.1060 +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations 1.1061 +ctx.drawImage(canvas2, 0, 0); 1.1062 +isPixel(ctx, 50,25, 2,253,0,255, 2); 1.1063 + 1.1064 + 1.1065 +} 1.1066 +</script> 1.1067 + 1.1068 +<!-- [[[ test_2d.composite.globalAlpha.canvaspattern.html ]]] --> 1.1069 + 1.1070 +<p>Canvas test: 2d.composite.globalAlpha.canvaspattern - bug 401790</p> 1.1071 +<canvas id="c36" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1072 +<script> 1.1073 + 1.1074 +function todo_isPixel(ctx, x,y, r,g,b,a, d) { 1.1075 + var pos = x + "," + y; 1.1076 + var colour = r + "," + g + "," + b + "," + a; 1.1077 + var pixel = ctx.getImageData(x, y, 1, 1); 1.1078 + var pr = pixel.data[0], 1.1079 + pg = pixel.data[1], 1.1080 + pb = pixel.data[2], 1.1081 + pa = pixel.data[3]; 1.1082 + todo(r-d <= pr && pr <= r+d && 1.1083 + g-d <= pg && pg <= g+d && 1.1084 + b-d <= pb && pb <= b+d && 1.1085 + a-d <= pa && pa <= a+d, 1.1086 + "pixel "+pos+" of "+ctx.canvas.id+" is "+pr+","+pg+","+pb+","+pa+" (marked todo); expected "+colour+" +/- " + d); 1.1087 +} 1.1088 + 1.1089 +function test_2d_composite_globalAlpha_canvaspattern() { 1.1090 + 1.1091 +var canvas = document.getElementById('c36'); 1.1092 +var ctx = canvas.getContext('2d'); 1.1093 + 1.1094 +var canvas2 = document.createElement('canvas'); 1.1095 +canvas2.width = 100; 1.1096 +canvas2.height = 50; 1.1097 +var ctx2 = canvas2.getContext('2d'); 1.1098 +ctx2.fillStyle = '#f00'; 1.1099 +ctx2.fillRect(0, 0, 100, 50); 1.1100 + 1.1101 +ctx.fillStyle = '#0f0'; 1.1102 +ctx.fillRect(0, 0, 100, 50); 1.1103 +ctx.fillStyle = ctx.createPattern(canvas2, 'no-repeat'); 1.1104 +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations 1.1105 +ctx.fillRect(0, 0, 100, 50); 1.1106 +isPixel(ctx, 50,25, 2,253,0,255, 2); 1.1107 + 1.1108 + 1.1109 +} 1.1110 +</script> 1.1111 + 1.1112 +<!-- [[[ test_2d.composite.globalAlpha.default.html ]]] --> 1.1113 + 1.1114 +<p>Canvas test: 2d.composite.globalAlpha.default</p> 1.1115 +<canvas id="c37" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1116 +<script> 1.1117 + 1.1118 +function test_2d_composite_globalAlpha_default() { 1.1119 + 1.1120 +var canvas = document.getElementById('c37'); 1.1121 +var ctx = canvas.getContext('2d'); 1.1122 + 1.1123 +ok(ctx.globalAlpha === 1.0, "ctx.globalAlpha === 1.0"); 1.1124 + 1.1125 + 1.1126 +} 1.1127 +</script> 1.1128 + 1.1129 +<!-- [[[ test_2d.composite.globalAlpha.fill.html ]]] --> 1.1130 + 1.1131 +<p>Canvas test: 2d.composite.globalAlpha.fill</p> 1.1132 +<canvas id="c38" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1133 +<script> 1.1134 + 1.1135 + 1.1136 +function test_2d_composite_globalAlpha_fill() { 1.1137 + 1.1138 +var canvas = document.getElementById('c38'); 1.1139 +var ctx = canvas.getContext('2d'); 1.1140 + 1.1141 +ctx.fillStyle = '#0f0'; 1.1142 +ctx.fillRect(0, 0, 100, 50); 1.1143 +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations 1.1144 +ctx.fillStyle = '#f00'; 1.1145 +ctx.fillRect(0, 0, 100, 50); 1.1146 +isPixel(ctx, 50,25, 2,253,0,255, 2); 1.1147 + 1.1148 + 1.1149 +} 1.1150 +</script> 1.1151 + 1.1152 +<!-- [[[ test_2d.composite.globalAlpha.image.html ]]] --> 1.1153 + 1.1154 +<p>Canvas test: 2d.composite.globalAlpha.image</p> 1.1155 +<canvas id="c39" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1156 +<script> 1.1157 + 1.1158 + 1.1159 +function test_2d_composite_globalAlpha_image() { 1.1160 + 1.1161 +var canvas = document.getElementById('c39'); 1.1162 +var ctx = canvas.getContext('2d'); 1.1163 + 1.1164 +ctx.fillStyle = '#0f0'; 1.1165 +ctx.fillRect(0, 0, 100, 50); 1.1166 +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations 1.1167 +ctx.drawImage(document.getElementById('red_1.png'), 0, 0); 1.1168 +isPixel(ctx, 50,25, 2,253,0,255, 2); 1.1169 + 1.1170 + 1.1171 +} 1.1172 +</script> 1.1173 +<img src="image_red.png" id="red_1.png" class="resource"> 1.1174 + 1.1175 +<!-- [[[ test_2d.composite.globalAlpha.imagepattern.html ]]] --> 1.1176 + 1.1177 +<p>Canvas test: 2d.composite.globalAlpha.imagepattern - bug 401790</p> 1.1178 +<canvas id="c40" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1179 +<script> 1.1180 + 1.1181 + 1.1182 + 1.1183 +function test_2d_composite_globalAlpha_imagepattern() { 1.1184 + 1.1185 +var canvas = document.getElementById('c40'); 1.1186 +var ctx = canvas.getContext('2d'); 1.1187 + 1.1188 +ctx.fillStyle = '#0f0'; 1.1189 +ctx.fillRect(0, 0, 100, 50); 1.1190 +ctx.fillStyle = ctx.createPattern(document.getElementById('red_2.png'), 'no-repeat'); 1.1191 +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations 1.1192 +ctx.fillRect(0, 0, 100, 50); 1.1193 +isPixel(ctx, 50,25, 2,253,0,255, 2); 1.1194 + 1.1195 + 1.1196 +} 1.1197 +</script> 1.1198 +<img src="image_red.png" id="red_2.png" class="resource"> 1.1199 + 1.1200 +<!-- [[[ test_2d.composite.globalAlpha.invalid.html ]]] --> 1.1201 + 1.1202 +<p>Canvas test: 2d.composite.globalAlpha.invalid</p> 1.1203 +<canvas id="c41" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1204 +<script> 1.1205 + 1.1206 +function test_2d_composite_globalAlpha_invalid() { 1.1207 + 1.1208 +var canvas = document.getElementById('c41'); 1.1209 +var ctx = canvas.getContext('2d'); 1.1210 + 1.1211 +ctx.globalAlpha = 0.5; 1.1212 +var a = ctx.globalAlpha; // might not be exactly 0.5, if it is rounded/quantised, so remember for future comparisons 1.1213 +ctx.globalAlpha = Infinity; 1.1214 +ok(ctx.globalAlpha === a, "ctx.globalAlpha === a"); 1.1215 +ctx.globalAlpha = -Infinity; 1.1216 +ok(ctx.globalAlpha === a, "ctx.globalAlpha === a"); 1.1217 +ctx.globalAlpha = NaN; 1.1218 +ok(ctx.globalAlpha === a, "ctx.globalAlpha === a"); 1.1219 + 1.1220 +} 1.1221 +</script> 1.1222 + 1.1223 +<!-- [[[ test_2d.composite.globalAlpha.range.html ]]] --> 1.1224 + 1.1225 +<p>Canvas test: 2d.composite.globalAlpha.range</p> 1.1226 +<canvas id="c42" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1227 +<script> 1.1228 + 1.1229 +function test_2d_composite_globalAlpha_range() { 1.1230 + 1.1231 +var canvas = document.getElementById('c42'); 1.1232 +var ctx = canvas.getContext('2d'); 1.1233 + 1.1234 +ctx.globalAlpha = 0.5; 1.1235 +var a = ctx.globalAlpha; // might not be exactly 0.5, if it is rounded/quantised, so remember for future comparisons 1.1236 +ctx.globalAlpha = 1.1; 1.1237 +ok(ctx.globalAlpha == a, "ctx.globalAlpha == a"); 1.1238 +ctx.globalAlpha = -0.1; 1.1239 +ok(ctx.globalAlpha == a, "ctx.globalAlpha == a"); 1.1240 +ctx.globalAlpha = 0; 1.1241 +ok(ctx.globalAlpha == 0, "ctx.globalAlpha == 0"); 1.1242 +ctx.globalAlpha = 1; 1.1243 +ok(ctx.globalAlpha == 1, "ctx.globalAlpha == 1"); 1.1244 + 1.1245 + 1.1246 +} 1.1247 +</script> 1.1248 + 1.1249 +<!-- [[[ test_2d.composite.image.copy.html ]]] --> 1.1250 + 1.1251 +<p>Canvas test: 2d.composite.image.copy</p> 1.1252 +<canvas id="c43" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1253 +<script> 1.1254 + 1.1255 + 1.1256 +function test_2d_composite_image_copy() { 1.1257 + 1.1258 +var canvas = document.getElementById('c43'); 1.1259 +var ctx = canvas.getContext('2d'); 1.1260 + 1.1261 + 1.1262 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.1263 +ctx.fillRect(0, 0, 100, 50); 1.1264 +ctx.globalCompositeOperation = 'copy'; 1.1265 +ctx.drawImage(document.getElementById('yellow75_12.png'), 0, 0); 1.1266 +isPixel(ctx, 50,25, 255,255,0,191, 5); 1.1267 + 1.1268 + 1.1269 +} 1.1270 +</script> 1.1271 +<img src="image_yellow75.png" id="yellow75_12.png" class="resource"> 1.1272 + 1.1273 +<!-- [[[ test_2d.composite.image.destination-atop.html ]]] --> 1.1274 + 1.1275 +<p>Canvas test: 2d.composite.image.destination-atop</p> 1.1276 +<canvas id="c44" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1277 +<script> 1.1278 + 1.1279 + 1.1280 +function test_2d_composite_image_destination_atop() { 1.1281 + 1.1282 +var canvas = document.getElementById('c44'); 1.1283 +var ctx = canvas.getContext('2d'); 1.1284 + 1.1285 + 1.1286 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.1287 +ctx.fillRect(0, 0, 100, 50); 1.1288 +ctx.globalCompositeOperation = 'destination-atop'; 1.1289 +ctx.drawImage(document.getElementById('yellow75_13.png'), 0, 0); 1.1290 +isPixel(ctx, 50,25, 127,255,127,191, 5); 1.1291 + 1.1292 + 1.1293 +} 1.1294 +</script> 1.1295 +<img src="image_yellow75.png" id="yellow75_13.png" class="resource"> 1.1296 + 1.1297 +<!-- [[[ test_2d.composite.image.destination-in.html ]]] --> 1.1298 + 1.1299 +<p>Canvas test: 2d.composite.image.destination-in</p> 1.1300 +<canvas id="c45" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1301 +<script> 1.1302 + 1.1303 + 1.1304 +function test_2d_composite_image_destination_in() { 1.1305 + 1.1306 +var canvas = document.getElementById('c45'); 1.1307 +var ctx = canvas.getContext('2d'); 1.1308 + 1.1309 + 1.1310 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.1311 +ctx.fillRect(0, 0, 100, 50); 1.1312 +ctx.globalCompositeOperation = 'destination-in'; 1.1313 +ctx.drawImage(document.getElementById('yellow75_14.png'), 0, 0); 1.1314 +isPixel(ctx, 50,25, 0,255,255,95, 5); 1.1315 + 1.1316 + 1.1317 +} 1.1318 +</script> 1.1319 +<img src="image_yellow75.png" id="yellow75_14.png" class="resource"> 1.1320 + 1.1321 +<!-- [[[ test_2d.composite.image.destination-out.html ]]] --> 1.1322 + 1.1323 +<p>Canvas test: 2d.composite.image.destination-out</p> 1.1324 +<canvas id="c46" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1325 +<script> 1.1326 + 1.1327 + 1.1328 +function test_2d_composite_image_destination_out() { 1.1329 + 1.1330 +var canvas = document.getElementById('c46'); 1.1331 +var ctx = canvas.getContext('2d'); 1.1332 + 1.1333 + 1.1334 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.1335 +ctx.fillRect(0, 0, 100, 50); 1.1336 +ctx.globalCompositeOperation = 'destination-out'; 1.1337 +ctx.drawImage(document.getElementById('yellow75_15.png'), 0, 0); 1.1338 +isPixel(ctx, 50,25, 0,255,255,31, 5); 1.1339 + 1.1340 + 1.1341 +} 1.1342 +</script> 1.1343 +<img src="image_yellow75.png" id="yellow75_15.png" class="resource"> 1.1344 + 1.1345 +<!-- [[[ test_2d.composite.image.destination-over.html ]]] --> 1.1346 + 1.1347 +<p>Canvas test: 2d.composite.image.destination-over</p> 1.1348 +<canvas id="c47" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1349 +<script> 1.1350 + 1.1351 + 1.1352 +function test_2d_composite_image_destination_over() { 1.1353 + 1.1354 +var canvas = document.getElementById('c47'); 1.1355 +var ctx = canvas.getContext('2d'); 1.1356 + 1.1357 + 1.1358 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.1359 +ctx.fillRect(0, 0, 100, 50); 1.1360 +ctx.globalCompositeOperation = 'destination-over'; 1.1361 +ctx.drawImage(document.getElementById('yellow75_16.png'), 0, 0); 1.1362 +isPixel(ctx, 50,25, 109,255,145,223, 5); 1.1363 + 1.1364 + 1.1365 +} 1.1366 +</script> 1.1367 +<img src="image_yellow75.png" id="yellow75_16.png" class="resource"> 1.1368 + 1.1369 +<!-- [[[ test_2d.composite.image.lighter.html ]]] --> 1.1370 + 1.1371 +<p>Canvas test: 2d.composite.image.lighter</p> 1.1372 +<canvas id="c48" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1373 +<script> 1.1374 + 1.1375 + 1.1376 +function test_2d_composite_image_lighter() { 1.1377 + 1.1378 +var canvas = document.getElementById('c48'); 1.1379 +var ctx = canvas.getContext('2d'); 1.1380 + 1.1381 + 1.1382 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.1383 +ctx.fillRect(0, 0, 100, 50); 1.1384 +ctx.globalCompositeOperation = 'lighter'; 1.1385 +ctx.drawImage(document.getElementById('yellow75_17.png'), 0, 0); 1.1386 +isPixel(ctx, 50,25, 191,255,127,255, 5); 1.1387 + 1.1388 + 1.1389 +} 1.1390 +</script> 1.1391 +<img src="image_yellow75.png" id="yellow75_17.png" class="resource"> 1.1392 + 1.1393 +<!-- [[[ test_2d.composite.image.source-atop.html ]]] --> 1.1394 + 1.1395 +<p>Canvas test: 2d.composite.image.source-atop</p> 1.1396 +<canvas id="c49" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1397 +<script> 1.1398 + 1.1399 + 1.1400 +function test_2d_composite_image_source_atop() { 1.1401 + 1.1402 +var canvas = document.getElementById('c49'); 1.1403 +var ctx = canvas.getContext('2d'); 1.1404 + 1.1405 + 1.1406 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.1407 +ctx.fillRect(0, 0, 100, 50); 1.1408 +ctx.globalCompositeOperation = 'source-atop'; 1.1409 +ctx.drawImage(document.getElementById('yellow75_18.png'), 0, 0); 1.1410 +isPixel(ctx, 50,25, 191,255,63,127, 5); 1.1411 + 1.1412 + 1.1413 +} 1.1414 +</script> 1.1415 +<img src="image_yellow75.png" id="yellow75_18.png" class="resource"> 1.1416 + 1.1417 +<!-- [[[ test_2d.composite.image.source-in.html ]]] --> 1.1418 + 1.1419 +<p>Canvas test: 2d.composite.image.source-in</p> 1.1420 +<canvas id="c50" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1421 +<script> 1.1422 + 1.1423 + 1.1424 +function test_2d_composite_image_source_in() { 1.1425 + 1.1426 +var canvas = document.getElementById('c50'); 1.1427 +var ctx = canvas.getContext('2d'); 1.1428 + 1.1429 + 1.1430 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.1431 +ctx.fillRect(0, 0, 100, 50); 1.1432 +ctx.globalCompositeOperation = 'source-in'; 1.1433 +ctx.drawImage(document.getElementById('yellow75_19.png'), 0, 0); 1.1434 +isPixel(ctx, 50,25, 255,255,0,95, 5); 1.1435 + 1.1436 + 1.1437 +} 1.1438 +</script> 1.1439 +<img src="image_yellow75.png" id="yellow75_19.png" class="resource"> 1.1440 + 1.1441 +<!-- [[[ test_2d.composite.image.source-out.html ]]] --> 1.1442 + 1.1443 +<p>Canvas test: 2d.composite.image.source-out</p> 1.1444 +<canvas id="c51" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1445 +<script> 1.1446 + 1.1447 + 1.1448 +function test_2d_composite_image_source_out() { 1.1449 + 1.1450 +var canvas = document.getElementById('c51'); 1.1451 +var ctx = canvas.getContext('2d'); 1.1452 + 1.1453 + 1.1454 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.1455 +ctx.fillRect(0, 0, 100, 50); 1.1456 +ctx.globalCompositeOperation = 'source-out'; 1.1457 +ctx.drawImage(document.getElementById('yellow75_20.png'), 0, 0); 1.1458 +isPixel(ctx, 50,25, 255,255,0,95, 5); 1.1459 + 1.1460 + 1.1461 +} 1.1462 +</script> 1.1463 +<img src="image_yellow75.png" id="yellow75_20.png" class="resource"> 1.1464 + 1.1465 +<!-- [[[ test_2d.composite.image.source-over.html ]]] --> 1.1466 + 1.1467 +<p>Canvas test: 2d.composite.image.source-over</p> 1.1468 +<canvas id="c52" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1469 +<script> 1.1470 + 1.1471 + 1.1472 +function test_2d_composite_image_source_over() { 1.1473 + 1.1474 +var canvas = document.getElementById('c52'); 1.1475 +var ctx = canvas.getContext('2d'); 1.1476 + 1.1477 + 1.1478 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.1479 +ctx.fillRect(0, 0, 100, 50); 1.1480 +ctx.globalCompositeOperation = 'source-over'; 1.1481 +ctx.drawImage(document.getElementById('yellow75_21.png'), 0, 0); 1.1482 +isPixel(ctx, 50,25, 218,255,36,223, 5); 1.1483 + 1.1484 + 1.1485 +} 1.1486 +</script> 1.1487 +<img src="image_yellow75.png" id="yellow75_21.png" class="resource"> 1.1488 + 1.1489 +<!-- [[[ test_2d.composite.image.xor.html ]]] --> 1.1490 + 1.1491 +<p>Canvas test: 2d.composite.image.xor</p> 1.1492 +<canvas id="c53" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1493 +<script> 1.1494 + 1.1495 + 1.1496 +function test_2d_composite_image_xor() { 1.1497 + 1.1498 +var canvas = document.getElementById('c53'); 1.1499 +var ctx = canvas.getContext('2d'); 1.1500 + 1.1501 + 1.1502 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.1503 +ctx.fillRect(0, 0, 100, 50); 1.1504 +ctx.globalCompositeOperation = 'xor'; 1.1505 +ctx.drawImage(document.getElementById('yellow75_22.png'), 0, 0); 1.1506 +isPixel(ctx, 50,25, 191,255,63,127, 5); 1.1507 + 1.1508 + 1.1509 +} 1.1510 +</script> 1.1511 +<img src="image_yellow75.png" id="yellow75_22.png" class="resource"> 1.1512 + 1.1513 +<!-- [[[ test_2d.composite.operation.casesensitive.html ]]] --> 1.1514 + 1.1515 +<p>Canvas test: 2d.composite.operation.casesensitive - bug 401788</p> 1.1516 +<canvas id="c54" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1517 +<script> 1.1518 + 1.1519 +function test_2d_composite_operation_casesensitive() { 1.1520 + 1.1521 +var canvas = document.getElementById('c54'); 1.1522 +var ctx = canvas.getContext('2d'); 1.1523 + 1.1524 +var _thrown_outer = false; 1.1525 +try { 1.1526 + 1.1527 +ctx.globalCompositeOperation = 'xor'; 1.1528 +ctx.globalCompositeOperation = 'Source-over'; 1.1529 +ok(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'"); 1.1530 + 1.1531 +} catch (e) { 1.1532 + _thrown_outer = true; 1.1533 +} 1.1534 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.1535 + 1.1536 + 1.1537 +} 1.1538 +</script> 1.1539 + 1.1540 +<!-- [[[ test_2d.composite.operation.clear.html ]]] --> 1.1541 + 1.1542 +<p>Canvas test: 2d.composite.operation.clear</p> 1.1543 +<canvas id="c55" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1544 +<script> 1.1545 + 1.1546 +function test_2d_composite_operation_clear() { 1.1547 + 1.1548 +var canvas = document.getElementById('c55'); 1.1549 +var ctx = canvas.getContext('2d'); 1.1550 + 1.1551 +ctx.globalCompositeOperation = 'xor'; 1.1552 +ctx.globalCompositeOperation = 'clear'; 1.1553 +ok(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'"); 1.1554 + 1.1555 + 1.1556 +} 1.1557 +</script> 1.1558 + 1.1559 +<!-- [[[ test_2d.composite.operation.darker.html ]]] --> 1.1560 + 1.1561 +<p>Canvas test: 2d.composite.operation.darker</p> 1.1562 +<canvas id="c56" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1563 +<script> 1.1564 + 1.1565 +function test_2d_composite_operation_darker() { 1.1566 + 1.1567 +var canvas = document.getElementById('c56'); 1.1568 +var ctx = canvas.getContext('2d'); 1.1569 + 1.1570 +ctx.globalCompositeOperation = 'xor'; 1.1571 +ctx.globalCompositeOperation = 'darker'; 1.1572 +ok(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'"); 1.1573 + 1.1574 + 1.1575 +} 1.1576 +</script> 1.1577 + 1.1578 +<!-- [[[ test_2d.composite.operation.default.html ]]] --> 1.1579 + 1.1580 +<p>Canvas test: 2d.composite.operation.default</p> 1.1581 +<canvas id="c57" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1582 +<script> 1.1583 + 1.1584 +function test_2d_composite_operation_default() { 1.1585 + 1.1586 +var canvas = document.getElementById('c57'); 1.1587 +var ctx = canvas.getContext('2d'); 1.1588 + 1.1589 +ok(ctx.globalCompositeOperation == 'source-over', "ctx.globalCompositeOperation == 'source-over'"); 1.1590 + 1.1591 + 1.1592 +} 1.1593 +</script> 1.1594 + 1.1595 +<!-- [[[ test_2d.composite.operation.get.html ]]] --> 1.1596 + 1.1597 +<p>Canvas test: 2d.composite.operation.get</p> 1.1598 +<canvas id="c58" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1599 +<script> 1.1600 + 1.1601 +function test_2d_composite_operation_get() { 1.1602 + 1.1603 +var canvas = document.getElementById('c58'); 1.1604 +var ctx = canvas.getContext('2d'); 1.1605 + 1.1606 +var modes = ['source-atop', 'source-in', 'source-out', 'source-over', 1.1607 + 'destination-atop', 'destination-in', 'destination-out', 'destination-over', 1.1608 + 'lighter', 'copy', 'xor']; 1.1609 +for (var i = 0; i < modes.length; ++i) 1.1610 +{ 1.1611 + ctx.globalCompositeOperation = modes[i]; 1.1612 + ok(ctx.globalCompositeOperation == modes[i], "ctx.globalCompositeOperation == modes[\""+(i)+"\"]"); 1.1613 +} 1.1614 + 1.1615 + 1.1616 +} 1.1617 +</script> 1.1618 + 1.1619 +<!-- [[[ test_2d.composite.operation.highlight.html ]]] --> 1.1620 + 1.1621 +<p>Canvas test: 2d.composite.operation.highlight - bug 401788</p> 1.1622 +<canvas id="c59" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1623 +<script> 1.1624 + 1.1625 +function test_2d_composite_operation_highlight() { 1.1626 + 1.1627 +var canvas = document.getElementById('c59'); 1.1628 +var ctx = canvas.getContext('2d'); 1.1629 + 1.1630 +var _thrown_outer = false; 1.1631 +try { 1.1632 + 1.1633 +ctx.globalCompositeOperation = 'xor'; 1.1634 +ctx.globalCompositeOperation = 'highlight'; 1.1635 +ok(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'"); 1.1636 + 1.1637 +} catch (e) { 1.1638 + _thrown_outer = true; 1.1639 +} 1.1640 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.1641 + 1.1642 + 1.1643 +} 1.1644 +</script> 1.1645 + 1.1646 +<!-- [[[ test_2d.composite.operation.nullsuffix.html ]]] --> 1.1647 + 1.1648 +<p>Canvas test: 2d.composite.operation.nullsuffix - bug 401788</p> 1.1649 +<canvas id="c60" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1650 +<script> 1.1651 + 1.1652 +function test_2d_composite_operation_nullsuffix() { 1.1653 + 1.1654 +var canvas = document.getElementById('c60'); 1.1655 +var ctx = canvas.getContext('2d'); 1.1656 + 1.1657 +var _thrown_outer = false; 1.1658 +try { 1.1659 + 1.1660 +ctx.globalCompositeOperation = 'xor'; 1.1661 +ctx.globalCompositeOperation = 'source-over\0'; 1.1662 +ok(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'"); 1.1663 + 1.1664 +} catch (e) { 1.1665 + _thrown_outer = true; 1.1666 +} 1.1667 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.1668 + 1.1669 + 1.1670 +} 1.1671 +</script> 1.1672 + 1.1673 +<!-- [[[ test_2d.composite.operation.over.html ]]] --> 1.1674 + 1.1675 +<p>Canvas test: 2d.composite.operation.over</p> 1.1676 +<canvas id="c61" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1677 +<script> 1.1678 + 1.1679 +function test_2d_composite_operation_over() { 1.1680 + 1.1681 +var canvas = document.getElementById('c61'); 1.1682 +var ctx = canvas.getContext('2d'); 1.1683 + 1.1684 +ctx.globalCompositeOperation = 'xor'; 1.1685 +ctx.globalCompositeOperation = 'over'; 1.1686 +ok(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'"); 1.1687 + 1.1688 + 1.1689 +} 1.1690 +</script> 1.1691 + 1.1692 +<!-- [[[ test_2d.composite.operation.unrecognised.html ]]] --> 1.1693 + 1.1694 +<p>Canvas test: 2d.composite.operation.unrecognised - bug 401788</p> 1.1695 +<canvas id="c62" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1696 +<script> 1.1697 + 1.1698 +function test_2d_composite_operation_unrecognised() { 1.1699 + 1.1700 +var canvas = document.getElementById('c62'); 1.1701 +var ctx = canvas.getContext('2d'); 1.1702 + 1.1703 +var _thrown_outer = false; 1.1704 +try { 1.1705 + 1.1706 +ctx.globalCompositeOperation = 'xor'; 1.1707 +ctx.globalCompositeOperation = 'nonexistent'; 1.1708 +ok(ctx.globalCompositeOperation == 'xor', "ctx.globalCompositeOperation == 'xor'"); 1.1709 + 1.1710 +} catch (e) { 1.1711 + _thrown_outer = true; 1.1712 +} 1.1713 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.1714 + 1.1715 + 1.1716 +} 1.1717 +</script> 1.1718 + 1.1719 +<!-- [[[ test_2d.composite.solid.copy.html ]]] --> 1.1720 + 1.1721 +<p>Canvas test: 2d.composite.solid.copy</p> 1.1722 +<canvas id="c63" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1723 +<script> 1.1724 + 1.1725 + 1.1726 +function test_2d_composite_solid_copy() { 1.1727 + 1.1728 +var canvas = document.getElementById('c63'); 1.1729 +var ctx = canvas.getContext('2d'); 1.1730 + 1.1731 + 1.1732 +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; 1.1733 +ctx.fillRect(0, 0, 100, 50); 1.1734 +ctx.globalCompositeOperation = 'copy'; 1.1735 +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; 1.1736 +ctx.fillRect(0, 0, 100, 50); 1.1737 +isPixel(ctx, 50,25, 255,255,0,255, 5); 1.1738 + 1.1739 + 1.1740 +} 1.1741 +</script> 1.1742 + 1.1743 +<!-- [[[ test_2d.composite.solid.destination-atop.html ]]] --> 1.1744 + 1.1745 +<p>Canvas test: 2d.composite.solid.destination-atop</p> 1.1746 +<canvas id="c64" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1747 +<script> 1.1748 + 1.1749 + 1.1750 +function test_2d_composite_solid_destination_atop() { 1.1751 + 1.1752 +var canvas = document.getElementById('c64'); 1.1753 +var ctx = canvas.getContext('2d'); 1.1754 + 1.1755 + 1.1756 +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; 1.1757 +ctx.fillRect(0, 0, 100, 50); 1.1758 +ctx.globalCompositeOperation = 'destination-atop'; 1.1759 +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; 1.1760 +ctx.fillRect(0, 0, 100, 50); 1.1761 +isPixel(ctx, 50,25, 0,255,255,255, 5); 1.1762 + 1.1763 + 1.1764 +} 1.1765 +</script> 1.1766 + 1.1767 +<!-- [[[ test_2d.composite.solid.destination-in.html ]]] --> 1.1768 + 1.1769 +<p>Canvas test: 2d.composite.solid.destination-in</p> 1.1770 +<canvas id="c65" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1771 +<script> 1.1772 + 1.1773 + 1.1774 +function test_2d_composite_solid_destination_in() { 1.1775 + 1.1776 +var canvas = document.getElementById('c65'); 1.1777 +var ctx = canvas.getContext('2d'); 1.1778 + 1.1779 + 1.1780 +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; 1.1781 +ctx.fillRect(0, 0, 100, 50); 1.1782 +ctx.globalCompositeOperation = 'destination-in'; 1.1783 +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; 1.1784 +ctx.fillRect(0, 0, 100, 50); 1.1785 +isPixel(ctx, 50,25, 0,255,255,255, 5); 1.1786 + 1.1787 + 1.1788 +} 1.1789 +</script> 1.1790 + 1.1791 +<!-- [[[ test_2d.composite.solid.destination-out.html ]]] --> 1.1792 + 1.1793 +<p>Canvas test: 2d.composite.solid.destination-out</p> 1.1794 +<canvas id="c66" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1795 +<script> 1.1796 + 1.1797 + 1.1798 +function test_2d_composite_solid_destination_out() { 1.1799 + 1.1800 +var canvas = document.getElementById('c66'); 1.1801 +var ctx = canvas.getContext('2d'); 1.1802 + 1.1803 + 1.1804 +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; 1.1805 +ctx.fillRect(0, 0, 100, 50); 1.1806 +ctx.globalCompositeOperation = 'destination-out'; 1.1807 +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; 1.1808 +ctx.fillRect(0, 0, 100, 50); 1.1809 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.1810 + 1.1811 + 1.1812 +} 1.1813 +</script> 1.1814 + 1.1815 +<!-- [[[ test_2d.composite.solid.destination-over.html ]]] --> 1.1816 + 1.1817 +<p>Canvas test: 2d.composite.solid.destination-over</p> 1.1818 +<canvas id="c67" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1819 +<script> 1.1820 + 1.1821 + 1.1822 +function test_2d_composite_solid_destination_over() { 1.1823 + 1.1824 +var canvas = document.getElementById('c67'); 1.1825 +var ctx = canvas.getContext('2d'); 1.1826 + 1.1827 + 1.1828 +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; 1.1829 +ctx.fillRect(0, 0, 100, 50); 1.1830 +ctx.globalCompositeOperation = 'destination-over'; 1.1831 +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; 1.1832 +ctx.fillRect(0, 0, 100, 50); 1.1833 +isPixel(ctx, 50,25, 0,255,255,255, 5); 1.1834 + 1.1835 + 1.1836 +} 1.1837 +</script> 1.1838 + 1.1839 +<!-- [[[ test_2d.composite.solid.lighter.html ]]] --> 1.1840 + 1.1841 +<p>Canvas test: 2d.composite.solid.lighter</p> 1.1842 +<canvas id="c68" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1843 +<script> 1.1844 + 1.1845 + 1.1846 +function test_2d_composite_solid_lighter() { 1.1847 + 1.1848 +var canvas = document.getElementById('c68'); 1.1849 +var ctx = canvas.getContext('2d'); 1.1850 + 1.1851 + 1.1852 +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; 1.1853 +ctx.fillRect(0, 0, 100, 50); 1.1854 +ctx.globalCompositeOperation = 'lighter'; 1.1855 +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; 1.1856 +ctx.fillRect(0, 0, 100, 50); 1.1857 +isPixel(ctx, 50,25, 255,255,255,255, 5); 1.1858 + 1.1859 + 1.1860 +} 1.1861 +</script> 1.1862 + 1.1863 +<!-- [[[ test_2d.composite.solid.source-atop.html ]]] --> 1.1864 + 1.1865 +<p>Canvas test: 2d.composite.solid.source-atop</p> 1.1866 +<canvas id="c69" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1867 +<script> 1.1868 + 1.1869 + 1.1870 +function test_2d_composite_solid_source_atop() { 1.1871 + 1.1872 +var canvas = document.getElementById('c69'); 1.1873 +var ctx = canvas.getContext('2d'); 1.1874 + 1.1875 + 1.1876 +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; 1.1877 +ctx.fillRect(0, 0, 100, 50); 1.1878 +ctx.globalCompositeOperation = 'source-atop'; 1.1879 +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; 1.1880 +ctx.fillRect(0, 0, 100, 50); 1.1881 +isPixel(ctx, 50,25, 255,255,0,255, 5); 1.1882 + 1.1883 + 1.1884 +} 1.1885 +</script> 1.1886 + 1.1887 +<!-- [[[ test_2d.composite.solid.source-in.html ]]] --> 1.1888 + 1.1889 +<p>Canvas test: 2d.composite.solid.source-in</p> 1.1890 +<canvas id="c70" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1891 +<script> 1.1892 + 1.1893 + 1.1894 +function test_2d_composite_solid_source_in() { 1.1895 + 1.1896 +var canvas = document.getElementById('c70'); 1.1897 +var ctx = canvas.getContext('2d'); 1.1898 + 1.1899 + 1.1900 +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; 1.1901 +ctx.fillRect(0, 0, 100, 50); 1.1902 +ctx.globalCompositeOperation = 'source-in'; 1.1903 +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; 1.1904 +ctx.fillRect(0, 0, 100, 50); 1.1905 +isPixel(ctx, 50,25, 255,255,0,255, 5); 1.1906 + 1.1907 + 1.1908 +} 1.1909 +</script> 1.1910 + 1.1911 +<!-- [[[ test_2d.composite.solid.source-out.html ]]] --> 1.1912 + 1.1913 +<p>Canvas test: 2d.composite.solid.source-out</p> 1.1914 +<canvas id="c71" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1915 +<script> 1.1916 + 1.1917 + 1.1918 +function test_2d_composite_solid_source_out() { 1.1919 + 1.1920 +var canvas = document.getElementById('c71'); 1.1921 +var ctx = canvas.getContext('2d'); 1.1922 + 1.1923 + 1.1924 +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; 1.1925 +ctx.fillRect(0, 0, 100, 50); 1.1926 +ctx.globalCompositeOperation = 'source-out'; 1.1927 +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; 1.1928 +ctx.fillRect(0, 0, 100, 50); 1.1929 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.1930 + 1.1931 + 1.1932 +} 1.1933 +</script> 1.1934 + 1.1935 +<!-- [[[ test_2d.composite.solid.source-over.html ]]] --> 1.1936 + 1.1937 +<p>Canvas test: 2d.composite.solid.source-over</p> 1.1938 +<canvas id="c72" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1939 +<script> 1.1940 + 1.1941 + 1.1942 +function test_2d_composite_solid_source_over() { 1.1943 + 1.1944 +var canvas = document.getElementById('c72'); 1.1945 +var ctx = canvas.getContext('2d'); 1.1946 + 1.1947 + 1.1948 +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; 1.1949 +ctx.fillRect(0, 0, 100, 50); 1.1950 +ctx.globalCompositeOperation = 'source-over'; 1.1951 +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; 1.1952 +ctx.fillRect(0, 0, 100, 50); 1.1953 +isPixel(ctx, 50,25, 255,255,0,255, 5); 1.1954 + 1.1955 + 1.1956 +} 1.1957 +</script> 1.1958 + 1.1959 +<!-- [[[ test_2d.composite.solid.xor.html ]]] --> 1.1960 + 1.1961 +<p>Canvas test: 2d.composite.solid.xor</p> 1.1962 +<canvas id="c73" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1963 +<script> 1.1964 + 1.1965 + 1.1966 +function test_2d_composite_solid_xor() { 1.1967 + 1.1968 +var canvas = document.getElementById('c73'); 1.1969 +var ctx = canvas.getContext('2d'); 1.1970 + 1.1971 + 1.1972 +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; 1.1973 +ctx.fillRect(0, 0, 100, 50); 1.1974 +ctx.globalCompositeOperation = 'xor'; 1.1975 +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; 1.1976 +ctx.fillRect(0, 0, 100, 50); 1.1977 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.1978 + 1.1979 + 1.1980 +} 1.1981 +</script> 1.1982 + 1.1983 +<!-- [[[ test_2d.composite.transparent.copy.html ]]] --> 1.1984 + 1.1985 +<p>Canvas test: 2d.composite.transparent.copy</p> 1.1986 +<canvas id="c74" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.1987 +<script> 1.1988 + 1.1989 + 1.1990 +function test_2d_composite_transparent_copy() { 1.1991 + 1.1992 +var canvas = document.getElementById('c74'); 1.1993 +var ctx = canvas.getContext('2d'); 1.1994 + 1.1995 + 1.1996 +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; 1.1997 +ctx.fillRect(0, 0, 100, 50); 1.1998 +ctx.globalCompositeOperation = 'copy'; 1.1999 +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; 1.2000 +ctx.fillRect(0, 0, 100, 50); 1.2001 +isPixel(ctx, 50,25, 0,0,255,191, 5); 1.2002 + 1.2003 + 1.2004 +} 1.2005 +</script> 1.2006 + 1.2007 +<!-- [[[ test_2d.composite.transparent.destination-atop.html ]]] --> 1.2008 + 1.2009 +<p>Canvas test: 2d.composite.transparent.destination-atop</p> 1.2010 +<canvas id="c75" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2011 +<script> 1.2012 + 1.2013 + 1.2014 +function test_2d_composite_transparent_destination_atop() { 1.2015 + 1.2016 +var canvas = document.getElementById('c75'); 1.2017 +var ctx = canvas.getContext('2d'); 1.2018 + 1.2019 + 1.2020 +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; 1.2021 +ctx.fillRect(0, 0, 100, 50); 1.2022 +ctx.globalCompositeOperation = 'destination-atop'; 1.2023 +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; 1.2024 +ctx.fillRect(0, 0, 100, 50); 1.2025 +isPixel(ctx, 50,25, 0,127,127,191, 5); 1.2026 + 1.2027 + 1.2028 +} 1.2029 +</script> 1.2030 + 1.2031 +<!-- [[[ test_2d.composite.transparent.destination-in.html ]]] --> 1.2032 + 1.2033 +<p>Canvas test: 2d.composite.transparent.destination-in</p> 1.2034 +<canvas id="c76" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2035 +<script> 1.2036 + 1.2037 + 1.2038 +function test_2d_composite_transparent_destination_in() { 1.2039 + 1.2040 +var canvas = document.getElementById('c76'); 1.2041 +var ctx = canvas.getContext('2d'); 1.2042 + 1.2043 + 1.2044 +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; 1.2045 +ctx.fillRect(0, 0, 100, 50); 1.2046 +ctx.globalCompositeOperation = 'destination-in'; 1.2047 +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; 1.2048 +ctx.fillRect(0, 0, 100, 50); 1.2049 +isPixel(ctx, 50,25, 0,255,0,95, 5); 1.2050 + 1.2051 + 1.2052 +} 1.2053 +</script> 1.2054 + 1.2055 +<!-- [[[ test_2d.composite.transparent.destination-out.html ]]] --> 1.2056 + 1.2057 +<p>Canvas test: 2d.composite.transparent.destination-out</p> 1.2058 +<canvas id="c77" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2059 +<script> 1.2060 + 1.2061 + 1.2062 +function test_2d_composite_transparent_destination_out() { 1.2063 + 1.2064 +var canvas = document.getElementById('c77'); 1.2065 +var ctx = canvas.getContext('2d'); 1.2066 + 1.2067 + 1.2068 +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; 1.2069 +ctx.fillRect(0, 0, 100, 50); 1.2070 +ctx.globalCompositeOperation = 'destination-out'; 1.2071 +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; 1.2072 +ctx.fillRect(0, 0, 100, 50); 1.2073 +isPixel(ctx, 50,25, 0,255,0,31, 5); 1.2074 + 1.2075 + 1.2076 +} 1.2077 +</script> 1.2078 + 1.2079 +<!-- [[[ test_2d.composite.transparent.destination-over.html ]]] --> 1.2080 + 1.2081 +<p>Canvas test: 2d.composite.transparent.destination-over</p> 1.2082 +<canvas id="c78" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2083 +<script> 1.2084 + 1.2085 + 1.2086 +function test_2d_composite_transparent_destination_over() { 1.2087 + 1.2088 +var canvas = document.getElementById('c78'); 1.2089 +var ctx = canvas.getContext('2d'); 1.2090 + 1.2091 + 1.2092 +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; 1.2093 +ctx.fillRect(0, 0, 100, 50); 1.2094 +ctx.globalCompositeOperation = 'destination-over'; 1.2095 +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; 1.2096 +ctx.fillRect(0, 0, 100, 50); 1.2097 +isPixel(ctx, 50,25, 0,145,109,223, 5); 1.2098 + 1.2099 + 1.2100 +} 1.2101 +</script> 1.2102 + 1.2103 +<!-- [[[ test_2d.composite.transparent.lighter.html ]]] --> 1.2104 + 1.2105 +<p>Canvas test: 2d.composite.transparent.lighter</p> 1.2106 +<canvas id="c79" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2107 +<script> 1.2108 + 1.2109 + 1.2110 +function test_2d_composite_transparent_lighter() { 1.2111 + 1.2112 +var canvas = document.getElementById('c79'); 1.2113 +var ctx = canvas.getContext('2d'); 1.2114 + 1.2115 + 1.2116 +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; 1.2117 +ctx.fillRect(0, 0, 100, 50); 1.2118 +ctx.globalCompositeOperation = 'lighter'; 1.2119 +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; 1.2120 +ctx.fillRect(0, 0, 100, 50); 1.2121 +isPixel(ctx, 50,25, 0,127,191,255, 5); 1.2122 + 1.2123 + 1.2124 +} 1.2125 +</script> 1.2126 + 1.2127 +<!-- [[[ test_2d.composite.transparent.source-atop.html ]]] --> 1.2128 + 1.2129 +<p>Canvas test: 2d.composite.transparent.source-atop</p> 1.2130 +<canvas id="c80" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2131 +<script> 1.2132 + 1.2133 + 1.2134 +function test_2d_composite_transparent_source_atop() { 1.2135 + 1.2136 +var canvas = document.getElementById('c80'); 1.2137 +var ctx = canvas.getContext('2d'); 1.2138 + 1.2139 + 1.2140 +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; 1.2141 +ctx.fillRect(0, 0, 100, 50); 1.2142 +ctx.globalCompositeOperation = 'source-atop'; 1.2143 +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; 1.2144 +ctx.fillRect(0, 0, 100, 50); 1.2145 +isPixel(ctx, 50,25, 0,63,191,127, 5); 1.2146 + 1.2147 + 1.2148 +} 1.2149 +</script> 1.2150 + 1.2151 +<!-- [[[ test_2d.composite.transparent.source-in.html ]]] --> 1.2152 + 1.2153 +<p>Canvas test: 2d.composite.transparent.source-in</p> 1.2154 +<canvas id="c81" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2155 +<script> 1.2156 + 1.2157 + 1.2158 +function test_2d_composite_transparent_source_in() { 1.2159 + 1.2160 +var canvas = document.getElementById('c81'); 1.2161 +var ctx = canvas.getContext('2d'); 1.2162 + 1.2163 + 1.2164 +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; 1.2165 +ctx.fillRect(0, 0, 100, 50); 1.2166 +ctx.globalCompositeOperation = 'source-in'; 1.2167 +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; 1.2168 +ctx.fillRect(0, 0, 100, 50); 1.2169 +isPixel(ctx, 50,25, 0,0,255,95, 5); 1.2170 + 1.2171 + 1.2172 +} 1.2173 +</script> 1.2174 + 1.2175 +<!-- [[[ test_2d.composite.transparent.source-out.html ]]] --> 1.2176 + 1.2177 +<p>Canvas test: 2d.composite.transparent.source-out</p> 1.2178 +<canvas id="c82" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2179 +<script> 1.2180 + 1.2181 + 1.2182 +function test_2d_composite_transparent_source_out() { 1.2183 + 1.2184 +var canvas = document.getElementById('c82'); 1.2185 +var ctx = canvas.getContext('2d'); 1.2186 + 1.2187 + 1.2188 +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; 1.2189 +ctx.fillRect(0, 0, 100, 50); 1.2190 +ctx.globalCompositeOperation = 'source-out'; 1.2191 +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; 1.2192 +ctx.fillRect(0, 0, 100, 50); 1.2193 +isPixel(ctx, 50,25, 0,0,255,95, 5); 1.2194 + 1.2195 + 1.2196 +} 1.2197 +</script> 1.2198 + 1.2199 +<!-- [[[ test_2d.composite.transparent.source-over.html ]]] --> 1.2200 + 1.2201 +<p>Canvas test: 2d.composite.transparent.source-over</p> 1.2202 +<canvas id="c83" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2203 +<script> 1.2204 + 1.2205 + 1.2206 +function test_2d_composite_transparent_source_over() { 1.2207 + 1.2208 +var canvas = document.getElementById('c83'); 1.2209 +var ctx = canvas.getContext('2d'); 1.2210 + 1.2211 + 1.2212 +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; 1.2213 +ctx.fillRect(0, 0, 100, 50); 1.2214 +ctx.globalCompositeOperation = 'source-over'; 1.2215 +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; 1.2216 +ctx.fillRect(0, 0, 100, 50); 1.2217 +isPixel(ctx, 50,25, 0,36,218,223, 5); 1.2218 + 1.2219 + 1.2220 +} 1.2221 +</script> 1.2222 + 1.2223 +<!-- [[[ test_2d.composite.transparent.xor.html ]]] --> 1.2224 + 1.2225 +<p>Canvas test: 2d.composite.transparent.xor</p> 1.2226 +<canvas id="c84" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2227 +<script> 1.2228 + 1.2229 + 1.2230 +function test_2d_composite_transparent_xor() { 1.2231 + 1.2232 +var canvas = document.getElementById('c84'); 1.2233 +var ctx = canvas.getContext('2d'); 1.2234 + 1.2235 + 1.2236 +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; 1.2237 +ctx.fillRect(0, 0, 100, 50); 1.2238 +ctx.globalCompositeOperation = 'xor'; 1.2239 +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; 1.2240 +ctx.fillRect(0, 0, 100, 50); 1.2241 +isPixel(ctx, 50,25, 0,63,191,127, 5); 1.2242 + 1.2243 + 1.2244 +} 1.2245 +</script> 1.2246 + 1.2247 +<!-- [[[ test_2d.composite.uncovered.fill.copy.html ]]] --> 1.2248 + 1.2249 +<p>Canvas test: 2d.composite.uncovered.fill.copy</p> 1.2250 +<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. --> 1.2251 +<canvas id="c85" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2252 +<script> 1.2253 + 1.2254 + 1.2255 + 1.2256 +function test_2d_composite_uncovered_fill_copy() { 1.2257 + 1.2258 +var canvas = document.getElementById('c85'); 1.2259 +var ctx = canvas.getContext('2d'); 1.2260 + 1.2261 + 1.2262 +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; 1.2263 +ctx.fillRect(0, 0, 100, 50); 1.2264 +ctx.globalCompositeOperation = 'copy'; 1.2265 +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; 1.2266 +ctx.translate(0, 25); 1.2267 +ctx.fillRect(0, 50, 100, 50); 1.2268 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.2269 + 1.2270 + 1.2271 +} 1.2272 +</script> 1.2273 + 1.2274 +<!-- [[[ test_2d.composite.uncovered.fill.destination-atop.html ]]] --> 1.2275 + 1.2276 +<p>Canvas test: 2d.composite.uncovered.fill.destination-atop</p> 1.2277 +<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. --> 1.2278 +<canvas id="c86" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2279 +<script> 1.2280 + 1.2281 + 1.2282 + 1.2283 +function test_2d_composite_uncovered_fill_destination_atop() { 1.2284 + 1.2285 +var canvas = document.getElementById('c86'); 1.2286 +var ctx = canvas.getContext('2d'); 1.2287 + 1.2288 + 1.2289 +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; 1.2290 +ctx.fillRect(0, 0, 100, 50); 1.2291 +ctx.globalCompositeOperation = 'destination-atop'; 1.2292 +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; 1.2293 +ctx.translate(0, 25); 1.2294 +ctx.fillRect(0, 50, 100, 50); 1.2295 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.2296 + 1.2297 + 1.2298 +} 1.2299 +</script> 1.2300 + 1.2301 +<!-- [[[ test_2d.composite.uncovered.fill.destination-in.html ]]] --> 1.2302 + 1.2303 +<p>Canvas test: 2d.composite.uncovered.fill.destination-in</p> 1.2304 +<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. --> 1.2305 +<canvas id="c87" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2306 +<script> 1.2307 + 1.2308 + 1.2309 + 1.2310 +function test_2d_composite_uncovered_fill_destination_in() { 1.2311 + 1.2312 +var canvas = document.getElementById('c87'); 1.2313 +var ctx = canvas.getContext('2d'); 1.2314 + 1.2315 + 1.2316 +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; 1.2317 +ctx.fillRect(0, 0, 100, 50); 1.2318 +ctx.globalCompositeOperation = 'destination-in'; 1.2319 +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; 1.2320 +ctx.translate(0, 25); 1.2321 +ctx.fillRect(0, 50, 100, 50); 1.2322 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.2323 + 1.2324 + 1.2325 +} 1.2326 +</script> 1.2327 + 1.2328 +<!-- [[[ test_2d.composite.uncovered.fill.source-in.html ]]] --> 1.2329 + 1.2330 +<p>Canvas test: 2d.composite.uncovered.fill.source-in</p> 1.2331 +<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. --> 1.2332 +<canvas id="c88" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2333 +<script> 1.2334 + 1.2335 + 1.2336 + 1.2337 +function test_2d_composite_uncovered_fill_source_in() { 1.2338 + 1.2339 +var canvas = document.getElementById('c88'); 1.2340 +var ctx = canvas.getContext('2d'); 1.2341 + 1.2342 + 1.2343 +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; 1.2344 +ctx.fillRect(0, 0, 100, 50); 1.2345 +ctx.globalCompositeOperation = 'source-in'; 1.2346 +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; 1.2347 +ctx.translate(0, 25); 1.2348 +ctx.fillRect(0, 50, 100, 50); 1.2349 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.2350 + 1.2351 + 1.2352 +} 1.2353 +</script> 1.2354 + 1.2355 +<!-- [[[ test_2d.composite.uncovered.fill.source-out.html ]]] --> 1.2356 + 1.2357 +<p>Canvas test: 2d.composite.uncovered.fill.source-out</p> 1.2358 +<!-- Testing: fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. --> 1.2359 +<canvas id="c89" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2360 +<script> 1.2361 + 1.2362 + 1.2363 + 1.2364 +function test_2d_composite_uncovered_fill_source_out() { 1.2365 + 1.2366 +var canvas = document.getElementById('c89'); 1.2367 +var ctx = canvas.getContext('2d'); 1.2368 + 1.2369 + 1.2370 +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; 1.2371 +ctx.fillRect(0, 0, 100, 50); 1.2372 +ctx.globalCompositeOperation = 'source-out'; 1.2373 +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; 1.2374 +ctx.translate(0, 25); 1.2375 +ctx.fillRect(0, 50, 100, 50); 1.2376 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.2377 + 1.2378 + 1.2379 +} 1.2380 +</script> 1.2381 + 1.2382 +<!-- [[[ test_2d.composite.uncovered.image.copy.html ]]] --> 1.2383 + 1.2384 +<p>Canvas test: 2d.composite.uncovered.image.copy</p> 1.2385 +<!-- Testing: drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. --> 1.2386 +<canvas id="c90" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2387 +<script> 1.2388 + 1.2389 + 1.2390 + 1.2391 +function test_2d_composite_uncovered_image_copy() { 1.2392 + 1.2393 +var canvas = document.getElementById('c90'); 1.2394 +var ctx = canvas.getContext('2d'); 1.2395 + 1.2396 + 1.2397 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.2398 +ctx.fillRect(0, 0, 100, 50); 1.2399 +ctx.globalCompositeOperation = 'copy'; 1.2400 +ctx.drawImage(document.getElementById('yellow_1.png'), 40, 40, 10, 10, 40, 50, 10, 10); 1.2401 +isPixel(ctx, 15,15, 0,0,0,0, 5); 1.2402 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.2403 + 1.2404 + 1.2405 +} 1.2406 +</script> 1.2407 +<img src="image_yellow.png" id="yellow_1.png" class="resource"> 1.2408 + 1.2409 +<!-- [[[ test_2d.composite.uncovered.image.destination-atop.html ]]] --> 1.2410 + 1.2411 +<p>Canvas test: 2d.composite.uncovered.image.destination-atop</p> 1.2412 +<!-- Testing: drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. --> 1.2413 +<canvas id="c91" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2414 +<script> 1.2415 + 1.2416 + 1.2417 + 1.2418 +function test_2d_composite_uncovered_image_destination_atop() { 1.2419 + 1.2420 +var canvas = document.getElementById('c91'); 1.2421 +var ctx = canvas.getContext('2d'); 1.2422 + 1.2423 + 1.2424 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.2425 +ctx.fillRect(0, 0, 100, 50); 1.2426 +ctx.globalCompositeOperation = 'destination-atop'; 1.2427 +ctx.drawImage(document.getElementById('yellow_2.png'), 40, 40, 10, 10, 40, 50, 10, 10); 1.2428 +isPixel(ctx, 15,15, 0,0,0,0, 5); 1.2429 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.2430 + 1.2431 + 1.2432 +} 1.2433 +</script> 1.2434 +<img src="image_yellow.png" id="yellow_2.png" class="resource"> 1.2435 + 1.2436 +<!-- [[[ test_2d.composite.uncovered.image.destination-in.html ]]] --> 1.2437 + 1.2438 +<p>Canvas test: 2d.composite.uncovered.image.destination-in</p> 1.2439 +<!-- Testing: drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. --> 1.2440 +<canvas id="c92" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2441 +<script> 1.2442 + 1.2443 + 1.2444 + 1.2445 +function test_2d_composite_uncovered_image_destination_in() { 1.2446 + 1.2447 +var canvas = document.getElementById('c92'); 1.2448 +var ctx = canvas.getContext('2d'); 1.2449 + 1.2450 + 1.2451 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.2452 +ctx.fillRect(0, 0, 100, 50); 1.2453 +ctx.globalCompositeOperation = 'destination-in'; 1.2454 +ctx.drawImage(document.getElementById('yellow_3.png'), 40, 40, 10, 10, 40, 50, 10, 10); 1.2455 +isPixel(ctx, 15,15, 0,0,0,0, 5); 1.2456 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.2457 + 1.2458 + 1.2459 +} 1.2460 +</script> 1.2461 +<img src="image_yellow.png" id="yellow_3.png" class="resource"> 1.2462 + 1.2463 +<!-- [[[ test_2d.composite.uncovered.image.source-in.html ]]] --> 1.2464 + 1.2465 +<p>Canvas test: 2d.composite.uncovered.image.source-in</p> 1.2466 +<!-- Testing: drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. --> 1.2467 +<canvas id="c93" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2468 +<script> 1.2469 + 1.2470 + 1.2471 + 1.2472 +function test_2d_composite_uncovered_image_source_in() { 1.2473 + 1.2474 +var canvas = document.getElementById('c93'); 1.2475 +var ctx = canvas.getContext('2d'); 1.2476 + 1.2477 + 1.2478 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.2479 +ctx.fillRect(0, 0, 100, 50); 1.2480 +ctx.globalCompositeOperation = 'source-in'; 1.2481 +ctx.drawImage(document.getElementById('yellow_4.png'), 40, 40, 10, 10, 40, 50, 10, 10); 1.2482 +isPixel(ctx, 15,15, 0,0,0,0, 5); 1.2483 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.2484 + 1.2485 + 1.2486 +} 1.2487 +</script> 1.2488 +<img src="image_yellow.png" id="yellow_4.png" class="resource"> 1.2489 + 1.2490 +<!-- [[[ test_2d.composite.uncovered.image.source-out.html ]]] --> 1.2491 + 1.2492 +<p>Canvas test: 2d.composite.uncovered.image.source-out</p> 1.2493 +<!-- Testing: drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. --> 1.2494 +<canvas id="c94" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2495 +<script> 1.2496 + 1.2497 + 1.2498 + 1.2499 +function test_2d_composite_uncovered_image_source_out() { 1.2500 + 1.2501 +var canvas = document.getElementById('c94'); 1.2502 +var ctx = canvas.getContext('2d'); 1.2503 + 1.2504 + 1.2505 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.2506 +ctx.fillRect(0, 0, 100, 50); 1.2507 +ctx.globalCompositeOperation = 'source-out'; 1.2508 +ctx.drawImage(document.getElementById('yellow_5.png'), 40, 40, 10, 10, 40, 50, 10, 10); 1.2509 +isPixel(ctx, 15,15, 0,0,0,0, 5); 1.2510 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.2511 + 1.2512 + 1.2513 +} 1.2514 +</script> 1.2515 +<img src="image_yellow.png" id="yellow_5.png" class="resource"> 1.2516 + 1.2517 +<!-- [[[ test_2d.composite.uncovered.pattern.copy.html ]]] --> 1.2518 + 1.2519 +<p>Canvas test: 2d.composite.uncovered.pattern.copy</p> 1.2520 +<!-- Testing: Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. --> 1.2521 +<canvas id="c95" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2522 +<script> 1.2523 + 1.2524 + 1.2525 + 1.2526 +function test_2d_composite_uncovered_pattern_copy() { 1.2527 + 1.2528 +var canvas = document.getElementById('c95'); 1.2529 +var ctx = canvas.getContext('2d'); 1.2530 + 1.2531 + 1.2532 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.2533 +ctx.fillRect(0, 0, 100, 50); 1.2534 +ctx.globalCompositeOperation = 'copy'; 1.2535 +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow_6.png'), 'no-repeat'); 1.2536 +ctx.fillRect(0, 50, 100, 50); 1.2537 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.2538 + 1.2539 + 1.2540 +} 1.2541 +</script> 1.2542 +<img src="image_yellow.png" id="yellow_6.png" class="resource"> 1.2543 + 1.2544 +<!-- [[[ test_2d.composite.uncovered.pattern.destination-atop.html ]]] --> 1.2545 + 1.2546 +<p>Canvas test: 2d.composite.uncovered.pattern.destination-atop</p> 1.2547 +<!-- Testing: Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. --> 1.2548 +<canvas id="c96" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2549 +<script> 1.2550 + 1.2551 + 1.2552 + 1.2553 +function test_2d_composite_uncovered_pattern_destination_atop() { 1.2554 + 1.2555 +var canvas = document.getElementById('c96'); 1.2556 +var ctx = canvas.getContext('2d'); 1.2557 + 1.2558 + 1.2559 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.2560 +ctx.fillRect(0, 0, 100, 50); 1.2561 +ctx.globalCompositeOperation = 'destination-atop'; 1.2562 +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow_7.png'), 'no-repeat'); 1.2563 +ctx.fillRect(0, 50, 100, 50); 1.2564 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.2565 + 1.2566 + 1.2567 +} 1.2568 +</script> 1.2569 +<img src="image_yellow.png" id="yellow_7.png" class="resource"> 1.2570 + 1.2571 +<!-- [[[ test_2d.composite.uncovered.pattern.destination-in.html ]]] --> 1.2572 + 1.2573 +<p>Canvas test: 2d.composite.uncovered.pattern.destination-in</p> 1.2574 +<!-- Testing: Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. --> 1.2575 +<canvas id="c97" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2576 +<script> 1.2577 + 1.2578 + 1.2579 + 1.2580 +function test_2d_composite_uncovered_pattern_destination_in() { 1.2581 + 1.2582 +var canvas = document.getElementById('c97'); 1.2583 +var ctx = canvas.getContext('2d'); 1.2584 + 1.2585 + 1.2586 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.2587 +ctx.fillRect(0, 0, 100, 50); 1.2588 +ctx.globalCompositeOperation = 'destination-in'; 1.2589 +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow_8.png'), 'no-repeat'); 1.2590 +ctx.fillRect(0, 50, 100, 50); 1.2591 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.2592 + 1.2593 + 1.2594 +} 1.2595 +</script> 1.2596 +<img src="image_yellow.png" id="yellow_8.png" class="resource"> 1.2597 + 1.2598 +<!-- [[[ test_2d.composite.uncovered.pattern.source-in.html ]]] --> 1.2599 + 1.2600 +<p>Canvas test: 2d.composite.uncovered.pattern.source-in</p> 1.2601 +<!-- Testing: Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. --> 1.2602 +<canvas id="c98" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2603 +<script> 1.2604 + 1.2605 + 1.2606 + 1.2607 +function test_2d_composite_uncovered_pattern_source_in() { 1.2608 + 1.2609 +var canvas = document.getElementById('c98'); 1.2610 +var ctx = canvas.getContext('2d'); 1.2611 + 1.2612 + 1.2613 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.2614 +ctx.fillRect(0, 0, 100, 50); 1.2615 +ctx.globalCompositeOperation = 'source-in'; 1.2616 +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow_9.png'), 'no-repeat'); 1.2617 +ctx.fillRect(0, 50, 100, 50); 1.2618 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.2619 + 1.2620 + 1.2621 +} 1.2622 +</script> 1.2623 +<img src="image_yellow.png" id="yellow_9.png" class="resource"> 1.2624 + 1.2625 +<!-- [[[ test_2d.composite.uncovered.pattern.source-out.html ]]] --> 1.2626 + 1.2627 +<p>Canvas test: 2d.composite.uncovered.pattern.source-out</p> 1.2628 +<!-- Testing: Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. --> 1.2629 +<canvas id="c99" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2630 +<script> 1.2631 + 1.2632 + 1.2633 + 1.2634 +function test_2d_composite_uncovered_pattern_source_out() { 1.2635 + 1.2636 +var canvas = document.getElementById('c99'); 1.2637 +var ctx = canvas.getContext('2d'); 1.2638 + 1.2639 + 1.2640 +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; 1.2641 +ctx.fillRect(0, 0, 100, 50); 1.2642 +ctx.globalCompositeOperation = 'source-out'; 1.2643 +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow_10.png'), 'no-repeat'); 1.2644 +ctx.fillRect(0, 50, 100, 50); 1.2645 +isPixel(ctx, 50,25, 0,0,0,0, 5); 1.2646 + 1.2647 + 1.2648 +} 1.2649 +</script> 1.2650 +<img src="image_yellow.png" id="yellow_10.png" class="resource"> 1.2651 + 1.2652 +<!-- [[[ test_2d.drawImage.3arg.html ]]] --> 1.2653 + 1.2654 +<p>Canvas test: 2d.drawImage.3arg</p> 1.2655 +<canvas id="c100" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2656 +<script> 1.2657 + 1.2658 + 1.2659 +function test_2d_drawImage_3arg() { 1.2660 + 1.2661 +var canvas = document.getElementById('c100'); 1.2662 +var ctx = canvas.getContext('2d'); 1.2663 + 1.2664 +ctx.drawImage(document.getElementById('green_1.png'), 0, 0); 1.2665 +ctx.drawImage(document.getElementById('red_3.png'), -100, 0); 1.2666 +ctx.drawImage(document.getElementById('red_3.png'), 100, 0); 1.2667 +ctx.drawImage(document.getElementById('red_3.png'), 0, -50); 1.2668 +ctx.drawImage(document.getElementById('red_3.png'), 0, 50); 1.2669 + 1.2670 +isPixel(ctx, 0,0, 0,255,0,255, 2); 1.2671 +isPixel(ctx, 99,0, 0,255,0,255, 2); 1.2672 +isPixel(ctx, 0,49, 0,255,0,255, 2); 1.2673 +isPixel(ctx, 99,49, 0,255,0,255, 2); 1.2674 + 1.2675 + 1.2676 +} 1.2677 +</script> 1.2678 +<img src="image_red.png" id="red_3.png" class="resource"> 1.2679 +<img src="image_green.png" id="green_1.png" class="resource"> 1.2680 + 1.2681 +<!-- [[[ test_2d.drawImage.5arg.html ]]] --> 1.2682 + 1.2683 +<p>Canvas test: 2d.drawImage.5arg</p> 1.2684 +<canvas id="c101" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2685 +<script> 1.2686 + 1.2687 + 1.2688 +function test_2d_drawImage_5arg() { 1.2689 + 1.2690 +var canvas = document.getElementById('c101'); 1.2691 +var ctx = canvas.getContext('2d'); 1.2692 + 1.2693 +ctx.fillStyle = '#f00'; 1.2694 +ctx.fillRect(0, 0, 100, 50); 1.2695 +ctx.drawImage(document.getElementById('green_2.png'), 50, 0, 50, 50); 1.2696 +ctx.drawImage(document.getElementById('red_4.png'), 0, 0, 50, 50); 1.2697 +ctx.fillStyle = '#0f0'; 1.2698 +ctx.fillRect(0, 0, 50, 50); 1.2699 + 1.2700 +isPixel(ctx, 0,0, 0,255,0,255, 2); 1.2701 +isPixel(ctx, 99,0, 0,255,0,255, 2); 1.2702 +isPixel(ctx, 0,49, 0,255,0,255, 2); 1.2703 +isPixel(ctx, 99,49, 0,255,0,255, 2); 1.2704 + 1.2705 + 1.2706 +} 1.2707 +</script> 1.2708 +<img src="image_red.png" id="red_4.png" class="resource"> 1.2709 +<img src="image_green.png" id="green_2.png" class="resource"> 1.2710 + 1.2711 +<!-- [[[ test_2d.drawImage.9arg.basic.html ]]] --> 1.2712 + 1.2713 +<p>Canvas test: 2d.drawImage.9arg.basic</p> 1.2714 +<canvas id="c102" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2715 +<script> 1.2716 + 1.2717 + 1.2718 +function test_2d_drawImage_9arg_basic() { 1.2719 + 1.2720 +var canvas = document.getElementById('c102'); 1.2721 +var ctx = canvas.getContext('2d'); 1.2722 + 1.2723 +ctx.fillStyle = '#f00'; 1.2724 +ctx.fillRect(0, 0, 100, 50); 1.2725 +ctx.drawImage(document.getElementById('green_3.png'), 0, 0, 100, 50, 0, 0, 100, 50); 1.2726 +isPixel(ctx, 0,0, 0,255,0,255, 2); 1.2727 +isPixel(ctx, 99,0, 0,255,0,255, 2); 1.2728 +isPixel(ctx, 0,49, 0,255,0,255, 2); 1.2729 +isPixel(ctx, 99,49, 0,255,0,255, 2); 1.2730 + 1.2731 + 1.2732 +} 1.2733 +</script> 1.2734 +<img src="image_green.png" id="green_3.png" class="resource"> 1.2735 + 1.2736 +<!-- [[[ test_2d.drawImage.9arg.destpos.html ]]] --> 1.2737 + 1.2738 +<p>Canvas test: 2d.drawImage.9arg.destpos</p> 1.2739 +<canvas id="c103" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2740 +<script> 1.2741 + 1.2742 + 1.2743 +function test_2d_drawImage_9arg_destpos() { 1.2744 + 1.2745 +var canvas = document.getElementById('c103'); 1.2746 +var ctx = canvas.getContext('2d'); 1.2747 + 1.2748 +ctx.fillStyle = '#f00'; 1.2749 +ctx.fillRect(0, 0, 100, 50); 1.2750 +ctx.drawImage(document.getElementById('green_4.png'), 0, 0, 100, 50, 0, 0, 100, 50); 1.2751 +ctx.drawImage(document.getElementById('red_5.png'), 0, 0, 100, 50, -100, 0, 100, 50); 1.2752 +ctx.drawImage(document.getElementById('red_5.png'), 0, 0, 100, 50, 100, 0, 100, 50); 1.2753 +ctx.drawImage(document.getElementById('red_5.png'), 0, 0, 100, 50, 0, -50, 100, 50); 1.2754 +ctx.drawImage(document.getElementById('red_5.png'), 0, 0, 100, 50, 0, 50, 100, 50); 1.2755 +isPixel(ctx, 0,0, 0,255,0,255, 2); 1.2756 +isPixel(ctx, 99,0, 0,255,0,255, 2); 1.2757 +isPixel(ctx, 0,49, 0,255,0,255, 2); 1.2758 +isPixel(ctx, 99,49, 0,255,0,255, 2); 1.2759 + 1.2760 + 1.2761 +} 1.2762 +</script> 1.2763 +<img src="image_red.png" id="red_5.png" class="resource"> 1.2764 +<img src="image_green.png" id="green_4.png" class="resource"> 1.2765 + 1.2766 +<!-- [[[ test_2d.drawImage.9arg.destsize.html ]]] --> 1.2767 + 1.2768 +<p>Canvas test: 2d.drawImage.9arg.destsize</p> 1.2769 +<canvas id="c104" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2770 +<script> 1.2771 + 1.2772 + 1.2773 +function test_2d_drawImage_9arg_destsize() { 1.2774 + 1.2775 +var canvas = document.getElementById('c104'); 1.2776 +var ctx = canvas.getContext('2d'); 1.2777 + 1.2778 +ctx.fillStyle = '#f00'; 1.2779 +ctx.fillRect(0, 0, 100, 50); 1.2780 +ctx.drawImage(document.getElementById('green_5.png'), 1, 1, 1, 1, 0, 0, 100, 50); 1.2781 +ctx.drawImage(document.getElementById('red_6.png'), 0, 0, 100, 50, -50, 0, 50, 50); 1.2782 +ctx.drawImage(document.getElementById('red_6.png'), 0, 0, 100, 50, 100, 0, 50, 50); 1.2783 +ctx.drawImage(document.getElementById('red_6.png'), 0, 0, 100, 50, 0, -25, 100, 25); 1.2784 +ctx.drawImage(document.getElementById('red_6.png'), 0, 0, 100, 50, 0, 50, 100, 25); 1.2785 +isPixel(ctx, 0,0, 0,255,0,255, 2); 1.2786 +isPixel(ctx, 99,0, 0,255,0,255, 2); 1.2787 +isPixel(ctx, 0,49, 0,255,0,255, 2); 1.2788 +isPixel(ctx, 99,49, 0,255,0,255, 2); 1.2789 + 1.2790 + 1.2791 +} 1.2792 +</script> 1.2793 +<img src="image_red.png" id="red_6.png" class="resource"> 1.2794 +<img src="image_green.png" id="green_5.png" class="resource"> 1.2795 + 1.2796 +<!-- [[[ test_2d.drawImage.9arg.sourcepos.html ]]] --> 1.2797 + 1.2798 +<p>Canvas test: 2d.drawImage.9arg.sourcepos</p> 1.2799 +<canvas id="c105" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2800 +<script> 1.2801 + 1.2802 + 1.2803 +function test_2d_drawImage_9arg_sourcepos() { 1.2804 + 1.2805 +var canvas = document.getElementById('c105'); 1.2806 +var ctx = canvas.getContext('2d'); 1.2807 + 1.2808 +ctx.fillStyle = '#f00'; 1.2809 +ctx.fillRect(0, 0, 100, 50); 1.2810 +ctx.drawImage(document.getElementById('rgrg-256x256_1.png'), 140, 20, 100, 50, 0, 0, 100, 50); 1.2811 +isPixel(ctx, 0,0, 0,255,0,255, 2); 1.2812 +isPixel(ctx, 99,0, 0,255,0,255, 2); 1.2813 +isPixel(ctx, 0,49, 0,255,0,255, 2); 1.2814 +isPixel(ctx, 99,49, 0,255,0,255, 2); 1.2815 + 1.2816 + 1.2817 +} 1.2818 +</script> 1.2819 +<img src="image_rgrg-256x256.png" id="rgrg-256x256_1.png" class="resource"> 1.2820 + 1.2821 +<!-- [[[ test_2d.drawImage.9arg.sourcesize.html ]]] --> 1.2822 + 1.2823 +<p>Canvas test: 2d.drawImage.9arg.sourcesize</p> 1.2824 +<canvas id="c106" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2825 +<script> 1.2826 + 1.2827 + 1.2828 +function test_2d_drawImage_9arg_sourcesize() { 1.2829 + 1.2830 +var canvas = document.getElementById('c106'); 1.2831 +var ctx = canvas.getContext('2d'); 1.2832 + 1.2833 +ctx.fillStyle = '#f00'; 1.2834 +ctx.fillRect(0, 0, 100, 50); 1.2835 +ctx.drawImage(document.getElementById('rgrg-256x256_2.png'), 0, 0, 256, 256, 0, 0, 100, 50); 1.2836 +ctx.fillStyle = '#0f0'; 1.2837 +ctx.fillRect(0, 0, 51, 26); 1.2838 +ctx.fillRect(49, 24, 51, 26); 1.2839 +isPixel(ctx, 0,0, 0,255,0,255, 3); 1.2840 +isPixel(ctx, 99,0, 0,255,0,255, 3); 1.2841 +isPixel(ctx, 0,49, 0,255,0,255, 3); 1.2842 +isPixel(ctx, 99,49, 0,255,0,255, 3); 1.2843 +isPixel(ctx, 20,20, 0,255,0,255, 3); 1.2844 +isPixel(ctx, 80,20, 0,255,0,255, 3); 1.2845 +isPixel(ctx, 20,30, 0,255,0,255, 3); 1.2846 +isPixel(ctx, 80,30, 0,255,0,255, 3); 1.2847 + 1.2848 + 1.2849 +} 1.2850 +</script> 1.2851 +<img src="image_rgrg-256x256.png" id="rgrg-256x256_2.png" class="resource"> 1.2852 + 1.2853 +<!-- [[[ test_2d.drawImage.alpha.html ]]] --> 1.2854 + 1.2855 +<p>Canvas test: 2d.drawImage.alpha</p> 1.2856 +<canvas id="c107" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2857 +<script> 1.2858 + 1.2859 + 1.2860 +function test_2d_drawImage_alpha() { 1.2861 + 1.2862 +var canvas = document.getElementById('c107'); 1.2863 +var ctx = canvas.getContext('2d'); 1.2864 + 1.2865 +ctx.fillStyle = '#0f0'; 1.2866 +ctx.fillRect(0, 0, 100, 50); 1.2867 +ctx.globalAlpha = 0; 1.2868 +ctx.drawImage(document.getElementById('red_7.png'), 0, 0); 1.2869 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.2870 + 1.2871 + 1.2872 +} 1.2873 +</script> 1.2874 +<img src="image_red.png" id="red_7.png" class="resource"> 1.2875 + 1.2876 +<!-- [[[ test_2d.drawImage.animated.apng.html ]]] --> 1.2877 + 1.2878 +<p>Canvas test: 2d.drawImage.animated.apng</p> 1.2879 +<!-- Testing: drawImage() of an APNG with no poster frame draws the first frame --> 1.2880 +<canvas id="c108" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2881 +<script> 1.2882 + 1.2883 + 1.2884 +function deferTest() { 1.2885 + _deferred = true; 1.2886 +} 1.2887 +function wrapFunction(f) { 1.2888 + return function () { 1.2889 + f.apply(null, arguments); 1.2890 + }; 1.2891 +} 1.2892 + 1.2893 +var canvas108 = document.getElementById('c108'); 1.2894 +var ctx108 = canvas108.getContext('2d'); 1.2895 +var isDone_test_2d_drawImage_animated_apng = false; 1.2896 + 1.2897 +function test_2d_drawImage_animated_apng() { 1.2898 + 1.2899 +deferTest(); 1.2900 +setTimeout(wrapFunction(function () { 1.2901 + ctx108.drawImage(document.getElementById('anim-gr_1.png'), 0, 0); 1.2902 + isPixel(ctx108, 50,25, 0,255,0,255, 2); 1.2903 + isDone_test_2d_drawImage_animated_apng = true; 1.2904 +}), 5000); 1.2905 + 1.2906 + 1.2907 +} 1.2908 +</script> 1.2909 +<img src="image_anim-gr.png" id="anim-gr_1.png" class="resource"> 1.2910 + 1.2911 +<!-- [[[ test_2d.drawImage.animated.gif.html ]]] --> 1.2912 + 1.2913 +<p>Canvas test: 2d.drawImage.animated.gif</p> 1.2914 +<!-- Testing: drawImage() of an animated GIF draws the first frame --> 1.2915 +<canvas id="c109" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2916 +<script> 1.2917 + 1.2918 +var canvas109 = document.getElementById('c109'); 1.2919 +var ctx109 = canvas109.getContext('2d'); 1.2920 +var isDone_test_2d_drawImage_animated_gif = false; 1.2921 + 1.2922 +function test_2d_drawImage_animated_gif() { 1.2923 + 1.2924 +deferTest(); 1.2925 +setTimeout(wrapFunction(function () { 1.2926 + ctx109.drawImage(document.getElementById('anim-gr_1.gif'), 0, 0); 1.2927 + isPixel(ctx109, 50,25, 0,255,0,255, 2); 1.2928 + isDone_test_2d_drawImage_animated_gif = true; 1.2929 +}), 5000); 1.2930 + 1.2931 + 1.2932 +} 1.2933 +</script> 1.2934 +<img src="image_anim-gr.gif" id="anim-gr_1.gif" class="resource"> 1.2935 + 1.2936 +<!-- [[[ test_2d.drawImage.animated.poster.html ]]] --> 1.2937 + 1.2938 +<p>Canvas test: 2d.drawImage.animated.poster</p> 1.2939 +<!-- Testing: drawImage() of an APNG draws the poster frame --> 1.2940 +<canvas id="c110" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2941 +<script> 1.2942 + 1.2943 +var canvas110 = document.getElementById('c110'); 1.2944 +var ctx110 = canvas110.getContext('2d'); 1.2945 + 1.2946 + 1.2947 +function test_2d_drawImage_animated_poster() { 1.2948 + 1.2949 +ctx110.drawImage(document.getElementById('anim-poster-gr_1.png'), 0, 0); 1.2950 +todo_isPixel(ctx110, 50,25, 0,255,0,255, 2); 1.2951 + 1.2952 + 1.2953 +} 1.2954 +</script> 1.2955 +<img src="image_anim-poster-gr.png" id="anim-poster-gr_1.png" class="resource"> 1.2956 + 1.2957 +<!-- [[[ test_2d.drawImage.broken.html ]]] --> 1.2958 + 1.2959 +<p>Canvas test: 2d.drawImage.broken</p> 1.2960 +<canvas id="c111" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2961 +<script> 1.2962 + 1.2963 +function test_2d_drawImage_broken() { 1.2964 + 1.2965 +var canvas = document.getElementById('c111'); 1.2966 +var ctx = canvas.getContext('2d'); 1.2967 + 1.2968 +var img = document.getElementById('broken_1.png'); 1.2969 +todo(img.complete === false, "img.complete === false"); 1.2970 +var _thrown = undefined; try { 1.2971 + ctx.drawImage(img, 0, 0); 1.2972 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "InvalidStateError" && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw InvalidStateError"); 1.2973 + 1.2974 + 1.2975 +} 1.2976 +</script> 1.2977 +<img src="image_broken.png" id="broken_1.png" class="resource"> 1.2978 + 1.2979 +<!-- [[[ test_2d.drawImage.canvas.html ]]] --> 1.2980 + 1.2981 +<p>Canvas test: 2d.drawImage.canvas</p> 1.2982 +<canvas id="c112" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.2983 +<script> 1.2984 + 1.2985 + 1.2986 +function test_2d_drawImage_canvas() { 1.2987 + 1.2988 +var canvas = document.getElementById('c112'); 1.2989 +var ctx = canvas.getContext('2d'); 1.2990 + 1.2991 +var canvas2 = document.createElement('canvas'); 1.2992 +canvas2.width = 100; 1.2993 +canvas2.height = 50; 1.2994 +var ctx2 = canvas2.getContext('2d'); 1.2995 +ctx2.fillStyle = '#0f0'; 1.2996 +ctx2.fillRect(0, 0, 100, 50); 1.2997 + 1.2998 +ctx.fillStyle = '#f00'; 1.2999 +ctx.drawImage(canvas2, 0, 0); 1.3000 + 1.3001 +isPixel(ctx, 0,0, 0,255,0,255, 2); 1.3002 +isPixel(ctx, 99,0, 0,255,0,255, 2); 1.3003 +isPixel(ctx, 0,49, 0,255,0,255, 2); 1.3004 +isPixel(ctx, 99,49, 0,255,0,255, 2); 1.3005 + 1.3006 + 1.3007 +} 1.3008 +</script> 1.3009 + 1.3010 +<!-- [[[ test_2d.drawImage.clip.html ]]] --> 1.3011 + 1.3012 +<p>Canvas test: 2d.drawImage.clip</p> 1.3013 +<canvas id="c113" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3014 +<script> 1.3015 + 1.3016 + 1.3017 +function test_2d_drawImage_clip() { 1.3018 + 1.3019 +var canvas = document.getElementById('c113'); 1.3020 +var ctx = canvas.getContext('2d'); 1.3021 + 1.3022 +ctx.fillStyle = '#0f0'; 1.3023 +ctx.fillRect(0, 0, 100, 50); 1.3024 +ctx.rect(-10, -10, 1, 1); 1.3025 +ctx.clip(); 1.3026 +ctx.drawImage(document.getElementById('red_8.png'), 0, 0); 1.3027 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.3028 + 1.3029 + 1.3030 +} 1.3031 +</script> 1.3032 +<img src="image_red.png" id="red_8.png" class="resource"> 1.3033 + 1.3034 +<!-- [[[ test_2d.drawImage.composite.html ]]] --> 1.3035 + 1.3036 +<p>Canvas test: 2d.drawImage.composite</p> 1.3037 +<canvas id="c114" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3038 +<script> 1.3039 + 1.3040 + 1.3041 +function test_2d_drawImage_composite() { 1.3042 + 1.3043 +var canvas = document.getElementById('c114'); 1.3044 +var ctx = canvas.getContext('2d'); 1.3045 + 1.3046 +ctx.fillStyle = '#0f0'; 1.3047 +ctx.fillRect(0, 0, 100, 50); 1.3048 +ctx.globalCompositeOperation = 'destination-over'; 1.3049 +ctx.drawImage(document.getElementById('red_9.png'), 0, 0); 1.3050 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.3051 + 1.3052 + 1.3053 +} 1.3054 +</script> 1.3055 +<img src="image_red.png" id="red_9.png" class="resource"> 1.3056 + 1.3057 +<!-- [[[ test_2d.drawImage.floatsource.html ]]] --> 1.3058 + 1.3059 +<p>Canvas test: 2d.drawImage.floatsource</p> 1.3060 +<canvas id="c115" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3061 +<script> 1.3062 + 1.3063 + 1.3064 +function test_2d_drawImage_floatsource() { 1.3065 + 1.3066 +var canvas = document.getElementById('c115'); 1.3067 +var ctx = canvas.getContext('2d'); 1.3068 + 1.3069 +ctx.drawImage(document.getElementById('green_6.png'), 10.1, 10.1, 0.1, 0.1, 0, 0, 100, 50); 1.3070 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.3071 + 1.3072 + 1.3073 +} 1.3074 +</script> 1.3075 +<img src="image_green.png" id="green_6.png" class="resource"> 1.3076 + 1.3077 +<!-- [[[ test_2d.drawImage.incomplete.html ]]] --> 1.3078 + 1.3079 +<p>Canvas test: 2d.drawImage.incomplete</p> 1.3080 +<canvas id="c116" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3081 +<script> 1.3082 + 1.3083 +function test_2d_drawImage_incomplete() { 1.3084 + 1.3085 +var canvas = document.getElementById('c116'); 1.3086 +var ctx = canvas.getContext('2d'); 1.3087 + 1.3088 +var img = new Image(); 1.3089 +todo(img.complete === false, "img.complete === false"); 1.3090 +var _thrown = undefined; try { 1.3091 + ctx.drawImage(img, 0, 0); 1.3092 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "InvalidStateError" && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw InvalidStateError"); 1.3093 + 1.3094 + 1.3095 +} 1.3096 +</script> 1.3097 + 1.3098 +<!-- [[[ test_2d.drawImage.negativedest.html ]]] --> 1.3099 + 1.3100 +<p>Canvas test: 2d.drawImage.negativedest</p> 1.3101 +<canvas id="c117" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3102 +<script> 1.3103 + 1.3104 + 1.3105 +function test_2d_drawImage_negativedest() { 1.3106 + 1.3107 +var canvas = document.getElementById('c117'); 1.3108 +var ctx = canvas.getContext('2d'); 1.3109 + 1.3110 +var _thrown_outer = false; 1.3111 +try { 1.3112 + 1.3113 +ctx.fillStyle = '#f00'; 1.3114 +ctx.fillRect(0, 0, 100, 50); 1.3115 +ctx.drawImage(document.getElementById('ggrr-256x256_1.png'), 100, 78, 50, 50, 0, 50, 50, -50); 1.3116 +ctx.drawImage(document.getElementById('ggrr-256x256_1.png'), 100, 128, 50, -50, 100, 50, -50, -50); 1.3117 +isPixel(ctx, 1,1, 0,255,0,255, 2); 1.3118 +isPixel(ctx, 1,48, 0,255,0,255, 2); 1.3119 +isPixel(ctx, 98,1, 0,255,0,255, 2); 1.3120 +isPixel(ctx, 98,48, 0,255,0,255, 2); 1.3121 +isPixel(ctx, 48,1, 0,255,0,255, 2); 1.3122 +isPixel(ctx, 48,48, 0,255,0,255, 2); 1.3123 +isPixel(ctx, 51,1, 0,255,0,255, 2); 1.3124 +isPixel(ctx, 51,48, 0,255,0,255, 2); 1.3125 +isPixel(ctx, 25,25, 0,255,0,255, 2); 1.3126 +isPixel(ctx, 75,25, 0,255,0,255, 2); 1.3127 + 1.3128 +} catch (e) { 1.3129 + _thrown_outer = true; 1.3130 +} 1.3131 +todo(!_thrown_outer, 'should not throw exception'); 1.3132 + 1.3133 + 1.3134 +} 1.3135 +</script> 1.3136 +<img src="image_ggrr-256x256.png" id="ggrr-256x256_1.png" class="resource"> 1.3137 + 1.3138 +<!-- [[[ test_2d.drawImage.negativesource.html ]]] --> 1.3139 + 1.3140 +<p>Canvas test: 2d.drawImage.negativesource</p> 1.3141 +<canvas id="c118" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3142 +<script> 1.3143 + 1.3144 + 1.3145 +function test_2d_drawImage_negativesource() { 1.3146 + 1.3147 +var canvas = document.getElementById('c118'); 1.3148 +var ctx = canvas.getContext('2d'); 1.3149 + 1.3150 +var _thrown_outer = false; 1.3151 +try { 1.3152 + 1.3153 +ctx.fillStyle = '#f00'; 1.3154 +ctx.fillRect(0, 0, 100, 50); 1.3155 +ctx.drawImage(document.getElementById('ggrr-256x256_2.png'), 100, 78, -100, 50, 0, 0, 50, 50); 1.3156 +ctx.drawImage(document.getElementById('ggrr-256x256_2.png'), 100, 128, -100, -50, 50, 0, 50, 50); 1.3157 +isPixel(ctx, 1,1, 0,255,0,255, 2); 1.3158 +isPixel(ctx, 1,48, 0,255,0,255, 2); 1.3159 +isPixel(ctx, 98,1, 0,255,0,255, 2); 1.3160 +isPixel(ctx, 98,48, 0,255,0,255, 2); 1.3161 +isPixel(ctx, 48,1, 0,255,0,255, 2); 1.3162 +isPixel(ctx, 48,48, 0,255,0,255, 2); 1.3163 +isPixel(ctx, 51,1, 0,255,0,255, 2); 1.3164 +isPixel(ctx, 51,48, 0,255,0,255, 2); 1.3165 +isPixel(ctx, 25,25, 0,255,0,255, 2); 1.3166 +isPixel(ctx, 75,25, 0,255,0,255, 2); 1.3167 + 1.3168 +} catch (e) { 1.3169 + _thrown_outer = true; 1.3170 +} 1.3171 +todo(!_thrown_outer, 'should not throw exception'); 1.3172 + 1.3173 + 1.3174 +} 1.3175 +</script> 1.3176 +<img src="image_ggrr-256x256.png" id="ggrr-256x256_2.png" class="resource"> 1.3177 + 1.3178 +<!-- [[[ test_2d.drawImage.nonfinite.html ]]] --> 1.3179 + 1.3180 +<p>Canvas test: 2d.drawImage.nonfinite</p> 1.3181 +<!-- Testing: drawImage() with Infinity/NaN is ignored --> 1.3182 +<canvas id="c119" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3183 +<script> 1.3184 + 1.3185 + 1.3186 +function test_2d_drawImage_nonfinite() { 1.3187 + 1.3188 +var canvas = document.getElementById('c119'); 1.3189 +var ctx = canvas.getContext('2d'); 1.3190 + 1.3191 +var _thrown_outer = false; 1.3192 + 1.3193 +try { 1.3194 + 1.3195 +ctx.fillStyle = '#0f0'; 1.3196 +ctx.fillRect(0, 0, 100, 50); 1.3197 +var red = document.getElementById('red_10.png'); 1.3198 +ctx.drawImage(red, Infinity, 0); 1.3199 +ctx.drawImage(red, -Infinity, 0); 1.3200 +ctx.drawImage(red, NaN, 0); 1.3201 +ctx.drawImage(red, 0, Infinity); 1.3202 +ctx.drawImage(red, 0, -Infinity); 1.3203 +ctx.drawImage(red, 0, NaN); 1.3204 +ctx.drawImage(red, Infinity, Infinity); 1.3205 +ctx.drawImage(red, Infinity, 0, 100, 50); 1.3206 +ctx.drawImage(red, -Infinity, 0, 100, 50); 1.3207 +ctx.drawImage(red, NaN, 0, 100, 50); 1.3208 +ctx.drawImage(red, 0, Infinity, 100, 50); 1.3209 +ctx.drawImage(red, 0, -Infinity, 100, 50); 1.3210 +ctx.drawImage(red, 0, NaN, 100, 50); 1.3211 +ctx.drawImage(red, 0, 0, Infinity, 50); 1.3212 +ctx.drawImage(red, 0, 0, -Infinity, 50); 1.3213 +ctx.drawImage(red, 0, 0, NaN, 50); 1.3214 +ctx.drawImage(red, 0, 0, 100, Infinity); 1.3215 +ctx.drawImage(red, 0, 0, 100, -Infinity); 1.3216 +ctx.drawImage(red, 0, 0, 100, NaN); 1.3217 +ctx.drawImage(red, Infinity, Infinity, 100, 50); 1.3218 +ctx.drawImage(red, Infinity, Infinity, Infinity, 50); 1.3219 +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity); 1.3220 +ctx.drawImage(red, Infinity, Infinity, 100, Infinity); 1.3221 +ctx.drawImage(red, Infinity, 0, Infinity, 50); 1.3222 +ctx.drawImage(red, Infinity, 0, Infinity, Infinity); 1.3223 +ctx.drawImage(red, Infinity, 0, 100, Infinity); 1.3224 +ctx.drawImage(red, 0, Infinity, Infinity, 50); 1.3225 +ctx.drawImage(red, 0, Infinity, Infinity, Infinity); 1.3226 +ctx.drawImage(red, 0, Infinity, 100, Infinity); 1.3227 +ctx.drawImage(red, 0, 0, Infinity, Infinity); 1.3228 +ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, 100, 50); 1.3229 +ctx.drawImage(red, -Infinity, 0, 100, 50, 0, 0, 100, 50); 1.3230 +ctx.drawImage(red, NaN, 0, 100, 50, 0, 0, 100, 50); 1.3231 +ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, 100, 50); 1.3232 +ctx.drawImage(red, 0, -Infinity, 100, 50, 0, 0, 100, 50); 1.3233 +ctx.drawImage(red, 0, NaN, 100, 50, 0, 0, 100, 50); 1.3234 +ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, 100, 50); 1.3235 +ctx.drawImage(red, 0, 0, -Infinity, 50, 0, 0, 100, 50); 1.3236 +ctx.drawImage(red, 0, 0, NaN, 50, 0, 0, 100, 50); 1.3237 +ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, 100, 50); 1.3238 +ctx.drawImage(red, 0, 0, 100, -Infinity, 0, 0, 100, 50); 1.3239 +ctx.drawImage(red, 0, 0, 100, NaN, 0, 0, 100, 50); 1.3240 +ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, 100, 50); 1.3241 +ctx.drawImage(red, 0, 0, 100, 50, -Infinity, 0, 100, 50); 1.3242 +ctx.drawImage(red, 0, 0, 100, 50, NaN, 0, 100, 50); 1.3243 +ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, 100, 50); 1.3244 +ctx.drawImage(red, 0, 0, 100, 50, 0, -Infinity, 100, 50); 1.3245 +ctx.drawImage(red, 0, 0, 100, 50, 0, NaN, 100, 50); 1.3246 +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, Infinity, 50); 1.3247 +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, -Infinity, 50); 1.3248 +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, NaN, 50); 1.3249 +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, Infinity); 1.3250 +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, -Infinity); 1.3251 +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, NaN); 1.3252 +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, 100, 50); 1.3253 +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, 100, 50); 1.3254 +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, 100, 50); 1.3255 +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, 100, 50); 1.3256 +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 100, 50); 1.3257 +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 50); 1.3258 +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); 1.3259 +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 100, Infinity); 1.3260 +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 50); 1.3261 +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity); 1.3262 +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, 100, Infinity); 1.3263 +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 100, 50); 1.3264 +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity, 50); 1.3265 +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity, Infinity); 1.3266 +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 100, Infinity); 1.3267 +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, Infinity, 50); 1.3268 +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, Infinity, Infinity); 1.3269 +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, 100, Infinity); 1.3270 +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, 100, 50); 1.3271 +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, 100, 50); 1.3272 +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, Infinity, 50); 1.3273 +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, Infinity, Infinity); 1.3274 +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, 100, Infinity); 1.3275 +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, Infinity, 50); 1.3276 +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, Infinity, Infinity); 1.3277 +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, 100, Infinity); 1.3278 +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, 100, 50); 1.3279 +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, Infinity, 50); 1.3280 +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, Infinity, Infinity); 1.3281 +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, 100, Infinity); 1.3282 +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, Infinity, 50); 1.3283 +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, Infinity, Infinity); 1.3284 +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, 100, Infinity); 1.3285 +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, 100, 50); 1.3286 +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, 100, 50); 1.3287 +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, 100, 50); 1.3288 +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, Infinity, 50); 1.3289 +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, Infinity, Infinity); 1.3290 +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, 100, Infinity); 1.3291 +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, Infinity, 50); 1.3292 +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, Infinity, Infinity); 1.3293 +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, 100, Infinity); 1.3294 +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, 100, 50); 1.3295 +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, Infinity, 50); 1.3296 +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, Infinity, Infinity); 1.3297 +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, 100, Infinity); 1.3298 +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, Infinity, 50); 1.3299 +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, Infinity, Infinity); 1.3300 +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, 100, Infinity); 1.3301 +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, 100, 50); 1.3302 +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, 100, 50); 1.3303 +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, Infinity, 50); 1.3304 +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, Infinity, Infinity); 1.3305 +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, 100, Infinity); 1.3306 +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, Infinity, 50); 1.3307 +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, Infinity, Infinity); 1.3308 +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, 100, Infinity); 1.3309 +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, 100, 50); 1.3310 +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, Infinity, 50); 1.3311 +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, Infinity, Infinity); 1.3312 +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, 100, Infinity); 1.3313 +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, Infinity, 50); 1.3314 +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, Infinity, Infinity); 1.3315 +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, 100, Infinity); 1.3316 +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, 100, 50); 1.3317 +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, 100, 50); 1.3318 +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, 100, 50); 1.3319 +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, 100, 50); 1.3320 +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 50); 1.3321 +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); 1.3322 +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, 100, Infinity); 1.3323 +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, Infinity, 50); 1.3324 +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity); 1.3325 +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, 100, Infinity); 1.3326 +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, 100, 50); 1.3327 +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, Infinity, 50); 1.3328 +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, Infinity, Infinity); 1.3329 +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, 100, Infinity); 1.3330 +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, Infinity, 50); 1.3331 +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, Infinity, Infinity); 1.3332 +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, 100, Infinity); 1.3333 +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, 100, 50); 1.3334 +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, 100, 50); 1.3335 +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, Infinity, 50); 1.3336 +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, Infinity, Infinity); 1.3337 +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, 100, Infinity); 1.3338 +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, Infinity, 50); 1.3339 +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, Infinity, Infinity); 1.3340 +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, 100, Infinity); 1.3341 +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, 100, 50); 1.3342 +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, Infinity, 50); 1.3343 +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, Infinity, Infinity); 1.3344 +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, 100, Infinity); 1.3345 +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, Infinity, 50); 1.3346 +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, Infinity, Infinity); 1.3347 +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, 100, Infinity); 1.3348 +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, 100, 50); 1.3349 +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, 100, 50); 1.3350 +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, 100, 50); 1.3351 +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, Infinity, 50); 1.3352 +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, Infinity, Infinity); 1.3353 +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, 100, Infinity); 1.3354 +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, Infinity, 50); 1.3355 +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, Infinity, Infinity); 1.3356 +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, 100, Infinity); 1.3357 +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, 100, 50); 1.3358 +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, Infinity, 50); 1.3359 +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, Infinity, Infinity); 1.3360 +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, 100, Infinity); 1.3361 +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, Infinity, 50); 1.3362 +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, Infinity, Infinity); 1.3363 +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, 100, Infinity); 1.3364 +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, 100, 50); 1.3365 +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, 100, 50); 1.3366 +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, Infinity, 50); 1.3367 +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, Infinity, Infinity); 1.3368 +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, 100, Infinity); 1.3369 +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, Infinity, 50); 1.3370 +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, Infinity, Infinity); 1.3371 +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, 100, Infinity); 1.3372 +ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, 100, 50); 1.3373 +ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, Infinity, 50); 1.3374 +ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, Infinity, Infinity); 1.3375 +ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, 100, Infinity); 1.3376 +ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, Infinity, 50); 1.3377 +ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, Infinity, Infinity); 1.3378 +ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, 100, Infinity); 1.3379 +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, 100, 50); 1.3380 +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, 100, 50); 1.3381 +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, 100, 50); 1.3382 +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 100, 50); 1.3383 +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 50); 1.3384 +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); 1.3385 +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 100, Infinity); 1.3386 +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 50); 1.3387 +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity); 1.3388 +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, 100, Infinity); 1.3389 +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, 100, 50); 1.3390 +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity, 50); 1.3391 +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity, Infinity); 1.3392 +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, 100, Infinity); 1.3393 +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, Infinity, 50); 1.3394 +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, Infinity, Infinity); 1.3395 +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, 100, Infinity); 1.3396 +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, 100, 50); 1.3397 +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, 100, 50); 1.3398 +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, Infinity, 50); 1.3399 +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, Infinity, Infinity); 1.3400 +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, 100, Infinity); 1.3401 +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, Infinity, 50); 1.3402 +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, Infinity, Infinity); 1.3403 +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, 100, Infinity); 1.3404 +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, 100, 50); 1.3405 +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, Infinity, 50); 1.3406 +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, Infinity, Infinity); 1.3407 +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, 100, Infinity); 1.3408 +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, Infinity, 50); 1.3409 +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, Infinity, Infinity); 1.3410 +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, 100, Infinity); 1.3411 +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, 100, 50); 1.3412 +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, 100, 50); 1.3413 +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, 100, 50); 1.3414 +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, Infinity, 50); 1.3415 +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, Infinity, Infinity); 1.3416 +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, 100, Infinity); 1.3417 +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, Infinity, 50); 1.3418 +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, Infinity, Infinity); 1.3419 +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, 100, Infinity); 1.3420 +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, 100, 50); 1.3421 +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, Infinity, 50); 1.3422 +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, Infinity, Infinity); 1.3423 +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, 100, Infinity); 1.3424 +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, Infinity, 50); 1.3425 +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, Infinity, Infinity); 1.3426 +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, 100, Infinity); 1.3427 +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, 100, 50); 1.3428 +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, 100, 50); 1.3429 +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, Infinity, 50); 1.3430 +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, Infinity, Infinity); 1.3431 +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, 100, Infinity); 1.3432 +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, Infinity, 50); 1.3433 +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, Infinity, Infinity); 1.3434 +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, 100, Infinity); 1.3435 +ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, 100, 50); 1.3436 +ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, Infinity, 50); 1.3437 +ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, Infinity, Infinity); 1.3438 +ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, 100, Infinity); 1.3439 +ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, Infinity, 50); 1.3440 +ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, Infinity, Infinity); 1.3441 +ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, 100, Infinity); 1.3442 +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, 100, 50); 1.3443 +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, 100, 50); 1.3444 +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, 100, 50); 1.3445 +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 50); 1.3446 +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); 1.3447 +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, 100, Infinity); 1.3448 +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, Infinity, 50); 1.3449 +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity); 1.3450 +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, 100, Infinity); 1.3451 +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, 100, 50); 1.3452 +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, Infinity, 50); 1.3453 +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, Infinity, Infinity); 1.3454 +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, 100, Infinity); 1.3455 +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, Infinity, 50); 1.3456 +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, Infinity, Infinity); 1.3457 +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, 100, Infinity); 1.3458 +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, 100, 50); 1.3459 +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, 100, 50); 1.3460 +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, Infinity, 50); 1.3461 +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, Infinity, Infinity); 1.3462 +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, 100, Infinity); 1.3463 +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, Infinity, 50); 1.3464 +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, Infinity, Infinity); 1.3465 +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, 100, Infinity); 1.3466 +ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, 100, 50); 1.3467 +ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, Infinity, 50); 1.3468 +ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, Infinity, Infinity); 1.3469 +ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, 100, Infinity); 1.3470 +ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, Infinity, 50); 1.3471 +ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, Infinity, Infinity); 1.3472 +ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, 100, Infinity); 1.3473 +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, 100, 50); 1.3474 +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, 100, 50); 1.3475 +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, Infinity, 50); 1.3476 +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, Infinity, Infinity); 1.3477 +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, 100, Infinity); 1.3478 +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, Infinity, 50); 1.3479 +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, Infinity, Infinity); 1.3480 +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, 100, Infinity); 1.3481 +ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, 100, 50); 1.3482 +ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, Infinity, 50); 1.3483 +ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, Infinity, Infinity); 1.3484 +ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, 100, Infinity); 1.3485 +ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, Infinity, 50); 1.3486 +ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, Infinity, Infinity); 1.3487 +ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, 100, Infinity); 1.3488 +ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, 100, 50); 1.3489 +ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, Infinity, 50); 1.3490 +ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, Infinity, Infinity); 1.3491 +ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, 100, Infinity); 1.3492 +ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, Infinity, 50); 1.3493 +ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, Infinity, Infinity); 1.3494 +ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, 100, Infinity); 1.3495 +ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, Infinity, 50); 1.3496 +ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, Infinity, Infinity); 1.3497 +ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, 100, Infinity); 1.3498 +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, Infinity, Infinity); 1.3499 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.3500 + 1.3501 +} catch (e) { 1.3502 + _thrown_outer = true; 1.3503 +} 1.3504 +ok(!_thrown_outer, 'should not throw exception'); 1.3505 + 1.3506 + 1.3507 +} 1.3508 +</script> 1.3509 +<img src="image_red.png" id="red_10.png" class="resource"> 1.3510 + 1.3511 +<!-- [[[ test_2d.drawImage.nowrap.html ]]] --> 1.3512 + 1.3513 +<p>Canvas test: 2d.drawImage.nowrap</p> 1.3514 +<!-- Testing: Stretched images do not get pixels wrapping around the edges --> 1.3515 +<canvas id="c120" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3516 +<script> 1.3517 + 1.3518 + 1.3519 +function test_2d_drawImage_nowrap() { 1.3520 + 1.3521 +var canvas = document.getElementById('c120'); 1.3522 +var ctx = canvas.getContext('2d'); 1.3523 + 1.3524 +ctx.fillStyle = '#0f0'; 1.3525 +ctx.fillRect(0, 0, 100, 50); 1.3526 +ctx.drawImage(document.getElementById('redtransparent_1.png'), -1950, 0, 2000, 50); 1.3527 +isPixel(ctx, 45,25, 0,255,0,255, 2); 1.3528 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.3529 +isPixel(ctx, 55,25, 0,255,0,255, 2); 1.3530 + 1.3531 + 1.3532 +} 1.3533 +</script> 1.3534 +<img src="image_redtransparent.png" id="redtransparent_1.png" class="resource"> 1.3535 + 1.3536 +<!-- [[[ test_2d.drawImage.null.html ]]] --> 1.3537 + 1.3538 +<p>Canvas test: 2d.drawImage.null</p> 1.3539 +<canvas id="c121" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3540 +<script> 1.3541 + 1.3542 +function test_2d_drawImage_null() { 1.3543 + 1.3544 +var canvas = document.getElementById('c121'); 1.3545 +var ctx = canvas.getContext('2d'); 1.3546 + 1.3547 +var _thrown = undefined; try { 1.3548 + ctx.drawImage(null, 0, 0); 1.3549 +} catch (e) { _thrown = e }; 1.3550 + 1.3551 +ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); 1.3552 + 1.3553 +} 1.3554 +</script> 1.3555 + 1.3556 +<!-- [[[ test_2d.drawImage.outsidesource.html ]]] --> 1.3557 + 1.3558 +<p>Canvas test: 2d.drawImage.outsidesource</p> 1.3559 +<canvas id="c122" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3560 +<script> 1.3561 + 1.3562 + 1.3563 + 1.3564 +function test_2d_drawImage_outsidesource() { 1.3565 + 1.3566 +var canvas = document.getElementById('c122'); 1.3567 +var ctx = canvas.getContext('2d'); 1.3568 + 1.3569 +var _thrown_outer = false; 1.3570 +try { 1.3571 + 1.3572 +ctx.drawImage(document.getElementById('green_7.png'), 10.5, 10.5, 89.5, 39.5, 0, 0, 100, 50); 1.3573 +ctx.drawImage(document.getElementById('green_7.png'), 5.5, 5.5, -5.5, -5.5, 0, 0, 100, 50); 1.3574 +ctx.drawImage(document.getElementById('green_7.png'), 100, 50, -5, -5, 0, 0, 100, 50); 1.3575 +var _thrown = undefined; try { 1.3576 + ctx.drawImage(document.getElementById('red_11.png'), -0.001, 0, 100, 50, 0, 0, 100, 50); 1.3577 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.3578 +var _thrown = undefined; try { 1.3579 + ctx.drawImage(document.getElementById('red_11.png'), 0, -0.001, 100, 50, 0, 0, 100, 50); 1.3580 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.3581 +var _thrown = undefined; try { 1.3582 + ctx.drawImage(document.getElementById('red_11.png'), 0, 0, 100.001, 50, 0, 0, 100, 50); 1.3583 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.3584 +var _thrown = undefined; try { 1.3585 + ctx.drawImage(document.getElementById('red_11.png'), 0, 0, 100, 50.001, 0, 0, 100, 50); 1.3586 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.3587 +var _thrown = undefined; try { 1.3588 + ctx.drawImage(document.getElementById('red_11.png'), 50, 0, 50.001, 50, 0, 0, 100, 50); 1.3589 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.3590 +var _thrown = undefined; try { 1.3591 + ctx.drawImage(document.getElementById('red_11.png'), 0, 0, -5, 5, 0, 0, 100, 50); 1.3592 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.3593 +var _thrown = undefined; try { 1.3594 + ctx.drawImage(document.getElementById('red_11.png'), 0, 0, 5, -5, 0, 0, 100, 50); 1.3595 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.3596 +var _thrown = undefined; try { 1.3597 + ctx.drawImage(document.getElementById('red_11.png'), 110, 60, -20, -20, 0, 0, 100, 50); 1.3598 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.3599 +todo_isPixel(ctx, 50,25, 0,255,0,255, 2); 1.3600 + 1.3601 +} catch (e) { 1.3602 + _thrown_outer = true; 1.3603 +} 1.3604 +todo(!_thrown_outer, 'should not throw exception'); 1.3605 + 1.3606 + 1.3607 +} 1.3608 +</script> 1.3609 +<img src="image_green.png" id="green_7.png" class="resource"> 1.3610 +<img src="image_red.png" id="red_11.png" class="resource"> 1.3611 + 1.3612 +<!-- [[[ test_2d.drawImage.path.html ]]] --> 1.3613 + 1.3614 +<p>Canvas test: 2d.drawImage.path</p> 1.3615 +<canvas id="c123" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3616 +<script> 1.3617 + 1.3618 + 1.3619 +function test_2d_drawImage_path() { 1.3620 + 1.3621 +var canvas = document.getElementById('c123'); 1.3622 +var ctx = canvas.getContext('2d'); 1.3623 + 1.3624 +ctx.fillStyle = '#0f0'; 1.3625 +ctx.rect(0, 0, 100, 50); 1.3626 +ctx.drawImage(document.getElementById('red_12.png'), 0, 0); 1.3627 +ctx.fill(); 1.3628 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.3629 + 1.3630 + 1.3631 +} 1.3632 +</script> 1.3633 +<img src="image_red.png" id="red_12.png" class="resource"> 1.3634 + 1.3635 +<!-- [[[ test_2d.drawImage.self.1.html ]]] --> 1.3636 + 1.3637 +<p>Canvas test: 2d.drawImage.self.1 - bug 433235</p> 1.3638 +<canvas id="c124" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3639 +<script> 1.3640 + 1.3641 + 1.3642 +function test_2d_drawImage_self_1() { 1.3643 + 1.3644 +var canvas = document.getElementById('c124'); 1.3645 +var ctx = canvas.getContext('2d'); 1.3646 + 1.3647 +ctx.fillStyle = '#0f0'; 1.3648 +ctx.fillRect(0, 0, 50, 50); 1.3649 +ctx.fillStyle = '#f00'; 1.3650 +ctx.fillRect(50, 0, 50, 50); 1.3651 +ctx.drawImage(canvas, 50, 0); 1.3652 + 1.3653 +isPixel(ctx, 0,0, 0,255,0,255, 2); 1.3654 +isPixel(ctx, 99,0, 0,255,0,255, 2); 1.3655 +isPixel(ctx, 0,49, 0,255,0,255, 2); 1.3656 +isPixel(ctx, 99,49, 0,255,0,255, 2); 1.3657 + 1.3658 + 1.3659 +} 1.3660 +</script> 1.3661 + 1.3662 +<!-- [[[ test_2d.drawImage.self.2.html ]]] --> 1.3663 + 1.3664 +<p>Canvas test: 2d.drawImage.self.2 - bug 433235</p> 1.3665 +<canvas id="c125" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3666 +<script> 1.3667 + 1.3668 + 1.3669 +function test_2d_drawImage_self_2() { 1.3670 + 1.3671 +var canvas = document.getElementById('c125'); 1.3672 +var ctx = canvas.getContext('2d'); 1.3673 + 1.3674 +ctx.fillStyle = '#0f0'; 1.3675 +ctx.fillRect(0, 1, 100, 49); 1.3676 +ctx.fillStyle = '#f00'; 1.3677 +ctx.fillRect(0, 0, 100, 1); 1.3678 +ctx.drawImage(canvas, 0, 1); 1.3679 +ctx.fillStyle = '#0f0'; 1.3680 +ctx.fillRect(0, 0, 100, 2); 1.3681 + 1.3682 +isPixel(ctx, 0,0, 0,255,0,255, 2); 1.3683 +isPixel(ctx, 99,0, 0,255,0,255, 2); 1.3684 +isPixel(ctx, 0,49, 0,255,0,255, 2); 1.3685 +isPixel(ctx, 99,49, 0,255,0,255, 2); 1.3686 + 1.3687 + 1.3688 +} 1.3689 +</script> 1.3690 + 1.3691 +<!-- [[[ test_2d.drawImage.transform.html ]]] --> 1.3692 + 1.3693 +<p>Canvas test: 2d.drawImage.transform</p> 1.3694 +<canvas id="c126" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3695 +<script> 1.3696 + 1.3697 + 1.3698 +function test_2d_drawImage_transform() { 1.3699 + 1.3700 +var canvas = document.getElementById('c126'); 1.3701 +var ctx = canvas.getContext('2d'); 1.3702 + 1.3703 +ctx.fillStyle = '#0f0'; 1.3704 +ctx.fillRect(0, 0, 100, 50); 1.3705 +ctx.translate(100, 0); 1.3706 +ctx.drawImage(document.getElementById('red_13.png'), 0, 0); 1.3707 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.3708 + 1.3709 + 1.3710 +} 1.3711 +</script> 1.3712 +<img src="image_red.png" id="red_13.png" class="resource"> 1.3713 + 1.3714 +<!-- [[[ test_2d.drawImage.wrongtype.html ]]] --> 1.3715 + 1.3716 +<p>Canvas test: 2d.drawImage.wrongtype</p> 1.3717 +<canvas id="c127" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3718 +<script> 1.3719 + 1.3720 +function test_2d_drawImage_wrongtype() { 1.3721 + 1.3722 +var canvas = document.getElementById('c127'); 1.3723 +var ctx = canvas.getContext('2d'); 1.3724 + 1.3725 +var _thrown = undefined; try { 1.3726 + ctx.drawImage(undefined, 0, 0); 1.3727 +} catch (e) { _thrown = e }; 1.3728 +ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); 1.3729 + 1.3730 +var _thrown = undefined; try { 1.3731 + ctx.drawImage(0, 0, 0); 1.3732 +} catch (e) { _thrown = e }; 1.3733 +ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); 1.3734 + 1.3735 +var _thrown = undefined; try { 1.3736 + ctx.drawImage("", 0, 0); 1.3737 +} catch (e) { _thrown = e }; 1.3738 +ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); 1.3739 + 1.3740 +var _thrown = undefined; try { 1.3741 + ctx.drawImage(document.createElement('p'), 0, 0); 1.3742 +} catch (e) { _thrown = e }; 1.3743 +ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); 1.3744 + 1.3745 +} 1.3746 +</script> 1.3747 + 1.3748 +<!-- [[[ test_2d.drawImage.zerosource.html ]]] --> 1.3749 + 1.3750 +<p>Canvas test: 2d.drawImage.zerosource</p> 1.3751 +<!-- Testing: drawImage with zero-sized source rectangle throws INDEX_SIZE_ERR --> 1.3752 +<canvas id="c128" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3753 +<script> 1.3754 + 1.3755 + 1.3756 +function test_2d_drawImage_zerosource() { 1.3757 + 1.3758 +var canvas = document.getElementById('c128'); 1.3759 +var ctx = canvas.getContext('2d'); 1.3760 + 1.3761 +ctx.fillStyle = '#0f0'; 1.3762 +ctx.fillRect(0, 0, 100, 50); 1.3763 +var _thrown = undefined; try { 1.3764 + ctx.drawImage(document.getElementById('red_14.png'), 10, 10, 0, 1, 0, 0, 100, 50); 1.3765 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.3766 +var _thrown = undefined; try { 1.3767 + ctx.drawImage(document.getElementById('red_14.png'), 10, 10, 1, 0, 0, 0, 100, 50); 1.3768 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.3769 +var _thrown = undefined; try { 1.3770 + ctx.drawImage(document.getElementById('red_14.png'), 10, 10, 0, 0, 0, 0, 100, 50); 1.3771 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.3772 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.3773 + 1.3774 + 1.3775 +} 1.3776 +</script> 1.3777 +<img src="image_red.png" id="red_14.png" class="resource"> 1.3778 + 1.3779 +<!-- [[[ test_2d.fillRect.basic.html ]]] --> 1.3780 + 1.3781 +<p>Canvas test: 2d.fillRect.basic</p> 1.3782 +<canvas id="c129" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3783 +<script> 1.3784 + 1.3785 + 1.3786 +function test_2d_fillRect_basic() { 1.3787 + 1.3788 +var canvas = document.getElementById('c129'); 1.3789 +var ctx = canvas.getContext('2d'); 1.3790 + 1.3791 +ctx.fillStyle = '#0f0'; 1.3792 +ctx.fillRect(0, 0, 100, 50); 1.3793 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.3794 + 1.3795 + 1.3796 +} 1.3797 +</script> 1.3798 + 1.3799 +<!-- [[[ test_2d.fillRect.clip.html ]]] --> 1.3800 + 1.3801 +<p>Canvas test: 2d.fillRect.clip</p> 1.3802 +<canvas id="c130" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3803 +<script> 1.3804 + 1.3805 + 1.3806 +function test_2d_fillRect_clip() { 1.3807 + 1.3808 +var canvas = document.getElementById('c130'); 1.3809 +var ctx = canvas.getContext('2d'); 1.3810 + 1.3811 +ctx.fillStyle = '#0f0'; 1.3812 +ctx.fillRect(0, 0, 100, 50); 1.3813 + 1.3814 +ctx.beginPath(); 1.3815 +ctx.rect(0, 0, 16, 16); 1.3816 +ctx.clip(); 1.3817 + 1.3818 +ctx.fillStyle = '#f00'; 1.3819 +ctx.fillRect(0, 0, 100, 50); 1.3820 + 1.3821 +ctx.fillStyle = '#0f0'; 1.3822 +ctx.fillRect(0, 0, 16, 16); 1.3823 + 1.3824 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.3825 + 1.3826 + 1.3827 +} 1.3828 +</script> 1.3829 + 1.3830 +<!-- [[[ test_2d.fillRect.negative.html ]]] --> 1.3831 + 1.3832 +<p>Canvas test: 2d.fillRect.negative</p> 1.3833 +<canvas id="c131" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3834 +<script> 1.3835 + 1.3836 + 1.3837 +function test_2d_fillRect_negative() { 1.3838 + 1.3839 +var canvas = document.getElementById('c131'); 1.3840 +var ctx = canvas.getContext('2d'); 1.3841 + 1.3842 +ctx.fillStyle = '#f00'; 1.3843 +ctx.fillRect(0, 0, 100, 50); 1.3844 +ctx.fillStyle = '#0f0'; 1.3845 +ctx.fillRect(0, 0, 50, 25); 1.3846 +ctx.fillRect(100, 0, -50, 25); 1.3847 +ctx.fillRect(0, 50, 50, -25); 1.3848 +ctx.fillRect(100, 50, -50, -25); 1.3849 +isPixel(ctx, 25,12, 0,255,0,255, 0); 1.3850 +isPixel(ctx, 75,12, 0,255,0,255, 0); 1.3851 +isPixel(ctx, 25,37, 0,255,0,255, 0); 1.3852 +isPixel(ctx, 75,37, 0,255,0,255, 0); 1.3853 + 1.3854 + 1.3855 +} 1.3856 +</script> 1.3857 + 1.3858 +<!-- [[[ test_2d.fillRect.nonfinite.html ]]] --> 1.3859 + 1.3860 +<p>Canvas test: 2d.fillRect.nonfinite</p> 1.3861 +<!-- Testing: fillRect() with Infinity/NaN is ignored --> 1.3862 +<canvas id="c132" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3863 +<script> 1.3864 + 1.3865 + 1.3866 +function test_2d_fillRect_nonfinite() { 1.3867 + 1.3868 +var canvas = document.getElementById('c132'); 1.3869 +var ctx = canvas.getContext('2d'); 1.3870 + 1.3871 +var _thrown_outer = false; 1.3872 +try { 1.3873 + 1.3874 +ctx.fillStyle = '#0f0'; 1.3875 +ctx.fillRect(0, 0, 100, 50); 1.3876 + 1.3877 +ctx.fillStyle = '#f00'; 1.3878 +ctx.fillRect(Infinity, 0, 100, 50); 1.3879 +ctx.fillRect(-Infinity, 0, 100, 50); 1.3880 +ctx.fillRect(NaN, 0, 100, 50); 1.3881 +ctx.fillRect(0, Infinity, 100, 50); 1.3882 +ctx.fillRect(0, -Infinity, 100, 50); 1.3883 +ctx.fillRect(0, NaN, 100, 50); 1.3884 +ctx.fillRect(0, 0, Infinity, 50); 1.3885 +ctx.fillRect(0, 0, -Infinity, 50); 1.3886 +ctx.fillRect(0, 0, NaN, 50); 1.3887 +ctx.fillRect(0, 0, 100, Infinity); 1.3888 +ctx.fillRect(0, 0, 100, -Infinity); 1.3889 +ctx.fillRect(0, 0, 100, NaN); 1.3890 +ctx.fillRect(Infinity, Infinity, 100, 50); 1.3891 +ctx.fillRect(Infinity, Infinity, Infinity, 50); 1.3892 +ctx.fillRect(Infinity, Infinity, Infinity, Infinity); 1.3893 +ctx.fillRect(Infinity, Infinity, 100, Infinity); 1.3894 +ctx.fillRect(Infinity, 0, Infinity, 50); 1.3895 +ctx.fillRect(Infinity, 0, Infinity, Infinity); 1.3896 +ctx.fillRect(Infinity, 0, 100, Infinity); 1.3897 +ctx.fillRect(0, Infinity, Infinity, 50); 1.3898 +ctx.fillRect(0, Infinity, Infinity, Infinity); 1.3899 +ctx.fillRect(0, Infinity, 100, Infinity); 1.3900 +ctx.fillRect(0, 0, Infinity, Infinity); 1.3901 + 1.3902 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.3903 + 1.3904 +} catch (e) { 1.3905 + _thrown_outer = true; 1.3906 +} 1.3907 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.3908 + 1.3909 + 1.3910 +} 1.3911 +</script> 1.3912 + 1.3913 +<!-- [[[ test_2d.fillRect.path.html ]]] --> 1.3914 + 1.3915 +<p>Canvas test: 2d.fillRect.path</p> 1.3916 +<canvas id="c133" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3917 +<script> 1.3918 + 1.3919 + 1.3920 +function test_2d_fillRect_path() { 1.3921 + 1.3922 +var canvas = document.getElementById('c133'); 1.3923 +var ctx = canvas.getContext('2d'); 1.3924 + 1.3925 +ctx.beginPath(); 1.3926 +ctx.rect(0, 0, 100, 50); 1.3927 +ctx.fillStyle = '#f00'; 1.3928 +ctx.fillRect(0, 0, 16, 16); 1.3929 +ctx.fillStyle = '#0f0'; 1.3930 +ctx.fill(); 1.3931 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.3932 + 1.3933 + 1.3934 +} 1.3935 +</script> 1.3936 + 1.3937 +<!-- [[[ test_2d.fillRect.shadow.html ]]] --> 1.3938 + 1.3939 +<p>Canvas test: 2d.fillRect.shadow</p> 1.3940 +<canvas id="c134" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3941 +<script> 1.3942 + 1.3943 + 1.3944 +function test_2d_fillRect_shadow() { 1.3945 + 1.3946 +var canvas = document.getElementById('c134'); 1.3947 +var ctx = canvas.getContext('2d'); 1.3948 + 1.3949 +ctx.fillStyle = '#0f0'; 1.3950 +ctx.fillRect(0, 0, 100, 50); 1.3951 + 1.3952 +ctx.fillStyle = '#f00'; 1.3953 +ctx.shadowBlur = 0; 1.3954 +ctx.shadowOffsetX = 0; 1.3955 +ctx.shadowOffsetY = 50; 1.3956 + 1.3957 +// Shadows are optional, so just test that if they apply to fill() then they apply to fillRect() too 1.3958 +ctx.beginPath(); 1.3959 +ctx.rect(0, -50, 100, 50); 1.3960 +ctx.shadowColor = '#f00'; 1.3961 +ctx.fill(); 1.3962 + 1.3963 +ctx.shadowColor = '#0f0'; 1.3964 +ctx.fillRect(0, -50, 100, 50); 1.3965 + 1.3966 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.3967 + 1.3968 + 1.3969 +} 1.3970 +</script> 1.3971 + 1.3972 +<!-- [[[ test_2d.fillRect.transform.html ]]] --> 1.3973 + 1.3974 +<p>Canvas test: 2d.fillRect.transform</p> 1.3975 +<canvas id="c135" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3976 +<script> 1.3977 + 1.3978 + 1.3979 +function test_2d_fillRect_transform() { 1.3980 + 1.3981 +var canvas = document.getElementById('c135'); 1.3982 +var ctx = canvas.getContext('2d'); 1.3983 + 1.3984 +ctx.scale(10, 10); 1.3985 +ctx.translate(0, 5); 1.3986 +ctx.fillStyle = '#0f0'; 1.3987 +ctx.fillRect(0, -5, 10, 5); 1.3988 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.3989 + 1.3990 + 1.3991 +} 1.3992 +</script> 1.3993 + 1.3994 +<!-- [[[ test_2d.fillRect.zero.html ]]] --> 1.3995 + 1.3996 +<p>Canvas test: 2d.fillRect.zero</p> 1.3997 +<canvas id="c136" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.3998 +<script> 1.3999 + 1.4000 + 1.4001 +function test_2d_fillRect_zero() { 1.4002 + 1.4003 +var canvas = document.getElementById('c136'); 1.4004 +var ctx = canvas.getContext('2d'); 1.4005 + 1.4006 +ctx.fillStyle = '#0f0'; 1.4007 +ctx.fillRect(0, 0, 100, 50); 1.4008 +ctx.fillStyle = '#f00'; 1.4009 +ctx.fillRect(0, 0, 100, 0); 1.4010 +ctx.fillRect(0, 0, 0, 50); 1.4011 +ctx.fillRect(0, 0, 0, 0); 1.4012 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4013 + 1.4014 + 1.4015 +} 1.4016 +</script> 1.4017 + 1.4018 +<!-- [[[ test_2d.fillStyle.default.html ]]] --> 1.4019 + 1.4020 +<p>Canvas test: 2d.fillStyle.default</p> 1.4021 +<canvas id="c137" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4022 +<script> 1.4023 + 1.4024 +function test_2d_fillStyle_default() { 1.4025 + 1.4026 +var canvas = document.getElementById('c137'); 1.4027 +var ctx = canvas.getContext('2d'); 1.4028 + 1.4029 +ok(ctx.fillStyle == '#000000', "ctx.fillStyle == '#000000'"); 1.4030 + 1.4031 + 1.4032 +} 1.4033 +</script> 1.4034 + 1.4035 +<!-- [[[ test_2d.fillStyle.get.semitransparent.html ]]] --> 1.4036 + 1.4037 +<p>Canvas test: 2d.fillStyle.get.semitransparent</p> 1.4038 +<canvas id="c138" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4039 +<script> 1.4040 + 1.4041 +function test_2d_fillStyle_get_semitransparent() { 1.4042 + 1.4043 +var canvas = document.getElementById('c138'); 1.4044 +var ctx = canvas.getContext('2d'); 1.4045 + 1.4046 +ctx.fillStyle = 'rgba(255,255,255,0.45)'; 1.4047 +ok(/^rgba\(255, 255, 255, 0\.4\d+\)$/.test(ctx.fillStyle), "ctx.fillStyle =~ /^rgba\\(255, 255, 255, 0\\.4\\d+\\)$/"); 1.4048 + 1.4049 + 1.4050 +} 1.4051 +</script> 1.4052 + 1.4053 +<!-- [[[ test_2d.fillStyle.get.solid.html ]]] --> 1.4054 + 1.4055 +<p>Canvas test: 2d.fillStyle.get.solid</p> 1.4056 +<canvas id="c139" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4057 +<script> 1.4058 + 1.4059 +function test_2d_fillStyle_get_solid() { 1.4060 + 1.4061 +var canvas = document.getElementById('c139'); 1.4062 +var ctx = canvas.getContext('2d'); 1.4063 + 1.4064 +ctx.fillStyle = '#fa0'; 1.4065 +ok(ctx.fillStyle === '#ffaa00', "ctx.fillStyle === '#ffaa00'"); 1.4066 + 1.4067 + 1.4068 +} 1.4069 +</script> 1.4070 + 1.4071 +<!-- [[[ test_2d.fillStyle.get.transparent.html ]]] --> 1.4072 + 1.4073 +<p>Canvas test: 2d.fillStyle.get.transparent</p> 1.4074 +<canvas id="c140" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4075 +<script> 1.4076 + 1.4077 +function test_2d_fillStyle_get_transparent() { 1.4078 + 1.4079 +var canvas = document.getElementById('c140'); 1.4080 +var ctx = canvas.getContext('2d'); 1.4081 + 1.4082 +ctx.fillStyle = 'rgba(0,0,0,0)'; 1.4083 +is(ctx.fillStyle, 'rgba(0, 0, 0, 0)', "ctx.fillStyle should be what we set it to"); 1.4084 + 1.4085 + 1.4086 +} 1.4087 +</script> 1.4088 + 1.4089 +<!-- [[[ test_2d.fillStyle.invalidstring.html ]]] --> 1.4090 + 1.4091 +<p>Canvas test: 2d.fillStyle.invalidstring</p> 1.4092 +<canvas id="c141" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4093 +<script> 1.4094 + 1.4095 + 1.4096 +function test_2d_fillStyle_invalidstring() { 1.4097 + 1.4098 +var canvas = document.getElementById('c141'); 1.4099 +var ctx = canvas.getContext('2d'); 1.4100 + 1.4101 +ctx.fillStyle = '#f00'; 1.4102 +ctx.fillRect(0, 0, 100, 50); 1.4103 +ctx.fillStyle = '#0f0'; 1.4104 +ctx.fillStyle = 'invalid'; 1.4105 +ctx.fillRect(0, 0, 100, 50); 1.4106 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4107 + 1.4108 + 1.4109 +} 1.4110 +</script> 1.4111 + 1.4112 +<!-- [[[ test_2d.fillStyle.invalidtype.html ]]] --> 1.4113 + 1.4114 +<p>Canvas test: 2d.fillStyle.invalidtype</p> 1.4115 +<canvas id="c142" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4116 +<script> 1.4117 + 1.4118 + 1.4119 +function test_2d_fillStyle_invalidtype() { 1.4120 + 1.4121 +var canvas = document.getElementById('c142'); 1.4122 +var ctx = canvas.getContext('2d'); 1.4123 + 1.4124 +ctx.fillStyle = '#f00'; 1.4125 +ctx.fillRect(0, 0, 100, 50); 1.4126 +ctx.fillStyle = '#0f0'; 1.4127 +ctx.fillStyle = null; 1.4128 +ctx.fillRect(0, 0, 100, 50); 1.4129 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4130 + 1.4131 + 1.4132 +} 1.4133 +</script> 1.4134 + 1.4135 +<!-- [[[ test_2d.fillStyle.parse.current.basic.html ]]] --> 1.4136 + 1.4137 +<p>Canvas test: 2d.fillStyle.parse.current.basic</p> 1.4138 +<!-- Testing: currentColor is computed from the canvas element --> 1.4139 +<canvas id="c143" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4140 +<script> 1.4141 + 1.4142 + 1.4143 + 1.4144 +function test_2d_fillStyle_parse_current_basic() { 1.4145 + 1.4146 +var canvas = document.getElementById('c143'); 1.4147 +var ctx = canvas.getContext('2d'); 1.4148 + 1.4149 +canvas.setAttribute('style', 'color: #0f0'); 1.4150 +ctx.fillStyle = '#f00'; 1.4151 +ctx.fillStyle = 'currentColor'; 1.4152 +ctx.fillRect(0, 0, 100, 50); 1.4153 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4154 + 1.4155 + 1.4156 +} 1.4157 +</script> 1.4158 + 1.4159 +<!-- [[[ test_2d.fillStyle.parse.current.changed.html ]]] --> 1.4160 + 1.4161 +<p>Canvas test: 2d.fillStyle.parse.current.changed</p> 1.4162 +<!-- Testing: currentColor is computed when the attribute is set, not when it is painted --> 1.4163 +<canvas id="c144" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4164 +<script> 1.4165 + 1.4166 + 1.4167 + 1.4168 +function test_2d_fillStyle_parse_current_changed() { 1.4169 + 1.4170 +var canvas = document.getElementById('c144'); 1.4171 +var ctx = canvas.getContext('2d'); 1.4172 + 1.4173 +canvas.setAttribute('style', 'color: #0f0'); 1.4174 +ctx.fillStyle = '#f00'; 1.4175 +ctx.fillStyle = 'currentColor'; 1.4176 +canvas.setAttribute('style', 'color: #f00'); 1.4177 +ctx.fillRect(0, 0, 100, 50); 1.4178 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4179 + 1.4180 + 1.4181 +} 1.4182 +</script> 1.4183 + 1.4184 +<!-- [[[ test_2d.fillStyle.parse.current.removed.html ]]] --> 1.4185 + 1.4186 +<p>Canvas test: 2d.fillStyle.parse.current.removed</p> 1.4187 +<!-- Testing: currentColor is solid black when the canvas element is not in a document --> 1.4188 +<canvas id="c145" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4189 +<script> 1.4190 + 1.4191 + 1.4192 + 1.4193 +function test_2d_fillStyle_parse_current_removed() { 1.4194 + 1.4195 +var canvas = document.getElementById('c145'); 1.4196 +var ctx = canvas.getContext('2d'); 1.4197 + 1.4198 +// Try not to let it undetectably incorrectly pick up opaque-black 1.4199 +// from other parts of the document: 1.4200 +document.body.parentNode.setAttribute('style', 'color: #f00'); 1.4201 +document.body.setAttribute('style', 'color: #f00'); 1.4202 +canvas.setAttribute('style', 'color: #f00'); 1.4203 + 1.4204 +var canvas2 = document.createElement('canvas'); 1.4205 +var ctx2 = canvas2.getContext('2d'); 1.4206 +ctx2.fillStyle = '#f00'; 1.4207 +ctx2.fillStyle = 'currentColor'; 1.4208 +ctx2.fillRect(0, 0, 100, 50); 1.4209 +ctx.drawImage(canvas2, 0, 0); 1.4210 + 1.4211 +document.body.parentNode.removeAttribute('style'); 1.4212 +document.body.removeAttribute('style'); 1.4213 + 1.4214 +isPixel(ctx, 50,25, 0,0,0,255, 0); 1.4215 + 1.4216 + 1.4217 +} 1.4218 +</script> 1.4219 + 1.4220 +<!-- [[[ test_2d.fillStyle.parse.hex3.html ]]] --> 1.4221 + 1.4222 +<p>Canvas test: 2d.fillStyle.parse.hex3</p> 1.4223 +<canvas id="c146" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4224 +<script> 1.4225 + 1.4226 + 1.4227 +function test_2d_fillStyle_parse_hex3() { 1.4228 + 1.4229 +var canvas = document.getElementById('c146'); 1.4230 +var ctx = canvas.getContext('2d'); 1.4231 + 1.4232 + 1.4233 +ctx.fillStyle = '#f00'; 1.4234 +ctx.fillStyle = '#0f0'; 1.4235 +ctx.fillRect(0, 0, 100, 50); 1.4236 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4237 + 1.4238 + 1.4239 +} 1.4240 +</script> 1.4241 + 1.4242 +<!-- [[[ test_2d.fillStyle.parse.hex6.html ]]] --> 1.4243 + 1.4244 +<p>Canvas test: 2d.fillStyle.parse.hex6</p> 1.4245 +<canvas id="c147" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4246 +<script> 1.4247 + 1.4248 + 1.4249 +function test_2d_fillStyle_parse_hex6() { 1.4250 + 1.4251 +var canvas = document.getElementById('c147'); 1.4252 +var ctx = canvas.getContext('2d'); 1.4253 + 1.4254 + 1.4255 +ctx.fillStyle = '#f00'; 1.4256 +ctx.fillStyle = '#00fF00'; 1.4257 +ctx.fillRect(0, 0, 100, 50); 1.4258 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4259 + 1.4260 + 1.4261 +} 1.4262 +</script> 1.4263 + 1.4264 +<!-- [[[ test_2d.fillStyle.parse.hsl-1.html ]]] --> 1.4265 + 1.4266 +<p>Canvas test: 2d.fillStyle.parse.hsl-1</p> 1.4267 +<canvas id="c148" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4268 +<script> 1.4269 + 1.4270 + 1.4271 +function test_2d_fillStyle_parse_hsl_1() { 1.4272 + 1.4273 +var canvas = document.getElementById('c148'); 1.4274 +var ctx = canvas.getContext('2d'); 1.4275 + 1.4276 + 1.4277 +ctx.fillStyle = '#f00'; 1.4278 +ctx.fillStyle = 'hsl(120, 100%, 50%)'; 1.4279 +ctx.fillRect(0, 0, 100, 50); 1.4280 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4281 + 1.4282 + 1.4283 +} 1.4284 +</script> 1.4285 + 1.4286 +<!-- [[[ test_2d.fillStyle.parse.hsl-2.html ]]] --> 1.4287 + 1.4288 +<p>Canvas test: 2d.fillStyle.parse.hsl-2</p> 1.4289 +<canvas id="c149" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4290 +<script> 1.4291 + 1.4292 + 1.4293 +function test_2d_fillStyle_parse_hsl_2() { 1.4294 + 1.4295 +var canvas = document.getElementById('c149'); 1.4296 +var ctx = canvas.getContext('2d'); 1.4297 + 1.4298 + 1.4299 +ctx.fillStyle = '#f00'; 1.4300 +ctx.fillStyle = 'hsl( -240 , 100% , 50% )'; 1.4301 +ctx.fillRect(0, 0, 100, 50); 1.4302 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4303 + 1.4304 + 1.4305 +} 1.4306 +</script> 1.4307 + 1.4308 +<!-- [[[ test_2d.fillStyle.parse.hsl-3.html ]]] --> 1.4309 + 1.4310 +<p>Canvas test: 2d.fillStyle.parse.hsl-3</p> 1.4311 +<canvas id="c150" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4312 +<script> 1.4313 + 1.4314 + 1.4315 +function test_2d_fillStyle_parse_hsl_3() { 1.4316 + 1.4317 +var canvas = document.getElementById('c150'); 1.4318 +var ctx = canvas.getContext('2d'); 1.4319 + 1.4320 + 1.4321 +ctx.fillStyle = '#f00'; 1.4322 +ctx.fillStyle = 'hsl(360120, 100%, 50%)'; 1.4323 +ctx.fillRect(0, 0, 100, 50); 1.4324 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4325 + 1.4326 + 1.4327 +} 1.4328 +</script> 1.4329 + 1.4330 +<!-- [[[ test_2d.fillStyle.parse.hsl-4.html ]]] --> 1.4331 + 1.4332 +<p>Canvas test: 2d.fillStyle.parse.hsl-4</p> 1.4333 +<canvas id="c151" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4334 +<script> 1.4335 + 1.4336 + 1.4337 +function test_2d_fillStyle_parse_hsl_4() { 1.4338 + 1.4339 +var canvas = document.getElementById('c151'); 1.4340 +var ctx = canvas.getContext('2d'); 1.4341 + 1.4342 + 1.4343 +ctx.fillStyle = '#f00'; 1.4344 +ctx.fillStyle = 'hsl(-360240, 100%, 50%)'; 1.4345 +ctx.fillRect(0, 0, 100, 50); 1.4346 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4347 + 1.4348 + 1.4349 +} 1.4350 +</script> 1.4351 + 1.4352 +<!-- [[[ test_2d.fillStyle.parse.hsl-5.html ]]] --> 1.4353 + 1.4354 +<p>Canvas test: 2d.fillStyle.parse.hsl-5</p> 1.4355 +<canvas id="c152" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4356 +<script> 1.4357 + 1.4358 + 1.4359 +function test_2d_fillStyle_parse_hsl_5() { 1.4360 + 1.4361 +var canvas = document.getElementById('c152'); 1.4362 +var ctx = canvas.getContext('2d'); 1.4363 + 1.4364 + 1.4365 +ctx.fillStyle = '#f00'; 1.4366 +ctx.fillStyle = 'hsl(120.0, 100.0%, 50.0%)'; 1.4367 +ctx.fillRect(0, 0, 100, 50); 1.4368 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4369 + 1.4370 + 1.4371 +} 1.4372 +</script> 1.4373 + 1.4374 +<!-- [[[ test_2d.fillStyle.parse.hsl-clamp-1.html ]]] --> 1.4375 + 1.4376 +<p>Canvas test: 2d.fillStyle.parse.hsl-clamp-1</p> 1.4377 +<canvas id="c153" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4378 +<script> 1.4379 + 1.4380 + 1.4381 +function test_2d_fillStyle_parse_hsl_clamp_1() { 1.4382 + 1.4383 +var canvas = document.getElementById('c153'); 1.4384 +var ctx = canvas.getContext('2d'); 1.4385 + 1.4386 + 1.4387 +ctx.fillStyle = '#f00'; 1.4388 +ctx.fillStyle = 'hsl(120, 200%, 50%)'; 1.4389 +ctx.fillRect(0, 0, 100, 50); 1.4390 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4391 + 1.4392 + 1.4393 +} 1.4394 +</script> 1.4395 + 1.4396 +<!-- [[[ test_2d.fillStyle.parse.hsl-clamp-2.html ]]] --> 1.4397 + 1.4398 +<p>Canvas test: 2d.fillStyle.parse.hsl-clamp-2</p> 1.4399 +<canvas id="c154" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4400 +<script> 1.4401 + 1.4402 + 1.4403 +function test_2d_fillStyle_parse_hsl_clamp_2() { 1.4404 + 1.4405 +var canvas = document.getElementById('c154'); 1.4406 +var ctx = canvas.getContext('2d'); 1.4407 + 1.4408 + 1.4409 +ctx.fillStyle = '#f00'; 1.4410 +ctx.fillStyle = 'hsl(120, -200%, 49.9%)'; 1.4411 +ctx.fillRect(0, 0, 100, 50); 1.4412 +isPixel(ctx, 50,25, 127,127,127,255, 0); 1.4413 + 1.4414 + 1.4415 +} 1.4416 +</script> 1.4417 + 1.4418 +<!-- [[[ test_2d.fillStyle.parse.hsl-clamp-3.html ]]] --> 1.4419 + 1.4420 +<p>Canvas test: 2d.fillStyle.parse.hsl-clamp-3</p> 1.4421 +<canvas id="c155" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4422 +<script> 1.4423 + 1.4424 + 1.4425 +function test_2d_fillStyle_parse_hsl_clamp_3() { 1.4426 + 1.4427 +var canvas = document.getElementById('c155'); 1.4428 +var ctx = canvas.getContext('2d'); 1.4429 + 1.4430 + 1.4431 +ctx.fillStyle = '#f00'; 1.4432 +ctx.fillStyle = 'hsl(120, 100%, 200%)'; 1.4433 +ctx.fillRect(0, 0, 100, 50); 1.4434 +isPixel(ctx, 50,25, 255,255,255,255, 0); 1.4435 + 1.4436 + 1.4437 +} 1.4438 +</script> 1.4439 + 1.4440 +<!-- [[[ test_2d.fillStyle.parse.hsl-clamp-4.html ]]] --> 1.4441 + 1.4442 +<p>Canvas test: 2d.fillStyle.parse.hsl-clamp-4</p> 1.4443 +<canvas id="c156" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4444 +<script> 1.4445 + 1.4446 + 1.4447 +function test_2d_fillStyle_parse_hsl_clamp_4() { 1.4448 + 1.4449 +var canvas = document.getElementById('c156'); 1.4450 +var ctx = canvas.getContext('2d'); 1.4451 + 1.4452 + 1.4453 +ctx.fillStyle = '#f00'; 1.4454 +ctx.fillStyle = 'hsl(120, 100%, -200%)'; 1.4455 +ctx.fillRect(0, 0, 100, 50); 1.4456 +isPixel(ctx, 50,25, 0,0,0,255, 0); 1.4457 + 1.4458 + 1.4459 +} 1.4460 +</script> 1.4461 + 1.4462 +<!-- [[[ test_2d.fillStyle.parse.hsla-1.html ]]] --> 1.4463 + 1.4464 +<p>Canvas test: 2d.fillStyle.parse.hsla-1</p> 1.4465 +<canvas id="c157" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4466 +<script> 1.4467 + 1.4468 + 1.4469 +function test_2d_fillStyle_parse_hsla_1() { 1.4470 + 1.4471 +var canvas = document.getElementById('c157'); 1.4472 +var ctx = canvas.getContext('2d'); 1.4473 + 1.4474 + 1.4475 +ctx.fillStyle = '#f00'; 1.4476 +ctx.fillStyle = 'hsla(120, 100%, 50%, 0.499)'; 1.4477 +ctx.fillRect(0, 0, 100, 50); 1.4478 +isPixel(ctx, 50,25, 0,255,0,127, 0); 1.4479 + 1.4480 + 1.4481 +} 1.4482 +</script> 1.4483 + 1.4484 +<!-- [[[ test_2d.fillStyle.parse.hsla-2.html ]]] --> 1.4485 + 1.4486 +<p>Canvas test: 2d.fillStyle.parse.hsla-2</p> 1.4487 +<canvas id="c158" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4488 +<script> 1.4489 + 1.4490 + 1.4491 +function test_2d_fillStyle_parse_hsla_2() { 1.4492 + 1.4493 +var canvas = document.getElementById('c158'); 1.4494 +var ctx = canvas.getContext('2d'); 1.4495 + 1.4496 + 1.4497 +ctx.fillStyle = '#f00'; 1.4498 +ctx.fillStyle = 'hsla( 120.0 , 100.0% , 50.0% , 1 )'; 1.4499 +ctx.fillRect(0, 0, 100, 50); 1.4500 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4501 + 1.4502 + 1.4503 +} 1.4504 +</script> 1.4505 + 1.4506 +<!-- [[[ test_2d.fillStyle.parse.hsla-clamp-1.html ]]] --> 1.4507 + 1.4508 +<p>Canvas test: 2d.fillStyle.parse.hsla-clamp-1</p> 1.4509 +<canvas id="c159" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4510 +<script> 1.4511 + 1.4512 + 1.4513 +function test_2d_fillStyle_parse_hsla_clamp_1() { 1.4514 + 1.4515 +var canvas = document.getElementById('c159'); 1.4516 +var ctx = canvas.getContext('2d'); 1.4517 + 1.4518 + 1.4519 +ctx.fillStyle = '#f00'; 1.4520 +ctx.fillStyle = 'hsla(120, 200%, 50%, 1)'; 1.4521 +ctx.fillRect(0, 0, 100, 50); 1.4522 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4523 + 1.4524 + 1.4525 +} 1.4526 +</script> 1.4527 + 1.4528 +<!-- [[[ test_2d.fillStyle.parse.hsla-clamp-2.html ]]] --> 1.4529 + 1.4530 +<p>Canvas test: 2d.fillStyle.parse.hsla-clamp-2</p> 1.4531 +<canvas id="c160" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4532 +<script> 1.4533 + 1.4534 + 1.4535 +function test_2d_fillStyle_parse_hsla_clamp_2() { 1.4536 + 1.4537 +var canvas = document.getElementById('c160'); 1.4538 +var ctx = canvas.getContext('2d'); 1.4539 + 1.4540 + 1.4541 +ctx.fillStyle = '#f00'; 1.4542 +ctx.fillStyle = 'hsla(120, -200%, 49.9%, 1)'; 1.4543 +ctx.fillRect(0, 0, 100, 50); 1.4544 +isPixel(ctx, 50,25, 127,127,127,255, 0); 1.4545 + 1.4546 + 1.4547 +} 1.4548 +</script> 1.4549 + 1.4550 +<!-- [[[ test_2d.fillStyle.parse.hsla-clamp-3.html ]]] --> 1.4551 + 1.4552 +<p>Canvas test: 2d.fillStyle.parse.hsla-clamp-3</p> 1.4553 +<canvas id="c161" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4554 +<script> 1.4555 + 1.4556 + 1.4557 +function test_2d_fillStyle_parse_hsla_clamp_3() { 1.4558 + 1.4559 +var canvas = document.getElementById('c161'); 1.4560 +var ctx = canvas.getContext('2d'); 1.4561 + 1.4562 + 1.4563 +ctx.fillStyle = '#f00'; 1.4564 +ctx.fillStyle = 'hsla(120, 100%, 200%, 1)'; 1.4565 +ctx.fillRect(0, 0, 100, 50); 1.4566 +isPixel(ctx, 50,25, 255,255,255,255, 0); 1.4567 + 1.4568 + 1.4569 +} 1.4570 +</script> 1.4571 + 1.4572 +<!-- [[[ test_2d.fillStyle.parse.hsla-clamp-4.html ]]] --> 1.4573 + 1.4574 +<p>Canvas test: 2d.fillStyle.parse.hsla-clamp-4</p> 1.4575 +<canvas id="c162" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4576 +<script> 1.4577 + 1.4578 + 1.4579 +function test_2d_fillStyle_parse_hsla_clamp_4() { 1.4580 + 1.4581 +var canvas = document.getElementById('c162'); 1.4582 +var ctx = canvas.getContext('2d'); 1.4583 + 1.4584 + 1.4585 +ctx.fillStyle = '#f00'; 1.4586 +ctx.fillStyle = 'hsla(120, 100%, -200%, 1)'; 1.4587 +ctx.fillRect(0, 0, 100, 50); 1.4588 +isPixel(ctx, 50,25, 0,0,0,255, 0); 1.4589 + 1.4590 + 1.4591 +} 1.4592 +</script> 1.4593 + 1.4594 +<!-- [[[ test_2d.fillStyle.parse.hsla-clamp-5.html ]]] --> 1.4595 + 1.4596 +<p>Canvas test: 2d.fillStyle.parse.hsla-clamp-5</p> 1.4597 +<canvas id="c163" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4598 +<script> 1.4599 + 1.4600 + 1.4601 +function test_2d_fillStyle_parse_hsla_clamp_5() { 1.4602 + 1.4603 +var canvas = document.getElementById('c163'); 1.4604 +var ctx = canvas.getContext('2d'); 1.4605 + 1.4606 + 1.4607 +ctx.fillStyle = '#f00'; 1.4608 +ctx.fillStyle = 'hsla(120, 100%, 50%, 2)'; 1.4609 +ctx.fillRect(0, 0, 100, 50); 1.4610 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4611 + 1.4612 + 1.4613 +} 1.4614 +</script> 1.4615 + 1.4616 +<!-- [[[ test_2d.fillStyle.parse.hsla-clamp-6.html ]]] --> 1.4617 + 1.4618 +<p>Canvas test: 2d.fillStyle.parse.hsla-clamp-6</p> 1.4619 +<canvas id="c164" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4620 +<script> 1.4621 + 1.4622 + 1.4623 +function test_2d_fillStyle_parse_hsla_clamp_6() { 1.4624 + 1.4625 +var canvas = document.getElementById('c164'); 1.4626 +var ctx = canvas.getContext('2d'); 1.4627 + 1.4628 + 1.4629 +ctx.fillStyle = '#f00'; 1.4630 +ctx.fillStyle = 'hsla(120, 100%, 0%, -2)'; 1.4631 +ctx.fillRect(0, 0, 100, 50); 1.4632 +isPixel(ctx, 50,25, 0,0,0,0, 0); 1.4633 + 1.4634 + 1.4635 +} 1.4636 +</script> 1.4637 + 1.4638 +<!-- [[[ test_2d.fillStyle.parse.html4.html ]]] --> 1.4639 + 1.4640 +<p>Canvas test: 2d.fillStyle.parse.html4</p> 1.4641 +<canvas id="c165" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4642 +<script> 1.4643 + 1.4644 + 1.4645 +function test_2d_fillStyle_parse_html4() { 1.4646 + 1.4647 +var canvas = document.getElementById('c165'); 1.4648 +var ctx = canvas.getContext('2d'); 1.4649 + 1.4650 + 1.4651 +ctx.fillStyle = '#f00'; 1.4652 +ctx.fillStyle = 'limE'; 1.4653 +ctx.fillRect(0, 0, 100, 50); 1.4654 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4655 + 1.4656 + 1.4657 +} 1.4658 +</script> 1.4659 + 1.4660 +<!-- [[[ test_2d.fillStyle.parse.invalid.hex3.html ]]] --> 1.4661 + 1.4662 +<p>Canvas test: 2d.fillStyle.parse.invalid.hex3</p> 1.4663 +<canvas id="c166" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4664 +<script> 1.4665 + 1.4666 + 1.4667 +function test_2d_fillStyle_parse_invalid_hex3() { 1.4668 + 1.4669 +var canvas = document.getElementById('c166'); 1.4670 +var ctx = canvas.getContext('2d'); 1.4671 + 1.4672 + 1.4673 +ctx.fillStyle = '#0f0'; 1.4674 +try { ctx.fillStyle = '#g00'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.4675 +ctx.fillRect(0, 0, 100, 50); 1.4676 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4677 + 1.4678 + 1.4679 +} 1.4680 +</script> 1.4681 + 1.4682 +<!-- [[[ test_2d.fillStyle.parse.invalid.hex6.html ]]] --> 1.4683 + 1.4684 +<p>Canvas test: 2d.fillStyle.parse.invalid.hex6</p> 1.4685 +<canvas id="c167" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4686 +<script> 1.4687 + 1.4688 + 1.4689 +function test_2d_fillStyle_parse_invalid_hex6() { 1.4690 + 1.4691 +var canvas = document.getElementById('c167'); 1.4692 +var ctx = canvas.getContext('2d'); 1.4693 + 1.4694 + 1.4695 +ctx.fillStyle = '#0f0'; 1.4696 +try { ctx.fillStyle = '#fg0000'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.4697 +ctx.fillRect(0, 0, 100, 50); 1.4698 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4699 + 1.4700 + 1.4701 +} 1.4702 +</script> 1.4703 + 1.4704 +<!-- [[[ test_2d.fillStyle.parse.invalid.hsl-1.html ]]] --> 1.4705 + 1.4706 +<p>Canvas test: 2d.fillStyle.parse.invalid.hsl-1</p> 1.4707 +<canvas id="c168" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4708 +<script> 1.4709 + 1.4710 + 1.4711 +function test_2d_fillStyle_parse_invalid_hsl_1() { 1.4712 + 1.4713 +var canvas = document.getElementById('c168'); 1.4714 +var ctx = canvas.getContext('2d'); 1.4715 + 1.4716 + 1.4717 +ctx.fillStyle = '#0f0'; 1.4718 +try { ctx.fillStyle = 'hsl(0%, 100%, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.4719 +ctx.fillRect(0, 0, 100, 50); 1.4720 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4721 + 1.4722 + 1.4723 +} 1.4724 +</script> 1.4725 + 1.4726 +<!-- [[[ test_2d.fillStyle.parse.invalid.hsl-2.html ]]] --> 1.4727 + 1.4728 +<p>Canvas test: 2d.fillStyle.parse.invalid.hsl-2</p> 1.4729 +<canvas id="c169" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4730 +<script> 1.4731 + 1.4732 + 1.4733 +function test_2d_fillStyle_parse_invalid_hsl_2() { 1.4734 + 1.4735 +var canvas = document.getElementById('c169'); 1.4736 +var ctx = canvas.getContext('2d'); 1.4737 + 1.4738 + 1.4739 +ctx.fillStyle = '#0f0'; 1.4740 +try { ctx.fillStyle = 'hsl(z, 100%, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.4741 +ctx.fillRect(0, 0, 100, 50); 1.4742 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4743 + 1.4744 + 1.4745 +} 1.4746 +</script> 1.4747 + 1.4748 +<!-- [[[ test_2d.fillStyle.parse.invalid.hsl-3.html ]]] --> 1.4749 + 1.4750 +<p>Canvas test: 2d.fillStyle.parse.invalid.hsl-3</p> 1.4751 +<canvas id="c170" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4752 +<script> 1.4753 + 1.4754 + 1.4755 +function test_2d_fillStyle_parse_invalid_hsl_3() { 1.4756 + 1.4757 +var canvas = document.getElementById('c170'); 1.4758 +var ctx = canvas.getContext('2d'); 1.4759 + 1.4760 + 1.4761 +ctx.fillStyle = '#0f0'; 1.4762 +try { ctx.fillStyle = 'hsl(0, 0, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.4763 +ctx.fillRect(0, 0, 100, 50); 1.4764 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4765 + 1.4766 + 1.4767 +} 1.4768 +</script> 1.4769 + 1.4770 +<!-- [[[ test_2d.fillStyle.parse.invalid.hsl-4.html ]]] --> 1.4771 + 1.4772 +<p>Canvas test: 2d.fillStyle.parse.invalid.hsl-4</p> 1.4773 +<canvas id="c171" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4774 +<script> 1.4775 + 1.4776 + 1.4777 +function test_2d_fillStyle_parse_invalid_hsl_4() { 1.4778 + 1.4779 +var canvas = document.getElementById('c171'); 1.4780 +var ctx = canvas.getContext('2d'); 1.4781 + 1.4782 + 1.4783 +ctx.fillStyle = '#0f0'; 1.4784 +try { ctx.fillStyle = 'hsl(0, 100%, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.4785 +ctx.fillRect(0, 0, 100, 50); 1.4786 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4787 + 1.4788 + 1.4789 +} 1.4790 +</script> 1.4791 + 1.4792 +<!-- [[[ test_2d.fillStyle.parse.invalid.hsl-5.html ]]] --> 1.4793 + 1.4794 +<p>Canvas test: 2d.fillStyle.parse.invalid.hsl-5</p> 1.4795 +<canvas id="c172" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4796 +<script> 1.4797 + 1.4798 + 1.4799 +function test_2d_fillStyle_parse_invalid_hsl_5() { 1.4800 + 1.4801 +var canvas = document.getElementById('c172'); 1.4802 +var ctx = canvas.getContext('2d'); 1.4803 + 1.4804 + 1.4805 +ctx.fillStyle = '#0f0'; 1.4806 +try { ctx.fillStyle = 'hsl(0, 100%, 100%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.4807 +ctx.fillRect(0, 0, 100, 50); 1.4808 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4809 + 1.4810 + 1.4811 +} 1.4812 +</script> 1.4813 + 1.4814 +<!-- [[[ test_2d.fillStyle.parse.invalid.hsla-1.html ]]] --> 1.4815 + 1.4816 +<p>Canvas test: 2d.fillStyle.parse.invalid.hsla-1</p> 1.4817 +<canvas id="c173" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4818 +<script> 1.4819 + 1.4820 + 1.4821 +function test_2d_fillStyle_parse_invalid_hsla_1() { 1.4822 + 1.4823 +var canvas = document.getElementById('c173'); 1.4824 +var ctx = canvas.getContext('2d'); 1.4825 + 1.4826 + 1.4827 +ctx.fillStyle = '#0f0'; 1.4828 +try { ctx.fillStyle = 'hsla(0%, 100%, 50%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.4829 +ctx.fillRect(0, 0, 100, 50); 1.4830 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4831 + 1.4832 + 1.4833 +} 1.4834 +</script> 1.4835 + 1.4836 +<!-- [[[ test_2d.fillStyle.parse.invalid.hsla-2.html ]]] --> 1.4837 + 1.4838 +<p>Canvas test: 2d.fillStyle.parse.invalid.hsla-2</p> 1.4839 +<canvas id="c174" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4840 +<script> 1.4841 + 1.4842 + 1.4843 +function test_2d_fillStyle_parse_invalid_hsla_2() { 1.4844 + 1.4845 +var canvas = document.getElementById('c174'); 1.4846 +var ctx = canvas.getContext('2d'); 1.4847 + 1.4848 + 1.4849 +ctx.fillStyle = '#0f0'; 1.4850 +try { ctx.fillStyle = 'hsla(0, 0, 50%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.4851 +ctx.fillRect(0, 0, 100, 50); 1.4852 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4853 + 1.4854 + 1.4855 +} 1.4856 +</script> 1.4857 + 1.4858 +<!-- [[[ test_2d.fillStyle.parse.invalid.name-1.html ]]] --> 1.4859 + 1.4860 +<p>Canvas test: 2d.fillStyle.parse.invalid.name-1</p> 1.4861 +<canvas id="c174a" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4862 +<script> 1.4863 + 1.4864 + 1.4865 +function test_2d_fillStyle_parse_invalid_name_1() { 1.4866 + 1.4867 +var canvas = document.getElementById('c174a'); 1.4868 +var ctx = canvas.getContext('2d'); 1.4869 + 1.4870 +ctx.fillStyle = '#0f0'; 1.4871 +try { ctx.fillStyle = 'darkbrown'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.4872 +ctx.fillRect(0, 0, 100, 50); 1.4873 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4874 + 1.4875 + 1.4876 +} 1.4877 +</script> 1.4878 + 1.4879 +<!-- [[[ test_2d.fillStyle.parse.invalid.name-2.html ]]] --> 1.4880 + 1.4881 +<p>Canvas test: 2d.fillStyle.parse.invalid.name-2</p> 1.4882 +<canvas id="c174b" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4883 +<script> 1.4884 + 1.4885 + 1.4886 +function test_2d_fillStyle_parse_invalid_name_2() { 1.4887 + 1.4888 +var canvas = document.getElementById('c174b'); 1.4889 +var ctx = canvas.getContext('2d'); 1.4890 + 1.4891 +ctx.fillStyle = '#0f0'; 1.4892 +try { ctx.fillStyle = 'firebrick1'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.4893 +ctx.fillRect(0, 0, 100, 50); 1.4894 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4895 + 1.4896 + 1.4897 +} 1.4898 +</script> 1.4899 + 1.4900 +<!-- [[[ test_2d.fillStyle.parse.invalid.name-3.html ]]] --> 1.4901 + 1.4902 +<p>Canvas test: 2d.fillStyle.parse.invalid.name-3</p> 1.4903 +<canvas id="c174c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4904 +<script> 1.4905 + 1.4906 + 1.4907 +function test_2d_fillStyle_parse_invalid_name_3() { 1.4908 + 1.4909 +var canvas = document.getElementById('c174c'); 1.4910 +var ctx = canvas.getContext('2d'); 1.4911 + 1.4912 +ctx.fillStyle = '#0f0'; 1.4913 +try { ctx.fillStyle = 'red blue'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.4914 +ctx.fillRect(0, 0, 100, 50); 1.4915 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4916 + 1.4917 + 1.4918 +} 1.4919 +</script> 1.4920 + 1.4921 +<!-- [[[ test_2d.fillStyle.parse.invalid.rgb-1.html ]]] --> 1.4922 + 1.4923 +<p>Canvas test: 2d.fillStyle.parse.invalid.rgb-1</p> 1.4924 +<canvas id="c175" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4925 +<script> 1.4926 + 1.4927 + 1.4928 +function test_2d_fillStyle_parse_invalid_rgb_1() { 1.4929 + 1.4930 +var canvas = document.getElementById('c175'); 1.4931 +var ctx = canvas.getContext('2d'); 1.4932 + 1.4933 + 1.4934 +ctx.fillStyle = '#0f0'; 1.4935 +try { ctx.fillStyle = 'rgb(255.0, 0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.4936 +ctx.fillRect(0, 0, 100, 50); 1.4937 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4938 + 1.4939 + 1.4940 +} 1.4941 +</script> 1.4942 + 1.4943 +<!-- [[[ test_2d.fillStyle.parse.invalid.rgb-2.html ]]] --> 1.4944 + 1.4945 +<p>Canvas test: 2d.fillStyle.parse.invalid.rgb-2</p> 1.4946 +<canvas id="c176" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4947 +<script> 1.4948 + 1.4949 + 1.4950 +function test_2d_fillStyle_parse_invalid_rgb_2() { 1.4951 + 1.4952 +var canvas = document.getElementById('c176'); 1.4953 +var ctx = canvas.getContext('2d'); 1.4954 + 1.4955 + 1.4956 +ctx.fillStyle = '#0f0'; 1.4957 +try { ctx.fillStyle = 'rgb(255, 0.0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.4958 +ctx.fillRect(0, 0, 100, 50); 1.4959 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4960 + 1.4961 + 1.4962 +} 1.4963 +</script> 1.4964 + 1.4965 +<!-- [[[ test_2d.fillStyle.parse.invalid.rgb-3.html ]]] --> 1.4966 + 1.4967 +<p>Canvas test: 2d.fillStyle.parse.invalid.rgb-3</p> 1.4968 +<canvas id="c177" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4969 +<script> 1.4970 + 1.4971 + 1.4972 +function test_2d_fillStyle_parse_invalid_rgb_3() { 1.4973 + 1.4974 +var canvas = document.getElementById('c177'); 1.4975 +var ctx = canvas.getContext('2d'); 1.4976 + 1.4977 + 1.4978 +ctx.fillStyle = '#0f0'; 1.4979 +try { ctx.fillStyle = 'rgb(255.0, 0, 0,)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.4980 +ctx.fillRect(0, 0, 100, 50); 1.4981 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.4982 + 1.4983 + 1.4984 +} 1.4985 +</script> 1.4986 + 1.4987 +<!-- [[[ test_2d.fillStyle.parse.invalid.rgb-4.html ]]] --> 1.4988 + 1.4989 +<p>Canvas test: 2d.fillStyle.parse.invalid.rgb-4</p> 1.4990 +<canvas id="c178" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.4991 +<script> 1.4992 + 1.4993 + 1.4994 +function test_2d_fillStyle_parse_invalid_rgb_4() { 1.4995 + 1.4996 +var canvas = document.getElementById('c178'); 1.4997 +var ctx = canvas.getContext('2d'); 1.4998 + 1.4999 + 1.5000 +ctx.fillStyle = '#0f0'; 1.5001 +try { ctx.fillStyle = 'rgb(100%, 0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.5002 +ctx.fillRect(0, 0, 100, 50); 1.5003 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5004 + 1.5005 + 1.5006 +} 1.5007 +</script> 1.5008 + 1.5009 +<!-- [[[ test_2d.fillStyle.parse.invalid.rgb-5.html ]]] --> 1.5010 + 1.5011 +<p>Canvas test: 2d.fillStyle.parse.invalid.rgb-5</p> 1.5012 +<canvas id="c179" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5013 +<script> 1.5014 + 1.5015 + 1.5016 +function test_2d_fillStyle_parse_invalid_rgb_5() { 1.5017 + 1.5018 +var canvas = document.getElementById('c179'); 1.5019 +var ctx = canvas.getContext('2d'); 1.5020 + 1.5021 + 1.5022 +ctx.fillStyle = '#0f0'; 1.5023 +try { ctx.fillStyle = 'rgb(255 0 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.5024 +ctx.fillRect(0, 0, 100, 50); 1.5025 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5026 + 1.5027 + 1.5028 +} 1.5029 +</script> 1.5030 + 1.5031 +<!-- [[[ test_2d.fillStyle.parse.invalid.rgb-6.html ]]] --> 1.5032 + 1.5033 +<p>Canvas test: 2d.fillStyle.parse.invalid.rgb-6</p> 1.5034 +<canvas id="c180" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5035 +<script> 1.5036 + 1.5037 + 1.5038 +function test_2d_fillStyle_parse_invalid_rgb_6() { 1.5039 + 1.5040 +var canvas = document.getElementById('c180'); 1.5041 +var ctx = canvas.getContext('2d'); 1.5042 + 1.5043 + 1.5044 +ctx.fillStyle = '#0f0'; 1.5045 +try { ctx.fillStyle = 'rgb(255, - 1, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.5046 +ctx.fillRect(0, 0, 100, 50); 1.5047 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5048 + 1.5049 + 1.5050 +} 1.5051 +</script> 1.5052 + 1.5053 +<!-- [[[ test_2d.fillStyle.parse.invalid.rgb-7.html ]]] --> 1.5054 + 1.5055 +<p>Canvas test: 2d.fillStyle.parse.invalid.rgb-7</p> 1.5056 +<canvas id="c181" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5057 +<script> 1.5058 + 1.5059 + 1.5060 +function test_2d_fillStyle_parse_invalid_rgb_7() { 1.5061 + 1.5062 +var canvas = document.getElementById('c181'); 1.5063 +var ctx = canvas.getContext('2d'); 1.5064 + 1.5065 + 1.5066 +ctx.fillStyle = '#0f0'; 1.5067 +try { ctx.fillStyle = 'rgb(255, 0, 0, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.5068 +ctx.fillRect(0, 0, 100, 50); 1.5069 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5070 + 1.5071 + 1.5072 +} 1.5073 +</script> 1.5074 + 1.5075 +<!-- [[[ test_2d.fillStyle.parse.invalid.rgba-1.html ]]] --> 1.5076 + 1.5077 +<p>Canvas test: 2d.fillStyle.parse.invalid.rgba-1</p> 1.5078 +<canvas id="c182" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5079 +<script> 1.5080 + 1.5081 + 1.5082 +function test_2d_fillStyle_parse_invalid_rgba_1() { 1.5083 + 1.5084 +var canvas = document.getElementById('c182'); 1.5085 +var ctx = canvas.getContext('2d'); 1.5086 + 1.5087 + 1.5088 +ctx.fillStyle = '#0f0'; 1.5089 +try { ctx.fillStyle = 'rgba(255, 0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.5090 +ctx.fillRect(0, 0, 100, 50); 1.5091 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5092 + 1.5093 + 1.5094 +} 1.5095 +</script> 1.5096 + 1.5097 +<!-- [[[ test_2d.fillStyle.parse.invalid.rgba-2.html ]]] --> 1.5098 + 1.5099 +<p>Canvas test: 2d.fillStyle.parse.invalid.rgba-2</p> 1.5100 +<canvas id="c183" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5101 +<script> 1.5102 + 1.5103 + 1.5104 +function test_2d_fillStyle_parse_invalid_rgba_2() { 1.5105 + 1.5106 +var canvas = document.getElementById('c183'); 1.5107 +var ctx = canvas.getContext('2d'); 1.5108 + 1.5109 + 1.5110 +ctx.fillStyle = '#0f0'; 1.5111 +try { ctx.fillStyle = 'rgba(255.0, 0, 0, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.5112 +ctx.fillRect(0, 0, 100, 50); 1.5113 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5114 + 1.5115 + 1.5116 +} 1.5117 +</script> 1.5118 + 1.5119 +<!-- [[[ test_2d.fillStyle.parse.invalid.rgba-3.html ]]] --> 1.5120 + 1.5121 +<p>Canvas test: 2d.fillStyle.parse.invalid.rgba-3</p> 1.5122 +<canvas id="c184" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5123 +<script> 1.5124 + 1.5125 + 1.5126 +function test_2d_fillStyle_parse_invalid_rgba_3() { 1.5127 + 1.5128 +var canvas = document.getElementById('c184'); 1.5129 +var ctx = canvas.getContext('2d'); 1.5130 + 1.5131 + 1.5132 +ctx.fillStyle = '#0f0'; 1.5133 +try { ctx.fillStyle = 'rgba(100%, 0, 0, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.5134 +ctx.fillRect(0, 0, 100, 50); 1.5135 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5136 + 1.5137 + 1.5138 +} 1.5139 +</script> 1.5140 + 1.5141 +<!-- [[[ test_2d.fillStyle.parse.invalid.rgba-4.html ]]] --> 1.5142 + 1.5143 +<p>Canvas test: 2d.fillStyle.parse.invalid.rgba-4</p> 1.5144 +<canvas id="c185" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5145 +<script> 1.5146 + 1.5147 + 1.5148 +function test_2d_fillStyle_parse_invalid_rgba_4() { 1.5149 + 1.5150 +var canvas = document.getElementById('c185'); 1.5151 +var ctx = canvas.getContext('2d'); 1.5152 + 1.5153 + 1.5154 +ctx.fillStyle = '#0f0'; 1.5155 +try { ctx.fillStyle = 'rgba(255, 0, 0, 100%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.5156 +ctx.fillRect(0, 0, 100, 50); 1.5157 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5158 + 1.5159 + 1.5160 +} 1.5161 +</script> 1.5162 + 1.5163 +<!-- [[[ test_2d.fillStyle.parse.invalid.rgba-5.html ]]] --> 1.5164 + 1.5165 +<p>Canvas test: 2d.fillStyle.parse.invalid.rgba-5</p> 1.5166 +<canvas id="c186" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5167 +<script> 1.5168 + 1.5169 + 1.5170 +function test_2d_fillStyle_parse_invalid_rgba_5() { 1.5171 + 1.5172 +var canvas = document.getElementById('c186'); 1.5173 +var ctx = canvas.getContext('2d'); 1.5174 + 1.5175 + 1.5176 +ctx.fillStyle = '#0f0'; 1.5177 +try { ctx.fillStyle = 'rgba(255, 0, 0, 1. 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does 1.5178 +ctx.fillRect(0, 0, 100, 50); 1.5179 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5180 + 1.5181 + 1.5182 +} 1.5183 +</script> 1.5184 + 1.5185 +<!-- [[[ test_2d.fillStyle.parse.rgb-clamp-1.html ]]] --> 1.5186 + 1.5187 +<p>Canvas test: 2d.fillStyle.parse.rgb-clamp-1</p> 1.5188 +<canvas id="c187" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5189 +<script> 1.5190 + 1.5191 + 1.5192 +function test_2d_fillStyle_parse_rgb_clamp_1() { 1.5193 + 1.5194 +var canvas = document.getElementById('c187'); 1.5195 +var ctx = canvas.getContext('2d'); 1.5196 + 1.5197 + 1.5198 +ctx.fillStyle = '#f00'; 1.5199 +ctx.fillStyle = 'rgb(-1000, 1000, -1000)'; 1.5200 +ctx.fillRect(0, 0, 100, 50); 1.5201 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5202 + 1.5203 + 1.5204 +} 1.5205 +</script> 1.5206 + 1.5207 +<!-- [[[ test_2d.fillStyle.parse.rgb-clamp-2.html ]]] --> 1.5208 + 1.5209 +<p>Canvas test: 2d.fillStyle.parse.rgb-clamp-2</p> 1.5210 +<canvas id="c188" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5211 +<script> 1.5212 + 1.5213 + 1.5214 +function test_2d_fillStyle_parse_rgb_clamp_2() { 1.5215 + 1.5216 +var canvas = document.getElementById('c188'); 1.5217 +var ctx = canvas.getContext('2d'); 1.5218 + 1.5219 + 1.5220 +ctx.fillStyle = '#f00'; 1.5221 +ctx.fillStyle = 'rgb(-200%, 200%, -200%)'; 1.5222 +ctx.fillRect(0, 0, 100, 50); 1.5223 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5224 + 1.5225 + 1.5226 +} 1.5227 +</script> 1.5228 + 1.5229 +<!-- [[[ test_2d.fillStyle.parse.rgb-clamp-3.html ]]] --> 1.5230 + 1.5231 +<p>Canvas test: 2d.fillStyle.parse.rgb-clamp-3</p> 1.5232 +<canvas id="c189" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5233 +<script> 1.5234 + 1.5235 + 1.5236 +function test_2d_fillStyle_parse_rgb_clamp_3() { 1.5237 + 1.5238 +var canvas = document.getElementById('c189'); 1.5239 +var ctx = canvas.getContext('2d'); 1.5240 + 1.5241 + 1.5242 +ctx.fillStyle = '#f00'; 1.5243 +ctx.fillStyle = 'rgb(-2147483649, 4294967298, -18446744073709551619)'; 1.5244 +ctx.fillRect(0, 0, 100, 50); 1.5245 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5246 + 1.5247 + 1.5248 +} 1.5249 +</script> 1.5250 + 1.5251 +<!-- [[[ test_2d.fillStyle.parse.rgb-clamp-4.html ]]] --> 1.5252 + 1.5253 +<p>Canvas test: 2d.fillStyle.parse.rgb-clamp-4</p> 1.5254 +<canvas id="c190" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5255 +<script> 1.5256 + 1.5257 + 1.5258 +function test_2d_fillStyle_parse_rgb_clamp_4() { 1.5259 + 1.5260 +var canvas = document.getElementById('c190'); 1.5261 +var ctx = canvas.getContext('2d'); 1.5262 + 1.5263 + 1.5264 +ctx.fillStyle = '#f00'; 1.5265 +ctx.fillStyle = 'rgb(-1000000000000000000000000000000000000000, 1000000000000000000000000000000000000000, -1000000000000000000000000000000000000000)'; 1.5266 +ctx.fillRect(0, 0, 100, 50); 1.5267 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5268 + 1.5269 + 1.5270 +} 1.5271 +</script> 1.5272 + 1.5273 +<!-- [[[ test_2d.fillStyle.parse.rgb-clamp-5.html ]]] --> 1.5274 + 1.5275 +<p>Canvas test: 2d.fillStyle.parse.rgb-clamp-5</p> 1.5276 +<canvas id="c191" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5277 +<script> 1.5278 + 1.5279 + 1.5280 +function test_2d_fillStyle_parse_rgb_clamp_5() { 1.5281 + 1.5282 +var canvas = document.getElementById('c191'); 1.5283 +var ctx = canvas.getContext('2d'); 1.5284 + 1.5285 + 1.5286 +ctx.fillStyle = '#f00'; 1.5287 +ctx.fillStyle = 'rgb(-10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, -10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)'; 1.5288 +ctx.fillRect(0, 0, 100, 50); 1.5289 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5290 + 1.5291 + 1.5292 +} 1.5293 +</script> 1.5294 + 1.5295 +<!-- [[[ test_2d.fillStyle.parse.rgb-num.html ]]] --> 1.5296 + 1.5297 +<p>Canvas test: 2d.fillStyle.parse.rgb-num</p> 1.5298 +<canvas id="c192" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5299 +<script> 1.5300 + 1.5301 + 1.5302 +function test_2d_fillStyle_parse_rgb_num() { 1.5303 + 1.5304 +var canvas = document.getElementById('c192'); 1.5305 +var ctx = canvas.getContext('2d'); 1.5306 + 1.5307 + 1.5308 +ctx.fillStyle = '#f00'; 1.5309 +ctx.fillStyle = 'rgb(0,255,0)'; 1.5310 +ctx.fillRect(0, 0, 100, 50); 1.5311 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5312 + 1.5313 + 1.5314 +} 1.5315 +</script> 1.5316 + 1.5317 +<!-- [[[ test_2d.fillStyle.parse.rgb-percent.html ]]] --> 1.5318 + 1.5319 +<p>Canvas test: 2d.fillStyle.parse.rgb-percent</p> 1.5320 +<canvas id="c193" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5321 +<script> 1.5322 + 1.5323 + 1.5324 +function test_2d_fillStyle_parse_rgb_percent() { 1.5325 + 1.5326 +var canvas = document.getElementById('c193'); 1.5327 +var ctx = canvas.getContext('2d'); 1.5328 + 1.5329 + 1.5330 +ctx.fillStyle = '#f00'; 1.5331 +ctx.fillStyle = 'rgb(0% ,100% ,0%)'; 1.5332 +ctx.fillRect(0, 0, 100, 50); 1.5333 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5334 + 1.5335 + 1.5336 +} 1.5337 +</script> 1.5338 + 1.5339 +<!-- [[[ test_2d.fillStyle.parse.rgba-clamp-1.html ]]] --> 1.5340 + 1.5341 +<p>Canvas test: 2d.fillStyle.parse.rgba-clamp-1</p> 1.5342 +<canvas id="c194" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5343 +<script> 1.5344 + 1.5345 + 1.5346 +function test_2d_fillStyle_parse_rgba_clamp_1() { 1.5347 + 1.5348 +var canvas = document.getElementById('c194'); 1.5349 +var ctx = canvas.getContext('2d'); 1.5350 + 1.5351 + 1.5352 +ctx.fillStyle = '#f00'; 1.5353 +ctx.fillStyle = 'rgba(0, 255, 0, -2)'; 1.5354 +ctx.fillRect(0, 0, 100, 50); 1.5355 +isPixel(ctx, 50,25, 0,0,0,0, 0); 1.5356 + 1.5357 + 1.5358 +} 1.5359 +</script> 1.5360 + 1.5361 +<!-- [[[ test_2d.fillStyle.parse.rgba-clamp-2.html ]]] --> 1.5362 + 1.5363 +<p>Canvas test: 2d.fillStyle.parse.rgba-clamp-2</p> 1.5364 +<canvas id="c195" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5365 +<script> 1.5366 + 1.5367 + 1.5368 +function test_2d_fillStyle_parse_rgba_clamp_2() { 1.5369 + 1.5370 +var canvas = document.getElementById('c195'); 1.5371 +var ctx = canvas.getContext('2d'); 1.5372 + 1.5373 + 1.5374 +ctx.fillStyle = '#f00'; 1.5375 +ctx.fillStyle = 'rgba(0, 255, 0, 2)'; 1.5376 +ctx.fillRect(0, 0, 100, 50); 1.5377 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5378 + 1.5379 + 1.5380 +} 1.5381 +</script> 1.5382 + 1.5383 +<!-- [[[ test_2d.fillStyle.parse.rgba-num-1.html ]]] --> 1.5384 + 1.5385 +<p>Canvas test: 2d.fillStyle.parse.rgba-num-1</p> 1.5386 +<canvas id="c196" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5387 +<script> 1.5388 + 1.5389 + 1.5390 +function test_2d_fillStyle_parse_rgba_num_1() { 1.5391 + 1.5392 +var canvas = document.getElementById('c196'); 1.5393 +var ctx = canvas.getContext('2d'); 1.5394 + 1.5395 + 1.5396 +ctx.fillStyle = '#f00'; 1.5397 +ctx.fillStyle = 'rgba( 0 , 255 , 0 , .499 )'; 1.5398 +ctx.fillRect(0, 0, 100, 50); 1.5399 +isPixel(ctx, 50,25, 0,255,0,127, 0); 1.5400 + 1.5401 + 1.5402 +} 1.5403 +</script> 1.5404 + 1.5405 +<!-- [[[ test_2d.fillStyle.parse.rgba-num-2.html ]]] --> 1.5406 + 1.5407 +<p>Canvas test: 2d.fillStyle.parse.rgba-num-2</p> 1.5408 +<canvas id="c197" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5409 +<script> 1.5410 + 1.5411 + 1.5412 +function test_2d_fillStyle_parse_rgba_num_2() { 1.5413 + 1.5414 +var canvas = document.getElementById('c197'); 1.5415 +var ctx = canvas.getContext('2d'); 1.5416 + 1.5417 + 1.5418 +ctx.fillStyle = '#f00'; 1.5419 +ctx.fillStyle = 'rgba( 0 , 255 , 0 , 0.499 )'; 1.5420 +ctx.fillRect(0, 0, 100, 50); 1.5421 +isPixel(ctx, 50,25, 0,255,0,127, 0); 1.5422 + 1.5423 + 1.5424 +} 1.5425 +</script> 1.5426 + 1.5427 +<!-- [[[ test_2d.fillStyle.parse.rgba-percent.html ]]] --> 1.5428 + 1.5429 +<p>Canvas test: 2d.fillStyle.parse.rgba-percent</p> 1.5430 +<canvas id="c198" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5431 +<script> 1.5432 + 1.5433 + 1.5434 +function test_2d_fillStyle_parse_rgba_percent() { 1.5435 + 1.5436 +var canvas = document.getElementById('c198'); 1.5437 +var ctx = canvas.getContext('2d'); 1.5438 + 1.5439 + 1.5440 +ctx.fillStyle = '#f00'; 1.5441 +ctx.fillStyle = 'rgba(0%,100%,0%,0.499)'; 1.5442 +ctx.fillRect(0, 0, 100, 50); 1.5443 +isPixel(ctx, 50,25, 0,255,0,127, 0); 1.5444 + 1.5445 + 1.5446 +} 1.5447 +</script> 1.5448 + 1.5449 +<!-- [[[ test_2d.fillStyle.parse.rgba-solid-1.html ]]] --> 1.5450 + 1.5451 +<p>Canvas test: 2d.fillStyle.parse.rgba-solid-1</p> 1.5452 +<canvas id="c199" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5453 +<script> 1.5454 + 1.5455 + 1.5456 +function test_2d_fillStyle_parse_rgba_solid_1() { 1.5457 + 1.5458 +var canvas = document.getElementById('c199'); 1.5459 +var ctx = canvas.getContext('2d'); 1.5460 + 1.5461 + 1.5462 +ctx.fillStyle = '#f00'; 1.5463 +ctx.fillStyle = 'rgba( 0 , 255 , 0 , 1 )'; 1.5464 +ctx.fillRect(0, 0, 100, 50); 1.5465 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5466 + 1.5467 + 1.5468 +} 1.5469 +</script> 1.5470 + 1.5471 +<!-- [[[ test_2d.fillStyle.parse.rgba-solid-2.html ]]] --> 1.5472 + 1.5473 +<p>Canvas test: 2d.fillStyle.parse.rgba-solid-2</p> 1.5474 +<canvas id="c200" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5475 +<script> 1.5476 + 1.5477 + 1.5478 +function test_2d_fillStyle_parse_rgba_solid_2() { 1.5479 + 1.5480 +var canvas = document.getElementById('c200'); 1.5481 +var ctx = canvas.getContext('2d'); 1.5482 + 1.5483 + 1.5484 +ctx.fillStyle = '#f00'; 1.5485 +ctx.fillStyle = 'rgba( 0 , 255 , 0 , 1.0 )'; 1.5486 +ctx.fillRect(0, 0, 100, 50); 1.5487 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5488 + 1.5489 + 1.5490 +} 1.5491 +</script> 1.5492 + 1.5493 +<!-- [[[ test_2d.fillStyle.parse.svg-1.html ]]] --> 1.5494 + 1.5495 +<p>Canvas test: 2d.fillStyle.parse.svg-1</p> 1.5496 +<canvas id="c201" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5497 +<script> 1.5498 + 1.5499 + 1.5500 +function test_2d_fillStyle_parse_svg_1() { 1.5501 + 1.5502 +var canvas = document.getElementById('c201'); 1.5503 +var ctx = canvas.getContext('2d'); 1.5504 + 1.5505 + 1.5506 +ctx.fillStyle = '#f00'; 1.5507 +ctx.fillStyle = 'gray'; 1.5508 +ctx.fillRect(0, 0, 100, 50); 1.5509 +isPixel(ctx, 50,25, 128,128,128,255, 0); 1.5510 + 1.5511 + 1.5512 +} 1.5513 +</script> 1.5514 + 1.5515 +<!-- [[[ test_2d.fillStyle.parse.svg-2.html ]]] --> 1.5516 + 1.5517 +<p>Canvas test: 2d.fillStyle.parse.svg-2</p> 1.5518 +<canvas id="c202" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5519 +<script> 1.5520 + 1.5521 + 1.5522 +function test_2d_fillStyle_parse_svg_2() { 1.5523 + 1.5524 +var canvas = document.getElementById('c202'); 1.5525 +var ctx = canvas.getContext('2d'); 1.5526 + 1.5527 + 1.5528 +ctx.fillStyle = '#f00'; 1.5529 +ctx.fillStyle = 'grey'; 1.5530 +ctx.fillRect(0, 0, 100, 50); 1.5531 +isPixel(ctx, 50,25, 128,128,128,255, 0); 1.5532 + 1.5533 + 1.5534 +} 1.5535 +</script> 1.5536 + 1.5537 +<!-- [[[ test_2d.fillStyle.parse.system.html ]]] --> 1.5538 + 1.5539 +<p>Canvas test: 2d.fillStyle.parse.system</p> 1.5540 +<canvas id="c203" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5541 +<script> 1.5542 + 1.5543 +function test_2d_fillStyle_parse_system() { 1.5544 + 1.5545 +var canvas = document.getElementById('c203'); 1.5546 +var ctx = canvas.getContext('2d'); 1.5547 + 1.5548 + 1.5549 +ctx.fillStyle = '#f00'; 1.5550 +ctx.fillStyle = 'ThreeDDarkShadow'; 1.5551 +ok(/^#(?!(FF0000|ff0000|f00)$)/.test(ctx.fillStyle), "ctx.fillStyle =~ /^#(?!(FF0000|ff0000|f00)$)/"); // test that it's not red 1.5552 + 1.5553 + 1.5554 +} 1.5555 +</script> 1.5556 + 1.5557 +<!-- [[[ test_2d.fillStyle.parse.transparent-1.html ]]] --> 1.5558 + 1.5559 +<p>Canvas test: 2d.fillStyle.parse.transparent-1</p> 1.5560 +<canvas id="c204" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5561 +<script> 1.5562 + 1.5563 + 1.5564 +function test_2d_fillStyle_parse_transparent_1() { 1.5565 + 1.5566 +var canvas = document.getElementById('c204'); 1.5567 +var ctx = canvas.getContext('2d'); 1.5568 + 1.5569 + 1.5570 +ctx.fillStyle = '#f00'; 1.5571 +ctx.fillStyle = 'transparent'; 1.5572 +ctx.fillRect(0, 0, 100, 50); 1.5573 +isPixel(ctx, 50,25, 0,0,0,0, 0); 1.5574 + 1.5575 + 1.5576 +} 1.5577 +</script> 1.5578 + 1.5579 +<!-- [[[ test_2d.fillStyle.parse.transparent-2.html ]]] --> 1.5580 + 1.5581 +<p>Canvas test: 2d.fillStyle.parse.transparent-2</p> 1.5582 +<canvas id="c205" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5583 +<script> 1.5584 + 1.5585 + 1.5586 +function test_2d_fillStyle_parse_transparent_2() { 1.5587 + 1.5588 +var canvas = document.getElementById('c205'); 1.5589 +var ctx = canvas.getContext('2d'); 1.5590 + 1.5591 + 1.5592 +ctx.fillStyle = '#f00'; 1.5593 +ctx.fillStyle = 'TrAnSpArEnT'; 1.5594 +ctx.fillRect(0, 0, 100, 50); 1.5595 +isPixel(ctx, 50,25, 0,0,0,0, 0); 1.5596 + 1.5597 + 1.5598 +} 1.5599 +</script> 1.5600 + 1.5601 +<!-- [[[ test_2d.getcontext.exists.html ]]] --> 1.5602 + 1.5603 +<p>Canvas test: 2d.getcontext.exists</p> 1.5604 +<!-- Testing: The 2D context is implemented --> 1.5605 +<canvas id="c206" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5606 +<script> 1.5607 + 1.5608 +function test_2d_getcontext_exists() { 1.5609 + 1.5610 +var canvas = document.getElementById('c206'); 1.5611 +var ctx = canvas.getContext('2d'); 1.5612 + 1.5613 +ok(canvas.getContext('2d') !== null, "canvas.getContext('2d') !== null"); 1.5614 + 1.5615 + 1.5616 +} 1.5617 +</script> 1.5618 + 1.5619 +<!-- [[[ test_2d.getcontext.shared.html ]]] --> 1.5620 + 1.5621 +<p>Canvas test: 2d.getcontext.shared</p> 1.5622 +<!-- Testing: getContext('2d') returns objects which share canvas state --> 1.5623 +<canvas id="c207" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5624 +<script> 1.5625 + 1.5626 + 1.5627 +function test_2d_getcontext_shared() { 1.5628 + 1.5629 +var canvas = document.getElementById('c207'); 1.5630 +var ctx = canvas.getContext('2d'); 1.5631 + 1.5632 +var ctx2 = canvas.getContext('2d'); 1.5633 +ctx.fillStyle = '#f00'; 1.5634 +ctx2.fillStyle = '#0f0'; 1.5635 +ctx.fillRect(0, 0, 100, 50); 1.5636 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5637 + 1.5638 + 1.5639 +} 1.5640 +</script> 1.5641 + 1.5642 +<!-- [[[ test_2d.getcontext.unique.html ]]] --> 1.5643 + 1.5644 +<p>Canvas test: 2d.getcontext.unique</p> 1.5645 +<!-- Testing: getContext('2d') returns the same object --> 1.5646 +<canvas id="c208" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5647 +<script> 1.5648 + 1.5649 +function test_2d_getcontext_unique() { 1.5650 + 1.5651 +var canvas = document.getElementById('c208'); 1.5652 +var ctx = canvas.getContext('2d'); 1.5653 + 1.5654 +ok(canvas.getContext('2d') === canvas.getContext('2d'), "canvas.getContext('2d') === canvas.getContext('2d')"); 1.5655 + 1.5656 + 1.5657 +} 1.5658 +</script> 1.5659 + 1.5660 +<!-- [[[ test_2d.gradient.empty.html ]]] --> 1.5661 + 1.5662 +<p>Canvas test: 2d.gradient.empty</p> 1.5663 +<canvas id="c209" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5664 +<script> 1.5665 + 1.5666 + 1.5667 +function test_2d_gradient_empty() { 1.5668 + 1.5669 +var canvas = document.getElementById('c209'); 1.5670 +var ctx = canvas.getContext('2d'); 1.5671 + 1.5672 +ctx.fillStyle = '#0f0'; 1.5673 +ctx.fillRect(0, 0, 100, 50); 1.5674 +var g = ctx.createLinearGradient(0, 0, 0, 50); 1.5675 +ctx.fillStyle = g; 1.5676 +ctx.fillRect(0, 0, 100, 50); 1.5677 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.5678 + 1.5679 + 1.5680 +} 1.5681 +</script> 1.5682 + 1.5683 +<!-- [[[ test_2d.gradient.interpolate.alpha.html ]]] --> 1.5684 + 1.5685 +<p>Canvas test: 2d.gradient.interpolate.alpha</p> 1.5686 +<canvas id="c210" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5687 +<script> 1.5688 + 1.5689 + 1.5690 +function test_2d_gradient_interpolate_alpha() { 1.5691 + 1.5692 +var canvas = document.getElementById('c210'); 1.5693 +var ctx = canvas.getContext('2d'); 1.5694 + 1.5695 +ctx.fillStyle = '#ff0'; 1.5696 +ctx.fillRect(0, 0, 100, 50); 1.5697 +var g = ctx.createLinearGradient(0, 0, 100, 0); 1.5698 +g.addColorStop(0, 'rgba(0,0,255, 0)'); 1.5699 +g.addColorStop(1, 'rgba(0,0,255, 1)'); 1.5700 +ctx.fillStyle = g; 1.5701 +ctx.fillRect(0, 0, 100, 50); 1.5702 +isPixel(ctx, 25,25, 191,191,63,255, 3); 1.5703 +isPixel(ctx, 50,25, 127,127,127,255, 3); 1.5704 +isPixel(ctx, 75,25, 63,63,191,255, 3); 1.5705 + 1.5706 + 1.5707 +} 1.5708 +</script> 1.5709 + 1.5710 +<!-- [[[ test_2d.gradient.interpolate.colour.html ]]] --> 1.5711 + 1.5712 +<p>Canvas test: 2d.gradient.interpolate.colour</p> 1.5713 +<canvas id="c211" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5714 +<script> 1.5715 + 1.5716 + 1.5717 +function test_2d_gradient_interpolate_colour() { 1.5718 + 1.5719 +var canvas = document.getElementById('c211'); 1.5720 +var ctx = canvas.getContext('2d'); 1.5721 + 1.5722 +var g = ctx.createLinearGradient(0, 0, 100, 0); 1.5723 +g.addColorStop(0, '#ff0'); 1.5724 +g.addColorStop(1, '#00f'); 1.5725 +ctx.fillStyle = g; 1.5726 +ctx.fillRect(0, 0, 100, 50); 1.5727 +isPixel(ctx, 25,25, 191,191,63,255, 3); 1.5728 +isPixel(ctx, 50,25, 127,127,127,255, 3); 1.5729 +isPixel(ctx, 75,25, 63,63,191,255, 3); 1.5730 + 1.5731 + 1.5732 +} 1.5733 +</script> 1.5734 + 1.5735 +<!-- [[[ test_2d.gradient.interpolate.colouralpha.html ]]] --> 1.5736 + 1.5737 +<p>Canvas test: 2d.gradient.interpolate.colouralpha</p> 1.5738 +<canvas id="c212" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5739 +<script> 1.5740 + 1.5741 + 1.5742 +function test_2d_gradient_interpolate_colouralpha() { 1.5743 + 1.5744 +var canvas = document.getElementById('c212'); 1.5745 +var ctx = canvas.getContext('2d'); 1.5746 + 1.5747 +var g = ctx.createLinearGradient(0, 0, 100, 0); 1.5748 +g.addColorStop(0, 'rgba(255,255,0, 0)'); 1.5749 +g.addColorStop(1, 'rgba(0,0,255, 1)'); 1.5750 +ctx.fillStyle = g; 1.5751 +ctx.fillRect(0, 0, 100, 50); 1.5752 +isPixel(ctx, 25,25, 191,191,63,63, 3); 1.5753 +isPixel(ctx, 50,25, 127,127,127,127, 3); 1.5754 +isPixel(ctx, 75,25, 63,63,191,191, 3); 1.5755 + 1.5756 + 1.5757 +} 1.5758 +</script> 1.5759 + 1.5760 +<!-- [[[ test_2d.gradient.interpolate.multiple.html ]]] --> 1.5761 + 1.5762 +<p>Canvas test: 2d.gradient.interpolate.multiple</p> 1.5763 +<canvas id="c213" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5764 +<script> 1.5765 + 1.5766 + 1.5767 +function test_2d_gradient_interpolate_multiple() { 1.5768 + 1.5769 +var canvas = document.getElementById('c213'); 1.5770 +var ctx = canvas.getContext('2d'); 1.5771 + 1.5772 +canvas.width = 200; 1.5773 +var g = ctx.createLinearGradient(0, 0, 200, 0); 1.5774 +g.addColorStop(0, '#ff0'); 1.5775 +g.addColorStop(0.5, '#0ff'); 1.5776 +g.addColorStop(1, '#f0f'); 1.5777 +ctx.fillStyle = g; 1.5778 +ctx.fillRect(0, 0, 200, 50); 1.5779 +isPixel(ctx, 50,25, 127,255,127,255, 3); 1.5780 +isPixel(ctx, 100,25, 0,255,255,255, 3); 1.5781 +isPixel(ctx, 150,25, 127,127,255,255, 3); 1.5782 + 1.5783 + 1.5784 +} 1.5785 +</script> 1.5786 + 1.5787 +<!-- [[[ test_2d.gradient.interpolate.outside.html ]]] --> 1.5788 + 1.5789 +<p>Canvas test: 2d.gradient.interpolate.outside</p> 1.5790 +<canvas id="c214" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5791 +<script> 1.5792 + 1.5793 + 1.5794 +function test_2d_gradient_interpolate_outside() { 1.5795 + 1.5796 +var canvas = document.getElementById('c214'); 1.5797 +var ctx = canvas.getContext('2d'); 1.5798 + 1.5799 +ctx.fillStyle = '#f00'; 1.5800 +ctx.fillRect(0, 0, 100, 50); 1.5801 + 1.5802 +var g = ctx.createLinearGradient(25, 0, 75, 0); 1.5803 +g.addColorStop(0.4, '#0f0'); 1.5804 +g.addColorStop(0.6, '#0f0'); 1.5805 + 1.5806 +ctx.fillStyle = g; 1.5807 +ctx.fillRect(0, 0, 100, 50); 1.5808 +isPixel(ctx, 20,25, 0,255,0,255, 2); 1.5809 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.5810 +isPixel(ctx, 80,25, 0,255,0,255, 2); 1.5811 + 1.5812 + 1.5813 +} 1.5814 +</script> 1.5815 + 1.5816 +<!-- [[[ test_2d.gradient.interpolate.overlap.html ]]] --> 1.5817 + 1.5818 +<p>Canvas test: 2d.gradient.interpolate.overlap</p> 1.5819 +<canvas id="c215" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5820 +<script> 1.5821 + 1.5822 + 1.5823 +function test_2d_gradient_interpolate_overlap() { 1.5824 + 1.5825 +var canvas = document.getElementById('c215'); 1.5826 +var ctx = canvas.getContext('2d'); 1.5827 + 1.5828 +if (!IsD2DEnabled() && !IsMacOSX10_5orOlder()) { 1.5829 + // On D2D the different nature of how gradients 1.5830 + // are drawn makes it so we cannot guarantee these stops are completely 1.5831 + // hard. 1.5832 + 1.5833 + // On OS X 10.5 quartz is confused by the overlapping stops: Bug #715235 1.5834 + canvas.width = 200; 1.5835 + var g = ctx.createLinearGradient(0, 0, 200, 0); 1.5836 + g.addColorStop(0, '#f00'); 1.5837 + g.addColorStop(0, '#ff0'); 1.5838 + g.addColorStop(0.25, '#00f'); 1.5839 + g.addColorStop(0.25, '#0f0'); 1.5840 + g.addColorStop(0.25, '#0f0'); 1.5841 + g.addColorStop(0.25, '#0f0'); 1.5842 + g.addColorStop(0.25, '#ff0'); 1.5843 + g.addColorStop(0.5, '#00f'); 1.5844 + g.addColorStop(0.5, '#0f0'); 1.5845 + g.addColorStop(0.75, '#00f'); 1.5846 + g.addColorStop(0.75, '#f00'); 1.5847 + g.addColorStop(0.75, '#ff0'); 1.5848 + g.addColorStop(0.5, '#0f0'); 1.5849 + g.addColorStop(0.5, '#0f0'); 1.5850 + g.addColorStop(0.5, '#ff0'); 1.5851 + g.addColorStop(1, '#00f'); 1.5852 + ctx.fillStyle = g; 1.5853 + ctx.fillRect(0, 0, 200, 50); 1.5854 + isPixel(ctx, 49,25, 0,0,255,255, 16); 1.5855 + isPixel(ctx, 51,25, 255,255,0,255, 16); 1.5856 + isPixel(ctx, 99,25, 0,0,255,255, 16); 1.5857 + isPixel(ctx, 101,25, 255,255,0,255, 16); 1.5858 + isPixel(ctx, 149,25, 0,0,255,255, 16); 1.5859 + isPixel(ctx, 151,25, 255,255,0,255, 16); 1.5860 +} 1.5861 +} 1.5862 +</script> 1.5863 + 1.5864 +<!-- [[[ test_2d.gradient.interpolate.overlap2.html ]]] --> 1.5865 + 1.5866 +<p>Canvas test: 2d.gradient.interpolate.overlap2</p> 1.5867 +<canvas id="c216" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5868 +<script> 1.5869 + 1.5870 + 1.5871 +function test_2d_gradient_interpolate_overlap2() { 1.5872 + 1.5873 +var canvas = document.getElementById('c216'); 1.5874 +var ctx = canvas.getContext('2d'); 1.5875 + 1.5876 +var g = ctx.createLinearGradient(0, 0, 100, 0); 1.5877 +var ps = [ 0, 1/10, 1/4, 1/3, 1/2, 3/4, 1 ]; 1.5878 +for (var p = 0; p < ps.length; ++p) 1.5879 +{ 1.5880 + g.addColorStop(ps[p], '#0f0'); 1.5881 + for (var i = 0; i < 15; ++i) 1.5882 + g.addColorStop(ps[p], '#f00'); 1.5883 + g.addColorStop(ps[p], '#0f0'); 1.5884 +} 1.5885 +ctx.fillStyle = g; 1.5886 +ctx.fillRect(0, 0, 100, 50); 1.5887 + 1.5888 +if (!IsMacOSX10_5orOlder()) { 1.5889 + // On OS X 10.5 quartz is confused by the overlapping stops: Bug #715235 1.5890 + isPixel(ctx, 1,25, 0,255,0,255, 0); 1.5891 + isPixel(ctx, 30,25, 0,255,0,255, 0); 1.5892 + isPixel(ctx, 40,25, 0,255,0,255, 0); 1.5893 + isPixel(ctx, 60,25, 0,255,0,255, 0); 1.5894 + isPixel(ctx, 80,25, 0,255,0,255, 0); 1.5895 +} 1.5896 + 1.5897 +} 1.5898 +</script> 1.5899 + 1.5900 +<!-- [[[ test_2d.gradient.interpolate.solid.html ]]] --> 1.5901 + 1.5902 +<p>Canvas test: 2d.gradient.interpolate.solid</p> 1.5903 +<canvas id="c217" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5904 +<script> 1.5905 + 1.5906 + 1.5907 +function test_2d_gradient_interpolate_solid() { 1.5908 + 1.5909 +var canvas = document.getElementById('c217'); 1.5910 +var ctx = canvas.getContext('2d'); 1.5911 + 1.5912 +var g = ctx.createLinearGradient(0, 0, 100, 0); 1.5913 +g.addColorStop(0, '#0f0'); 1.5914 +g.addColorStop(1, '#0f0'); 1.5915 +ctx.fillStyle = g; 1.5916 +ctx.fillRect(0, 0, 100, 50); 1.5917 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.5918 + 1.5919 + 1.5920 +} 1.5921 +</script> 1.5922 + 1.5923 +<!-- [[[ test_2d.gradient.interpolate.vertical.html ]]] --> 1.5924 + 1.5925 +<p>Canvas test: 2d.gradient.interpolate.vertical</p> 1.5926 +<canvas id="c218" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5927 +<script> 1.5928 + 1.5929 + 1.5930 +function test_2d_gradient_interpolate_vertical() { 1.5931 + 1.5932 +var canvas = document.getElementById('c218'); 1.5933 +var ctx = canvas.getContext('2d'); 1.5934 + 1.5935 +var g = ctx.createLinearGradient(0, 0, 0, 50); 1.5936 +g.addColorStop(0, '#ff0'); 1.5937 +g.addColorStop(1, '#00f'); 1.5938 +ctx.fillStyle = g; 1.5939 +ctx.fillRect(0, 0, 100, 50); 1.5940 +isPixel(ctx, 50,12, 191,191,63,255, 10); 1.5941 +isPixel(ctx, 50,25, 127,127,127,255, 5); 1.5942 +isPixel(ctx, 50,37, 63,63,191,255, 10); 1.5943 + 1.5944 + 1.5945 +} 1.5946 +</script> 1.5947 + 1.5948 +<!-- [[[ test_2d.gradient.interpolate.zerosize.html ]]] --> 1.5949 + 1.5950 +<p>Canvas test: 2d.gradient.interpolate.zerosize</p> 1.5951 +<canvas id="c219" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5952 +<script> 1.5953 + 1.5954 + 1.5955 + 1.5956 +function test_2d_gradient_interpolate_zerosize() { 1.5957 + 1.5958 +var canvas = document.getElementById('c219'); 1.5959 +var ctx = canvas.getContext('2d'); 1.5960 + 1.5961 +ctx.fillStyle = '#0f0'; 1.5962 +ctx.fillRect(0, 0, 100, 50); 1.5963 + 1.5964 +var g = ctx.createLinearGradient(50, 25, 50, 25); // zero-length line (undefined direction) 1.5965 +g.addColorStop(0, '#f00'); 1.5966 +g.addColorStop(1, '#f00'); 1.5967 +ctx.fillStyle = g; 1.5968 +ctx.fillRect(0, 0, 100, 50); 1.5969 + 1.5970 +todo_isPixel(ctx, 40,20, 0,255,0,255, 2); 1.5971 + 1.5972 +} 1.5973 +</script> 1.5974 + 1.5975 +<!-- [[[ test_2d.gradient.linear.nonfinite.html ]]] --> 1.5976 + 1.5977 +<p>Canvas test: 2d.gradient.linear.nonfinite</p> 1.5978 +<!-- Testing: createLinearGradient() throws NOT_SUPPORTED_ERR if arguments are not finite --> 1.5979 +<canvas id="c220" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.5980 +<script> 1.5981 + 1.5982 +function test_2d_gradient_linear_nonfinite() { 1.5983 + 1.5984 +var canvas = document.getElementById('c220'); 1.5985 +var ctx = canvas.getContext('2d'); 1.5986 + 1.5987 +var _thrown = undefined; try { 1.5988 + ctx.createLinearGradient(Infinity, 0, 1, 0); 1.5989 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.5990 +var _thrown = undefined; try { 1.5991 + ctx.createLinearGradient(-Infinity, 0, 1, 0); 1.5992 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.5993 +var _thrown = undefined; try { 1.5994 + ctx.createLinearGradient(NaN, 0, 1, 0); 1.5995 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.5996 +var _thrown = undefined; try { 1.5997 + ctx.createLinearGradient(0, Infinity, 1, 0); 1.5998 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.5999 +var _thrown = undefined; try { 1.6000 + ctx.createLinearGradient(0, -Infinity, 1, 0); 1.6001 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6002 +var _thrown = undefined; try { 1.6003 + ctx.createLinearGradient(0, NaN, 1, 0); 1.6004 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6005 +var _thrown = undefined; try { 1.6006 + ctx.createLinearGradient(0, 0, Infinity, 0); 1.6007 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6008 +var _thrown = undefined; try { 1.6009 + ctx.createLinearGradient(0, 0, -Infinity, 0); 1.6010 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6011 +var _thrown = undefined; try { 1.6012 + ctx.createLinearGradient(0, 0, NaN, 0); 1.6013 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6014 +var _thrown = undefined; try { 1.6015 + ctx.createLinearGradient(0, 0, 1, Infinity); 1.6016 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6017 +var _thrown = undefined; try { 1.6018 + ctx.createLinearGradient(0, 0, 1, -Infinity); 1.6019 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6020 +var _thrown = undefined; try { 1.6021 + ctx.createLinearGradient(0, 0, 1, NaN); 1.6022 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6023 +var _thrown = undefined; try { 1.6024 + ctx.createLinearGradient(Infinity, Infinity, 1, 0); 1.6025 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6026 +var _thrown = undefined; try { 1.6027 + ctx.createLinearGradient(Infinity, Infinity, Infinity, 0); 1.6028 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6029 +var _thrown = undefined; try { 1.6030 + ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity); 1.6031 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6032 +var _thrown = undefined; try { 1.6033 + ctx.createLinearGradient(Infinity, Infinity, 1, Infinity); 1.6034 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6035 +var _thrown = undefined; try { 1.6036 + ctx.createLinearGradient(Infinity, 0, Infinity, 0); 1.6037 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6038 +var _thrown = undefined; try { 1.6039 + ctx.createLinearGradient(Infinity, 0, Infinity, Infinity); 1.6040 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6041 +var _thrown = undefined; try { 1.6042 + ctx.createLinearGradient(Infinity, 0, 1, Infinity); 1.6043 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6044 +var _thrown = undefined; try { 1.6045 + ctx.createLinearGradient(0, Infinity, Infinity, 0); 1.6046 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6047 +var _thrown = undefined; try { 1.6048 + ctx.createLinearGradient(0, Infinity, Infinity, Infinity); 1.6049 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6050 +var _thrown = undefined; try { 1.6051 + ctx.createLinearGradient(0, Infinity, 1, Infinity); 1.6052 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6053 +var _thrown = undefined; try { 1.6054 + ctx.createLinearGradient(0, 0, Infinity, Infinity); 1.6055 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6056 + 1.6057 + 1.6058 +} 1.6059 +</script> 1.6060 + 1.6061 +<!-- [[[ test_2d.gradient.linear.transform.1.html ]]] --> 1.6062 + 1.6063 +<p>Canvas test: 2d.gradient.linear.transform.1</p> 1.6064 +<!-- Testing: Linear gradient coordinates are relative to the coordinate space at the time of filling --> 1.6065 +<canvas id="c221" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6066 +<script> 1.6067 + 1.6068 + 1.6069 +function test_2d_gradient_linear_transform_1() { 1.6070 + 1.6071 +var canvas = document.getElementById('c221'); 1.6072 +var ctx = canvas.getContext('2d'); 1.6073 + 1.6074 +var g = ctx.createLinearGradient(0, 0, 200, 0); 1.6075 +g.addColorStop(0, '#f00'); 1.6076 +g.addColorStop(0.25, '#0f0'); 1.6077 +g.addColorStop(0.75, '#0f0'); 1.6078 +g.addColorStop(1, '#f00'); 1.6079 +ctx.fillStyle = g; 1.6080 +ctx.translate(-50, 0); 1.6081 +ctx.fillRect(50, 0, 100, 50); 1.6082 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.6083 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.6084 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.6085 + 1.6086 + 1.6087 +} 1.6088 +</script> 1.6089 + 1.6090 +<!-- [[[ test_2d.gradient.linear.transform.2.html ]]] --> 1.6091 + 1.6092 +<p>Canvas test: 2d.gradient.linear.transform.2</p> 1.6093 +<!-- Testing: Linear gradient coordinates are relative to the coordinate space at the time of filling --> 1.6094 +<canvas id="c222" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6095 +<script> 1.6096 + 1.6097 + 1.6098 +function test_2d_gradient_linear_transform_2() { 1.6099 + 1.6100 +var canvas = document.getElementById('c222'); 1.6101 +var ctx = canvas.getContext('2d'); 1.6102 + 1.6103 +ctx.translate(100, 0); 1.6104 +var g = ctx.createLinearGradient(0, 0, 200, 0); 1.6105 +g.addColorStop(0, '#f00'); 1.6106 +g.addColorStop(0.25, '#0f0'); 1.6107 +g.addColorStop(0.75, '#0f0'); 1.6108 +g.addColorStop(1, '#f00'); 1.6109 +ctx.fillStyle = g; 1.6110 +ctx.translate(-150, 0); 1.6111 +ctx.fillRect(50, 0, 100, 50); 1.6112 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.6113 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.6114 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.6115 + 1.6116 + 1.6117 +} 1.6118 +</script> 1.6119 + 1.6120 +<!-- [[[ test_2d.gradient.linear.transform.3.html ]]] --> 1.6121 + 1.6122 +<p>Canvas test: 2d.gradient.linear.transform.3</p> 1.6123 +<!-- Testing: Linear gradient transforms do not experience broken caching effects --> 1.6124 +<canvas id="c223" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6125 +<script> 1.6126 + 1.6127 + 1.6128 + 1.6129 +function test_2d_gradient_linear_transform_3() { 1.6130 + 1.6131 +var canvas = document.getElementById('c223'); 1.6132 +var ctx = canvas.getContext('2d'); 1.6133 + 1.6134 +var g = ctx.createLinearGradient(0, 0, 200, 0); 1.6135 +g.addColorStop(0, '#f00'); 1.6136 +g.addColorStop(0.25, '#0f0'); 1.6137 +g.addColorStop(0.75, '#0f0'); 1.6138 +g.addColorStop(1, '#f00'); 1.6139 +ctx.fillStyle = g; 1.6140 +ctx.fillRect(0, 0, 100, 50); 1.6141 +ctx.translate(-50, 0); 1.6142 +ctx.fillRect(50, 0, 100, 50); 1.6143 + 1.6144 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.6145 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.6146 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.6147 +} 1.6148 +</script> 1.6149 + 1.6150 +<!-- [[[ test_2d.gradient.object.compare.html ]]] --> 1.6151 + 1.6152 +<p>Canvas test: 2d.gradient.object.compare</p> 1.6153 +<canvas id="c224" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6154 +<script> 1.6155 + 1.6156 +function test_2d_gradient_object_compare() { 1.6157 + 1.6158 +var canvas = document.getElementById('c224'); 1.6159 +var ctx = canvas.getContext('2d'); 1.6160 + 1.6161 +var g1 = ctx.createLinearGradient(0, 0, 100, 0); 1.6162 +var g2 = ctx.createLinearGradient(0, 0, 100, 0); 1.6163 +ok(g1 !== g2, "g1 !== g2"); 1.6164 +ctx.fillStyle = g1; 1.6165 +ok(ctx.fillStyle === g1, "ctx.fillStyle === g1"); 1.6166 + 1.6167 + 1.6168 +} 1.6169 +</script> 1.6170 + 1.6171 +<!-- [[[ test_2d.gradient.object.crosscanvas.html ]]] --> 1.6172 + 1.6173 +<p>Canvas test: 2d.gradient.object.crosscanvas</p> 1.6174 +<canvas id="c225" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6175 +<script> 1.6176 + 1.6177 + 1.6178 +function test_2d_gradient_object_crosscanvas() { 1.6179 + 1.6180 +var canvas = document.getElementById('c225'); 1.6181 +var ctx = canvas.getContext('2d'); 1.6182 + 1.6183 +ctx.fillStyle = '#f00'; 1.6184 +ctx.fillRect(0, 0, 100, 50); 1.6185 +var g = document.createElement('canvas').getContext('2d').createLinearGradient(0, 0, 100, 0); 1.6186 +g.addColorStop(0, '#0f0'); 1.6187 +g.addColorStop(1, '#0f0'); 1.6188 +ctx.fillStyle = g; 1.6189 +ctx.fillRect(0, 0, 100, 50); 1.6190 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.6191 + 1.6192 + 1.6193 +} 1.6194 +</script> 1.6195 + 1.6196 +<!-- [[[ test_2d.gradient.object.invalidcolour.html ]]] --> 1.6197 + 1.6198 +<p>Canvas test: 2d.gradient.object.invalidcolour</p> 1.6199 +<canvas id="c226" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6200 +<script> 1.6201 + 1.6202 +function test_2d_gradient_object_invalidcolour() { 1.6203 + 1.6204 +var canvas = document.getElementById('c226'); 1.6205 +var ctx = canvas.getContext('2d'); 1.6206 + 1.6207 +var g = ctx.createLinearGradient(0, 0, 100, 0); 1.6208 +var _thrown = undefined; try { 1.6209 + g.addColorStop(0, ""); 1.6210 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "SyntaxError" && _thrown.code == DOMException.SYNTAX_ERR, "should throw SyntaxError"); 1.6211 +var _thrown = undefined; try { 1.6212 + g.addColorStop(0, 'undefined'); 1.6213 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "SyntaxError" && _thrown.code == DOMException.SYNTAX_ERR, "should throw SyntaxError"); 1.6214 + 1.6215 + 1.6216 +} 1.6217 +</script> 1.6218 + 1.6219 +<!-- [[[ test_2d.gradient.object.invalidoffset.html ]]] --> 1.6220 + 1.6221 +<p>Canvas test: 2d.gradient.object.invalidoffset</p> 1.6222 +<canvas id="c227" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6223 +<script> 1.6224 + 1.6225 +function test_2d_gradient_object_invalidoffset() { 1.6226 + 1.6227 +var canvas = document.getElementById('c227'); 1.6228 +var ctx = canvas.getContext('2d'); 1.6229 + 1.6230 +var g = ctx.createLinearGradient(0, 0, 100, 0); 1.6231 +var _thrown = undefined; try { 1.6232 + g.addColorStop(-1, '#000'); 1.6233 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.6234 +var _thrown = undefined; try { 1.6235 + g.addColorStop(2, '#000'); 1.6236 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.6237 +var _thrown = undefined; try { 1.6238 + g.addColorStop(Infinity, '#000'); 1.6239 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); 1.6240 +var _thrown = undefined; try { 1.6241 + g.addColorStop(-Infinity, '#000'); 1.6242 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); 1.6243 +var _thrown = undefined; try { 1.6244 + g.addColorStop(NaN, '#000'); 1.6245 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); 1.6246 + 1.6247 + 1.6248 +} 1.6249 +</script> 1.6250 + 1.6251 +<!-- [[[ test_2d.gradient.object.return.html ]]] --> 1.6252 + 1.6253 +<p>Canvas test: 2d.gradient.object.return</p> 1.6254 +<!-- Testing: createLinearGradient() and createRadialGradient() returns objects implementing CanvasGradient --> 1.6255 +<canvas id="c228" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6256 +<script> 1.6257 + 1.6258 +function test_2d_gradient_object_return() { 1.6259 + 1.6260 +var canvas = document.getElementById('c228'); 1.6261 +var ctx = canvas.getContext('2d'); 1.6262 + 1.6263 +window.CanvasGradient.prototype.thisImplementsCanvasGradient = true; 1.6264 + 1.6265 +var g1 = ctx.createLinearGradient(0, 0, 100, 0); 1.6266 +ok(g1.addColorStop !== undefined, "g1.addColorStop !== undefined"); 1.6267 +ok(g1.thisImplementsCanvasGradient === true, "g1.thisImplementsCanvasGradient === true"); 1.6268 + 1.6269 +var g2 = ctx.createRadialGradient(0, 0, 10, 0, 0, 20); 1.6270 +ok(g2.addColorStop !== undefined, "g2.addColorStop !== undefined"); 1.6271 +ok(g2.thisImplementsCanvasGradient === true, "g2.thisImplementsCanvasGradient === true"); 1.6272 + 1.6273 + 1.6274 +} 1.6275 +</script> 1.6276 + 1.6277 +<!-- [[[ test_2d.gradient.object.type.html ]]] --> 1.6278 + 1.6279 +<p>Canvas test: 2d.gradient.object.type</p> 1.6280 +<!-- Testing: window.CanvasGradient exists and has the right properties --> 1.6281 +<canvas id="c229" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6282 +<script> 1.6283 + 1.6284 +function test_2d_gradient_object_type() { 1.6285 + 1.6286 +var canvas = document.getElementById('c229'); 1.6287 +var ctx = canvas.getContext('2d'); 1.6288 + 1.6289 +ok(window.CanvasGradient !== undefined, "window.CanvasGradient !== undefined"); 1.6290 +ok(window.CanvasGradient.prototype.addColorStop !== undefined, "window.CanvasGradient.prototype.addColorStop !== undefined"); 1.6291 + 1.6292 + 1.6293 +} 1.6294 +</script> 1.6295 + 1.6296 +<!-- [[[ test_2d.gradient.object.update.html ]]] --> 1.6297 + 1.6298 +<p>Canvas test: 2d.gradient.object.update</p> 1.6299 +<canvas id="c230" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6300 +<script> 1.6301 + 1.6302 + 1.6303 +function test_2d_gradient_object_update() { 1.6304 + 1.6305 +var canvas = document.getElementById('c230'); 1.6306 +var ctx = canvas.getContext('2d'); 1.6307 + 1.6308 +var g = ctx.createLinearGradient(-100, 0, 200, 0); 1.6309 +g.addColorStop(0, '#f00'); 1.6310 +g.addColorStop(1, '#f00'); 1.6311 +ctx.fillStyle = g; 1.6312 +g.addColorStop(0.1, '#0f0'); 1.6313 +g.addColorStop(0.9, '#0f0'); 1.6314 +ctx.fillRect(0, 0, 100, 50); 1.6315 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.6316 + 1.6317 + 1.6318 +} 1.6319 +</script> 1.6320 + 1.6321 +<!-- [[[ test_2d.gradient.radial.cone.behind.html ]]] --> 1.6322 + 1.6323 +<p>Canvas test: 2d.gradient.radial.cone.behind</p> 1.6324 +<canvas id="c231" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6325 +<script> 1.6326 + 1.6327 + 1.6328 + 1.6329 +function test_2d_gradient_radial_cone_behind() { 1.6330 + 1.6331 +var canvas = document.getElementById('c231'); 1.6332 +var ctx = canvas.getContext('2d'); 1.6333 + 1.6334 +ctx.fillStyle = '#0f0'; 1.6335 +ctx.fillRect(0, 0, 100, 50); 1.6336 + 1.6337 +var g = ctx.createRadialGradient(120, 25, 10, 211, 25, 100); 1.6338 +g.addColorStop(0, '#f00'); 1.6339 +g.addColorStop(1, '#f00'); 1.6340 +ctx.fillStyle = g; 1.6341 +ctx.fillRect(0, 0, 100, 50); 1.6342 + 1.6343 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.6344 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.6345 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.6346 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.6347 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.6348 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.6349 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.6350 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.6351 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.6352 + 1.6353 + 1.6354 +} 1.6355 +</script> 1.6356 + 1.6357 +<!-- [[[ test_2d.gradient.radial.cone.beside.html ]]] --> 1.6358 + 1.6359 +<p>Canvas test: 2d.gradient.radial.cone.beside</p> 1.6360 +<canvas id="c232" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6361 +<script> 1.6362 + 1.6363 + 1.6364 + 1.6365 +function test_2d_gradient_radial_cone_beside() { 1.6366 + 1.6367 +var canvas = document.getElementById('c232'); 1.6368 +var ctx = canvas.getContext('2d'); 1.6369 + 1.6370 +ctx.fillStyle = '#0f0'; 1.6371 +ctx.fillRect(0, 0, 100, 50); 1.6372 + 1.6373 +var g = ctx.createRadialGradient(0, 100, 40, 100, 100, 50); 1.6374 +g.addColorStop(0, '#f00'); 1.6375 +g.addColorStop(1, '#f00'); 1.6376 +ctx.fillStyle = g; 1.6377 +ctx.fillRect(0, 0, 100, 50); 1.6378 + 1.6379 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.6380 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.6381 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.6382 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.6383 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.6384 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.6385 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.6386 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.6387 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.6388 + 1.6389 + 1.6390 +} 1.6391 +</script> 1.6392 + 1.6393 +<!-- [[[ test_2d.gradient.radial.cone.bottom.html ]]] --> 1.6394 + 1.6395 +<p>Canvas test: 2d.gradient.radial.cone.bottom</p> 1.6396 +<canvas id="c233" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6397 +<script> 1.6398 + 1.6399 + 1.6400 +function test_2d_gradient_radial_cone_bottom() { 1.6401 + 1.6402 +var canvas = document.getElementById('c233'); 1.6403 +var ctx = canvas.getContext('2d'); 1.6404 + 1.6405 +ctx.fillStyle = '#f00'; 1.6406 +ctx.fillRect(0, 0, 100, 50); 1.6407 + 1.6408 +var g = ctx.createRadialGradient(210, 25, 100, 230, 25, 101); 1.6409 +g.addColorStop(0, '#0f0'); 1.6410 +g.addColorStop(1, '#f00'); 1.6411 +ctx.fillStyle = g; 1.6412 +ctx.fillRect(0, 0, 100, 50); 1.6413 + 1.6414 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.6415 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.6416 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.6417 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.6418 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.6419 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.6420 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.6421 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.6422 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.6423 + 1.6424 + 1.6425 +} 1.6426 +</script> 1.6427 + 1.6428 +<!-- [[[ test_2d.gradient.radial.cone.cylinder.html ]]] --> 1.6429 + 1.6430 +<p>Canvas test: 2d.gradient.radial.cone.cylinder</p> 1.6431 +<canvas id="c234" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6432 +<script> 1.6433 + 1.6434 + 1.6435 +function test_2d_gradient_radial_cone_cylinder() { 1.6436 + 1.6437 +var canvas = document.getElementById('c234'); 1.6438 +var ctx = canvas.getContext('2d'); 1.6439 + 1.6440 +ctx.fillStyle = '#f00'; 1.6441 +ctx.fillRect(0, 0, 100, 50); 1.6442 + 1.6443 +var g = ctx.createRadialGradient(210, 25, 100, 230, 25, 100); 1.6444 +g.addColorStop(0, '#0f0'); 1.6445 +g.addColorStop(1, '#f00'); 1.6446 +ctx.fillStyle = g; 1.6447 +ctx.fillRect(0, 0, 100, 50); 1.6448 + 1.6449 +isPixel(ctx, 1, 1, 0, 255, 0, 255, 0); 1.6450 +isPixel(ctx, 50, 1, 0, 255, 0, 255, 0); 1.6451 +isPixel(ctx, 98, 1, 0, 255, 0, 255, 0); 1.6452 +isPixel(ctx, 1, 25, 0, 255, 0, 255, 0); 1.6453 +isPixel(ctx, 50, 25, 0, 255, 0, 255, 0); 1.6454 +isPixel(ctx, 98, 25, 0, 255, 0, 255, 0); 1.6455 +isPixel(ctx, 1, 48, 0, 255, 0, 255, 0); 1.6456 +isPixel(ctx, 50, 48, 0, 255, 0, 255, 0); 1.6457 +isPixel(ctx, 98, 48, 0, 255, 0, 255, 0); 1.6458 + 1.6459 +} 1.6460 +</script> 1.6461 + 1.6462 +<!-- [[[ test_2d.gradient.radial.cone.front.html ]]] --> 1.6463 + 1.6464 +<p>Canvas test: 2d.gradient.radial.cone.front</p> 1.6465 +<canvas id="c235" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6466 +<script> 1.6467 + 1.6468 + 1.6469 +function test_2d_gradient_radial_cone_front() { 1.6470 + 1.6471 +var canvas = document.getElementById('c235'); 1.6472 +var ctx = canvas.getContext('2d'); 1.6473 + 1.6474 +ctx.fillStyle = '#f00'; 1.6475 +ctx.fillRect(0, 0, 100, 50); 1.6476 + 1.6477 +var g = ctx.createRadialGradient(311, 25, 10, 210, 25, 100); 1.6478 +g.addColorStop(0, '#f00'); 1.6479 +g.addColorStop(1, '#0f0'); 1.6480 +ctx.fillStyle = g; 1.6481 +ctx.fillRect(0, 0, 100, 50); 1.6482 + 1.6483 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.6484 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.6485 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.6486 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.6487 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.6488 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.6489 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.6490 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.6491 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.6492 + 1.6493 + 1.6494 +} 1.6495 +</script> 1.6496 + 1.6497 +<!-- [[[ test_2d.gradient.radial.cone.shape1.html ]]] --> 1.6498 + 1.6499 +<p>Canvas test: 2d.gradient.radial.cone.shape1</p> 1.6500 +<canvas id="c236" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6501 +<script> 1.6502 + 1.6503 + 1.6504 +function test_2d_gradient_radial_cone_shape1() { 1.6505 + 1.6506 +var canvas = document.getElementById('c236'); 1.6507 +var ctx = canvas.getContext('2d'); 1.6508 + 1.6509 +var tol = 1; // tolerance to avoid antialiasing artifacts 1.6510 + 1.6511 +ctx.fillStyle = '#0f0'; 1.6512 +ctx.fillRect(0, 0, 100, 50); 1.6513 + 1.6514 +ctx.fillStyle = '#f00'; 1.6515 +ctx.beginPath(); 1.6516 +ctx.moveTo(30+tol, 40); 1.6517 +ctx.lineTo(110, -20+tol); 1.6518 +ctx.lineTo(110, 100-tol); 1.6519 +ctx.fill(); 1.6520 + 1.6521 +var g = ctx.createRadialGradient(30+10*5/2, 40, 10*3/2, 30+10*15/4, 40, 10*9/4); 1.6522 +g.addColorStop(0, '#0f0'); 1.6523 +g.addColorStop(1, '#0f0'); 1.6524 +ctx.fillStyle = g; 1.6525 +ctx.fillRect(0, 0, 100, 50); 1.6526 + 1.6527 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.6528 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.6529 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.6530 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.6531 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.6532 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.6533 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.6534 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.6535 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.6536 + 1.6537 + 1.6538 +} 1.6539 +</script> 1.6540 + 1.6541 +<!-- [[[ test_2d.gradient.radial.cone.shape2.html ]]] --> 1.6542 + 1.6543 +<p>Canvas test: 2d.gradient.radial.cone.shape2</p> 1.6544 +<canvas id="c237" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6545 +<script> 1.6546 + 1.6547 + 1.6548 + 1.6549 +function test_2d_gradient_radial_cone_shape2() { 1.6550 + 1.6551 +var canvas = document.getElementById('c237'); 1.6552 +var ctx = canvas.getContext('2d'); 1.6553 + 1.6554 +var tol = 1; // tolerance to avoid antialiasing artifacts 1.6555 + 1.6556 +ctx.fillStyle = '#0f0'; 1.6557 +ctx.fillRect(0, 0, 100, 50); 1.6558 + 1.6559 +var g = ctx.createRadialGradient(30+10*5/2, 40, 10*3/2, 30+10*15/4, 40, 10*9/4); 1.6560 +g.addColorStop(0, '#f00'); 1.6561 +g.addColorStop(1, '#f00'); 1.6562 +ctx.fillStyle = g; 1.6563 +ctx.fillRect(0, 0, 100, 50); 1.6564 + 1.6565 +ctx.fillStyle = '#0f0'; 1.6566 +ctx.beginPath(); 1.6567 +ctx.moveTo(30-tol, 40); 1.6568 +ctx.lineTo(110, -20-tol); 1.6569 +ctx.lineTo(110, 100+tol); 1.6570 +ctx.fill(); 1.6571 + 1.6572 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.6573 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.6574 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.6575 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.6576 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.6577 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.6578 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.6579 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.6580 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.6581 + 1.6582 + 1.6583 +} 1.6584 +</script> 1.6585 + 1.6586 +<!-- [[[ test_2d.gradient.radial.cone.top.html ]]] --> 1.6587 + 1.6588 +<p>Canvas test: 2d.gradient.radial.cone.top</p> 1.6589 +<canvas id="c238" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6590 +<script> 1.6591 + 1.6592 + 1.6593 +function test_2d_gradient_radial_cone_top() { 1.6594 + 1.6595 +var canvas = document.getElementById('c238'); 1.6596 +var ctx = canvas.getContext('2d'); 1.6597 + 1.6598 +ctx.fillStyle = '#f00'; 1.6599 +ctx.fillRect(0, 0, 100, 50); 1.6600 + 1.6601 +var g = ctx.createRadialGradient(230, 25, 100, 100, 25, 101); 1.6602 +g.addColorStop(0, '#f00'); 1.6603 +g.addColorStop(1, '#0f0'); 1.6604 +ctx.fillStyle = g; 1.6605 +ctx.fillRect(0, 0, 100, 50); 1.6606 + 1.6607 +isPixel(ctx, 1, 1, 0, 255, 0, 255, 0); 1.6608 +isPixel(ctx, 50, 1, 0, 255, 0, 255, 0); 1.6609 +isPixel(ctx, 98, 1, 0, 255, 0, 255, 0); 1.6610 +isPixel(ctx, 1, 25, 0, 255, 0, 255, 0); 1.6611 +isPixel(ctx, 50, 25, 0, 255, 0, 255, 0); 1.6612 +isPixel(ctx, 98, 25, 0, 255, 0, 255, 0); 1.6613 +isPixel(ctx, 1, 48, 0, 255, 0, 255, 0); 1.6614 +isPixel(ctx, 50, 48, 0, 255, 0, 255, 0); 1.6615 +isPixel(ctx, 98, 48, 0, 255, 0, 255, 0); 1.6616 + 1.6617 +} 1.6618 +</script> 1.6619 + 1.6620 +<!-- [[[ test_2d.gradient.radial.equal.html ]]] --> 1.6621 + 1.6622 +<p>Canvas test: 2d.gradient.radial.equal</p> 1.6623 +<canvas id="c239" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6624 +<script> 1.6625 + 1.6626 + 1.6627 + 1.6628 +function test_2d_gradient_radial_equal() { 1.6629 + 1.6630 +var canvas = document.getElementById('c239'); 1.6631 +var ctx = canvas.getContext('2d'); 1.6632 + 1.6633 +ctx.fillStyle = '#0f0'; 1.6634 +ctx.fillRect(0, 0, 100, 50); 1.6635 + 1.6636 +var g = ctx.createRadialGradient(50, 25, 20, 50, 25, 20); 1.6637 +g.addColorStop(0, '#f00'); 1.6638 +g.addColorStop(1, '#f00'); 1.6639 +ctx.fillStyle = g; 1.6640 +ctx.fillRect(0, 0, 100, 50); 1.6641 + 1.6642 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.6643 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.6644 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.6645 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.6646 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.6647 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.6648 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.6649 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.6650 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.6651 + 1.6652 + 1.6653 +} 1.6654 +</script> 1.6655 + 1.6656 +<!-- [[[ test_2d.gradient.radial.inside1.html ]]] --> 1.6657 + 1.6658 +<p>Canvas test: 2d.gradient.radial.inside1</p> 1.6659 +<canvas id="c240" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6660 +<script> 1.6661 + 1.6662 + 1.6663 +function test_2d_gradient_radial_inside1() { 1.6664 + 1.6665 +if (IsAcceleratedSkia()) 1.6666 + return; 1.6667 + 1.6668 +var canvas = document.getElementById('c240'); 1.6669 +var ctx = canvas.getContext('2d'); 1.6670 + 1.6671 +ctx.fillStyle = '#f00'; 1.6672 +ctx.fillRect(0, 0, 100, 50); 1.6673 + 1.6674 +var g = ctx.createRadialGradient(50, 25, 100, 50, 25, 200); 1.6675 +g.addColorStop(0, '#0f0'); 1.6676 +g.addColorStop(1, '#f00'); 1.6677 +ctx.fillStyle = g; 1.6678 +ctx.fillRect(0, 0, 100, 50); 1.6679 + 1.6680 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.6681 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.6682 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.6683 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.6684 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.6685 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.6686 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.6687 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.6688 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.6689 + 1.6690 + 1.6691 +} 1.6692 +</script> 1.6693 + 1.6694 +<!-- [[[ test_2d.gradient.radial.inside2.html ]]] --> 1.6695 + 1.6696 +<p>Canvas test: 2d.gradient.radial.inside2</p> 1.6697 +<canvas id="c241" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6698 +<script> 1.6699 + 1.6700 + 1.6701 +function test_2d_gradient_radial_inside2() { 1.6702 + 1.6703 +var canvas = document.getElementById('c241'); 1.6704 +var ctx = canvas.getContext('2d'); 1.6705 + 1.6706 +ctx.fillStyle = '#f00'; 1.6707 +ctx.fillRect(0, 0, 100, 50); 1.6708 + 1.6709 +var g = ctx.createRadialGradient(50, 25, 200, 50, 25, 100); 1.6710 +g.addColorStop(0, '#f00'); 1.6711 +g.addColorStop(1, '#0f0'); 1.6712 +ctx.fillStyle = g; 1.6713 +ctx.fillRect(0, 0, 100, 50); 1.6714 + 1.6715 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.6716 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.6717 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.6718 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.6719 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.6720 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.6721 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.6722 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.6723 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.6724 + 1.6725 + 1.6726 +} 1.6727 +</script> 1.6728 + 1.6729 +<!-- [[[ test_2d.gradient.radial.inside3.html ]]] --> 1.6730 + 1.6731 +<p>Canvas test: 2d.gradient.radial.inside3</p> 1.6732 +<canvas id="c242" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6733 +<script> 1.6734 + 1.6735 + 1.6736 +function test_2d_gradient_radial_inside3() { 1.6737 + 1.6738 +var canvas = document.getElementById('c242'); 1.6739 +var ctx = canvas.getContext('2d'); 1.6740 + 1.6741 +ctx.fillStyle = '#f00'; 1.6742 +ctx.fillRect(0, 0, 100, 50); 1.6743 + 1.6744 +var g = ctx.createRadialGradient(50, 25, 200, 50, 25, 100); 1.6745 +g.addColorStop(0, '#f00'); 1.6746 +g.addColorStop(0.993, '#f00'); 1.6747 +g.addColorStop(1, '#0f0'); 1.6748 +ctx.fillStyle = g; 1.6749 +ctx.fillRect(0, 0, 100, 50); 1.6750 + 1.6751 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.6752 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.6753 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.6754 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.6755 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.6756 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.6757 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.6758 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.6759 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.6760 + 1.6761 + 1.6762 +} 1.6763 +</script> 1.6764 + 1.6765 +<!-- [[[ test_2d.gradient.radial.negative.html ]]] --> 1.6766 + 1.6767 +<p>Canvas test: 2d.gradient.radial.negative</p> 1.6768 +<!-- Testing: createRadialGradient() throws INDEX_SIZE_ERR if either radius is negative --> 1.6769 +<canvas id="c243" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6770 +<script> 1.6771 + 1.6772 +function test_2d_gradient_radial_negative() { 1.6773 + 1.6774 +var canvas = document.getElementById('c243'); 1.6775 +var ctx = canvas.getContext('2d'); 1.6776 + 1.6777 +var _thrown = undefined; try { 1.6778 + ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1); 1.6779 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.6780 +var _thrown = undefined; try { 1.6781 + ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1); 1.6782 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.6783 +var _thrown = undefined; try { 1.6784 + ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1); 1.6785 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.6786 + 1.6787 + 1.6788 +} 1.6789 +</script> 1.6790 + 1.6791 +<!-- [[[ test_2d.gradient.radial.nonfinite.html ]]] --> 1.6792 + 1.6793 +<p>Canvas test: 2d.gradient.radial.nonfinite</p> 1.6794 +<!-- Testing: createRadialGradient() throws NOT_SUPPORTED_ERR if arguments are not finite --> 1.6795 +<canvas id="c244" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.6796 +<script> 1.6797 + 1.6798 +function test_2d_gradient_radial_nonfinite() { 1.6799 + 1.6800 +var canvas = document.getElementById('c244'); 1.6801 +var ctx = canvas.getContext('2d'); 1.6802 + 1.6803 +var _thrown = undefined; try { 1.6804 + ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1); 1.6805 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6806 +var _thrown = undefined; try { 1.6807 + ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1); 1.6808 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6809 +var _thrown = undefined; try { 1.6810 + ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1); 1.6811 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6812 +var _thrown = undefined; try { 1.6813 + ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1); 1.6814 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6815 +var _thrown = undefined; try { 1.6816 + ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1); 1.6817 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6818 +var _thrown = undefined; try { 1.6819 + ctx.createRadialGradient(0, NaN, 1, 0, 0, 1); 1.6820 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6821 +var _thrown = undefined; try { 1.6822 + ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1); 1.6823 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6824 +var _thrown = undefined; try { 1.6825 + ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1); 1.6826 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6827 +var _thrown = undefined; try { 1.6828 + ctx.createRadialGradient(0, 0, NaN, 0, 0, 1); 1.6829 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6830 +var _thrown = undefined; try { 1.6831 + ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1); 1.6832 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6833 +var _thrown = undefined; try { 1.6834 + ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1); 1.6835 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6836 +var _thrown = undefined; try { 1.6837 + ctx.createRadialGradient(0, 0, 1, NaN, 0, 1); 1.6838 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6839 +var _thrown = undefined; try { 1.6840 + ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1); 1.6841 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6842 +var _thrown = undefined; try { 1.6843 + ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1); 1.6844 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6845 +var _thrown = undefined; try { 1.6846 + ctx.createRadialGradient(0, 0, 1, 0, NaN, 1); 1.6847 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6848 +var _thrown = undefined; try { 1.6849 + ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity); 1.6850 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6851 +var _thrown = undefined; try { 1.6852 + ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity); 1.6853 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6854 +var _thrown = undefined; try { 1.6855 + ctx.createRadialGradient(0, 0, 1, 0, 0, NaN); 1.6856 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6857 +var _thrown = undefined; try { 1.6858 + ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1); 1.6859 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6860 +var _thrown = undefined; try { 1.6861 + ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1); 1.6862 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6863 +var _thrown = undefined; try { 1.6864 + ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1); 1.6865 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6866 +var _thrown = undefined; try { 1.6867 + ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1); 1.6868 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6869 +var _thrown = undefined; try { 1.6870 + ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); 1.6871 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6872 +var _thrown = undefined; try { 1.6873 + ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity); 1.6874 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6875 +var _thrown = undefined; try { 1.6876 + ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1); 1.6877 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6878 +var _thrown = undefined; try { 1.6879 + ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity); 1.6880 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6881 +var _thrown = undefined; try { 1.6882 + ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity); 1.6883 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6884 +var _thrown = undefined; try { 1.6885 + ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1); 1.6886 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6887 +var _thrown = undefined; try { 1.6888 + ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1); 1.6889 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6890 +var _thrown = undefined; try { 1.6891 + ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity); 1.6892 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6893 +var _thrown = undefined; try { 1.6894 + ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity); 1.6895 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6896 +var _thrown = undefined; try { 1.6897 + ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1); 1.6898 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6899 +var _thrown = undefined; try { 1.6900 + ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity); 1.6901 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6902 +var _thrown = undefined; try { 1.6903 + ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity); 1.6904 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6905 +var _thrown = undefined; try { 1.6906 + ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1); 1.6907 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6908 +var _thrown = undefined; try { 1.6909 + ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1); 1.6910 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6911 +var _thrown = undefined; try { 1.6912 + ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1); 1.6913 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6914 +var _thrown = undefined; try { 1.6915 + ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity); 1.6916 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6917 +var _thrown = undefined; try { 1.6918 + ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity); 1.6919 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6920 +var _thrown = undefined; try { 1.6921 + ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1); 1.6922 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6923 +var _thrown = undefined; try { 1.6924 + ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity); 1.6925 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6926 +var _thrown = undefined; try { 1.6927 + ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity); 1.6928 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6929 +var _thrown = undefined; try { 1.6930 + ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1); 1.6931 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6932 +var _thrown = undefined; try { 1.6933 + ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1); 1.6934 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6935 +var _thrown = undefined; try { 1.6936 + ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity); 1.6937 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6938 +var _thrown = undefined; try { 1.6939 + ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity); 1.6940 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6941 +var _thrown = undefined; try { 1.6942 + ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1); 1.6943 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6944 +var _thrown = undefined; try { 1.6945 + ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity); 1.6946 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6947 +var _thrown = undefined; try { 1.6948 + ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity); 1.6949 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6950 +var _thrown = undefined; try { 1.6951 + ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1); 1.6952 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6953 +var _thrown = undefined; try { 1.6954 + ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1); 1.6955 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6956 +var _thrown = undefined; try { 1.6957 + ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1); 1.6958 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6959 +var _thrown = undefined; try { 1.6960 + ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity); 1.6961 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6962 +var _thrown = undefined; try { 1.6963 + ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity); 1.6964 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6965 +var _thrown = undefined; try { 1.6966 + ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1); 1.6967 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6968 +var _thrown = undefined; try { 1.6969 + ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity); 1.6970 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6971 +var _thrown = undefined; try { 1.6972 + ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity); 1.6973 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6974 +var _thrown = undefined; try { 1.6975 + ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1); 1.6976 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6977 +var _thrown = undefined; try { 1.6978 + ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1); 1.6979 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6980 +var _thrown = undefined; try { 1.6981 + ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity); 1.6982 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6983 +var _thrown = undefined; try { 1.6984 + ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity); 1.6985 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6986 +var _thrown = undefined; try { 1.6987 + ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1); 1.6988 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6989 +var _thrown = undefined; try { 1.6990 + ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity); 1.6991 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6992 +var _thrown = undefined; try { 1.6993 + ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity); 1.6994 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6995 +var _thrown = undefined; try { 1.6996 + ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1); 1.6997 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.6998 +var _thrown = undefined; try { 1.6999 + ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1); 1.7000 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7001 +var _thrown = undefined; try { 1.7002 + ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity); 1.7003 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7004 +var _thrown = undefined; try { 1.7005 + ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity); 1.7006 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7007 +var _thrown = undefined; try { 1.7008 + ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1); 1.7009 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7010 +var _thrown = undefined; try { 1.7011 + ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity); 1.7012 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7013 +var _thrown = undefined; try { 1.7014 + ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity); 1.7015 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7016 +var _thrown = undefined; try { 1.7017 + ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1); 1.7018 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7019 +var _thrown = undefined; try { 1.7020 + ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity); 1.7021 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7022 +var _thrown = undefined; try { 1.7023 + ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity); 1.7024 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7025 +var _thrown = undefined; try { 1.7026 + ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity); 1.7027 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7028 + 1.7029 + 1.7030 +} 1.7031 +</script> 1.7032 + 1.7033 +<!-- [[[ test_2d.gradient.radial.outside1.html ]]] --> 1.7034 + 1.7035 +<p>Canvas test: 2d.gradient.radial.outside1</p> 1.7036 +<canvas id="c245" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7037 +<script> 1.7038 + 1.7039 + 1.7040 +function test_2d_gradient_radial_outside1() { 1.7041 + 1.7042 +var canvas = document.getElementById('c245'); 1.7043 +var ctx = canvas.getContext('2d'); 1.7044 + 1.7045 +ctx.fillStyle = '#f00'; 1.7046 +ctx.fillRect(0, 0, 100, 50); 1.7047 + 1.7048 +var g = ctx.createRadialGradient(200, 25, 10, 200, 25, 20); 1.7049 +g.addColorStop(0, '#f00'); 1.7050 +g.addColorStop(1, '#0f0'); 1.7051 +ctx.fillStyle = g; 1.7052 +ctx.fillRect(0, 0, 100, 50); 1.7053 + 1.7054 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.7055 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.7056 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.7057 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.7058 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.7059 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.7060 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.7061 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.7062 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.7063 + 1.7064 + 1.7065 +} 1.7066 +</script> 1.7067 + 1.7068 +<!-- [[[ test_2d.gradient.radial.outside2.html ]]] --> 1.7069 + 1.7070 +<p>Canvas test: 2d.gradient.radial.outside2</p> 1.7071 +<canvas id="c246" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7072 +<script> 1.7073 + 1.7074 + 1.7075 + 1.7076 +function test_2d_gradient_radial_outside2() { 1.7077 + 1.7078 +var canvas = document.getElementById('c246'); 1.7079 +var ctx = canvas.getContext('2d'); 1.7080 + 1.7081 +ctx.fillStyle = '#f00'; 1.7082 +ctx.fillRect(0, 0, 100, 50); 1.7083 + 1.7084 +var g = ctx.createRadialGradient(200, 25, 20, 200, 25, 10); 1.7085 +g.addColorStop(0, '#0f0'); 1.7086 +g.addColorStop(1, '#f00'); 1.7087 +ctx.fillStyle = g; 1.7088 +ctx.fillRect(0, 0, 100, 50); 1.7089 + 1.7090 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.7091 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.7092 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.7093 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.7094 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.7095 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.7096 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.7097 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.7098 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.7099 + 1.7100 + 1.7101 +} 1.7102 +</script> 1.7103 + 1.7104 +<!-- [[[ test_2d.gradient.radial.outside3.html ]]] --> 1.7105 + 1.7106 +<p>Canvas test: 2d.gradient.radial.outside3</p> 1.7107 +<canvas id="c247" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7108 +<script> 1.7109 + 1.7110 + 1.7111 + 1.7112 +function test_2d_gradient_radial_outside3() { 1.7113 + 1.7114 +var canvas = document.getElementById('c247'); 1.7115 +var ctx = canvas.getContext('2d'); 1.7116 + 1.7117 +ctx.fillStyle = '#f00'; 1.7118 +ctx.fillRect(0, 0, 100, 50); 1.7119 + 1.7120 +var g = ctx.createRadialGradient(200, 25, 20, 200, 25, 10); 1.7121 +g.addColorStop(0, '#0f0'); 1.7122 +g.addColorStop(0.001, '#f00'); 1.7123 +g.addColorStop(1, '#f00'); 1.7124 +ctx.fillStyle = g; 1.7125 +ctx.fillRect(0, 0, 100, 50); 1.7126 + 1.7127 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.7128 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.7129 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.7130 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.7131 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.7132 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.7133 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.7134 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.7135 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.7136 + 1.7137 + 1.7138 +} 1.7139 +</script> 1.7140 + 1.7141 +<!-- [[[ test_2d.gradient.radial.touch1.html ]]] --> 1.7142 + 1.7143 +<p>Canvas test: 2d.gradient.radial.touch1</p> 1.7144 +<canvas id="c248" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7145 +<script> 1.7146 + 1.7147 + 1.7148 + 1.7149 +function test_2d_gradient_radial_touch1() { 1.7150 + 1.7151 +var canvas = document.getElementById('c248'); 1.7152 +var ctx = canvas.getContext('2d'); 1.7153 + 1.7154 +ctx.fillStyle = '#0f0'; 1.7155 +ctx.fillRect(0, 0, 100, 50); 1.7156 + 1.7157 +var g = ctx.createRadialGradient(150, 25, 50, 200, 25, 100); 1.7158 +g.addColorStop(0, '#f00'); 1.7159 +g.addColorStop(1, '#f00'); 1.7160 +ctx.fillStyle = g; 1.7161 +ctx.fillRect(0, 0, 100, 50); 1.7162 + 1.7163 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.7164 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.7165 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.7166 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.7167 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.7168 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.7169 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.7170 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.7171 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.7172 + 1.7173 + 1.7174 +} 1.7175 +</script> 1.7176 + 1.7177 +<!-- [[[ test_2d.gradient.radial.touch2.html ]]] --> 1.7178 + 1.7179 +<p>Canvas test: 2d.gradient.radial.touch2</p> 1.7180 +<canvas id="c249" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7181 +<script> 1.7182 + 1.7183 + 1.7184 + 1.7185 +function test_2d_gradient_radial_touch2() { 1.7186 + 1.7187 +var canvas = document.getElementById('c249'); 1.7188 +var ctx = canvas.getContext('2d'); 1.7189 + 1.7190 +ctx.fillStyle = '#f00'; 1.7191 +ctx.fillRect(0, 0, 100, 50); 1.7192 + 1.7193 +var g = ctx.createRadialGradient(-80, 25, 70, 0, 25, 150); 1.7194 +g.addColorStop(0, '#f00'); 1.7195 +g.addColorStop(0.01, '#0f0'); 1.7196 +g.addColorStop(0.99, '#0f0'); 1.7197 +g.addColorStop(1, '#f00'); 1.7198 +ctx.fillStyle = g; 1.7199 +ctx.fillRect(0, 0, 100, 50); 1.7200 + 1.7201 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.7202 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.7203 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.7204 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.7205 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.7206 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.7207 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.7208 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.7209 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.7210 + 1.7211 + 1.7212 +} 1.7213 +</script> 1.7214 + 1.7215 +<!-- [[[ test_2d.gradient.radial.touch3.html ]]] --> 1.7216 + 1.7217 +<p>Canvas test: 2d.gradient.radial.touch3</p> 1.7218 +<canvas id="c250" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7219 +<script> 1.7220 + 1.7221 + 1.7222 + 1.7223 +function test_2d_gradient_radial_touch3() { 1.7224 + 1.7225 +var canvas = document.getElementById('c250'); 1.7226 +var ctx = canvas.getContext('2d'); 1.7227 + 1.7228 +ctx.fillStyle = '#0f0'; 1.7229 +ctx.fillRect(0, 0, 100, 50); 1.7230 + 1.7231 +var g = ctx.createRadialGradient(120, -15, 25, 140, -30, 50); 1.7232 +g.addColorStop(0, '#f00'); 1.7233 +g.addColorStop(1, '#f00'); 1.7234 +ctx.fillStyle = g; 1.7235 +ctx.fillRect(0, 0, 100, 50); 1.7236 + 1.7237 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.7238 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.7239 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.7240 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.7241 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.7242 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.7243 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.7244 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.7245 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.7246 + 1.7247 + 1.7248 +} 1.7249 +</script> 1.7250 + 1.7251 +<!-- [[[ test_2d.gradient.radial.transform.1.html ]]] --> 1.7252 + 1.7253 +<p>Canvas test: 2d.gradient.radial.transform.1</p> 1.7254 +<!-- Testing: Radial gradient coordinates are relative to the coordinate space at the time of filling --> 1.7255 +<canvas id="c251" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7256 +<script> 1.7257 + 1.7258 + 1.7259 +function test_2d_gradient_radial_transform_1() { 1.7260 + 1.7261 +var canvas = document.getElementById('c251'); 1.7262 +var ctx = canvas.getContext('2d'); 1.7263 + 1.7264 +var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2); 1.7265 +g.addColorStop(0, '#0f0'); 1.7266 +g.addColorStop(0.5, '#0f0'); 1.7267 +g.addColorStop(0.51, '#f00'); 1.7268 +g.addColorStop(1, '#f00'); 1.7269 +ctx.fillStyle = g; 1.7270 +ctx.translate(50, 25); 1.7271 +ctx.scale(10, 10); 1.7272 +ctx.fillRect(-5, -2.5, 10, 5); 1.7273 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.7274 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.7275 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.7276 + 1.7277 + 1.7278 +} 1.7279 +</script> 1.7280 + 1.7281 +<!-- [[[ test_2d.gradient.radial.transform.2.html ]]] --> 1.7282 + 1.7283 +<p>Canvas test: 2d.gradient.radial.transform.2</p> 1.7284 +<!-- Testing: Radial gradient coordinates are relative to the coordinate space at the time of filling --> 1.7285 +<canvas id="c252" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7286 +<script> 1.7287 + 1.7288 + 1.7289 +function test_2d_gradient_radial_transform_2() { 1.7290 + 1.7291 +var canvas = document.getElementById('c252'); 1.7292 +var ctx = canvas.getContext('2d'); 1.7293 + 1.7294 +ctx.translate(100, 0); 1.7295 +var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2); 1.7296 +g.addColorStop(0, '#0f0'); 1.7297 +g.addColorStop(0.5, '#0f0'); 1.7298 +g.addColorStop(0.51, '#f00'); 1.7299 +g.addColorStop(1, '#f00'); 1.7300 +ctx.fillStyle = g; 1.7301 +ctx.translate(-50, 25); 1.7302 +ctx.scale(10, 10); 1.7303 +ctx.fillRect(-5, -2.5, 10, 5); 1.7304 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.7305 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.7306 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.7307 + 1.7308 + 1.7309 +} 1.7310 +</script> 1.7311 + 1.7312 +<!-- [[[ test_2d.gradient.radial.transform.3.html ]]] --> 1.7313 + 1.7314 +<p>Canvas test: 2d.gradient.radial.transform.3</p> 1.7315 +<!-- Testing: Radial gradient transforms do not experience broken caching effects --> 1.7316 +<canvas id="c253" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7317 +<script> 1.7318 + 1.7319 + 1.7320 + 1.7321 +function test_2d_gradient_radial_transform_3() { 1.7322 + 1.7323 +var canvas = document.getElementById('c253'); 1.7324 +var ctx = canvas.getContext('2d'); 1.7325 + 1.7326 +var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2); 1.7327 +g.addColorStop(0, '#0f0'); 1.7328 +g.addColorStop(0.5, '#0f0'); 1.7329 +g.addColorStop(0.51, '#f00'); 1.7330 +g.addColorStop(1, '#f00'); 1.7331 +ctx.fillStyle = g; 1.7332 +ctx.fillRect(0, 0, 100, 50); 1.7333 +ctx.translate(50, 25); 1.7334 +ctx.scale(10, 10); 1.7335 +ctx.fillRect(-5, -2.5, 10, 5); 1.7336 + 1.7337 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.7338 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.7339 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.7340 + 1.7341 +} 1.7342 +</script> 1.7343 + 1.7344 +<!-- [[[ test_2d.imageData.create.basic.html ]]] --> 1.7345 + 1.7346 +<p>Canvas test: 2d.imageData.create.basic - bug 433004</p> 1.7347 +<!-- Testing: createImageData() exists and returns something --> 1.7348 +<canvas id="c254" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7349 +<script> 1.7350 + 1.7351 +function test_2d_imageData_create_basic() { 1.7352 + 1.7353 +var canvas = document.getElementById('c254'); 1.7354 +var ctx = canvas.getContext('2d'); 1.7355 + 1.7356 +ok(ctx.createImageData(1, 1) !== null, "ctx.createImageData(1, 1) !== null"); 1.7357 + 1.7358 + 1.7359 +} 1.7360 +</script> 1.7361 + 1.7362 +<!-- [[[ test_2d.imageData.create1.basic.html ]]] --> 1.7363 + 1.7364 +<p>Canvas test: 2d.imageData.create1.basic - bug 630040</p> 1.7365 +<!-- Testing: createImageData(imgdata) exists and returns something --> 1.7366 +<canvas id="c254a" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7367 +<script> 1.7368 + 1.7369 +function test_2d_imageData_create1_basic() { 1.7370 + 1.7371 +var canvas = document.getElementById('c254a'); 1.7372 +var ctx = canvas.getContext('2d'); 1.7373 + 1.7374 +ok(ctx.createImageData(ctx.createImageData(1, 1)) != null, "ctx.createImageData(ctx.createImageData(1, 1)) != null"); 1.7375 + 1.7376 + 1.7377 +} 1.7378 +</script> 1.7379 + 1.7380 +<!-- [[[ test_2d.imageData.create.initial.html ]]] --> 1.7381 + 1.7382 +<p>Canvas test: 2d.imageData.create.initial - bug 433004</p> 1.7383 +<!-- Testing: createImageData() returns transparent black data of the right size --> 1.7384 +<canvas id="c255" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7385 +<script> 1.7386 + 1.7387 +function test_2d_imageData_create_initial() { 1.7388 + 1.7389 +var canvas = document.getElementById('c255'); 1.7390 +var ctx = canvas.getContext('2d'); 1.7391 + 1.7392 +var imgdata = ctx.createImageData(10, 20); 1.7393 +ok(imgdata.data.length == imgdata.width*imgdata.height*4, "imgdata.data.length == imgdata.width*imgdata.height*4"); 1.7394 +ok(imgdata.width < imgdata.height, "imgdata.width < imgdata.height"); 1.7395 +ok(imgdata.width > 0, "imgdata.width > 0"); 1.7396 +var isTransparentBlack = true; 1.7397 +for (var i = 0; i < imgdata.data.length; ++i) 1.7398 + if (imgdata.data[i] !== 0) 1.7399 + isTransparentBlack = false; 1.7400 +ok(isTransparentBlack, "isTransparentBlack"); 1.7401 + 1.7402 + 1.7403 +} 1.7404 +</script> 1.7405 + 1.7406 +<!-- [[[ test_2d.imageData.create1.initial.html ]]] --> 1.7407 + 1.7408 +<p>Canvas test: 2d.imageData.create1.initial - bug 630040</p> 1.7409 +<!-- Testing: createImageData(imgdata) returns transparent black data of the right size --> 1.7410 +<canvas id="c255a" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7411 +<script> 1.7412 + 1.7413 +function test_2d_imageData_create1_initial() { 1.7414 + 1.7415 +var canvas = document.getElementById('c255a'); 1.7416 +var ctx = canvas.getContext('2d'); 1.7417 + 1.7418 +ctx.fillStyle = '#0f0'; 1.7419 +ctx.fillRect(0, 0, 100, 50); 1.7420 +var imgdata1 = ctx.getImageData(0, 0, 10, 20); 1.7421 +var imgdata2 = ctx.createImageData(imgdata1); 1.7422 +ok(imgdata2.data.length == imgdata1.data.length, "imgdata2.data.length == imgdata1.data.length"); 1.7423 +ok(imgdata2.width == imgdata1.width, "imgdata2.width == imgdata1.width"); 1.7424 +ok(imgdata2.height == imgdata1.height, "imgdata2.height == imgdata1.height"); 1.7425 +var isTransparentBlack = true; 1.7426 +for (var i = 0; i < imgdata2.data.length; ++i) 1.7427 + if (imgdata2.data[i] !== 0) 1.7428 + isTransparentBlack = false; 1.7429 +ok(isTransparentBlack, "isTransparentBlack"); 1.7430 + 1.7431 + 1.7432 +} 1.7433 +</script> 1.7434 + 1.7435 +<!-- [[[ test_2d.imageData.create.large.html ]]] --> 1.7436 + 1.7437 +<p>Canvas test: 2d.imageData.create.large - bug 433004</p> 1.7438 +<!-- Testing: createImageData() works for sizes much larger than the canvas --> 1.7439 +<canvas id="c256" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7440 +<script> 1.7441 + 1.7442 +function test_2d_imageData_create_large() { 1.7443 + 1.7444 +var canvas = document.getElementById('c256'); 1.7445 +var ctx = canvas.getContext('2d'); 1.7446 + 1.7447 +var _thrown_outer = false; 1.7448 + 1.7449 +var imgdata = ctx.createImageData(1000, 2000); 1.7450 +ok(imgdata.data.length == imgdata.width*imgdata.height*4, "imgdata.data.length == imgdata.width*imgdata.height*4"); 1.7451 +ok(imgdata.width < imgdata.height, "imgdata.width < imgdata.height"); 1.7452 +ok(imgdata.width > 0, "imgdata.width > 0"); 1.7453 +var isTransparentBlack = true; 1.7454 +for (var i = 0; i < imgdata.data.length; i += 7813) // check ~1024 points (assuming normal scaling) 1.7455 + if (imgdata.data[i] !== 0) 1.7456 + isTransparentBlack = false; 1.7457 +ok(isTransparentBlack, "isTransparentBlack"); 1.7458 + 1.7459 + 1.7460 +} 1.7461 +</script> 1.7462 + 1.7463 +<!-- [[[ test_2d.imageData.create.negative.html ]]] --> 1.7464 + 1.7465 +<p>Canvas test: 2d.imageData.create.negative - bug 433004</p> 1.7466 +<!-- Testing: createImageData() takes the absolute magnitude of the size arguments --> 1.7467 +<canvas id="c257" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7468 +<script> 1.7469 + 1.7470 +function test_2d_imageData_create_negative() { 1.7471 + 1.7472 +var canvas = document.getElementById('c257'); 1.7473 +var ctx = canvas.getContext('2d'); 1.7474 + 1.7475 +var _thrown_outer = false; 1.7476 +try { 1.7477 + 1.7478 +var imgdata1 = ctx.createImageData(10, 20); 1.7479 +var imgdata2 = ctx.createImageData(-10, 20); 1.7480 +var imgdata3 = ctx.createImageData(10, -20); 1.7481 +var imgdata4 = ctx.createImageData(-10, -20); 1.7482 +ok(imgdata1.data.length == imgdata2.data.length, "imgdata1.data.length == imgdata2.data.length"); 1.7483 +ok(imgdata2.data.length == imgdata3.data.length, "imgdata2.data.length == imgdata3.data.length"); 1.7484 +ok(imgdata3.data.length == imgdata4.data.length, "imgdata3.data.length == imgdata4.data.length"); 1.7485 + 1.7486 +} catch (e) { 1.7487 + _thrown_outer = true; 1.7488 +} 1.7489 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.7490 + 1.7491 + 1.7492 +} 1.7493 +</script> 1.7494 + 1.7495 +<!-- [[[ test_2d.imageData.create.nonfinite.html ]]] --> 1.7496 + 1.7497 +<p>Canvas test: 2d.imageData.create.nonfinite - bug 433004</p> 1.7498 +<!-- Testing: createImageData() throws NOT_SUPPORTED_ERR if arguments are not finite --> 1.7499 +<canvas id="c258" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7500 +<script> 1.7501 + 1.7502 +function test_2d_imageData_create_nonfinite() { 1.7503 + 1.7504 +var canvas = document.getElementById('c258'); 1.7505 +var ctx = canvas.getContext('2d'); 1.7506 + 1.7507 +var _thrown = undefined; try { 1.7508 + ctx.createImageData(Infinity, 10); 1.7509 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7510 +var _thrown = undefined; try { 1.7511 + ctx.createImageData(-Infinity, 10); 1.7512 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7513 +var _thrown = undefined; try { 1.7514 + ctx.createImageData(NaN, 10); 1.7515 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7516 +var _thrown = undefined; try { 1.7517 + ctx.createImageData(10, Infinity); 1.7518 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7519 +var _thrown = undefined; try { 1.7520 + ctx.createImageData(10, -Infinity); 1.7521 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7522 +var _thrown = undefined; try { 1.7523 + ctx.createImageData(10, NaN); 1.7524 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7525 +var _thrown = undefined; try { 1.7526 + ctx.createImageData(Infinity, Infinity); 1.7527 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7528 +var _thrown = undefined; try { 1.7529 + ctx.createImageData({valueOf:function() Infinity}, 10); 1.7530 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7531 +var _thrown = undefined; try { 1.7532 + ctx.createImageData({valueOf:function() -Infinity}, 10); 1.7533 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7534 +var _thrown = undefined; try { 1.7535 + ctx.createImageData({valueOf:function() NaN}, 10); 1.7536 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7537 +var _thrown = undefined; try { 1.7538 + ctx.createImageData(10, {valueOf:function() Infinity}); 1.7539 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7540 +var _thrown = undefined; try { 1.7541 + ctx.createImageData(10, {valueOf:function() -Infinity}); 1.7542 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7543 +var _thrown = undefined; try { 1.7544 + ctx.createImageData(10, {valueOf:function() NaN}); 1.7545 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7546 +var _thrown = undefined; try { 1.7547 + ctx.createImageData({valueOf:function() Infinity}, {valueOf:function() Infinity}); 1.7548 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7549 + 1.7550 + 1.7551 +} 1.7552 +</script> 1.7553 + 1.7554 +<!-- [[[ test_2d.imageData.create.round.html ]]] --> 1.7555 + 1.7556 +<p>Canvas test: 2d.imageData.create.round - bug 433004</p> 1.7557 +<!-- Testing: createImageData(w, h) is rounded the same as getImageData(0, 0, w, h) --> 1.7558 +<canvas id="c259" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7559 +<script> 1.7560 + 1.7561 +function test_2d_imageData_create_round() { 1.7562 + 1.7563 +var canvas = document.getElementById('c259'); 1.7564 +var ctx = canvas.getContext('2d'); 1.7565 + 1.7566 +var _thrown_outer = false; 1.7567 + 1.7568 +var imgdata1 = ctx.createImageData(10.01, 10.99); 1.7569 +var imgdata2 = ctx.getImageData(0, 0, 10.01, 10.99); 1.7570 +is(imgdata1.width, imgdata2.width, "imgdata1.width == imgdata2.width"); 1.7571 +is(imgdata1.height, imgdata2.height, "imgdata1.height == imgdata2.height"); 1.7572 + 1.7573 + 1.7574 +} 1.7575 +</script> 1.7576 + 1.7577 +<!-- [[[ test_2d.imageData.create.tiny.html ]]] --> 1.7578 + 1.7579 +<p>Canvas test: 2d.imageData.create.tiny - bug 433004</p> 1.7580 +<!-- Testing: createImageData() works for sizes smaller than one pixel --> 1.7581 +<canvas id="c260" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7582 +<script> 1.7583 + 1.7584 +function test_2d_imageData_create_tiny() { 1.7585 + 1.7586 +var canvas = document.getElementById('c260'); 1.7587 +var ctx = canvas.getContext('2d'); 1.7588 + 1.7589 +var _thrown_outer = false; 1.7590 +try { 1.7591 + 1.7592 +var imgdata = ctx.createImageData(0.0001, 0.0001); 1.7593 +ok(imgdata.data.length == imgdata.width*imgdata.height*4, "imgdata.data.length == imgdata.width*imgdata.height*4"); 1.7594 +ok(imgdata.width == 1, "imgdata.width == 1"); 1.7595 +ok(imgdata.height == 1, "imgdata.height == 1"); 1.7596 +var isTransparentBlack = true; 1.7597 +for (var i = 0; i < imgdata.data.length; ++i) 1.7598 + if (imgdata.data[i] !== 0) 1.7599 + isTransparentBlack = false; 1.7600 +ok(isTransparentBlack, "isTransparentBlack"); 1.7601 + 1.7602 +} catch (e) { 1.7603 + _thrown_outer = true; 1.7604 +} 1.7605 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.7606 + 1.7607 + 1.7608 +} 1.7609 +</script> 1.7610 + 1.7611 +<!-- [[[ test_2d.imageData.create.type.html ]]] --> 1.7612 + 1.7613 +<p>Canvas test: 2d.imageData.create.type - bug 433004</p> 1.7614 +<!-- Testing: createImageData() returns an ImageData object containing a Uint8ClampedArray object --> 1.7615 +<canvas id="c261" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7616 +<script> 1.7617 + 1.7618 +function test_2d_imageData_create_type() { 1.7619 + 1.7620 +var canvas = document.getElementById('c261'); 1.7621 +var ctx = canvas.getContext('2d'); 1.7622 + 1.7623 +ok(window.ImageData !== undefined, "window.ImageData !== undefined"); 1.7624 +ok(window.Uint8ClampedArray !== undefined, "window.Uint8ClampedArray !== undefined"); 1.7625 +window.ImageData.prototype.thisImplementsImageData = true; 1.7626 +window.Uint8ClampedArray.prototype.thisImplementsUint8ClampedArray = true; 1.7627 +var imgdata = ctx.createImageData(1, 1); 1.7628 +ok(imgdata.thisImplementsImageData, "imgdata.thisImplementsImageData"); 1.7629 +ok(imgdata.data.thisImplementsUint8ClampedArray, "imgdata.data.thisImplementsUint8ClampedArray"); 1.7630 + 1.7631 + 1.7632 +} 1.7633 +</script> 1.7634 + 1.7635 +<!-- [[[ test_2d.imageData.create1.type.html ]]] --> 1.7636 + 1.7637 +<p>Canvas test: 2d.imageData.create1.type - bug 630040</p> 1.7638 +<!-- Testing: createImageData(imgdata) returns an ImageData object containing a Uint8ClampedArray object --> 1.7639 +<canvas id="c261a" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7640 +<script> 1.7641 + 1.7642 +function test_2d_imageData_create1_type() { 1.7643 + 1.7644 +var canvas = document.getElementById('c261a'); 1.7645 +var ctx = canvas.getContext('2d'); 1.7646 + 1.7647 +ok(window.ImageData !== undefined, "window.ImageData !== undefined"); 1.7648 +ok(window.Uint8ClampedArray !== undefined, "window.Uint8ClampedArray !== undefined"); 1.7649 +window.ImageData.prototype.thisImplementsImageData = true; 1.7650 +window.Uint8ClampedArray.prototype.thisImplementsUint8ClampedArray = true; 1.7651 +var imgdata = ctx.createImageData(ctx.createImageData(1, 1)); 1.7652 +ok(imgdata.thisImplementsImageData, "imgdata.thisImplementsImageData"); 1.7653 +ok(imgdata.data.thisImplementsUint8ClampedArray, "imgdata.data.thisImplementsUint8ClampedArray"); 1.7654 + 1.7655 + 1.7656 +} 1.7657 +</script> 1.7658 + 1.7659 +<!-- [[[ test_2d.imageData.create.zero.html ]]] --> 1.7660 + 1.7661 +<p>Canvas test: 2d.imageData.create.zero - bug 433004</p> 1.7662 +<!-- Testing: createImageData() throws INDEX_SIZE_ERR if size is zero --> 1.7663 +<canvas id="c262" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7664 +<script> 1.7665 + 1.7666 +function test_2d_imageData_create_zero() { 1.7667 + 1.7668 +var canvas = document.getElementById('c262'); 1.7669 +var ctx = canvas.getContext('2d'); 1.7670 + 1.7671 +var _thrown = undefined; try { 1.7672 + ctx.createImageData(10, 0); 1.7673 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.7674 +var _thrown = undefined; try { 1.7675 + ctx.createImageData(0, 10); 1.7676 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.7677 +var _thrown = undefined; try { 1.7678 + ctx.createImageData(0, 0); 1.7679 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.7680 + 1.7681 + 1.7682 +} 1.7683 +</script> 1.7684 + 1.7685 +<!-- [[[ test_2d.imageData.create1.zero.html ]]] --> 1.7686 + 1.7687 +<p>Canvas test: 2d.imageData.create1.zero - bug 630040</p> 1.7688 +<!-- Testing: createImageData(null) throws TypeError --> 1.7689 +<canvas id="c262a" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7690 +<script> 1.7691 + 1.7692 +function test_2d_imageData_create1_zero() { 1.7693 + 1.7694 +var canvas = document.getElementById('c262a'); 1.7695 +var ctx = canvas.getContext('2d'); 1.7696 + 1.7697 +var _thrown = undefined; try { 1.7698 + ctx.createImageData(null); 1.7699 +} catch (e) { _thrown = e }; 1.7700 +ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); 1.7701 + 1.7702 + 1.7703 +} 1.7704 +</script> 1.7705 + 1.7706 +<!-- [[[ test_2d.imageData.get.basic.html ]]] --> 1.7707 + 1.7708 +<p>Canvas test: 2d.imageData.get.basic</p> 1.7709 +<!-- Testing: getImageData() exists and returns something --> 1.7710 +<canvas id="c263" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7711 +<script> 1.7712 + 1.7713 +function test_2d_imageData_get_basic() { 1.7714 + 1.7715 +var canvas = document.getElementById('c263'); 1.7716 +var ctx = canvas.getContext('2d'); 1.7717 + 1.7718 +ok(ctx.getImageData(0, 0, 100, 50) !== null, "ctx.getImageData(0, 0, 100, 50) !== null"); 1.7719 + 1.7720 + 1.7721 +} 1.7722 +</script> 1.7723 + 1.7724 +<!-- [[[ test_2d.imageData.get.clamp.html ]]] --> 1.7725 + 1.7726 +<p>Canvas test: 2d.imageData.get.clamp</p> 1.7727 +<!-- Testing: getImageData() clamps colours to the range [0, 255] --> 1.7728 +<canvas id="c264" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7729 +<script> 1.7730 + 1.7731 +function test_2d_imageData_get_clamp() { 1.7732 + 1.7733 +var canvas = document.getElementById('c264'); 1.7734 +var ctx = canvas.getContext('2d'); 1.7735 + 1.7736 +ctx.fillStyle = 'rgb(-100, -200, -300)'; 1.7737 +ctx.fillRect(0, 0, 100, 50); 1.7738 +ctx.fillStyle = 'rgb(256, 300, 400)'; 1.7739 +ctx.fillRect(20, 10, 60, 10); 1.7740 +var imgdata1 = ctx.getImageData(10, 5, 1, 1); 1.7741 +ok(imgdata1.data[0] === 0, "imgdata1.data[\""+(0)+"\"] === 0"); 1.7742 +ok(imgdata1.data[1] === 0, "imgdata1.data[\""+(1)+"\"] === 0"); 1.7743 +ok(imgdata1.data[2] === 0, "imgdata1.data[\""+(2)+"\"] === 0"); 1.7744 +var imgdata2 = ctx.getImageData(30, 15, 1, 1); 1.7745 +ok(imgdata2.data[0] === 255, "imgdata2.data[\""+(0)+"\"] === 255"); 1.7746 +ok(imgdata2.data[1] === 255, "imgdata2.data[\""+(1)+"\"] === 255"); 1.7747 +ok(imgdata2.data[2] === 255, "imgdata2.data[\""+(2)+"\"] === 255"); 1.7748 + 1.7749 + 1.7750 +} 1.7751 +</script> 1.7752 + 1.7753 +<!-- [[[ test_2d.imageData.get.nonfinite.html ]]] --> 1.7754 + 1.7755 +<p>Canvas test: 2d.imageData.get.nonfinite</p> 1.7756 +<!-- Testing: getImageData() throws NOT_SUPPORTED_ERR if arguments are not finite --> 1.7757 +<canvas id="c265" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7758 +<script> 1.7759 + 1.7760 +function test_2d_imageData_get_nonfinite() { 1.7761 + 1.7762 +var canvas = document.getElementById('c265'); 1.7763 +var ctx = canvas.getContext('2d'); 1.7764 + 1.7765 +var _thrown = undefined; try { 1.7766 + ctx.getImageData(Infinity, 10, 10, 10); 1.7767 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7768 +var _thrown = undefined; try { 1.7769 + ctx.getImageData(-Infinity, 10, 10, 10); 1.7770 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7771 +var _thrown = undefined; try { 1.7772 + ctx.getImageData(NaN, 10, 10, 10); 1.7773 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7774 +var _thrown = undefined; try { 1.7775 + ctx.getImageData(10, Infinity, 10, 10); 1.7776 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7777 +var _thrown = undefined; try { 1.7778 + ctx.getImageData(10, -Infinity, 10, 10); 1.7779 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7780 +var _thrown = undefined; try { 1.7781 + ctx.getImageData(10, NaN, 10, 10); 1.7782 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7783 +var _thrown = undefined; try { 1.7784 + ctx.getImageData(10, 10, Infinity, 10); 1.7785 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7786 +var _thrown = undefined; try { 1.7787 + ctx.getImageData(10, 10, -Infinity, 10); 1.7788 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7789 +var _thrown = undefined; try { 1.7790 + ctx.getImageData(10, 10, NaN, 10); 1.7791 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7792 +var _thrown = undefined; try { 1.7793 + ctx.getImageData(10, 10, 10, Infinity); 1.7794 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7795 +var _thrown = undefined; try { 1.7796 + ctx.getImageData(10, 10, 10, -Infinity); 1.7797 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7798 +var _thrown = undefined; try { 1.7799 + ctx.getImageData(10, 10, 10, NaN); 1.7800 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7801 +var _thrown = undefined; try { 1.7802 + ctx.getImageData(Infinity, Infinity, 10, 10); 1.7803 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7804 +var _thrown = undefined; try { 1.7805 + ctx.getImageData(Infinity, Infinity, Infinity, 10); 1.7806 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7807 +var _thrown = undefined; try { 1.7808 + ctx.getImageData(Infinity, Infinity, Infinity, Infinity); 1.7809 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7810 +var _thrown = undefined; try { 1.7811 + ctx.getImageData(Infinity, Infinity, 10, Infinity); 1.7812 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7813 +var _thrown = undefined; try { 1.7814 + ctx.getImageData(Infinity, 10, Infinity, 10); 1.7815 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7816 +var _thrown = undefined; try { 1.7817 + ctx.getImageData(Infinity, 10, Infinity, Infinity); 1.7818 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7819 +var _thrown = undefined; try { 1.7820 + ctx.getImageData(Infinity, 10, 10, Infinity); 1.7821 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7822 +var _thrown = undefined; try { 1.7823 + ctx.getImageData(10, Infinity, Infinity, 10); 1.7824 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7825 +var _thrown = undefined; try { 1.7826 + ctx.getImageData(10, Infinity, Infinity, Infinity); 1.7827 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7828 +var _thrown = undefined; try { 1.7829 + ctx.getImageData(10, Infinity, 10, Infinity); 1.7830 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7831 +var _thrown = undefined; try { 1.7832 + ctx.getImageData(10, 10, Infinity, Infinity); 1.7833 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7834 +var _thrown = undefined; try { 1.7835 + ctx.getImageData({valueOf:function() Infinity}, 10, 10, 10); 1.7836 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7837 +var _thrown = undefined; try { 1.7838 + ctx.getImageData({valueOf:function() -Infinity}, 10, 10, 10); 1.7839 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7840 +var _thrown = undefined; try { 1.7841 + ctx.getImageData({valueOf:function() NaN}, 10, 10, 10); 1.7842 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7843 +var _thrown = undefined; try { 1.7844 + ctx.getImageData(10, {valueOf:function() Infinity}, 10, 10); 1.7845 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7846 +var _thrown = undefined; try { 1.7847 + ctx.getImageData(10, {valueOf:function() -Infinity}, 10, 10); 1.7848 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7849 +var _thrown = undefined; try { 1.7850 + ctx.getImageData(10, {valueOf:function() NaN}, 10, 10); 1.7851 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7852 +var _thrown = undefined; try { 1.7853 + ctx.getImageData(10, 10, {valueOf:function() Infinity}, 10); 1.7854 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7855 +var _thrown = undefined; try { 1.7856 + ctx.getImageData(10, 10, {valueOf:function() -Infinity}, 10); 1.7857 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7858 +var _thrown = undefined; try { 1.7859 + ctx.getImageData(10, 10, {valueOf:function() NaN}, 10); 1.7860 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7861 +var _thrown = undefined; try { 1.7862 + ctx.getImageData(10, 10, 10, {valueOf:function() Infinity}); 1.7863 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7864 +var _thrown = undefined; try { 1.7865 + ctx.getImageData(10, 10, 10, {valueOf:function() -Infinity}); 1.7866 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7867 +var _thrown = undefined; try { 1.7868 + ctx.getImageData(10, 10, 10, {valueOf:function() NaN}); 1.7869 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7870 +var _thrown = undefined; try { 1.7871 + ctx.getImageData({valueOf:function() Infinity}, {valueOf:function() Infinity}, 10, 10); 1.7872 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7873 +var _thrown = undefined; try { 1.7874 + ctx.getImageData({valueOf:function() Infinity}, {valueOf:function() Infinity}, {valueOf:function() Infinity}, 10); 1.7875 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7876 +var _thrown = undefined; try { 1.7877 + ctx.getImageData({valueOf:function() Infinity}, {valueOf:function() Infinity}, {valueOf:function() Infinity}, {valueOf:function() Infinity}); 1.7878 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7879 +var _thrown = undefined; try { 1.7880 + ctx.getImageData({valueOf:function() Infinity}, {valueOf:function() Infinity}, 10, {valueOf:function() Infinity}); 1.7881 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7882 +var _thrown = undefined; try { 1.7883 + ctx.getImageData({valueOf:function() Infinity}, 10, {valueOf:function() Infinity}, 10); 1.7884 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7885 +var _thrown = undefined; try { 1.7886 + ctx.getImageData({valueOf:function() Infinity}, 10, {valueOf:function() Infinity}, {valueOf:function() Infinity}); 1.7887 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7888 +var _thrown = undefined; try { 1.7889 + ctx.getImageData({valueOf:function() Infinity}, 10, 10, {valueOf:function() Infinity}); 1.7890 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7891 +var _thrown = undefined; try { 1.7892 + ctx.getImageData(10, {valueOf:function() Infinity}, {valueOf:function() Infinity}, 10); 1.7893 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7894 +var _thrown = undefined; try { 1.7895 + ctx.getImageData(10, {valueOf:function() Infinity}, {valueOf:function() Infinity}, {valueOf:function() Infinity}); 1.7896 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7897 +var _thrown = undefined; try { 1.7898 + ctx.getImageData(10, {valueOf:function() Infinity}, 10, {valueOf:function() Infinity}); 1.7899 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7900 +var _thrown = undefined; try { 1.7901 + ctx.getImageData(10, 10, {valueOf:function() Infinity}, {valueOf:function() Infinity}); 1.7902 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.7903 + 1.7904 + 1.7905 +} 1.7906 +</script> 1.7907 + 1.7908 +<!-- [[[ test_2d.imageData.get.nonpremul.html ]]] --> 1.7909 + 1.7910 +<p>Canvas test: 2d.imageData.get.nonpremul</p> 1.7911 +<!-- Testing: getImageData() returns non-premultiplied colours --> 1.7912 +<canvas id="c266" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7913 +<script> 1.7914 + 1.7915 +function test_2d_imageData_get_nonpremul() { 1.7916 + 1.7917 +var canvas = document.getElementById('c266'); 1.7918 +var ctx = canvas.getContext('2d'); 1.7919 + 1.7920 +ctx.fillStyle = 'rgba(255, 255, 255, 0.5)'; 1.7921 +ctx.fillRect(0, 0, 100, 50); 1.7922 +var imgdata = ctx.getImageData(10, 10, 10, 10); 1.7923 +ok(imgdata.data[0] > 200, "imgdata.data[\""+(0)+"\"] > 200"); 1.7924 +ok(imgdata.data[1] > 200, "imgdata.data[\""+(1)+"\"] > 200"); 1.7925 +ok(imgdata.data[2] > 200, "imgdata.data[\""+(2)+"\"] > 200"); 1.7926 +ok(imgdata.data[3] > 100, "imgdata.data[\""+(3)+"\"] > 100"); 1.7927 +ok(imgdata.data[3] < 200, "imgdata.data[\""+(3)+"\"] < 200"); 1.7928 + 1.7929 + 1.7930 +} 1.7931 +</script> 1.7932 + 1.7933 +<!-- [[[ test_2d.imageData.get.order.alpha.html ]]] --> 1.7934 + 1.7935 +<p>Canvas test: 2d.imageData.get.order.alpha</p> 1.7936 +<!-- Testing: getImageData() returns A in the fourth component --> 1.7937 +<canvas id="c267" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7938 +<script> 1.7939 + 1.7940 +function test_2d_imageData_get_order_alpha() { 1.7941 + 1.7942 +var canvas = document.getElementById('c267'); 1.7943 +var ctx = canvas.getContext('2d'); 1.7944 + 1.7945 +ctx.fillStyle = 'rgba(0, 0, 0, 0.5)'; 1.7946 +ctx.fillRect(0, 0, 100, 50); 1.7947 +var imgdata = ctx.getImageData(0, 0, 10, 10); 1.7948 +ok(imgdata.data[3] < 200, "imgdata.data[\""+(3)+"\"] < 200"); 1.7949 +ok(imgdata.data[3] > 100, "imgdata.data[\""+(3)+"\"] > 100"); 1.7950 + 1.7951 + 1.7952 +} 1.7953 +</script> 1.7954 + 1.7955 +<!-- [[[ test_2d.imageData.get.order.cols.html ]]] --> 1.7956 + 1.7957 +<p>Canvas test: 2d.imageData.get.order.cols</p> 1.7958 +<!-- Testing: getImageData() returns leftmost columns first --> 1.7959 +<canvas id="c268" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7960 +<script> 1.7961 + 1.7962 +function test_2d_imageData_get_order_cols() { 1.7963 + 1.7964 +var canvas = document.getElementById('c268'); 1.7965 +var ctx = canvas.getContext('2d'); 1.7966 + 1.7967 +ctx.fillStyle = '#fff'; 1.7968 +ctx.fillRect(0, 0, 100, 50); 1.7969 +ctx.fillStyle = '#000'; 1.7970 +ctx.fillRect(0, 0, 2, 50); 1.7971 +var imgdata = ctx.getImageData(0, 0, 10, 10); 1.7972 +ok(imgdata.data[0] === 0, "imgdata.data[\""+(0)+"\"] === 0"); 1.7973 +ok(imgdata.data[Math.round(imgdata.width/2*4)] === 255, "imgdata.data[Math.round(imgdata.width/2*4)] === 255"); 1.7974 +ok(imgdata.data[Math.round((imgdata.height/2)*imgdata.width*4)] === 0, "imgdata.data[Math.round((imgdata.height/2)*imgdata.width*4)] === 0"); 1.7975 + 1.7976 + 1.7977 +} 1.7978 +</script> 1.7979 + 1.7980 +<!-- [[[ test_2d.imageData.get.order.rgb.html ]]] --> 1.7981 + 1.7982 +<p>Canvas test: 2d.imageData.get.order.rgb</p> 1.7983 +<!-- Testing: getImageData() returns R then G then B --> 1.7984 +<canvas id="c269" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.7985 +<script> 1.7986 + 1.7987 +function test_2d_imageData_get_order_rgb() { 1.7988 + 1.7989 +var canvas = document.getElementById('c269'); 1.7990 +var ctx = canvas.getContext('2d'); 1.7991 + 1.7992 +ctx.fillStyle = '#48c'; 1.7993 +ctx.fillRect(0, 0, 100, 50); 1.7994 +var imgdata = ctx.getImageData(0, 0, 10, 10); 1.7995 +ok(imgdata.data[0] === 0x44, "imgdata.data[\""+(0)+"\"] === 0x44"); 1.7996 +ok(imgdata.data[1] === 0x88, "imgdata.data[\""+(1)+"\"] === 0x88"); 1.7997 +ok(imgdata.data[2] === 0xCC, "imgdata.data[\""+(2)+"\"] === 0xCC"); 1.7998 +ok(imgdata.data[3] === 255, "imgdata.data[\""+(3)+"\"] === 255"); 1.7999 + 1.8000 + 1.8001 +} 1.8002 +</script> 1.8003 + 1.8004 +<!-- [[[ test_2d.imageData.get.order.rows.html ]]] --> 1.8005 + 1.8006 +<p>Canvas test: 2d.imageData.get.order.rows</p> 1.8007 +<!-- Testing: getImageData() returns topmost rows first --> 1.8008 +<canvas id="c270" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8009 +<script> 1.8010 + 1.8011 +function test_2d_imageData_get_order_rows() { 1.8012 + 1.8013 +var canvas = document.getElementById('c270'); 1.8014 +var ctx = canvas.getContext('2d'); 1.8015 + 1.8016 +ctx.fillStyle = '#fff'; 1.8017 +ctx.fillRect(0, 0, 100, 50); 1.8018 +ctx.fillStyle = '#000'; 1.8019 +ctx.fillRect(0, 0, 100, 2); 1.8020 +var imgdata = ctx.getImageData(0, 0, 10, 10); 1.8021 +ok(imgdata.data[0] === 0, "imgdata.data[\""+(0)+"\"] === 0"); 1.8022 +ok(imgdata.data[Math.floor(imgdata.width/2*4)] === 0, "imgdata.data[Math.floor(imgdata.width/2*4)] === 0"); 1.8023 +ok(imgdata.data[(imgdata.height/2)*imgdata.width*4] === 255, "imgdata.data[(imgdata.height/2)*imgdata.width*4] === 255"); 1.8024 + 1.8025 + 1.8026 +} 1.8027 +</script> 1.8028 + 1.8029 +<!-- [[[ test_2d.imageData.get.range.html ]]] --> 1.8030 + 1.8031 +<p>Canvas test: 2d.imageData.get.range</p> 1.8032 +<!-- Testing: getImageData() returns values in the range [0, 255] --> 1.8033 +<canvas id="c271" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8034 +<script> 1.8035 + 1.8036 +function test_2d_imageData_get_range() { 1.8037 + 1.8038 +var canvas = document.getElementById('c271'); 1.8039 +var ctx = canvas.getContext('2d'); 1.8040 + 1.8041 +ctx.fillStyle = '#000'; 1.8042 +ctx.fillRect(0, 0, 100, 50); 1.8043 +ctx.fillStyle = '#fff'; 1.8044 +ctx.fillRect(20, 10, 60, 10); 1.8045 +var imgdata1 = ctx.getImageData(10, 5, 1, 1); 1.8046 +ok(imgdata1.data[0] === 0, "imgdata1.data[\""+(0)+"\"] === 0"); 1.8047 +var imgdata2 = ctx.getImageData(30, 15, 1, 1); 1.8048 +ok(imgdata2.data[0] === 255, "imgdata2.data[\""+(0)+"\"] === 255"); 1.8049 + 1.8050 + 1.8051 +} 1.8052 +</script> 1.8053 + 1.8054 +<!-- [[[ test_2d.imageData.get.source.negative.html ]]] --> 1.8055 + 1.8056 +<p>Canvas test: 2d.imageData.get.source.negative</p> 1.8057 +<!-- Testing: getImageData() works with negative width and height --> 1.8058 +<canvas id="c272" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8059 +<script> 1.8060 + 1.8061 +function test_2d_imageData_get_source_negative() { 1.8062 + 1.8063 +var canvas = document.getElementById('c272'); 1.8064 +var ctx = canvas.getContext('2d'); 1.8065 + 1.8066 +ctx.fillStyle = '#000'; 1.8067 +ctx.fillRect(0, 0, 100, 50); 1.8068 +ctx.fillStyle = '#fff'; 1.8069 +ctx.fillRect(20, 10, 60, 10); 1.8070 + 1.8071 +var imgdata1 = ctx.getImageData(85, 25, -10, -10); 1.8072 +ok(imgdata1.data[0] === 255, "imgdata1.data[\""+(0)+"\"] === 255"); 1.8073 +ok(imgdata1.data[1] === 255, "imgdata1.data[\""+(1)+"\"] === 255"); 1.8074 +ok(imgdata1.data[2] === 255, "imgdata1.data[\""+(2)+"\"] === 255"); 1.8075 +ok(imgdata1.data[3] === 255, "imgdata1.data[\""+(3)+"\"] === 255"); 1.8076 +ok(imgdata1.data[imgdata1.data.length-4+0] === 0, "imgdata1.data[imgdata1.data.length-4+0] === 0"); 1.8077 +ok(imgdata1.data[imgdata1.data.length-4+1] === 0, "imgdata1.data[imgdata1.data.length-4+1] === 0"); 1.8078 +ok(imgdata1.data[imgdata1.data.length-4+2] === 0, "imgdata1.data[imgdata1.data.length-4+2] === 0"); 1.8079 +ok(imgdata1.data[imgdata1.data.length-4+3] === 255, "imgdata1.data[imgdata1.data.length-4+3] === 255"); 1.8080 + 1.8081 +var imgdata2 = ctx.getImageData(0, 0, -1, -1); 1.8082 +ok(imgdata2.data[0] === 0, "imgdata2.data[\""+(0)+"\"] === 0"); 1.8083 +ok(imgdata2.data[1] === 0, "imgdata2.data[\""+(1)+"\"] === 0"); 1.8084 +ok(imgdata2.data[2] === 0, "imgdata2.data[\""+(2)+"\"] === 0"); 1.8085 +ok(imgdata2.data[3] === 0, "imgdata2.data[\""+(3)+"\"] === 0"); 1.8086 + 1.8087 + 1.8088 +} 1.8089 +</script> 1.8090 + 1.8091 +<!-- [[[ test_2d.imageData.get.source.outside.html ]]] --> 1.8092 + 1.8093 +<p>Canvas test: 2d.imageData.get.source.outside</p> 1.8094 +<!-- Testing: getImageData() returns transparent black outside the canvas --> 1.8095 +<canvas id="c273" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8096 +<script> 1.8097 + 1.8098 +function test_2d_imageData_get_source_outside() { 1.8099 + 1.8100 +var canvas = document.getElementById('c273'); 1.8101 +var ctx = canvas.getContext('2d'); 1.8102 + 1.8103 +var _thrown_outer = false; 1.8104 +try { 1.8105 + 1.8106 +ctx.fillStyle = '#08f'; 1.8107 +ctx.fillRect(0, 0, 100, 50); 1.8108 + 1.8109 +var imgdata1 = ctx.getImageData(-10, 5, 1, 1); 1.8110 +ok(imgdata1.data[0] === 0, "imgdata1.data[\""+(0)+"\"] === 0"); 1.8111 +ok(imgdata1.data[1] === 0, "imgdata1.data[\""+(1)+"\"] === 0"); 1.8112 +ok(imgdata1.data[2] === 0, "imgdata1.data[\""+(2)+"\"] === 0"); 1.8113 +ok(imgdata1.data[3] === 0, "imgdata1.data[\""+(3)+"\"] === 0"); 1.8114 + 1.8115 +var imgdata2 = ctx.getImageData(10, -5, 1, 1); 1.8116 +ok(imgdata2.data[0] === 0, "imgdata2.data[\""+(0)+"\"] === 0"); 1.8117 +ok(imgdata2.data[1] === 0, "imgdata2.data[\""+(1)+"\"] === 0"); 1.8118 +ok(imgdata2.data[2] === 0, "imgdata2.data[\""+(2)+"\"] === 0"); 1.8119 +ok(imgdata2.data[3] === 0, "imgdata2.data[\""+(3)+"\"] === 0"); 1.8120 + 1.8121 +var imgdata3 = ctx.getImageData(200, 5, 1, 1); 1.8122 +ok(imgdata3.data[0] === 0, "imgdata3.data[\""+(0)+"\"] === 0"); 1.8123 +ok(imgdata3.data[1] === 0, "imgdata3.data[\""+(1)+"\"] === 0"); 1.8124 +ok(imgdata3.data[2] === 0, "imgdata3.data[\""+(2)+"\"] === 0"); 1.8125 +ok(imgdata3.data[3] === 0, "imgdata3.data[\""+(3)+"\"] === 0"); 1.8126 + 1.8127 +var imgdata4 = ctx.getImageData(10, 60, 1, 1); 1.8128 +ok(imgdata4.data[0] === 0, "imgdata4.data[\""+(0)+"\"] === 0"); 1.8129 +ok(imgdata4.data[1] === 0, "imgdata4.data[\""+(1)+"\"] === 0"); 1.8130 +ok(imgdata4.data[2] === 0, "imgdata4.data[\""+(2)+"\"] === 0"); 1.8131 +ok(imgdata4.data[3] === 0, "imgdata4.data[\""+(3)+"\"] === 0"); 1.8132 + 1.8133 +var imgdata5 = ctx.getImageData(100, 10, 1, 1); 1.8134 +ok(imgdata5.data[0] === 0, "imgdata5.data[\""+(0)+"\"] === 0"); 1.8135 +ok(imgdata5.data[1] === 0, "imgdata5.data[\""+(1)+"\"] === 0"); 1.8136 +ok(imgdata5.data[2] === 0, "imgdata5.data[\""+(2)+"\"] === 0"); 1.8137 +ok(imgdata5.data[3] === 0, "imgdata5.data[\""+(3)+"\"] === 0"); 1.8138 + 1.8139 +var imgdata6 = ctx.getImageData(0, 10, 1, 1); 1.8140 +ok(imgdata6.data[0] === 0, "imgdata6.data[\""+(0)+"\"] === 0"); 1.8141 +ok(imgdata6.data[1] === 136, "imgdata6.data[\""+(1)+"\"] === 136"); 1.8142 +ok(imgdata6.data[2] === 255, "imgdata6.data[\""+(2)+"\"] === 255"); 1.8143 +ok(imgdata6.data[3] === 255, "imgdata6.data[\""+(3)+"\"] === 255"); 1.8144 + 1.8145 +var imgdata7 = ctx.getImageData(-10, 10, 20, 20); 1.8146 +ok(imgdata7.data[ 0*4+0] === 0, "imgdata7.data[ 0*4+0] === 0"); 1.8147 +ok(imgdata7.data[ 0*4+1] === 0, "imgdata7.data[ 0*4+1] === 0"); 1.8148 +ok(imgdata7.data[ 0*4+2] === 0, "imgdata7.data[ 0*4+2] === 0"); 1.8149 +ok(imgdata7.data[ 0*4+3] === 0, "imgdata7.data[ 0*4+3] === 0"); 1.8150 +ok(imgdata7.data[ 9*4+0] === 0, "imgdata7.data[ 9*4+0] === 0"); 1.8151 +ok(imgdata7.data[ 9*4+1] === 0, "imgdata7.data[ 9*4+1] === 0"); 1.8152 +ok(imgdata7.data[ 9*4+2] === 0, "imgdata7.data[ 9*4+2] === 0"); 1.8153 +ok(imgdata7.data[ 9*4+3] === 0, "imgdata7.data[ 9*4+3] === 0"); 1.8154 +ok(imgdata7.data[10*4+0] === 0, "imgdata7.data[10*4+0] === 0"); 1.8155 +ok(imgdata7.data[10*4+1] === 136, "imgdata7.data[10*4+1] === 136"); 1.8156 +ok(imgdata7.data[10*4+2] === 255, "imgdata7.data[10*4+2] === 255"); 1.8157 +ok(imgdata7.data[10*4+3] === 255, "imgdata7.data[10*4+3] === 255"); 1.8158 +ok(imgdata7.data[19*4+0] === 0, "imgdata7.data[19*4+0] === 0"); 1.8159 +ok(imgdata7.data[19*4+1] === 136, "imgdata7.data[19*4+1] === 136"); 1.8160 +ok(imgdata7.data[19*4+2] === 255, "imgdata7.data[19*4+2] === 255"); 1.8161 +ok(imgdata7.data[19*4+3] === 255, "imgdata7.data[19*4+3] === 255"); 1.8162 +ok(imgdata7.data[20*4+0] === 0, "imgdata7.data[20*4+0] === 0"); 1.8163 +ok(imgdata7.data[20*4+1] === 0, "imgdata7.data[20*4+1] === 0"); 1.8164 +ok(imgdata7.data[20*4+2] === 0, "imgdata7.data[20*4+2] === 0"); 1.8165 +ok(imgdata7.data[20*4+3] === 0, "imgdata7.data[20*4+3] === 0"); 1.8166 + 1.8167 +} catch (e) { 1.8168 + _thrown_outer = true; 1.8169 +} 1.8170 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.8171 + 1.8172 + 1.8173 +} 1.8174 +</script> 1.8175 + 1.8176 +<!-- [[[ test_2d.imageData.get.source.size.html ]]] --> 1.8177 + 1.8178 +<p>Canvas test: 2d.imageData.get.source.size</p> 1.8179 +<!-- Testing: getImageData() returns bigger ImageData for bigger source rectangle --> 1.8180 +<canvas id="c274" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8181 +<script> 1.8182 + 1.8183 +function test_2d_imageData_get_source_size() { 1.8184 + 1.8185 +var canvas = document.getElementById('c274'); 1.8186 +var ctx = canvas.getContext('2d'); 1.8187 + 1.8188 +var imgdata1 = ctx.getImageData(0, 0, 10, 10); 1.8189 +var imgdata2 = ctx.getImageData(0, 0, 20, 20); 1.8190 +ok(imgdata2.width > imgdata1.width, "imgdata2.width > imgdata1.width"); 1.8191 +ok(imgdata2.height > imgdata1.height, "imgdata2.height > imgdata1.height"); 1.8192 + 1.8193 + 1.8194 +} 1.8195 +</script> 1.8196 + 1.8197 +<!-- [[[ test_2d.imageData.get.tiny.html ]]] --> 1.8198 + 1.8199 +<p>Canvas test: 2d.imageData.get.tiny</p> 1.8200 +<!-- Testing: getImageData() works for sizes smaller than one pixel --> 1.8201 +<canvas id="c275" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8202 +<script> 1.8203 + 1.8204 +function test_2d_imageData_get_tiny() { 1.8205 + 1.8206 +var canvas = document.getElementById('c275'); 1.8207 +var ctx = canvas.getContext('2d'); 1.8208 + 1.8209 +var _thrown_outer = false; 1.8210 +try { 1.8211 + 1.8212 +var imgdata = ctx.getImageData(0, 0, 0.0001, 0.0001); 1.8213 +ok(imgdata.data.length == imgdata.width*imgdata.height*4, "imgdata.data.length == imgdata.width*imgdata.height*4"); 1.8214 +ok(imgdata.width == 1, "imgdata.width == 1"); 1.8215 +ok(imgdata.height == 1, "imgdata.height == 1"); 1.8216 + 1.8217 +} catch (e) { 1.8218 + _thrown_outer = true; 1.8219 +} 1.8220 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.8221 + 1.8222 + 1.8223 +} 1.8224 +</script> 1.8225 + 1.8226 +<!-- [[[ test_2d.imageData.get.type.html ]]] --> 1.8227 + 1.8228 +<p>Canvas test: 2d.imageData.get.type</p> 1.8229 +<!-- Testing: getImageData() returns an ImageData object containing a Uint8ClampedArray object --> 1.8230 +<canvas id="c276" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8231 +<script> 1.8232 + 1.8233 +function test_2d_imageData_get_type() { 1.8234 + 1.8235 +var canvas = document.getElementById('c276'); 1.8236 +var ctx = canvas.getContext('2d'); 1.8237 + 1.8238 +ok(window.ImageData !== undefined, "window.ImageData !== undefined"); 1.8239 +ok(window.Uint8ClampedArray !== undefined, "window.Uint8ClampedArray !== undefined"); 1.8240 +window.ImageData.prototype.thisImplementsImageData = true; 1.8241 +window.Uint8ClampedArray.prototype.thisImplementsUint8ClampedArray = true; 1.8242 +var imgdata = ctx.getImageData(0, 0, 1, 1); 1.8243 +ok(imgdata.thisImplementsImageData, "imgdata.thisImplementsImageData"); 1.8244 +ok(imgdata.data.thisImplementsUint8ClampedArray, "imgdata.data.thisImplementsUint8ClampedArray"); 1.8245 + 1.8246 + 1.8247 +} 1.8248 +</script> 1.8249 + 1.8250 +<!-- [[[ test_2d.imageData.get.unaffected.html ]]] --> 1.8251 + 1.8252 +<p>Canvas test: 2d.imageData.get.unaffected</p> 1.8253 +<!-- Testing: getImageData() is not affected by context state --> 1.8254 +<canvas id="c277" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8255 +<script> 1.8256 + 1.8257 + 1.8258 +function test_2d_imageData_get_unaffected() { 1.8259 + 1.8260 +var canvas = document.getElementById('c277'); 1.8261 +var ctx = canvas.getContext('2d'); 1.8262 + 1.8263 +ctx.fillStyle = '#0f0'; 1.8264 +ctx.fillRect(0, 0, 50, 50) 1.8265 +ctx.fillStyle = '#f00'; 1.8266 +ctx.fillRect(50, 0, 50, 50) 1.8267 +ctx.save(); 1.8268 +ctx.translate(50, 0); 1.8269 +ctx.globalAlpha = 0.1; 1.8270 +ctx.globalCompositeOperation = 'destination-atop'; 1.8271 +ctx.shadowColor = '#f00'; 1.8272 +ctx.rect(0, 0, 5, 5); 1.8273 +ctx.clip(); 1.8274 +var imgdata = ctx.getImageData(0, 0, 50, 50); 1.8275 +ctx.restore(); 1.8276 +ctx.putImageData(imgdata, 50, 0); 1.8277 +isPixel(ctx, 25,25, 0,255,0,255, 2); 1.8278 +isPixel(ctx, 75,25, 0,255,0,255, 2); 1.8279 + 1.8280 + 1.8281 +} 1.8282 +</script> 1.8283 + 1.8284 +<!-- [[[ test_2d.imageData.get.zero.html ]]] --> 1.8285 + 1.8286 +<p>Canvas test: 2d.imageData.get.zero</p> 1.8287 +<!-- Testing: getImageData() throws INDEX_SIZE_ERR if size is zero --> 1.8288 +<canvas id="c278" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8289 +<script> 1.8290 + 1.8291 +function test_2d_imageData_get_zero() { 1.8292 + 1.8293 +var canvas = document.getElementById('c278'); 1.8294 +var ctx = canvas.getContext('2d'); 1.8295 + 1.8296 +var _thrown = undefined; try { 1.8297 + ctx.getImageData(1, 1, 10, 0); 1.8298 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.8299 +var _thrown = undefined; try { 1.8300 + ctx.getImageData(1, 1, 0, 10); 1.8301 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.8302 +var _thrown = undefined; try { 1.8303 + ctx.getImageData(1, 1, 0, 0); 1.8304 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.8305 + 1.8306 + 1.8307 +} 1.8308 +</script> 1.8309 + 1.8310 +<!-- [[[ test_2d.imageData.object.clamp.html ]]] --> 1.8311 + 1.8312 +<p>Canvas test: 2d.imageData.object.clamp</p> 1.8313 +<!-- Testing: ImageData.data clamps numbers to [0, 255] --> 1.8314 +<canvas id="c279" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8315 +<script> 1.8316 + 1.8317 +function test_2d_imageData_object_clamp() { 1.8318 + 1.8319 +var canvas = document.getElementById('c279'); 1.8320 +var ctx = canvas.getContext('2d'); 1.8321 + 1.8322 +var imgdata = ctx.getImageData(0, 0, 10, 10); 1.8323 + 1.8324 +imgdata.data[0] = 100; 1.8325 +imgdata.data[0] = 300; 1.8326 +ok(imgdata.data[0] === 255, "imgdata.data[\""+(0)+"\"] === 255"); 1.8327 +imgdata.data[0] = 100; 1.8328 +imgdata.data[0] = -100; 1.8329 +ok(imgdata.data[0] === 0, "imgdata.data[\""+(0)+"\"] === 0"); 1.8330 + 1.8331 +imgdata.data[0] = 100; 1.8332 +imgdata.data[0] = 200+Math.pow(2, 32); 1.8333 +ok(imgdata.data[0] === 255, "imgdata.data[\""+(0)+"\"] === 255"); 1.8334 +imgdata.data[0] = 100; 1.8335 +imgdata.data[0] = -200-Math.pow(2, 32); 1.8336 +ok(imgdata.data[0] === 0, "imgdata.data[\""+(0)+"\"] === 0"); 1.8337 + 1.8338 +imgdata.data[0] = 100; 1.8339 +imgdata.data[0] = Math.pow(10, 39); 1.8340 +ok(imgdata.data[0] === 255, "imgdata.data[\""+(0)+"\"] === 255"); 1.8341 +imgdata.data[0] = 100; 1.8342 +imgdata.data[0] = -Math.pow(10, 39); 1.8343 +ok(imgdata.data[0] === 0, "imgdata.data[\""+(0)+"\"] === 0"); 1.8344 + 1.8345 +imgdata.data[0] = 100; 1.8346 +imgdata.data[0] = -Infinity; 1.8347 +ok(imgdata.data[0] === 0, "imgdata.data[\""+(0)+"\"] === 0"); 1.8348 +imgdata.data[0] = 100; 1.8349 +imgdata.data[0] = Infinity; 1.8350 +ok(imgdata.data[0] === 255, "imgdata.data[\""+(0)+"\"] === 255"); 1.8351 + 1.8352 + 1.8353 +} 1.8354 +</script> 1.8355 + 1.8356 +<!-- [[[ test_2d.imageData.object.ctor.html ]]] --> 1.8357 + 1.8358 +<p>Canvas test: 2d.imageData.object.ctor</p> 1.8359 +<!-- Testing: ImageData does not have a usable constructor --> 1.8360 +<canvas id="c280" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8361 +<script> 1.8362 + 1.8363 +function test_2d_imageData_object_ctor() { 1.8364 + 1.8365 +var canvas = document.getElementById('c280'); 1.8366 +var ctx = canvas.getContext('2d'); 1.8367 + 1.8368 +ok(window.ImageData !== undefined, "window.ImageData !== undefined"); 1.8369 + 1.8370 +var _thrown_outer = false; 1.8371 +try { 1.8372 + 1.8373 +new window.ImageData(1,1); 1.8374 + 1.8375 +} catch (e) { 1.8376 + _thrown_outer = true; 1.8377 +} 1.8378 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.8379 + 1.8380 + 1.8381 +} 1.8382 +</script> 1.8383 + 1.8384 +<!-- [[[ test_2d.imageData.object.nan.html ]]] --> 1.8385 + 1.8386 +<p>Canvas test: 2d.imageData.object.nan</p> 1.8387 +<!-- Testing: ImageData.data converts NaN to 0 --> 1.8388 +<canvas id="c281" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8389 +<script> 1.8390 + 1.8391 +function test_2d_imageData_object_nan() { 1.8392 + 1.8393 +var canvas = document.getElementById('c281'); 1.8394 +var ctx = canvas.getContext('2d'); 1.8395 + 1.8396 +var imgdata = ctx.getImageData(0, 0, 10, 10); 1.8397 +imgdata.data[0] = 100; 1.8398 +imgdata.data[0] = NaN; 1.8399 +ok(imgdata.data[0] === 0, "imgdata.data[\""+(0)+"\"] === 0"); 1.8400 +imgdata.data[0] = 100; 1.8401 +imgdata.data[0] = "cheese"; 1.8402 +ok(imgdata.data[0] === 0, "imgdata.data[\""+(0)+"\"] === 0"); 1.8403 + 1.8404 + 1.8405 +} 1.8406 +</script> 1.8407 + 1.8408 +<!-- [[[ test_2d.imageData.object.properties.html ]]] --> 1.8409 + 1.8410 +<p>Canvas test: 2d.imageData.object.properties</p> 1.8411 +<!-- Testing: ImageData objects have the right properties --> 1.8412 +<canvas id="c282" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8413 +<script> 1.8414 + 1.8415 +function test_2d_imageData_object_properties() { 1.8416 + 1.8417 +var canvas = document.getElementById('c282'); 1.8418 +var ctx = canvas.getContext('2d'); 1.8419 + 1.8420 +var imgdata = ctx.getImageData(0, 0, 10, 10); 1.8421 +ok(typeof(imgdata.width) == 'number', "typeof(imgdata.width) == 'number'"); 1.8422 +ok(typeof(imgdata.height) == 'number', "typeof(imgdata.height) == 'number'"); 1.8423 +ok(typeof(imgdata.data) == 'object', "typeof(imgdata.data) == 'object'"); 1.8424 + 1.8425 + 1.8426 +} 1.8427 +</script> 1.8428 + 1.8429 +<!-- [[[ test_2d.imageData.object.readonly.html ]]] --> 1.8430 + 1.8431 +<p>Canvas test: 2d.imageData.object.readonly</p> 1.8432 +<!-- Testing: ImageData objects properties are read-only --> 1.8433 +<canvas id="c283" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8434 +<script> 1.8435 + 1.8436 +function test_2d_imageData_object_readonly() { 1.8437 + 1.8438 +var canvas = document.getElementById('c283'); 1.8439 +var ctx = canvas.getContext('2d'); 1.8440 + 1.8441 +var imgdata = ctx.getImageData(0, 0, 10, 10); 1.8442 +var w = imgdata.width; 1.8443 +var h = imgdata.height; 1.8444 +var d = imgdata.data; 1.8445 +imgdata.width = 123; 1.8446 +imgdata.height = 123; 1.8447 +imgdata.data = [100,100,100,100]; 1.8448 +ok(imgdata.width === w, "imgdata.width === w"); 1.8449 +ok(imgdata.height === h, "imgdata.height === h"); 1.8450 +ok(imgdata.data === d, "imgdata.data === d"); 1.8451 +ok(imgdata.data[0] === 0, "imgdata.data[\""+(0)+"\"] === 0"); 1.8452 +ok(imgdata.data[1] === 0, "imgdata.data[\""+(1)+"\"] === 0"); 1.8453 +ok(imgdata.data[2] === 0, "imgdata.data[\""+(2)+"\"] === 0"); 1.8454 +ok(imgdata.data[3] === 0, "imgdata.data[\""+(3)+"\"] === 0"); 1.8455 + 1.8456 + 1.8457 +} 1.8458 +</script> 1.8459 + 1.8460 +<!-- [[[ test_2d.imageData.object.round.html ]]] --> 1.8461 + 1.8462 +<p>Canvas test: 2d.imageData.object.round</p> 1.8463 +<!-- Testing: ImageData.data rounds numbers with convertToIntegerTiesToEven --> 1.8464 +<canvas id="c284" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8465 +<script> 1.8466 + 1.8467 +function test_2d_imageData_object_round() { 1.8468 + 1.8469 +var canvas = document.getElementById('c284'); 1.8470 +var ctx = canvas.getContext('2d'); 1.8471 + 1.8472 +var imgdata = ctx.getImageData(0, 0, 10, 10); 1.8473 +imgdata.data[0] = 0.499; 1.8474 +ok(imgdata.data[0] === 0, "imgdata.data[\""+(0)+"\"] === 0"); 1.8475 +imgdata.data[0] = 0.5; 1.8476 +ok(imgdata.data[0] === 0, "imgdata.data[\""+(0)+"\"] === 0"); 1.8477 +imgdata.data[0] = 0.501; 1.8478 +ok(imgdata.data[0] === 1, "imgdata.data[\""+(0)+"\"] === 1"); 1.8479 +imgdata.data[0] = 1.499; 1.8480 +ok(imgdata.data[0] === 1, "imgdata.data[\""+(0)+"\"] === 1"); 1.8481 +imgdata.data[0] = 1.5; 1.8482 +ok(imgdata.data[0] === 2, "imgdata.data[\""+(0)+"\"] === 2"); 1.8483 +imgdata.data[0] = 1.501; 1.8484 +ok(imgdata.data[0] === 2, "imgdata.data[\""+(0)+"\"] === 2"); 1.8485 +imgdata.data[0] = 2.5; 1.8486 +ok(imgdata.data[0] === 2, "imgdata.data[\""+(0)+"\"] === 2"); 1.8487 +imgdata.data[0] = 3.5; 1.8488 +ok(imgdata.data[0] === 4, "imgdata.data[\""+(0)+"\"] === 4"); 1.8489 +imgdata.data[0] = 252.5; 1.8490 +ok(imgdata.data[0] === 252, "imgdata.data[\""+(0)+"\"] === 252"); 1.8491 +imgdata.data[0] = 253.5; 1.8492 +ok(imgdata.data[0] === 254, "imgdata.data[\""+(0)+"\"] === 254"); 1.8493 +imgdata.data[0] = 254.5; 1.8494 +ok(imgdata.data[0] === 254, "imgdata.data[\""+(0)+"\"] === 254"); 1.8495 + 1.8496 + 1.8497 +} 1.8498 +</script> 1.8499 + 1.8500 +<!-- [[[ test_2d.imageData.object.set.html ]]] --> 1.8501 + 1.8502 +<p>Canvas test: 2d.imageData.object.set</p> 1.8503 +<!-- Testing: ImageData.data can be modified --> 1.8504 +<canvas id="c285" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8505 +<script> 1.8506 + 1.8507 +function test_2d_imageData_object_set() { 1.8508 + 1.8509 +var canvas = document.getElementById('c285'); 1.8510 +var ctx = canvas.getContext('2d'); 1.8511 + 1.8512 +var imgdata = ctx.getImageData(0, 0, 10, 10); 1.8513 +imgdata.data[0] = 100; 1.8514 +ok(imgdata.data[0] === 100, "imgdata.data[\""+(0)+"\"] === 100"); 1.8515 +imgdata.data[0] = 200; 1.8516 +ok(imgdata.data[0] === 200, "imgdata.data[\""+(0)+"\"] === 200"); 1.8517 + 1.8518 + 1.8519 +} 1.8520 +</script> 1.8521 + 1.8522 +<!-- [[[ test_2d.imageData.object.string.html ]]] --> 1.8523 + 1.8524 +<p>Canvas test: 2d.imageData.object.string</p> 1.8525 +<!-- Testing: ImageData.data converts strings to numbers with ToNumber --> 1.8526 +<canvas id="c286" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8527 +<script> 1.8528 + 1.8529 +function test_2d_imageData_object_string() { 1.8530 + 1.8531 +var canvas = document.getElementById('c286'); 1.8532 +var ctx = canvas.getContext('2d'); 1.8533 + 1.8534 +var imgdata = ctx.getImageData(0, 0, 10, 10); 1.8535 +imgdata.data[0] = 100; 1.8536 +imgdata.data[0] = "110"; 1.8537 +ok(imgdata.data[0] === 110, "imgdata.data[\""+(0)+"\"] === 110"); 1.8538 +imgdata.data[0] = 100; 1.8539 +imgdata.data[0] = "0x78"; 1.8540 +ok(imgdata.data[0] === 120, "imgdata.data[\""+(0)+"\"] === 120"); 1.8541 +imgdata.data[0] = 100; 1.8542 +imgdata.data[0] = " +130e0 "; 1.8543 +ok(imgdata.data[0] === 130, "imgdata.data[\""+(0)+"\"] === 130"); 1.8544 + 1.8545 + 1.8546 +} 1.8547 +</script> 1.8548 + 1.8549 +<!-- [[[ test_2d.imageData.object.undefined.html ]]] --> 1.8550 + 1.8551 +<p>Canvas test: 2d.imageData.object.undefined</p> 1.8552 +<!-- Testing: ImageData.data converts undefined to 0 --> 1.8553 +<canvas id="c287" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8554 +<script> 1.8555 + 1.8556 +function test_2d_imageData_object_undefined() { 1.8557 + 1.8558 +var canvas = document.getElementById('c287'); 1.8559 +var ctx = canvas.getContext('2d'); 1.8560 + 1.8561 +var imgdata = ctx.getImageData(0, 0, 10, 10); 1.8562 +imgdata.data[0] = 100; 1.8563 +imgdata.data[0] = undefined; 1.8564 +ok(imgdata.data[0] === 0, "imgdata.data[\""+(0)+"\"] === 0"); 1.8565 + 1.8566 + 1.8567 +} 1.8568 +</script> 1.8569 + 1.8570 +<!-- [[[ test_2d.imageData.put.alpha.html ]]] --> 1.8571 + 1.8572 +<p>Canvas test: 2d.imageData.put.alpha</p> 1.8573 +<!-- Testing: putImageData() puts non-solid image data correctly --> 1.8574 +<canvas id="c288" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8575 +<script> 1.8576 + 1.8577 + 1.8578 +function test_2d_imageData_put_alpha() { 1.8579 + 1.8580 +var canvas = document.getElementById('c288'); 1.8581 +var ctx = canvas.getContext('2d'); 1.8582 + 1.8583 +ctx.fillStyle = 'rgba(0, 255, 0, 0.25)'; 1.8584 +ctx.fillRect(0, 0, 100, 50) 1.8585 +var imgdata = ctx.getImageData(0, 0, 100, 50); 1.8586 +ctx.fillStyle = '#f00'; 1.8587 +ctx.fillRect(0, 0, 100, 50) 1.8588 +ctx.putImageData(imgdata, 0, 0); 1.8589 +isPixel(ctx, 50,25, 0,255,0,64, 2); 1.8590 + 1.8591 + 1.8592 +} 1.8593 +</script> 1.8594 + 1.8595 +<!-- [[[ test_2d.imageData.put.basic.html ]]] --> 1.8596 + 1.8597 +<p>Canvas test: 2d.imageData.put.basic</p> 1.8598 +<!-- Testing: putImageData() puts image data from getImageData() onto the canvas --> 1.8599 +<canvas id="c289" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8600 +<script> 1.8601 + 1.8602 + 1.8603 +function test_2d_imageData_put_basic() { 1.8604 + 1.8605 +var canvas = document.getElementById('c289'); 1.8606 +var ctx = canvas.getContext('2d'); 1.8607 + 1.8608 +ctx.fillStyle = '#0f0'; 1.8609 +ctx.fillRect(0, 0, 100, 50) 1.8610 +var imgdata = ctx.getImageData(0, 0, 100, 50); 1.8611 +ctx.fillStyle = '#f00'; 1.8612 +ctx.fillRect(0, 0, 100, 50) 1.8613 +ctx.putImageData(imgdata, 0, 0); 1.8614 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.8615 + 1.8616 + 1.8617 +} 1.8618 +</script> 1.8619 + 1.8620 +<!-- [[[ test_2d.imageData.put.clip.html ]]] --> 1.8621 + 1.8622 +<p>Canvas test: 2d.imageData.put.clip - bug 433397</p> 1.8623 +<!-- Testing: putImageData() is not affected by clipping regions --> 1.8624 +<canvas id="c290" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8625 +<script> 1.8626 + 1.8627 + 1.8628 + 1.8629 +function test_2d_imageData_put_clip() { 1.8630 + 1.8631 +var canvas = document.getElementById('c290'); 1.8632 +var ctx = canvas.getContext('2d'); 1.8633 + 1.8634 +ctx.fillStyle = '#0f0'; 1.8635 +ctx.fillRect(0, 0, 100, 50) 1.8636 +var imgdata = ctx.getImageData(0, 0, 100, 50); 1.8637 +ctx.fillStyle = '#f00'; 1.8638 +ctx.fillRect(0, 0, 100, 50) 1.8639 +ctx.beginPath(); 1.8640 +ctx.rect(0, 0, 50, 50); 1.8641 +ctx.clip(); 1.8642 +ctx.putImageData(imgdata, 0, 0); 1.8643 +isPixel(ctx, 25,25, 0,255,0,255, 2); 1.8644 +isPixel(ctx, 75,25, 0,255,0,255, 2); 1.8645 + 1.8646 + 1.8647 +} 1.8648 +</script> 1.8649 + 1.8650 +<!-- [[[ test_2d.imageData.put.created.html ]]] --> 1.8651 + 1.8652 +<p>Canvas test: 2d.imageData.put.created - bug 433004</p> 1.8653 +<!-- Testing: putImageData() puts image data from createImageData() onto the canvas --> 1.8654 +<canvas id="c291" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8655 +<script> 1.8656 + 1.8657 + 1.8658 +function test_2d_imageData_put_created() { 1.8659 + 1.8660 +var canvas = document.getElementById('c291'); 1.8661 +var ctx = canvas.getContext('2d'); 1.8662 + 1.8663 +var imgdata = ctx.createImageData(100, 50); 1.8664 +for (var i = 0; i < imgdata.data.length; i += 4) { 1.8665 + imgdata.data[i] = 0; 1.8666 + imgdata.data[i+1] = 255; 1.8667 + imgdata.data[i+2] = 0; 1.8668 + imgdata.data[i+3] = 255; 1.8669 +} 1.8670 +ctx.fillStyle = '#f00'; 1.8671 +ctx.fillRect(0, 0, 100, 50) 1.8672 +ctx.putImageData(imgdata, 0, 0); 1.8673 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.8674 + 1.8675 + 1.8676 +} 1.8677 +</script> 1.8678 + 1.8679 +<!-- [[[ test_2d.imageData.put.cross.html ]]] --> 1.8680 + 1.8681 +<p>Canvas test: 2d.imageData.put.cross</p> 1.8682 +<!-- Testing: putImageData() accepts image data got from a different canvas --> 1.8683 +<canvas id="c292" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8684 +<script> 1.8685 + 1.8686 + 1.8687 +function test_2d_imageData_put_cross() { 1.8688 + 1.8689 +var canvas = document.getElementById('c292'); 1.8690 +var ctx = canvas.getContext('2d'); 1.8691 + 1.8692 +var canvas2 = document.createElement('canvas'); 1.8693 +var ctx2 = canvas2.getContext('2d'); 1.8694 +ctx2.fillStyle = '#0f0'; 1.8695 +ctx2.fillRect(0, 0, 100, 50) 1.8696 +var imgdata = ctx2.getImageData(0, 0, 100, 50); 1.8697 +ctx.fillStyle = '#f00'; 1.8698 +ctx.fillRect(0, 0, 100, 50) 1.8699 +ctx.putImageData(imgdata, 0, 0); 1.8700 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.8701 + 1.8702 + 1.8703 +} 1.8704 +</script> 1.8705 + 1.8706 +<!-- [[[ test_2d.imageData.put.dirty.negative.html ]]] --> 1.8707 + 1.8708 +<p>Canvas test: 2d.imageData.put.dirty.negative</p> 1.8709 +<!-- Testing: putImageData() handles negative-sized dirty rectangles correctly --> 1.8710 +<canvas id="c293" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8711 +<script> 1.8712 + 1.8713 + 1.8714 +function test_2d_imageData_put_dirty_negative() { 1.8715 + 1.8716 +var canvas = document.getElementById('c293'); 1.8717 +var ctx = canvas.getContext('2d'); 1.8718 + 1.8719 +var _thrown_outer = false; 1.8720 +try { 1.8721 + 1.8722 +ctx.fillStyle = '#f00'; 1.8723 +ctx.fillRect(0, 0, 100, 50) 1.8724 +ctx.fillStyle = '#0f0'; 1.8725 +ctx.fillRect(0, 0, 20, 20) 1.8726 + 1.8727 +var imgdata = ctx.getImageData(0, 0, 100, 50); 1.8728 + 1.8729 +ctx.fillStyle = '#0f0'; 1.8730 +ctx.fillRect(0, 0, 100, 50) 1.8731 +ctx.fillStyle = '#f00'; 1.8732 +ctx.fillRect(40, 20, 20, 20) 1.8733 +ctx.putImageData(imgdata, 40, 20, 20, 20, -20, -20); 1.8734 + 1.8735 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.8736 +isPixel(ctx, 35,25, 0,255,0,255, 2); 1.8737 +isPixel(ctx, 65,25, 0,255,0,255, 2); 1.8738 +isPixel(ctx, 50,15, 0,255,0,255, 2); 1.8739 +isPixel(ctx, 50,45, 0,255,0,255, 2); 1.8740 + 1.8741 +} catch (e) { 1.8742 + _thrown_outer = true; 1.8743 +} 1.8744 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.8745 + 1.8746 + 1.8747 +} 1.8748 +</script> 1.8749 + 1.8750 +<!-- [[[ test_2d.imageData.put.dirty.outside.html ]]] --> 1.8751 + 1.8752 +<p>Canvas test: 2d.imageData.put.dirty.outside</p> 1.8753 +<!-- Testing: putImageData() handles dirty rectangles outside the canvas correctly --> 1.8754 +<canvas id="c294" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8755 +<script> 1.8756 + 1.8757 + 1.8758 +function test_2d_imageData_put_dirty_outside() { 1.8759 + 1.8760 +var canvas = document.getElementById('c294'); 1.8761 +var ctx = canvas.getContext('2d'); 1.8762 + 1.8763 +var _thrown_outer = false; 1.8764 +try { 1.8765 + 1.8766 +ctx.fillStyle = '#f00'; 1.8767 +ctx.fillRect(0, 0, 100, 50) 1.8768 + 1.8769 +var imgdata = ctx.getImageData(0, 0, 100, 50); 1.8770 + 1.8771 +ctx.fillStyle = '#0f0'; 1.8772 +ctx.fillRect(0, 0, 100, 50) 1.8773 + 1.8774 +ctx.putImageData(imgdata, 100, 20, 20, 20, -20, -20); 1.8775 +ctx.putImageData(imgdata, 200, 200, 0, 0, 100, 50); 1.8776 +ctx.putImageData(imgdata, 40, 20, -30, -20, 30, 20); 1.8777 +ctx.putImageData(imgdata, -30, 20, 0, 0, 30, 20); 1.8778 + 1.8779 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.8780 +isPixel(ctx, 98,15, 0,255,0,255, 2); 1.8781 +isPixel(ctx, 98,25, 0,255,0,255, 2); 1.8782 +isPixel(ctx, 98,45, 0,255,0,255, 2); 1.8783 +isPixel(ctx, 1,5, 0,255,0,255, 2); 1.8784 +isPixel(ctx, 1,25, 0,255,0,255, 2); 1.8785 +isPixel(ctx, 1,45, 0,255,0,255, 2); 1.8786 + 1.8787 +} catch (e) { 1.8788 + _thrown_outer = true; 1.8789 +} 1.8790 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.8791 + 1.8792 + 1.8793 +} 1.8794 +</script> 1.8795 + 1.8796 +<!-- [[[ test_2d.imageData.put.dirty.rect1.html ]]] --> 1.8797 + 1.8798 +<p>Canvas test: 2d.imageData.put.dirty.rect1</p> 1.8799 +<!-- Testing: putImageData() only modifies areas inside the dirty rectangle, using width and height --> 1.8800 +<canvas id="c295" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8801 +<script> 1.8802 + 1.8803 + 1.8804 +function test_2d_imageData_put_dirty_rect1() { 1.8805 + 1.8806 +var canvas = document.getElementById('c295'); 1.8807 +var ctx = canvas.getContext('2d'); 1.8808 + 1.8809 +var _thrown_outer = false; 1.8810 +try { 1.8811 + 1.8812 +ctx.fillStyle = '#f00'; 1.8813 +ctx.fillRect(0, 0, 100, 50) 1.8814 +ctx.fillStyle = '#0f0'; 1.8815 +ctx.fillRect(0, 0, 20, 20) 1.8816 + 1.8817 +var imgdata = ctx.getImageData(0, 0, 100, 50); 1.8818 + 1.8819 +ctx.fillStyle = '#0f0'; 1.8820 +ctx.fillRect(0, 0, 100, 50) 1.8821 +ctx.fillStyle = '#f00'; 1.8822 +ctx.fillRect(40, 20, 20, 20) 1.8823 +ctx.putImageData(imgdata, 40, 20, 0, 0, 20, 20); 1.8824 + 1.8825 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.8826 +isPixel(ctx, 35,25, 0,255,0,255, 2); 1.8827 +isPixel(ctx, 65,25, 0,255,0,255, 2); 1.8828 +isPixel(ctx, 50,15, 0,255,0,255, 2); 1.8829 +isPixel(ctx, 50,45, 0,255,0,255, 2); 1.8830 + 1.8831 +} catch (e) { 1.8832 + _thrown_outer = true; 1.8833 +} 1.8834 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.8835 + 1.8836 + 1.8837 +} 1.8838 +</script> 1.8839 + 1.8840 +<!-- [[[ test_2d.imageData.put.dirty.rect2.html ]]] --> 1.8841 + 1.8842 +<p>Canvas test: 2d.imageData.put.dirty.rect2</p> 1.8843 +<!-- Testing: putImageData() only modifies areas inside the dirty rectangle, using x and y --> 1.8844 +<canvas id="c296" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8845 +<script> 1.8846 + 1.8847 + 1.8848 +function test_2d_imageData_put_dirty_rect2() { 1.8849 + 1.8850 +var canvas = document.getElementById('c296'); 1.8851 +var ctx = canvas.getContext('2d'); 1.8852 + 1.8853 +var _thrown_outer = false; 1.8854 +try { 1.8855 + 1.8856 +ctx.fillStyle = '#f00'; 1.8857 +ctx.fillRect(0, 0, 100, 50) 1.8858 +ctx.fillStyle = '#0f0'; 1.8859 +ctx.fillRect(60, 30, 20, 20) 1.8860 + 1.8861 +var imgdata = ctx.getImageData(0, 0, 100, 50); 1.8862 + 1.8863 +ctx.fillStyle = '#0f0'; 1.8864 +ctx.fillRect(0, 0, 100, 50) 1.8865 +ctx.fillStyle = '#f00'; 1.8866 +ctx.fillRect(40, 20, 20, 20) 1.8867 +ctx.putImageData(imgdata, -20, -10, 60, 30, 20, 20); 1.8868 + 1.8869 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.8870 +isPixel(ctx, 35,25, 0,255,0,255, 2); 1.8871 +isPixel(ctx, 65,25, 0,255,0,255, 2); 1.8872 +isPixel(ctx, 50,15, 0,255,0,255, 2); 1.8873 +isPixel(ctx, 50,45, 0,255,0,255, 2); 1.8874 + 1.8875 +} catch (e) { 1.8876 + _thrown_outer = true; 1.8877 +} 1.8878 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.8879 + 1.8880 + 1.8881 +} 1.8882 +</script> 1.8883 + 1.8884 +<!-- [[[ test_2d.imageData.put.dirty.zero.html ]]] --> 1.8885 + 1.8886 +<p>Canvas test: 2d.imageData.put.dirty.zero</p> 1.8887 +<!-- Testing: putImageData() with zero-sized dirty rectangle puts nothing --> 1.8888 +<canvas id="c297" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8889 +<script> 1.8890 + 1.8891 + 1.8892 + 1.8893 +function test_2d_imageData_put_dirty_zero() { 1.8894 + 1.8895 +var canvas = document.getElementById('c297'); 1.8896 +var ctx = canvas.getContext('2d'); 1.8897 + 1.8898 +ctx.fillStyle = '#f00'; 1.8899 +ctx.fillRect(0, 0, 100, 50) 1.8900 +var imgdata = ctx.getImageData(0, 0, 100, 50); 1.8901 +ctx.fillStyle = '#0f0'; 1.8902 +ctx.fillRect(0, 0, 100, 50) 1.8903 +ctx.putImageData(imgdata, 0, 0, 0, 0, 0, 0); 1.8904 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.8905 + 1.8906 + 1.8907 +} 1.8908 +</script> 1.8909 + 1.8910 +<!-- [[[ test_2d.imageData.put.modified.html ]]] --> 1.8911 + 1.8912 +<p>Canvas test: 2d.imageData.put.modified</p> 1.8913 +<!-- Testing: putImageData() puts modified image data correctly --> 1.8914 +<canvas id="c298" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8915 +<script> 1.8916 + 1.8917 + 1.8918 +function test_2d_imageData_put_modified() { 1.8919 + 1.8920 +var canvas = document.getElementById('c298'); 1.8921 +var ctx = canvas.getContext('2d'); 1.8922 + 1.8923 +ctx.fillStyle = '#0f0'; 1.8924 +ctx.fillRect(0, 0, 100, 50) 1.8925 +ctx.fillStyle = '#f00'; 1.8926 +ctx.fillRect(45, 20, 10, 10) 1.8927 +var imgdata = ctx.getImageData(45, 20, 10, 10); 1.8928 +for (var i = 0, len = imgdata.width*imgdata.height*4; i < len; i += 4) 1.8929 +{ 1.8930 + imgdata.data[i] = 0; 1.8931 + imgdata.data[i+1] = 255; 1.8932 +} 1.8933 +ctx.putImageData(imgdata, 45, 20); 1.8934 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.8935 + 1.8936 + 1.8937 +} 1.8938 +</script> 1.8939 + 1.8940 +<!-- [[[ test_2d.imageData.put.nonfinite.html ]]] --> 1.8941 + 1.8942 +<p>Canvas test: 2d.imageData.put.nonfinite</p> 1.8943 +<!-- Testing: putImageData() throws NOT_SUPPORTED_ERR if arguments are not finite --> 1.8944 +<canvas id="c299" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.8945 +<script> 1.8946 + 1.8947 +function test_2d_imageData_put_nonfinite() { 1.8948 + 1.8949 +var canvas = document.getElementById('c299'); 1.8950 +var ctx = canvas.getContext('2d'); 1.8951 + 1.8952 +var imgdata = ctx.getImageData(0, 0, 10, 10); 1.8953 +var _thrown = undefined; try { 1.8954 + ctx.putImageData(imgdata, Infinity, 10); 1.8955 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.8956 +var _thrown = undefined; try { 1.8957 + ctx.putImageData(imgdata, -Infinity, 10); 1.8958 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.8959 +var _thrown = undefined; try { 1.8960 + ctx.putImageData(imgdata, NaN, 10); 1.8961 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.8962 +var _thrown = undefined; try { 1.8963 + ctx.putImageData(imgdata, 10, Infinity); 1.8964 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.8965 +var _thrown = undefined; try { 1.8966 + ctx.putImageData(imgdata, 10, -Infinity); 1.8967 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.8968 +var _thrown = undefined; try { 1.8969 + ctx.putImageData(imgdata, 10, NaN); 1.8970 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.8971 +var _thrown = undefined; try { 1.8972 + ctx.putImageData(imgdata, Infinity, Infinity); 1.8973 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.8974 +var _thrown = undefined; try { 1.8975 + ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, 10); 1.8976 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.8977 +var _thrown = undefined; try { 1.8978 + ctx.putImageData(imgdata, -Infinity, 10, 10, 10, 10, 10); 1.8979 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.8980 +var _thrown = undefined; try { 1.8981 + ctx.putImageData(imgdata, NaN, 10, 10, 10, 10, 10); 1.8982 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.8983 +var _thrown = undefined; try { 1.8984 + ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, 10); 1.8985 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.8986 +var _thrown = undefined; try { 1.8987 + ctx.putImageData(imgdata, 10, -Infinity, 10, 10, 10, 10); 1.8988 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.8989 +var _thrown = undefined; try { 1.8990 + ctx.putImageData(imgdata, 10, NaN, 10, 10, 10, 10); 1.8991 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.8992 +var _thrown = undefined; try { 1.8993 + ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, 10); 1.8994 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.8995 +var _thrown = undefined; try { 1.8996 + ctx.putImageData(imgdata, 10, 10, -Infinity, 10, 10, 10); 1.8997 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.8998 +var _thrown = undefined; try { 1.8999 + ctx.putImageData(imgdata, 10, 10, NaN, 10, 10, 10); 1.9000 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9001 +var _thrown = undefined; try { 1.9002 + ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, 10); 1.9003 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9004 +var _thrown = undefined; try { 1.9005 + ctx.putImageData(imgdata, 10, 10, 10, -Infinity, 10, 10); 1.9006 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9007 +var _thrown = undefined; try { 1.9008 + ctx.putImageData(imgdata, 10, 10, 10, NaN, 10, 10); 1.9009 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9010 +var _thrown = undefined; try { 1.9011 + ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, 10); 1.9012 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9013 +var _thrown = undefined; try { 1.9014 + ctx.putImageData(imgdata, 10, 10, 10, 10, -Infinity, 10); 1.9015 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9016 +var _thrown = undefined; try { 1.9017 + ctx.putImageData(imgdata, 10, 10, 10, 10, NaN, 10); 1.9018 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9019 +var _thrown = undefined; try { 1.9020 + ctx.putImageData(imgdata, 10, 10, 10, 10, 10, Infinity); 1.9021 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9022 +var _thrown = undefined; try { 1.9023 + ctx.putImageData(imgdata, 10, 10, 10, 10, 10, -Infinity); 1.9024 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9025 +var _thrown = undefined; try { 1.9026 + ctx.putImageData(imgdata, 10, 10, 10, 10, 10, NaN); 1.9027 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9028 +var _thrown = undefined; try { 1.9029 + ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, 10); 1.9030 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9031 +var _thrown = undefined; try { 1.9032 + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, 10); 1.9033 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9034 +var _thrown = undefined; try { 1.9035 + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, 10); 1.9036 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9037 +var _thrown = undefined; try { 1.9038 + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, 10); 1.9039 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9040 +var _thrown = undefined; try { 1.9041 + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); 1.9042 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9043 +var _thrown = undefined; try { 1.9044 + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, Infinity); 1.9045 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9046 +var _thrown = undefined; try { 1.9047 + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, 10); 1.9048 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9049 +var _thrown = undefined; try { 1.9050 + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, Infinity); 1.9051 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9052 +var _thrown = undefined; try { 1.9053 + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, Infinity); 1.9054 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9055 +var _thrown = undefined; try { 1.9056 + ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, 10); 1.9057 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9058 +var _thrown = undefined; try { 1.9059 + ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, 10); 1.9060 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9061 +var _thrown = undefined; try { 1.9062 + ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, Infinity); 1.9063 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9064 +var _thrown = undefined; try { 1.9065 + ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, Infinity); 1.9066 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9067 +var _thrown = undefined; try { 1.9068 + ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, 10); 1.9069 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9070 +var _thrown = undefined; try { 1.9071 + ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, Infinity); 1.9072 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9073 +var _thrown = undefined; try { 1.9074 + ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, Infinity); 1.9075 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9076 +var _thrown = undefined; try { 1.9077 + ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, 10); 1.9078 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9079 +var _thrown = undefined; try { 1.9080 + ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, 10); 1.9081 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9082 +var _thrown = undefined; try { 1.9083 + ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, 10); 1.9084 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9085 +var _thrown = undefined; try { 1.9086 + ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, Infinity); 1.9087 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9088 +var _thrown = undefined; try { 1.9089 + ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, Infinity); 1.9090 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9091 +var _thrown = undefined; try { 1.9092 + ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, 10); 1.9093 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9094 +var _thrown = undefined; try { 1.9095 + ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, Infinity); 1.9096 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9097 +var _thrown = undefined; try { 1.9098 + ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, Infinity); 1.9099 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9100 +var _thrown = undefined; try { 1.9101 + ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, 10); 1.9102 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9103 +var _thrown = undefined; try { 1.9104 + ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, 10); 1.9105 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9106 +var _thrown = undefined; try { 1.9107 + ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, Infinity); 1.9108 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9109 +var _thrown = undefined; try { 1.9110 + ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, Infinity); 1.9111 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9112 +var _thrown = undefined; try { 1.9113 + ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, 10); 1.9114 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9115 +var _thrown = undefined; try { 1.9116 + ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, Infinity); 1.9117 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9118 +var _thrown = undefined; try { 1.9119 + ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, Infinity); 1.9120 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9121 +var _thrown = undefined; try { 1.9122 + ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, 10); 1.9123 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9124 +var _thrown = undefined; try { 1.9125 + ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, 10); 1.9126 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9127 +var _thrown = undefined; try { 1.9128 + ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, 10); 1.9129 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9130 +var _thrown = undefined; try { 1.9131 + ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, Infinity); 1.9132 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9133 +var _thrown = undefined; try { 1.9134 + ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, Infinity); 1.9135 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9136 +var _thrown = undefined; try { 1.9137 + ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, 10); 1.9138 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9139 +var _thrown = undefined; try { 1.9140 + ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, Infinity); 1.9141 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9142 +var _thrown = undefined; try { 1.9143 + ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, Infinity); 1.9144 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9145 +var _thrown = undefined; try { 1.9146 + ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, 10); 1.9147 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9148 +var _thrown = undefined; try { 1.9149 + ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, 10); 1.9150 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9151 +var _thrown = undefined; try { 1.9152 + ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, Infinity); 1.9153 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9154 +var _thrown = undefined; try { 1.9155 + ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, Infinity); 1.9156 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9157 +var _thrown = undefined; try { 1.9158 + ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, 10); 1.9159 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9160 +var _thrown = undefined; try { 1.9161 + ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, Infinity); 1.9162 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9163 +var _thrown = undefined; try { 1.9164 + ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, Infinity); 1.9165 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9166 +var _thrown = undefined; try { 1.9167 + ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, 10); 1.9168 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9169 +var _thrown = undefined; try { 1.9170 + ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, 10); 1.9171 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9172 +var _thrown = undefined; try { 1.9173 + ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, Infinity); 1.9174 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9175 +var _thrown = undefined; try { 1.9176 + ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, Infinity); 1.9177 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9178 +var _thrown = undefined; try { 1.9179 + ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, 10); 1.9180 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9181 +var _thrown = undefined; try { 1.9182 + ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, Infinity); 1.9183 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9184 +var _thrown = undefined; try { 1.9185 + ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, Infinity); 1.9186 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9187 +var _thrown = undefined; try { 1.9188 + ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, 10); 1.9189 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9190 +var _thrown = undefined; try { 1.9191 + ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, Infinity); 1.9192 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9193 +var _thrown = undefined; try { 1.9194 + ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, Infinity); 1.9195 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9196 +var _thrown = undefined; try { 1.9197 + ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, Infinity); 1.9198 +} catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError"); 1.9199 + 1.9200 + 1.9201 +} 1.9202 +</script> 1.9203 + 1.9204 +<!-- [[[ test_2d.imageData.put.null.html ]]] --> 1.9205 + 1.9206 +<p>Canvas test: 2d.imageData.put.null - bug 421715</p> 1.9207 +<!-- Testing: putImageData() with null imagedata throws TYPE_MISMATCH_ERR --> 1.9208 +<canvas id="c300" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9209 +<script> 1.9210 + 1.9211 +function test_2d_imageData_put_null() { 1.9212 + 1.9213 +var canvas = document.getElementById('c300'); 1.9214 +var ctx = canvas.getContext('2d'); 1.9215 + 1.9216 +var _thrown = undefined; try { 1.9217 + ctx.putImageData(null, 0, 0); 1.9218 +} catch (e) { _thrown = e }; 1.9219 +ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); 1.9220 + 1.9221 +} 1.9222 +</script> 1.9223 + 1.9224 +<!-- [[[ test_2d.imageData.put.path.html ]]] --> 1.9225 + 1.9226 +<p>Canvas test: 2d.imageData.put.path</p> 1.9227 +<!-- Testing: putImageData() does not affect the current path --> 1.9228 +<canvas id="c301" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9229 +<script> 1.9230 + 1.9231 + 1.9232 +function test_2d_imageData_put_path() { 1.9233 + 1.9234 +var canvas = document.getElementById('c301'); 1.9235 +var ctx = canvas.getContext('2d'); 1.9236 + 1.9237 +ctx.fillStyle = '#f00'; 1.9238 +ctx.fillRect(0, 0, 100, 50) 1.9239 +ctx.rect(0, 0, 100, 50); 1.9240 +var imgdata = ctx.getImageData(0, 0, 100, 50); 1.9241 +ctx.putImageData(imgdata, 0, 0); 1.9242 +ctx.fillStyle = '#0f0'; 1.9243 +ctx.fill(); 1.9244 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.9245 + 1.9246 + 1.9247 +} 1.9248 +</script> 1.9249 + 1.9250 +<!-- [[[ test_2d.imageData.put.unaffected.html ]]] --> 1.9251 + 1.9252 +<p>Canvas test: 2d.imageData.put.unaffected</p> 1.9253 +<!-- Testing: putImageData() is not affected by context state --> 1.9254 +<canvas id="c302" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9255 +<script> 1.9256 + 1.9257 + 1.9258 +function test_2d_imageData_put_unaffected() { 1.9259 + 1.9260 +var canvas = document.getElementById('c302'); 1.9261 +var ctx = canvas.getContext('2d'); 1.9262 + 1.9263 +ctx.fillStyle = '#0f0'; 1.9264 +ctx.fillRect(0, 0, 100, 50) 1.9265 +var imgdata = ctx.getImageData(0, 0, 100, 50); 1.9266 +ctx.fillStyle = '#f00'; 1.9267 +ctx.fillRect(0, 0, 100, 50) 1.9268 +ctx.globalAlpha = 0.1; 1.9269 +ctx.globalCompositeOperation = 'destination-atop'; 1.9270 +ctx.shadowColor = '#f00'; 1.9271 +ctx.translate(100, 50); 1.9272 +ctx.scale(0.1, 0.1); 1.9273 +ctx.putImageData(imgdata, 0, 0); 1.9274 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.9275 + 1.9276 + 1.9277 +} 1.9278 +</script> 1.9279 + 1.9280 +<!-- [[[ test_2d.imageData.put.unchanged.html ]]] --> 1.9281 + 1.9282 +<p>Canvas test: 2d.imageData.put.unchanged</p> 1.9283 +<!-- Testing: putImageData(getImageData(...), ...) has no effect --> 1.9284 +<canvas id="c303" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9285 +<script> 1.9286 + 1.9287 +function test_2d_imageData_put_unchanged() { 1.9288 + 1.9289 +var canvas = document.getElementById('c303'); 1.9290 +var ctx = canvas.getContext('2d'); 1.9291 + 1.9292 +var i = 0; 1.9293 +for (var y = 0; y < 16; ++y) { 1.9294 + for (var x = 0; x < 16; ++x, ++i) { 1.9295 + ctx.fillStyle = 'rgba(' + i + ',' + (Math.floor(i*1.5) % 256) + ',' + (Math.floor(i*23.3) % 256) + ',' + (i/256) + ')'; 1.9296 + ctx.fillRect(x, y, 1, 1); 1.9297 + } 1.9298 +} 1.9299 +var imgdata1 = ctx.getImageData(0.1, 0.2, 15.8, 15.9); 1.9300 +var olddata = []; 1.9301 +for (var i = 0; i < imgdata1.data.length; ++i) 1.9302 + olddata[i] = imgdata1.data[i]; 1.9303 + 1.9304 +ctx.putImageData(imgdata1, 0.1, 0.2); 1.9305 + 1.9306 +var imgdata2 = ctx.getImageData(0.1, 0.2, 15.8, 15.9); 1.9307 +for (var i = 0; i < imgdata2.data.length; ++i) { 1.9308 + ok(olddata[i] === imgdata2.data[i], "olddata[\""+(i)+"\"] === imgdata2.data[\""+(i)+"\"]"); 1.9309 +} 1.9310 + 1.9311 + 1.9312 +} 1.9313 +</script> 1.9314 + 1.9315 +<!-- [[[ test_2d.imageData.put.wrongtype.html ]]] --> 1.9316 + 1.9317 +<p>Canvas test: 2d.imageData.put.wrongtype</p> 1.9318 +<!-- Testing: putImageData() does not accept non-ImageData objects --> 1.9319 +<canvas id="c304" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9320 +<script> 1.9321 + 1.9322 +function test_2d_imageData_put_wrongtype() { 1.9323 + 1.9324 +var canvas = document.getElementById('c304'); 1.9325 +var ctx = canvas.getContext('2d'); 1.9326 + 1.9327 +var imgdata = { width: 1, height: 1, data: [255, 0, 0, 255] }; 1.9328 +var _thrown = undefined; try { 1.9329 + ctx.putImageData(imgdata, 0, 0); 1.9330 +} catch (e) { _thrown = e }; 1.9331 +ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); 1.9332 + 1.9333 +var _thrown = undefined; try { 1.9334 + ctx.putImageData("cheese", 0, 0); 1.9335 +} catch (e) { _thrown = e }; 1.9336 +ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); 1.9337 + 1.9338 +var _thrown = undefined; try { 1.9339 + ctx.putImageData(42, 0, 0); 1.9340 +} catch (e) { _thrown = e }; 1.9341 +ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); 1.9342 +} 1.9343 +</script> 1.9344 + 1.9345 +<!-- [[[ test_2d.line.cap.butt.html ]]] --> 1.9346 + 1.9347 +<p>Canvas test: 2d.line.cap.butt</p> 1.9348 +<!-- Testing: lineCap 'butt' is rendered correctly --> 1.9349 +<canvas id="c305" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9350 +<script> 1.9351 + 1.9352 + 1.9353 +function test_2d_line_cap_butt() { 1.9354 + 1.9355 +var canvas = document.getElementById('c305'); 1.9356 +var ctx = canvas.getContext('2d'); 1.9357 + 1.9358 +ctx.fillStyle = '#0f0'; 1.9359 +ctx.fillRect(0, 0, 100, 50); 1.9360 + 1.9361 +ctx.lineCap = 'butt'; 1.9362 +ctx.lineWidth = 20; 1.9363 + 1.9364 +ctx.fillStyle = '#f00'; 1.9365 +ctx.strokeStyle = '#0f0'; 1.9366 +ctx.fillRect(15, 15, 20, 20); 1.9367 +ctx.beginPath(); 1.9368 +ctx.moveTo(25, 15); 1.9369 +ctx.lineTo(25, 35); 1.9370 +ctx.stroke(); 1.9371 + 1.9372 +ctx.fillStyle = '#0f0'; 1.9373 +ctx.strokeStyle = '#f00'; 1.9374 +ctx.beginPath(); 1.9375 +ctx.moveTo(75, 15); 1.9376 +ctx.lineTo(75, 35); 1.9377 +ctx.stroke(); 1.9378 +ctx.fillRect(65, 15, 20, 20); 1.9379 + 1.9380 +isPixel(ctx, 25,14, 0,255,0,255, 0); 1.9381 +isPixel(ctx, 25,15, 0,255,0,255, 0); 1.9382 +isPixel(ctx, 25,16, 0,255,0,255, 0); 1.9383 +isPixel(ctx, 25,34, 0,255,0,255, 0); 1.9384 +isPixel(ctx, 25,35, 0,255,0,255, 0); 1.9385 +isPixel(ctx, 25,36, 0,255,0,255, 0); 1.9386 + 1.9387 +isPixel(ctx, 75,14, 0,255,0,255, 0); 1.9388 +isPixel(ctx, 75,15, 0,255,0,255, 0); 1.9389 +isPixel(ctx, 75,16, 0,255,0,255, 0); 1.9390 +isPixel(ctx, 75,34, 0,255,0,255, 0); 1.9391 +isPixel(ctx, 75,35, 0,255,0,255, 0); 1.9392 +isPixel(ctx, 75,36, 0,255,0,255, 0); 1.9393 + 1.9394 + 1.9395 +} 1.9396 +</script> 1.9397 + 1.9398 +<!-- [[[ test_2d.line.cap.closed.html ]]] --> 1.9399 + 1.9400 +<p>Canvas test: 2d.line.cap.closed</p> 1.9401 +<!-- Testing: Line caps are not drawn at the corners of an unclosed rectangle --> 1.9402 +<canvas id="c306" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9403 +<script> 1.9404 + 1.9405 + 1.9406 +function test_2d_line_cap_closed() { 1.9407 + 1.9408 +var canvas = document.getElementById('c306'); 1.9409 +var ctx = canvas.getContext('2d'); 1.9410 + 1.9411 +ctx.fillStyle = '#0f0'; 1.9412 +ctx.strokeStyle = '#f00'; 1.9413 +ctx.fillRect(0, 0, 100, 50); 1.9414 + 1.9415 +ctx.lineJoin = 'bevel'; 1.9416 +ctx.lineCap = 'square'; 1.9417 +ctx.lineWidth = 400; 1.9418 + 1.9419 +ctx.beginPath(); 1.9420 +ctx.moveTo(200, 200); 1.9421 +ctx.lineTo(200, 1000); 1.9422 +ctx.lineTo(1000, 1000); 1.9423 +ctx.lineTo(1000, 200); 1.9424 +ctx.closePath(); 1.9425 +ctx.stroke(); 1.9426 + 1.9427 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.9428 +isPixel(ctx, 48,1, 0,255,0,255, 0); 1.9429 +isPixel(ctx, 48,48, 0,255,0,255, 0); 1.9430 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.9431 + 1.9432 + 1.9433 +} 1.9434 +</script> 1.9435 + 1.9436 +<!-- [[[ test_2d.line.cap.invalid.html ]]] --> 1.9437 + 1.9438 +<p>Canvas test: 2d.line.cap.invalid - bug 401788</p> 1.9439 +<!-- Testing: Setting lineCap to invalid values is ignored --> 1.9440 +<canvas id="c307" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9441 +<script> 1.9442 + 1.9443 +function test_2d_line_cap_invalid() { 1.9444 + 1.9445 +var canvas = document.getElementById('c307'); 1.9446 +var ctx = canvas.getContext('2d'); 1.9447 + 1.9448 +var _thrown_outer = false; 1.9449 +try { 1.9450 + 1.9451 +ctx.lineCap = 'butt' 1.9452 +ok(ctx.lineCap === 'butt', "ctx.lineCap === 'butt'"); 1.9453 + 1.9454 +ctx.lineCap = 'butt'; 1.9455 +ctx.lineCap = 'invalid'; 1.9456 +ok(ctx.lineCap === 'butt', "ctx.lineCap === 'butt'"); 1.9457 + 1.9458 +ctx.lineCap = 'butt'; 1.9459 +ctx.lineCap = 'ROUND'; 1.9460 +ok(ctx.lineCap === 'butt', "ctx.lineCap === 'butt'"); 1.9461 + 1.9462 +ctx.lineCap = 'butt'; 1.9463 +ctx.lineCap = 'round\0'; 1.9464 +ok(ctx.lineCap === 'butt', "ctx.lineCap === 'butt'"); 1.9465 + 1.9466 +ctx.lineCap = 'butt'; 1.9467 +ctx.lineCap = 'round '; 1.9468 +ok(ctx.lineCap === 'butt', "ctx.lineCap === 'butt'"); 1.9469 + 1.9470 +ctx.lineCap = 'butt'; 1.9471 +ctx.lineCap = ""; 1.9472 +ok(ctx.lineCap === 'butt', "ctx.lineCap === 'butt'"); 1.9473 + 1.9474 +ctx.lineCap = 'butt'; 1.9475 +ctx.lineCap = 'bevel'; 1.9476 +ok(ctx.lineCap === 'butt', "ctx.lineCap === 'butt'"); 1.9477 + 1.9478 +} catch (e) { 1.9479 + _thrown_outer = true; 1.9480 +} 1.9481 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.9482 + 1.9483 + 1.9484 +} 1.9485 +</script> 1.9486 + 1.9487 +<!-- [[[ test_2d.line.cap.open.html ]]] --> 1.9488 + 1.9489 +<p>Canvas test: 2d.line.cap.open</p> 1.9490 +<!-- Testing: Line caps are drawn at the corners of an unclosed rectangle --> 1.9491 +<canvas id="c308" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9492 +<script> 1.9493 + 1.9494 + 1.9495 +function test_2d_line_cap_open() { 1.9496 + 1.9497 +var canvas = document.getElementById('c308'); 1.9498 +var ctx = canvas.getContext('2d'); 1.9499 + 1.9500 +ctx.fillStyle = '#f00'; 1.9501 +ctx.strokeStyle = '#0f0'; 1.9502 +ctx.fillRect(0, 0, 100, 50); 1.9503 + 1.9504 +ctx.lineJoin = 'bevel'; 1.9505 +ctx.lineCap = 'square'; 1.9506 +ctx.lineWidth = 400; 1.9507 + 1.9508 +ctx.beginPath(); 1.9509 +ctx.moveTo(200, 200); 1.9510 +ctx.lineTo(200, 1000); 1.9511 +ctx.lineTo(1000, 1000); 1.9512 +ctx.lineTo(1000, 200); 1.9513 +ctx.lineTo(200, 200); 1.9514 +ctx.stroke(); 1.9515 + 1.9516 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.9517 +isPixel(ctx, 48,1, 0,255,0,255, 0); 1.9518 +isPixel(ctx, 48,48, 0,255,0,255, 0); 1.9519 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.9520 + 1.9521 + 1.9522 +} 1.9523 +</script> 1.9524 + 1.9525 +<!-- [[[ test_2d.line.cap.round.html ]]] --> 1.9526 + 1.9527 +<p>Canvas test: 2d.line.cap.round</p> 1.9528 +<!-- Testing: lineCap 'round' is rendered correctly --> 1.9529 +<canvas id="c309" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9530 +<script> 1.9531 + 1.9532 + 1.9533 +function test_2d_line_cap_round() { 1.9534 + 1.9535 +var canvas = document.getElementById('c309'); 1.9536 +var ctx = canvas.getContext('2d'); 1.9537 + 1.9538 +ctx.fillStyle = '#0f0'; 1.9539 +ctx.fillRect(0, 0, 100, 50); 1.9540 + 1.9541 +var tol = 1; // tolerance to avoid antialiasing artifacts 1.9542 + 1.9543 +ctx.lineCap = 'round'; 1.9544 +ctx.lineWidth = 20; 1.9545 + 1.9546 + 1.9547 +ctx.fillStyle = '#f00'; 1.9548 +ctx.strokeStyle = '#0f0'; 1.9549 + 1.9550 +ctx.beginPath(); 1.9551 +ctx.moveTo(35-tol, 15); 1.9552 +ctx.arc(25, 15, 10-tol, 0, Math.PI, true); 1.9553 +ctx.arc(25, 35, 10-tol, Math.PI, 0, true); 1.9554 +ctx.fill(); 1.9555 + 1.9556 +ctx.beginPath(); 1.9557 +ctx.moveTo(25, 15); 1.9558 +ctx.lineTo(25, 35); 1.9559 +ctx.stroke(); 1.9560 + 1.9561 + 1.9562 +ctx.fillStyle = '#0f0'; 1.9563 +ctx.strokeStyle = '#f00'; 1.9564 + 1.9565 +ctx.beginPath(); 1.9566 +ctx.moveTo(75, 15); 1.9567 +ctx.lineTo(75, 35); 1.9568 +ctx.stroke(); 1.9569 + 1.9570 +ctx.beginPath(); 1.9571 +ctx.moveTo(85+tol, 15); 1.9572 +ctx.arc(75, 15, 10+tol, 0, Math.PI, true); 1.9573 +ctx.arc(75, 35, 10+tol, Math.PI, 0, true); 1.9574 +ctx.fill(); 1.9575 + 1.9576 +isPixel(ctx, 17,6, 0,255,0,255, 0); 1.9577 +isPixel(ctx, 25,6, 0,255,0,255, 0); 1.9578 +isPixel(ctx, 32,6, 0,255,0,255, 0); 1.9579 +isPixel(ctx, 17,43, 0,255,0,255, 0); 1.9580 +isPixel(ctx, 25,43, 0,255,0,255, 0); 1.9581 +isPixel(ctx, 32,43, 0,255,0,255, 0); 1.9582 + 1.9583 +isPixel(ctx, 67,6, 0,255,0,255, 0); 1.9584 +isPixel(ctx, 75,6, 0,255,0,255, 0); 1.9585 +isPixel(ctx, 82,6, 0,255,0,255, 0); 1.9586 +isPixel(ctx, 67,43, 0,255,0,255, 0); 1.9587 +isPixel(ctx, 75,43, 0,255,0,255, 0); 1.9588 +isPixel(ctx, 82,43, 0,255,0,255, 0); 1.9589 + 1.9590 + 1.9591 +} 1.9592 +</script> 1.9593 + 1.9594 +<!-- [[[ test_2d.line.cap.square.html ]]] --> 1.9595 + 1.9596 +<p>Canvas test: 2d.line.cap.square</p> 1.9597 +<!-- Testing: lineCap 'square' is rendered correctly --> 1.9598 +<canvas id="c310" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9599 +<script> 1.9600 + 1.9601 + 1.9602 +function test_2d_line_cap_square() { 1.9603 + 1.9604 +var canvas = document.getElementById('c310'); 1.9605 +var ctx = canvas.getContext('2d'); 1.9606 + 1.9607 +ctx.fillStyle = '#0f0'; 1.9608 +ctx.fillRect(0, 0, 100, 50); 1.9609 + 1.9610 +ctx.lineCap = 'square'; 1.9611 +ctx.lineWidth = 20; 1.9612 + 1.9613 +ctx.fillStyle = '#f00'; 1.9614 +ctx.strokeStyle = '#0f0'; 1.9615 +ctx.fillRect(15, 5, 20, 40); 1.9616 +ctx.beginPath(); 1.9617 +ctx.moveTo(25, 15); 1.9618 +ctx.lineTo(25, 35); 1.9619 +ctx.stroke(); 1.9620 + 1.9621 +ctx.fillStyle = '#0f0'; 1.9622 +ctx.strokeStyle = '#f00'; 1.9623 +ctx.beginPath(); 1.9624 +ctx.moveTo(75, 15); 1.9625 +ctx.lineTo(75, 35); 1.9626 +ctx.stroke(); 1.9627 +ctx.fillRect(65, 5, 20, 40); 1.9628 + 1.9629 +isPixel(ctx, 25,4, 0,255,0,255, 0); 1.9630 +isPixel(ctx, 25,5, 0,255,0,255, 0); 1.9631 +isPixel(ctx, 25,6, 0,255,0,255, 0); 1.9632 +isPixel(ctx, 25,44, 0,255,0,255, 0); 1.9633 +isPixel(ctx, 25,45, 0,255,0,255, 0); 1.9634 +isPixel(ctx, 25,46, 0,255,0,255, 0); 1.9635 + 1.9636 +isPixel(ctx, 75,4, 0,255,0,255, 0); 1.9637 +isPixel(ctx, 75,5, 0,255,0,255, 0); 1.9638 +isPixel(ctx, 75,6, 0,255,0,255, 0); 1.9639 +isPixel(ctx, 75,44, 0,255,0,255, 0); 1.9640 +isPixel(ctx, 75,45, 0,255,0,255, 0); 1.9641 +isPixel(ctx, 75,46, 0,255,0,255, 0); 1.9642 + 1.9643 + 1.9644 +} 1.9645 +</script> 1.9646 + 1.9647 +<!-- [[[ test_2d.line.cross.html ]]] --> 1.9648 + 1.9649 +<p>Canvas test: 2d.line.cross</p> 1.9650 +<canvas id="c311" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9651 +<script> 1.9652 + 1.9653 + 1.9654 +function test_2d_line_cross() { 1.9655 + 1.9656 +var canvas = document.getElementById('c311'); 1.9657 +var ctx = canvas.getContext('2d'); 1.9658 + 1.9659 +ctx.fillStyle = '#0f0'; 1.9660 +ctx.fillRect(0, 0, 100, 50); 1.9661 + 1.9662 +ctx.lineWidth = 200; 1.9663 +ctx.lineJoin = 'bevel'; 1.9664 + 1.9665 +ctx.strokeStyle = '#f00'; 1.9666 +ctx.beginPath(); 1.9667 +ctx.moveTo(110, 50); 1.9668 +ctx.lineTo(110, 60); 1.9669 +ctx.lineTo(100, 60); 1.9670 +ctx.stroke(); 1.9671 + 1.9672 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.9673 +isPixel(ctx, 48,1, 0,255,0,255, 0); 1.9674 +isPixel(ctx, 48,48, 0,255,0,255, 0); 1.9675 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.9676 + 1.9677 + 1.9678 +} 1.9679 +</script> 1.9680 + 1.9681 +<!-- [[[ test_2d.line.defaults.html ]]] --> 1.9682 + 1.9683 +<p>Canvas test: 2d.line.defaults</p> 1.9684 +<canvas id="c312" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9685 +<script> 1.9686 + 1.9687 +function test_2d_line_defaults() { 1.9688 + 1.9689 +var canvas = document.getElementById('c312'); 1.9690 +var ctx = canvas.getContext('2d'); 1.9691 + 1.9692 +ok(ctx.lineWidth === 1, "ctx.lineWidth === 1"); 1.9693 +ok(ctx.lineCap === 'butt', "ctx.lineCap === 'butt'"); 1.9694 +ok(ctx.lineJoin === 'miter', "ctx.lineJoin === 'miter'"); 1.9695 +ok(ctx.miterLimit === 10, "ctx.miterLimit === 10"); 1.9696 + 1.9697 + 1.9698 +} 1.9699 +</script> 1.9700 + 1.9701 +<!-- [[[ test_2d.line.join.bevel.html ]]] --> 1.9702 + 1.9703 +<p>Canvas test: 2d.line.join.bevel</p> 1.9704 +<!-- Testing: lineJoin 'bevel' is rendered correctly --> 1.9705 +<canvas id="c313" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9706 +<script> 1.9707 + 1.9708 + 1.9709 +function test_2d_line_join_bevel() { 1.9710 + 1.9711 +var canvas = document.getElementById('c313'); 1.9712 +var ctx = canvas.getContext('2d'); 1.9713 + 1.9714 +ctx.fillStyle = '#0f0'; 1.9715 +ctx.fillRect(0, 0, 100, 50); 1.9716 + 1.9717 +var tol = 1; // tolerance to avoid antialiasing artifacts 1.9718 + 1.9719 +ctx.lineJoin = 'bevel'; 1.9720 +ctx.lineWidth = 20; 1.9721 + 1.9722 +ctx.fillStyle = '#f00'; 1.9723 +ctx.strokeStyle = '#0f0'; 1.9724 + 1.9725 +ctx.fillRect(10, 10, 20, 20); 1.9726 +ctx.fillRect(20, 20, 20, 20); 1.9727 +ctx.beginPath(); 1.9728 +ctx.moveTo(30, 20); 1.9729 +ctx.lineTo(40-tol, 20); 1.9730 +ctx.lineTo(30, 10+tol); 1.9731 +ctx.fill(); 1.9732 + 1.9733 +ctx.beginPath(); 1.9734 +ctx.moveTo(10, 20); 1.9735 +ctx.lineTo(30, 20); 1.9736 +ctx.lineTo(30, 40); 1.9737 +ctx.stroke(); 1.9738 + 1.9739 + 1.9740 +ctx.fillStyle = '#0f0'; 1.9741 +ctx.strokeStyle = '#f00'; 1.9742 + 1.9743 +ctx.beginPath(); 1.9744 +ctx.moveTo(60, 20); 1.9745 +ctx.lineTo(80, 20); 1.9746 +ctx.lineTo(80, 40); 1.9747 +ctx.stroke(); 1.9748 + 1.9749 +ctx.fillRect(60, 10, 20, 20); 1.9750 +ctx.fillRect(70, 20, 20, 20); 1.9751 +ctx.beginPath(); 1.9752 +ctx.moveTo(80, 20); 1.9753 +ctx.lineTo(90+tol, 20); 1.9754 +ctx.lineTo(80, 10-tol); 1.9755 +ctx.fill(); 1.9756 + 1.9757 +isPixel(ctx, 34,16, 0,255,0,255, 0); 1.9758 +isPixel(ctx, 34,15, 0,255,0,255, 0); 1.9759 +isPixel(ctx, 35,15, 0,255,0,255, 0); 1.9760 +isPixel(ctx, 36,15, 0,255,0,255, 0); 1.9761 +isPixel(ctx, 36,14, 0,255,0,255, 0); 1.9762 + 1.9763 +isPixel(ctx, 84,16, 0,255,0,255, 0); 1.9764 +isPixel(ctx, 84,15, 0,255,0,255, 0); 1.9765 +isPixel(ctx, 85,15, 0,255,0,255, 0); 1.9766 +isPixel(ctx, 86,15, 0,255,0,255, 0); 1.9767 +isPixel(ctx, 86,14, 0,255,0,255, 0); 1.9768 + 1.9769 + 1.9770 +} 1.9771 +</script> 1.9772 + 1.9773 +<!-- [[[ test_2d.line.join.closed.html ]]] --> 1.9774 + 1.9775 +<p>Canvas test: 2d.line.join.closed</p> 1.9776 +<!-- Testing: Line joins are drawn at the corner of a closed rectangle --> 1.9777 +<canvas id="c314" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9778 +<script> 1.9779 + 1.9780 + 1.9781 +function test_2d_line_join_closed() { 1.9782 + 1.9783 +var canvas = document.getElementById('c314'); 1.9784 +var ctx = canvas.getContext('2d'); 1.9785 + 1.9786 +ctx.fillStyle = '#f00'; 1.9787 +ctx.strokeStyle = '#0f0'; 1.9788 +ctx.fillRect(0, 0, 100, 50); 1.9789 + 1.9790 +ctx.lineJoin = 'miter'; 1.9791 +ctx.lineWidth = 200; 1.9792 + 1.9793 +ctx.beginPath(); 1.9794 +ctx.moveTo(100, 50); 1.9795 +ctx.lineTo(100, 1000); 1.9796 +ctx.lineTo(1000, 1000); 1.9797 +ctx.lineTo(1000, 50); 1.9798 +ctx.closePath(); 1.9799 +ctx.stroke(); 1.9800 + 1.9801 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.9802 +isPixel(ctx, 48,1, 0,255,0,255, 0); 1.9803 +isPixel(ctx, 48,48, 0,255,0,255, 0); 1.9804 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.9805 + 1.9806 + 1.9807 +} 1.9808 +</script> 1.9809 + 1.9810 +<!-- [[[ test_2d.line.join.invalid.html ]]] --> 1.9811 + 1.9812 +<p>Canvas test: 2d.line.join.invalid - bug 401788</p> 1.9813 +<!-- Testing: Setting lineJoin to invalid values is ignored --> 1.9814 +<canvas id="c315" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9815 +<script> 1.9816 + 1.9817 +function test_2d_line_join_invalid() { 1.9818 + 1.9819 +var canvas = document.getElementById('c315'); 1.9820 +var ctx = canvas.getContext('2d'); 1.9821 + 1.9822 +var _thrown_outer = false; 1.9823 +try { 1.9824 + 1.9825 +ctx.lineJoin = 'bevel' 1.9826 +ok(ctx.lineJoin === 'bevel', "ctx.lineJoin === 'bevel'"); 1.9827 + 1.9828 +ctx.lineJoin = 'bevel'; 1.9829 +ctx.lineJoin = 'invalid'; 1.9830 +ok(ctx.lineJoin === 'bevel', "ctx.lineJoin === 'bevel'"); 1.9831 + 1.9832 +ctx.lineJoin = 'bevel'; 1.9833 +ctx.lineJoin = 'ROUND'; 1.9834 +ok(ctx.lineJoin === 'bevel', "ctx.lineJoin === 'bevel'"); 1.9835 + 1.9836 +ctx.lineJoin = 'bevel'; 1.9837 +ctx.lineJoin = 'round\0'; 1.9838 +ok(ctx.lineJoin === 'bevel', "ctx.lineJoin === 'bevel'"); 1.9839 + 1.9840 +ctx.lineJoin = 'bevel'; 1.9841 +ctx.lineJoin = 'round '; 1.9842 +ok(ctx.lineJoin === 'bevel', "ctx.lineJoin === 'bevel'"); 1.9843 + 1.9844 +ctx.lineJoin = 'bevel'; 1.9845 +ctx.lineJoin = ""; 1.9846 +ok(ctx.lineJoin === 'bevel', "ctx.lineJoin === 'bevel'"); 1.9847 + 1.9848 +ctx.lineJoin = 'bevel'; 1.9849 +ctx.lineJoin = 'butt'; 1.9850 +ok(ctx.lineJoin === 'bevel', "ctx.lineJoin === 'bevel'"); 1.9851 + 1.9852 +} catch (e) { 1.9853 + _thrown_outer = true; 1.9854 +} 1.9855 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.9856 + 1.9857 + 1.9858 +} 1.9859 +</script> 1.9860 + 1.9861 +<!-- [[[ test_2d.line.join.miter.html ]]] --> 1.9862 + 1.9863 +<p>Canvas test: 2d.line.join.miter</p> 1.9864 +<!-- Testing: lineJoin 'miter' is rendered correctly --> 1.9865 +<canvas id="c316" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9866 +<script> 1.9867 + 1.9868 + 1.9869 +function test_2d_line_join_miter() { 1.9870 + 1.9871 +var canvas = document.getElementById('c316'); 1.9872 +var ctx = canvas.getContext('2d'); 1.9873 + 1.9874 +ctx.fillStyle = '#0f0'; 1.9875 +ctx.fillRect(0, 0, 100, 50); 1.9876 + 1.9877 +ctx.lineJoin = 'miter'; 1.9878 +ctx.lineWidth = 20; 1.9879 + 1.9880 +ctx.fillStyle = '#f00'; 1.9881 +ctx.strokeStyle = '#0f0'; 1.9882 + 1.9883 +ctx.fillStyle = '#f00'; 1.9884 +ctx.strokeStyle = '#0f0'; 1.9885 + 1.9886 +ctx.fillRect(10, 10, 30, 20); 1.9887 +ctx.fillRect(20, 10, 20, 30); 1.9888 + 1.9889 +ctx.beginPath(); 1.9890 +ctx.moveTo(10, 20); 1.9891 +ctx.lineTo(30, 20); 1.9892 +ctx.lineTo(30, 40); 1.9893 +ctx.stroke(); 1.9894 + 1.9895 + 1.9896 +ctx.fillStyle = '#0f0'; 1.9897 +ctx.strokeStyle = '#f00'; 1.9898 + 1.9899 +ctx.beginPath(); 1.9900 +ctx.moveTo(60, 20); 1.9901 +ctx.lineTo(80, 20); 1.9902 +ctx.lineTo(80, 40); 1.9903 +ctx.stroke(); 1.9904 + 1.9905 +ctx.fillRect(60, 10, 30, 20); 1.9906 +ctx.fillRect(70, 10, 20, 30); 1.9907 + 1.9908 +isPixel(ctx, 38,12, 0,255,0,255, 0); 1.9909 +isPixel(ctx, 39,11, 0,255,0,255, 0); 1.9910 +isPixel(ctx, 40,10, 0,255,0,255, 0); 1.9911 +isPixel(ctx, 41,9, 0,255,0,255, 0); 1.9912 +isPixel(ctx, 42,8, 0,255,0,255, 0); 1.9913 + 1.9914 +isPixel(ctx, 88,12, 0,255,0,255, 0); 1.9915 +isPixel(ctx, 89,11, 0,255,0,255, 0); 1.9916 +isPixel(ctx, 90,10, 0,255,0,255, 0); 1.9917 +isPixel(ctx, 91,9, 0,255,0,255, 0); 1.9918 +isPixel(ctx, 92,8, 0,255,0,255, 0); 1.9919 + 1.9920 + 1.9921 +} 1.9922 +</script> 1.9923 + 1.9924 +<!-- [[[ test_2d.line.join.open.html ]]] --> 1.9925 + 1.9926 +<p>Canvas test: 2d.line.join.open</p> 1.9927 +<!-- Testing: Line joins are not drawn at the corner of an unclosed rectangle --> 1.9928 +<canvas id="c317" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9929 +<script> 1.9930 + 1.9931 + 1.9932 +function test_2d_line_join_open() { 1.9933 + 1.9934 +var canvas = document.getElementById('c317'); 1.9935 +var ctx = canvas.getContext('2d'); 1.9936 + 1.9937 +ctx.fillStyle = '#0f0'; 1.9938 +ctx.strokeStyle = '#f00'; 1.9939 +ctx.fillRect(0, 0, 100, 50); 1.9940 + 1.9941 +ctx.lineJoin = 'miter'; 1.9942 +ctx.lineWidth = 200; 1.9943 + 1.9944 +ctx.beginPath(); 1.9945 +ctx.moveTo(100, 50); 1.9946 +ctx.lineTo(100, 1000); 1.9947 +ctx.lineTo(1000, 1000); 1.9948 +ctx.lineTo(1000, 50); 1.9949 +ctx.lineTo(100, 50); 1.9950 +ctx.stroke(); 1.9951 + 1.9952 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.9953 +isPixel(ctx, 48,1, 0,255,0,255, 0); 1.9954 +isPixel(ctx, 48,48, 0,255,0,255, 0); 1.9955 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.9956 + 1.9957 + 1.9958 +} 1.9959 +</script> 1.9960 + 1.9961 +<!-- [[[ test_2d.line.join.parallel.html ]]] --> 1.9962 + 1.9963 +<p>Canvas test: 2d.line.join.parallel</p> 1.9964 +<!-- Testing: Line joins are drawn at 180-degree joins --> 1.9965 +<canvas id="c318" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.9966 +<script> 1.9967 + 1.9968 + 1.9969 +function test_2d_line_join_parallel() { 1.9970 + 1.9971 +var canvas = document.getElementById('c318'); 1.9972 +var ctx = canvas.getContext('2d'); 1.9973 + 1.9974 +ctx.fillStyle = '#f00'; 1.9975 +ctx.fillRect(0, 0, 100, 50); 1.9976 + 1.9977 +ctx.strokeStyle = '#0f0'; 1.9978 +ctx.lineWidth = 300; 1.9979 +ctx.lineJoin = 'round'; 1.9980 +ctx.beginPath(); 1.9981 +ctx.moveTo(-100, 25); 1.9982 +ctx.lineTo(0, 25); 1.9983 +ctx.lineTo(-100, 25); 1.9984 +ctx.stroke(); 1.9985 + 1.9986 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.9987 +isPixel(ctx, 48,1, 0,255,0,255, 0); 1.9988 +isPixel(ctx, 48,48, 0,255,0,255, 0); 1.9989 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.9990 + 1.9991 + 1.9992 +} 1.9993 +</script> 1.9994 + 1.9995 +<!-- [[[ test_2d.line.join.round.html ]]] --> 1.9996 + 1.9997 +<p>Canvas test: 2d.line.join.round</p> 1.9998 +<!-- Testing: lineJoin 'round' is rendered correctly --> 1.9999 +<canvas id="c319" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10000 +<script> 1.10001 + 1.10002 + 1.10003 +function test_2d_line_join_round() { 1.10004 + 1.10005 +var canvas = document.getElementById('c319'); 1.10006 +var ctx = canvas.getContext('2d'); 1.10007 + 1.10008 +ctx.fillStyle = '#0f0'; 1.10009 +ctx.fillRect(0, 0, 100, 50); 1.10010 + 1.10011 +var tol = 1; // tolerance to avoid antialiasing artifacts 1.10012 + 1.10013 +ctx.lineJoin = 'round'; 1.10014 +ctx.lineWidth = 20; 1.10015 + 1.10016 +ctx.fillStyle = '#f00'; 1.10017 +ctx.strokeStyle = '#0f0'; 1.10018 + 1.10019 +ctx.fillRect(10, 10, 20, 20); 1.10020 +ctx.fillRect(20, 20, 20, 20); 1.10021 +ctx.beginPath(); 1.10022 +ctx.moveTo(30, 20); 1.10023 +ctx.arc(30, 20, 10-tol, 0, 2*Math.PI, true); 1.10024 +ctx.fill(); 1.10025 + 1.10026 +ctx.beginPath(); 1.10027 +ctx.moveTo(10, 20); 1.10028 +ctx.lineTo(30, 20); 1.10029 +ctx.lineTo(30, 40); 1.10030 +ctx.stroke(); 1.10031 + 1.10032 + 1.10033 +ctx.fillStyle = '#0f0'; 1.10034 +ctx.strokeStyle = '#f00'; 1.10035 + 1.10036 +ctx.beginPath(); 1.10037 +ctx.moveTo(60, 20); 1.10038 +ctx.lineTo(80, 20); 1.10039 +ctx.lineTo(80, 40); 1.10040 +ctx.stroke(); 1.10041 + 1.10042 +ctx.fillRect(60, 10, 20, 20); 1.10043 +ctx.fillRect(70, 20, 20, 20); 1.10044 +ctx.beginPath(); 1.10045 +ctx.moveTo(80, 20); 1.10046 +ctx.arc(80, 20, 10+tol, 0, 2*Math.PI, true); 1.10047 +ctx.fill(); 1.10048 + 1.10049 +isPixel(ctx, 36,14, 0,255,0,255, 0); 1.10050 +isPixel(ctx, 36,13, 0,255,0,255, 0); 1.10051 +isPixel(ctx, 37,13, 0,255,0,255, 0); 1.10052 +isPixel(ctx, 38,13, 0,255,0,255, 0); 1.10053 +isPixel(ctx, 38,12, 0,255,0,255, 0); 1.10054 + 1.10055 +isPixel(ctx, 86,14, 0,255,0,255, 0); 1.10056 +isPixel(ctx, 86,13, 0,255,0,255, 0); 1.10057 +isPixel(ctx, 87,13, 0,255,0,255, 0); 1.10058 +isPixel(ctx, 88,13, 0,255,0,255, 0); 1.10059 +isPixel(ctx, 88,12, 0,255,0,255, 0); 1.10060 + 1.10061 + 1.10062 +} 1.10063 +</script> 1.10064 + 1.10065 +<!-- [[[ test_2d.line.miter.acute.html ]]] --> 1.10066 + 1.10067 +<p>Canvas test: 2d.line.miter.acute</p> 1.10068 +<!-- Testing: Miter joins are drawn correctly with acute angles --> 1.10069 +<canvas id="c320" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10070 +<script> 1.10071 + 1.10072 + 1.10073 +function test_2d_line_miter_acute() { 1.10074 + 1.10075 +var canvas = document.getElementById('c320'); 1.10076 +var ctx = canvas.getContext('2d'); 1.10077 + 1.10078 +ctx.fillStyle = '#f00'; 1.10079 +ctx.fillRect(0, 0, 100, 50); 1.10080 + 1.10081 +ctx.lineWidth = 200; 1.10082 +ctx.lineJoin = 'miter'; 1.10083 + 1.10084 +ctx.strokeStyle = '#0f0'; 1.10085 +ctx.miterLimit = 2.614; 1.10086 +ctx.beginPath(); 1.10087 +ctx.moveTo(100, 1000); 1.10088 +ctx.lineTo(100, 100); 1.10089 +ctx.lineTo(1000, 1000); 1.10090 +ctx.stroke(); 1.10091 + 1.10092 +ctx.strokeStyle = '#f00'; 1.10093 +ctx.miterLimit = 2.613; 1.10094 +ctx.beginPath(); 1.10095 +ctx.moveTo(100, 1000); 1.10096 +ctx.lineTo(100, 100); 1.10097 +ctx.lineTo(1000, 1000); 1.10098 +ctx.stroke(); 1.10099 + 1.10100 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.10101 +isPixel(ctx, 48,1, 0,255,0,255, 0); 1.10102 +isPixel(ctx, 48,48, 0,255,0,255, 0); 1.10103 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.10104 + 1.10105 + 1.10106 +} 1.10107 +</script> 1.10108 + 1.10109 +<!-- [[[ test_2d.line.miter.exceeded.html ]]] --> 1.10110 + 1.10111 +<p>Canvas test: 2d.line.miter.exceeded</p> 1.10112 +<!-- Testing: Miter joins are not drawn when the miter limit is exceeded --> 1.10113 +<canvas id="c321" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10114 +<script> 1.10115 + 1.10116 + 1.10117 +function test_2d_line_miter_exceeded() { 1.10118 + 1.10119 +var canvas = document.getElementById('c321'); 1.10120 +var ctx = canvas.getContext('2d'); 1.10121 + 1.10122 +ctx.fillStyle = '#0f0'; 1.10123 +ctx.fillRect(0, 0, 100, 50); 1.10124 + 1.10125 +ctx.lineWidth = 400; 1.10126 +ctx.lineJoin = 'miter'; 1.10127 + 1.10128 +ctx.strokeStyle = '#f00'; 1.10129 +ctx.miterLimit = 1.414; 1.10130 +ctx.beginPath(); 1.10131 +ctx.moveTo(200, 1000); 1.10132 +ctx.lineTo(200, 200); 1.10133 +ctx.lineTo(1000, 201); // slightly non-right-angle to avoid being a special case 1.10134 +ctx.stroke(); 1.10135 + 1.10136 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.10137 +isPixel(ctx, 48,1, 0,255,0,255, 0); 1.10138 +isPixel(ctx, 48,48, 0,255,0,255, 0); 1.10139 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.10140 + 1.10141 + 1.10142 +} 1.10143 +</script> 1.10144 + 1.10145 +<!-- [[[ test_2d.line.miter.invalid.html ]]] --> 1.10146 + 1.10147 +<p>Canvas test: 2d.line.miter.invalid</p> 1.10148 +<!-- Testing: Setting miterLimit to invalid values is ignored --> 1.10149 +<canvas id="c322" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10150 +<script> 1.10151 + 1.10152 +function test_2d_line_miter_invalid() { 1.10153 + 1.10154 +var canvas = document.getElementById('c322'); 1.10155 +var ctx = canvas.getContext('2d'); 1.10156 + 1.10157 +var _thrown_outer = false; 1.10158 +try { 1.10159 + 1.10160 +ctx.miterLimit = 1.5; 1.10161 +ok(ctx.miterLimit === 1.5, "ctx.miterLimit === 1.5"); 1.10162 + 1.10163 +ctx.miterLimit = 1.5; 1.10164 +ctx.miterLimit = 0; 1.10165 +ok(ctx.miterLimit === 1.5, "ctx.miterLimit === 1.5"); 1.10166 + 1.10167 +ctx.miterLimit = 1.5; 1.10168 +ctx.miterLimit = -1; 1.10169 +ok(ctx.miterLimit === 1.5, "ctx.miterLimit === 1.5"); 1.10170 + 1.10171 +ctx.miterLimit = 1.5; 1.10172 +ctx.miterLimit = Infinity; 1.10173 +ok(ctx.miterLimit === 1.5, "ctx.miterLimit === 1.5"); 1.10174 + 1.10175 +ctx.miterLimit = 1.5; 1.10176 +ctx.miterLimit = -Infinity; 1.10177 +ok(ctx.miterLimit === 1.5, "ctx.miterLimit === 1.5"); 1.10178 + 1.10179 +ctx.miterLimit = 1.5; 1.10180 +ctx.miterLimit = NaN; 1.10181 +ok(ctx.miterLimit === 1.5, "ctx.miterLimit === 1.5"); 1.10182 + 1.10183 +} catch (e) { 1.10184 + _thrown_outer = true; 1.10185 +} 1.10186 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.10187 + 1.10188 + 1.10189 +} 1.10190 +</script> 1.10191 + 1.10192 +<!-- [[[ test_2d.line.miter.lineedge.html ]]] --> 1.10193 + 1.10194 +<p>Canvas test: 2d.line.miter.lineedge - bug 401791</p> 1.10195 +<!-- Testing: Miter joins are not drawn when the miter limit is exceeded at the corners of a zero-height rectangle --> 1.10196 +<canvas id="c323" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10197 +<script> 1.10198 + 1.10199 + 1.10200 +function test_2d_line_miter_lineedge() { 1.10201 + 1.10202 +var canvas = document.getElementById('c323'); 1.10203 +var ctx = canvas.getContext('2d'); 1.10204 + 1.10205 +ctx.fillStyle = '#0f0'; 1.10206 +ctx.fillRect(0, 0, 100, 50); 1.10207 + 1.10208 +ctx.lineWidth = 200; 1.10209 +ctx.lineJoin = 'miter'; 1.10210 + 1.10211 +ctx.strokeStyle = '#f00'; 1.10212 +ctx.miterLimit = 1.414; 1.10213 +ctx.beginPath(); 1.10214 +ctx.strokeRect(100, 25, 200, 0); 1.10215 + 1.10216 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.10217 +isPixel(ctx, 48,1, 0,255,0,255, 0); 1.10218 +isPixel(ctx, 48,48, 0,255,0,255, 0); 1.10219 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.10220 + 1.10221 + 1.10222 +} 1.10223 +</script> 1.10224 + 1.10225 +<!-- [[[ test_2d.line.miter.obtuse.html ]]] --> 1.10226 + 1.10227 +<p>Canvas test: 2d.line.miter.obtuse</p> 1.10228 +<!-- Testing: Miter joins are drawn correctly with obtuse angles --> 1.10229 +<canvas id="c324" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10230 +<script> 1.10231 + 1.10232 + 1.10233 +function test_2d_line_miter_obtuse() { 1.10234 + 1.10235 +var canvas = document.getElementById('c324'); 1.10236 +var ctx = canvas.getContext('2d'); 1.10237 + 1.10238 +ctx.fillStyle = '#f00'; 1.10239 +ctx.fillRect(0, 0, 100, 50); 1.10240 + 1.10241 +var x=800; 1.10242 +var y=300; 1.10243 +ctx.lineWidth = 1600; 1.10244 +ctx.lineJoin = 'miter'; 1.10245 + 1.10246 +ctx.strokeStyle = '#0f0'; 1.10247 +ctx.miterLimit = 1.083; 1.10248 +ctx.beginPath(); 1.10249 +ctx.moveTo(800, 10000); 1.10250 +ctx.lineTo(800, 300); 1.10251 +ctx.lineTo(10000, -8900); 1.10252 +ctx.stroke(); 1.10253 + 1.10254 +ctx.strokeStyle = '#f00'; 1.10255 +ctx.miterLimit = 1.082; 1.10256 +ctx.beginPath(); 1.10257 +ctx.moveTo(800, 10000); 1.10258 +ctx.lineTo(800, 300); 1.10259 +ctx.lineTo(10000, -8900); 1.10260 +ctx.stroke(); 1.10261 + 1.10262 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.10263 +isPixel(ctx, 48,1, 0,255,0,255, 0); 1.10264 +isPixel(ctx, 48,48, 0,255,0,255, 0); 1.10265 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.10266 + 1.10267 + 1.10268 +} 1.10269 +</script> 1.10270 + 1.10271 +<!-- [[[ test_2d.line.miter.rightangle.html ]]] --> 1.10272 + 1.10273 +<p>Canvas test: 2d.line.miter.rightangle - bug 401791</p> 1.10274 +<!-- Testing: Miter joins are not drawn when the miter limit is exceeded, on exact right angles --> 1.10275 +<canvas id="c325" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10276 +<script> 1.10277 + 1.10278 + 1.10279 +function test_2d_line_miter_rightangle() { 1.10280 + 1.10281 +var canvas = document.getElementById('c325'); 1.10282 +var ctx = canvas.getContext('2d'); 1.10283 + 1.10284 +ctx.fillStyle = '#0f0'; 1.10285 +ctx.fillRect(0, 0, 100, 50); 1.10286 + 1.10287 +ctx.lineWidth = 400; 1.10288 +ctx.lineJoin = 'miter'; 1.10289 + 1.10290 +ctx.strokeStyle = '#f00'; 1.10291 +ctx.miterLimit = 1.414; 1.10292 +ctx.beginPath(); 1.10293 +ctx.moveTo(200, 1000); 1.10294 +ctx.lineTo(200, 200); 1.10295 +ctx.lineTo(1000, 200); 1.10296 +ctx.stroke(); 1.10297 + 1.10298 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.10299 +isPixel(ctx, 48,1, 0,255,0,255, 0); 1.10300 +isPixel(ctx, 48,48, 0,255,0,255, 0); 1.10301 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.10302 + 1.10303 + 1.10304 +} 1.10305 +</script> 1.10306 + 1.10307 +<!-- [[[ test_2d.line.miter.within.html ]]] --> 1.10308 + 1.10309 +<p>Canvas test: 2d.line.miter.within</p> 1.10310 +<!-- Testing: Miter joins are drawn when the miter limit is not quite exceeded --> 1.10311 +<canvas id="c326" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10312 +<script> 1.10313 + 1.10314 + 1.10315 +function test_2d_line_miter_within() { 1.10316 + 1.10317 +var canvas = document.getElementById('c326'); 1.10318 +var ctx = canvas.getContext('2d'); 1.10319 + 1.10320 +ctx.fillStyle = '#f00'; 1.10321 +ctx.fillRect(0, 0, 100, 50); 1.10322 + 1.10323 +ctx.lineWidth = 400; 1.10324 +ctx.lineJoin = 'miter'; 1.10325 + 1.10326 +ctx.strokeStyle = '#0f0'; 1.10327 +ctx.miterLimit = 1.416; 1.10328 +ctx.beginPath(); 1.10329 +ctx.moveTo(200, 1000); 1.10330 +ctx.lineTo(200, 200); 1.10331 +ctx.lineTo(1000, 201); 1.10332 +ctx.stroke(); 1.10333 + 1.10334 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.10335 +isPixel(ctx, 48,1, 0,255,0,255, 0); 1.10336 +isPixel(ctx, 48,48, 0,255,0,255, 0); 1.10337 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.10338 + 1.10339 + 1.10340 +} 1.10341 +</script> 1.10342 + 1.10343 +<!-- [[[ test_2d.line.union.html ]]] --> 1.10344 + 1.10345 +<p>Canvas test: 2d.line.union</p> 1.10346 +<canvas id="c327" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10347 +<script> 1.10348 + 1.10349 + 1.10350 +function test_2d_line_union() { 1.10351 + 1.10352 +var canvas = document.getElementById('c327'); 1.10353 +var ctx = canvas.getContext('2d'); 1.10354 + 1.10355 +ctx.fillStyle = '#f00'; 1.10356 +ctx.fillRect(0, 0, 100, 50); 1.10357 + 1.10358 +ctx.lineWidth = 100; 1.10359 +ctx.lineCap = 'round'; 1.10360 + 1.10361 +ctx.strokeStyle = '#0f0'; 1.10362 +ctx.beginPath(); 1.10363 +ctx.moveTo(0, 24); 1.10364 +ctx.lineTo(100, 25); 1.10365 +ctx.lineTo(0, 26); 1.10366 +ctx.closePath(); 1.10367 +ctx.stroke(); 1.10368 + 1.10369 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.10370 +isPixel(ctx, 25,1, 0,255,0,255, 0); 1.10371 +isPixel(ctx, 48,1, 0,255,0,255, 0); 1.10372 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.10373 +isPixel(ctx, 25,1, 0,255,0,255, 0); 1.10374 +isPixel(ctx, 48,48, 0,255,0,255, 0); 1.10375 + 1.10376 + 1.10377 +} 1.10378 +</script> 1.10379 + 1.10380 +<!-- [[[ test_2d.line.width.basic.html ]]] --> 1.10381 + 1.10382 +<p>Canvas test: 2d.line.width.basic</p> 1.10383 +<!-- Testing: lineWidth determines the width of line strokes --> 1.10384 +<canvas id="c328" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10385 +<script> 1.10386 + 1.10387 + 1.10388 +function test_2d_line_width_basic() { 1.10389 + 1.10390 +var canvas = document.getElementById('c328'); 1.10391 +var ctx = canvas.getContext('2d'); 1.10392 + 1.10393 +ctx.fillStyle = '#0f0'; 1.10394 +ctx.fillRect(0, 0, 100, 50); 1.10395 + 1.10396 +ctx.lineWidth = 20; 1.10397 +// Draw a green line over a red box, to check the line is not too small 1.10398 +ctx.fillStyle = '#f00'; 1.10399 +ctx.strokeStyle = '#0f0'; 1.10400 +ctx.fillRect(15, 15, 20, 20); 1.10401 +ctx.beginPath(); 1.10402 +ctx.moveTo(25, 15); 1.10403 +ctx.lineTo(25, 35); 1.10404 +ctx.stroke(); 1.10405 + 1.10406 +// Draw a green box over a red line, to check the line is not too large 1.10407 +ctx.fillStyle = '#0f0'; 1.10408 +ctx.strokeStyle = '#f00'; 1.10409 +ctx.beginPath(); 1.10410 +ctx.moveTo(75, 15); 1.10411 +ctx.lineTo(75, 35); 1.10412 +ctx.stroke(); 1.10413 +ctx.fillRect(65, 15, 20, 20); 1.10414 + 1.10415 +isPixel(ctx, 14,25, 0,255,0,255, 0); 1.10416 +isPixel(ctx, 15,25, 0,255,0,255, 0); 1.10417 +isPixel(ctx, 16,25, 0,255,0,255, 0); 1.10418 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.10419 +isPixel(ctx, 34,25, 0,255,0,255, 0); 1.10420 +isPixel(ctx, 35,25, 0,255,0,255, 0); 1.10421 +isPixel(ctx, 36,25, 0,255,0,255, 0); 1.10422 + 1.10423 +isPixel(ctx, 64,25, 0,255,0,255, 0); 1.10424 +isPixel(ctx, 65,25, 0,255,0,255, 0); 1.10425 +isPixel(ctx, 66,25, 0,255,0,255, 0); 1.10426 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.10427 +isPixel(ctx, 84,25, 0,255,0,255, 0); 1.10428 +isPixel(ctx, 85,25, 0,255,0,255, 0); 1.10429 +isPixel(ctx, 86,25, 0,255,0,255, 0); 1.10430 + 1.10431 + 1.10432 +} 1.10433 +</script> 1.10434 + 1.10435 +<!-- [[[ test_2d.line.width.invalid.html ]]] --> 1.10436 + 1.10437 +<p>Canvas test: 2d.line.width.invalid</p> 1.10438 +<!-- Testing: Setting lineWidth to invalid values is ignored --> 1.10439 +<canvas id="c329" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10440 +<script> 1.10441 + 1.10442 +function test_2d_line_width_invalid() { 1.10443 + 1.10444 +var canvas = document.getElementById('c329'); 1.10445 +var ctx = canvas.getContext('2d'); 1.10446 + 1.10447 +var _thrown_outer = false; 1.10448 +try { 1.10449 + 1.10450 +ctx.lineWidth = 1.5; 1.10451 +ok(ctx.lineWidth === 1.5, "ctx.lineWidth === 1.5"); 1.10452 + 1.10453 +ctx.lineWidth = 1.5; 1.10454 +ctx.lineWidth = 0; 1.10455 +ok(ctx.lineWidth === 1.5, "ctx.lineWidth === 1.5"); 1.10456 + 1.10457 +ctx.lineWidth = 1.5; 1.10458 +ctx.lineWidth = -1; 1.10459 +ok(ctx.lineWidth === 1.5, "ctx.lineWidth === 1.5"); 1.10460 + 1.10461 +ctx.lineWidth = 1.5; 1.10462 +ctx.lineWidth = Infinity; 1.10463 +ok(ctx.lineWidth === 1.5, "ctx.lineWidth === 1.5"); 1.10464 + 1.10465 +ctx.lineWidth = 1.5; 1.10466 +ctx.lineWidth = -Infinity; 1.10467 +ok(ctx.lineWidth === 1.5, "ctx.lineWidth === 1.5"); 1.10468 + 1.10469 +ctx.lineWidth = 1.5; 1.10470 +ctx.lineWidth = NaN; 1.10471 +ok(ctx.lineWidth === 1.5, "ctx.lineWidth === 1.5"); 1.10472 + 1.10473 +} catch (e) { 1.10474 + _thrown_outer = true; 1.10475 +} 1.10476 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.10477 + 1.10478 + 1.10479 +} 1.10480 +</script> 1.10481 + 1.10482 +<!-- [[[ test_2d.line.width.transformed.html ]]] --> 1.10483 + 1.10484 +<p>Canvas test: 2d.line.width.transformed</p> 1.10485 +<!-- Testing: Line stroke widths are affected by scale transformations --> 1.10486 +<canvas id="c330" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10487 +<script> 1.10488 + 1.10489 + 1.10490 +function test_2d_line_width_transformed() { 1.10491 + 1.10492 +var canvas = document.getElementById('c330'); 1.10493 +var ctx = canvas.getContext('2d'); 1.10494 + 1.10495 +ctx.fillStyle = '#0f0'; 1.10496 +ctx.fillRect(0, 0, 100, 50); 1.10497 + 1.10498 +ctx.lineWidth = 4; 1.10499 +// Draw a green line over a red box, to check the line is not too small 1.10500 +ctx.fillStyle = '#f00'; 1.10501 +ctx.strokeStyle = '#0f0'; 1.10502 +ctx.fillRect(15, 15, 20, 20); 1.10503 +ctx.save(); 1.10504 + ctx.scale(5, 1); 1.10505 + ctx.beginPath(); 1.10506 + ctx.moveTo(5, 15); 1.10507 + ctx.lineTo(5, 35); 1.10508 + ctx.stroke(); 1.10509 +ctx.restore(); 1.10510 + 1.10511 +// Draw a green box over a red line, to check the line is not too large 1.10512 +ctx.fillStyle = '#0f0'; 1.10513 +ctx.strokeStyle = '#f00'; 1.10514 +ctx.save(); 1.10515 + ctx.scale(-5, 1); 1.10516 + ctx.beginPath(); 1.10517 + ctx.moveTo(-15, 15); 1.10518 + ctx.lineTo(-15, 35); 1.10519 + ctx.stroke(); 1.10520 +ctx.restore(); 1.10521 +ctx.fillRect(65, 15, 20, 20); 1.10522 + 1.10523 +isPixel(ctx, 14,25, 0,255,0,255, 0); 1.10524 +isPixel(ctx, 15,25, 0,255,0,255, 0); 1.10525 +isPixel(ctx, 16,25, 0,255,0,255, 0); 1.10526 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.10527 +isPixel(ctx, 34,25, 0,255,0,255, 0); 1.10528 +isPixel(ctx, 35,25, 0,255,0,255, 0); 1.10529 +isPixel(ctx, 36,25, 0,255,0,255, 0); 1.10530 + 1.10531 +isPixel(ctx, 64,25, 0,255,0,255, 0); 1.10532 +isPixel(ctx, 65,25, 0,255,0,255, 0); 1.10533 +isPixel(ctx, 66,25, 0,255,0,255, 0); 1.10534 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.10535 +isPixel(ctx, 84,25, 0,255,0,255, 0); 1.10536 +isPixel(ctx, 85,25, 0,255,0,255, 0); 1.10537 +isPixel(ctx, 86,25, 0,255,0,255, 0); 1.10538 + 1.10539 + 1.10540 +} 1.10541 +</script> 1.10542 + 1.10543 +<!-- [[[ test_2d.missingargs.html ]]] --> 1.10544 + 1.10545 +<p>Canvas test: 2d.missingargs</p> 1.10546 +<!-- Testing: Missing arguments cause NOT_SUPPORTED_ERR --> 1.10547 +<canvas id="c331" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10548 +<script> 1.10549 + 1.10550 +function test_2d_missingargs() { 1.10551 + 1.10552 +var canvas = document.getElementById('c331'); 1.10553 +var ctx = canvas.getContext('2d'); 1.10554 + 1.10555 +var _thrown = undefined; try { 1.10556 + ctx.scale(); 1.10557 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10558 +var _thrown = undefined; try { 1.10559 + ctx.scale(1); 1.10560 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10561 +var _thrown = undefined; try { 1.10562 + ctx.rotate(); 1.10563 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10564 +var _thrown = undefined; try { 1.10565 + ctx.translate(); 1.10566 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10567 +var _thrown = undefined; try { 1.10568 + ctx.translate(0); 1.10569 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10570 +if (ctx.transform) { // (avoid spurious failures, since the aim here is not to test that all features are supported) 1.10571 + var _thrown = undefined; try { 1.10572 + ctx.transform(); 1.10573 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10574 + var _thrown = undefined; try { 1.10575 + ctx.transform(1); 1.10576 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10577 + var _thrown = undefined; try { 1.10578 + ctx.transform(1, 0); 1.10579 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10580 + var _thrown = undefined; try { 1.10581 + ctx.transform(1, 0, 0); 1.10582 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10583 + var _thrown = undefined; try { 1.10584 + ctx.transform(1, 0, 0, 1); 1.10585 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10586 + var _thrown = undefined; try { 1.10587 + ctx.transform(1, 0, 0, 1, 0); 1.10588 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10589 +} 1.10590 +if (ctx.setTransform) { 1.10591 + var _thrown = undefined; try { 1.10592 + ctx.setTransform(); 1.10593 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10594 + var _thrown = undefined; try { 1.10595 + ctx.setTransform(1); 1.10596 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10597 + var _thrown = undefined; try { 1.10598 + ctx.setTransform(1, 0); 1.10599 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10600 + var _thrown = undefined; try { 1.10601 + ctx.setTransform(1, 0, 0); 1.10602 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10603 + var _thrown = undefined; try { 1.10604 + ctx.setTransform(1, 0, 0, 1); 1.10605 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10606 + var _thrown = undefined; try { 1.10607 + ctx.setTransform(1, 0, 0, 1, 0); 1.10608 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10609 +} 1.10610 +var _thrown = undefined; try { 1.10611 + ctx.createLinearGradient(); 1.10612 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10613 +var _thrown = undefined; try { 1.10614 + ctx.createLinearGradient(0); 1.10615 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10616 +var _thrown = undefined; try { 1.10617 + ctx.createLinearGradient(0, 0); 1.10618 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10619 +var _thrown = undefined; try { 1.10620 + ctx.createLinearGradient(0, 0, 1); 1.10621 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10622 +var _thrown = undefined; try { 1.10623 + ctx.createRadialGradient(); 1.10624 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10625 +var _thrown = undefined; try { 1.10626 + ctx.createRadialGradient(0); 1.10627 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10628 +var _thrown = undefined; try { 1.10629 + ctx.createRadialGradient(0, 0); 1.10630 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10631 +var _thrown = undefined; try { 1.10632 + ctx.createRadialGradient(0, 0, 1); 1.10633 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10634 +var _thrown = undefined; try { 1.10635 + ctx.createRadialGradient(0, 0, 1, 0); 1.10636 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10637 +var _thrown = undefined; try { 1.10638 + ctx.createRadialGradient(0, 0, 1, 0, 0); 1.10639 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10640 +var _thrown = undefined; try { 1.10641 + ctx.createPattern(canvas); 1.10642 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10643 +var _thrown = undefined; try { 1.10644 + ctx.clearRect(); 1.10645 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10646 +var _thrown = undefined; try { 1.10647 + ctx.clearRect(0); 1.10648 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10649 +var _thrown = undefined; try { 1.10650 + ctx.clearRect(0, 0); 1.10651 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10652 +var _thrown = undefined; try { 1.10653 + ctx.clearRect(0, 0, 0); 1.10654 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10655 +var _thrown = undefined; try { 1.10656 + ctx.fillRect(); 1.10657 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10658 +var _thrown = undefined; try { 1.10659 + ctx.fillRect(0); 1.10660 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10661 +var _thrown = undefined; try { 1.10662 + ctx.fillRect(0, 0); 1.10663 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10664 +var _thrown = undefined; try { 1.10665 + ctx.fillRect(0, 0, 0); 1.10666 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10667 +var _thrown = undefined; try { 1.10668 + ctx.strokeRect(); 1.10669 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10670 +var _thrown = undefined; try { 1.10671 + ctx.strokeRect(0); 1.10672 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10673 +var _thrown = undefined; try { 1.10674 + ctx.strokeRect(0, 0); 1.10675 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10676 +var _thrown = undefined; try { 1.10677 + ctx.strokeRect(0, 0, 0); 1.10678 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10679 +var _thrown = undefined; try { 1.10680 + ctx.moveTo(); 1.10681 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10682 +var _thrown = undefined; try { 1.10683 + ctx.moveTo(0); 1.10684 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10685 +var _thrown = undefined; try { 1.10686 + ctx.lineTo(); 1.10687 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10688 +var _thrown = undefined; try { 1.10689 + ctx.lineTo(0); 1.10690 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10691 +var _thrown = undefined; try { 1.10692 + ctx.quadraticCurveTo(); 1.10693 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10694 +var _thrown = undefined; try { 1.10695 + ctx.quadraticCurveTo(0); 1.10696 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10697 +var _thrown = undefined; try { 1.10698 + ctx.quadraticCurveTo(0, 0); 1.10699 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10700 +var _thrown = undefined; try { 1.10701 + ctx.quadraticCurveTo(0, 0, 0); 1.10702 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10703 +var _thrown = undefined; try { 1.10704 + ctx.bezierCurveTo(); 1.10705 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10706 +var _thrown = undefined; try { 1.10707 + ctx.bezierCurveTo(0); 1.10708 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10709 +var _thrown = undefined; try { 1.10710 + ctx.bezierCurveTo(0, 0); 1.10711 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10712 +var _thrown = undefined; try { 1.10713 + ctx.bezierCurveTo(0, 0, 0); 1.10714 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10715 +var _thrown = undefined; try { 1.10716 + ctx.bezierCurveTo(0, 0, 0, 0); 1.10717 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10718 +var _thrown = undefined; try { 1.10719 + ctx.bezierCurveTo(0, 0, 0, 0, 0); 1.10720 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10721 +var _thrown = undefined; try { 1.10722 + ctx.arcTo(); 1.10723 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10724 +var _thrown = undefined; try { 1.10725 + ctx.arcTo(0); 1.10726 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10727 +var _thrown = undefined; try { 1.10728 + ctx.arcTo(0, 0); 1.10729 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10730 +var _thrown = undefined; try { 1.10731 + ctx.arcTo(0, 0, 0); 1.10732 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10733 +var _thrown = undefined; try { 1.10734 + ctx.arcTo(0, 0, 0, 0); 1.10735 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10736 +var _thrown = undefined; try { 1.10737 + ctx.rect(); 1.10738 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10739 +var _thrown = undefined; try { 1.10740 + ctx.rect(0); 1.10741 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10742 +var _thrown = undefined; try { 1.10743 + ctx.rect(0, 0); 1.10744 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10745 +var _thrown = undefined; try { 1.10746 + ctx.rect(0, 0, 0); 1.10747 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10748 +var _thrown = undefined; try { 1.10749 + ctx.arc(); 1.10750 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10751 +var _thrown = undefined; try { 1.10752 + ctx.arc(0); 1.10753 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10754 +var _thrown = undefined; try { 1.10755 + ctx.arc(0, 0); 1.10756 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10757 +var _thrown = undefined; try { 1.10758 + ctx.arc(0, 0, 1); 1.10759 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10760 +var _thrown = undefined; try { 1.10761 + ctx.arc(0, 0, 1, 0); 1.10762 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10763 +var _thrown = undefined; try { 1.10764 + ctx.arc(0, 0, 1, 0, 0); 1.10765 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10766 +if (ctx.isPointInPath) { 1.10767 + var _thrown = undefined; try { 1.10768 + ctx.isPointInPath(); 1.10769 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10770 + var _thrown = undefined; try { 1.10771 + ctx.isPointInPath(0); 1.10772 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10773 +} 1.10774 +var _thrown = undefined; try { 1.10775 + ctx.drawImage(); 1.10776 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10777 +var _thrown = undefined; try { 1.10778 + ctx.drawImage(canvas); 1.10779 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10780 +var _thrown = undefined; try { 1.10781 + ctx.drawImage(canvas, 0); 1.10782 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10783 +// TODO: n >= 3 args on drawImage could be either a valid overload, 1.10784 +// or too few for another overload, or too many for another 1.10785 +// overload - what should happen? 1.10786 +if (ctx.createImageData) { 1.10787 + var _thrown = undefined; try { 1.10788 + ctx.createImageData(); 1.10789 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10790 + var _thrown = undefined; try { 1.10791 + ctx.createImageData(1); 1.10792 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10793 +} 1.10794 +if (ctx.getImageData) { 1.10795 + var _thrown = undefined; try { 1.10796 + ctx.getImageData(); 1.10797 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10798 + var _thrown = undefined; try { 1.10799 + ctx.getImageData(0); 1.10800 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10801 + var _thrown = undefined; try { 1.10802 + ctx.getImageData(0, 0); 1.10803 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10804 + var _thrown = undefined; try { 1.10805 + ctx.getImageData(0, 0, 1); 1.10806 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10807 +} 1.10808 +if (ctx.putImageData) { 1.10809 + var imgdata = ctx.getImageData(0, 0, 1, 1); 1.10810 + var _thrown = undefined; try { 1.10811 + ctx.putImageData(); 1.10812 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10813 + var _thrown = undefined; try { 1.10814 + ctx.putImageData(imgdata); 1.10815 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10816 + var _thrown = undefined; try { 1.10817 + ctx.putImageData(imgdata, 0); 1.10818 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10819 +} 1.10820 +var g = ctx.createLinearGradient(0, 0, 0, 0); 1.10821 +var _thrown = undefined; try { 1.10822 + g.addColorStop(); 1.10823 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10824 +var _thrown = undefined; try { 1.10825 + g.addColorStop(0); 1.10826 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.10827 + 1.10828 + 1.10829 +} 1.10830 +</script> 1.10831 + 1.10832 +<!-- [[[ test_2d.path.arc.angle.1.html ]]] --> 1.10833 + 1.10834 +<p>Canvas test: 2d.path.arc.angle.1</p> 1.10835 +<!-- Testing: arc() draws pi/2 .. -pi anticlockwise correctly --> 1.10836 +<canvas id="c332" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10837 +<script> 1.10838 + 1.10839 + 1.10840 +function test_2d_path_arc_angle_1() { 1.10841 + 1.10842 +var canvas = document.getElementById('c332'); 1.10843 +var ctx = canvas.getContext('2d'); 1.10844 + 1.10845 +ctx.fillStyle = '#0f0'; 1.10846 +ctx.fillRect(0, 0, 100, 50); 1.10847 +ctx.fillStyle = '#f00'; 1.10848 +ctx.beginPath(); 1.10849 +ctx.moveTo(100, 0); 1.10850 +ctx.arc(100, 0, 150, Math.PI/2, -Math.PI, true); 1.10851 +ctx.fill(); 1.10852 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.10853 + 1.10854 + 1.10855 +} 1.10856 +</script> 1.10857 + 1.10858 +<!-- [[[ test_2d.path.arc.angle.2.html ]]] --> 1.10859 + 1.10860 +<p>Canvas test: 2d.path.arc.angle.2</p> 1.10861 +<!-- Testing: arc() draws -3pi/2 .. -pi anticlockwise correctly --> 1.10862 +<canvas id="c333" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10863 +<script> 1.10864 + 1.10865 + 1.10866 +function test_2d_path_arc_angle_2() { 1.10867 + 1.10868 +var canvas = document.getElementById('c333'); 1.10869 +var ctx = canvas.getContext('2d'); 1.10870 + 1.10871 +ctx.fillStyle = '#0f0'; 1.10872 +ctx.fillRect(0, 0, 100, 50); 1.10873 +ctx.fillStyle = '#f00'; 1.10874 +ctx.beginPath(); 1.10875 +ctx.moveTo(100, 0); 1.10876 +ctx.arc(100, 0, 150, -3*Math.PI/2, -Math.PI, true); 1.10877 +ctx.fill(); 1.10878 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.10879 + 1.10880 + 1.10881 +} 1.10882 +</script> 1.10883 + 1.10884 +<!-- [[[ test_2d.path.arc.angle.3.html ]]] --> 1.10885 + 1.10886 +<p>Canvas test: 2d.path.arc.angle.3</p> 1.10887 +<!-- Testing: arc() wraps angles mod 2pi when anticlockwise and end > start+2pi --> 1.10888 +<canvas id="c334" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10889 +<script> 1.10890 + 1.10891 + 1.10892 +function test_2d_path_arc_angle_3() { 1.10893 + 1.10894 +var canvas = document.getElementById('c334'); 1.10895 +var ctx = canvas.getContext('2d'); 1.10896 + 1.10897 +ctx.fillStyle = '#0f0'; 1.10898 +ctx.fillRect(0, 0, 100, 50); 1.10899 +ctx.fillStyle = '#f00'; 1.10900 +ctx.beginPath(); 1.10901 +ctx.moveTo(100, 0); 1.10902 +ctx.arc(100, 0, 150, (512+1/2)*Math.PI, (1024-1)*Math.PI, true); 1.10903 +ctx.fill(); 1.10904 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.10905 + 1.10906 + 1.10907 +} 1.10908 +</script> 1.10909 + 1.10910 +<!-- [[[ test_2d.path.arc.angle.4.html ]]] --> 1.10911 + 1.10912 +<p>Canvas test: 2d.path.arc.angle.4</p> 1.10913 +<!-- Testing: arc() draws a full circle when clockwise and end > start+2pi --> 1.10914 +<canvas id="c335" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10915 +<script> 1.10916 + 1.10917 + 1.10918 +function test_2d_path_arc_angle_4() { 1.10919 + 1.10920 +var canvas = document.getElementById('c335'); 1.10921 +var ctx = canvas.getContext('2d'); 1.10922 + 1.10923 +ctx.fillStyle = '#f00'; 1.10924 +ctx.fillRect(0, 0, 100, 50); 1.10925 +ctx.fillStyle = '#0f0'; 1.10926 +ctx.beginPath(); 1.10927 +ctx.moveTo(50, 25); 1.10928 +ctx.arc(50, 25, 60, (512+1/2)*Math.PI, (1024-1)*Math.PI, false); 1.10929 +ctx.fill(); 1.10930 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.10931 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.10932 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.10933 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.10934 + 1.10935 + 1.10936 +} 1.10937 +</script> 1.10938 + 1.10939 +<!-- [[[ test_2d.path.arc.angle.5.html ]]] --> 1.10940 + 1.10941 +<p>Canvas test: 2d.path.arc.angle.5</p> 1.10942 +<!-- Testing: arc() wraps angles mod 2pi when clockwise and start > end+2pi --> 1.10943 +<canvas id="c336" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10944 +<script> 1.10945 + 1.10946 + 1.10947 +function test_2d_path_arc_angle_5() { 1.10948 + 1.10949 +var canvas = document.getElementById('c336'); 1.10950 +var ctx = canvas.getContext('2d'); 1.10951 + 1.10952 +ctx.fillStyle = '#0f0'; 1.10953 +ctx.fillRect(0, 0, 100, 50); 1.10954 +ctx.fillStyle = '#f00'; 1.10955 +ctx.beginPath(); 1.10956 +ctx.moveTo(100, 0); 1.10957 +ctx.arc(100, 0, 150, (1024-1)*Math.PI, (512+1/2)*Math.PI, false); 1.10958 +ctx.fill(); 1.10959 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.10960 + 1.10961 + 1.10962 +} 1.10963 +</script> 1.10964 + 1.10965 +<!-- [[[ test_2d.path.arc.angle.6.html ]]] --> 1.10966 + 1.10967 +<p>Canvas test: 2d.path.arc.angle.6</p> 1.10968 +<!-- Testing: arc() draws a full circle when anticlockwise and start > end+2pi --> 1.10969 +<canvas id="c337" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10970 +<script> 1.10971 + 1.10972 + 1.10973 +function test_2d_path_arc_angle_6() { 1.10974 + 1.10975 +var canvas = document.getElementById('c337'); 1.10976 +var ctx = canvas.getContext('2d'); 1.10977 + 1.10978 +ctx.fillStyle = '#f00'; 1.10979 +ctx.fillRect(0, 0, 100, 50); 1.10980 +ctx.fillStyle = '#0f0'; 1.10981 +ctx.beginPath(); 1.10982 +ctx.moveTo(50, 25); 1.10983 +ctx.arc(50, 25, 60, (1024-1)*Math.PI, (512+1/2)*Math.PI, true); 1.10984 +ctx.fill(); 1.10985 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.10986 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.10987 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.10988 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.10989 + 1.10990 + 1.10991 +} 1.10992 +</script> 1.10993 + 1.10994 +<!-- [[[ test_2d.path.arc.empty.html ]]] --> 1.10995 + 1.10996 +<p>Canvas test: 2d.path.arc.empty</p> 1.10997 +<!-- Testing: arc() with an empty path does not draw a straight line to the start point --> 1.10998 +<canvas id="c338" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.10999 +<script> 1.11000 + 1.11001 + 1.11002 +function test_2d_path_arc_empty() { 1.11003 + 1.11004 +var canvas = document.getElementById('c338'); 1.11005 +var ctx = canvas.getContext('2d'); 1.11006 + 1.11007 +ctx.fillStyle = '#0f0'; 1.11008 +ctx.fillRect(0, 0, 100, 50); 1.11009 +ctx.lineWidth = 50; 1.11010 +ctx.strokeStyle = '#f00'; 1.11011 +ctx.beginPath(); 1.11012 +ctx.arc(200, 25, 5, 0, 2*Math.PI, true); 1.11013 +ctx.stroke(); 1.11014 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11015 + 1.11016 + 1.11017 +} 1.11018 +</script> 1.11019 + 1.11020 +<!-- [[[ test_2d.path.arc.end.html ]]] --> 1.11021 + 1.11022 +<p>Canvas test: 2d.path.arc.end</p> 1.11023 +<!-- Testing: arc() adds the end point of the arc to the subpath --> 1.11024 +<canvas id="c339" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11025 +<script> 1.11026 + 1.11027 + 1.11028 +function test_2d_path_arc_end() { 1.11029 + 1.11030 +var canvas = document.getElementById('c339'); 1.11031 +var ctx = canvas.getContext('2d'); 1.11032 + 1.11033 +ctx.fillStyle = '#f00'; 1.11034 +ctx.fillRect(0, 0, 100, 50); 1.11035 +ctx.lineWidth = 50; 1.11036 +ctx.strokeStyle = '#0f0'; 1.11037 +ctx.beginPath(); 1.11038 +ctx.moveTo(-100, 0); 1.11039 +ctx.arc(-100, 0, 25, -Math.PI/2, Math.PI/2, true); 1.11040 +ctx.lineTo(100, 25); 1.11041 +ctx.stroke(); 1.11042 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11043 + 1.11044 + 1.11045 +} 1.11046 +</script> 1.11047 + 1.11048 +<!-- [[[ test_2d.path.arc.negative.html ]]] --> 1.11049 + 1.11050 +<p>Canvas test: 2d.path.arc.negative</p> 1.11051 +<!-- Testing: arc() with negative radius throws INDEX_SIZE_ERR --> 1.11052 +<canvas id="c340" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11053 +<script> 1.11054 + 1.11055 +function test_2d_path_arc_negative() { 1.11056 + 1.11057 +var canvas = document.getElementById('c340'); 1.11058 +var ctx = canvas.getContext('2d'); 1.11059 + 1.11060 +var _thrown = undefined; try { 1.11061 + ctx.arc(0, 0, -1, 0, 0, true); 1.11062 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.11063 + 1.11064 + 1.11065 +} 1.11066 +</script> 1.11067 + 1.11068 +<!-- [[[ test_2d.path.arc.nonempty.html ]]] --> 1.11069 + 1.11070 +<p>Canvas test: 2d.path.arc.nonempty</p> 1.11071 +<!-- Testing: arc() with a non-empty path does draw a straight line to the start point --> 1.11072 +<canvas id="c341" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11073 +<script> 1.11074 + 1.11075 + 1.11076 +function test_2d_path_arc_nonempty() { 1.11077 + 1.11078 +var canvas = document.getElementById('c341'); 1.11079 +var ctx = canvas.getContext('2d'); 1.11080 + 1.11081 +ctx.fillStyle = '#f00'; 1.11082 +ctx.fillRect(0, 0, 100, 50); 1.11083 +ctx.lineWidth = 50; 1.11084 +ctx.strokeStyle = '#0f0'; 1.11085 +ctx.beginPath(); 1.11086 +ctx.moveTo(0, 25); 1.11087 +ctx.arc(200, 25, 5, 0, 2*Math.PI, true); 1.11088 +ctx.stroke(); 1.11089 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11090 + 1.11091 + 1.11092 +} 1.11093 +</script> 1.11094 + 1.11095 +<!-- [[[ test_2d.path.arc.nonfinite.html ]]] --> 1.11096 + 1.11097 +<p>Canvas test: 2d.path.arc.nonfinite</p> 1.11098 +<!-- Testing: arc() with Infinity/NaN is ignored --> 1.11099 +<canvas id="c342" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11100 +<script> 1.11101 + 1.11102 + 1.11103 +function test_2d_path_arc_nonfinite() { 1.11104 + 1.11105 +var canvas = document.getElementById('c342'); 1.11106 +var ctx = canvas.getContext('2d'); 1.11107 + 1.11108 +var _thrown_outer = false; 1.11109 +try { 1.11110 + 1.11111 +ctx.fillStyle = '#f00'; 1.11112 +ctx.fillRect(0, 0, 100, 50); 1.11113 +ctx.moveTo(0, 0); 1.11114 +ctx.lineTo(100, 0); 1.11115 +ctx.arc(Infinity, 50, 0, 2*Math.PI, true); 1.11116 +ctx.arc(-Infinity, 50, 0, 2*Math.PI, true); 1.11117 +ctx.arc(NaN, 50, 0, 2*Math.PI, true); 1.11118 +ctx.arc(0, Infinity, 0, 2*Math.PI, true); 1.11119 +ctx.arc(0, -Infinity, 0, 2*Math.PI, true); 1.11120 +ctx.arc(0, NaN, 0, 2*Math.PI, true); 1.11121 +ctx.arc(0, 50, Infinity, 2*Math.PI, true); 1.11122 +ctx.arc(0, 50, -Infinity, 2*Math.PI, true); 1.11123 +ctx.arc(0, 50, NaN, 2*Math.PI, true); 1.11124 +ctx.arc(0, 50, 0, Infinity, true); 1.11125 +ctx.arc(0, 50, 0, -Infinity, true); 1.11126 +ctx.arc(0, 50, 0, NaN, true); 1.11127 +ctx.arc(Infinity, Infinity, 0, 2*Math.PI, true); 1.11128 +ctx.arc(Infinity, Infinity, Infinity, 2*Math.PI, true); 1.11129 +ctx.arc(Infinity, Infinity, Infinity, Infinity, true); 1.11130 +ctx.arc(Infinity, Infinity, 0, Infinity, true); 1.11131 +ctx.arc(Infinity, 50, Infinity, 2*Math.PI, true); 1.11132 +ctx.arc(Infinity, 50, Infinity, Infinity, true); 1.11133 +ctx.arc(Infinity, 50, 0, Infinity, true); 1.11134 +ctx.arc(0, Infinity, Infinity, 2*Math.PI, true); 1.11135 +ctx.arc(0, Infinity, Infinity, Infinity, true); 1.11136 +ctx.arc(0, Infinity, 0, Infinity, true); 1.11137 +ctx.arc(0, 50, Infinity, Infinity, true); 1.11138 +ctx.lineTo(100, 50); 1.11139 +ctx.lineTo(0, 50); 1.11140 +ctx.fillStyle = '#0f0'; 1.11141 +ctx.fill(); 1.11142 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11143 +isPixel(ctx, 90,45, 0,255,0,255, 0); 1.11144 + 1.11145 +} catch (e) { 1.11146 + _thrown_outer = true; 1.11147 +} 1.11148 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.11149 + 1.11150 + 1.11151 +} 1.11152 +</script> 1.11153 + 1.11154 +<!-- [[[ test_2d.path.arc.scale.1.html ]]] --> 1.11155 + 1.11156 +<p>Canvas test: 2d.path.arc.scale.1</p> 1.11157 +<!-- Testing: Non-uniformly scaled arcs are the right shape --> 1.11158 +<canvas id="c343" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11159 +<script> 1.11160 + 1.11161 + 1.11162 +function test_2d_path_arc_scale_1() { 1.11163 + 1.11164 +var canvas = document.getElementById('c343'); 1.11165 +var ctx = canvas.getContext('2d'); 1.11166 + 1.11167 +ctx.fillStyle = '#f00'; 1.11168 +ctx.fillRect(0, 0, 100, 50); 1.11169 +ctx.scale(2, 0.5); 1.11170 +ctx.fillStyle = '#0f0'; 1.11171 +ctx.beginPath(); 1.11172 +var hypothenuse = Math.sqrt(50 * 50 + 25 * 25); 1.11173 +var tolerance = 0.5; 1.11174 +var radius = hypothenuse + tolerance; 1.11175 +ctx.arc(25, 50, radius, 0, 2*Math.PI, false); 1.11176 +ctx.fill(); 1.11177 +ctx.fillStyle = '#f00'; 1.11178 +ctx.beginPath(); 1.11179 +ctx.moveTo(-25, 50); 1.11180 +ctx.arc(-25, 50, 24, 0, 2*Math.PI, false); 1.11181 +ctx.moveTo(75, 50); 1.11182 +ctx.arc(75, 50, 24, 0, 2*Math.PI, false); 1.11183 +ctx.moveTo(25, -25); 1.11184 +ctx.arc(25, -25, 24, 0, 2*Math.PI, false); 1.11185 +ctx.moveTo(25, 125); 1.11186 +ctx.arc(25, 125, 24, 0, 2*Math.PI, false); 1.11187 +ctx.fill(); 1.11188 + 1.11189 +isPixel(ctx, 0,0, 0,255,0,255, 0); 1.11190 +isPixel(ctx, 50,0, 0,255,0,255, 0); 1.11191 +isPixel(ctx, 99,0, 0,255,0,255, 0); 1.11192 +isPixel(ctx, 0,25, 0,255,0,255, 0); 1.11193 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11194 +isPixel(ctx, 99,25, 0,255,0,255, 0); 1.11195 +isPixel(ctx, 0,49, 0,255,0,255, 0); 1.11196 +isPixel(ctx, 50,49, 0,255,0,255, 0); 1.11197 +isPixel(ctx, 99,49, 0,255,0,255, 0); 1.11198 + 1.11199 + 1.11200 +} 1.11201 +</script> 1.11202 + 1.11203 +<!-- [[[ test_2d.path.arc.scale.2.html ]]] --> 1.11204 + 1.11205 +<p>Canvas test: 2d.path.arc.scale.2</p> 1.11206 +<!-- Testing: Highly scaled arcs are the right shape --> 1.11207 +<canvas id="c344" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11208 +<script> 1.11209 + 1.11210 + 1.11211 +function test_2d_path_arc_scale_2() { 1.11212 + 1.11213 +var canvas = document.getElementById('c344'); 1.11214 +var ctx = canvas.getContext('2d'); 1.11215 + 1.11216 +ctx.fillStyle = '#f00'; 1.11217 +ctx.fillRect(0, 0, 100, 50); 1.11218 +ctx.scale(100, 100); 1.11219 +ctx.strokeStyle = '#0f0'; 1.11220 +ctx.lineWidth = 1.2; 1.11221 +ctx.beginPath(); 1.11222 +ctx.arc(0, 0, 0.6, 0, Math.PI/2, false); 1.11223 +ctx.stroke(); 1.11224 + 1.11225 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.11226 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.11227 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.11228 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.11229 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11230 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.11231 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.11232 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.11233 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.11234 + 1.11235 + 1.11236 +} 1.11237 +</script> 1.11238 + 1.11239 +<!-- [[[ test_2d.path.arc.selfintersect.1.html ]]] --> 1.11240 + 1.11241 +<p>Canvas test: 2d.path.arc.selfintersect.1</p> 1.11242 +<!-- Testing: arc() with lineWidth > 2*radius is drawn sensibly --> 1.11243 +<canvas id="c345" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11244 +<script> 1.11245 + 1.11246 + 1.11247 +function test_2d_path_arc_selfintersect_1() { 1.11248 + 1.11249 +var canvas = document.getElementById('c345'); 1.11250 +var ctx = canvas.getContext('2d'); 1.11251 + 1.11252 +ctx.fillStyle = '#0f0'; 1.11253 +ctx.fillRect(0, 0, 100, 50); 1.11254 +ctx.lineWidth = 200; 1.11255 +ctx.strokeStyle = '#f00'; 1.11256 +ctx.beginPath(); 1.11257 +ctx.arc(100, 50, 25, 0, -Math.PI/2, true); 1.11258 +ctx.stroke(); 1.11259 +ctx.beginPath(); 1.11260 +ctx.arc(0, 0, 25, 0, -Math.PI/2, true); 1.11261 +ctx.stroke(); 1.11262 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11263 + 1.11264 + 1.11265 +} 1.11266 +</script> 1.11267 + 1.11268 +<!-- [[[ test_2d.path.arc.selfintersect.2.html ]]] --> 1.11269 + 1.11270 +<p>Canvas test: 2d.path.arc.selfintersect.2</p> 1.11271 +<!-- Testing: arc() with lineWidth > 2*radius is drawn sensibly --> 1.11272 +<canvas id="c346" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11273 +<script> 1.11274 + 1.11275 + 1.11276 +function test_2d_path_arc_selfintersect_2() { 1.11277 + 1.11278 +var canvas = document.getElementById('c346'); 1.11279 +var ctx = canvas.getContext('2d'); 1.11280 + 1.11281 +ctx.fillStyle = '#f00'; 1.11282 +ctx.fillRect(0, 0, 100, 50); 1.11283 +ctx.lineWidth = 180; 1.11284 +ctx.strokeStyle = '#0f0'; 1.11285 +ctx.beginPath(); 1.11286 +ctx.arc(-50, 50, 25, 0, -Math.PI/2, true); 1.11287 +ctx.stroke(); 1.11288 +ctx.beginPath(); 1.11289 +ctx.arc(100, 0, 25, 0, -Math.PI/2, true); 1.11290 +ctx.stroke(); 1.11291 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11292 +isPixel(ctx, 90,10, 0,255,0,255, 0); 1.11293 +isPixel(ctx, 97,1, 0,255,0,255, 0); 1.11294 +isPixel(ctx, 97,2, 0,255,0,255, 0); 1.11295 +isPixel(ctx, 97,3, 0,255,0,255, 0); 1.11296 +isPixel(ctx, 2,48, 0,255,0,255, 0); 1.11297 + 1.11298 + 1.11299 +} 1.11300 +</script> 1.11301 + 1.11302 +<!-- [[[ test_2d.path.arc.shape.1.html ]]] --> 1.11303 + 1.11304 +<p>Canvas test: 2d.path.arc.shape.1</p> 1.11305 +<!-- Testing: arc() from 0 to pi does not draw anything in the wrong half --> 1.11306 +<canvas id="c347" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11307 +<script> 1.11308 + 1.11309 + 1.11310 +function test_2d_path_arc_shape_1() { 1.11311 + 1.11312 +var canvas = document.getElementById('c347'); 1.11313 +var ctx = canvas.getContext('2d'); 1.11314 + 1.11315 +ctx.fillStyle = '#0f0'; 1.11316 +ctx.fillRect(0, 0, 100, 50); 1.11317 +ctx.lineWidth = 50; 1.11318 +ctx.strokeStyle = '#f00'; 1.11319 +ctx.beginPath(); 1.11320 +ctx.arc(50, 50, 50, 0, Math.PI, false); 1.11321 +ctx.stroke(); 1.11322 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11323 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.11324 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.11325 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.11326 +// Fails on Linux with Azure/Cairo only 1.11327 +// The arc is drawn badly due to Cairo limitations, the error only becomes 1.11328 +// apparent on Linux because of anti-aliasing, probably due to X. 1.11329 +// The limitation is that Cairo draws arcs by stroking perpendicular to the arc, 1.11330 +// and at very large stroke thicknesses, this becomes a fan. Where exactly the 1.11331 +// 'blades' of the fan appear seems to depend on exactly how the arc is defined 1.11332 +// and the platform. So if the blades of the fan are where pixels are tested it 1.11333 +// passes the test, if the testing pixels fall in between the blades, then we fail. 1.11334 +// With Thebes/Cairo, we were rendering wrong, but got lucky with the test, now 1.11335 +// we are not so lucky. 1.11336 +// Bug 764125 1.11337 +if (IsAzureCairo() && IsLinux()) { 1.11338 + todo_isPixel(ctx, 20,48, 0,255,0,255, 0); 1.11339 +} else { 1.11340 + isPixel(ctx, 20,48, 0,255,0,255, 0); 1.11341 +} 1.11342 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.11343 + 1.11344 +} 1.11345 +</script> 1.11346 + 1.11347 +<!-- [[[ test_2d.path.arc.shape.2.html ]]] --> 1.11348 + 1.11349 +<p>Canvas test: 2d.path.arc.shape.2</p> 1.11350 +<!-- Testing: arc() from 0 to pi draws stuff in the right half --> 1.11351 +<canvas id="c348" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11352 +<script> 1.11353 + 1.11354 + 1.11355 +function test_2d_path_arc_shape_2() { 1.11356 + 1.11357 +var canvas = document.getElementById('c348'); 1.11358 +var ctx = canvas.getContext('2d'); 1.11359 + 1.11360 +ctx.fillStyle = '#f00'; 1.11361 +ctx.fillRect(0, 0, 100, 50); 1.11362 +ctx.lineWidth = 100; 1.11363 +ctx.strokeStyle = '#0f0'; 1.11364 +ctx.beginPath(); 1.11365 +ctx.arc(50, 50, 50, 0, Math.PI, true); 1.11366 +ctx.stroke(); 1.11367 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11368 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.11369 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.11370 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.11371 +isPixel(ctx, 20,48, 0,255,0,255, 0); 1.11372 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.11373 + 1.11374 + 1.11375 +} 1.11376 +</script> 1.11377 + 1.11378 +<!-- [[[ test_2d.path.arc.shape.3.html ]]] --> 1.11379 + 1.11380 +<p>Canvas test: 2d.path.arc.shape.3</p> 1.11381 +<!-- Testing: arc() from 0 to -pi/2 does not draw anything in the wrong quadrant --> 1.11382 +<canvas id="c349" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11383 +<script> 1.11384 + 1.11385 + 1.11386 + 1.11387 +function test_2d_path_arc_shape_3() { 1.11388 + 1.11389 +var canvas = document.getElementById('c349'); 1.11390 +var ctx = canvas.getContext('2d'); 1.11391 + 1.11392 +ctx.fillStyle = '#0f0'; 1.11393 +ctx.fillRect(0, 0, 100, 50); 1.11394 +ctx.lineWidth = 100; 1.11395 +ctx.strokeStyle = '#f00'; 1.11396 +ctx.beginPath(); 1.11397 +ctx.arc(0, 50, 50, 0, -Math.PI/2, false); 1.11398 +ctx.stroke(); 1.11399 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11400 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.11401 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.11402 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.11403 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.11404 + 1.11405 + 1.11406 +} 1.11407 +</script> 1.11408 + 1.11409 +<!-- [[[ test_2d.path.arc.shape.4.html ]]] --> 1.11410 + 1.11411 +<p>Canvas test: 2d.path.arc.shape.4</p> 1.11412 +<!-- Testing: arc() from 0 to -pi/2 draws stuff in the right quadrant --> 1.11413 +<canvas id="c350" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11414 +<script> 1.11415 + 1.11416 + 1.11417 +function test_2d_path_arc_shape_4() { 1.11418 + 1.11419 +var canvas = document.getElementById('c350'); 1.11420 +var ctx = canvas.getContext('2d'); 1.11421 + 1.11422 +ctx.fillStyle = '#f00'; 1.11423 +ctx.fillRect(0, 0, 100, 50); 1.11424 +ctx.lineWidth = 150; 1.11425 +ctx.strokeStyle = '#0f0'; 1.11426 +ctx.beginPath(); 1.11427 +ctx.arc(-50, 50, 100, 0, -Math.PI/2, true); 1.11428 +ctx.stroke(); 1.11429 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11430 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.11431 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.11432 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.11433 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.11434 + 1.11435 + 1.11436 +} 1.11437 +</script> 1.11438 + 1.11439 +<!-- [[[ test_2d.path.arc.shape.5.html ]]] --> 1.11440 + 1.11441 +<p>Canvas test: 2d.path.arc.shape.5</p> 1.11442 +<!-- Testing: arc() from 0 to 5pi does not draw crazy things --> 1.11443 +<canvas id="c351" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11444 +<script> 1.11445 + 1.11446 + 1.11447 +function test_2d_path_arc_shape_5() { 1.11448 + 1.11449 +var canvas = document.getElementById('c351'); 1.11450 +var ctx = canvas.getContext('2d'); 1.11451 + 1.11452 +ctx.fillStyle = '#0f0'; 1.11453 +ctx.fillRect(0, 0, 100, 50); 1.11454 +ctx.lineWidth = 200; 1.11455 +ctx.strokeStyle = '#f00'; 1.11456 +ctx.beginPath(); 1.11457 +ctx.arc(300, 0, 100, 0, 5*Math.PI, false); 1.11458 +ctx.stroke(); 1.11459 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11460 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.11461 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.11462 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.11463 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.11464 + 1.11465 + 1.11466 +} 1.11467 +</script> 1.11468 + 1.11469 +<!-- [[[ test_2d.path.arc.twopie.1.html ]]] --> 1.11470 + 1.11471 +<p>Canvas test: 2d.path.arc.twopie.1</p> 1.11472 +<!-- Testing: arc() draws nothing when end = start + 2pi-e and anticlockwise --> 1.11473 +<canvas id="c352" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11474 +<script> 1.11475 + 1.11476 + 1.11477 +function test_2d_path_arc_twopie_1() { 1.11478 + 1.11479 +var canvas = document.getElementById('c352'); 1.11480 +var ctx = canvas.getContext('2d'); 1.11481 + 1.11482 +ctx.fillStyle = '#0f0'; 1.11483 +ctx.fillRect(0, 0, 100, 50); 1.11484 +ctx.strokeStyle = '#f00'; 1.11485 +ctx.lineWidth = 100; 1.11486 +ctx.beginPath(); 1.11487 +ctx.arc(50, 25, 50, 0, 2*Math.PI - 1e-4, true); 1.11488 +ctx.stroke(); 1.11489 +isPixel(ctx, 50,20, 0,255,0,255, 0); 1.11490 + 1.11491 + 1.11492 +} 1.11493 +</script> 1.11494 + 1.11495 +<!-- [[[ test_2d.path.arc.twopie.2.html ]]] --> 1.11496 + 1.11497 +<p>Canvas test: 2d.path.arc.twopie.2</p> 1.11498 +<!-- Testing: arc() draws a full circle when end = start + 2pi-e and clockwise --> 1.11499 +<canvas id="c353" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11500 +<script> 1.11501 + 1.11502 + 1.11503 +function test_2d_path_arc_twopie_2() { 1.11504 + 1.11505 +var canvas = document.getElementById('c353'); 1.11506 +var ctx = canvas.getContext('2d'); 1.11507 + 1.11508 +ctx.fillStyle = '#f00'; 1.11509 +ctx.fillRect(0, 0, 100, 50); 1.11510 +ctx.strokeStyle = '#0f0'; 1.11511 +ctx.lineWidth = 100; 1.11512 +ctx.beginPath(); 1.11513 +ctx.arc(50, 25, 50, 0, 2*Math.PI - 1e-4, false); 1.11514 +ctx.stroke(); 1.11515 +isPixel(ctx, 50,20, 0,255,0,255, 0); 1.11516 + 1.11517 + 1.11518 +} 1.11519 +</script> 1.11520 + 1.11521 +<!-- [[[ test_2d.path.arc.twopie.3.html ]]] --> 1.11522 + 1.11523 +<p>Canvas test: 2d.path.arc.twopie.3</p> 1.11524 +<!-- Testing: arc() draws a full circle when end = start + 2pi+e and anticlockwise --> 1.11525 +<canvas id="c354" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11526 +<script> 1.11527 + 1.11528 + 1.11529 +function test_2d_path_arc_twopie_3() { 1.11530 + 1.11531 +var canvas = document.getElementById('c354'); 1.11532 +var ctx = canvas.getContext('2d'); 1.11533 + 1.11534 +ctx.fillStyle = '#f00'; 1.11535 +ctx.fillRect(0, 0, 100, 50); 1.11536 +ctx.strokeStyle = '#0f0'; 1.11537 +ctx.lineWidth = 100; 1.11538 +ctx.beginPath(); 1.11539 +ctx.arc(50, 25, 50, 0, 2*Math.PI + 1e-4, true); 1.11540 +ctx.stroke(); 1.11541 +isPixel(ctx, 50,20, 0,255,0,255, 0); 1.11542 + 1.11543 + 1.11544 +} 1.11545 +</script> 1.11546 + 1.11547 +<!-- [[[ test_2d.path.arc.twopie.4.html ]]] --> 1.11548 + 1.11549 +<p>Canvas test: 2d.path.arc.twopie.4</p> 1.11550 +<!-- Testing: arc() draws nothing when end = start + 2pi+e and clockwise --> 1.11551 +<canvas id="c355" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11552 +<script> 1.11553 + 1.11554 + 1.11555 +function test_2d_path_arc_twopie_4() { 1.11556 + 1.11557 +var canvas = document.getElementById('c355'); 1.11558 +var ctx = canvas.getContext('2d'); 1.11559 + 1.11560 +ctx.fillStyle = '#f00'; 1.11561 +ctx.fillRect(0, 0, 100, 50); 1.11562 +ctx.strokeStyle = '#0f0'; 1.11563 +ctx.lineWidth = 100; 1.11564 +ctx.beginPath(); 1.11565 +ctx.arc(50, 25, 50, 0, 2*Math.PI + 1e-4, false); 1.11566 +ctx.stroke(); 1.11567 +isPixel(ctx, 50,20, 0,255,0,255, 0); 1.11568 + 1.11569 + 1.11570 +} 1.11571 +</script> 1.11572 + 1.11573 +<!-- [[[ test_2d.path.arc.zero.1.html ]]] --> 1.11574 + 1.11575 +<p>Canvas test: 2d.path.arc.zero.1</p> 1.11576 +<!-- Testing: arc() draws nothing when startAngle = endAngle and anticlockwise --> 1.11577 +<canvas id="c356" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11578 +<script> 1.11579 + 1.11580 + 1.11581 +function test_2d_path_arc_zero_1() { 1.11582 + 1.11583 +var canvas = document.getElementById('c356'); 1.11584 +var ctx = canvas.getContext('2d'); 1.11585 + 1.11586 +ctx.fillStyle = '#0f0'; 1.11587 +ctx.fillRect(0, 0, 100, 50); 1.11588 +ctx.strokeStyle = '#f00'; 1.11589 +ctx.lineWidth = 100; 1.11590 +ctx.beginPath(); 1.11591 +ctx.arc(50, 25, 50, 0, 0, true); 1.11592 +ctx.stroke(); 1.11593 +isPixel(ctx, 50,20, 0,255,0,255, 0); 1.11594 + 1.11595 + 1.11596 +} 1.11597 +</script> 1.11598 + 1.11599 +<!-- [[[ test_2d.path.arc.zero.2.html ]]] --> 1.11600 + 1.11601 +<p>Canvas test: 2d.path.arc.zero.2</p> 1.11602 +<!-- Testing: arc() draws nothing when startAngle = endAngle and clockwise --> 1.11603 +<canvas id="c357" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11604 +<script> 1.11605 + 1.11606 + 1.11607 +function test_2d_path_arc_zero_2() { 1.11608 + 1.11609 +var canvas = document.getElementById('c357'); 1.11610 +var ctx = canvas.getContext('2d'); 1.11611 + 1.11612 +ctx.fillStyle = '#0f0'; 1.11613 +ctx.fillRect(0, 0, 100, 50); 1.11614 +ctx.strokeStyle = '#f00'; 1.11615 +ctx.lineWidth = 100; 1.11616 +ctx.beginPath(); 1.11617 +ctx.arc(50, 25, 50, 0, 0, false); 1.11618 +ctx.stroke(); 1.11619 +isPixel(ctx, 50,20, 0,255,0,255, 0); 1.11620 + 1.11621 + 1.11622 +} 1.11623 +</script> 1.11624 + 1.11625 +<!-- [[[ test_2d.path.arc.zeroradius.html ]]] --> 1.11626 + 1.11627 +<p>Canvas test: 2d.path.arc.zeroradius</p> 1.11628 +<!-- Testing: arc() with zero radius draws a line to the start point --> 1.11629 +<canvas id="c358" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11630 +<script> 1.11631 + 1.11632 + 1.11633 + 1.11634 +function test_2d_path_arc_zeroradius() { 1.11635 + 1.11636 +var canvas = document.getElementById('c358'); 1.11637 +var ctx = canvas.getContext('2d'); 1.11638 + 1.11639 +ctx.fillStyle = '#f00' 1.11640 +ctx.fillRect(0, 0, 100, 50); 1.11641 +ctx.lineWidth = 50; 1.11642 +ctx.strokeStyle = '#0f0'; 1.11643 +ctx.beginPath(); 1.11644 +ctx.moveTo(0, 25); 1.11645 +ctx.arc(200, 25, 0, 0, Math.PI, true); 1.11646 +ctx.stroke(); 1.11647 + 1.11648 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11649 +} 1.11650 +</script> 1.11651 + 1.11652 +<!-- [[[ test_2d.path.arcTo.coincide.1.html ]]] --> 1.11653 + 1.11654 +<p>Canvas test: 2d.path.arcTo.coincide.1</p> 1.11655 +<!-- Testing: arcTo() has no effect if P0 = P1 --> 1.11656 +<canvas id="c359" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11657 +<script> 1.11658 + 1.11659 + 1.11660 + 1.11661 +function test_2d_path_arcTo_coincide_1() { 1.11662 + 1.11663 +var canvas = document.getElementById('c359'); 1.11664 +var ctx = canvas.getContext('2d'); 1.11665 + 1.11666 +ctx.fillStyle = '#f00'; 1.11667 +ctx.fillRect(0, 0, 100, 50); 1.11668 +ctx.lineWidth = 50; 1.11669 + 1.11670 +ctx.strokeStyle = '#0f0'; 1.11671 +ctx.beginPath(); 1.11672 +ctx.moveTo(0, 25); 1.11673 +ctx.arcTo(0, 25, 50, 1000, 1); 1.11674 +ctx.lineTo(100, 25); 1.11675 +ctx.stroke(); 1.11676 + 1.11677 +ctx.strokeStyle = '#f00'; 1.11678 +ctx.beginPath(); 1.11679 +ctx.moveTo(50, 25); 1.11680 +ctx.arcTo(50, 25, 100, 25, 1); 1.11681 +ctx.stroke(); 1.11682 + 1.11683 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.11684 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11685 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.11686 + 1.11687 + 1.11688 +} 1.11689 +</script> 1.11690 + 1.11691 +<!-- [[[ test_2d.path.arcTo.coincide.2.html ]]] --> 1.11692 + 1.11693 +<p>Canvas test: 2d.path.arcTo.coincide.2</p> 1.11694 +<!-- Testing: arcTo() draws a straight line to P1 if P1 = P2 --> 1.11695 +<canvas id="c360" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11696 +<script> 1.11697 + 1.11698 + 1.11699 +function test_2d_path_arcTo_coincide_2() { 1.11700 + 1.11701 +var canvas = document.getElementById('c360'); 1.11702 +var ctx = canvas.getContext('2d'); 1.11703 + 1.11704 +ctx.fillStyle = '#f00'; 1.11705 +ctx.fillRect(0, 0, 100, 50); 1.11706 +ctx.lineWidth = 50; 1.11707 +ctx.strokeStyle = '#0f0'; 1.11708 +ctx.beginPath(); 1.11709 +ctx.moveTo(0, 25); 1.11710 +ctx.arcTo(100, 25, 100, 25, 1); 1.11711 +ctx.stroke(); 1.11712 + 1.11713 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11714 + 1.11715 + 1.11716 +} 1.11717 +</script> 1.11718 + 1.11719 +<!-- [[[ test_2d.path.arcTo.collinear.1.html ]]] --> 1.11720 + 1.11721 +<p>Canvas test: 2d.path.arcTo.collinear.1</p> 1.11722 +<!-- Testing: arcTo() with all points on a line, and P1 between P0/P2, draws a straight line to P1 --> 1.11723 +<canvas id="c361" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11724 +<script> 1.11725 + 1.11726 + 1.11727 + 1.11728 +function test_2d_path_arcTo_collinear_1() { 1.11729 + 1.11730 +var canvas = document.getElementById('c361'); 1.11731 +var ctx = canvas.getContext('2d'); 1.11732 + 1.11733 +ctx.fillStyle = '#f00'; 1.11734 +ctx.fillRect(0, 0, 100, 50); 1.11735 +ctx.lineWidth = 50; 1.11736 + 1.11737 +ctx.strokeStyle = '#0f0'; 1.11738 +ctx.beginPath(); 1.11739 +ctx.moveTo(0, 25); 1.11740 +ctx.arcTo(100, 25, 200, 25, 1); 1.11741 +ctx.stroke(); 1.11742 + 1.11743 +ctx.strokeStyle = '#f00'; 1.11744 +ctx.beginPath(); 1.11745 +ctx.moveTo(-100, 25); 1.11746 +ctx.arcTo(0, 25, 100, 25, 1); 1.11747 +ctx.stroke(); 1.11748 + 1.11749 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11750 + 1.11751 + 1.11752 +} 1.11753 +</script> 1.11754 + 1.11755 +<!-- [[[ test_2d.path.arcTo.collinear.2.html ]]] --> 1.11756 + 1.11757 +<p>Canvas test: 2d.path.arcTo.collinear.2</p> 1.11758 +<!-- Testing: arcTo() with all points on a line, and P2 between P0/P1, draws an infinite line along P1..P2 --> 1.11759 +<canvas id="c362" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11760 +<script> 1.11761 + 1.11762 + 1.11763 + 1.11764 +function test_2d_path_arcTo_collinear_2() { 1.11765 + 1.11766 +var canvas = document.getElementById('c362'); 1.11767 +var ctx = canvas.getContext('2d'); 1.11768 + 1.11769 +ctx.fillStyle = '#f00'; 1.11770 +ctx.fillRect(0, 0, 100, 50); 1.11771 +ctx.lineWidth = 50; 1.11772 + 1.11773 +ctx.strokeStyle = '#0f0'; 1.11774 +ctx.beginPath(); 1.11775 +ctx.moveTo(1000, 25); 1.11776 +ctx.arcTo(1100, 25, 1050, 25, 1); 1.11777 +ctx.stroke(); 1.11778 + 1.11779 +ctx.strokeStyle = '#f00'; 1.11780 +ctx.beginPath(); 1.11781 +ctx.moveTo(0, 25); 1.11782 +ctx.arcTo(100, 25, -50, 25, 1); 1.11783 +ctx.stroke(); 1.11784 + 1.11785 +todo_isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11786 + 1.11787 + 1.11788 +} 1.11789 +</script> 1.11790 + 1.11791 +<!-- [[[ test_2d.path.arcTo.collinear.3.html ]]] --> 1.11792 + 1.11793 +<p>Canvas test: 2d.path.arcTo.collinear.3</p> 1.11794 +<!-- Testing: arcTo() with all points on a line, and P0 between P1/P2, draws an infinite line along P1..P2 --> 1.11795 +<canvas id="c363" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11796 +<script> 1.11797 + 1.11798 + 1.11799 + 1.11800 +function test_2d_path_arcTo_collinear_3() { 1.11801 + 1.11802 +var canvas = document.getElementById('c363'); 1.11803 +var ctx = canvas.getContext('2d'); 1.11804 + 1.11805 +ctx.fillStyle = '#f00'; 1.11806 +ctx.fillRect(0, 0, 100, 50); 1.11807 +ctx.lineWidth = 50; 1.11808 + 1.11809 +ctx.strokeStyle = '#0f0'; 1.11810 +ctx.beginPath(); 1.11811 +ctx.moveTo(150, 25); 1.11812 +ctx.arcTo(200, 25, 100, 25, 1); 1.11813 +ctx.stroke(); 1.11814 + 1.11815 +ctx.strokeStyle = '#f00'; 1.11816 +ctx.beginPath(); 1.11817 +ctx.moveTo(0, 25); 1.11818 +ctx.arcTo(100, 25, 50, 25, 1); 1.11819 +ctx.stroke(); 1.11820 + 1.11821 +todo_isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11822 + 1.11823 + 1.11824 +} 1.11825 +</script> 1.11826 + 1.11827 +<!-- [[[ test_2d.path.arcTo.emptysubpath.html ]]] --> 1.11828 + 1.11829 +<p>Canvas test: 2d.path.arcTo.emptysubpath</p> 1.11830 +<!-- Testing: arcTo() does nothing if there are no subpaths --> 1.11831 +<canvas id="c364" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11832 +<script> 1.11833 + 1.11834 + 1.11835 + 1.11836 +function test_2d_path_arcTo_emptysubpath() { 1.11837 + 1.11838 +var canvas = document.getElementById('c364'); 1.11839 +var ctx = canvas.getContext('2d'); 1.11840 + 1.11841 +ctx.fillStyle = '#0f0'; 1.11842 +ctx.fillRect(0, 0, 100, 50); 1.11843 +ctx.lineWidth = 50; 1.11844 +ctx.strokeStyle = '#f00'; 1.11845 +ctx.beginPath(); 1.11846 +ctx.arcTo(0, 25, 0, 25, 0.1); 1.11847 +ctx.arcTo(100, 25, 100, 25, 0.1); 1.11848 +ctx.stroke(); 1.11849 +todo_isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11850 + 1.11851 + 1.11852 +} 1.11853 +</script> 1.11854 + 1.11855 +<!-- [[[ test_2d.path.arcTo.negative.html ]]] --> 1.11856 + 1.11857 +<p>Canvas test: 2d.path.arcTo.negative</p> 1.11858 +<!-- Testing: arcTo() with negative radius throws an exception --> 1.11859 +<canvas id="c365" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11860 +<script> 1.11861 + 1.11862 +function test_2d_path_arcTo_negative() { 1.11863 + 1.11864 +var canvas = document.getElementById('c365'); 1.11865 +var ctx = canvas.getContext('2d'); 1.11866 + 1.11867 +var _thrown = undefined; try { 1.11868 + ctx.arcTo(0, 0, 0, 0, -1); 1.11869 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "IndexSizeError" && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw IndexSizeError"); 1.11870 + 1.11871 + 1.11872 +} 1.11873 +</script> 1.11874 + 1.11875 +<!-- [[[ test_2d.path.arcTo.nonfinite.html ]]] --> 1.11876 + 1.11877 +<p>Canvas test: 2d.path.arcTo.nonfinite</p> 1.11878 +<!-- Testing: arcTo() with Infinity/NaN is ignored --> 1.11879 +<canvas id="c366" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11880 +<script> 1.11881 + 1.11882 + 1.11883 +function test_2d_path_arcTo_nonfinite() { 1.11884 + 1.11885 +var canvas = document.getElementById('c366'); 1.11886 +var ctx = canvas.getContext('2d'); 1.11887 + 1.11888 +var _thrown_outer = false; 1.11889 +try { 1.11890 + 1.11891 +ctx.moveTo(0, 0); 1.11892 +ctx.lineTo(100, 0); 1.11893 +ctx.arcTo(Infinity, 50, 0, 50, 0); 1.11894 +ctx.arcTo(-Infinity, 50, 0, 50, 0); 1.11895 +ctx.arcTo(NaN, 50, 0, 50, 0); 1.11896 +ctx.arcTo(0, Infinity, 0, 50, 0); 1.11897 +ctx.arcTo(0, -Infinity, 0, 50, 0); 1.11898 +ctx.arcTo(0, NaN, 0, 50, 0); 1.11899 +ctx.arcTo(0, 50, Infinity, 50, 0); 1.11900 +ctx.arcTo(0, 50, -Infinity, 50, 0); 1.11901 +ctx.arcTo(0, 50, NaN, 50, 0); 1.11902 +ctx.arcTo(0, 50, 0, Infinity, 0); 1.11903 +ctx.arcTo(0, 50, 0, -Infinity, 0); 1.11904 +ctx.arcTo(0, 50, 0, NaN, 0); 1.11905 +ctx.arcTo(0, 50, 0, 50, Infinity); 1.11906 +ctx.arcTo(0, 50, 0, 50, -Infinity); 1.11907 +ctx.arcTo(0, 50, 0, 50, NaN); 1.11908 +ctx.arcTo(Infinity, Infinity, 0, 50, 0); 1.11909 +ctx.arcTo(Infinity, Infinity, Infinity, 50, 0); 1.11910 +ctx.arcTo(Infinity, Infinity, Infinity, Infinity, 0); 1.11911 +ctx.arcTo(Infinity, Infinity, Infinity, Infinity, Infinity); 1.11912 +ctx.arcTo(Infinity, Infinity, Infinity, 50, Infinity); 1.11913 +ctx.arcTo(Infinity, Infinity, 0, Infinity, 0); 1.11914 +ctx.arcTo(Infinity, Infinity, 0, Infinity, Infinity); 1.11915 +ctx.arcTo(Infinity, Infinity, 0, 50, Infinity); 1.11916 +ctx.arcTo(Infinity, 50, Infinity, 50, 0); 1.11917 +ctx.arcTo(Infinity, 50, Infinity, Infinity, 0); 1.11918 +ctx.arcTo(Infinity, 50, Infinity, Infinity, Infinity); 1.11919 +ctx.arcTo(Infinity, 50, Infinity, 50, Infinity); 1.11920 +ctx.arcTo(Infinity, 50, 0, Infinity, 0); 1.11921 +ctx.arcTo(Infinity, 50, 0, Infinity, Infinity); 1.11922 +ctx.arcTo(Infinity, 50, 0, 50, Infinity); 1.11923 +ctx.arcTo(0, Infinity, Infinity, 50, 0); 1.11924 +ctx.arcTo(0, Infinity, Infinity, Infinity, 0); 1.11925 +ctx.arcTo(0, Infinity, Infinity, Infinity, Infinity); 1.11926 +ctx.arcTo(0, Infinity, Infinity, 50, Infinity); 1.11927 +ctx.arcTo(0, Infinity, 0, Infinity, 0); 1.11928 +ctx.arcTo(0, Infinity, 0, Infinity, Infinity); 1.11929 +ctx.arcTo(0, Infinity, 0, 50, Infinity); 1.11930 +ctx.arcTo(0, 50, Infinity, Infinity, 0); 1.11931 +ctx.arcTo(0, 50, Infinity, Infinity, Infinity); 1.11932 +ctx.arcTo(0, 50, Infinity, 50, Infinity); 1.11933 +ctx.arcTo(0, 50, 0, Infinity, Infinity); 1.11934 +ctx.lineTo(100, 50); 1.11935 +ctx.lineTo(0, 50); 1.11936 +ctx.fillStyle = '#0f0'; 1.11937 +ctx.fill(); 1.11938 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11939 +isPixel(ctx, 90,45, 0,255,0,255, 0); 1.11940 + 1.11941 +} catch (e) { 1.11942 + _thrown_outer = true; 1.11943 +} 1.11944 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.11945 + 1.11946 + 1.11947 +} 1.11948 +</script> 1.11949 + 1.11950 +<!-- [[[ test_2d.path.arcTo.scale.html ]]] --> 1.11951 + 1.11952 +<p>Canvas test: 2d.path.arcTo.scale</p> 1.11953 +<!-- Testing: arcTo scales the curve, not just the control points --> 1.11954 +<canvas id="c367" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11955 +<script> 1.11956 + 1.11957 + 1.11958 +function test_2d_path_arcTo_scale() { 1.11959 + 1.11960 +var canvas = document.getElementById('c367'); 1.11961 +var ctx = canvas.getContext('2d'); 1.11962 + 1.11963 +ctx.fillStyle = '#f00'; 1.11964 +ctx.fillRect(0, 0, 100, 50); 1.11965 + 1.11966 +ctx.fillStyle = '#0f0'; 1.11967 +ctx.beginPath(); 1.11968 +ctx.moveTo(0, 50); 1.11969 +ctx.translate(100, 0); 1.11970 +ctx.scale(0.1, 1); 1.11971 +ctx.arcTo(50, 50, 50, 0, 50); 1.11972 +ctx.lineTo(-1000, 0); 1.11973 +ctx.fill(); 1.11974 + 1.11975 +isPixel(ctx, 0,0, 0,255,0,255, 0); 1.11976 +isPixel(ctx, 50,0, 0,255,0,255, 0); 1.11977 +isPixel(ctx, 99,0, 0,255,0,255, 0); 1.11978 +isPixel(ctx, 0,25, 0,255,0,255, 0); 1.11979 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.11980 +isPixel(ctx, 99,25, 0,255,0,255, 0); 1.11981 +isPixel(ctx, 0,49, 0,255,0,255, 0); 1.11982 +isPixel(ctx, 50,49, 0,255,0,255, 0); 1.11983 +isPixel(ctx, 99,49, 0,255,0,255, 0); 1.11984 + 1.11985 + 1.11986 +} 1.11987 +</script> 1.11988 + 1.11989 +<!-- [[[ test_2d.path.arcTo.shape.curve1.html ]]] --> 1.11990 + 1.11991 +<p>Canvas test: 2d.path.arcTo.shape.curve1</p> 1.11992 +<!-- Testing: arcTo() curves in the right kind of shape --> 1.11993 +<canvas id="c368" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.11994 +<script> 1.11995 + 1.11996 + 1.11997 + 1.11998 +function test_2d_path_arcTo_shape_curve1() { 1.11999 + 1.12000 +var canvas = document.getElementById('c368'); 1.12001 +var ctx = canvas.getContext('2d'); 1.12002 + 1.12003 +var tol = 1.5; // tolerance to avoid antialiasing artifacts 1.12004 + 1.12005 +ctx.fillStyle = '#0f0'; 1.12006 +ctx.fillRect(0, 0, 100, 50); 1.12007 + 1.12008 +ctx.strokeStyle = '#f00'; 1.12009 +ctx.lineWidth = 10; 1.12010 +ctx.beginPath(); 1.12011 +ctx.moveTo(10, 25); 1.12012 +ctx.arcTo(75, 25, 75, 60, 20); 1.12013 +ctx.stroke(); 1.12014 + 1.12015 +ctx.fillStyle = '#0f0'; 1.12016 +ctx.beginPath(); 1.12017 +ctx.rect(10, 20, 45, 10); 1.12018 +ctx.moveTo(80, 45); 1.12019 +ctx.arc(55, 45, 25+tol, 0, -Math.PI/2, true); 1.12020 +ctx.arc(55, 45, 15-tol, -Math.PI/2, 0, false); 1.12021 +ctx.fill(); 1.12022 + 1.12023 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12024 +isPixel(ctx, 55,19, 0,255,0,255, 0); 1.12025 +isPixel(ctx, 55,20, 0,255,0,255, 0); 1.12026 +isPixel(ctx, 55,21, 0,255,0,255, 0); 1.12027 +isPixel(ctx, 64,22, 0,255,0,255, 0); 1.12028 +isPixel(ctx, 65,21, 0,255,0,255, 0); 1.12029 +isPixel(ctx, 72,28, 0,255,0,255, 0); 1.12030 +isPixel(ctx, 73,27, 0,255,0,255, 0); 1.12031 +isPixel(ctx, 78,36, 0,255,0,255, 0); 1.12032 +isPixel(ctx, 79,35, 0,255,0,255, IsAzureSkia() ? 1 : 0); 1.12033 +isPixel(ctx, 80,44, 0,255,0,255, 0); 1.12034 +isPixel(ctx, 80,45, 0,255,0,255, 0); 1.12035 +isPixel(ctx, 80,46, 0,255,0,255, 0); 1.12036 + 1.12037 + 1.12038 +} 1.12039 +</script> 1.12040 + 1.12041 +<!-- [[[ test_2d.path.arcTo.shape.curve2.html ]]] --> 1.12042 + 1.12043 +<p>Canvas test: 2d.path.arcTo.shape.curve2</p> 1.12044 +<!-- Testing: arcTo() curves in the right kind of shape --> 1.12045 +<canvas id="c369" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12046 +<script> 1.12047 + 1.12048 + 1.12049 + 1.12050 +function test_2d_path_arcTo_shape_curve2() { 1.12051 + 1.12052 +var canvas = document.getElementById('c369'); 1.12053 +var ctx = canvas.getContext('2d'); 1.12054 + 1.12055 +var tol = 1.5; // tolerance to avoid antialiasing artifacts 1.12056 + 1.12057 +ctx.fillStyle = '#0f0'; 1.12058 +ctx.fillRect(0, 0, 100, 50); 1.12059 + 1.12060 +ctx.fillStyle = '#f00'; 1.12061 +ctx.beginPath(); 1.12062 +ctx.rect(10, 20, 45, 10); 1.12063 +ctx.moveTo(80, 45); 1.12064 +ctx.arc(55, 45, 25-tol, 0, -Math.PI/2, true); 1.12065 +ctx.arc(55, 45, 15+tol, -Math.PI/2, 0, false); 1.12066 +ctx.fill(); 1.12067 + 1.12068 +ctx.strokeStyle = '#0f0'; 1.12069 +ctx.lineWidth = 10; 1.12070 +ctx.beginPath(); 1.12071 +ctx.moveTo(10, 25); 1.12072 +ctx.arcTo(75, 25, 75, 60, 20); 1.12073 +ctx.stroke(); 1.12074 + 1.12075 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12076 +isPixel(ctx, 55,19, 0,255,0,255, 0); 1.12077 +isPixel(ctx, 55,20, 0,255,0,255, 0); 1.12078 +isPixel(ctx, 55,21, 0,255,0,255, 0); 1.12079 +isPixel(ctx, 64,22, 0,255,0,255, IsAzureSkia() ? 1 : 0); 1.12080 +isPixel(ctx, 65,21, 0,255,0,255, 0); 1.12081 +isPixel(ctx, 72,28, 0,255,0,255, 0); 1.12082 +isPixel(ctx, 73,27, 0,255,0,255, IsAzureSkia() ? 1 : 0); 1.12083 +isPixel(ctx, 78,36, 0,255,0,255, IsAzureSkia() ? 1 : 0); 1.12084 +isPixel(ctx, 79,35, 0,255,0,255, 0); 1.12085 +isPixel(ctx, 80,44, 0,255,0,255, 0); 1.12086 +isPixel(ctx, 80,45, 0,255,0,255, 0); 1.12087 +isPixel(ctx, 80,46, 0,255,0,255, 0); 1.12088 + 1.12089 + 1.12090 +} 1.12091 +</script> 1.12092 + 1.12093 +<!-- [[[ test_2d.path.arcTo.shape.end.html ]]] --> 1.12094 + 1.12095 +<p>Canvas test: 2d.path.arcTo.shape.end</p> 1.12096 +<!-- Testing: arcTo() does not draw anything from P1 to P2 --> 1.12097 +<canvas id="c370" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12098 +<script> 1.12099 + 1.12100 + 1.12101 + 1.12102 +function test_2d_path_arcTo_shape_end() { 1.12103 + 1.12104 +var canvas = document.getElementById('c370'); 1.12105 +var ctx = canvas.getContext('2d'); 1.12106 + 1.12107 +ctx.fillStyle = '#0f0'; 1.12108 +ctx.fillRect(0, 0, 100, 50); 1.12109 +ctx.strokeStyle = '#f00'; 1.12110 +ctx.lineWidth = 50; 1.12111 +ctx.beginPath(); 1.12112 +ctx.moveTo(-100, -100); 1.12113 +ctx.arcTo(-100, 25, 200, 25, 10); 1.12114 +ctx.stroke(); 1.12115 + 1.12116 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.12117 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.12118 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12119 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.12120 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.12121 + 1.12122 + 1.12123 +} 1.12124 +</script> 1.12125 + 1.12126 +<!-- [[[ test_2d.path.arcTo.shape.start.html ]]] --> 1.12127 + 1.12128 +<p>Canvas test: 2d.path.arcTo.shape.start</p> 1.12129 +<!-- Testing: arcTo() draws a straight line from P0 to P1 --> 1.12130 +<canvas id="c371" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12131 +<script> 1.12132 + 1.12133 + 1.12134 + 1.12135 +function test_2d_path_arcTo_shape_start() { 1.12136 + 1.12137 +var canvas = document.getElementById('c371'); 1.12138 +var ctx = canvas.getContext('2d'); 1.12139 + 1.12140 +ctx.fillStyle = '#f00'; 1.12141 +ctx.fillRect(0, 0, 100, 50); 1.12142 +ctx.strokeStyle = '#0f0'; 1.12143 +ctx.lineWidth = 50; 1.12144 +ctx.beginPath(); 1.12145 +ctx.moveTo(0, 25); 1.12146 +ctx.arcTo(200, 25, 200, 50, 10); 1.12147 +ctx.stroke(); 1.12148 + 1.12149 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.12150 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.12151 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12152 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.12153 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.12154 + 1.12155 + 1.12156 +} 1.12157 +</script> 1.12158 + 1.12159 +<!-- [[[ test_2d.path.arcTo.transformation.html ]]] --> 1.12160 + 1.12161 +<p>Canvas test: 2d.path.arcTo.transformation</p> 1.12162 +<!-- Testing: arcTo joins up to the last subpath point correctly --> 1.12163 +<canvas id="c372" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12164 +<script> 1.12165 + 1.12166 + 1.12167 +function test_2d_path_arcTo_transformation() { 1.12168 + 1.12169 +var canvas = document.getElementById('c372'); 1.12170 +var ctx = canvas.getContext('2d'); 1.12171 + 1.12172 +ctx.fillStyle = '#f00'; 1.12173 +ctx.fillRect(0, 0, 100, 50); 1.12174 + 1.12175 +ctx.fillStyle = '#0f0'; 1.12176 +ctx.beginPath(); 1.12177 +ctx.moveTo(0, 50); 1.12178 +ctx.translate(100, 0); 1.12179 +ctx.arcTo(50, 50, 50, 0, 50); 1.12180 +ctx.lineTo(-100, 0); 1.12181 +ctx.fill(); 1.12182 + 1.12183 +isPixel(ctx, 0,0, 0,255,0,255, 0); 1.12184 +isPixel(ctx, 50,0, 0,255,0,255, 0); 1.12185 +isPixel(ctx, 99,0, 0,255,0,255, 0); 1.12186 +isPixel(ctx, 0,25, 0,255,0,255, 0); 1.12187 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12188 +isPixel(ctx, 99,25, 0,255,0,255, 0); 1.12189 +isPixel(ctx, 0,49, 0,255,0,255, 0); 1.12190 +isPixel(ctx, 50,49, 0,255,0,255, 0); 1.12191 +isPixel(ctx, 99,49, 0,255,0,255, 0); 1.12192 + 1.12193 + 1.12194 +} 1.12195 +</script> 1.12196 + 1.12197 +<!-- [[[ test_2d.path.arcTo.zero.1.html ]]] --> 1.12198 + 1.12199 +<p>Canvas test: 2d.path.arcTo.zero.1</p> 1.12200 +<!-- Testing: arcTo() with zero radius draws a straight line from P0 to P1 --> 1.12201 +<canvas id="c373" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12202 +<script> 1.12203 + 1.12204 + 1.12205 +function test_2d_path_arcTo_zero_1() { 1.12206 + 1.12207 +var canvas = document.getElementById('c373'); 1.12208 +var ctx = canvas.getContext('2d'); 1.12209 + 1.12210 +var _thrown_outer = false; 1.12211 +try { 1.12212 + 1.12213 +ctx.fillStyle = '#f00'; 1.12214 +ctx.fillRect(0, 0, 100, 50); 1.12215 +ctx.lineWidth = 50; 1.12216 + 1.12217 +ctx.strokeStyle = '#0f0'; 1.12218 +ctx.beginPath(); 1.12219 +ctx.moveTo(0, 25); 1.12220 +ctx.arcTo(100, 25, 100, 100, 0); 1.12221 +ctx.stroke(); 1.12222 + 1.12223 +ctx.strokeStyle = '#f00'; 1.12224 +ctx.beginPath(); 1.12225 +ctx.moveTo(0, -25); 1.12226 +ctx.arcTo(50, -25, 50, 50, 0); 1.12227 +ctx.stroke(); 1.12228 + 1.12229 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12230 + 1.12231 +} catch (e) { 1.12232 + _thrown_outer = true; 1.12233 +} 1.12234 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.12235 + 1.12236 + 1.12237 +} 1.12238 +</script> 1.12239 + 1.12240 +<!-- [[[ test_2d.path.arcTo.zero.2.html ]]] --> 1.12241 + 1.12242 +<p>Canvas test: 2d.path.arcTo.zero.2</p> 1.12243 +<!-- Testing: arcTo() with zero radius draws a straight line from P0 to P1, even when all points are collinear --> 1.12244 +<canvas id="c374" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12245 +<script> 1.12246 + 1.12247 + 1.12248 +function test_2d_path_arcTo_zero_2() { 1.12249 + 1.12250 +var canvas = document.getElementById('c374'); 1.12251 +var ctx = canvas.getContext('2d'); 1.12252 + 1.12253 +var _thrown_outer = false; 1.12254 +try { 1.12255 + 1.12256 +ctx.fillStyle = '#f00'; 1.12257 +ctx.fillRect(0, 0, 100, 50); 1.12258 +ctx.lineWidth = 50; 1.12259 + 1.12260 +ctx.strokeStyle = '#0f0'; 1.12261 +ctx.beginPath(); 1.12262 +ctx.moveTo(0, 25); 1.12263 +ctx.arcTo(100, 25, -100, 25, 0); 1.12264 +ctx.stroke(); 1.12265 + 1.12266 +ctx.strokeStyle = '#f00'; 1.12267 +ctx.beginPath(); 1.12268 +ctx.moveTo(100, 25); 1.12269 +ctx.arcTo(200, 25, 50, 25, 0); 1.12270 +ctx.stroke(); 1.12271 + 1.12272 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12273 + 1.12274 +} catch (e) { 1.12275 + _thrown_outer = true; 1.12276 +} 1.12277 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.12278 + 1.12279 + 1.12280 +} 1.12281 +</script> 1.12282 + 1.12283 +<!-- [[[ test_2d.path.beginPath.html ]]] --> 1.12284 + 1.12285 +<p>Canvas test: 2d.path.beginPath</p> 1.12286 +<canvas id="c375" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12287 +<script> 1.12288 + 1.12289 + 1.12290 +function test_2d_path_beginPath() { 1.12291 + 1.12292 +var canvas = document.getElementById('c375'); 1.12293 +var ctx = canvas.getContext('2d'); 1.12294 + 1.12295 +ctx.rect(0, 0, 100, 50); 1.12296 +ctx.beginPath(); 1.12297 +ctx.fillStyle = '#f00'; 1.12298 +ctx.fill(); 1.12299 +isPixel(ctx, 50,25, 0,0,0,0, 0); 1.12300 + 1.12301 + 1.12302 +} 1.12303 +</script> 1.12304 + 1.12305 +<!-- [[[ test_2d.path.bezierCurveTo.basic.html ]]] --> 1.12306 + 1.12307 +<p>Canvas test: 2d.path.bezierCurveTo.basic</p> 1.12308 +<canvas id="c376" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12309 +<script> 1.12310 + 1.12311 + 1.12312 +function test_2d_path_bezierCurveTo_basic() { 1.12313 + 1.12314 +var canvas = document.getElementById('c376'); 1.12315 +var ctx = canvas.getContext('2d'); 1.12316 + 1.12317 +ctx.strokeStyle = '#0f0'; 1.12318 +ctx.lineWidth = 50; 1.12319 +ctx.beginPath(); 1.12320 +ctx.moveTo(0, 25); 1.12321 +ctx.bezierCurveTo(100, 25, 100, 25, 100, 25); 1.12322 +ctx.stroke(); 1.12323 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12324 + 1.12325 + 1.12326 +} 1.12327 +</script> 1.12328 + 1.12329 +<!-- [[[ test_2d.path.bezierCurveTo.emptysubpath.html ]]] --> 1.12330 + 1.12331 +<p>Canvas test: 2d.path.bezierCurveTo.emptysubpath</p> 1.12332 +<canvas id="c377" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12333 +<script> 1.12334 + 1.12335 + 1.12336 + 1.12337 +function test_2d_path_bezierCurveTo_emptysubpath() { 1.12338 + 1.12339 +var canvas = document.getElementById('c377'); 1.12340 +var ctx = canvas.getContext('2d'); 1.12341 + 1.12342 +ctx.strokeStyle = '#f00'; 1.12343 +ctx.lineWidth = 50; 1.12344 +ctx.beginPath(); 1.12345 +ctx.bezierCurveTo(0, 25, 0, 25, 0, 25); 1.12346 +ctx.bezierCurveTo(100, 25, 100, 25, 100, 25); 1.12347 +ctx.stroke(); 1.12348 +todo_isPixel(ctx, 50,25, 0,0,0,0, 0); 1.12349 + 1.12350 + 1.12351 +} 1.12352 +</script> 1.12353 + 1.12354 +<!-- [[[ test_2d.path.bezierCurveTo.nonfinite.html ]]] --> 1.12355 + 1.12356 +<p>Canvas test: 2d.path.bezierCurveTo.nonfinite</p> 1.12357 +<!-- Testing: bezierCurveTo() with Infinity/NaN is ignored --> 1.12358 +<canvas id="c378" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12359 +<script> 1.12360 + 1.12361 + 1.12362 +function test_2d_path_bezierCurveTo_nonfinite() { 1.12363 + 1.12364 +var canvas = document.getElementById('c378'); 1.12365 +var ctx = canvas.getContext('2d'); 1.12366 + 1.12367 +var _thrown_outer = false; 1.12368 +try { 1.12369 + 1.12370 +ctx.moveTo(0, 0); 1.12371 +ctx.lineTo(100, 0); 1.12372 +ctx.bezierCurveTo(Infinity, 50, 0, 50, 0, 50); 1.12373 +ctx.bezierCurveTo(-Infinity, 50, 0, 50, 0, 50); 1.12374 +ctx.bezierCurveTo(NaN, 50, 0, 50, 0, 50); 1.12375 +ctx.bezierCurveTo(0, Infinity, 0, 50, 0, 50); 1.12376 +ctx.bezierCurveTo(0, -Infinity, 0, 50, 0, 50); 1.12377 +ctx.bezierCurveTo(0, NaN, 0, 50, 0, 50); 1.12378 +ctx.bezierCurveTo(0, 50, Infinity, 50, 0, 50); 1.12379 +ctx.bezierCurveTo(0, 50, -Infinity, 50, 0, 50); 1.12380 +ctx.bezierCurveTo(0, 50, NaN, 50, 0, 50); 1.12381 +ctx.bezierCurveTo(0, 50, 0, Infinity, 0, 50); 1.12382 +ctx.bezierCurveTo(0, 50, 0, -Infinity, 0, 50); 1.12383 +ctx.bezierCurveTo(0, 50, 0, NaN, 0, 50); 1.12384 +ctx.bezierCurveTo(0, 50, 0, 50, Infinity, 50); 1.12385 +ctx.bezierCurveTo(0, 50, 0, 50, -Infinity, 50); 1.12386 +ctx.bezierCurveTo(0, 50, 0, 50, NaN, 50); 1.12387 +ctx.bezierCurveTo(0, 50, 0, 50, 0, Infinity); 1.12388 +ctx.bezierCurveTo(0, 50, 0, 50, 0, -Infinity); 1.12389 +ctx.bezierCurveTo(0, 50, 0, 50, 0, NaN); 1.12390 +ctx.bezierCurveTo(Infinity, Infinity, 0, 50, 0, 50); 1.12391 +ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, 0, 50); 1.12392 +ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, 0, 50); 1.12393 +ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, Infinity, 50); 1.12394 +ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); 1.12395 +ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, 0, Infinity); 1.12396 +ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, Infinity, 50); 1.12397 +ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, Infinity, Infinity); 1.12398 +ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, 0, Infinity); 1.12399 +ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, 0, 50); 1.12400 +ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, Infinity, 50); 1.12401 +ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, Infinity, Infinity); 1.12402 +ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, 0, Infinity); 1.12403 +ctx.bezierCurveTo(Infinity, Infinity, 0, 50, Infinity, 50); 1.12404 +ctx.bezierCurveTo(Infinity, Infinity, 0, 50, Infinity, Infinity); 1.12405 +ctx.bezierCurveTo(Infinity, Infinity, 0, 50, 0, Infinity); 1.12406 +ctx.bezierCurveTo(Infinity, 50, Infinity, 50, 0, 50); 1.12407 +ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, 0, 50); 1.12408 +ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, Infinity, 50); 1.12409 +ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, Infinity, Infinity); 1.12410 +ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, 0, Infinity); 1.12411 +ctx.bezierCurveTo(Infinity, 50, Infinity, 50, Infinity, 50); 1.12412 +ctx.bezierCurveTo(Infinity, 50, Infinity, 50, Infinity, Infinity); 1.12413 +ctx.bezierCurveTo(Infinity, 50, Infinity, 50, 0, Infinity); 1.12414 +ctx.bezierCurveTo(Infinity, 50, 0, Infinity, 0, 50); 1.12415 +ctx.bezierCurveTo(Infinity, 50, 0, Infinity, Infinity, 50); 1.12416 +ctx.bezierCurveTo(Infinity, 50, 0, Infinity, Infinity, Infinity); 1.12417 +ctx.bezierCurveTo(Infinity, 50, 0, Infinity, 0, Infinity); 1.12418 +ctx.bezierCurveTo(Infinity, 50, 0, 50, Infinity, 50); 1.12419 +ctx.bezierCurveTo(Infinity, 50, 0, 50, Infinity, Infinity); 1.12420 +ctx.bezierCurveTo(Infinity, 50, 0, 50, 0, Infinity); 1.12421 +ctx.bezierCurveTo(0, Infinity, Infinity, 50, 0, 50); 1.12422 +ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, 0, 50); 1.12423 +ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, Infinity, 50); 1.12424 +ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, Infinity, Infinity); 1.12425 +ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, 0, Infinity); 1.12426 +ctx.bezierCurveTo(0, Infinity, Infinity, 50, Infinity, 50); 1.12427 +ctx.bezierCurveTo(0, Infinity, Infinity, 50, Infinity, Infinity); 1.12428 +ctx.bezierCurveTo(0, Infinity, Infinity, 50, 0, Infinity); 1.12429 +ctx.bezierCurveTo(0, Infinity, 0, Infinity, 0, 50); 1.12430 +ctx.bezierCurveTo(0, Infinity, 0, Infinity, Infinity, 50); 1.12431 +ctx.bezierCurveTo(0, Infinity, 0, Infinity, Infinity, Infinity); 1.12432 +ctx.bezierCurveTo(0, Infinity, 0, Infinity, 0, Infinity); 1.12433 +ctx.bezierCurveTo(0, Infinity, 0, 50, Infinity, 50); 1.12434 +ctx.bezierCurveTo(0, Infinity, 0, 50, Infinity, Infinity); 1.12435 +ctx.bezierCurveTo(0, Infinity, 0, 50, 0, Infinity); 1.12436 +ctx.bezierCurveTo(0, 50, Infinity, Infinity, 0, 50); 1.12437 +ctx.bezierCurveTo(0, 50, Infinity, Infinity, Infinity, 50); 1.12438 +ctx.bezierCurveTo(0, 50, Infinity, Infinity, Infinity, Infinity); 1.12439 +ctx.bezierCurveTo(0, 50, Infinity, Infinity, 0, Infinity); 1.12440 +ctx.bezierCurveTo(0, 50, Infinity, 50, Infinity, 50); 1.12441 +ctx.bezierCurveTo(0, 50, Infinity, 50, Infinity, Infinity); 1.12442 +ctx.bezierCurveTo(0, 50, Infinity, 50, 0, Infinity); 1.12443 +ctx.bezierCurveTo(0, 50, 0, Infinity, Infinity, 50); 1.12444 +ctx.bezierCurveTo(0, 50, 0, Infinity, Infinity, Infinity); 1.12445 +ctx.bezierCurveTo(0, 50, 0, Infinity, 0, Infinity); 1.12446 +ctx.bezierCurveTo(0, 50, 0, 50, Infinity, Infinity); 1.12447 +ctx.lineTo(100, 50); 1.12448 +ctx.lineTo(0, 50); 1.12449 +ctx.fillStyle = '#0f0'; 1.12450 +ctx.fill(); 1.12451 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12452 +isPixel(ctx, 90,45, 0,255,0,255, 0); 1.12453 + 1.12454 +} catch (e) { 1.12455 + _thrown_outer = true; 1.12456 +} 1.12457 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.12458 + 1.12459 + 1.12460 +} 1.12461 +</script> 1.12462 + 1.12463 +<!-- [[[ test_2d.path.bezierCurveTo.scaled.html ]]] --> 1.12464 + 1.12465 +<p>Canvas test: 2d.path.bezierCurveTo.scaled</p> 1.12466 +<canvas id="c379" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12467 +<script> 1.12468 + 1.12469 + 1.12470 +function test_2d_path_bezierCurveTo_scaled() { 1.12471 + 1.12472 +var canvas = document.getElementById('c379'); 1.12473 +var ctx = canvas.getContext('2d'); 1.12474 + 1.12475 +ctx.scale(1000, 1000); 1.12476 +ctx.strokeStyle = '#0f0'; 1.12477 +ctx.lineWidth = 0.055; 1.12478 +ctx.beginPath(); 1.12479 +ctx.moveTo(-2, 3.1); 1.12480 +ctx.bezierCurveTo(-2, -1, 2.1, -1, 2.1, 3.1); 1.12481 +ctx.stroke(); 1.12482 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12483 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.12484 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.12485 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.12486 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.12487 + 1.12488 + 1.12489 +} 1.12490 +</script> 1.12491 + 1.12492 +<!-- [[[ test_2d.path.bezierCurveTo.shape.html ]]] --> 1.12493 + 1.12494 +<p>Canvas test: 2d.path.bezierCurveTo.shape</p> 1.12495 +<canvas id="c380" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12496 +<script> 1.12497 + 1.12498 + 1.12499 +function test_2d_path_bezierCurveTo_shape() { 1.12500 + 1.12501 +var canvas = document.getElementById('c380'); 1.12502 +var ctx = canvas.getContext('2d'); 1.12503 + 1.12504 +ctx.strokeStyle = '#0f0'; 1.12505 +ctx.lineWidth = 55; 1.12506 +ctx.beginPath(); 1.12507 +ctx.moveTo(-2000, 3100); 1.12508 +ctx.bezierCurveTo(-2000, -1000, 2100, -1000, 2100, 3100); 1.12509 +ctx.stroke(); 1.12510 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12511 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.12512 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.12513 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.12514 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.12515 + 1.12516 + 1.12517 +} 1.12518 +</script> 1.12519 + 1.12520 +<!-- [[[ test_2d.path.clip.basic.1.html ]]] --> 1.12521 + 1.12522 +<p>Canvas test: 2d.path.clip.basic.1</p> 1.12523 +<canvas id="c381" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12524 +<script> 1.12525 + 1.12526 + 1.12527 +function test_2d_path_clip_basic_1() { 1.12528 + 1.12529 +var canvas = document.getElementById('c381'); 1.12530 +var ctx = canvas.getContext('2d'); 1.12531 + 1.12532 +ctx.fillStyle = '#f00'; 1.12533 +ctx.fillRect(0, 0, 100, 50); 1.12534 + 1.12535 +ctx.beginPath(); 1.12536 +ctx.rect(0, 0, 100, 50); 1.12537 +ctx.clip(); 1.12538 + 1.12539 +ctx.fillStyle = '#0f0'; 1.12540 +ctx.fillRect(0, 0, 100, 50); 1.12541 + 1.12542 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12543 + 1.12544 + 1.12545 +} 1.12546 +</script> 1.12547 + 1.12548 +<!-- [[[ test_2d.path.clip.basic.2.html ]]] --> 1.12549 + 1.12550 +<p>Canvas test: 2d.path.clip.basic.2</p> 1.12551 +<canvas id="c382" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12552 +<script> 1.12553 + 1.12554 + 1.12555 +function test_2d_path_clip_basic_2() { 1.12556 + 1.12557 +var canvas = document.getElementById('c382'); 1.12558 +var ctx = canvas.getContext('2d'); 1.12559 + 1.12560 +ctx.fillStyle = '#0f0'; 1.12561 +ctx.fillRect(0, 0, 100, 50); 1.12562 + 1.12563 +ctx.beginPath(); 1.12564 +ctx.rect(-100, 0, 100, 50); 1.12565 +ctx.clip(); 1.12566 + 1.12567 +ctx.fillStyle = '#f00'; 1.12568 +ctx.fillRect(0, 0, 100, 50); 1.12569 + 1.12570 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12571 + 1.12572 + 1.12573 +} 1.12574 +</script> 1.12575 + 1.12576 +<!-- [[[ test_2d.path.clip.empty.html ]]] --> 1.12577 + 1.12578 +<p>Canvas test: 2d.path.clip.empty</p> 1.12579 +<canvas id="c383" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12580 +<script> 1.12581 + 1.12582 + 1.12583 +function test_2d_path_clip_empty() { 1.12584 + 1.12585 +var canvas = document.getElementById('c383'); 1.12586 +var ctx = canvas.getContext('2d'); 1.12587 + 1.12588 +ctx.fillStyle = '#0f0'; 1.12589 +ctx.fillRect(0, 0, 100, 50); 1.12590 + 1.12591 +ctx.beginPath(); 1.12592 +ctx.clip(); 1.12593 + 1.12594 +ctx.fillStyle = '#f00'; 1.12595 +ctx.fillRect(0, 0, 100, 50); 1.12596 + 1.12597 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12598 + 1.12599 + 1.12600 +} 1.12601 +</script> 1.12602 + 1.12603 +<!-- [[[ test_2d.path.clip.intersect.html ]]] --> 1.12604 + 1.12605 +<p>Canvas test: 2d.path.clip.intersect</p> 1.12606 +<canvas id="c384" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12607 +<script> 1.12608 + 1.12609 + 1.12610 +function test_2d_path_clip_intersect() { 1.12611 + 1.12612 +var canvas = document.getElementById('c384'); 1.12613 +var ctx = canvas.getContext('2d'); 1.12614 + 1.12615 +ctx.fillStyle = '#0f0'; 1.12616 +ctx.fillRect(0, 0, 100, 50); 1.12617 + 1.12618 +ctx.beginPath(); 1.12619 +ctx.rect(0, 0, 50, 50); 1.12620 +ctx.clip(); 1.12621 +ctx.beginPath(); 1.12622 +ctx.rect(50, 0, 50, 50) 1.12623 +ctx.clip(); 1.12624 + 1.12625 +ctx.fillStyle = '#f00'; 1.12626 +ctx.fillRect(0, 0, 100, 50); 1.12627 + 1.12628 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12629 + 1.12630 + 1.12631 +} 1.12632 +</script> 1.12633 + 1.12634 +<!-- [[[ test_2d.path.clip.unaffected.html ]]] --> 1.12635 + 1.12636 +<p>Canvas test: 2d.path.clip.unaffected</p> 1.12637 +<canvas id="c385" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12638 +<script> 1.12639 + 1.12640 + 1.12641 +function test_2d_path_clip_unaffected() { 1.12642 + 1.12643 +var canvas = document.getElementById('c385'); 1.12644 +var ctx = canvas.getContext('2d'); 1.12645 + 1.12646 +ctx.fillStyle = '#f00'; 1.12647 +ctx.fillRect(0, 0, 100, 50); 1.12648 + 1.12649 +ctx.fillStyle = '#0f0'; 1.12650 + 1.12651 +ctx.beginPath(); 1.12652 +ctx.lineTo(0, 0); 1.12653 +ctx.lineTo(0, 50); 1.12654 +ctx.lineTo(100, 50); 1.12655 +ctx.lineTo(100, 0); 1.12656 +ctx.clip(); 1.12657 + 1.12658 +ctx.lineTo(0, 0); 1.12659 +ctx.fill(); 1.12660 + 1.12661 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12662 + 1.12663 + 1.12664 +} 1.12665 +</script> 1.12666 + 1.12667 +<!-- [[[ test_2d.path.clip.winding.1.html ]]] --> 1.12668 + 1.12669 +<p>Canvas test: 2d.path.clip.winding.1</p> 1.12670 +<canvas id="c386" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12671 +<script> 1.12672 + 1.12673 + 1.12674 +function test_2d_path_clip_winding_1() { 1.12675 + 1.12676 +var canvas = document.getElementById('c386'); 1.12677 +var ctx = canvas.getContext('2d'); 1.12678 + 1.12679 +ctx.fillStyle = '#0f0'; 1.12680 +ctx.fillRect(0, 0, 100, 50); 1.12681 + 1.12682 +ctx.beginPath(); 1.12683 +ctx.moveTo(-10, -10); 1.12684 +ctx.lineTo(110, -10); 1.12685 +ctx.lineTo(110, 60); 1.12686 +ctx.lineTo(-10, 60); 1.12687 +ctx.lineTo(-10, -10); 1.12688 +ctx.lineTo(0, 0); 1.12689 +ctx.lineTo(0, 50); 1.12690 +ctx.lineTo(100, 50); 1.12691 +ctx.lineTo(100, 0); 1.12692 +ctx.clip(); 1.12693 + 1.12694 +ctx.fillStyle = '#f00'; 1.12695 +ctx.fillRect(0, 0, 100, 50); 1.12696 + 1.12697 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12698 + 1.12699 + 1.12700 +} 1.12701 +</script> 1.12702 + 1.12703 +<!-- [[[ test_2d.path.clip.winding.2.html ]]] --> 1.12704 + 1.12705 +<p>Canvas test: 2d.path.clip.winding.2</p> 1.12706 +<canvas id="c387" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12707 +<script> 1.12708 + 1.12709 + 1.12710 +function test_2d_path_clip_winding_2() { 1.12711 + 1.12712 +var canvas = document.getElementById('c387'); 1.12713 +var ctx = canvas.getContext('2d'); 1.12714 + 1.12715 +ctx.fillStyle = '#f00'; 1.12716 +ctx.fillRect(0, 0, 100, 50); 1.12717 + 1.12718 +ctx.beginPath(); 1.12719 +ctx.moveTo(-10, -10); 1.12720 +ctx.lineTo(110, -10); 1.12721 +ctx.lineTo(110, 60); 1.12722 +ctx.lineTo(-10, 60); 1.12723 +ctx.lineTo(-10, -10); 1.12724 +ctx.clip(); 1.12725 + 1.12726 +ctx.beginPath(); 1.12727 +ctx.lineTo(0, 0); 1.12728 +ctx.lineTo(0, 50); 1.12729 +ctx.lineTo(100, 50); 1.12730 +ctx.lineTo(100, 0); 1.12731 +ctx.lineTo(0, 0); 1.12732 +ctx.clip(); 1.12733 + 1.12734 +ctx.fillStyle = '#0f0'; 1.12735 +ctx.fillRect(0, 0, 100, 50); 1.12736 + 1.12737 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12738 + 1.12739 + 1.12740 +} 1.12741 +</script> 1.12742 + 1.12743 +<!-- [[[ test_2d.path.closePath.empty.html ]]] --> 1.12744 + 1.12745 +<p>Canvas test: 2d.path.closePath.empty</p> 1.12746 +<canvas id="c388" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12747 +<script> 1.12748 + 1.12749 + 1.12750 +function test_2d_path_closePath_empty() { 1.12751 + 1.12752 +var canvas = document.getElementById('c388'); 1.12753 +var ctx = canvas.getContext('2d'); 1.12754 + 1.12755 +ctx.closePath(); 1.12756 +ctx.fillStyle = '#f00'; 1.12757 +ctx.fill(); 1.12758 +isPixel(ctx, 50,25, 0,0,0,0, 0); 1.12759 + 1.12760 + 1.12761 +} 1.12762 +</script> 1.12763 + 1.12764 +<!-- [[[ test_2d.path.closePath.newline.html ]]] --> 1.12765 + 1.12766 +<p>Canvas test: 2d.path.closePath.newline</p> 1.12767 +<canvas id="c389" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12768 +<script> 1.12769 + 1.12770 + 1.12771 +function test_2d_path_closePath_newline() { 1.12772 + 1.12773 +var canvas = document.getElementById('c389'); 1.12774 +var ctx = canvas.getContext('2d'); 1.12775 + 1.12776 +ctx.strokeStyle = '#0f0'; 1.12777 +ctx.lineWidth = 50; 1.12778 +ctx.moveTo(-100, 25); 1.12779 +ctx.lineTo(-100, -100); 1.12780 +ctx.lineTo(200, -100); 1.12781 +ctx.lineTo(200, 25); 1.12782 +ctx.closePath(); 1.12783 +ctx.stroke(); 1.12784 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12785 + 1.12786 + 1.12787 +} 1.12788 +</script> 1.12789 + 1.12790 +<!-- [[[ test_2d.path.closePath.nextpoint.html ]]] --> 1.12791 + 1.12792 +<p>Canvas test: 2d.path.closePath.nextpoint</p> 1.12793 +<canvas id="c390" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12794 +<script> 1.12795 + 1.12796 + 1.12797 +function test_2d_path_closePath_nextpoint() { 1.12798 + 1.12799 +var canvas = document.getElementById('c390'); 1.12800 +var ctx = canvas.getContext('2d'); 1.12801 + 1.12802 +ctx.strokeStyle = '#0f0'; 1.12803 +ctx.lineWidth = 50; 1.12804 +ctx.moveTo(-100, 25); 1.12805 +ctx.lineTo(-100, -1000); 1.12806 +ctx.closePath(); 1.12807 +ctx.lineTo(1000, 25); 1.12808 +ctx.stroke(); 1.12809 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12810 + 1.12811 + 1.12812 +} 1.12813 +</script> 1.12814 + 1.12815 +<!-- [[[ test_2d.path.fill.closed.basic.html ]]] --> 1.12816 + 1.12817 +<p>Canvas test: 2d.path.fill.closed.basic</p> 1.12818 +<canvas id="c391" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12819 +<script> 1.12820 + 1.12821 + 1.12822 +function test_2d_path_fill_closed_basic() { 1.12823 + 1.12824 +var canvas = document.getElementById('c391'); 1.12825 +var ctx = canvas.getContext('2d'); 1.12826 + 1.12827 +ctx.fillStyle = '#f00'; 1.12828 +ctx.fillRect(0, 0, 100, 50); 1.12829 + 1.12830 +ctx.fillStyle = '#0f0'; 1.12831 +ctx.moveTo(0, 0); 1.12832 +ctx.lineTo(100, 0); 1.12833 +ctx.lineTo(100, 50); 1.12834 +ctx.lineTo(0, 50); 1.12835 +ctx.fill(); 1.12836 + 1.12837 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12838 + 1.12839 + 1.12840 +} 1.12841 +</script> 1.12842 + 1.12843 +<!-- [[[ test_2d.path.fill.closed.unaffected.html ]]] --> 1.12844 + 1.12845 +<p>Canvas test: 2d.path.fill.closed.unaffected</p> 1.12846 +<canvas id="c392" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12847 +<script> 1.12848 + 1.12849 + 1.12850 +function test_2d_path_fill_closed_unaffected() { 1.12851 + 1.12852 +var canvas = document.getElementById('c392'); 1.12853 +var ctx = canvas.getContext('2d'); 1.12854 + 1.12855 +ctx.fillStyle = '#00f'; 1.12856 +ctx.fillRect(0, 0, 100, 50); 1.12857 + 1.12858 +ctx.moveTo(0, 0); 1.12859 +ctx.lineTo(100, 0); 1.12860 +ctx.lineTo(100, 50); 1.12861 +ctx.fillStyle = '#f00'; 1.12862 +ctx.fill(); 1.12863 +ctx.lineTo(0, 50); 1.12864 +ctx.fillStyle = '#0f0'; 1.12865 +ctx.fill(); 1.12866 + 1.12867 +isPixel(ctx, 90,10, 0,255,0,255, 0); 1.12868 +isPixel(ctx, 10,40, 0,255,0,255, 0); 1.12869 + 1.12870 + 1.12871 +} 1.12872 +</script> 1.12873 + 1.12874 +<!-- [[[ test_2d.path.fill.overlap.html ]]] --> 1.12875 + 1.12876 +<p>Canvas test: 2d.path.fill.overlap</p> 1.12877 +<canvas id="c393" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12878 +<script> 1.12879 + 1.12880 + 1.12881 +function test_2d_path_fill_overlap() { 1.12882 + 1.12883 +var canvas = document.getElementById('c393'); 1.12884 +var ctx = canvas.getContext('2d'); 1.12885 + 1.12886 +ctx.fillStyle = '#000'; 1.12887 +ctx.fillRect(0, 0, 100, 50); 1.12888 + 1.12889 +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; 1.12890 +ctx.rect(0, 0, 100, 50); 1.12891 +ctx.closePath(); 1.12892 +ctx.rect(10, 10, 80, 30); 1.12893 +ctx.fill(); 1.12894 + 1.12895 +isPixel(ctx, 50,25, 0,127,0,255, 1); 1.12896 + 1.12897 + 1.12898 +} 1.12899 +</script> 1.12900 + 1.12901 +<!-- [[[ test_2d.path.fill.winding.add.html ]]] --> 1.12902 + 1.12903 +<p>Canvas test: 2d.path.fill.winding.add</p> 1.12904 +<canvas id="c394" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12905 +<script> 1.12906 + 1.12907 + 1.12908 +function test_2d_path_fill_winding_add() { 1.12909 + 1.12910 +var canvas = document.getElementById('c394'); 1.12911 +var ctx = canvas.getContext('2d'); 1.12912 + 1.12913 +ctx.fillStyle = '#f00'; 1.12914 +ctx.fillRect(0, 0, 100, 50); 1.12915 + 1.12916 +ctx.fillStyle = '#0f0'; 1.12917 +ctx.moveTo(-10, -10); 1.12918 +ctx.lineTo(110, -10); 1.12919 +ctx.lineTo(110, 60); 1.12920 +ctx.lineTo(-10, 60); 1.12921 +ctx.lineTo(-10, -10); 1.12922 +ctx.lineTo(0, 0); 1.12923 +ctx.lineTo(100, 0); 1.12924 +ctx.lineTo(100, 50); 1.12925 +ctx.lineTo(0, 50); 1.12926 +ctx.fill(); 1.12927 + 1.12928 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12929 + 1.12930 + 1.12931 +} 1.12932 +</script> 1.12933 + 1.12934 +<!-- [[[ test_2d.path.fill.winding.subtract.1.html ]]] --> 1.12935 + 1.12936 +<p>Canvas test: 2d.path.fill.winding.subtract.1</p> 1.12937 +<canvas id="c395" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12938 +<script> 1.12939 + 1.12940 + 1.12941 +function test_2d_path_fill_winding_subtract_1() { 1.12942 + 1.12943 +var canvas = document.getElementById('c395'); 1.12944 +var ctx = canvas.getContext('2d'); 1.12945 + 1.12946 +ctx.fillStyle = '#0f0'; 1.12947 +ctx.fillRect(0, 0, 100, 50); 1.12948 + 1.12949 +ctx.fillStyle = '#f00'; 1.12950 +ctx.moveTo(-10, -10); 1.12951 +ctx.lineTo(110, -10); 1.12952 +ctx.lineTo(110, 60); 1.12953 +ctx.lineTo(-10, 60); 1.12954 +ctx.lineTo(-10, -10); 1.12955 +ctx.lineTo(0, 0); 1.12956 +ctx.lineTo(0, 50); 1.12957 +ctx.lineTo(100, 50); 1.12958 +ctx.lineTo(100, 0); 1.12959 +ctx.fill(); 1.12960 + 1.12961 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12962 + 1.12963 + 1.12964 +} 1.12965 +</script> 1.12966 + 1.12967 +<!-- [[[ test_2d.path.fill.winding.subtract.2.html ]]] --> 1.12968 + 1.12969 +<p>Canvas test: 2d.path.fill.winding.subtract.2</p> 1.12970 +<canvas id="c396" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.12971 +<script> 1.12972 + 1.12973 + 1.12974 +function test_2d_path_fill_winding_subtract_2() { 1.12975 + 1.12976 +var canvas = document.getElementById('c396'); 1.12977 +var ctx = canvas.getContext('2d'); 1.12978 + 1.12979 +ctx.fillStyle = '#0f0'; 1.12980 +ctx.fillRect(0, 0, 100, 50); 1.12981 + 1.12982 +ctx.fillStyle = '#f00'; 1.12983 +ctx.moveTo(-10, -10); 1.12984 +ctx.lineTo(110, -10); 1.12985 +ctx.lineTo(110, 60); 1.12986 +ctx.lineTo(-10, 60); 1.12987 +ctx.moveTo(0, 0); 1.12988 +ctx.lineTo(0, 50); 1.12989 +ctx.lineTo(100, 50); 1.12990 +ctx.lineTo(100, 0); 1.12991 +ctx.fill(); 1.12992 + 1.12993 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.12994 + 1.12995 + 1.12996 +} 1.12997 +</script> 1.12998 + 1.12999 +<!-- [[[ test_2d.path.fill.winding.subtract.3.html ]]] --> 1.13000 + 1.13001 +<p>Canvas test: 2d.path.fill.winding.subtract.3</p> 1.13002 +<canvas id="c397" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13003 +<script> 1.13004 + 1.13005 + 1.13006 +function test_2d_path_fill_winding_subtract_3() { 1.13007 + 1.13008 +var canvas = document.getElementById('c397'); 1.13009 +var ctx = canvas.getContext('2d'); 1.13010 + 1.13011 +ctx.fillStyle = '#f00'; 1.13012 +ctx.fillRect(0, 0, 100, 50); 1.13013 + 1.13014 +ctx.fillStyle = '#0f0'; 1.13015 +ctx.moveTo(-10, -10); 1.13016 +ctx.lineTo(110, -10); 1.13017 +ctx.lineTo(110, 60); 1.13018 +ctx.lineTo(-10, 60); 1.13019 +ctx.lineTo(-10, -10); 1.13020 +ctx.lineTo(-20, -20); 1.13021 +ctx.lineTo(120, -20); 1.13022 +ctx.lineTo(120, 70); 1.13023 +ctx.lineTo(-20, 70); 1.13024 +ctx.lineTo(-20, -20); 1.13025 +ctx.lineTo(0, 0); 1.13026 +ctx.lineTo(0, 50); 1.13027 +ctx.lineTo(100, 50); 1.13028 +ctx.lineTo(100, 0); 1.13029 +ctx.fill(); 1.13030 + 1.13031 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.13032 + 1.13033 + 1.13034 +} 1.13035 +</script> 1.13036 + 1.13037 +<!-- [[[ test_2d.path.initial.html ]]] --> 1.13038 + 1.13039 +<p>Canvas test: 2d.path.initial</p> 1.13040 +<canvas id="c398" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13041 +<script> 1.13042 + 1.13043 + 1.13044 + 1.13045 +function test_2d_path_initial() { 1.13046 + 1.13047 +var canvas = document.getElementById('c398'); 1.13048 +var ctx = canvas.getContext('2d'); 1.13049 + 1.13050 +ctx.lineTo(0, 0); 1.13051 +ctx.lineTo(100, 0); 1.13052 +ctx.lineTo(100, 50); 1.13053 +ctx.lineTo(0, 50); 1.13054 +ctx.closePath(); 1.13055 +ctx.fillStyle = '#f00'; 1.13056 +ctx.fill(); 1.13057 +todo_isPixel(ctx, 50,25, 0,0,0,0, 0); 1.13058 + 1.13059 + 1.13060 +} 1.13061 +</script> 1.13062 + 1.13063 +<!-- [[[ test_2d.path.isPointInPath.arc.html ]]] --> 1.13064 + 1.13065 +<p>Canvas test: 2d.path.isPointInPath.arc</p> 1.13066 +<!-- Testing: isPointInPath() works on arcs --> 1.13067 +<canvas id="c399" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13068 +<script> 1.13069 + 1.13070 +function test_2d_path_isPointInPath_arc() { 1.13071 + 1.13072 +var canvas = document.getElementById('c399'); 1.13073 +var ctx = canvas.getContext('2d'); 1.13074 + 1.13075 +ctx.arc(50, 25, 10, 0, Math.PI, false); 1.13076 +ok(ctx.isPointInPath(50, 10) === false, "ctx.isPointInPath(50, 10) === false"); 1.13077 +ok(ctx.isPointInPath(50, 20) === false, "ctx.isPointInPath(50, 20) === false"); 1.13078 +ok(ctx.isPointInPath(50, 30) === true, "ctx.isPointInPath(50, 30) === true"); 1.13079 +ok(ctx.isPointInPath(50, 40) === false, "ctx.isPointInPath(50, 40) === false"); 1.13080 +ok(ctx.isPointInPath(30, 20) === false, "ctx.isPointInPath(30, 20) === false"); 1.13081 +ok(ctx.isPointInPath(70, 20) === false, "ctx.isPointInPath(70, 20) === false"); 1.13082 +ok(ctx.isPointInPath(30, 30) === false, "ctx.isPointInPath(30, 30) === false"); 1.13083 +ok(ctx.isPointInPath(70, 30) === false, "ctx.isPointInPath(70, 30) === false"); 1.13084 + 1.13085 + 1.13086 +} 1.13087 +</script> 1.13088 + 1.13089 +<!-- [[[ test_2d.path.isPointInPath.basic.1.html ]]] --> 1.13090 + 1.13091 +<p>Canvas test: 2d.path.isPointInPath.basic.1</p> 1.13092 +<!-- Testing: isPointInPath() detects whether the point is inside the path --> 1.13093 +<canvas id="c400" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13094 +<script> 1.13095 + 1.13096 +function test_2d_path_isPointInPath_basic_1() { 1.13097 + 1.13098 +var canvas = document.getElementById('c400'); 1.13099 +var ctx = canvas.getContext('2d'); 1.13100 + 1.13101 +ctx.rect(0, 0, 20, 20); 1.13102 +ok(ctx.isPointInPath(10, 10) === true, "ctx.isPointInPath(10, 10) === true"); 1.13103 +ok(ctx.isPointInPath(30, 10) === false, "ctx.isPointInPath(30, 10) === false"); 1.13104 + 1.13105 + 1.13106 +} 1.13107 +</script> 1.13108 + 1.13109 +<!-- [[[ test_2d.path.isPointInPath.basic.2.html ]]] --> 1.13110 + 1.13111 +<p>Canvas test: 2d.path.isPointInPath.basic.2</p> 1.13112 +<!-- Testing: isPointInPath() detects whether the point is inside the path --> 1.13113 +<canvas id="c401" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13114 +<script> 1.13115 + 1.13116 +function test_2d_path_isPointInPath_basic_2() { 1.13117 + 1.13118 +var canvas = document.getElementById('c401'); 1.13119 +var ctx = canvas.getContext('2d'); 1.13120 + 1.13121 +ctx.rect(20, 0, 20, 20); 1.13122 +ok(ctx.isPointInPath(10, 10) === false, "ctx.isPointInPath(10, 10) === false"); 1.13123 +ok(ctx.isPointInPath(30, 10) === true, "ctx.isPointInPath(30, 10) === true"); 1.13124 + 1.13125 + 1.13126 +} 1.13127 +</script> 1.13128 + 1.13129 +<!-- [[[ test_2d.path.isPointInPath.bezier.html ]]] --> 1.13130 + 1.13131 +<p>Canvas test: 2d.path.isPointInPath.bezier</p> 1.13132 +<!-- Testing: isPointInPath() works on Bezier curves --> 1.13133 +<canvas id="c402" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13134 +<script> 1.13135 + 1.13136 +function test_2d_path_isPointInPath_bezier() { 1.13137 + 1.13138 +var canvas = document.getElementById('c402'); 1.13139 +var ctx = canvas.getContext('2d'); 1.13140 + 1.13141 +ctx.moveTo(25, 25); 1.13142 +ctx.bezierCurveTo(50, -50, 50, 100, 75, 25); 1.13143 +ok(ctx.isPointInPath(25, 20) == false, "ctx.isPointInPath(25, 20) == false"); 1.13144 +ok(ctx.isPointInPath(25, 30) == false, "ctx.isPointInPath(25, 30) == false"); 1.13145 +ok(ctx.isPointInPath(30, 20) == true, "ctx.isPointInPath(30, 20) == true"); 1.13146 +ok(ctx.isPointInPath(30, 30) == false, "ctx.isPointInPath(30, 30) == false"); 1.13147 +ok(ctx.isPointInPath(40, 2) == false, "ctx.isPointInPath(40, 2) == false"); 1.13148 +ok(ctx.isPointInPath(40, 20) == true, "ctx.isPointInPath(40, 20) == true"); 1.13149 +ok(ctx.isPointInPath(40, 30) == false, "ctx.isPointInPath(40, 30) == false"); 1.13150 +ok(ctx.isPointInPath(40, 47) == false, "ctx.isPointInPath(40, 47) == false"); 1.13151 +ok(ctx.isPointInPath(45, 20) == true, "ctx.isPointInPath(45, 20) == true"); 1.13152 +ok(ctx.isPointInPath(45, 30) == false, "ctx.isPointInPath(45, 30) == false"); 1.13153 +ok(ctx.isPointInPath(55, 20) == false, "ctx.isPointInPath(55, 20) == false"); 1.13154 +ok(ctx.isPointInPath(55, 30) == true, "ctx.isPointInPath(55, 30) == true"); 1.13155 +ok(ctx.isPointInPath(60, 2) == false, "ctx.isPointInPath(60, 2) == false"); 1.13156 +ok(ctx.isPointInPath(60, 20) == false, "ctx.isPointInPath(60, 20) == false"); 1.13157 +ok(ctx.isPointInPath(60, 30) == true, "ctx.isPointInPath(60, 30) == true"); 1.13158 +ok(ctx.isPointInPath(60, 47) == false, "ctx.isPointInPath(60, 47) == false"); 1.13159 +ok(ctx.isPointInPath(70, 20) == false, "ctx.isPointInPath(70, 20) == false"); 1.13160 +ok(ctx.isPointInPath(70, 30) == true, "ctx.isPointInPath(70, 30) == true"); 1.13161 +ok(ctx.isPointInPath(75, 20) == false, "ctx.isPointInPath(75, 20) == false"); 1.13162 +ok(ctx.isPointInPath(75, 30) == false, "ctx.isPointInPath(75, 30) == false"); 1.13163 + 1.13164 + 1.13165 +} 1.13166 +</script> 1.13167 + 1.13168 +<!-- [[[ test_2d.path.isPointInPath.bigarc.html ]]] --> 1.13169 + 1.13170 +<p>Canvas test: 2d.path.isPointInPath.bigarc</p> 1.13171 +<!-- Testing: isPointInPath() works on unclosed arcs larger than 2pi --> 1.13172 +<canvas id="c403" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13173 +<script> 1.13174 + 1.13175 +function test_2d_path_isPointInPath_bigarc() { 1.13176 + 1.13177 +var canvas = document.getElementById('c403'); 1.13178 +var ctx = canvas.getContext('2d'); 1.13179 + 1.13180 +ctx.arc(50, 25, 10, 0, 7, false); 1.13181 +ok(ctx.isPointInPath(50, 10) === false, "ctx.isPointInPath(50, 10) === false"); 1.13182 +ok(ctx.isPointInPath(50, 20) === true, "ctx.isPointInPath(50, 20) === true"); 1.13183 +ok(ctx.isPointInPath(50, 30) === true, "ctx.isPointInPath(50, 30) === true"); 1.13184 +ok(ctx.isPointInPath(50, 40) === false, "ctx.isPointInPath(50, 40) === false"); 1.13185 +ok(ctx.isPointInPath(30, 20) === false, "ctx.isPointInPath(30, 20) === false"); 1.13186 +ok(ctx.isPointInPath(70, 20) === false, "ctx.isPointInPath(70, 20) === false"); 1.13187 +ok(ctx.isPointInPath(30, 30) === false, "ctx.isPointInPath(30, 30) === false"); 1.13188 +ok(ctx.isPointInPath(70, 30) === false, "ctx.isPointInPath(70, 30) === false"); 1.13189 + 1.13190 + 1.13191 +} 1.13192 +</script> 1.13193 + 1.13194 +<!-- [[[ test_2d.path.isPointInPath.edge.html ]]] --> 1.13195 + 1.13196 +<p>Canvas test: 2d.path.isPointInPath.edge</p> 1.13197 +<!-- Testing: isPointInPath() counts points on the path as being inside --> 1.13198 +<canvas id="c404" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13199 +<script> 1.13200 + 1.13201 +function test_2d_path_isPointInPath_edge() { 1.13202 + 1.13203 +var canvas = document.getElementById('c404'); 1.13204 +var ctx = canvas.getContext('2d'); 1.13205 + 1.13206 +ctx.rect(0, 0, 20, 20); 1.13207 + 1.13208 +ok(ctx.isPointInPath(0, 0) === true, "ctx.isPointInPath(0, 0) === true"); 1.13209 +ok(ctx.isPointInPath(10, 0) === true, "ctx.isPointInPath(10, 0) === true"); 1.13210 +ok(ctx.isPointInPath(20, 0) === true, "ctx.isPointInPath(20, 0) === true"); 1.13211 +ok(ctx.isPointInPath(20, 10) === true, "ctx.isPointInPath(20, 10) === true"); 1.13212 +ok(ctx.isPointInPath(20, 20) === true, "ctx.isPointInPath(20, 20) === true"); 1.13213 +ok(ctx.isPointInPath(10, 20) === true, "ctx.isPointInPath(10, 20) === true"); 1.13214 +ok(ctx.isPointInPath(0, 20) === true, "ctx.isPointInPath(0, 20) === true"); 1.13215 +ok(ctx.isPointInPath(0, 10) === true, "ctx.isPointInPath(0, 10) === true"); 1.13216 +ok(ctx.isPointInPath(10, -0.01) === false, "ctx.isPointInPath(10, -0.01) === false"); 1.13217 +ok(ctx.isPointInPath(10, 20.01) === false, "ctx.isPointInPath(10, 20.01) === false"); 1.13218 +ok(ctx.isPointInPath(-0.01, 10) === false, "ctx.isPointInPath(-0.01, 10) === false"); 1.13219 +ok(ctx.isPointInPath(20.01, 10) === false, "ctx.isPointInPath(20.01, 10) === false"); 1.13220 + 1.13221 +} 1.13222 +</script> 1.13223 + 1.13224 +<!-- [[[ test_2d.path.isPointInPath.empty.html ]]] --> 1.13225 + 1.13226 +<p>Canvas test: 2d.path.isPointInPath.empty</p> 1.13227 +<!-- Testing: isPointInPath() works when there is no path --> 1.13228 +<canvas id="c405" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13229 +<script> 1.13230 + 1.13231 +function test_2d_path_isPointInPath_empty() { 1.13232 + 1.13233 +var canvas = document.getElementById('c405'); 1.13234 +var ctx = canvas.getContext('2d'); 1.13235 + 1.13236 +ok(ctx.isPointInPath(0, 0) === false, "ctx.isPointInPath(0, 0) === false"); 1.13237 + 1.13238 + 1.13239 +} 1.13240 +</script> 1.13241 + 1.13242 +<!-- [[[ test_2d.path.isPointInPath.nonfinite.html ]]] --> 1.13243 + 1.13244 +<p>Canvas test: 2d.path.isPointInPath.nonfinite</p> 1.13245 +<!-- Testing: isPointInPath() returns false for non-finite arguments --> 1.13246 +<canvas id="c406" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13247 +<script> 1.13248 + 1.13249 +function test_2d_path_isPointInPath_nonfinite() { 1.13250 + 1.13251 +var canvas = document.getElementById('c406'); 1.13252 +var ctx = canvas.getContext('2d'); 1.13253 + 1.13254 +var _thrown_outer = false; 1.13255 +try { 1.13256 + 1.13257 +ctx.rect(-100, -50, 200, 100); 1.13258 +ok(ctx.isPointInPath(Infinity, 0) === false, "ctx.isPointInPath(Infinity, 0) === false"); 1.13259 +ok(ctx.isPointInPath(-Infinity, 0) === false, "ctx.isPointInPath(-Infinity, 0) === false"); 1.13260 +ok(ctx.isPointInPath(NaN, 0) === false, "ctx.isPointInPath(NaN, 0) === false"); 1.13261 +ok(ctx.isPointInPath(0, Infinity) === false, "ctx.isPointInPath(0, Infinity) === false"); 1.13262 +ok(ctx.isPointInPath(0, -Infinity) === false, "ctx.isPointInPath(0, -Infinity) === false"); 1.13263 +ok(ctx.isPointInPath(0, NaN) === false, "ctx.isPointInPath(0, NaN) === false"); 1.13264 +ok(ctx.isPointInPath(NaN, NaN) === false, "ctx.isPointInPath(NaN, NaN) === false"); 1.13265 + 1.13266 +} catch (e) { 1.13267 + _thrown_outer = true; 1.13268 +} 1.13269 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.13270 + 1.13271 + 1.13272 +} 1.13273 +</script> 1.13274 + 1.13275 +<!-- [[[ test_2d.path.isPointInPath.outside.html ]]] --> 1.13276 + 1.13277 +<p>Canvas test: 2d.path.isPointInPath.outside</p> 1.13278 +<!-- Testing: isPointInPath() works on paths outside the canvas --> 1.13279 +<canvas id="c407" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13280 +<script> 1.13281 + 1.13282 +function test_2d_path_isPointInPath_outside() { 1.13283 + 1.13284 +var canvas = document.getElementById('c407'); 1.13285 +var ctx = canvas.getContext('2d'); 1.13286 + 1.13287 +ctx.rect(0, -100, 20, 20); 1.13288 +ctx.rect(20, -10, 20, 20); 1.13289 +ok(ctx.isPointInPath(10, -110) === false, "ctx.isPointInPath(10, -110) === false"); 1.13290 +ok(ctx.isPointInPath(10, -90) === true, "ctx.isPointInPath(10, -90) === true"); 1.13291 +ok(ctx.isPointInPath(10, -70) === false, "ctx.isPointInPath(10, -70) === false"); 1.13292 +ok(ctx.isPointInPath(30, -20) === false, "ctx.isPointInPath(30, -20) === false"); 1.13293 +ok(ctx.isPointInPath(30, 0) === true, "ctx.isPointInPath(30, 0) === true"); 1.13294 +ok(ctx.isPointInPath(30, 20) === false, "ctx.isPointInPath(30, 20) === false"); 1.13295 + 1.13296 + 1.13297 +} 1.13298 +</script> 1.13299 + 1.13300 +<!-- [[[ test_2d.path.isPointInPath.subpath.html ]]] --> 1.13301 + 1.13302 +<p>Canvas test: 2d.path.isPointInPath.subpath</p> 1.13303 +<!-- Testing: isPointInPath() uses the current path, not just the subpath --> 1.13304 +<canvas id="c408" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13305 +<script> 1.13306 + 1.13307 +function test_2d_path_isPointInPath_subpath() { 1.13308 + 1.13309 +var canvas = document.getElementById('c408'); 1.13310 +var ctx = canvas.getContext('2d'); 1.13311 + 1.13312 +ctx.rect(0, 0, 20, 20); 1.13313 +ctx.beginPath(); 1.13314 +ctx.rect(20, 0, 20, 20); 1.13315 +ctx.closePath(); 1.13316 +ctx.rect(40, 0, 20, 20); 1.13317 +ok(ctx.isPointInPath(10, 10) === false, "ctx.isPointInPath(10, 10) === false"); 1.13318 +ok(ctx.isPointInPath(30, 10) === true, "ctx.isPointInPath(30, 10) === true"); 1.13319 +ok(ctx.isPointInPath(50, 10) === true, "ctx.isPointInPath(50, 10) === true"); 1.13320 + 1.13321 + 1.13322 +} 1.13323 +</script> 1.13324 + 1.13325 +<!-- [[[ test_2d.path.isPointInPath.transform.1.html ]]] --> 1.13326 + 1.13327 +<p>Canvas test: 2d.path.isPointInPath.transform.1 - bug 405300</p> 1.13328 +<!-- Testing: isPointInPath() handles transformations correctly --> 1.13329 +<canvas id="c409" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13330 +<script> 1.13331 + 1.13332 +function test_2d_path_isPointInPath_transform_1() { 1.13333 + 1.13334 +var canvas = document.getElementById('c409'); 1.13335 +var ctx = canvas.getContext('2d'); 1.13336 + 1.13337 +ctx.translate(50, 0); 1.13338 +ctx.rect(0, 0, 20, 20); 1.13339 +ok(ctx.isPointInPath(-40, 10) === false, "ctx.isPointInPath(-40, 10) === false"); 1.13340 +ok(ctx.isPointInPath(10, 10) === false, "ctx.isPointInPath(10, 10) === false"); 1.13341 +ok(ctx.isPointInPath(49, 10) === false, "ctx.isPointInPath(49, 10) === false"); 1.13342 +ok(ctx.isPointInPath(51, 10) === true, "ctx.isPointInPath(51, 10) === true"); 1.13343 +ok(ctx.isPointInPath(69, 10) === true, "ctx.isPointInPath(69, 10) === true"); 1.13344 +ok(ctx.isPointInPath(71, 10) === false, "ctx.isPointInPath(71, 10) === false"); 1.13345 + 1.13346 + 1.13347 +} 1.13348 +</script> 1.13349 + 1.13350 +<!-- [[[ test_2d.path.isPointInPath.transform.2.html ]]] --> 1.13351 + 1.13352 +<p>Canvas test: 2d.path.isPointInPath.transform.2 - bug 405300</p> 1.13353 +<!-- Testing: isPointInPath() handles transformations correctly --> 1.13354 +<canvas id="c410" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13355 +<script> 1.13356 + 1.13357 +function test_2d_path_isPointInPath_transform_2() { 1.13358 + 1.13359 +var canvas = document.getElementById('c410'); 1.13360 +var ctx = canvas.getContext('2d'); 1.13361 + 1.13362 +ctx.rect(50, 0, 20, 20); 1.13363 +ctx.translate(50, 0); 1.13364 +ok(ctx.isPointInPath(-40, 10) === false, "ctx.isPointInPath(-40, 10) === false"); 1.13365 +ok(ctx.isPointInPath(10, 10) === false, "ctx.isPointInPath(10, 10) === false"); 1.13366 +ok(ctx.isPointInPath(49, 10) === false, "ctx.isPointInPath(49, 10) === false"); 1.13367 +ok(ctx.isPointInPath(51, 10) === true, "ctx.isPointInPath(51, 10) === true"); 1.13368 +ok(ctx.isPointInPath(69, 10) === true, "ctx.isPointInPath(69, 10) === true"); 1.13369 +ok(ctx.isPointInPath(71, 10) === false, "ctx.isPointInPath(71, 10) === false"); 1.13370 + 1.13371 + 1.13372 +} 1.13373 +</script> 1.13374 + 1.13375 +<!-- [[[ test_2d.path.isPointInPath.transform.3.html ]]] --> 1.13376 + 1.13377 +<p>Canvas test: 2d.path.isPointInPath.transform.3 - bug 405300</p> 1.13378 +<!-- Testing: isPointInPath() handles transformations correctly --> 1.13379 +<canvas id="c411" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13380 +<script> 1.13381 + 1.13382 +function test_2d_path_isPointInPath_transform_3() { 1.13383 + 1.13384 +var canvas = document.getElementById('c411'); 1.13385 +var ctx = canvas.getContext('2d'); 1.13386 + 1.13387 +ctx.scale(-1, 1); 1.13388 +ctx.rect(-70, 0, 20, 20); 1.13389 +ok(ctx.isPointInPath(-40, 10) === false, "ctx.isPointInPath(-40, 10) === false"); 1.13390 +ok(ctx.isPointInPath(10, 10) === false, "ctx.isPointInPath(10, 10) === false"); 1.13391 +ok(ctx.isPointInPath(49, 10) === false, "ctx.isPointInPath(49, 10) === false"); 1.13392 +ok(ctx.isPointInPath(51, 10) === true, "ctx.isPointInPath(51, 10) === true"); 1.13393 +ok(ctx.isPointInPath(69, 10) === true, "ctx.isPointInPath(69, 10) === true"); 1.13394 +ok(ctx.isPointInPath(71, 10) === false, "ctx.isPointInPath(71, 10) === false"); 1.13395 + 1.13396 + 1.13397 +} 1.13398 +</script> 1.13399 + 1.13400 +<!-- [[[ test_2d.path.isPointInPath.unclosed.html ]]] --> 1.13401 + 1.13402 +<p>Canvas test: 2d.path.isPointInPath.unclosed</p> 1.13403 +<!-- Testing: isPointInPath() works on unclosed subpaths --> 1.13404 +<canvas id="c412" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13405 +<script> 1.13406 + 1.13407 +function test_2d_path_isPointInPath_unclosed() { 1.13408 + 1.13409 +var canvas = document.getElementById('c412'); 1.13410 +var ctx = canvas.getContext('2d'); 1.13411 + 1.13412 +ctx.moveTo(0, 0); 1.13413 +ctx.lineTo(20, 0); 1.13414 +ctx.lineTo(20, 20); 1.13415 +ctx.lineTo(0, 20); 1.13416 +ok(ctx.isPointInPath(10, 10) === true, "ctx.isPointInPath(10, 10) === true"); 1.13417 +ok(ctx.isPointInPath(30, 10) === false, "ctx.isPointInPath(30, 10) === false"); 1.13418 + 1.13419 + 1.13420 +} 1.13421 +</script> 1.13422 + 1.13423 +<!-- [[[ test_2d.path.isPointInPath.winding.html ]]] --> 1.13424 + 1.13425 +<p>Canvas test: 2d.path.isPointInPath.winding</p> 1.13426 +<!-- Testing: isPointInPath() uses the non-zero winding number rule --> 1.13427 +<canvas id="c413" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13428 +<script> 1.13429 + 1.13430 +function test_2d_path_isPointInPath_winding() { 1.13431 + 1.13432 +var canvas = document.getElementById('c413'); 1.13433 +var ctx = canvas.getContext('2d'); 1.13434 + 1.13435 +// Create a square ring, using opposite windings to make a hole in the centre 1.13436 +ctx.moveTo(0, 0); 1.13437 +ctx.lineTo(50, 0); 1.13438 +ctx.lineTo(50, 50); 1.13439 +ctx.lineTo(0, 50); 1.13440 +ctx.lineTo(0, 0); 1.13441 +ctx.lineTo(10, 10); 1.13442 +ctx.lineTo(10, 40); 1.13443 +ctx.lineTo(40, 40); 1.13444 +ctx.lineTo(40, 10); 1.13445 +ctx.lineTo(10, 10); 1.13446 + 1.13447 +ok(ctx.isPointInPath(5, 5) === true, "ctx.isPointInPath(5, 5) === true"); 1.13448 +ok(ctx.isPointInPath(25, 5) === true, "ctx.isPointInPath(25, 5) === true"); 1.13449 +ok(ctx.isPointInPath(45, 5) === true, "ctx.isPointInPath(45, 5) === true"); 1.13450 +ok(ctx.isPointInPath(5, 25) === true, "ctx.isPointInPath(5, 25) === true"); 1.13451 +ok(ctx.isPointInPath(25, 25) === false, "ctx.isPointInPath(25, 25) === false"); 1.13452 +ok(ctx.isPointInPath(45, 25) === true, "ctx.isPointInPath(45, 25) === true"); 1.13453 +ok(ctx.isPointInPath(5, 45) === true, "ctx.isPointInPath(5, 45) === true"); 1.13454 +ok(ctx.isPointInPath(25, 45) === true, "ctx.isPointInPath(25, 45) === true"); 1.13455 +ok(ctx.isPointInPath(45, 45) === true, "ctx.isPointInPath(45, 45) === true"); 1.13456 + 1.13457 + 1.13458 +} 1.13459 +</script> 1.13460 + 1.13461 +<!-- [[[ test_2d.path.lineTo.basic.html ]]] --> 1.13462 + 1.13463 +<p>Canvas test: 2d.path.lineTo.basic</p> 1.13464 +<canvas id="c414" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13465 +<script> 1.13466 + 1.13467 + 1.13468 +function test_2d_path_lineTo_basic() { 1.13469 + 1.13470 +var canvas = document.getElementById('c414'); 1.13471 +var ctx = canvas.getContext('2d'); 1.13472 + 1.13473 +ctx.strokeStyle = '#0f0'; 1.13474 +ctx.lineWidth = 50; 1.13475 +ctx.beginPath(); 1.13476 +ctx.moveTo(0, 25); 1.13477 +ctx.lineTo(100, 25); 1.13478 +ctx.stroke(); 1.13479 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.13480 + 1.13481 + 1.13482 +} 1.13483 +</script> 1.13484 + 1.13485 +<!-- [[[ test_2d.path.lineTo.emptysubpath.html ]]] --> 1.13486 + 1.13487 +<p>Canvas test: 2d.path.lineTo.emptysubpath</p> 1.13488 +<canvas id="c415" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13489 +<script> 1.13490 + 1.13491 + 1.13492 + 1.13493 +function test_2d_path_lineTo_emptysubpath() { 1.13494 + 1.13495 +var canvas = document.getElementById('c415'); 1.13496 +var ctx = canvas.getContext('2d'); 1.13497 + 1.13498 +ctx.strokeStyle = '#f00'; 1.13499 +ctx.lineWidth = 50; 1.13500 +ctx.beginPath(); 1.13501 +ctx.lineTo(0, 25); 1.13502 +ctx.lineTo(100, 25); 1.13503 +ctx.stroke(); 1.13504 +todo_isPixel(ctx, 50,25, 0,0,0,0, 0); 1.13505 + 1.13506 + 1.13507 +} 1.13508 +</script> 1.13509 + 1.13510 +<!-- [[[ test_2d.path.lineTo.nextpoint.html ]]] --> 1.13511 + 1.13512 +<p>Canvas test: 2d.path.lineTo.nextpoint</p> 1.13513 +<canvas id="c416" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13514 +<script> 1.13515 + 1.13516 + 1.13517 +function test_2d_path_lineTo_nextpoint() { 1.13518 + 1.13519 +var canvas = document.getElementById('c416'); 1.13520 +var ctx = canvas.getContext('2d'); 1.13521 + 1.13522 +ctx.strokeStyle = '#0f0'; 1.13523 +ctx.lineWidth = 50; 1.13524 +ctx.beginPath(); 1.13525 +ctx.moveTo(-100, -100); 1.13526 +ctx.lineTo(0, 25); 1.13527 +ctx.lineTo(100, 25); 1.13528 +ctx.stroke(); 1.13529 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.13530 + 1.13531 + 1.13532 +} 1.13533 +</script> 1.13534 + 1.13535 +<!-- [[[ test_2d.path.lineTo.nonfinite.html ]]] --> 1.13536 + 1.13537 +<p>Canvas test: 2d.path.lineTo.nonfinite</p> 1.13538 +<!-- Testing: lineTo() with Infinity/NaN is ignored --> 1.13539 +<canvas id="c417" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13540 +<script> 1.13541 + 1.13542 + 1.13543 +function test_2d_path_lineTo_nonfinite() { 1.13544 + 1.13545 +var canvas = document.getElementById('c417'); 1.13546 +var ctx = canvas.getContext('2d'); 1.13547 + 1.13548 +var _thrown_outer = false; 1.13549 +try { 1.13550 + 1.13551 +ctx.moveTo(0, 0); 1.13552 +ctx.lineTo(100, 0); 1.13553 +ctx.lineTo(Infinity, 50); 1.13554 +ctx.lineTo(-Infinity, 50); 1.13555 +ctx.lineTo(NaN, 50); 1.13556 +ctx.lineTo(0, Infinity); 1.13557 +ctx.lineTo(0, -Infinity); 1.13558 +ctx.lineTo(0, NaN); 1.13559 +ctx.lineTo(Infinity, Infinity); 1.13560 +ctx.lineTo(100, 50); 1.13561 +ctx.lineTo(0, 50); 1.13562 +ctx.fillStyle = '#0f0'; 1.13563 +ctx.fill(); 1.13564 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.13565 +isPixel(ctx, 90,45, 0,255,0,255, 0); 1.13566 + 1.13567 +} catch (e) { 1.13568 + _thrown_outer = true; 1.13569 +} 1.13570 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.13571 + 1.13572 + 1.13573 +} 1.13574 +</script> 1.13575 + 1.13576 +<!-- [[[ test_2d.path.moveTo.basic.html ]]] --> 1.13577 + 1.13578 +<p>Canvas test: 2d.path.moveTo.basic</p> 1.13579 +<canvas id="c418" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13580 +<script> 1.13581 + 1.13582 + 1.13583 +function test_2d_path_moveTo_basic() { 1.13584 + 1.13585 +var canvas = document.getElementById('c418'); 1.13586 +var ctx = canvas.getContext('2d'); 1.13587 + 1.13588 +ctx.rect(0, 0, 10, 50); 1.13589 +ctx.moveTo(100, 0); 1.13590 +ctx.lineTo(10, 0); 1.13591 +ctx.lineTo(10, 50); 1.13592 +ctx.lineTo(100, 50); 1.13593 +ctx.fillStyle = '#0f0'; 1.13594 +ctx.fill(); 1.13595 +isPixel(ctx, 90,25, 0,255,0,255, 0); 1.13596 + 1.13597 + 1.13598 +} 1.13599 +</script> 1.13600 + 1.13601 +<!-- [[[ test_2d.path.moveTo.multiple.html ]]] --> 1.13602 + 1.13603 +<p>Canvas test: 2d.path.moveTo.multiple</p> 1.13604 +<canvas id="c419" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13605 +<script> 1.13606 + 1.13607 + 1.13608 +function test_2d_path_moveTo_multiple() { 1.13609 + 1.13610 +var canvas = document.getElementById('c419'); 1.13611 +var ctx = canvas.getContext('2d'); 1.13612 + 1.13613 +ctx.moveTo(0, 25); 1.13614 +ctx.moveTo(100, 25); 1.13615 +ctx.moveTo(0, 25); 1.13616 +ctx.lineTo(100, 25); 1.13617 +ctx.strokeStyle = '#0f0'; 1.13618 +ctx.lineWidth = 50; 1.13619 +ctx.stroke(); 1.13620 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.13621 + 1.13622 + 1.13623 +} 1.13624 +</script> 1.13625 + 1.13626 +<!-- [[[ test_2d.path.moveTo.newsubpath.html ]]] --> 1.13627 + 1.13628 +<p>Canvas test: 2d.path.moveTo.newsubpath</p> 1.13629 +<canvas id="c420" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13630 +<script> 1.13631 + 1.13632 + 1.13633 +function test_2d_path_moveTo_newsubpath() { 1.13634 + 1.13635 +var canvas = document.getElementById('c420'); 1.13636 +var ctx = canvas.getContext('2d'); 1.13637 + 1.13638 +ctx.beginPath(); 1.13639 +ctx.moveTo(0, 0); 1.13640 +ctx.moveTo(100, 0); 1.13641 +ctx.moveTo(100, 50); 1.13642 +ctx.moveTo(0, 50); 1.13643 +ctx.fillStyle = '#f00'; 1.13644 +ctx.fill(); 1.13645 +isPixel(ctx, 50,25, 0,0,0,0, 0); 1.13646 + 1.13647 + 1.13648 +} 1.13649 +</script> 1.13650 + 1.13651 +<!-- [[[ test_2d.path.moveTo.nonfinite.html ]]] --> 1.13652 + 1.13653 +<p>Canvas test: 2d.path.moveTo.nonfinite</p> 1.13654 +<!-- Testing: moveTo() with Infinity/NaN is ignored --> 1.13655 +<canvas id="c421" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13656 +<script> 1.13657 + 1.13658 + 1.13659 +function test_2d_path_moveTo_nonfinite() { 1.13660 + 1.13661 +var canvas = document.getElementById('c421'); 1.13662 +var ctx = canvas.getContext('2d'); 1.13663 + 1.13664 +var _thrown_outer = false; 1.13665 +try { 1.13666 + 1.13667 +ctx.moveTo(0, 0); 1.13668 +ctx.lineTo(100, 0); 1.13669 +ctx.moveTo(Infinity, 50); 1.13670 +ctx.moveTo(-Infinity, 50); 1.13671 +ctx.moveTo(NaN, 50); 1.13672 +ctx.moveTo(0, Infinity); 1.13673 +ctx.moveTo(0, -Infinity); 1.13674 +ctx.moveTo(0, NaN); 1.13675 +ctx.moveTo(Infinity, Infinity); 1.13676 +ctx.lineTo(100, 50); 1.13677 +ctx.lineTo(0, 50); 1.13678 +ctx.fillStyle = '#0f0'; 1.13679 +ctx.fill(); 1.13680 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.13681 + 1.13682 +} catch (e) { 1.13683 + _thrown_outer = true; 1.13684 +} 1.13685 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.13686 + 1.13687 + 1.13688 +} 1.13689 +</script> 1.13690 + 1.13691 +<!-- [[[ test_2d.path.quadraticCurveTo.basic.html ]]] --> 1.13692 + 1.13693 +<p>Canvas test: 2d.path.quadraticCurveTo.basic</p> 1.13694 +<canvas id="c422" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13695 +<script> 1.13696 + 1.13697 + 1.13698 +function test_2d_path_quadraticCurveTo_basic() { 1.13699 + 1.13700 +var canvas = document.getElementById('c422'); 1.13701 +var ctx = canvas.getContext('2d'); 1.13702 + 1.13703 +ctx.strokeStyle = '#0f0'; 1.13704 +ctx.lineWidth = 50; 1.13705 +ctx.beginPath(); 1.13706 +ctx.moveTo(0, 25); 1.13707 +ctx.quadraticCurveTo(100, 25, 100, 25); 1.13708 +ctx.stroke(); 1.13709 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.13710 + 1.13711 + 1.13712 +} 1.13713 +</script> 1.13714 + 1.13715 +<!-- [[[ test_2d.path.quadraticCurveTo.emptysubpath.html ]]] --> 1.13716 + 1.13717 +<p>Canvas test: 2d.path.quadraticCurveTo.emptysubpath</p> 1.13718 +<canvas id="c423" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13719 +<script> 1.13720 + 1.13721 + 1.13722 + 1.13723 +function test_2d_path_quadraticCurveTo_emptysubpath() { 1.13724 + 1.13725 +var canvas = document.getElementById('c423'); 1.13726 +var ctx = canvas.getContext('2d'); 1.13727 + 1.13728 +ctx.strokeStyle = '#f00'; 1.13729 +ctx.lineWidth = 50; 1.13730 +ctx.beginPath(); 1.13731 +ctx.quadraticCurveTo(0, 25, 0, 25); 1.13732 +ctx.quadraticCurveTo(100, 25, 100, 25); 1.13733 +ctx.stroke(); 1.13734 +todo_isPixel(ctx, 50,25, 0,0,0,0, 0); 1.13735 + 1.13736 + 1.13737 +} 1.13738 +</script> 1.13739 + 1.13740 +<!-- [[[ test_2d.path.quadraticCurveTo.nonfinite.html ]]] --> 1.13741 + 1.13742 +<p>Canvas test: 2d.path.quadraticCurveTo.nonfinite</p> 1.13743 +<!-- Testing: quadraticCurveTo() with Infinity/NaN is ignored --> 1.13744 +<canvas id="c424" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13745 +<script> 1.13746 + 1.13747 + 1.13748 +function test_2d_path_quadraticCurveTo_nonfinite() { 1.13749 + 1.13750 +var canvas = document.getElementById('c424'); 1.13751 +var ctx = canvas.getContext('2d'); 1.13752 + 1.13753 +var _thrown_outer = false; 1.13754 +try { 1.13755 + 1.13756 +ctx.moveTo(0, 0); 1.13757 +ctx.lineTo(100, 0); 1.13758 +ctx.quadraticCurveTo(Infinity, 50, 0, 50); 1.13759 +ctx.quadraticCurveTo(-Infinity, 50, 0, 50); 1.13760 +ctx.quadraticCurveTo(NaN, 50, 0, 50); 1.13761 +ctx.quadraticCurveTo(0, Infinity, 0, 50); 1.13762 +ctx.quadraticCurveTo(0, -Infinity, 0, 50); 1.13763 +ctx.quadraticCurveTo(0, NaN, 0, 50); 1.13764 +ctx.quadraticCurveTo(0, 50, Infinity, 50); 1.13765 +ctx.quadraticCurveTo(0, 50, -Infinity, 50); 1.13766 +ctx.quadraticCurveTo(0, 50, NaN, 50); 1.13767 +ctx.quadraticCurveTo(0, 50, 0, Infinity); 1.13768 +ctx.quadraticCurveTo(0, 50, 0, -Infinity); 1.13769 +ctx.quadraticCurveTo(0, 50, 0, NaN); 1.13770 +ctx.quadraticCurveTo(Infinity, Infinity, 0, 50); 1.13771 +ctx.quadraticCurveTo(Infinity, Infinity, Infinity, 50); 1.13772 +ctx.quadraticCurveTo(Infinity, Infinity, Infinity, Infinity); 1.13773 +ctx.quadraticCurveTo(Infinity, Infinity, 0, Infinity); 1.13774 +ctx.quadraticCurveTo(Infinity, 50, Infinity, 50); 1.13775 +ctx.quadraticCurveTo(Infinity, 50, Infinity, Infinity); 1.13776 +ctx.quadraticCurveTo(Infinity, 50, 0, Infinity); 1.13777 +ctx.quadraticCurveTo(0, Infinity, Infinity, 50); 1.13778 +ctx.quadraticCurveTo(0, Infinity, Infinity, Infinity); 1.13779 +ctx.quadraticCurveTo(0, Infinity, 0, Infinity); 1.13780 +ctx.quadraticCurveTo(0, 50, Infinity, Infinity); 1.13781 +ctx.lineTo(100, 50); 1.13782 +ctx.lineTo(0, 50); 1.13783 +ctx.fillStyle = '#0f0'; 1.13784 +ctx.fill(); 1.13785 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.13786 +isPixel(ctx, 90,45, 0,255,0,255, 0); 1.13787 + 1.13788 +} catch (e) { 1.13789 + _thrown_outer = true; 1.13790 +} 1.13791 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.13792 + 1.13793 + 1.13794 +} 1.13795 +</script> 1.13796 + 1.13797 +<!-- [[[ test_2d.path.quadraticCurveTo.scaled.html ]]] --> 1.13798 + 1.13799 +<p>Canvas test: 2d.path.quadraticCurveTo.scaled</p> 1.13800 +<canvas id="c425" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13801 +<script> 1.13802 + 1.13803 + 1.13804 +function test_2d_path_quadraticCurveTo_scaled() { 1.13805 + 1.13806 +var canvas = document.getElementById('c425'); 1.13807 +var ctx = canvas.getContext('2d'); 1.13808 + 1.13809 +ctx.scale(1000, 1000); 1.13810 +ctx.strokeStyle = '#0f0'; 1.13811 +ctx.lineWidth = 0.055; 1.13812 +ctx.beginPath(); 1.13813 +ctx.moveTo(-1, 1.05); 1.13814 +ctx.quadraticCurveTo(0, -1, 1.2, 1.05); 1.13815 +ctx.stroke(); 1.13816 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.13817 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.13818 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.13819 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.13820 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.13821 + 1.13822 + 1.13823 +} 1.13824 +</script> 1.13825 + 1.13826 +<!-- [[[ test_2d.path.quadraticCurveTo.shape.html ]]] --> 1.13827 + 1.13828 +<p>Canvas test: 2d.path.quadraticCurveTo.shape</p> 1.13829 +<canvas id="c426" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13830 +<script> 1.13831 + 1.13832 + 1.13833 +function test_2d_path_quadraticCurveTo_shape() { 1.13834 + 1.13835 +var canvas = document.getElementById('c426'); 1.13836 +var ctx = canvas.getContext('2d'); 1.13837 + 1.13838 +ctx.strokeStyle = '#0f0'; 1.13839 +ctx.lineWidth = 55; 1.13840 +ctx.beginPath(); 1.13841 +ctx.moveTo(-1000, 1050); 1.13842 +ctx.quadraticCurveTo(0, -1000, 1200, 1050); 1.13843 +ctx.stroke(); 1.13844 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.13845 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.13846 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.13847 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.13848 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.13849 + 1.13850 + 1.13851 +} 1.13852 +</script> 1.13853 + 1.13854 +<!-- [[[ test_2d.path.rect.basic.html ]]] --> 1.13855 + 1.13856 +<p>Canvas test: 2d.path.rect.basic</p> 1.13857 +<canvas id="c427" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13858 +<script> 1.13859 + 1.13860 + 1.13861 +function test_2d_path_rect_basic() { 1.13862 + 1.13863 +var canvas = document.getElementById('c427'); 1.13864 +var ctx = canvas.getContext('2d'); 1.13865 + 1.13866 +ctx.fillStyle = '#0f0'; 1.13867 +ctx.rect(0, 0, 100, 50); 1.13868 +ctx.fill(); 1.13869 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.13870 + 1.13871 + 1.13872 +} 1.13873 +</script> 1.13874 + 1.13875 +<!-- [[[ test_2d.path.rect.closed.html ]]] --> 1.13876 + 1.13877 +<p>Canvas test: 2d.path.rect.closed</p> 1.13878 +<canvas id="c428" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13879 +<script> 1.13880 + 1.13881 + 1.13882 +function test_2d_path_rect_closed() { 1.13883 + 1.13884 +var canvas = document.getElementById('c428'); 1.13885 +var ctx = canvas.getContext('2d'); 1.13886 + 1.13887 +ctx.strokeStyle = '#0f0'; 1.13888 +ctx.lineWidth = 200; 1.13889 +ctx.lineJoin = 'miter'; 1.13890 +ctx.rect(100, 50, 100, 100); 1.13891 +ctx.stroke(); 1.13892 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.13893 + 1.13894 + 1.13895 +} 1.13896 +</script> 1.13897 + 1.13898 +<!-- [[[ test_2d.path.rect.end.1.html ]]] --> 1.13899 + 1.13900 +<p>Canvas test: 2d.path.rect.end.1</p> 1.13901 +<canvas id="c429" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13902 +<script> 1.13903 + 1.13904 + 1.13905 +function test_2d_path_rect_end_1() { 1.13906 + 1.13907 +var canvas = document.getElementById('c429'); 1.13908 +var ctx = canvas.getContext('2d'); 1.13909 + 1.13910 +ctx.strokeStyle = '#0f0'; 1.13911 +ctx.lineWidth = 100; 1.13912 +ctx.rect(200, 100, 400, 1000); 1.13913 +ctx.lineTo(-2000, -1000); 1.13914 +ctx.stroke(); 1.13915 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.13916 + 1.13917 + 1.13918 +} 1.13919 +</script> 1.13920 + 1.13921 +<!-- [[[ test_2d.path.rect.end.2.html ]]] --> 1.13922 + 1.13923 +<p>Canvas test: 2d.path.rect.end.2</p> 1.13924 +<canvas id="c430" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13925 +<script> 1.13926 + 1.13927 + 1.13928 +function test_2d_path_rect_end_2() { 1.13929 + 1.13930 +var canvas = document.getElementById('c430'); 1.13931 +var ctx = canvas.getContext('2d'); 1.13932 + 1.13933 +ctx.strokeStyle = '#0f0'; 1.13934 +ctx.lineWidth = 450; 1.13935 +ctx.lineCap = 'round'; 1.13936 +ctx.lineJoin = 'bevel'; 1.13937 +ctx.rect(150, 150, 2000, 2000); 1.13938 +ctx.lineTo(160, 160); 1.13939 +ctx.stroke(); 1.13940 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.13941 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.13942 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.13943 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.13944 + 1.13945 + 1.13946 +} 1.13947 +</script> 1.13948 + 1.13949 +<!-- [[[ test_2d.path.rect.negative.html ]]] --> 1.13950 + 1.13951 +<p>Canvas test: 2d.path.rect.negative</p> 1.13952 +<canvas id="c431" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13953 +<script> 1.13954 + 1.13955 + 1.13956 +function test_2d_path_rect_negative() { 1.13957 + 1.13958 +var canvas = document.getElementById('c431'); 1.13959 +var ctx = canvas.getContext('2d'); 1.13960 + 1.13961 +ctx.fillStyle = '#f00'; 1.13962 +ctx.fillRect(0, 0, 100, 50); 1.13963 +ctx.beginPath(); 1.13964 +ctx.fillStyle = '#0f0'; 1.13965 +ctx.rect(0, 0, 50, 25); 1.13966 +ctx.rect(100, 0, -50, 25); 1.13967 +ctx.rect(0, 50, 50, -25); 1.13968 +ctx.rect(100, 50, -50, -25); 1.13969 +ctx.fill(); 1.13970 +isPixel(ctx, 25,12, 0,255,0,255, 0); 1.13971 +isPixel(ctx, 75,12, 0,255,0,255, 0); 1.13972 +isPixel(ctx, 25,37, 0,255,0,255, 0); 1.13973 +isPixel(ctx, 75,37, 0,255,0,255, 0); 1.13974 + 1.13975 + 1.13976 +} 1.13977 +</script> 1.13978 + 1.13979 +<!-- [[[ test_2d.path.rect.newsubpath.html ]]] --> 1.13980 + 1.13981 +<p>Canvas test: 2d.path.rect.newsubpath</p> 1.13982 +<canvas id="c432" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.13983 +<script> 1.13984 + 1.13985 + 1.13986 +function test_2d_path_rect_newsubpath() { 1.13987 + 1.13988 +var canvas = document.getElementById('c432'); 1.13989 +var ctx = canvas.getContext('2d'); 1.13990 + 1.13991 +ctx.beginPath(); 1.13992 +ctx.strokeStyle = '#f00'; 1.13993 +ctx.lineWidth = 50; 1.13994 +ctx.moveTo(-100, 25); 1.13995 +ctx.lineTo(-50, 25); 1.13996 +ctx.rect(200, 25, 1, 1); 1.13997 +ctx.stroke(); 1.13998 +isPixel(ctx, 50,25, 0,0,0,0, 0); 1.13999 + 1.14000 + 1.14001 +} 1.14002 +</script> 1.14003 + 1.14004 +<!-- [[[ test_2d.path.rect.nonfinite.html ]]] --> 1.14005 + 1.14006 +<p>Canvas test: 2d.path.rect.nonfinite</p> 1.14007 +<!-- Testing: rect() with Infinity/NaN is ignored --> 1.14008 +<canvas id="c433" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14009 +<script> 1.14010 + 1.14011 + 1.14012 +function test_2d_path_rect_nonfinite() { 1.14013 + 1.14014 +var canvas = document.getElementById('c433'); 1.14015 +var ctx = canvas.getContext('2d'); 1.14016 + 1.14017 +var _thrown_outer = false; 1.14018 +try { 1.14019 + 1.14020 +ctx.moveTo(0, 0); 1.14021 +ctx.lineTo(100, 0); 1.14022 +ctx.rect(Infinity, 50, 1, 1); 1.14023 +ctx.rect(-Infinity, 50, 1, 1); 1.14024 +ctx.rect(NaN, 50, 1, 1); 1.14025 +ctx.rect(0, Infinity, 1, 1); 1.14026 +ctx.rect(0, -Infinity, 1, 1); 1.14027 +ctx.rect(0, NaN, 1, 1); 1.14028 +ctx.rect(0, 50, Infinity, 1); 1.14029 +ctx.rect(0, 50, -Infinity, 1); 1.14030 +ctx.rect(0, 50, NaN, 1); 1.14031 +ctx.rect(0, 50, 1, Infinity); 1.14032 +ctx.rect(0, 50, 1, -Infinity); 1.14033 +ctx.rect(0, 50, 1, NaN); 1.14034 +ctx.rect(Infinity, Infinity, 1, 1); 1.14035 +ctx.rect(Infinity, Infinity, Infinity, 1); 1.14036 +ctx.rect(Infinity, Infinity, Infinity, Infinity); 1.14037 +ctx.rect(Infinity, Infinity, 1, Infinity); 1.14038 +ctx.rect(Infinity, 50, Infinity, 1); 1.14039 +ctx.rect(Infinity, 50, Infinity, Infinity); 1.14040 +ctx.rect(Infinity, 50, 1, Infinity); 1.14041 +ctx.rect(0, Infinity, Infinity, 1); 1.14042 +ctx.rect(0, Infinity, Infinity, Infinity); 1.14043 +ctx.rect(0, Infinity, 1, Infinity); 1.14044 +ctx.rect(0, 50, Infinity, Infinity); 1.14045 +ctx.lineTo(100, 50); 1.14046 +ctx.lineTo(0, 50); 1.14047 +ctx.fillStyle = '#0f0'; 1.14048 +ctx.fill(); 1.14049 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14050 +isPixel(ctx, 90,45, 0,255,0,255, 0); 1.14051 + 1.14052 +} catch (e) { 1.14053 + _thrown_outer = true; 1.14054 +} 1.14055 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.14056 + 1.14057 + 1.14058 +} 1.14059 +</script> 1.14060 + 1.14061 +<!-- [[[ test_2d.path.rect.selfintersect.html ]]] --> 1.14062 + 1.14063 +<p>Canvas test: 2d.path.rect.selfintersect</p> 1.14064 +<canvas id="c434" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14065 +<script> 1.14066 + 1.14067 + 1.14068 + 1.14069 +function test_2d_path_rect_selfintersect() { 1.14070 + 1.14071 +var canvas = document.getElementById('c434'); 1.14072 +var ctx = canvas.getContext('2d'); 1.14073 + 1.14074 +ctx.strokeStyle = '#0f0'; 1.14075 +ctx.lineWidth = 90; 1.14076 +ctx.beginPath(); 1.14077 +ctx.rect(45, 20, 10, 10); 1.14078 +ctx.stroke(); 1.14079 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14080 + 1.14081 + 1.14082 +} 1.14083 +</script> 1.14084 + 1.14085 +<!-- [[[ test_2d.path.rect.winding.html ]]] --> 1.14086 + 1.14087 +<p>Canvas test: 2d.path.rect.winding</p> 1.14088 +<canvas id="c435" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14089 +<script> 1.14090 + 1.14091 + 1.14092 +function test_2d_path_rect_winding() { 1.14093 + 1.14094 +var canvas = document.getElementById('c435'); 1.14095 +var ctx = canvas.getContext('2d'); 1.14096 + 1.14097 +ctx.fillStyle = '#0f0'; 1.14098 +ctx.fillRect(0, 0, 100, 50); 1.14099 +ctx.beginPath(); 1.14100 +ctx.fillStyle = '#f00'; 1.14101 +ctx.rect(0, 0, 50, 50); 1.14102 +ctx.rect(100, 50, -50, -50); 1.14103 +ctx.rect(0, 25, 100, -25); 1.14104 +ctx.rect(100, 25, -100, 25); 1.14105 +ctx.fill(); 1.14106 +isPixel(ctx, 25,12, 0,255,0,255, 0); 1.14107 +isPixel(ctx, 75,12, 0,255,0,255, 0); 1.14108 +isPixel(ctx, 25,37, 0,255,0,255, 0); 1.14109 +isPixel(ctx, 75,37, 0,255,0,255, 0); 1.14110 + 1.14111 + 1.14112 +} 1.14113 +</script> 1.14114 + 1.14115 +<!-- [[[ test_2d.path.rect.zero.1.html ]]] --> 1.14116 + 1.14117 +<p>Canvas test: 2d.path.rect.zero.1</p> 1.14118 +<canvas id="c436" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14119 +<script> 1.14120 + 1.14121 + 1.14122 +function test_2d_path_rect_zero_1() { 1.14123 + 1.14124 +var canvas = document.getElementById('c436'); 1.14125 +var ctx = canvas.getContext('2d'); 1.14126 + 1.14127 +ctx.strokeStyle = '#0f0'; 1.14128 +ctx.lineWidth = 100; 1.14129 +ctx.beginPath(); 1.14130 +ctx.rect(0, 50, 100, 0); 1.14131 +ctx.stroke(); 1.14132 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14133 + 1.14134 + 1.14135 +} 1.14136 +</script> 1.14137 + 1.14138 +<!-- [[[ test_2d.path.rect.zero.2.html ]]] --> 1.14139 + 1.14140 +<p>Canvas test: 2d.path.rect.zero.2</p> 1.14141 +<canvas id="c437" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14142 +<script> 1.14143 + 1.14144 + 1.14145 +function test_2d_path_rect_zero_2() { 1.14146 + 1.14147 +var canvas = document.getElementById('c437'); 1.14148 +var ctx = canvas.getContext('2d'); 1.14149 + 1.14150 +ctx.strokeStyle = '#0f0'; 1.14151 +ctx.lineWidth = 100; 1.14152 +ctx.beginPath(); 1.14153 +ctx.rect(50, -100, 0, 250); 1.14154 +ctx.stroke(); 1.14155 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14156 + 1.14157 + 1.14158 +} 1.14159 +</script> 1.14160 + 1.14161 +<!-- [[[ test_2d.path.rect.zero.3.html ]]] --> 1.14162 + 1.14163 +<p>Canvas test: 2d.path.rect.zero.3</p> 1.14164 +<canvas id="c438" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14165 +<script> 1.14166 + 1.14167 + 1.14168 +function test_2d_path_rect_zero_3() { 1.14169 + 1.14170 +var canvas = document.getElementById('c438'); 1.14171 +var ctx = canvas.getContext('2d'); 1.14172 + 1.14173 +if (!IsD2DEnabled()) { 1.14174 + // Disabled for D2D until we can figure out Bug 587554. 1.14175 + ctx.strokeStyle = '#f00'; 1.14176 + ctx.lineWidth = 100; 1.14177 + ctx.beginPath(); 1.14178 + ctx.rect(50, 25, 0, 0); 1.14179 + ctx.stroke(); 1.14180 + isPixel(ctx, 50,25, 0,0,0,0, 0); 1.14181 +} 1.14182 + 1.14183 +} 1.14184 +</script> 1.14185 + 1.14186 +<!-- [[[ test_2d.path.rect.zero.4.html ]]] --> 1.14187 + 1.14188 +<p>Canvas test: 2d.path.rect.zero.4</p> 1.14189 +<canvas id="c439" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14190 +<script> 1.14191 + 1.14192 + 1.14193 +function test_2d_path_rect_zero_4() { 1.14194 + 1.14195 +var canvas = document.getElementById('c439'); 1.14196 +var ctx = canvas.getContext('2d'); 1.14197 + 1.14198 +ctx.strokeStyle = '#0f0'; 1.14199 +ctx.lineWidth = 50; 1.14200 +ctx.rect(100, 25, 0, 0); 1.14201 +ctx.lineTo(0, 25); 1.14202 +ctx.stroke(); 1.14203 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14204 + 1.14205 + 1.14206 +} 1.14207 +</script> 1.14208 + 1.14209 +<!-- [[[ test_2d.path.rect.zero.5.html ]]] --> 1.14210 + 1.14211 +<p>Canvas test: 2d.path.rect.zero.5</p> 1.14212 +<canvas id="c440" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14213 +<script> 1.14214 + 1.14215 + 1.14216 +function test_2d_path_rect_zero_5() { 1.14217 + 1.14218 +var canvas = document.getElementById('c440'); 1.14219 +var ctx = canvas.getContext('2d'); 1.14220 + 1.14221 +ctx.strokeStyle = '#f00'; 1.14222 +ctx.lineWidth = 50; 1.14223 +ctx.moveTo(0, 0); 1.14224 +ctx.rect(100, 25, 0, 0); 1.14225 +ctx.stroke(); 1.14226 +isPixel(ctx, 50,25, 0,0,0,0, 0); 1.14227 + 1.14228 + 1.14229 +} 1.14230 +</script> 1.14231 + 1.14232 +<!-- [[[ test_2d.path.rect.zero.6.html ]]] --> 1.14233 + 1.14234 +<p>Canvas test: 2d.path.rect.zero.6</p> 1.14235 +<canvas id="c441" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14236 +<script> 1.14237 + 1.14238 + 1.14239 + 1.14240 +function test_2d_path_rect_zero_6() { 1.14241 + 1.14242 +var canvas = document.getElementById('c441'); 1.14243 +var ctx = canvas.getContext('2d'); 1.14244 + 1.14245 +ctx.strokeStyle = '#f00'; 1.14246 +ctx.lineJoin = 'miter'; 1.14247 +ctx.miterLimit = 1.5; 1.14248 +ctx.lineWidth = 200; 1.14249 +ctx.beginPath(); 1.14250 +ctx.rect(100, 25, 1000, 0); 1.14251 +ctx.stroke(); 1.14252 +todo_isPixel(ctx, 50,25, 0,0,0,0, 0); 1.14253 + 1.14254 + 1.14255 +} 1.14256 +</script> 1.14257 + 1.14258 +<!-- [[[ test_2d.path.stroke.empty.html ]]] --> 1.14259 + 1.14260 +<p>Canvas test: 2d.path.stroke.empty</p> 1.14261 +<!-- Testing: Empty subpaths are not stroked --> 1.14262 +<canvas id="c442" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14263 +<script> 1.14264 + 1.14265 + 1.14266 +function test_2d_path_stroke_empty() { 1.14267 + 1.14268 +var canvas = document.getElementById('c442'); 1.14269 +var ctx = canvas.getContext('2d'); 1.14270 + 1.14271 +ctx.fillStyle = '#0f0'; 1.14272 +ctx.fillRect(0, 0, 100, 50); 1.14273 + 1.14274 +ctx.strokeStyle = '#f00'; 1.14275 +ctx.lineWidth = 100; 1.14276 +ctx.lineCap = 'round'; 1.14277 +ctx.lineJoin = 'round'; 1.14278 + 1.14279 +ctx.beginPath(); 1.14280 +ctx.moveTo(40, 25); 1.14281 +ctx.moveTo(60, 25); 1.14282 +ctx.stroke(); 1.14283 + 1.14284 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14285 + 1.14286 + 1.14287 +} 1.14288 +</script> 1.14289 + 1.14290 +<!-- [[[ test_2d.path.stroke.overlap.html ]]] --> 1.14291 + 1.14292 +<p>Canvas test: 2d.path.stroke.overlap</p> 1.14293 +<!-- Testing: Stroked subpaths are combined before being drawn --> 1.14294 +<canvas id="c443" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14295 +<script> 1.14296 + 1.14297 + 1.14298 +function test_2d_path_stroke_overlap() { 1.14299 + 1.14300 +var canvas = document.getElementById('c443'); 1.14301 +var ctx = canvas.getContext('2d'); 1.14302 + 1.14303 +ctx.fillStyle = '#000'; 1.14304 +ctx.fillRect(0, 0, 100, 50); 1.14305 + 1.14306 +ctx.strokeStyle = 'rgba(0, 255, 0, 0.5)'; 1.14307 +ctx.lineWidth = 50; 1.14308 +ctx.moveTo(0, 20); 1.14309 +ctx.lineTo(100, 20); 1.14310 +ctx.moveTo(0, 30); 1.14311 +ctx.lineTo(100, 30); 1.14312 +ctx.stroke(); 1.14313 + 1.14314 +isPixel(ctx, 50,25, 0,127,0,255, 1); 1.14315 + 1.14316 + 1.14317 +} 1.14318 +</script> 1.14319 + 1.14320 +<!-- [[[ test_2d.path.stroke.prune.arc.html ]]] --> 1.14321 + 1.14322 +<p>Canvas test: 2d.path.stroke.prune.arc</p> 1.14323 +<!-- Testing: Zero-length line segments from arcTo and arc are removed before stroking --> 1.14324 +<canvas id="c444" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14325 +<script> 1.14326 + 1.14327 + 1.14328 + 1.14329 +function test_2d_path_stroke_prune_arc() { 1.14330 + 1.14331 +var canvas = document.getElementById('c444'); 1.14332 +var ctx = canvas.getContext('2d'); 1.14333 + 1.14334 +ctx.fillStyle = '#0f0'; 1.14335 +ctx.fillRect(0, 0, 100, 50); 1.14336 + 1.14337 +ctx.strokeStyle = '#f00'; 1.14338 +ctx.lineWidth = 100; 1.14339 +ctx.lineCap = 'round'; 1.14340 +ctx.lineJoin = 'round'; 1.14341 + 1.14342 +ctx.beginPath(); 1.14343 +ctx.moveTo(50, 25); 1.14344 +ctx.arcTo(50, 25, 150, 25, 10); 1.14345 +ctx.stroke(); 1.14346 + 1.14347 +ctx.beginPath(); 1.14348 +ctx.moveTo(50, 25); 1.14349 +ctx.arc(50, 25, 10, 0, 0, false); 1.14350 +ctx.stroke(); 1.14351 + 1.14352 +todo_isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14353 + 1.14354 + 1.14355 +} 1.14356 +</script> 1.14357 + 1.14358 +<!-- [[[ test_2d.path.stroke.prune.closed.html ]]] --> 1.14359 + 1.14360 +<p>Canvas test: 2d.path.stroke.prune.closed</p> 1.14361 +<!-- Testing: Zero-length line segments from closed paths are removed before stroking --> 1.14362 +<canvas id="c445" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14363 +<script> 1.14364 + 1.14365 + 1.14366 + 1.14367 +function test_2d_path_stroke_prune_closed() { 1.14368 + 1.14369 +var canvas = document.getElementById('c445'); 1.14370 +var ctx = canvas.getContext('2d'); 1.14371 + 1.14372 +ctx.fillStyle = '#0f0'; 1.14373 +ctx.fillRect(0, 0, 100, 50); 1.14374 + 1.14375 +ctx.strokeStyle = '#f00'; 1.14376 +ctx.lineWidth = 100; 1.14377 +ctx.lineCap = 'round'; 1.14378 +ctx.lineJoin = 'round'; 1.14379 + 1.14380 +ctx.beginPath(); 1.14381 +ctx.moveTo(50, 25); 1.14382 +ctx.lineTo(50, 25); 1.14383 +ctx.closePath(); 1.14384 +ctx.stroke(); 1.14385 + 1.14386 +if (IsAzureSkia()) { 1.14387 + isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14388 +} else { 1.14389 + todo_isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14390 +} 1.14391 + 1.14392 +} 1.14393 +</script> 1.14394 + 1.14395 +<!-- [[[ test_2d.path.stroke.prune.corner.html ]]] --> 1.14396 + 1.14397 +<p>Canvas test: 2d.path.stroke.prune.corner</p> 1.14398 +<!-- Testing: Zero-length line segments are removed before stroking with miters --> 1.14399 +<canvas id="c446" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14400 +<script> 1.14401 + 1.14402 + 1.14403 +function test_2d_path_stroke_prune_corner() { 1.14404 + 1.14405 +var canvas = document.getElementById('c446'); 1.14406 +var ctx = canvas.getContext('2d'); 1.14407 + 1.14408 +ctx.fillStyle = '#0f0'; 1.14409 +ctx.fillRect(0, 0, 100, 50); 1.14410 + 1.14411 +ctx.strokeStyle = '#f00'; 1.14412 +ctx.lineWidth = 400; 1.14413 +ctx.lineJoin = 'miter'; 1.14414 +ctx.miterLimit = 1.4; 1.14415 + 1.14416 +ctx.beginPath(); 1.14417 +ctx.moveTo(-1000, 200, 0, 0); 1.14418 +ctx.lineTo(-100, 200); 1.14419 +ctx.lineTo(-100, 200); 1.14420 +ctx.lineTo(-100, 200); 1.14421 +ctx.lineTo(-100, 1000); 1.14422 +ctx.stroke(); 1.14423 + 1.14424 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14425 + 1.14426 + 1.14427 +} 1.14428 +</script> 1.14429 + 1.14430 +<!-- [[[ test_2d.path.stroke.prune.curve.html ]]] --> 1.14431 + 1.14432 +<p>Canvas test: 2d.path.stroke.prune.curve</p> 1.14433 +<!-- Testing: Zero-length line segments from quadraticCurveTo and bezierCurveTo are removed before stroking --> 1.14434 +<canvas id="c447" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14435 +<script> 1.14436 + 1.14437 + 1.14438 + 1.14439 +function test_2d_path_stroke_prune_curve() { 1.14440 + 1.14441 +var canvas = document.getElementById('c447'); 1.14442 +var ctx = canvas.getContext('2d'); 1.14443 + 1.14444 +ctx.fillStyle = '#0f0'; 1.14445 +ctx.fillRect(0, 0, 100, 50); 1.14446 + 1.14447 +ctx.strokeStyle = '#f00'; 1.14448 +ctx.lineWidth = 100; 1.14449 +ctx.lineCap = 'round'; 1.14450 +ctx.lineJoin = 'round'; 1.14451 + 1.14452 +ctx.beginPath(); 1.14453 +ctx.moveTo(50, 25); 1.14454 +ctx.quadraticCurveTo(50, 25, 50, 25); 1.14455 +ctx.stroke(); 1.14456 + 1.14457 +ctx.beginPath(); 1.14458 +ctx.moveTo(50, 25); 1.14459 +ctx.bezierCurveTo(50, 25, 50, 25, 50, 25); 1.14460 +ctx.stroke(); 1.14461 + 1.14462 +if (IsAzureSkia()) { 1.14463 + isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14464 +} else { 1.14465 + todo_isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14466 +} 1.14467 + 1.14468 + 1.14469 +} 1.14470 +</script> 1.14471 + 1.14472 +<!-- [[[ test_2d.path.stroke.prune.line.html ]]] --> 1.14473 + 1.14474 +<p>Canvas test: 2d.path.stroke.prune.line</p> 1.14475 +<!-- Testing: Zero-length line segments from lineTo are removed before stroking --> 1.14476 +<canvas id="c448" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14477 +<script> 1.14478 + 1.14479 + 1.14480 + 1.14481 +function test_2d_path_stroke_prune_line() { 1.14482 + 1.14483 +var canvas = document.getElementById('c448'); 1.14484 +var ctx = canvas.getContext('2d'); 1.14485 + 1.14486 +ctx.fillStyle = '#0f0'; 1.14487 +ctx.fillRect(0, 0, 100, 50); 1.14488 + 1.14489 +ctx.strokeStyle = '#f00'; 1.14490 +ctx.lineWidth = 100; 1.14491 +ctx.lineCap = 'round'; 1.14492 +ctx.lineJoin = 'round'; 1.14493 + 1.14494 +ctx.beginPath(); 1.14495 +ctx.moveTo(50, 25); 1.14496 +ctx.lineTo(50, 25); 1.14497 +ctx.stroke(); 1.14498 + 1.14499 +if (IsAzureSkia()) { 1.14500 + isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14501 +} else { 1.14502 + todo_isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14503 +} 1.14504 + 1.14505 +} 1.14506 +</script> 1.14507 + 1.14508 +<!-- [[[ test_2d.path.stroke.prune.rect.html ]]] --> 1.14509 + 1.14510 +<p>Canvas test: 2d.path.stroke.prune.rect</p> 1.14511 +<!-- Testing: Zero-length line segments from rect and strokeRect are removed before stroking --> 1.14512 +<canvas id="c449" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14513 +<script> 1.14514 + 1.14515 + 1.14516 + 1.14517 +function test_2d_path_stroke_prune_rect() { 1.14518 + 1.14519 +var canvas = document.getElementById('c449'); 1.14520 +var ctx = canvas.getContext('2d'); 1.14521 + 1.14522 +ctx.fillStyle = '#0f0'; 1.14523 +ctx.fillRect(0, 0, 100, 50); 1.14524 + 1.14525 +ctx.strokeStyle = '#f00'; 1.14526 +ctx.lineWidth = 100; 1.14527 +ctx.lineCap = 'round'; 1.14528 +ctx.lineJoin = 'round'; 1.14529 + 1.14530 +ctx.beginPath(); 1.14531 +ctx.rect(50, 25, 0, 0); 1.14532 +ctx.stroke(); 1.14533 + 1.14534 +ctx.strokeRect(50, 25, 0, 0); 1.14535 + 1.14536 +if (IsAzureSkia()) { 1.14537 + isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14538 +} else { 1.14539 + todo_isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14540 +} 1.14541 + 1.14542 +} 1.14543 +</script> 1.14544 + 1.14545 +<!-- [[[ test_2d.path.stroke.scale1.html ]]] --> 1.14546 + 1.14547 +<p>Canvas test: 2d.path.stroke.scale1</p> 1.14548 +<!-- Testing: Stroke line widths are scaled by the current transformation matrix --> 1.14549 +<canvas id="c450" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14550 +<script> 1.14551 + 1.14552 + 1.14553 +function test_2d_path_stroke_scale1() { 1.14554 + 1.14555 +var canvas = document.getElementById('c450'); 1.14556 +var ctx = canvas.getContext('2d'); 1.14557 + 1.14558 +ctx.fillStyle = '#f00'; 1.14559 +ctx.fillRect(0, 0, 100, 50); 1.14560 + 1.14561 +ctx.beginPath(); 1.14562 +ctx.rect(25, 12.5, 50, 25); 1.14563 +ctx.save(); 1.14564 +ctx.scale(50, 25); 1.14565 +ctx.strokeStyle = '#0f0'; 1.14566 +ctx.stroke(); 1.14567 +ctx.restore(); 1.14568 + 1.14569 +ctx.beginPath(); 1.14570 +ctx.rect(-25, -12.5, 150, 75); 1.14571 +ctx.save(); 1.14572 +ctx.scale(50, 25); 1.14573 +ctx.strokeStyle = '#f00'; 1.14574 +ctx.stroke(); 1.14575 +ctx.restore(); 1.14576 + 1.14577 +isPixel(ctx, 0,0, 0,255,0,255, 0); 1.14578 +isPixel(ctx, 50,0, 0,255,0,255, 0); 1.14579 +isPixel(ctx, 99,0, 0,255,0,255, 0); 1.14580 +isPixel(ctx, 0,25, 0,255,0,255, 0); 1.14581 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14582 +isPixel(ctx, 99,25, 0,255,0,255, 0); 1.14583 +isPixel(ctx, 0,49, 0,255,0,255, 0); 1.14584 +isPixel(ctx, 50,49, 0,255,0,255, 0); 1.14585 +isPixel(ctx, 99,49, 0,255,0,255, 0); 1.14586 + 1.14587 + 1.14588 +} 1.14589 +</script> 1.14590 + 1.14591 +<!-- [[[ test_2d.path.stroke.scale2.html ]]] --> 1.14592 + 1.14593 +<p>Canvas test: 2d.path.stroke.scale2</p> 1.14594 +<!-- Testing: Stroke line widths are scaled by the current transformation matrix --> 1.14595 +<canvas id="c451" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14596 +<script> 1.14597 + 1.14598 + 1.14599 +function test_2d_path_stroke_scale2() { 1.14600 + 1.14601 +var canvas = document.getElementById('c451'); 1.14602 +var ctx = canvas.getContext('2d'); 1.14603 + 1.14604 +if (!IsD2DEnabled()) { 1.14605 + // On D2D a rasterization bug causes a small discrepancy here. See bug 587316 1.14606 + ctx.fillStyle = '#f00'; 1.14607 + ctx.fillRect(0, 0, 100, 50); 1.14608 + 1.14609 + ctx.beginPath(); 1.14610 + ctx.rect(25, 12.5, 50, 25); 1.14611 + ctx.save(); 1.14612 + ctx.rotate(Math.PI/2); 1.14613 + ctx.scale(25, 50); 1.14614 + ctx.strokeStyle = '#0f0'; 1.14615 + ctx.stroke(); 1.14616 + ctx.restore(); 1.14617 + 1.14618 + ctx.beginPath(); 1.14619 + ctx.rect(-25, -12.5, 150, 75); 1.14620 + ctx.save(); 1.14621 + ctx.rotate(Math.PI/2); 1.14622 + ctx.scale(25, 50); 1.14623 + ctx.strokeStyle = '#f00'; 1.14624 + ctx.stroke(); 1.14625 + ctx.restore(); 1.14626 + 1.14627 + isPixel(ctx, 0,0, 0,255,0,255, 0); 1.14628 + isPixel(ctx, 50,0, 0,255,0,255, 0); 1.14629 + isPixel(ctx, 99,0, 0,255,0,255, 0); 1.14630 + isPixel(ctx, 0,25, 0,255,0,255, 0); 1.14631 + isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14632 + isPixel(ctx, 99,25, 0,255,0,255, 0); 1.14633 + isPixel(ctx, 0,49, 0,255,0,255, 0); 1.14634 + isPixel(ctx, 50,49, 0,255,0,255, 0); 1.14635 + isPixel(ctx, 99,49, 0,255,0,255, 0); 1.14636 +} 1.14637 + 1.14638 +} 1.14639 +</script> 1.14640 + 1.14641 +<!-- [[[ test_2d.path.stroke.skew.html ]]] --> 1.14642 + 1.14643 +<p>Canvas test: 2d.path.stroke.skew</p> 1.14644 +<!-- Testing: Strokes lines are skewed by the current transformation matrix --> 1.14645 +<canvas id="c452" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14646 +<script> 1.14647 + 1.14648 + 1.14649 +function test_2d_path_stroke_skew() { 1.14650 + 1.14651 +var canvas = document.getElementById('c452'); 1.14652 +var ctx = canvas.getContext('2d'); 1.14653 + 1.14654 +ctx.fillStyle = '#f00'; 1.14655 +ctx.fillRect(0, 0, 100, 50); 1.14656 + 1.14657 +ctx.save(); 1.14658 +ctx.beginPath(); 1.14659 +ctx.moveTo(49, -50); 1.14660 +ctx.lineTo(201, -50); 1.14661 +ctx.rotate(Math.PI/4); 1.14662 +ctx.scale(1, 283); 1.14663 +ctx.strokeStyle = '#0f0'; 1.14664 +ctx.stroke(); 1.14665 +ctx.restore(); 1.14666 + 1.14667 +ctx.save(); 1.14668 +ctx.beginPath(); 1.14669 +ctx.translate(-150, 0); 1.14670 +ctx.moveTo(49, -50); 1.14671 +ctx.lineTo(199, -50); 1.14672 +ctx.rotate(Math.PI/4); 1.14673 +ctx.scale(1, 142); 1.14674 +ctx.strokeStyle = '#f00'; 1.14675 +ctx.stroke(); 1.14676 +ctx.restore(); 1.14677 + 1.14678 +ctx.save(); 1.14679 +ctx.beginPath(); 1.14680 +ctx.translate(-150, 0); 1.14681 +ctx.moveTo(49, -50); 1.14682 +ctx.lineTo(199, -50); 1.14683 +ctx.rotate(Math.PI/4); 1.14684 +ctx.scale(1, 142); 1.14685 +ctx.strokeStyle = '#f00'; 1.14686 +ctx.stroke(); 1.14687 +ctx.restore(); 1.14688 + 1.14689 +isPixel(ctx, 0,0, 0,255,0,255, 0); 1.14690 +isPixel(ctx, 50,0, 0,255,0,255, 0); 1.14691 +isPixel(ctx, 99,0, 0,255,0,255, 0); 1.14692 +isPixel(ctx, 0,25, 0,255,0,255, 0); 1.14693 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14694 +isPixel(ctx, 99,25, 0,255,0,255, 0); 1.14695 +isPixel(ctx, 0,49, 0,255,0,255, 0); 1.14696 +isPixel(ctx, 50,49, 0,255,0,255, 0); 1.14697 +isPixel(ctx, 99,49, 0,255,0,255, 0); 1.14698 + 1.14699 +} 1.14700 +</script> 1.14701 + 1.14702 +<!-- [[[ test_2d.path.stroke.unaffected.html ]]] --> 1.14703 + 1.14704 +<p>Canvas test: 2d.path.stroke.unaffected</p> 1.14705 +<!-- Testing: Stroking does not start a new path or subpath --> 1.14706 +<canvas id="c453" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14707 +<script> 1.14708 + 1.14709 + 1.14710 +function test_2d_path_stroke_unaffected() { 1.14711 + 1.14712 +var canvas = document.getElementById('c453'); 1.14713 +var ctx = canvas.getContext('2d'); 1.14714 + 1.14715 +ctx.fillStyle = '#f00'; 1.14716 +ctx.fillRect(0, 0, 100, 50); 1.14717 + 1.14718 +ctx.lineWidth = 50; 1.14719 +ctx.moveTo(-100, 25); 1.14720 +ctx.lineTo(-100, -100); 1.14721 +ctx.lineTo(200, -100); 1.14722 +ctx.lineTo(200, 25); 1.14723 +ctx.strokeStyle = '#f00'; 1.14724 +ctx.stroke(); 1.14725 + 1.14726 +ctx.closePath(); 1.14727 +ctx.strokeStyle = '#0f0'; 1.14728 +ctx.stroke(); 1.14729 + 1.14730 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14731 + 1.14732 + 1.14733 +} 1.14734 +</script> 1.14735 + 1.14736 +<!-- [[[ test_2d.path.stroke.union.html ]]] --> 1.14737 + 1.14738 +<p>Canvas test: 2d.path.stroke.union</p> 1.14739 +<!-- Testing: Strokes in opposite directions are unioned, not subtracted --> 1.14740 +<canvas id="c454" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14741 +<script> 1.14742 + 1.14743 + 1.14744 +function test_2d_path_stroke_union() { 1.14745 + 1.14746 +var canvas = document.getElementById('c454'); 1.14747 +var ctx = canvas.getContext('2d'); 1.14748 + 1.14749 +ctx.fillStyle = '#f00'; 1.14750 +ctx.fillRect(0, 0, 100, 50); 1.14751 + 1.14752 +ctx.strokeStyle = '#0f0'; 1.14753 +ctx.lineWidth = 40; 1.14754 +ctx.moveTo(0, 10); 1.14755 +ctx.lineTo(100, 10); 1.14756 +ctx.moveTo(100, 40); 1.14757 +ctx.lineTo(0, 40); 1.14758 +ctx.stroke(); 1.14759 + 1.14760 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14761 + 1.14762 + 1.14763 +} 1.14764 +</script> 1.14765 + 1.14766 +<!-- [[[ test_2d.path.transformation.basic.html ]]] --> 1.14767 + 1.14768 +<p>Canvas test: 2d.path.transformation.basic</p> 1.14769 +<canvas id="c455" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14770 +<script> 1.14771 + 1.14772 + 1.14773 +function test_2d_path_transformation_basic() { 1.14774 + 1.14775 +var canvas = document.getElementById('c455'); 1.14776 +var ctx = canvas.getContext('2d'); 1.14777 + 1.14778 +ctx.fillStyle = '#f00'; 1.14779 +ctx.fillRect(0, 0, 100, 50); 1.14780 + 1.14781 +ctx.translate(-100, 0); 1.14782 +ctx.rect(100, 0, 100, 50); 1.14783 +ctx.translate(0, -100); 1.14784 +ctx.fillStyle = '#0f0'; 1.14785 +ctx.fill(); 1.14786 + 1.14787 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14788 + 1.14789 + 1.14790 +} 1.14791 +</script> 1.14792 + 1.14793 +<!-- [[[ test_2d.path.transformation.changing.html ]]] --> 1.14794 + 1.14795 +<p>Canvas test: 2d.path.transformation.changing</p> 1.14796 +<!-- Testing: Transformations are applied while building paths, not when drawing --> 1.14797 +<canvas id="c456" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14798 +<script> 1.14799 + 1.14800 + 1.14801 +function test_2d_path_transformation_changing() { 1.14802 + 1.14803 +var canvas = document.getElementById('c456'); 1.14804 +var ctx = canvas.getContext('2d'); 1.14805 + 1.14806 +ctx.fillStyle = '#f00'; 1.14807 +ctx.fillRect(0, 0, 100, 50); 1.14808 +ctx.fillStyle = '#0f0'; 1.14809 +ctx.moveTo(0, 0); 1.14810 +ctx.translate(100, 0); 1.14811 +ctx.lineTo(0, 0); 1.14812 +ctx.translate(0, 50); 1.14813 +ctx.lineTo(0, 0); 1.14814 +ctx.translate(-100, 0); 1.14815 +ctx.lineTo(0, 0); 1.14816 +ctx.translate(1000, 1000); 1.14817 +ctx.rotate(Math.PI/2); 1.14818 +ctx.scale(0.1, 0.1); 1.14819 +ctx.fill(); 1.14820 + 1.14821 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14822 + 1.14823 + 1.14824 +} 1.14825 +</script> 1.14826 + 1.14827 +<!-- [[[ test_2d.path.transformation.multiple.html ]]] --> 1.14828 + 1.14829 +<p>Canvas test: 2d.path.transformation.multiple</p> 1.14830 +<canvas id="c457" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14831 +<script> 1.14832 + 1.14833 + 1.14834 +function test_2d_path_transformation_multiple() { 1.14835 + 1.14836 +var canvas = document.getElementById('c457'); 1.14837 +var ctx = canvas.getContext('2d'); 1.14838 + 1.14839 +ctx.fillStyle = '#f00'; 1.14840 +ctx.fillRect(0, 0, 100, 50); 1.14841 + 1.14842 +ctx.rect(0, 0, 100, 50); 1.14843 +ctx.fill(); 1.14844 +ctx.translate(-100, 0); 1.14845 +ctx.fillStyle = '#0f0'; 1.14846 +ctx.fill(); 1.14847 + 1.14848 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14849 + 1.14850 + 1.14851 +} 1.14852 +</script> 1.14853 + 1.14854 +<!-- [[[ test_2d.pattern.animated.gif.html ]]] --> 1.14855 + 1.14856 +<p>Canvas test: 2d.pattern.animated.gif</p> 1.14857 +<!-- Testing: createPattern() of an animated GIF draws the first frame --> 1.14858 +<canvas id="c458" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14859 +<script> 1.14860 + 1.14861 +var canvas458 = document.getElementById('c458'); 1.14862 +var ctx458 = canvas458.getContext('2d'); 1.14863 +var isDone_test_2d_pattern_animated_gif = false; 1.14864 + 1.14865 +function test_2d_pattern_animated_gif() { 1.14866 + 1.14867 +deferTest(); 1.14868 +setTimeout(function () { 1.14869 + var pattern = ctx458.createPattern(document.getElementById('anim-gr_2.gif'), 'repeat'); 1.14870 + ctx458.fillStyle = pattern; 1.14871 + ctx458.fillRect(0, 0, 50, 50); 1.14872 + setTimeout(wrapFunction(function () { 1.14873 + ctx458.fillRect(50, 0, 50, 50); 1.14874 + isPixel(ctx458, 25,25, 0,255,0,255, 2); 1.14875 + isPixel(ctx458, 75,25, 0,255,0,255, 2); 1.14876 + isDone_test_2d_pattern_animated_gif = true; 1.14877 + }), 2500); 1.14878 +}, 2500); 1.14879 + 1.14880 + 1.14881 +} 1.14882 +</script> 1.14883 +<img src="image_anim-gr.gif" id="anim-gr_2.gif" class="resource"> 1.14884 + 1.14885 +<!-- [[[ test_2d.pattern.basic.canvas.html ]]] --> 1.14886 + 1.14887 +<p>Canvas test: 2d.pattern.basic.canvas</p> 1.14888 +<canvas id="c459" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14889 +<script> 1.14890 + 1.14891 + 1.14892 +function test_2d_pattern_basic_canvas() { 1.14893 + 1.14894 +var canvas = document.getElementById('c459'); 1.14895 +var ctx = canvas.getContext('2d'); 1.14896 + 1.14897 +ctx.fillStyle = '#f00'; 1.14898 +ctx.fillRect(0, 0, 100, 50); 1.14899 + 1.14900 +var canvas2 = document.createElement('canvas'); 1.14901 +canvas2.width = 100; 1.14902 +canvas2.height = 50; 1.14903 +var ctx2 = canvas2.getContext('2d'); 1.14904 +ctx2.fillStyle = '#0f0'; 1.14905 +ctx2.fillRect(0, 0, 100, 50); 1.14906 + 1.14907 +var pattern = ctx.createPattern(canvas2, 'no-repeat'); 1.14908 +ctx.fillStyle = pattern; 1.14909 +ctx.fillRect(0, 0, 100, 50); 1.14910 + 1.14911 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.14912 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.14913 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.14914 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.14915 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.14916 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.14917 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.14918 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.14919 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.14920 + 1.14921 + 1.14922 +} 1.14923 +</script> 1.14924 + 1.14925 +<!-- [[[ test_2d.pattern.basic.image.html ]]] --> 1.14926 + 1.14927 +<p>Canvas test: 2d.pattern.basic.image</p> 1.14928 +<canvas id="c460" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14929 +<script> 1.14930 + 1.14931 + 1.14932 +function test_2d_pattern_basic_image() { 1.14933 + 1.14934 +var canvas = document.getElementById('c460'); 1.14935 +var ctx = canvas.getContext('2d'); 1.14936 + 1.14937 +ctx.fillStyle = '#f00'; 1.14938 +ctx.fillRect(0, 0, 100, 50); 1.14939 +var img = document.getElementById('green_8.png'); 1.14940 +var pattern = ctx.createPattern(img, 'no-repeat'); 1.14941 +ctx.fillStyle = pattern; 1.14942 +ctx.fillRect(0, 0, 100, 50); 1.14943 + 1.14944 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.14945 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.14946 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.14947 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.14948 + 1.14949 + 1.14950 +} 1.14951 +</script> 1.14952 +<img src="image_green.png" id="green_8.png" class="resource"> 1.14953 + 1.14954 +<!-- [[[ test_2d.pattern.basic.nocontext.html ]]] --> 1.14955 + 1.14956 +<p>Canvas test: 2d.pattern.basic.nocontext</p> 1.14957 +<canvas id="c461" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14958 +<script> 1.14959 + 1.14960 + 1.14961 +function test_2d_pattern_basic_nocontext() { 1.14962 + 1.14963 +var canvas = document.getElementById('c461'); 1.14964 +var ctx = canvas.getContext('2d'); 1.14965 + 1.14966 +var canvas2 = document.createElement('canvas'); 1.14967 +canvas2.width = 100; 1.14968 +canvas2.height = 50; 1.14969 +var pattern = ctx.createPattern(canvas2, 'no-repeat'); 1.14970 + 1.14971 +ctx.fillStyle = '#0f0'; 1.14972 +ctx.fillRect(0, 0, 100, 50); 1.14973 +ctx.fillStyle = pattern; 1.14974 +ctx.fillRect(0, 0, 100, 50); 1.14975 + 1.14976 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.14977 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.14978 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.14979 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.14980 + 1.14981 + 1.14982 +} 1.14983 +</script> 1.14984 + 1.14985 +<!-- [[[ test_2d.pattern.basic.type.html ]]] --> 1.14986 + 1.14987 +<p>Canvas test: 2d.pattern.basic.type</p> 1.14988 +<canvas id="c462" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.14989 +<script> 1.14990 + 1.14991 +function test_2d_pattern_basic_type() { 1.14992 + 1.14993 +var canvas = document.getElementById('c462'); 1.14994 +var ctx = canvas.getContext('2d'); 1.14995 + 1.14996 +ok(window.CanvasPattern !== undefined, "window.CanvasPattern !== undefined"); 1.14997 + 1.14998 +window.CanvasPattern.prototype.thisImplementsCanvasPattern = true; 1.14999 + 1.15000 +var img = document.getElementById('green_9.png'); 1.15001 +var pattern = ctx.createPattern(img, 'no-repeat'); 1.15002 +ok(pattern.thisImplementsCanvasPattern, "pattern.thisImplementsCanvasPattern"); 1.15003 + 1.15004 + 1.15005 +} 1.15006 +</script> 1.15007 +<img src="image_green.png" id="green_9.png" class="resource"> 1.15008 + 1.15009 +<!-- [[[ test_2d.pattern.basic.zerocanvas.html ]]] --> 1.15010 + 1.15011 +<p>Canvas test: 2d.pattern.basic.zerocanvas</p> 1.15012 +<canvas id="c463" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15013 +<script> 1.15014 + 1.15015 + 1.15016 + 1.15017 +function test_2d_pattern_basic_zerocanvas() { 1.15018 + 1.15019 +var canvas = document.getElementById('c463'); 1.15020 +var ctx = canvas.getContext('2d'); 1.15021 + 1.15022 +canvas.width = 0; 1.15023 +canvas.height = 10; 1.15024 +ok(canvas.width === 0, "canvas.width === 0"); 1.15025 +ok(canvas.height === 10, "canvas.height === 10"); 1.15026 +var _thrown = undefined; try { 1.15027 + ctx.createPattern(canvas, 'repeat'); 1.15028 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "InvalidStateError" && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw InvalidStateError"); 1.15029 + 1.15030 +canvas.width = 10; 1.15031 +canvas.height = 0; 1.15032 +ok(canvas.width === 10, "canvas.width === 10"); 1.15033 +ok(canvas.height === 0, "canvas.height === 0"); 1.15034 +var _thrown = undefined; try { 1.15035 + ctx.createPattern(canvas, 'repeat'); 1.15036 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "InvalidStateError" && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw InvalidStateError"); 1.15037 + 1.15038 +canvas.width = 0; 1.15039 +canvas.height = 0; 1.15040 +ok(canvas.width === 0, "canvas.width === 0"); 1.15041 +ok(canvas.height === 0, "canvas.height === 0"); 1.15042 +var _thrown = undefined; try { 1.15043 + ctx.createPattern(canvas, 'repeat'); 1.15044 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "InvalidStateError" && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw InvalidStateError"); 1.15045 + 1.15046 + 1.15047 +} 1.15048 +</script> 1.15049 + 1.15050 +<!-- [[[ test_2d.pattern.crosscanvas.html ]]] --> 1.15051 + 1.15052 +<p>Canvas test: 2d.pattern.crosscanvas</p> 1.15053 +<canvas id="c464" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15054 +<script> 1.15055 + 1.15056 + 1.15057 +function test_2d_pattern_crosscanvas() { 1.15058 + 1.15059 +var canvas = document.getElementById('c464'); 1.15060 +var ctx = canvas.getContext('2d'); 1.15061 + 1.15062 +var img = document.getElementById('green_10.png'); 1.15063 + 1.15064 +var pattern = document.createElement('canvas').getContext('2d').createPattern(img, 'no-repeat'); 1.15065 +ctx.fillStyle = '#f00'; 1.15066 +ctx.fillRect(0, 0, 100, 50); 1.15067 +ctx.fillStyle = pattern; 1.15068 +ctx.fillRect(0, 0, 100, 50); 1.15069 + 1.15070 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.15071 + 1.15072 + 1.15073 +} 1.15074 +</script> 1.15075 +<img src="image_green.png" id="green_10.png" class="resource"> 1.15076 + 1.15077 +<!-- [[[ test_2d.pattern.image.broken.html ]]] --> 1.15078 + 1.15079 +<p>Canvas test: 2d.pattern.image.broken</p> 1.15080 +<canvas id="c465" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15081 +<script> 1.15082 + 1.15083 +function test_2d_pattern_image_broken() { 1.15084 + 1.15085 +var canvas = document.getElementById('c465'); 1.15086 +var ctx = canvas.getContext('2d'); 1.15087 + 1.15088 +var img = document.getElementById('broken_2.png'); 1.15089 +todo(img.complete === false, "img.complete === false"); 1.15090 +var _thrown = undefined; try { 1.15091 + ctx.createPattern(img, 'repeat'); 1.15092 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "InvalidStateError" && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw InvalidStateError"); 1.15093 + 1.15094 + 1.15095 +} 1.15096 +</script> 1.15097 +<img src="image_broken.png" id="broken_2.png" class="resource"> 1.15098 + 1.15099 +<!-- [[[ test_2d.pattern.image.incomplete.html ]]] --> 1.15100 + 1.15101 +<p>Canvas test: 2d.pattern.image.incomplete</p> 1.15102 +<canvas id="c466" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15103 +<script> 1.15104 + 1.15105 +function test_2d_pattern_image_incomplete() { 1.15106 + 1.15107 +var canvas = document.getElementById('c466'); 1.15108 +var ctx = canvas.getContext('2d'); 1.15109 + 1.15110 +var img = new Image(); 1.15111 +todo(img.complete === false, "img.complete === false"); 1.15112 +var _thrown = undefined; try { 1.15113 + ctx.createPattern(img, 'repeat'); 1.15114 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "InvalidStateError" && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw InvalidStateError"); 1.15115 + 1.15116 + 1.15117 +} 1.15118 +</script> 1.15119 + 1.15120 +<!-- [[[ test_2d.pattern.image.null.html ]]] --> 1.15121 + 1.15122 +<p>Canvas test: 2d.pattern.image.null</p> 1.15123 +<canvas id="c467" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15124 +<script> 1.15125 + 1.15126 +function test_2d_pattern_image_null() { 1.15127 + 1.15128 +var canvas = document.getElementById('c467'); 1.15129 +var ctx = canvas.getContext('2d'); 1.15130 + 1.15131 +var _thrown = undefined; try { 1.15132 + ctx.createPattern(null, 'repeat'); 1.15133 +} catch (e) { _thrown = e }; 1.15134 +ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); 1.15135 +} 1.15136 +</script> 1.15137 + 1.15138 +<!-- [[[ test_2d.pattern.image.string.html ]]] --> 1.15139 + 1.15140 +<p>Canvas test: 2d.pattern.image.string</p> 1.15141 +<canvas id="c468" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15142 +<script> 1.15143 + 1.15144 +function test_2d_pattern_image_string() { 1.15145 + 1.15146 +var canvas = document.getElementById('c468'); 1.15147 +var ctx = canvas.getContext('2d'); 1.15148 + 1.15149 +var _thrown = undefined; try { 1.15150 + ctx.createPattern('image_red.png', 'repeat'); 1.15151 +} catch (e) { _thrown = e }; 1.15152 +ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); 1.15153 +} 1.15154 +</script> 1.15155 + 1.15156 +<!-- [[[ test_2d.pattern.image.undefined.html ]]] --> 1.15157 + 1.15158 +<p>Canvas test: 2d.pattern.image.undefined</p> 1.15159 +<canvas id="c469" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15160 +<script> 1.15161 + 1.15162 +function test_2d_pattern_image_undefined() { 1.15163 + 1.15164 +var canvas = document.getElementById('c469'); 1.15165 +var ctx = canvas.getContext('2d'); 1.15166 + 1.15167 +var _thrown = undefined; try { 1.15168 + ctx.createPattern(undefined, 'repeat'); 1.15169 +} catch (e) { _thrown = e }; 1.15170 +ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); 1.15171 +} 1.15172 +</script> 1.15173 + 1.15174 +<!-- [[[ test_2d.pattern.modify.canvas1.html ]]] --> 1.15175 + 1.15176 +<p>Canvas test: 2d.pattern.modify.canvas1</p> 1.15177 +<canvas id="c470" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15178 +<script> 1.15179 + 1.15180 + 1.15181 +function test_2d_pattern_modify_canvas1() { 1.15182 + 1.15183 +var canvas = document.getElementById('c470'); 1.15184 +var ctx = canvas.getContext('2d'); 1.15185 + 1.15186 +var canvas2 = document.createElement('canvas'); 1.15187 +canvas2.width = 100; 1.15188 +canvas2.height = 50; 1.15189 +var ctx2 = canvas2.getContext('2d'); 1.15190 +ctx2.fillStyle = '#0f0'; 1.15191 +ctx2.fillRect(0, 0, 100, 50); 1.15192 + 1.15193 +var pattern = ctx.createPattern(canvas2, 'no-repeat'); 1.15194 + 1.15195 +ctx2.fillStyle = '#f00'; 1.15196 +ctx2.fillRect(0, 0, 100, 50); 1.15197 + 1.15198 +ctx.fillStyle = pattern; 1.15199 +ctx.fillRect(0, 0, 100, 50); 1.15200 + 1.15201 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15202 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15203 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15204 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15205 + 1.15206 + 1.15207 +} 1.15208 +</script> 1.15209 + 1.15210 +<!-- [[[ test_2d.pattern.modify.canvas2.html ]]] --> 1.15211 + 1.15212 +<p>Canvas test: 2d.pattern.modify.canvas2</p> 1.15213 +<canvas id="c471" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15214 +<script> 1.15215 + 1.15216 + 1.15217 +function test_2d_pattern_modify_canvas2() { 1.15218 + 1.15219 +var canvas = document.getElementById('c471'); 1.15220 +var ctx = canvas.getContext('2d'); 1.15221 + 1.15222 +var canvas2 = document.createElement('canvas'); 1.15223 +canvas2.width = 100; 1.15224 +canvas2.height = 50; 1.15225 +var ctx2 = canvas2.getContext('2d'); 1.15226 +ctx2.fillStyle = '#0f0'; 1.15227 +ctx2.fillRect(0, 0, 100, 50); 1.15228 + 1.15229 +var pattern = ctx.createPattern(canvas2, 'no-repeat'); 1.15230 +ctx.fillStyle = pattern; 1.15231 +ctx.fillRect(0, 0, 100, 50); 1.15232 +ctx.fillStyle = '#f00'; 1.15233 +ctx.fillRect(0, 0, 100, 50); 1.15234 + 1.15235 +ctx2.fillStyle = '#f00'; 1.15236 +ctx2.fillRect(0, 0, 100, 50); 1.15237 + 1.15238 +ctx.fillStyle = pattern; 1.15239 +ctx.fillRect(0, 0, 100, 50); 1.15240 + 1.15241 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15242 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15243 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15244 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15245 + 1.15246 + 1.15247 +} 1.15248 +</script> 1.15249 + 1.15250 +<!-- [[[ test_2d.pattern.modify.image1.html ]]] --> 1.15251 + 1.15252 +<p>Canvas test: 2d.pattern.modify.image1</p> 1.15253 +<canvas id="c472" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15254 +<script> 1.15255 + 1.15256 +var canvas472 = document.getElementById('c472'); 1.15257 +var ctx472 = canvas472.getContext('2d'); 1.15258 + 1.15259 +function test_2d_pattern_modify_image1() { 1.15260 + 1.15261 +var img = document.getElementById('green_11.png'); 1.15262 +var pattern = ctx472.createPattern(img, 'no-repeat'); 1.15263 +deferTest(); 1.15264 +img.onload = wrapFunction(function () 1.15265 +{ 1.15266 + ctx472.fillStyle = pattern; 1.15267 + ctx472.fillRect(0, 0, 100, 50); 1.15268 + 1.15269 + isPixel(ctx472, 1,1, 0,255,0,255, 0); 1.15270 + isPixel(ctx472, 98,1, 0,255,0,255, 0); 1.15271 + isPixel(ctx472, 1,48, 0,255,0,255, 0); 1.15272 + isPixel(ctx472, 98,48, 0,255,0,255, 0); 1.15273 +}); 1.15274 +img.src = 'image_red.png'; 1.15275 + 1.15276 + 1.15277 +} 1.15278 +</script> 1.15279 +<img src="image_green.png" id="green_11.png" class="resource"> 1.15280 + 1.15281 +<!-- [[[ test_2d.pattern.modify.image2.html ]]] --> 1.15282 + 1.15283 +<p>Canvas test: 2d.pattern.modify.image2</p> 1.15284 +<canvas id="c473" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15285 +<script> 1.15286 + 1.15287 + 1.15288 +var canvas473 = document.getElementById('c473'); 1.15289 +var ctx473 = canvas473.getContext('2d'); 1.15290 + 1.15291 +function test_2d_pattern_modify_image2() { 1.15292 + 1.15293 +var img = document.getElementById('green_12.png'); 1.15294 +var pattern = ctx473.createPattern(img, 'no-repeat'); 1.15295 +ctx473.fillStyle = pattern; 1.15296 +ctx473.fillRect(0, 0, 100, 50); 1.15297 +ctx473.fillStyle = '#00f'; 1.15298 +ctx473.fillRect(0, 0, 100, 50); 1.15299 +deferTest(); 1.15300 +img.onload = wrapFunction(function () 1.15301 +{ 1.15302 + ctx473.fillStyle = pattern; 1.15303 + ctx473.fillRect(0, 0, 100, 50); 1.15304 + 1.15305 + isPixel(ctx473, 1,1, 0,255,0,255, 0); 1.15306 + isPixel(ctx473, 98,1, 0,255,0,255, 0); 1.15307 + isPixel(ctx473, 1,48, 0,255,0,255, 0); 1.15308 + isPixel(ctx473, 98,48, 0,255,0,255, 0); 1.15309 +}); 1.15310 +img.src = 'image_red.png'; 1.15311 + 1.15312 + 1.15313 +} 1.15314 +</script> 1.15315 +<img src="image_green.png" id="green_12.png" class="resource"> 1.15316 + 1.15317 +<!-- [[[ test_2d.pattern.paint.norepeat.basic.html ]]] --> 1.15318 + 1.15319 +<p>Canvas test: 2d.pattern.paint.norepeat.basic</p> 1.15320 +<canvas id="c474" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15321 +<script> 1.15322 + 1.15323 + 1.15324 +function test_2d_pattern_paint_norepeat_basic() { 1.15325 + 1.15326 +var canvas = document.getElementById('c474'); 1.15327 +var ctx = canvas.getContext('2d'); 1.15328 + 1.15329 +ctx.fillStyle = '#f00'; 1.15330 +ctx.fillRect(0, 0, 100, 50); 1.15331 + 1.15332 +var img = document.getElementById('green_13.png'); 1.15333 +var pattern = ctx.createPattern(img, 'no-repeat'); 1.15334 +ctx.fillStyle = pattern; 1.15335 +ctx.fillRect(0, 0, 100, 50); 1.15336 + 1.15337 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15338 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15339 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15340 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15341 + 1.15342 + 1.15343 +} 1.15344 +</script> 1.15345 +<img src="image_green.png" id="green_13.png" class="resource"> 1.15346 + 1.15347 +<!-- [[[ test_2d.pattern.paint.norepeat.coord1.html ]]] --> 1.15348 + 1.15349 +<p>Canvas test: 2d.pattern.paint.norepeat.coord1</p> 1.15350 +<canvas id="c475" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15351 +<script> 1.15352 + 1.15353 + 1.15354 +function test_2d_pattern_paint_norepeat_coord1() { 1.15355 + 1.15356 +var canvas = document.getElementById('c475'); 1.15357 +var ctx = canvas.getContext('2d'); 1.15358 + 1.15359 +ctx.fillStyle = '#0f0'; 1.15360 +ctx.fillRect(0, 0, 50, 50); 1.15361 +ctx.fillStyle = '#f00'; 1.15362 +ctx.fillRect(50, 0, 50, 50); 1.15363 + 1.15364 +var img = document.getElementById('green_14.png'); 1.15365 +var pattern = ctx.createPattern(img, 'no-repeat'); 1.15366 +ctx.fillStyle = pattern; 1.15367 +ctx.translate(50, 0); 1.15368 +ctx.fillRect(-50, 0, 100, 50); 1.15369 + 1.15370 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15371 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15372 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15373 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15374 + 1.15375 + 1.15376 +} 1.15377 +</script> 1.15378 +<img src="image_green.png" id="green_14.png" class="resource"> 1.15379 + 1.15380 +<!-- [[[ test_2d.pattern.paint.norepeat.coord2.html ]]] --> 1.15381 + 1.15382 +<p>Canvas test: 2d.pattern.paint.norepeat.coord2</p> 1.15383 +<canvas id="c476" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15384 +<script> 1.15385 + 1.15386 + 1.15387 +function test_2d_pattern_paint_norepeat_coord2() { 1.15388 + 1.15389 +var canvas = document.getElementById('c476'); 1.15390 +var ctx = canvas.getContext('2d'); 1.15391 + 1.15392 +var img = document.getElementById('green_15.png'); 1.15393 +var pattern = ctx.createPattern(img, 'no-repeat'); 1.15394 +ctx.fillStyle = pattern; 1.15395 +ctx.fillRect(0, 0, 50, 50); 1.15396 + 1.15397 +ctx.fillStyle = '#f00'; 1.15398 +ctx.fillRect(50, 0, 50, 50); 1.15399 + 1.15400 +ctx.fillStyle = pattern; 1.15401 +ctx.translate(50, 0); 1.15402 +ctx.fillRect(-50, 0, 100, 50); 1.15403 + 1.15404 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15405 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15406 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15407 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15408 + 1.15409 + 1.15410 +} 1.15411 +</script> 1.15412 +<img src="image_green.png" id="green_15.png" class="resource"> 1.15413 + 1.15414 +<!-- [[[ test_2d.pattern.paint.norepeat.coord3.html ]]] --> 1.15415 + 1.15416 +<p>Canvas test: 2d.pattern.paint.norepeat.coord3</p> 1.15417 +<canvas id="c477" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15418 +<script> 1.15419 + 1.15420 + 1.15421 +function test_2d_pattern_paint_norepeat_coord3() { 1.15422 + 1.15423 +var canvas = document.getElementById('c477'); 1.15424 +var ctx = canvas.getContext('2d'); 1.15425 + 1.15426 +ctx.fillStyle = '#0f0'; 1.15427 +ctx.fillRect(0, 0, 100, 50); 1.15428 + 1.15429 +var img = document.getElementById('red_15.png'); 1.15430 +var pattern = ctx.createPattern(img, 'no-repeat'); 1.15431 +ctx.fillStyle = pattern; 1.15432 +ctx.translate(50, 25); 1.15433 +ctx.fillRect(-50, -25, 100, 50); 1.15434 + 1.15435 +ctx.fillStyle = '#0f0'; 1.15436 +ctx.fillRect(0, 0, 50, 25); 1.15437 + 1.15438 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15439 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15440 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15441 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15442 + 1.15443 + 1.15444 +} 1.15445 +</script> 1.15446 +<img src="image_red.png" id="red_15.png" class="resource"> 1.15447 + 1.15448 +<!-- [[[ test_2d.pattern.paint.norepeat.outside.html ]]] --> 1.15449 + 1.15450 +<p>Canvas test: 2d.pattern.paint.norepeat.outside</p> 1.15451 +<canvas id="c478" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15452 +<script> 1.15453 + 1.15454 + 1.15455 +function test_2d_pattern_paint_norepeat_outside() { 1.15456 + 1.15457 +var canvas = document.getElementById('c478'); 1.15458 +var ctx = canvas.getContext('2d'); 1.15459 + 1.15460 +ctx.fillStyle = '#f00'; 1.15461 +ctx.fillRect(0, 0, 100, 50); 1.15462 + 1.15463 +var img = document.getElementById('red_16.png'); 1.15464 +var pattern = ctx.createPattern(img, 'no-repeat'); 1.15465 +ctx.fillStyle = '#0f0'; 1.15466 +ctx.fillRect(0, 0, 100, 50); 1.15467 + 1.15468 +ctx.fillStyle = pattern; 1.15469 +ctx.fillRect(0, -50, 100, 50); 1.15470 +ctx.fillRect(-100, 0, 100, 50); 1.15471 +ctx.fillRect(0, 50, 100, 50); 1.15472 +ctx.fillRect(100, 0, 100, 50); 1.15473 + 1.15474 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15475 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15476 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15477 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15478 + 1.15479 + 1.15480 +} 1.15481 +</script> 1.15482 +<img src="image_red.png" id="red_16.png" class="resource"> 1.15483 + 1.15484 +<!-- [[[ test_2d.pattern.paint.orientation.canvas.html ]]] --> 1.15485 + 1.15486 +<p>Canvas test: 2d.pattern.paint.orientation.canvas</p> 1.15487 +<!-- Testing: Canvas patterns do not get flipped when painted --> 1.15488 +<canvas id="c479" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15489 +<script> 1.15490 + 1.15491 + 1.15492 +function test_2d_pattern_paint_orientation_canvas() { 1.15493 + 1.15494 +var canvas = document.getElementById('c479'); 1.15495 +var ctx = canvas.getContext('2d'); 1.15496 + 1.15497 +ctx.fillStyle = '#f00'; 1.15498 +ctx.fillRect(0, 0, 100, 50); 1.15499 + 1.15500 +var canvas2 = document.createElement('canvas'); 1.15501 +canvas2.width = 100; 1.15502 +canvas2.height = 50; 1.15503 +var ctx2 = canvas2.getContext('2d'); 1.15504 +ctx2.fillStyle = '#f00'; 1.15505 +ctx2.fillRect(0, 0, 100, 25); 1.15506 +ctx2.fillStyle = '#0f0'; 1.15507 +ctx2.fillRect(0, 25, 100, 25); 1.15508 + 1.15509 +var pattern = ctx.createPattern(canvas2, 'no-repeat'); 1.15510 +ctx.fillStyle = pattern; 1.15511 +ctx.fillRect(0, 0, 100, 50); 1.15512 +ctx.fillStyle = '#0f0'; 1.15513 +ctx.fillRect(0, 0, 100, 25); 1.15514 + 1.15515 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15516 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15517 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15518 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15519 + 1.15520 + 1.15521 +} 1.15522 +</script> 1.15523 + 1.15524 +<!-- [[[ test_2d.pattern.paint.orientation.image.html ]]] --> 1.15525 + 1.15526 +<p>Canvas test: 2d.pattern.paint.orientation.image</p> 1.15527 +<!-- Testing: Image patterns do not get flipped when painted --> 1.15528 +<canvas id="c480" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15529 +<script> 1.15530 + 1.15531 + 1.15532 +function test_2d_pattern_paint_orientation_image() { 1.15533 + 1.15534 +var canvas = document.getElementById('c480'); 1.15535 +var ctx = canvas.getContext('2d'); 1.15536 + 1.15537 +ctx.fillStyle = '#f00'; 1.15538 +ctx.fillRect(0, 0, 100, 50); 1.15539 + 1.15540 +var img = document.getElementById('rrgg-256x256_1.png'); 1.15541 +var pattern = ctx.createPattern(img, 'no-repeat'); 1.15542 +ctx.fillStyle = pattern; 1.15543 +ctx.save(); 1.15544 +ctx.translate(0, -103); 1.15545 +ctx.fillRect(0, 103, 100, 50); 1.15546 +ctx.restore(); 1.15547 + 1.15548 +ctx.fillStyle = '#0f0'; 1.15549 +ctx.fillRect(0, 0, 100, 25); 1.15550 + 1.15551 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15552 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15553 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15554 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15555 + 1.15556 + 1.15557 +} 1.15558 +</script> 1.15559 +<img src="image_rrgg-256x256.png" id="rrgg-256x256_1.png" class="resource"> 1.15560 + 1.15561 +<!-- [[[ test_2d.pattern.paint.repeat.basic.html ]]] --> 1.15562 + 1.15563 +<p>Canvas test: 2d.pattern.paint.repeat.basic</p> 1.15564 +<canvas id="c481" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15565 +<script> 1.15566 + 1.15567 + 1.15568 +function test_2d_pattern_paint_repeat_basic() { 1.15569 + 1.15570 +var canvas = document.getElementById('c481'); 1.15571 +var ctx = canvas.getContext('2d'); 1.15572 + 1.15573 +ctx.fillStyle = '#f00'; 1.15574 +ctx.fillRect(0, 0, 100, 50); 1.15575 + 1.15576 +var img = document.getElementById('green-16x16_1.png'); 1.15577 +var pattern = ctx.createPattern(img, 'repeat'); 1.15578 +ctx.fillStyle = pattern; 1.15579 +ctx.fillRect(0, 0, 100, 50); 1.15580 + 1.15581 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15582 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15583 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15584 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15585 + 1.15586 + 1.15587 +} 1.15588 +</script> 1.15589 +<img src="image_green-16x16.png" id="green-16x16_1.png" class="resource"> 1.15590 + 1.15591 +<!-- [[[ test_2d.pattern.paint.repeat.coord1.html ]]] --> 1.15592 + 1.15593 +<p>Canvas test: 2d.pattern.paint.repeat.coord1</p> 1.15594 +<canvas id="c482" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15595 +<script> 1.15596 + 1.15597 + 1.15598 +function test_2d_pattern_paint_repeat_coord1() { 1.15599 + 1.15600 +var canvas = document.getElementById('c482'); 1.15601 +var ctx = canvas.getContext('2d'); 1.15602 + 1.15603 +ctx.fillStyle = '#f00'; 1.15604 +ctx.fillRect(0, 0, 100, 50); 1.15605 + 1.15606 +var img = document.getElementById('rgrg-256x256_3.png'); 1.15607 +var pattern = ctx.createPattern(img, 'repeat'); 1.15608 +ctx.fillStyle = pattern; 1.15609 +ctx.translate(-128, -78); 1.15610 +ctx.fillRect(128, 78, 100, 50); 1.15611 + 1.15612 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15613 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15614 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15615 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15616 + 1.15617 + 1.15618 +} 1.15619 +</script> 1.15620 +<img src="image_rgrg-256x256.png" id="rgrg-256x256_3.png" class="resource"> 1.15621 + 1.15622 +<!-- [[[ test_2d.pattern.paint.repeat.coord2.html ]]] --> 1.15623 + 1.15624 +<p>Canvas test: 2d.pattern.paint.repeat.coord2</p> 1.15625 +<canvas id="c483" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15626 +<script> 1.15627 + 1.15628 + 1.15629 +function test_2d_pattern_paint_repeat_coord2() { 1.15630 + 1.15631 +var canvas = document.getElementById('c483'); 1.15632 +var ctx = canvas.getContext('2d'); 1.15633 + 1.15634 +var img = document.getElementById('ggrr-256x256_3.png'); 1.15635 +var pattern = ctx.createPattern(img, 'repeat'); 1.15636 +ctx.fillStyle = pattern; 1.15637 +ctx.fillRect(0, 0, 100, 50); 1.15638 + 1.15639 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15640 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15641 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15642 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15643 + 1.15644 + 1.15645 +} 1.15646 +</script> 1.15647 +<img src="image_ggrr-256x256.png" id="ggrr-256x256_3.png" class="resource"> 1.15648 + 1.15649 +<!-- [[[ test_2d.pattern.paint.repeat.coord3.html ]]] --> 1.15650 + 1.15651 +<p>Canvas test: 2d.pattern.paint.repeat.coord3</p> 1.15652 +<canvas id="c484" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15653 +<script> 1.15654 + 1.15655 + 1.15656 + 1.15657 +function test_2d_pattern_paint_repeat_coord3() { 1.15658 + 1.15659 +var canvas = document.getElementById('c484'); 1.15660 +var ctx = canvas.getContext('2d'); 1.15661 + 1.15662 +var img = document.getElementById('rgrg-256x256_4.png'); 1.15663 +var pattern = ctx.createPattern(img, 'repeat'); 1.15664 +ctx.fillStyle = pattern; 1.15665 +ctx.fillRect(0, 0, 100, 50); 1.15666 + 1.15667 +ctx.translate(-128, -78); 1.15668 +ctx.fillRect(128, 78, 100, 50); 1.15669 + 1.15670 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15671 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15672 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15673 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15674 +} 1.15675 +</script> 1.15676 +<img src="image_rgrg-256x256.png" id="rgrg-256x256_4.png" class="resource"> 1.15677 + 1.15678 +<!-- [[[ test_2d.pattern.paint.repeat.outside.html ]]] --> 1.15679 + 1.15680 +<p>Canvas test: 2d.pattern.paint.repeat.outside</p> 1.15681 +<canvas id="c485" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15682 +<script> 1.15683 + 1.15684 + 1.15685 +function test_2d_pattern_paint_repeat_outside() { 1.15686 + 1.15687 +var canvas = document.getElementById('c485'); 1.15688 +var ctx = canvas.getContext('2d'); 1.15689 + 1.15690 +ctx.fillStyle = '#f00'; 1.15691 +ctx.fillRect(0, 0, 100, 50); 1.15692 + 1.15693 +var img = document.getElementById('green-16x16_2.png'); 1.15694 +var pattern = ctx.createPattern(img, 'repeat'); 1.15695 +ctx.fillStyle = pattern; 1.15696 +ctx.translate(50, 25); 1.15697 +ctx.fillRect(-50, -25, 100, 50); 1.15698 + 1.15699 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15700 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15701 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15702 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15703 + 1.15704 + 1.15705 +} 1.15706 +</script> 1.15707 +<img src="image_green-16x16.png" id="green-16x16_2.png" class="resource"> 1.15708 + 1.15709 +<!-- [[[ test_2d.pattern.paint.repeatx.basic.html ]]] --> 1.15710 + 1.15711 +<p>Canvas test: 2d.pattern.paint.repeatx.basic</p> 1.15712 +<canvas id="c486" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15713 +<script> 1.15714 + 1.15715 + 1.15716 +function test_2d_pattern_paint_repeatx_basic() { 1.15717 + 1.15718 +var canvas = document.getElementById('c486'); 1.15719 +var ctx = canvas.getContext('2d'); 1.15720 + 1.15721 +ctx.fillStyle = '#0f0'; 1.15722 +ctx.fillRect(0, 0, 100, 50); 1.15723 +ctx.fillStyle = '#f00'; 1.15724 +ctx.fillRect(0, 0, 100, 16); 1.15725 + 1.15726 +var img = document.getElementById('green-16x16_3.png'); 1.15727 +var pattern = ctx.createPattern(img, 'repeat-x'); 1.15728 +ctx.fillStyle = pattern; 1.15729 +ctx.fillRect(0, 0, 100, 50); 1.15730 + 1.15731 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15732 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15733 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15734 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15735 + 1.15736 + 1.15737 +} 1.15738 +</script> 1.15739 +<img src="image_green-16x16.png" id="green-16x16_3.png" class="resource"> 1.15740 + 1.15741 +<!-- [[[ test_2d.pattern.paint.repeatx.coord1.html ]]] --> 1.15742 + 1.15743 +<p>Canvas test: 2d.pattern.paint.repeatx.coord1</p> 1.15744 +<canvas id="c487" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15745 +<script> 1.15746 + 1.15747 + 1.15748 + 1.15749 +function test_2d_pattern_paint_repeatx_coord1() { 1.15750 + 1.15751 +var canvas = document.getElementById('c487'); 1.15752 +var ctx = canvas.getContext('2d'); 1.15753 + 1.15754 +ctx.fillStyle = '#0f0'; 1.15755 +ctx.fillRect(0, 0, 100, 50); 1.15756 + 1.15757 +var img = document.getElementById('red-16x16_1.png'); 1.15758 +var pattern = ctx.createPattern(img, 'repeat-x'); 1.15759 +ctx.fillStyle = pattern; 1.15760 +ctx.translate(0, 16); 1.15761 +ctx.fillRect(0, -16, 100, 50); 1.15762 + 1.15763 +ctx.fillStyle = '#0f0'; 1.15764 +ctx.fillRect(0, 0, 100, 16); 1.15765 + 1.15766 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15767 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15768 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15769 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15770 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.15771 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.15772 +} 1.15773 +</script> 1.15774 +<img src="image_red-16x16.png" id="red-16x16_1.png" class="resource"> 1.15775 + 1.15776 +<!-- [[[ test_2d.pattern.paint.repeatx.outside.html ]]] --> 1.15777 + 1.15778 +<p>Canvas test: 2d.pattern.paint.repeatx.outside</p> 1.15779 +<canvas id="c488" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15780 +<script> 1.15781 + 1.15782 + 1.15783 + 1.15784 +function test_2d_pattern_paint_repeatx_outside() { 1.15785 + 1.15786 +var canvas = document.getElementById('c488'); 1.15787 +var ctx = canvas.getContext('2d'); 1.15788 + 1.15789 +ctx.fillStyle = '#0f0'; 1.15790 +ctx.fillRect(0, 0, 100, 50); 1.15791 + 1.15792 +var img = document.getElementById('red-16x16_2.png'); 1.15793 +var pattern = ctx.createPattern(img, 'repeat-x'); 1.15794 +ctx.fillStyle = pattern; 1.15795 +ctx.fillRect(0, 0, 100, 50); 1.15796 + 1.15797 +ctx.fillStyle = '#0f0'; 1.15798 +ctx.fillRect(0, 0, 100, 16); 1.15799 + 1.15800 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15801 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15802 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15803 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15804 +} 1.15805 +</script> 1.15806 +<img src="image_red-16x16.png" id="red-16x16_2.png" class="resource"> 1.15807 + 1.15808 +<!-- [[[ test_2d.pattern.paint.repeaty.basic.html ]]] --> 1.15809 + 1.15810 +<p>Canvas test: 2d.pattern.paint.repeaty.basic</p> 1.15811 +<canvas id="c489" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15812 +<script> 1.15813 + 1.15814 + 1.15815 +function test_2d_pattern_paint_repeaty_basic() { 1.15816 + 1.15817 +var canvas = document.getElementById('c489'); 1.15818 +var ctx = canvas.getContext('2d'); 1.15819 + 1.15820 +ctx.fillStyle = '#0f0'; 1.15821 +ctx.fillRect(0, 0, 100, 50); 1.15822 +ctx.fillStyle = '#f00'; 1.15823 +ctx.fillRect(0, 0, 16, 50); 1.15824 + 1.15825 +var img = document.getElementById('green-16x16_4.png'); 1.15826 +var pattern = ctx.createPattern(img, 'repeat-y'); 1.15827 +ctx.fillStyle = pattern; 1.15828 +ctx.fillRect(0, 0, 100, 50); 1.15829 + 1.15830 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15831 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15832 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15833 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15834 + 1.15835 + 1.15836 +} 1.15837 +</script> 1.15838 +<img src="image_green-16x16.png" id="green-16x16_4.png" class="resource"> 1.15839 + 1.15840 +<!-- [[[ test_2d.pattern.paint.repeaty.coord1.html ]]] --> 1.15841 + 1.15842 +<p>Canvas test: 2d.pattern.paint.repeaty.coord1</p> 1.15843 +<canvas id="c490" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15844 +<script> 1.15845 + 1.15846 + 1.15847 + 1.15848 +function test_2d_pattern_paint_repeaty_coord1() { 1.15849 + 1.15850 +var canvas = document.getElementById('c490'); 1.15851 +var ctx = canvas.getContext('2d'); 1.15852 + 1.15853 +ctx.fillStyle = '#0f0'; 1.15854 +ctx.fillRect(0, 0, 100, 50); 1.15855 + 1.15856 +var img = document.getElementById('red-16x16_3.png'); 1.15857 +var pattern = ctx.createPattern(img, 'repeat-y'); 1.15858 +ctx.fillStyle = pattern; 1.15859 +ctx.translate(48, 0); 1.15860 +ctx.fillRect(-48, 0, 100, 50); 1.15861 + 1.15862 +ctx.fillStyle = '#0f0'; 1.15863 +ctx.fillRect(0, 0, 16, 50); 1.15864 + 1.15865 +isPixel(ctx, 50,1, 0,255,0,255, 0); 1.15866 +isPixel(ctx, 50,48, 0,255,0,255, 0); 1.15867 + 1.15868 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15869 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15870 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15871 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15872 +} 1.15873 +</script> 1.15874 +<img src="image_red-16x16.png" id="red-16x16_3.png" class="resource"> 1.15875 + 1.15876 +<!-- [[[ test_2d.pattern.paint.repeaty.outside.html ]]] --> 1.15877 + 1.15878 +<p>Canvas test: 2d.pattern.paint.repeaty.outside</p> 1.15879 +<canvas id="c491" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15880 +<script> 1.15881 + 1.15882 + 1.15883 + 1.15884 +function test_2d_pattern_paint_repeaty_outside() { 1.15885 + 1.15886 +var canvas = document.getElementById('c491'); 1.15887 +var ctx = canvas.getContext('2d'); 1.15888 + 1.15889 +ctx.fillStyle = '#0f0'; 1.15890 +ctx.fillRect(0, 0, 100, 50); 1.15891 + 1.15892 +var img = document.getElementById('red-16x16_4.png'); 1.15893 +var pattern = ctx.createPattern(img, 'repeat-y'); 1.15894 +ctx.fillStyle = pattern; 1.15895 +ctx.fillRect(0, 0, 100, 50); 1.15896 + 1.15897 +ctx.fillStyle = '#0f0'; 1.15898 +ctx.fillRect(0, 0, 16, 50); 1.15899 + 1.15900 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15901 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15902 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15903 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15904 +} 1.15905 +</script> 1.15906 +<img src="image_red-16x16.png" id="red-16x16_4.png" class="resource"> 1.15907 + 1.15908 +<!-- [[[ test_2d.pattern.repeat.case.html ]]] --> 1.15909 + 1.15910 +<p>Canvas test: 2d.pattern.repeat.case</p> 1.15911 +<canvas id="c492" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15912 +<script> 1.15913 + 1.15914 +function test_2d_pattern_repeat_case() { 1.15915 + 1.15916 +var canvas = document.getElementById('c492'); 1.15917 +var ctx = canvas.getContext('2d'); 1.15918 + 1.15919 +var _thrown = undefined; try { 1.15920 + ctx.createPattern(canvas, "Repeat"); 1.15921 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "SyntaxError" && _thrown.code == DOMException.SYNTAX_ERR, "should throw SyntaxError"); 1.15922 + 1.15923 + 1.15924 +} 1.15925 +</script> 1.15926 + 1.15927 +<!-- [[[ test_2d.pattern.repeat.empty.html ]]] --> 1.15928 + 1.15929 +<p>Canvas test: 2d.pattern.repeat.empty</p> 1.15930 +<canvas id="c493" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15931 +<script> 1.15932 + 1.15933 + 1.15934 +function test_2d_pattern_repeat_empty() { 1.15935 + 1.15936 +var canvas = document.getElementById('c493'); 1.15937 +var ctx = canvas.getContext('2d'); 1.15938 + 1.15939 +ctx.fillStyle = '#f00'; 1.15940 +ctx.fillRect(0, 0, 100, 50); 1.15941 +var img = document.getElementById('green-1x1_1.png'); 1.15942 +var pattern = ctx.createPattern(img, ""); 1.15943 +ctx.fillStyle = pattern; 1.15944 +ctx.fillRect(0, 0, 200, 50); 1.15945 + 1.15946 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15947 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15948 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15949 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15950 + 1.15951 + 1.15952 +} 1.15953 +</script> 1.15954 +<img src="image_green-1x1.png" id="green-1x1_1.png" class="resource"> 1.15955 + 1.15956 +<!-- [[[ test_2d.pattern.repeat.null.html ]]] --> 1.15957 + 1.15958 +<p>Canvas test: 2d.pattern.repeat.null</p> 1.15959 +<canvas id="c494" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15960 +<script> 1.15961 + 1.15962 + 1.15963 +function test_2d_pattern_repeat_null() { 1.15964 + 1.15965 +var canvas = document.getElementById('c494'); 1.15966 +var ctx = canvas.getContext('2d'); 1.15967 + 1.15968 +ctx.fillStyle = '#f00'; 1.15969 +ctx.fillRect(0, 0, 100, 50); 1.15970 +var img = document.getElementById('green-1x1_2.png'); 1.15971 +var pattern = ctx.createPattern(img, null); 1.15972 +ctx.fillStyle = pattern; 1.15973 +ctx.fillRect(0, 0, 100, 50); 1.15974 + 1.15975 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.15976 +isPixel(ctx, 98,1, 0,255,0,255, 0); 1.15977 +isPixel(ctx, 1,48, 0,255,0,255, 0); 1.15978 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.15979 + 1.15980 + 1.15981 +} 1.15982 +</script> 1.15983 +<img src="image_green-1x1.png" id="green-1x1_2.png" class="resource"> 1.15984 + 1.15985 +<!-- [[[ test_2d.pattern.repeat.nullsuffix.html ]]] --> 1.15986 + 1.15987 +<p>Canvas test: 2d.pattern.repeat.nullsuffix</p> 1.15988 +<canvas id="c495" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.15989 +<script> 1.15990 + 1.15991 +function test_2d_pattern_repeat_nullsuffix() { 1.15992 + 1.15993 +var canvas = document.getElementById('c495'); 1.15994 +var ctx = canvas.getContext('2d'); 1.15995 + 1.15996 +var _thrown = undefined; try { 1.15997 + ctx.createPattern(canvas, "repeat\0"); 1.15998 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "SyntaxError" && _thrown.code == DOMException.SYNTAX_ERR, "should throw SyntaxError"); 1.15999 + 1.16000 + 1.16001 +} 1.16002 +</script> 1.16003 + 1.16004 +<!-- [[[ test_2d.pattern.repeat.undefined.html ]]] --> 1.16005 + 1.16006 +<p>Canvas test: 2d.pattern.repeat.undefined</p> 1.16007 +<canvas id="c496" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16008 +<script> 1.16009 + 1.16010 +function test_2d_pattern_repeat_undefined() { 1.16011 + 1.16012 +var canvas = document.getElementById('c496'); 1.16013 +var ctx = canvas.getContext('2d'); 1.16014 + 1.16015 +var _thrown = undefined; try { 1.16016 + ctx.createPattern(canvas, undefined); 1.16017 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "SyntaxError" && _thrown.code == DOMException.SYNTAX_ERR, "should throw SyntaxError"); 1.16018 + 1.16019 + 1.16020 +} 1.16021 +</script> 1.16022 + 1.16023 +<!-- [[[ test_2d.pattern.repeat.unrecognised.html ]]] --> 1.16024 + 1.16025 +<p>Canvas test: 2d.pattern.repeat.unrecognised</p> 1.16026 +<canvas id="c497" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16027 +<script> 1.16028 + 1.16029 +function test_2d_pattern_repeat_unrecognised() { 1.16030 + 1.16031 +var canvas = document.getElementById('c497'); 1.16032 +var ctx = canvas.getContext('2d'); 1.16033 + 1.16034 +var _thrown = undefined; try { 1.16035 + ctx.createPattern(canvas, "invalid"); 1.16036 +} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "SyntaxError" && _thrown.code == DOMException.SYNTAX_ERR, "should throw SyntaxError"); 1.16037 + 1.16038 + 1.16039 +} 1.16040 +</script> 1.16041 + 1.16042 +<!-- [[[ test_2d.scaled.html ]]] --> 1.16043 + 1.16044 +<p>Canvas test: 2d.scaled</p> 1.16045 +<!-- Testing: CSS-scaled canvases get drawn correctly --> 1.16046 +<canvas id="c498" width="50" height="25" style="width: 100px; height: 50px"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16047 +<script> 1.16048 + 1.16049 +function test_2d_scaled() { 1.16050 + 1.16051 +var canvas = document.getElementById('c498'); 1.16052 +var ctx = canvas.getContext('2d'); 1.16053 + 1.16054 +ctx.fillStyle = '#00f'; 1.16055 +ctx.fillRect(0, 0, 50, 25); 1.16056 +ctx.fillStyle = '#0ff'; 1.16057 +ctx.fillRect(0, 0, 25, 10); 1.16058 + 1.16059 +todo(false, "test completed successfully"); // (Bug 483989) 1.16060 + 1.16061 +} 1.16062 + 1.16063 +</script> 1.16064 +<!-- [[[ test_2d.shadow.alpha.1.html ]]] --> 1.16065 + 1.16066 +<p>Canvas test: 2d.shadow.alpha.1</p> 1.16067 +<canvas id="c499" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16068 +<script> 1.16069 + 1.16070 + 1.16071 +function test_2d_shadow_alpha_1() { 1.16072 + 1.16073 +var canvas = document.getElementById('c499'); 1.16074 +var ctx = canvas.getContext('2d'); 1.16075 + 1.16076 +ctx.fillStyle = '#0f0'; 1.16077 +ctx.fillRect(0, 0, 100, 50); 1.16078 +ctx.shadowColor = 'rgba(255, 0, 0, 0.01)'; 1.16079 +ctx.shadowOffsetY = 50; 1.16080 +ctx.fillRect(0, -50, 100, 50); 1.16081 + 1.16082 +isPixel(ctx, 50,25, 0,255,0,255, 4); 1.16083 + 1.16084 + 1.16085 +} 1.16086 +</script> 1.16087 + 1.16088 +<!-- [[[ test_2d.shadow.alpha.2.html ]]] --> 1.16089 + 1.16090 +<p>Canvas test: 2d.shadow.alpha.2</p> 1.16091 +<canvas id="c500" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16092 +<script> 1.16093 + 1.16094 + 1.16095 + 1.16096 +function test_2d_shadow_alpha_2() { 1.16097 + 1.16098 +var canvas = document.getElementById('c500'); 1.16099 +var ctx = canvas.getContext('2d'); 1.16100 + 1.16101 +ctx.fillStyle = '#f00'; 1.16102 +ctx.fillRect(0, 0, 100, 50); 1.16103 +ctx.shadowColor = 'rgba(0, 0, 255, 0.5)'; 1.16104 +ctx.shadowOffsetY = 50; 1.16105 +ctx.fillRect(0, -50, 100, 50); 1.16106 + 1.16107 +isPixel(ctx, 50,25, 127,0,127,255, 2); 1.16108 + 1.16109 + 1.16110 +} 1.16111 +</script> 1.16112 + 1.16113 +<!-- [[[ test_2d.shadow.alpha.3.html ]]] --> 1.16114 + 1.16115 +<p>Canvas test: 2d.shadow.alpha.3</p> 1.16116 +<canvas id="c501" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16117 +<script> 1.16118 + 1.16119 + 1.16120 + 1.16121 +function test_2d_shadow_alpha_3() { 1.16122 + 1.16123 +var canvas = document.getElementById('c501'); 1.16124 +var ctx = canvas.getContext('2d'); 1.16125 + 1.16126 +ctx.fillStyle = '#f00'; 1.16127 +ctx.fillRect(0, 0, 100, 50); 1.16128 +ctx.fillStyle = '#f00'; // (work around broken Firefox globalAlpha caching) 1.16129 +ctx.shadowColor = '#00f'; 1.16130 +ctx.shadowOffsetY = 50; 1.16131 +ctx.globalAlpha = 0.5; 1.16132 +ctx.fillRect(0, -50, 100, 50); 1.16133 + 1.16134 +isPixel(ctx, 50,25, 127,0,127,255, 2); 1.16135 + 1.16136 + 1.16137 +} 1.16138 +</script> 1.16139 + 1.16140 +<!-- [[[ test_2d.shadow.alpha.4.html ]]] --> 1.16141 + 1.16142 +<p>Canvas test: 2d.shadow.alpha.4</p> 1.16143 +<canvas id="c502" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16144 +<script> 1.16145 + 1.16146 + 1.16147 + 1.16148 +function test_2d_shadow_alpha_4() { 1.16149 + 1.16150 +var canvas = document.getElementById('c502'); 1.16151 +var ctx = canvas.getContext('2d'); 1.16152 + 1.16153 +ctx.fillStyle = '#f00'; 1.16154 +ctx.fillRect(0, 0, 100, 50); 1.16155 +ctx.fillStyle = '#f00'; // (work around broken Firefox globalAlpha caching) 1.16156 +ctx.shadowColor = 'rgba(0, 0, 255, 0.707)'; 1.16157 +ctx.shadowOffsetY = 50; 1.16158 +ctx.globalAlpha = 0.707; 1.16159 +ctx.fillRect(0, -50, 100, 50); 1.16160 + 1.16161 +isPixel(ctx, 50,25, 127,0,127,255, 2); 1.16162 + 1.16163 + 1.16164 +} 1.16165 +</script> 1.16166 + 1.16167 +<!-- [[[ test_2d.shadow.alpha.5.html ]]] --> 1.16168 + 1.16169 +<p>Canvas test: 2d.shadow.alpha.5</p> 1.16170 +<canvas id="c503" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16171 +<script> 1.16172 + 1.16173 + 1.16174 + 1.16175 +function test_2d_shadow_alpha_5() { 1.16176 + 1.16177 +var canvas = document.getElementById('c503'); 1.16178 +var ctx = canvas.getContext('2d'); 1.16179 + 1.16180 +ctx.fillStyle = '#f00'; 1.16181 +ctx.fillRect(0, 0, 100, 50); 1.16182 +ctx.fillStyle = 'rgba(64, 0, 0, 0.5)'; 1.16183 +ctx.shadowColor = '#00f'; 1.16184 +ctx.shadowOffsetY = 50; 1.16185 +ctx.fillRect(0, -50, 100, 50); 1.16186 + 1.16187 +isPixel(ctx, 50,25, 127,0,127,255, 2); 1.16188 + 1.16189 + 1.16190 +} 1.16191 +</script> 1.16192 + 1.16193 +<!-- [[[ test_2d.shadow.attributes.shadowBlur.1.html ]]] --> 1.16194 + 1.16195 +<p>Canvas test: 2d.shadow.attributes.shadowBlur.1</p> 1.16196 +<canvas id="c504" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16197 +<script> 1.16198 + 1.16199 +function test_2d_shadow_attributes_shadowBlur_1() { 1.16200 + 1.16201 +var canvas = document.getElementById('c504'); 1.16202 +var ctx = canvas.getContext('2d'); 1.16203 + 1.16204 +ctx.shadowBlur = 1; 1.16205 +ok(ctx.shadowBlur === 1, "ctx.shadowBlur === 1"); 1.16206 +ctx.shadowBlur = 0.5; 1.16207 +ok(ctx.shadowBlur === 0.5, "ctx.shadowBlur === 0.5"); 1.16208 +ctx.shadowBlur = 1e6; 1.16209 +ok(ctx.shadowBlur === 1e6, "ctx.shadowBlur === 1e6"); 1.16210 +ctx.shadowBlur = 1; 1.16211 +ctx.shadowBlur = -2; 1.16212 +ok(ctx.shadowBlur === 1, "ctx.shadowBlur === 1"); 1.16213 +ctx.shadowBlur = 0; 1.16214 +ok(ctx.shadowBlur === 0, "ctx.shadowBlur === 0"); 1.16215 + 1.16216 + 1.16217 +} 1.16218 +</script> 1.16219 + 1.16220 +<!-- [[[ test_2d.shadow.attributes.shadowBlur.2.html ]]] --> 1.16221 + 1.16222 +<p>Canvas test: 2d.shadow.attributes.shadowBlur.2</p> 1.16223 +<canvas id="c505" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16224 +<script> 1.16225 + 1.16226 +function test_2d_shadow_attributes_shadowBlur_2() { 1.16227 + 1.16228 +var canvas = document.getElementById('c505'); 1.16229 +var ctx = canvas.getContext('2d'); 1.16230 + 1.16231 +ctx.shadowBlur = 1; 1.16232 +ctx.shadowBlur = -2; 1.16233 +ok(ctx.shadowBlur === 1, "ctx.shadowBlur === 1"); 1.16234 + 1.16235 +ctx.shadowBlur = 1; 1.16236 +ctx.shadowBlur = Infinity; 1.16237 +ok(ctx.shadowBlur === 1, "ctx.shadowBlur === 1"); 1.16238 + 1.16239 +ctx.shadowBlur = 1; 1.16240 +ctx.shadowBlur = -Infinity; 1.16241 +ok(ctx.shadowBlur === 1, "ctx.shadowBlur === 1"); 1.16242 + 1.16243 +ctx.shadowBlur = 1; 1.16244 +ctx.shadowBlur = NaN; 1.16245 +ok(ctx.shadowBlur === 1, "ctx.shadowBlur === 1"); 1.16246 + 1.16247 +} 1.16248 +</script> 1.16249 + 1.16250 +<!-- [[[ test_2d.shadow.attributes.shadowColor.1.html ]]] --> 1.16251 + 1.16252 +<p>Canvas test: 2d.shadow.attributes.shadowColor.1</p> 1.16253 +<canvas id="c506" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16254 +<script> 1.16255 + 1.16256 +function test_2d_shadow_attributes_shadowColor_1() { 1.16257 + 1.16258 +var canvas = document.getElementById('c506'); 1.16259 +var ctx = canvas.getContext('2d'); 1.16260 + 1.16261 +ctx.shadowColor = 'lime'; 1.16262 +ok(ctx.shadowColor === '#00ff00', "ctx.shadowColor === '#00ff00'"); 1.16263 +ctx.shadowColor = 'RGBA(0,255, 0,0)'; 1.16264 +is(ctx.shadowColor, 'rgba(0, 255, 0, 0)', "ctx.shadowColor should be what we set it to"); 1.16265 + 1.16266 + 1.16267 +} 1.16268 +</script> 1.16269 + 1.16270 +<!-- [[[ test_2d.shadow.attributes.shadowColor.2.html ]]] --> 1.16271 + 1.16272 +<p>Canvas test: 2d.shadow.attributes.shadowColor.2</p> 1.16273 +<canvas id="c507" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16274 +<script> 1.16275 + 1.16276 +function test_2d_shadow_attributes_shadowColor_2() { 1.16277 + 1.16278 +var canvas = document.getElementById('c507'); 1.16279 +var ctx = canvas.getContext('2d'); 1.16280 + 1.16281 +ctx.shadowColor = '#00ff00'; 1.16282 +ctx.shadowColor = 'bogus'; 1.16283 +ok(ctx.shadowColor === '#00ff00', "ctx.shadowColor === '#00ff00'"); 1.16284 +ctx.shadowColor = ctx; 1.16285 +ok(ctx.shadowColor === '#00ff00', "ctx.shadowColor === '#00ff00'"); 1.16286 +ctx.shadowColor = undefined; 1.16287 +ok(ctx.shadowColor === '#00ff00', "ctx.shadowColor === '#00ff00'"); 1.16288 + 1.16289 + 1.16290 +} 1.16291 +</script> 1.16292 + 1.16293 +<!-- [[[ test_2d.shadow.attributes.shadowOffset.1.html ]]] --> 1.16294 + 1.16295 +<p>Canvas test: 2d.shadow.attributes.shadowOffset.1</p> 1.16296 +<canvas id="c508" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16297 +<script> 1.16298 + 1.16299 +function test_2d_shadow_attributes_shadowOffset_1() { 1.16300 + 1.16301 +var canvas = document.getElementById('c508'); 1.16302 +var ctx = canvas.getContext('2d'); 1.16303 + 1.16304 +ctx.shadowOffsetX = 1; 1.16305 +ctx.shadowOffsetY = 2; 1.16306 +ok(ctx.shadowOffsetX === 1, "ctx.shadowOffsetX === 1"); 1.16307 +ok(ctx.shadowOffsetY === 2, "ctx.shadowOffsetY === 2"); 1.16308 +ctx.shadowOffsetX = 0.5; 1.16309 +ctx.shadowOffsetY = 0.25; 1.16310 +ok(ctx.shadowOffsetX === 0.5, "ctx.shadowOffsetX === 0.5"); 1.16311 +ok(ctx.shadowOffsetY === 0.25, "ctx.shadowOffsetY === 0.25"); 1.16312 +ctx.shadowOffsetX = -0.5; 1.16313 +ctx.shadowOffsetY = -0.25; 1.16314 +ok(ctx.shadowOffsetX === -0.5, "ctx.shadowOffsetX === -0.5"); 1.16315 +ok(ctx.shadowOffsetY === -0.25, "ctx.shadowOffsetY === -0.25"); 1.16316 +ctx.shadowOffsetX = 1e6; 1.16317 +ctx.shadowOffsetY = 1e6; 1.16318 +ok(ctx.shadowOffsetX === 1e6, "ctx.shadowOffsetX === 1e6"); 1.16319 +ok(ctx.shadowOffsetY === 1e6, "ctx.shadowOffsetY === 1e6"); 1.16320 + 1.16321 + 1.16322 +} 1.16323 +</script> 1.16324 + 1.16325 +<!-- [[[ test_2d.shadow.attributes.shadowOffset.2.html ]]] --> 1.16326 + 1.16327 +<p>Canvas test: 2d.shadow.attributes.shadowOffset.2</p> 1.16328 +<canvas id="c509" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16329 +<script> 1.16330 + 1.16331 +function test_2d_shadow_attributes_shadowOffset_2() { 1.16332 + 1.16333 +var canvas = document.getElementById('c509'); 1.16334 +var ctx = canvas.getContext('2d'); 1.16335 + 1.16336 +ctx.shadowOffsetX = 1; 1.16337 +ctx.shadowOffsetY = 2; 1.16338 +ctx.shadowOffsetX = Infinity; 1.16339 +ctx.shadowOffsetY = Infinity; 1.16340 +ok(ctx.shadowOffsetX === 1, "ctx.shadowOffsetX === 1"); 1.16341 +ok(ctx.shadowOffsetY === 2, "ctx.shadowOffsetY === 2"); 1.16342 + 1.16343 +ctx.shadowOffsetX = 1; 1.16344 +ctx.shadowOffsetY = 2; 1.16345 +ctx.shadowOffsetX = -Infinity; 1.16346 +ctx.shadowOffsetY = -Infinity; 1.16347 +ok(ctx.shadowOffsetX === 1, "ctx.shadowOffsetX === 1"); 1.16348 +ok(ctx.shadowOffsetY === 2, "ctx.shadowOffsetY === 2"); 1.16349 + 1.16350 +ctx.shadowOffsetX = 1; 1.16351 +ctx.shadowOffsetY = 2; 1.16352 +ctx.shadowOffsetX = NaN; 1.16353 +ctx.shadowOffsetY = NaN; 1.16354 +ok(ctx.shadowOffsetX === 1, "ctx.shadowOffsetX === 1"); 1.16355 +ok(ctx.shadowOffsetY === 2, "ctx.shadowOffsetY === 2"); 1.16356 + 1.16357 +} 1.16358 +</script> 1.16359 + 1.16360 +<!-- [[[ test_2d.shadow.basic.1.html ]]] --> 1.16361 + 1.16362 +<p>Canvas test: 2d.shadow.basic.1</p> 1.16363 +<canvas id="c510" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16364 +<script> 1.16365 + 1.16366 + 1.16367 +function test_2d_shadow_basic_1() { 1.16368 + 1.16369 +var canvas = document.getElementById('c510'); 1.16370 +var ctx = canvas.getContext('2d'); 1.16371 + 1.16372 +ctx.shadowColor = '#f00'; 1.16373 +ctx.fillStyle = '#0f0'; 1.16374 +ctx.fillRect(0, 0, 100, 50); 1.16375 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.16376 + 1.16377 + 1.16378 +} 1.16379 +</script> 1.16380 + 1.16381 +<!-- [[[ test_2d.shadow.basic.2.html ]]] --> 1.16382 + 1.16383 +<p>Canvas test: 2d.shadow.basic.2</p> 1.16384 +<canvas id="c511" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16385 +<script> 1.16386 + 1.16387 + 1.16388 +function test_2d_shadow_basic_2() { 1.16389 + 1.16390 +var canvas = document.getElementById('c511'); 1.16391 +var ctx = canvas.getContext('2d'); 1.16392 + 1.16393 +ctx.fillStyle = '#0f0'; 1.16394 +ctx.fillRect(0, 0, 100, 50); 1.16395 +ctx.fillStyle = '#f00'; 1.16396 +ctx.shadowColor = '#f00'; 1.16397 +ctx.fillRect(0, -50, 100, 50); 1.16398 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.16399 + 1.16400 + 1.16401 +} 1.16402 +</script> 1.16403 + 1.16404 +<!-- [[[ test_2d.shadow.blur.high.html ]]] --> 1.16405 + 1.16406 +<p>Canvas test: 2d.shadow.blur.high</p> 1.16407 +<canvas id="c512" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16408 +<script> 1.16409 + 1.16410 +function test_2d_shadow_blur_high() { 1.16411 + 1.16412 +var canvas = document.getElementById('c512'); 1.16413 +var ctx = canvas.getContext('2d'); 1.16414 + 1.16415 +ctx.fillStyle = '#ff0'; 1.16416 +ctx.fillRect(0, 0, 100, 50); 1.16417 +ctx.shadowColor = '#00f'; 1.16418 +ctx.shadowOffsetY = 0; 1.16419 +ctx.shadowBlur = 555.6; 1.16420 +ctx.fillRect(-200, -200, 200, 400); 1.16421 + 1.16422 +todo(false, "test completed successfully"); // (Bug 483989) 1.16423 + 1.16424 +} 1.16425 + 1.16426 +</script> 1.16427 +<!-- [[[ test_2d.shadow.blur.low.html ]]] --> 1.16428 + 1.16429 +<p>Canvas test: 2d.shadow.blur.low</p> 1.16430 +<canvas id="c513" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16431 +<script> 1.16432 + 1.16433 +function test_2d_shadow_blur_low() { 1.16434 + 1.16435 +var canvas = document.getElementById('c513'); 1.16436 +var ctx = canvas.getContext('2d'); 1.16437 + 1.16438 +ctx.fillStyle = '#ff0'; 1.16439 +ctx.fillRect(0, 0, 100, 50); 1.16440 +ctx.shadowColor = '#00f'; 1.16441 +ctx.shadowOffsetY = 25; 1.16442 +for (var x = 0; x < 100; ++x) { 1.16443 + ctx.save(); 1.16444 + ctx.beginPath(); 1.16445 + ctx.rect(x, 0, 1, 50); 1.16446 + ctx.clip(); 1.16447 + ctx.shadowBlur = x; 1.16448 + ctx.fillRect(-200, -200, 500, 200); 1.16449 + ctx.restore(); 1.16450 +} 1.16451 + 1.16452 +todo(false, "test completed successfully"); // (Bug 483989) 1.16453 + 1.16454 +} 1.16455 +</script> 1.16456 +<!-- [[[ test_2d.shadow.canvas.alpha.html ]]] --> 1.16457 + 1.16458 +<p>Canvas test: 2d.shadow.canvas.alpha</p> 1.16459 +<canvas id="c514" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16460 +<script> 1.16461 + 1.16462 + 1.16463 + 1.16464 +function test_2d_shadow_canvas_alpha() { 1.16465 + 1.16466 +var canvas = document.getElementById('c514'); 1.16467 +var ctx = canvas.getContext('2d'); 1.16468 + 1.16469 +var canvas2 = document.createElement('canvas'); 1.16470 +canvas2.width = 100; 1.16471 +canvas2.height = 50; 1.16472 +var ctx2 = canvas2.getContext('2d'); 1.16473 +ctx2.fillStyle = 'rgba(255, 0, 0, 0.5)'; 1.16474 +ctx2.fillRect(0, 0, 100, 50); 1.16475 + 1.16476 +ctx.fillStyle = '#f00'; 1.16477 +ctx.fillRect(0, 0, 100, 50); 1.16478 +ctx.shadowOffsetY = 50; 1.16479 +ctx.shadowColor = '#00f'; 1.16480 +ctx.drawImage(canvas2, 0, -50); 1.16481 + 1.16482 +isPixel(ctx, 50,25, 127,0,127,255, 2); 1.16483 + 1.16484 + 1.16485 +} 1.16486 +</script> 1.16487 +<img src="image_transparent50.png" id="transparent50_1.png" class="resource"> 1.16488 + 1.16489 +<!-- [[[ test_2d.shadow.canvas.basic.html ]]] --> 1.16490 + 1.16491 +<p>Canvas test: 2d.shadow.canvas.basic</p> 1.16492 +<canvas id="c515" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16493 +<script> 1.16494 + 1.16495 + 1.16496 + 1.16497 +function test_2d_shadow_canvas_basic() { 1.16498 + 1.16499 +var canvas = document.getElementById('c515'); 1.16500 +var ctx = canvas.getContext('2d'); 1.16501 + 1.16502 +var canvas2 = document.createElement('canvas'); 1.16503 +canvas2.width = 100; 1.16504 +canvas2.height = 50; 1.16505 +var ctx2 = canvas2.getContext('2d'); 1.16506 +ctx2.fillStyle = '#f00'; 1.16507 +ctx2.fillRect(0, 0, 100, 50); 1.16508 + 1.16509 +ctx.fillStyle = '#f00'; 1.16510 +ctx.fillRect(0, 0, 100, 50); 1.16511 +ctx.shadowColor = '#0f0'; 1.16512 +ctx.shadowOffsetY = 50; 1.16513 +ctx.drawImage(canvas2, 0, -50); 1.16514 + 1.16515 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.16516 + 1.16517 + 1.16518 +} 1.16519 +</script> 1.16520 + 1.16521 +<!-- [[[ test_2d.shadow.canvas.transparent.1.html ]]] --> 1.16522 + 1.16523 +<p>Canvas test: 2d.shadow.canvas.transparent.1</p> 1.16524 +<canvas id="c516" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16525 +<script> 1.16526 + 1.16527 + 1.16528 +function test_2d_shadow_canvas_transparent_1() { 1.16529 + 1.16530 +var canvas = document.getElementById('c516'); 1.16531 +var ctx = canvas.getContext('2d'); 1.16532 + 1.16533 +var canvas2 = document.createElement('canvas'); 1.16534 +canvas2.width = 100; 1.16535 +canvas2.height = 50; 1.16536 +var ctx2 = canvas2.getContext('2d'); 1.16537 + 1.16538 +ctx.fillStyle = '#0f0'; 1.16539 +ctx.fillRect(0, 0, 100, 50); 1.16540 +ctx.shadowColor = '#f00'; 1.16541 +ctx.shadowOffsetY = 50; 1.16542 +ctx.drawImage(canvas2, 0, -50); 1.16543 + 1.16544 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.16545 + 1.16546 + 1.16547 +} 1.16548 +</script> 1.16549 + 1.16550 +<!-- [[[ test_2d.shadow.canvas.transparent.2.html ]]] --> 1.16551 + 1.16552 +<p>Canvas test: 2d.shadow.canvas.transparent.2</p> 1.16553 +<canvas id="c517" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16554 +<script> 1.16555 + 1.16556 + 1.16557 + 1.16558 +function test_2d_shadow_canvas_transparent_2() { 1.16559 + 1.16560 +var canvas = document.getElementById('c517'); 1.16561 +var ctx = canvas.getContext('2d'); 1.16562 + 1.16563 +var canvas2 = document.createElement('canvas'); 1.16564 +canvas2.width = 100; 1.16565 +canvas2.height = 50; 1.16566 +var ctx2 = canvas2.getContext('2d'); 1.16567 +ctx2.fillStyle = '#f00'; 1.16568 +ctx2.fillRect(0, 0, 50, 50); 1.16569 + 1.16570 +ctx.fillStyle = '#0f0'; 1.16571 +ctx.fillRect(0, 0, 50, 50); 1.16572 +ctx.fillStyle = '#f00'; 1.16573 +ctx.fillRect(50, 0, 50, 50); 1.16574 +ctx.shadowOffsetY = 50; 1.16575 +ctx.shadowColor = '#0f0'; 1.16576 +ctx.drawImage(canvas2, 50, -50); 1.16577 +ctx.shadowColor = '#f00'; 1.16578 +ctx.drawImage(canvas2, -50, -50); 1.16579 + 1.16580 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.16581 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.16582 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.16583 + 1.16584 + 1.16585 +} 1.16586 +</script> 1.16587 + 1.16588 +<!-- [[[ test_2d.shadow.clip.1.html ]]] --> 1.16589 + 1.16590 +<p>Canvas test: 2d.shadow.clip.1</p> 1.16591 +<canvas id="c518" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16592 +<script> 1.16593 + 1.16594 + 1.16595 + 1.16596 +function test_2d_shadow_clip_1() { 1.16597 + 1.16598 +var canvas = document.getElementById('c518'); 1.16599 +var ctx = canvas.getContext('2d'); 1.16600 + 1.16601 +ctx.fillStyle = '#0f0'; 1.16602 +ctx.fillRect(0, 0, 50, 50); 1.16603 +ctx.fillStyle = '#f00'; 1.16604 +ctx.fillRect(50, 0, 50, 50); 1.16605 + 1.16606 +ctx.save(); 1.16607 +ctx.beginPath(); 1.16608 +ctx.rect(50, 0, 50, 50); 1.16609 +ctx.clip(); 1.16610 +ctx.shadowColor = '#0f0'; 1.16611 +ctx.shadowOffsetX = 50; 1.16612 +ctx.fillRect(0, 0, 50, 50); 1.16613 +ctx.restore(); 1.16614 + 1.16615 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.16616 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.16617 + 1.16618 + 1.16619 +} 1.16620 +</script> 1.16621 + 1.16622 +<!-- [[[ test_2d.shadow.clip.2.html ]]] --> 1.16623 + 1.16624 +<p>Canvas test: 2d.shadow.clip.2</p> 1.16625 +<canvas id="c519" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16626 +<script> 1.16627 + 1.16628 + 1.16629 +function test_2d_shadow_clip_2() { 1.16630 + 1.16631 +var canvas = document.getElementById('c519'); 1.16632 +var ctx = canvas.getContext('2d'); 1.16633 + 1.16634 +ctx.fillStyle = '#f00'; 1.16635 +ctx.fillRect(0, 0, 50, 50); 1.16636 +ctx.fillStyle = '#0f0'; 1.16637 +ctx.fillRect(50, 0, 50, 50); 1.16638 + 1.16639 +ctx.save(); 1.16640 +ctx.beginPath(); 1.16641 +ctx.rect(0, 0, 50, 50); 1.16642 +ctx.clip(); 1.16643 +ctx.shadowColor = '#f00'; 1.16644 +ctx.shadowOffsetX = 50; 1.16645 +ctx.fillRect(0, 0, 50, 50); 1.16646 +ctx.restore(); 1.16647 + 1.16648 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.16649 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.16650 + 1.16651 + 1.16652 +} 1.16653 +</script> 1.16654 + 1.16655 +<!-- [[[ test_2d.shadow.clip.3.html ]]] --> 1.16656 + 1.16657 +<p>Canvas test: 2d.shadow.clip.3</p> 1.16658 +<canvas id="c520" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16659 +<script> 1.16660 + 1.16661 + 1.16662 + 1.16663 +function test_2d_shadow_clip_3() { 1.16664 + 1.16665 +var canvas = document.getElementById('c520'); 1.16666 +var ctx = canvas.getContext('2d'); 1.16667 + 1.16668 +ctx.fillStyle = '#f00'; 1.16669 +ctx.fillRect(0, 0, 50, 50); 1.16670 +ctx.fillStyle = '#0f0'; 1.16671 +ctx.fillRect(50, 0, 50, 50); 1.16672 + 1.16673 +ctx.save(); 1.16674 +ctx.beginPath(); 1.16675 +ctx.rect(0, 0, 50, 50); 1.16676 +ctx.clip(); 1.16677 +ctx.fillStyle = '#f00'; 1.16678 +ctx.shadowColor = '#0f0'; 1.16679 +ctx.shadowOffsetX = 50; 1.16680 +ctx.fillRect(-50, 0, 50, 50); 1.16681 +ctx.restore(); 1.16682 + 1.16683 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.16684 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.16685 + 1.16686 + 1.16687 +} 1.16688 +</script> 1.16689 + 1.16690 +<!-- [[[ test_2d.shadow.composite.1.html ]]] --> 1.16691 + 1.16692 +<p>Canvas test: 2d.shadow.composite.1</p> 1.16693 +<canvas id="c521" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16694 +<script> 1.16695 + 1.16696 + 1.16697 + 1.16698 +function test_2d_shadow_composite_1() { 1.16699 + 1.16700 +var canvas = document.getElementById('c521'); 1.16701 +var ctx = canvas.getContext('2d'); 1.16702 + 1.16703 +ctx.fillStyle = '#f00'; 1.16704 +ctx.fillRect(0, 0, 100, 50); 1.16705 +ctx.globalCompositeOperation = 'xor'; 1.16706 +ctx.shadowColor = '#f00'; 1.16707 +ctx.shadowOffsetX = 100; 1.16708 +ctx.fillStyle = '#0f0'; 1.16709 +ctx.fillRect(-100, 0, 200, 50); 1.16710 + 1.16711 +isPixel(ctx, 50, 25, 0, 255, 0, 255, 2); 1.16712 + 1.16713 +} 1.16714 +</script> 1.16715 + 1.16716 +<!-- [[[ test_2d.shadow.composite.2.html ]]] --> 1.16717 + 1.16718 +<p>Canvas test: 2d.shadow.composite.2</p> 1.16719 +<canvas id="c522" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16720 +<script> 1.16721 + 1.16722 + 1.16723 + 1.16724 +function test_2d_shadow_composite_2() { 1.16725 + 1.16726 +var canvas = document.getElementById('c522'); 1.16727 +var ctx = canvas.getContext('2d'); 1.16728 + 1.16729 +ctx.fillStyle = '#f00'; 1.16730 +ctx.fillRect(0, 0, 100, 50); 1.16731 +ctx.globalCompositeOperation = 'xor'; 1.16732 +ctx.shadowColor = '#f00'; 1.16733 +ctx.shadowBlur = 1; 1.16734 +ctx.fillStyle = '#0f0'; 1.16735 +ctx.fillRect(-10, -10, 120, 70); 1.16736 + 1.16737 +isPixel(ctx, 50, 25, 0, 255, 0, 255, 2); 1.16738 + 1.16739 +} 1.16740 +</script> 1.16741 + 1.16742 +<!-- [[[ test_2d.shadow.composite.3.html ]]] --> 1.16743 + 1.16744 +<p>Canvas test: 2d.shadow.composite.3</p> 1.16745 +<canvas id="c523" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16746 +<script> 1.16747 + 1.16748 + 1.16749 + 1.16750 +function test_2d_shadow_composite_3() { 1.16751 + 1.16752 +var canvas = document.getElementById('c523'); 1.16753 +var ctx = canvas.getContext('2d'); 1.16754 + 1.16755 +ctx.fillStyle = '#f00'; 1.16756 +ctx.fillRect(0, 0, 100, 50); 1.16757 +ctx.globalCompositeOperation = 'xor'; 1.16758 +ctx.shadowColor = '#f00'; 1.16759 +ctx.fillStyle = '#0f0'; 1.16760 +ctx.fillRect(0, 0, 100, 50); 1.16761 + 1.16762 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.16763 + 1.16764 + 1.16765 +} 1.16766 +</script> 1.16767 + 1.16768 +<!-- [[[ test_2d.shadow.composite.4.html ]]] --> 1.16769 + 1.16770 +<p>Canvas test: 2d.shadow.composite.4</p> 1.16771 +<canvas id="c524" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16772 +<script> 1.16773 + 1.16774 + 1.16775 + 1.16776 +function test_2d_shadow_composite_4() { 1.16777 + 1.16778 +var canvas = document.getElementById('c524'); 1.16779 +var ctx = canvas.getContext('2d'); 1.16780 + 1.16781 +ctx.globalCompositeOperation = 'destination-over'; 1.16782 +ctx.shadowColor = '#0f0'; 1.16783 +ctx.fillStyle = '#f00'; 1.16784 +ctx.fillRect(0, 0, 100, 50); 1.16785 + 1.16786 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.16787 + 1.16788 + 1.16789 +} 1.16790 +</script> 1.16791 + 1.16792 +<!-- [[[ test_2d.shadow.gradient.alpha.html ]]] --> 1.16793 + 1.16794 +<p>Canvas test: 2d.shadow.gradient.alpha</p> 1.16795 +<canvas id="c525" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16796 +<script> 1.16797 + 1.16798 + 1.16799 + 1.16800 +function test_2d_shadow_gradient_alpha() { 1.16801 + 1.16802 +var canvas = document.getElementById('c525'); 1.16803 +var ctx = canvas.getContext('2d'); 1.16804 + 1.16805 +var gradient = ctx.createLinearGradient(0, 0, 100, 0); 1.16806 +gradient.addColorStop(0, 'rgba(255,0,0,0.5)'); 1.16807 +gradient.addColorStop(1, 'rgba(255,0,0,0.5)'); 1.16808 +ctx.fillStyle = '#f00'; 1.16809 +ctx.fillRect(0, 0, 100, 50); 1.16810 +ctx.shadowOffsetY = 50; 1.16811 +ctx.shadowColor = '#00f'; 1.16812 +ctx.fillStyle = gradient; 1.16813 +ctx.fillRect(0, -50, 100, 50); 1.16814 + 1.16815 +isPixel(ctx, 50,25, 127,0,127,255, 2); 1.16816 + 1.16817 + 1.16818 +} 1.16819 +</script> 1.16820 + 1.16821 +<!-- [[[ test_2d.shadow.gradient.basic.html ]]] --> 1.16822 + 1.16823 +<p>Canvas test: 2d.shadow.gradient.basic</p> 1.16824 +<canvas id="c526" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16825 +<script> 1.16826 + 1.16827 + 1.16828 + 1.16829 +function test_2d_shadow_gradient_basic() { 1.16830 + 1.16831 +var canvas = document.getElementById('c526'); 1.16832 +var ctx = canvas.getContext('2d'); 1.16833 + 1.16834 +var gradient = ctx.createLinearGradient(0, 0, 100, 0); 1.16835 +gradient.addColorStop(0, '#f00'); 1.16836 +gradient.addColorStop(1, '#f00'); 1.16837 +ctx.fillStyle = '#f00'; 1.16838 +ctx.fillRect(0, 0, 100, 50); 1.16839 +ctx.shadowColor = '#0f0'; 1.16840 +ctx.shadowOffsetY = 50; 1.16841 +ctx.fillStyle = gradient; 1.16842 +ctx.fillRect(0, -50, 100, 50); 1.16843 + 1.16844 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.16845 + 1.16846 + 1.16847 +} 1.16848 +</script> 1.16849 + 1.16850 +<!-- [[[ test_2d.shadow.gradient.transparent.1.html ]]] --> 1.16851 + 1.16852 +<p>Canvas test: 2d.shadow.gradient.transparent.1</p> 1.16853 +<canvas id="c527" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16854 +<script> 1.16855 + 1.16856 + 1.16857 +function test_2d_shadow_gradient_transparent_1() { 1.16858 + 1.16859 +var canvas = document.getElementById('c527'); 1.16860 +var ctx = canvas.getContext('2d'); 1.16861 + 1.16862 +var gradient = ctx.createLinearGradient(0, 0, 100, 0); 1.16863 +gradient.addColorStop(0, 'rgba(0,0,0,0)'); 1.16864 +gradient.addColorStop(1, 'rgba(0,0,0,0)'); 1.16865 +ctx.fillStyle = '#0f0'; 1.16866 +ctx.fillRect(0, 0, 100, 50); 1.16867 +ctx.shadowColor = '#f00'; 1.16868 +ctx.shadowOffsetY = 50; 1.16869 +ctx.fillStyle = gradient; 1.16870 +ctx.fillRect(0, -50, 100, 50); 1.16871 + 1.16872 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.16873 + 1.16874 + 1.16875 +} 1.16876 +</script> 1.16877 + 1.16878 +<!-- [[[ test_2d.shadow.gradient.transparent.2.html ]]] --> 1.16879 + 1.16880 +<p>Canvas test: 2d.shadow.gradient.transparent.2</p> 1.16881 +<canvas id="c528" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16882 +<script> 1.16883 + 1.16884 + 1.16885 + 1.16886 +function test_2d_shadow_gradient_transparent_2() { 1.16887 + 1.16888 +var canvas = document.getElementById('c528'); 1.16889 +var ctx = canvas.getContext('2d'); 1.16890 + 1.16891 +var gradient = ctx.createLinearGradient(0, 0, 100, 0); 1.16892 +gradient.addColorStop(0, '#f00'); 1.16893 +gradient.addColorStop(0.499, '#f00'); 1.16894 +gradient.addColorStop(0.5, 'rgba(0,0,0,0)'); 1.16895 +gradient.addColorStop(1, 'rgba(0,0,0,0)'); 1.16896 +ctx.fillStyle = '#f00'; 1.16897 +ctx.fillRect(0, 0, 50, 50); 1.16898 +ctx.fillStyle = '#0f0'; 1.16899 +ctx.fillRect(50, 0, 50, 50); 1.16900 +ctx.shadowOffsetY = 50; 1.16901 +ctx.shadowColor = '#0f0'; 1.16902 +ctx.fillStyle = gradient; 1.16903 +ctx.fillRect(0, -50, 100, 50); 1.16904 + 1.16905 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.16906 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.16907 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.16908 + 1.16909 + 1.16910 +} 1.16911 +</script> 1.16912 + 1.16913 +<!-- [[[ test_2d.shadow.image.alpha.html ]]] --> 1.16914 + 1.16915 +<p>Canvas test: 2d.shadow.image.alpha</p> 1.16916 +<canvas id="c529" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16917 +<script> 1.16918 + 1.16919 + 1.16920 + 1.16921 +function test_2d_shadow_image_alpha() { 1.16922 + 1.16923 +var canvas = document.getElementById('c529'); 1.16924 +var ctx = canvas.getContext('2d'); 1.16925 + 1.16926 +ctx.fillStyle = '#f00'; 1.16927 +ctx.fillRect(0, 0, 100, 50); 1.16928 +ctx.shadowOffsetY = 50; 1.16929 +ctx.shadowColor = '#00f'; 1.16930 +ctx.drawImage(document.getElementById('transparent50_2.png'), 0, -50); 1.16931 + 1.16932 +isPixel(ctx, 50,25, 127,0,127,255, 2); 1.16933 + 1.16934 + 1.16935 +} 1.16936 +</script> 1.16937 +<img src="image_transparent50.png" id="transparent50_2.png" class="resource"> 1.16938 + 1.16939 +<!-- [[[ test_2d.shadow.image.basic.html ]]] --> 1.16940 + 1.16941 +<p>Canvas test: 2d.shadow.image.basic</p> 1.16942 +<canvas id="c530" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16943 +<script> 1.16944 + 1.16945 + 1.16946 + 1.16947 +function test_2d_shadow_image_basic() { 1.16948 + 1.16949 +var canvas = document.getElementById('c530'); 1.16950 +var ctx = canvas.getContext('2d'); 1.16951 + 1.16952 +ctx.fillStyle = '#f00'; 1.16953 +ctx.fillRect(0, 0, 100, 50); 1.16954 +ctx.shadowColor = '#0f0'; 1.16955 +ctx.shadowOffsetY = 50; 1.16956 +ctx.drawImage(document.getElementById('red_17.png'), 0, -50); 1.16957 + 1.16958 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.16959 + 1.16960 + 1.16961 +} 1.16962 +</script> 1.16963 +<img src="image_red.png" id="red_17.png" class="resource"> 1.16964 + 1.16965 +<!-- [[[ test_2d.shadow.image.scale.html ]]] --> 1.16966 + 1.16967 +<p>Canvas test: 2d.shadow.image.scale</p> 1.16968 +<canvas id="c531" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16969 +<script> 1.16970 + 1.16971 + 1.16972 + 1.16973 +function test_2d_shadow_image_scale() { 1.16974 + 1.16975 +var canvas = document.getElementById('c531'); 1.16976 +var ctx = canvas.getContext('2d'); 1.16977 + 1.16978 +ctx.fillStyle = '#f00'; 1.16979 +ctx.fillRect(0, 0, 100, 50); 1.16980 +ctx.shadowOffsetY = 50; 1.16981 +ctx.shadowColor = '#0f0'; 1.16982 +ctx.drawImage(document.getElementById('redtransparent_2.png'), 0, 0, 100, 50, -10, -50, 240, 50); 1.16983 + 1.16984 +isPixel(ctx, 25,25, 0,255,0,255, 2); 1.16985 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.16986 +isPixel(ctx, 75,25, 0,255,0,255, 2); 1.16987 + 1.16988 + 1.16989 +} 1.16990 +</script> 1.16991 +<img src="image_redtransparent.png" id="redtransparent_2.png" class="resource"> 1.16992 + 1.16993 +<!-- [[[ test_2d.shadow.image.section.html ]]] --> 1.16994 + 1.16995 +<p>Canvas test: 2d.shadow.image.section</p> 1.16996 +<canvas id="c532" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.16997 +<script> 1.16998 + 1.16999 + 1.17000 +function test_2d_shadow_image_section() { 1.17001 + 1.17002 +var canvas = document.getElementById('c532'); 1.17003 +var ctx = canvas.getContext('2d'); 1.17004 + 1.17005 +ctx.fillStyle = '#0f0'; 1.17006 +ctx.fillRect(0, 0, 100, 50); 1.17007 +ctx.shadowOffsetY = 50; 1.17008 +ctx.shadowColor = '#f00'; 1.17009 +ctx.drawImage(document.getElementById('redtransparent_3.png'), 50, 0, 50, 50, 0, -50, 50, 50); 1.17010 + 1.17011 +isPixel(ctx, 25,25, 0,255,0,255, 2); 1.17012 +isPixel(ctx, 50,25, 0,255,0,255, 2); 1.17013 +isPixel(ctx, 75,25, 0,255,0,255, 2); 1.17014 + 1.17015 + 1.17016 +} 1.17017 +</script> 1.17018 +<img src="image_redtransparent.png" id="redtransparent_3.png" class="resource"> 1.17019 + 1.17020 +<!-- [[[ test_2d.shadow.image.transparent.1.html ]]] --> 1.17021 + 1.17022 +<p>Canvas test: 2d.shadow.image.transparent.1</p> 1.17023 +<canvas id="c533" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17024 +<script> 1.17025 + 1.17026 + 1.17027 +function test_2d_shadow_image_transparent_1() { 1.17028 + 1.17029 +var canvas = document.getElementById('c533'); 1.17030 +var ctx = canvas.getContext('2d'); 1.17031 + 1.17032 +ctx.fillStyle = '#0f0'; 1.17033 +ctx.fillRect(0, 0, 100, 50); 1.17034 +ctx.shadowColor = '#f00'; 1.17035 +ctx.shadowOffsetY = 50; 1.17036 +ctx.drawImage(document.getElementById('transparent_1.png'), 0, -50); 1.17037 + 1.17038 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.17039 + 1.17040 + 1.17041 +} 1.17042 +</script> 1.17043 +<img src="image_transparent.png" id="transparent_1.png" class="resource"> 1.17044 + 1.17045 +<!-- [[[ test_2d.shadow.image.transparent.2.html ]]] --> 1.17046 + 1.17047 +<p>Canvas test: 2d.shadow.image.transparent.2</p> 1.17048 +<canvas id="c534" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17049 +<script> 1.17050 + 1.17051 + 1.17052 + 1.17053 +function test_2d_shadow_image_transparent_2() { 1.17054 + 1.17055 +var canvas = document.getElementById('c534'); 1.17056 +var ctx = canvas.getContext('2d'); 1.17057 + 1.17058 +ctx.fillStyle = '#0f0'; 1.17059 +ctx.fillRect(0, 0, 50, 50); 1.17060 +ctx.fillStyle = '#f00'; 1.17061 +ctx.fillRect(50, 0, 50, 50); 1.17062 +ctx.shadowOffsetY = 50; 1.17063 +ctx.shadowColor = '#0f0'; 1.17064 +ctx.drawImage(document.getElementById('redtransparent_4.png'), 50, -50); 1.17065 +ctx.shadowColor = '#f00'; 1.17066 +ctx.drawImage(document.getElementById('redtransparent_4.png'), -50, -50); 1.17067 + 1.17068 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.17069 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.17070 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.17071 + 1.17072 + 1.17073 +} 1.17074 +</script> 1.17075 +<img src="image_redtransparent.png" id="redtransparent_4.png" class="resource"> 1.17076 + 1.17077 +<!-- [[[ test_2d.shadow.offset.negativeX.html ]]] --> 1.17078 + 1.17079 +<p>Canvas test: 2d.shadow.offset.negativeX</p> 1.17080 +<canvas id="c535" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17081 +<script> 1.17082 + 1.17083 + 1.17084 + 1.17085 +function test_2d_shadow_offset_negativeX() { 1.17086 + 1.17087 +var canvas = document.getElementById('c535'); 1.17088 +var ctx = canvas.getContext('2d'); 1.17089 + 1.17090 +ctx.fillStyle = '#f00'; 1.17091 +ctx.fillRect(0, 0, 100, 50); 1.17092 +ctx.fillStyle = '#0f0'; 1.17093 +ctx.shadowColor = '#0f0'; 1.17094 +ctx.shadowOffsetX = -50; 1.17095 +ctx.fillRect(50, 0, 50, 50); 1.17096 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.17097 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.17098 + 1.17099 + 1.17100 +} 1.17101 +</script> 1.17102 + 1.17103 +<!-- [[[ test_2d.shadow.offset.negativeY.html ]]] --> 1.17104 + 1.17105 +<p>Canvas test: 2d.shadow.offset.negativeY</p> 1.17106 +<canvas id="c536" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17107 +<script> 1.17108 + 1.17109 + 1.17110 + 1.17111 +function test_2d_shadow_offset_negativeY() { 1.17112 + 1.17113 +var canvas = document.getElementById('c536'); 1.17114 +var ctx = canvas.getContext('2d'); 1.17115 + 1.17116 +ctx.fillStyle = '#f00'; 1.17117 +ctx.fillRect(0, 0, 100, 50); 1.17118 +ctx.fillStyle = '#0f0'; 1.17119 +ctx.shadowColor = '#0f0'; 1.17120 +ctx.shadowOffsetY = -25; 1.17121 +ctx.fillRect(0, 25, 100, 25); 1.17122 +isPixel(ctx, 50,12, 0,255,0,255, 0); 1.17123 +isPixel(ctx, 50,37, 0,255,0,255, 0); 1.17124 + 1.17125 + 1.17126 +} 1.17127 +</script> 1.17128 + 1.17129 +<!-- [[[ test_2d.shadow.offset.positiveX.html ]]] --> 1.17130 + 1.17131 +<p>Canvas test: 2d.shadow.offset.positiveX</p> 1.17132 +<canvas id="c537" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17133 +<script> 1.17134 + 1.17135 + 1.17136 + 1.17137 +function test_2d_shadow_offset_positiveX() { 1.17138 + 1.17139 +var canvas = document.getElementById('c537'); 1.17140 +var ctx = canvas.getContext('2d'); 1.17141 + 1.17142 +ctx.fillStyle = '#f00'; 1.17143 +ctx.fillRect(0, 0, 100, 50); 1.17144 +ctx.fillStyle = '#0f0'; 1.17145 +ctx.shadowColor = '#0f0'; 1.17146 +ctx.shadowOffsetX = 50; 1.17147 +ctx.fillRect(0, 0, 50, 50); 1.17148 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.17149 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.17150 + 1.17151 + 1.17152 +} 1.17153 +</script> 1.17154 + 1.17155 +<!-- [[[ test_2d.shadow.offset.positiveY.html ]]] --> 1.17156 + 1.17157 +<p>Canvas test: 2d.shadow.offset.positiveY</p> 1.17158 +<canvas id="c538" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17159 +<script> 1.17160 + 1.17161 + 1.17162 + 1.17163 +function test_2d_shadow_offset_positiveY() { 1.17164 + 1.17165 +var canvas = document.getElementById('c538'); 1.17166 +var ctx = canvas.getContext('2d'); 1.17167 + 1.17168 +ctx.fillStyle = '#f00'; 1.17169 +ctx.fillRect(0, 0, 100, 50); 1.17170 +ctx.fillStyle = '#0f0'; 1.17171 +ctx.shadowColor = '#0f0'; 1.17172 +ctx.shadowOffsetY = 25; 1.17173 +ctx.fillRect(0, 0, 100, 25); 1.17174 +isPixel(ctx, 50,12, 0,255,0,255, 0); 1.17175 +isPixel(ctx, 50,37, 0,255,0,255, 0); 1.17176 + 1.17177 + 1.17178 +} 1.17179 +</script> 1.17180 + 1.17181 +<!-- [[[ test_2d.shadow.outside.html ]]] --> 1.17182 + 1.17183 +<p>Canvas test: 2d.shadow.outside</p> 1.17184 +<canvas id="c539" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17185 +<script> 1.17186 + 1.17187 + 1.17188 + 1.17189 +function test_2d_shadow_outside() { 1.17190 + 1.17191 +var canvas = document.getElementById('c539'); 1.17192 +var ctx = canvas.getContext('2d'); 1.17193 + 1.17194 +ctx.fillStyle = '#f00'; 1.17195 +ctx.fillRect(0, 0, 100, 50); 1.17196 +ctx.shadowColor = '#0f0'; 1.17197 +ctx.shadowOffsetX = 100; 1.17198 +ctx.fillRect(-100, 0, 25, 50); 1.17199 +ctx.shadowOffsetX = -100; 1.17200 +ctx.fillRect(175, 0, 25, 50); 1.17201 +ctx.shadowOffsetX = 0; 1.17202 +ctx.shadowOffsetY = 100; 1.17203 +ctx.fillRect(25, -100, 50, 25); 1.17204 +ctx.shadowOffsetY = -100; 1.17205 +ctx.fillRect(25, 125, 50, 25); 1.17206 +isPixel(ctx, 12,25, 0,255,0,255, 0); 1.17207 +isPixel(ctx, 87,25, 0,255,0,255, 0); 1.17208 +isPixel(ctx, 50,12, 0,255,0,255, 0); 1.17209 +isPixel(ctx, 50,37, 0,255,0,255, 0); 1.17210 + 1.17211 + 1.17212 +} 1.17213 +</script> 1.17214 + 1.17215 +<!-- [[[ test_2d.shadow.pattern.alpha.html ]]] --> 1.17216 + 1.17217 +<p>Canvas test: 2d.shadow.pattern.alpha</p> 1.17218 +<canvas id="c540" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17219 +<script> 1.17220 + 1.17221 + 1.17222 + 1.17223 +function test_2d_shadow_pattern_alpha() { 1.17224 + 1.17225 +var canvas = document.getElementById('c540'); 1.17226 +var ctx = canvas.getContext('2d'); 1.17227 + 1.17228 +var pattern = ctx.createPattern(document.getElementById('transparent50_3.png'), 'repeat'); 1.17229 +ctx.fillStyle = '#f00'; 1.17230 +ctx.fillRect(0, 0, 100, 50); 1.17231 +ctx.shadowOffsetY = 50; 1.17232 +ctx.shadowColor = '#00f'; 1.17233 +ctx.fillStyle = pattern; 1.17234 +ctx.fillRect(0, -50, 100, 50); 1.17235 + 1.17236 +isPixel(ctx, 50,25, 127,0,127,255, 2); 1.17237 + 1.17238 + 1.17239 +} 1.17240 +</script> 1.17241 +<img src="image_transparent50.png" id="transparent50_3.png" class="resource"> 1.17242 + 1.17243 +<!-- [[[ test_2d.shadow.pattern.basic.html ]]] --> 1.17244 + 1.17245 +<p>Canvas test: 2d.shadow.pattern.basic</p> 1.17246 +<canvas id="c541" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17247 +<script> 1.17248 + 1.17249 + 1.17250 + 1.17251 +function test_2d_shadow_pattern_basic() { 1.17252 + 1.17253 +var canvas = document.getElementById('c541'); 1.17254 +var ctx = canvas.getContext('2d'); 1.17255 + 1.17256 +var pattern = ctx.createPattern(document.getElementById('red_18.png'), 'repeat'); 1.17257 +ctx.fillStyle = '#f00'; 1.17258 +ctx.fillRect(0, 0, 100, 50); 1.17259 +ctx.shadowColor = '#0f0'; 1.17260 +ctx.shadowOffsetY = 50; 1.17261 +ctx.fillStyle = pattern; 1.17262 +ctx.fillRect(0, -50, 100, 50); 1.17263 + 1.17264 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.17265 + 1.17266 + 1.17267 +} 1.17268 +</script> 1.17269 +<img src="image_red.png" id="red_18.png" class="resource"> 1.17270 + 1.17271 +<!-- [[[ test_2d.shadow.pattern.transparent.1.html ]]] --> 1.17272 + 1.17273 +<p>Canvas test: 2d.shadow.pattern.transparent.1</p> 1.17274 +<canvas id="c542" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17275 +<script> 1.17276 + 1.17277 + 1.17278 +function test_2d_shadow_pattern_transparent_1() { 1.17279 + 1.17280 +var canvas = document.getElementById('c542'); 1.17281 +var ctx = canvas.getContext('2d'); 1.17282 + 1.17283 +var pattern = ctx.createPattern(document.getElementById('transparent_2.png'), 'repeat'); 1.17284 +ctx.fillStyle = '#0f0'; 1.17285 +ctx.fillRect(0, 0, 100, 50); 1.17286 +ctx.shadowColor = '#f00'; 1.17287 +ctx.shadowOffsetY = 50; 1.17288 +ctx.fillStyle = pattern; 1.17289 +ctx.fillRect(0, -50, 100, 50); 1.17290 + 1.17291 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.17292 + 1.17293 + 1.17294 +} 1.17295 +</script> 1.17296 +<img src="image_transparent.png" id="transparent_2.png" class="resource"> 1.17297 + 1.17298 +<!-- [[[ test_2d.shadow.pattern.transparent.2.html ]]] --> 1.17299 + 1.17300 +<p>Canvas test: 2d.shadow.pattern.transparent.2</p> 1.17301 +<canvas id="c543" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17302 +<script> 1.17303 + 1.17304 + 1.17305 + 1.17306 +function test_2d_shadow_pattern_transparent_2() { 1.17307 + 1.17308 +var canvas = document.getElementById('c543'); 1.17309 +var ctx = canvas.getContext('2d'); 1.17310 + 1.17311 +var pattern = ctx.createPattern(document.getElementById('redtransparent_5.png'), 'repeat'); 1.17312 +ctx.fillStyle = '#f00'; 1.17313 +ctx.fillRect(0, 0, 50, 50); 1.17314 +ctx.fillStyle = '#0f0'; 1.17315 +ctx.fillRect(50, 0, 50, 50); 1.17316 +ctx.shadowOffsetY = 50; 1.17317 +ctx.shadowColor = '#0f0'; 1.17318 +ctx.fillStyle = pattern; 1.17319 +ctx.fillRect(0, -50, 100, 50); 1.17320 + 1.17321 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.17322 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.17323 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.17324 + 1.17325 + 1.17326 +} 1.17327 +</script> 1.17328 +<img src="image_redtransparent.png" id="redtransparent_5.png" class="resource"> 1.17329 + 1.17330 +<!-- [[[ test_2d.shadow.stroke.basic.html ]]] --> 1.17331 + 1.17332 +<p>Canvas test: 2d.shadow.stroke.basic</p> 1.17333 +<canvas id="c544" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17334 +<script> 1.17335 + 1.17336 + 1.17337 + 1.17338 +function test_2d_shadow_stroke_basic() { 1.17339 + 1.17340 +var canvas = document.getElementById('c544'); 1.17341 +var ctx = canvas.getContext('2d'); 1.17342 + 1.17343 +ctx.fillStyle = '#f00'; 1.17344 +ctx.fillRect(0, 0, 100, 50); 1.17345 +ctx.strokeStyle = '#f00'; 1.17346 +ctx.shadowColor = '#0f0'; 1.17347 +ctx.shadowOffsetY = 50; 1.17348 +ctx.beginPath(); 1.17349 +ctx.lineWidth = 50; 1.17350 +ctx.moveTo(0, -25); 1.17351 +ctx.lineTo(100, -25); 1.17352 +ctx.stroke(); 1.17353 + 1.17354 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.17355 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.17356 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.17357 + 1.17358 + 1.17359 +} 1.17360 +</script> 1.17361 + 1.17362 +<!-- [[[ test_2d.shadow.stroke.cap.1.html ]]] --> 1.17363 + 1.17364 +<p>Canvas test: 2d.shadow.stroke.cap.1</p> 1.17365 +<canvas id="c545" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17366 +<script> 1.17367 + 1.17368 + 1.17369 +function test_2d_shadow_stroke_cap_1() { 1.17370 + 1.17371 +var canvas = document.getElementById('c545'); 1.17372 +var ctx = canvas.getContext('2d'); 1.17373 + 1.17374 +ctx.fillStyle = '#0f0'; 1.17375 +ctx.fillRect(0, 0, 100, 50); 1.17376 +ctx.strokeStyle = '#f00'; 1.17377 +ctx.shadowColor = '#f00'; 1.17378 +ctx.shadowOffsetY = 50; 1.17379 +ctx.beginPath(); 1.17380 +ctx.lineWidth = 50; 1.17381 +ctx.lineCap = 'butt'; 1.17382 +ctx.moveTo(-50, -25); 1.17383 +ctx.lineTo(0, -25); 1.17384 +ctx.moveTo(100, -25); 1.17385 +ctx.lineTo(150, -25); 1.17386 +ctx.stroke(); 1.17387 + 1.17388 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.17389 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.17390 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.17391 + 1.17392 + 1.17393 +} 1.17394 +</script> 1.17395 + 1.17396 +<!-- [[[ test_2d.shadow.stroke.cap.2.html ]]] --> 1.17397 + 1.17398 +<p>Canvas test: 2d.shadow.stroke.cap.2</p> 1.17399 +<canvas id="c546" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17400 +<script> 1.17401 + 1.17402 + 1.17403 + 1.17404 +function test_2d_shadow_stroke_cap_2() { 1.17405 + 1.17406 +var canvas = document.getElementById('c546'); 1.17407 +var ctx = canvas.getContext('2d'); 1.17408 + 1.17409 +ctx.fillStyle = '#f00'; 1.17410 +ctx.fillRect(0, 0, 100, 50); 1.17411 +ctx.strokeStyle = '#f00'; 1.17412 +ctx.shadowColor = '#0f0'; 1.17413 +ctx.shadowOffsetY = 50; 1.17414 +ctx.beginPath(); 1.17415 +ctx.lineWidth = 50; 1.17416 +ctx.lineCap = 'square'; 1.17417 +ctx.moveTo(25, -25); 1.17418 +ctx.lineTo(75, -25); 1.17419 +ctx.stroke(); 1.17420 + 1.17421 +isPixel(ctx, 1,25, 0,255,0,255, 0); 1.17422 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.17423 +isPixel(ctx, 98,25, 0,255,0,255, 0); 1.17424 + 1.17425 + 1.17426 +} 1.17427 +</script> 1.17428 + 1.17429 +<!-- [[[ test_2d.shadow.stroke.join.1.html ]]] --> 1.17430 + 1.17431 +<p>Canvas test: 2d.shadow.stroke.join.1</p> 1.17432 +<canvas id="c547" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17433 +<script> 1.17434 + 1.17435 + 1.17436 +function test_2d_shadow_stroke_join_1() { 1.17437 + 1.17438 +var canvas = document.getElementById('c547'); 1.17439 +var ctx = canvas.getContext('2d'); 1.17440 + 1.17441 +ctx.fillStyle = '#0f0'; 1.17442 +ctx.fillRect(0, 0, 100, 50); 1.17443 +ctx.strokeStyle = '#f00'; 1.17444 +ctx.shadowColor = '#f00'; 1.17445 +ctx.shadowOffsetX = 100; 1.17446 +ctx.lineWidth = 200; 1.17447 +ctx.lineJoin = 'bevel'; 1.17448 +ctx.beginPath(); 1.17449 +ctx.moveTo(-200, -50); 1.17450 +ctx.lineTo(-150, -50); 1.17451 +ctx.lineTo(-151, -100); 1.17452 +ctx.stroke(); 1.17453 + 1.17454 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.17455 +isPixel(ctx, 48,48, 0,255,0,255, 0); 1.17456 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.17457 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.17458 + 1.17459 + 1.17460 +} 1.17461 +</script> 1.17462 + 1.17463 +<!-- [[[ test_2d.shadow.stroke.join.2.html ]]] --> 1.17464 + 1.17465 +<p>Canvas test: 2d.shadow.stroke.join.2</p> 1.17466 +<canvas id="c548" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17467 +<script> 1.17468 + 1.17469 + 1.17470 + 1.17471 +function test_2d_shadow_stroke_join_2() { 1.17472 + 1.17473 +var canvas = document.getElementById('c548'); 1.17474 +var ctx = canvas.getContext('2d'); 1.17475 + 1.17476 +ctx.fillStyle = '#f00'; 1.17477 +ctx.fillRect(0, 0, 50, 50); 1.17478 +ctx.fillStyle = '#0f0'; 1.17479 +ctx.fillRect(50, 0, 50, 50); 1.17480 +ctx.strokeStyle = '#f00'; 1.17481 +ctx.shadowColor = '#0f0'; 1.17482 +ctx.shadowOffsetX = 100; 1.17483 +ctx.lineWidth = 200; 1.17484 +ctx.lineJoin = 'miter'; 1.17485 +ctx.beginPath(); 1.17486 +ctx.moveTo(-200, -50); 1.17487 +ctx.lineTo(-150, -50); 1.17488 +ctx.lineTo(-151, -100); 1.17489 +ctx.stroke(); 1.17490 + 1.17491 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.17492 +isPixel(ctx, 48,48, 0,255,0,255, 0); 1.17493 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.17494 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.17495 + 1.17496 + 1.17497 +} 1.17498 +</script> 1.17499 + 1.17500 +<!-- [[[ test_2d.shadow.stroke.join.3.html ]]] --> 1.17501 + 1.17502 +<p>Canvas test: 2d.shadow.stroke.join.3</p> 1.17503 +<canvas id="c549" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17504 +<script> 1.17505 + 1.17506 + 1.17507 +function test_2d_shadow_stroke_join_3() { 1.17508 + 1.17509 +var canvas = document.getElementById('c549'); 1.17510 +var ctx = canvas.getContext('2d'); 1.17511 + 1.17512 +ctx.fillStyle = '#0f0'; 1.17513 +ctx.fillRect(0, 0, 100, 50); 1.17514 +ctx.strokeStyle = '#f00'; 1.17515 +ctx.shadowColor = '#f00'; 1.17516 +ctx.shadowOffsetX = 100; 1.17517 +ctx.lineWidth = 200; 1.17518 +ctx.lineJoin = 'miter'; 1.17519 +ctx.miterLimit = 0.1; 1.17520 +ctx.beginPath(); 1.17521 +ctx.moveTo(-200, -50); 1.17522 +ctx.lineTo(-150, -50); 1.17523 +ctx.lineTo(-151, -100); // (not an exact right angle, to avoid some other bug in Firefox 3) 1.17524 +ctx.stroke(); 1.17525 + 1.17526 +isPixel(ctx, 1,1, 0,255,0,255, 0); 1.17527 +isPixel(ctx, 48,48, 0,255,0,255, 0); 1.17528 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.17529 +isPixel(ctx, 98,48, 0,255,0,255, 0); 1.17530 + 1.17531 + 1.17532 +} 1.17533 +</script> 1.17534 + 1.17535 +<!-- [[[ test_2d.shadow.transform.1.html ]]] --> 1.17536 + 1.17537 +<p>Canvas test: 2d.shadow.transform.1</p> 1.17538 +<canvas id="c550" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17539 +<script> 1.17540 + 1.17541 + 1.17542 + 1.17543 +function test_2d_shadow_transform_1() { 1.17544 + 1.17545 +var canvas = document.getElementById('c550'); 1.17546 +var ctx = canvas.getContext('2d'); 1.17547 + 1.17548 +ctx.fillStyle = '#f00'; 1.17549 +ctx.fillRect(0, 0, 100, 50); 1.17550 +ctx.shadowOffsetY = 50; 1.17551 +ctx.shadowColor = '#0f0'; 1.17552 +ctx.translate(100, 100); 1.17553 +ctx.fillRect(-100, -150, 100, 50); 1.17554 + 1.17555 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.17556 + 1.17557 + 1.17558 +} 1.17559 +</script> 1.17560 + 1.17561 +<!-- [[[ test_2d.shadow.transform.2.html ]]] --> 1.17562 + 1.17563 +<p>Canvas test: 2d.shadow.transform.2</p> 1.17564 +<canvas id="c551" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17565 +<script> 1.17566 + 1.17567 + 1.17568 + 1.17569 +function test_2d_shadow_transform_2() { 1.17570 + 1.17571 +var canvas = document.getElementById('c551'); 1.17572 +var ctx = canvas.getContext('2d'); 1.17573 + 1.17574 +ctx.fillStyle = '#f00'; 1.17575 +ctx.fillRect(0, 0, 100, 50); 1.17576 +ctx.shadowOffsetY = 50; 1.17577 +ctx.shadowColor = '#0f0'; 1.17578 +ctx.rotate(Math.PI) 1.17579 +ctx.fillRect(-100, 0, 100, 50); 1.17580 + 1.17581 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.17582 + 1.17583 + 1.17584 +} 1.17585 +</script> 1.17586 + 1.17587 +<!-- [[[ test_2d.state.saverestore.bitmap.html ]]] --> 1.17588 + 1.17589 +<p>Canvas test: 2d.state.saverestore.bitmap</p> 1.17590 +<!-- Testing: save()/restore() does not affect the current bitmap --> 1.17591 +<canvas id="c552" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17592 +<script> 1.17593 + 1.17594 + 1.17595 +function test_2d_state_saverestore_bitmap() { 1.17596 + 1.17597 +var canvas = document.getElementById('c552'); 1.17598 +var ctx = canvas.getContext('2d'); 1.17599 + 1.17600 +ctx.fillStyle = '#f00'; 1.17601 +ctx.fillRect(0, 0, 100, 50); 1.17602 +ctx.save(); 1.17603 +ctx.fillStyle = '#0f0'; 1.17604 +ctx.fillRect(0, 0, 100, 50); 1.17605 +ctx.restore(); 1.17606 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.17607 + 1.17608 + 1.17609 +} 1.17610 +</script> 1.17611 + 1.17612 +<!-- [[[ test_2d.state.saverestore.clip.html ]]] --> 1.17613 + 1.17614 +<p>Canvas test: 2d.state.saverestore.clip</p> 1.17615 +<!-- Testing: save()/restore() affects the clipping path --> 1.17616 +<canvas id="c553" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17617 +<script> 1.17618 + 1.17619 + 1.17620 +function test_2d_state_saverestore_clip() { 1.17621 + 1.17622 +var canvas = document.getElementById('c553'); 1.17623 +var ctx = canvas.getContext('2d'); 1.17624 + 1.17625 +ctx.fillStyle = '#f00'; 1.17626 +ctx.fillRect(0, 0, 100, 50); 1.17627 +ctx.save(); 1.17628 +ctx.rect(0, 0, 1, 1); 1.17629 +ctx.clip(); 1.17630 +ctx.restore(); 1.17631 +ctx.fillStyle = '#0f0'; 1.17632 +ctx.fillRect(0, 0, 100, 50); 1.17633 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.17634 + 1.17635 + 1.17636 +} 1.17637 +</script> 1.17638 + 1.17639 +<!-- [[[ test_2d.state.saverestore.fillStyle.html ]]] --> 1.17640 + 1.17641 +<p>Canvas test: 2d.state.saverestore.fillStyle</p> 1.17642 +<!-- Testing: save()/restore() works for fillStyle --> 1.17643 +<canvas id="c554" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17644 +<script> 1.17645 + 1.17646 +function test_2d_state_saverestore_fillStyle() { 1.17647 + 1.17648 +var canvas = document.getElementById('c554'); 1.17649 +var ctx = canvas.getContext('2d'); 1.17650 + 1.17651 +// Test that restore() undoes any modifications 1.17652 +var old = ctx.fillStyle; 1.17653 +ctx.save(); 1.17654 +ctx.fillStyle = "#ff0000"; 1.17655 +ctx.restore(); 1.17656 +ok(ctx.fillStyle === old, "ctx.fillStyle === old"); 1.17657 + 1.17658 +// Also test that save() doesn't modify the values 1.17659 +ctx.fillStyle = "#ff0000"; 1.17660 +old = ctx.fillStyle; 1.17661 + // we're not interested in failures caused by get(set(x)) != x (e.g. 1.17662 + // from rounding), so compare against d instead of against "#ff0000" 1.17663 +ctx.save(); 1.17664 +ok(ctx.fillStyle === old, "ctx.fillStyle === old"); 1.17665 +ctx.restore(); 1.17666 + 1.17667 + 1.17668 +} 1.17669 +</script> 1.17670 + 1.17671 +<!-- [[[ test_2d.state.saverestore.globalAlpha.html ]]] --> 1.17672 + 1.17673 +<p>Canvas test: 2d.state.saverestore.globalAlpha</p> 1.17674 +<!-- Testing: save()/restore() works for globalAlpha --> 1.17675 +<canvas id="c555" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17676 +<script> 1.17677 + 1.17678 +function test_2d_state_saverestore_globalAlpha() { 1.17679 + 1.17680 +var canvas = document.getElementById('c555'); 1.17681 +var ctx = canvas.getContext('2d'); 1.17682 + 1.17683 +// Test that restore() undoes any modifications 1.17684 +var old = ctx.globalAlpha; 1.17685 +ctx.save(); 1.17686 +ctx.globalAlpha = 0.5; 1.17687 +ctx.restore(); 1.17688 +ok(ctx.globalAlpha === old, "ctx.globalAlpha === old"); 1.17689 + 1.17690 +// Also test that save() doesn't modify the values 1.17691 +ctx.globalAlpha = 0.5; 1.17692 +old = ctx.globalAlpha; 1.17693 + // we're not interested in failures caused by get(set(x)) != x (e.g. 1.17694 + // from rounding), so compare against d instead of against 0.5 1.17695 +ctx.save(); 1.17696 +ok(ctx.globalAlpha === old, "ctx.globalAlpha === old"); 1.17697 +ctx.restore(); 1.17698 + 1.17699 + 1.17700 +} 1.17701 +</script> 1.17702 + 1.17703 +<!-- [[[ test_2d.state.saverestore.globalCompositeOperation.html ]]] --> 1.17704 + 1.17705 +<p>Canvas test: 2d.state.saverestore.globalCompositeOperation</p> 1.17706 +<!-- Testing: save()/restore() works for globalCompositeOperation --> 1.17707 +<canvas id="c556" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17708 +<script> 1.17709 + 1.17710 +function test_2d_state_saverestore_globalCompositeOperation() { 1.17711 + 1.17712 +var canvas = document.getElementById('c556'); 1.17713 +var ctx = canvas.getContext('2d'); 1.17714 + 1.17715 +// Test that restore() undoes any modifications 1.17716 +var old = ctx.globalCompositeOperation; 1.17717 +ctx.save(); 1.17718 +ctx.globalCompositeOperation = "copy"; 1.17719 +ctx.restore(); 1.17720 +ok(ctx.globalCompositeOperation === old, "ctx.globalCompositeOperation === old"); 1.17721 + 1.17722 +// Also test that save() doesn't modify the values 1.17723 +ctx.globalCompositeOperation = "copy"; 1.17724 +old = ctx.globalCompositeOperation; 1.17725 + // we're not interested in failures caused by get(set(x)) != x (e.g. 1.17726 + // from rounding), so compare against d instead of against "copy" 1.17727 +ctx.save(); 1.17728 +ok(ctx.globalCompositeOperation === old, "ctx.globalCompositeOperation === old"); 1.17729 +ctx.restore(); 1.17730 + 1.17731 + 1.17732 +} 1.17733 +</script> 1.17734 + 1.17735 +<!-- [[[ test_2d.state.saverestore.lineCap.html ]]] --> 1.17736 + 1.17737 +<p>Canvas test: 2d.state.saverestore.lineCap</p> 1.17738 +<!-- Testing: save()/restore() works for lineCap --> 1.17739 +<canvas id="c557" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17740 +<script> 1.17741 + 1.17742 +function test_2d_state_saverestore_lineCap() { 1.17743 + 1.17744 +var canvas = document.getElementById('c557'); 1.17745 +var ctx = canvas.getContext('2d'); 1.17746 + 1.17747 +// Test that restore() undoes any modifications 1.17748 +var old = ctx.lineCap; 1.17749 +ctx.save(); 1.17750 +ctx.lineCap = "round"; 1.17751 +ctx.restore(); 1.17752 +ok(ctx.lineCap === old, "ctx.lineCap === old"); 1.17753 + 1.17754 +// Also test that save() doesn't modify the values 1.17755 +ctx.lineCap = "round"; 1.17756 +old = ctx.lineCap; 1.17757 + // we're not interested in failures caused by get(set(x)) != x (e.g. 1.17758 + // from rounding), so compare against d instead of against "round" 1.17759 +ctx.save(); 1.17760 +ok(ctx.lineCap === old, "ctx.lineCap === old"); 1.17761 +ctx.restore(); 1.17762 + 1.17763 + 1.17764 +} 1.17765 +</script> 1.17766 + 1.17767 +<!-- [[[ test_2d.state.saverestore.lineJoin.html ]]] --> 1.17768 + 1.17769 +<p>Canvas test: 2d.state.saverestore.lineJoin</p> 1.17770 +<!-- Testing: save()/restore() works for lineJoin --> 1.17771 +<canvas id="c558" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17772 +<script> 1.17773 + 1.17774 +function test_2d_state_saverestore_lineJoin() { 1.17775 + 1.17776 +var canvas = document.getElementById('c558'); 1.17777 +var ctx = canvas.getContext('2d'); 1.17778 + 1.17779 +// Test that restore() undoes any modifications 1.17780 +var old = ctx.lineJoin; 1.17781 +ctx.save(); 1.17782 +ctx.lineJoin = "round"; 1.17783 +ctx.restore(); 1.17784 +ok(ctx.lineJoin === old, "ctx.lineJoin === old"); 1.17785 + 1.17786 +// Also test that save() doesn't modify the values 1.17787 +ctx.lineJoin = "round"; 1.17788 +old = ctx.lineJoin; 1.17789 + // we're not interested in failures caused by get(set(x)) != x (e.g. 1.17790 + // from rounding), so compare against d instead of against "round" 1.17791 +ctx.save(); 1.17792 +ok(ctx.lineJoin === old, "ctx.lineJoin === old"); 1.17793 +ctx.restore(); 1.17794 + 1.17795 + 1.17796 +} 1.17797 +</script> 1.17798 + 1.17799 +<!-- [[[ test_2d.state.saverestore.lineWidth.html ]]] --> 1.17800 + 1.17801 +<p>Canvas test: 2d.state.saverestore.lineWidth</p> 1.17802 +<!-- Testing: save()/restore() works for lineWidth --> 1.17803 +<canvas id="c559" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17804 +<script> 1.17805 + 1.17806 +function test_2d_state_saverestore_lineWidth() { 1.17807 + 1.17808 +var canvas = document.getElementById('c559'); 1.17809 +var ctx = canvas.getContext('2d'); 1.17810 + 1.17811 +// Test that restore() undoes any modifications 1.17812 +var old = ctx.lineWidth; 1.17813 +ctx.save(); 1.17814 +ctx.lineWidth = 0.5; 1.17815 +ctx.restore(); 1.17816 +ok(ctx.lineWidth === old, "ctx.lineWidth === old"); 1.17817 + 1.17818 +// Also test that save() doesn't modify the values 1.17819 +ctx.lineWidth = 0.5; 1.17820 +old = ctx.lineWidth; 1.17821 + // we're not interested in failures caused by get(set(x)) != x (e.g. 1.17822 + // from rounding), so compare against d instead of against 0.5 1.17823 +ctx.save(); 1.17824 +ok(ctx.lineWidth === old, "ctx.lineWidth === old"); 1.17825 +ctx.restore(); 1.17826 + 1.17827 + 1.17828 +} 1.17829 +</script> 1.17830 + 1.17831 +<!-- [[[ test_2d.state.saverestore.miterLimit.html ]]] --> 1.17832 + 1.17833 +<p>Canvas test: 2d.state.saverestore.miterLimit</p> 1.17834 +<!-- Testing: save()/restore() works for miterLimit --> 1.17835 +<canvas id="c560" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17836 +<script> 1.17837 + 1.17838 +function test_2d_state_saverestore_miterLimit() { 1.17839 + 1.17840 +var canvas = document.getElementById('c560'); 1.17841 +var ctx = canvas.getContext('2d'); 1.17842 + 1.17843 +// Test that restore() undoes any modifications 1.17844 +var old = ctx.miterLimit; 1.17845 +ctx.save(); 1.17846 +ctx.miterLimit = 0.5; 1.17847 +ctx.restore(); 1.17848 +ok(ctx.miterLimit === old, "ctx.miterLimit === old"); 1.17849 + 1.17850 +// Also test that save() doesn't modify the values 1.17851 +ctx.miterLimit = 0.5; 1.17852 +old = ctx.miterLimit; 1.17853 + // we're not interested in failures caused by get(set(x)) != x (e.g. 1.17854 + // from rounding), so compare against d instead of against 0.5 1.17855 +ctx.save(); 1.17856 +ok(ctx.miterLimit === old, "ctx.miterLimit === old"); 1.17857 +ctx.restore(); 1.17858 + 1.17859 + 1.17860 +} 1.17861 +</script> 1.17862 + 1.17863 +<!-- [[[ test_2d.state.saverestore.path.html ]]] --> 1.17864 + 1.17865 +<p>Canvas test: 2d.state.saverestore.path</p> 1.17866 +<!-- Testing: save()/restore() does not affect the current path --> 1.17867 +<canvas id="c561" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17868 +<script> 1.17869 + 1.17870 + 1.17871 +function test_2d_state_saverestore_path() { 1.17872 + 1.17873 +var canvas = document.getElementById('c561'); 1.17874 +var ctx = canvas.getContext('2d'); 1.17875 + 1.17876 +ctx.fillStyle = '#f00'; 1.17877 +ctx.fillRect(0, 0, 100, 50); 1.17878 +ctx.save(); 1.17879 +ctx.rect(0, 0, 100, 50); 1.17880 +ctx.restore(); 1.17881 +ctx.fillStyle = '#0f0'; 1.17882 +ctx.fill(); 1.17883 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.17884 + 1.17885 + 1.17886 +} 1.17887 +</script> 1.17888 + 1.17889 +<!-- [[[ test_2d.state.saverestore.shadowBlur.html ]]] --> 1.17890 + 1.17891 +<p>Canvas test: 2d.state.saverestore.shadowBlur</p> 1.17892 +<!-- Testing: save()/restore() works for shadowBlur --> 1.17893 +<canvas id="c562" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17894 +<script> 1.17895 + 1.17896 +function test_2d_state_saverestore_shadowBlur() { 1.17897 + 1.17898 +var canvas = document.getElementById('c562'); 1.17899 +var ctx = canvas.getContext('2d'); 1.17900 + 1.17901 +// Test that restore() undoes any modifications 1.17902 +var old = ctx.shadowBlur; 1.17903 +ctx.save(); 1.17904 +ctx.shadowBlur = 5; 1.17905 +ctx.restore(); 1.17906 +ok(ctx.shadowBlur === old, "ctx.shadowBlur === old"); 1.17907 + 1.17908 +// Also test that save() doesn't modify the values 1.17909 +ctx.shadowBlur = 5; 1.17910 +old = ctx.shadowBlur; 1.17911 + // we're not interested in failures caused by get(set(x)) != x (e.g. 1.17912 + // from rounding), so compare against d instead of against 5 1.17913 +ctx.save(); 1.17914 +ok(ctx.shadowBlur === old, "ctx.shadowBlur === old"); 1.17915 +ctx.restore(); 1.17916 + 1.17917 + 1.17918 +} 1.17919 +</script> 1.17920 + 1.17921 +<!-- [[[ test_2d.state.saverestore.shadowColor.html ]]] --> 1.17922 + 1.17923 +<p>Canvas test: 2d.state.saverestore.shadowColor</p> 1.17924 +<!-- Testing: save()/restore() works for shadowColor --> 1.17925 +<canvas id="c563" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17926 +<script> 1.17927 + 1.17928 +function test_2d_state_saverestore_shadowColor() { 1.17929 + 1.17930 +var canvas = document.getElementById('c563'); 1.17931 +var ctx = canvas.getContext('2d'); 1.17932 + 1.17933 +// Test that restore() undoes any modifications 1.17934 +var old = ctx.shadowColor; 1.17935 +ctx.save(); 1.17936 +ctx.shadowColor = "#ff0000"; 1.17937 +ctx.restore(); 1.17938 +ok(ctx.shadowColor === old, "ctx.shadowColor === old"); 1.17939 + 1.17940 +// Also test that save() doesn't modify the values 1.17941 +ctx.shadowColor = "#ff0000"; 1.17942 +old = ctx.shadowColor; 1.17943 + // we're not interested in failures caused by get(set(x)) != x (e.g. 1.17944 + // from rounding), so compare against d instead of against "#ff0000" 1.17945 +ctx.save(); 1.17946 +ok(ctx.shadowColor === old, "ctx.shadowColor === old"); 1.17947 +ctx.restore(); 1.17948 + 1.17949 + 1.17950 +} 1.17951 +</script> 1.17952 + 1.17953 +<!-- [[[ test_2d.state.saverestore.shadowOffsetX.html ]]] --> 1.17954 + 1.17955 +<p>Canvas test: 2d.state.saverestore.shadowOffsetX</p> 1.17956 +<!-- Testing: save()/restore() works for shadowOffsetX --> 1.17957 +<canvas id="c564" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17958 +<script> 1.17959 + 1.17960 +function test_2d_state_saverestore_shadowOffsetX() { 1.17961 + 1.17962 +var canvas = document.getElementById('c564'); 1.17963 +var ctx = canvas.getContext('2d'); 1.17964 + 1.17965 +// Test that restore() undoes any modifications 1.17966 +var old = ctx.shadowOffsetX; 1.17967 +ctx.save(); 1.17968 +ctx.shadowOffsetX = 5; 1.17969 +ctx.restore(); 1.17970 +ok(ctx.shadowOffsetX === old, "ctx.shadowOffsetX === old"); 1.17971 + 1.17972 +// Also test that save() doesn't modify the values 1.17973 +ctx.shadowOffsetX = 5; 1.17974 +old = ctx.shadowOffsetX; 1.17975 + // we're not interested in failures caused by get(set(x)) != x (e.g. 1.17976 + // from rounding), so compare against d instead of against 5 1.17977 +ctx.save(); 1.17978 +ok(ctx.shadowOffsetX === old, "ctx.shadowOffsetX === old"); 1.17979 +ctx.restore(); 1.17980 + 1.17981 + 1.17982 +} 1.17983 +</script> 1.17984 + 1.17985 +<!-- [[[ test_2d.state.saverestore.shadowOffsetY.html ]]] --> 1.17986 + 1.17987 +<p>Canvas test: 2d.state.saverestore.shadowOffsetY</p> 1.17988 +<!-- Testing: save()/restore() works for shadowOffsetY --> 1.17989 +<canvas id="c565" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.17990 +<script> 1.17991 + 1.17992 +function test_2d_state_saverestore_shadowOffsetY() { 1.17993 + 1.17994 +var canvas = document.getElementById('c565'); 1.17995 +var ctx = canvas.getContext('2d'); 1.17996 + 1.17997 +// Test that restore() undoes any modifications 1.17998 +var old = ctx.shadowOffsetY; 1.17999 +ctx.save(); 1.18000 +ctx.shadowOffsetY = 5; 1.18001 +ctx.restore(); 1.18002 +ok(ctx.shadowOffsetY === old, "ctx.shadowOffsetY === old"); 1.18003 + 1.18004 +// Also test that save() doesn't modify the values 1.18005 +ctx.shadowOffsetY = 5; 1.18006 +old = ctx.shadowOffsetY; 1.18007 + // we're not interested in failures caused by get(set(x)) != x (e.g. 1.18008 + // from rounding), so compare against d instead of against 5 1.18009 +ctx.save(); 1.18010 +ok(ctx.shadowOffsetY === old, "ctx.shadowOffsetY === old"); 1.18011 +ctx.restore(); 1.18012 + 1.18013 + 1.18014 +} 1.18015 +</script> 1.18016 + 1.18017 +<!-- [[[ test_2d.state.saverestore.stack.html ]]] --> 1.18018 + 1.18019 +<p>Canvas test: 2d.state.saverestore.stack</p> 1.18020 +<!-- Testing: save()/restore() can be nested as a stack --> 1.18021 +<canvas id="c566" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18022 +<script> 1.18023 + 1.18024 +function test_2d_state_saverestore_stack() { 1.18025 + 1.18026 +var canvas = document.getElementById('c566'); 1.18027 +var ctx = canvas.getContext('2d'); 1.18028 + 1.18029 +ctx.lineWidth = 1; 1.18030 +ctx.save(); 1.18031 +ctx.lineWidth = 2; 1.18032 +ctx.save(); 1.18033 +ctx.lineWidth = 3; 1.18034 +ok(ctx.lineWidth == 3, "ctx.lineWidth == 3"); 1.18035 +ctx.restore(); 1.18036 +ok(ctx.lineWidth == 2, "ctx.lineWidth == 2"); 1.18037 +ctx.restore(); 1.18038 +ok(ctx.lineWidth == 1, "ctx.lineWidth == 1"); 1.18039 + 1.18040 + 1.18041 +} 1.18042 +</script> 1.18043 + 1.18044 +<!-- [[[ test_2d.state.saverestore.stackdepth.html ]]] --> 1.18045 + 1.18046 +<p>Canvas test: 2d.state.saverestore.stackdepth</p> 1.18047 +<!-- Testing: save()/restore() stack depth is not unreasonably limited --> 1.18048 +<canvas id="c567" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18049 +<script> 1.18050 + 1.18051 +function test_2d_state_saverestore_stackdepth() { 1.18052 + 1.18053 +var canvas = document.getElementById('c567'); 1.18054 +var ctx = canvas.getContext('2d'); 1.18055 + 1.18056 +var limit = 512; 1.18057 +for (var i = 1; i < limit; ++i) 1.18058 +{ 1.18059 + ctx.save(); 1.18060 + ctx.lineWidth = i; 1.18061 +} 1.18062 +for (var i = limit-1; i > 0; --i) 1.18063 +{ 1.18064 + ok(ctx.lineWidth == i, "ctx.lineWidth == i"); 1.18065 + ctx.restore(); 1.18066 +} 1.18067 + 1.18068 + 1.18069 +} 1.18070 +</script> 1.18071 + 1.18072 +<!-- [[[ test_2d.state.saverestore.strokeStyle.html ]]] --> 1.18073 + 1.18074 +<p>Canvas test: 2d.state.saverestore.strokeStyle</p> 1.18075 +<!-- Testing: save()/restore() works for strokeStyle --> 1.18076 +<canvas id="c568" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18077 +<script> 1.18078 + 1.18079 +function test_2d_state_saverestore_strokeStyle() { 1.18080 + 1.18081 +var canvas = document.getElementById('c568'); 1.18082 +var ctx = canvas.getContext('2d'); 1.18083 + 1.18084 +// Test that restore() undoes any modifications 1.18085 +var old = ctx.strokeStyle; 1.18086 +ctx.save(); 1.18087 +ctx.strokeStyle = "#ff0000"; 1.18088 +ctx.restore(); 1.18089 +ok(ctx.strokeStyle === old, "ctx.strokeStyle === old"); 1.18090 + 1.18091 +// Also test that save() doesn't modify the values 1.18092 +ctx.strokeStyle = "#ff0000"; 1.18093 +old = ctx.strokeStyle; 1.18094 + // we're not interested in failures caused by get(set(x)) != x (e.g. 1.18095 + // from rounding), so compare against d instead of against "#ff0000" 1.18096 +ctx.save(); 1.18097 +ok(ctx.strokeStyle === old, "ctx.strokeStyle === old"); 1.18098 +ctx.restore(); 1.18099 + 1.18100 + 1.18101 +} 1.18102 +</script> 1.18103 + 1.18104 +<!-- [[[ test_2d.state.saverestore.transformation.html ]]] --> 1.18105 + 1.18106 +<p>Canvas test: 2d.state.saverestore.transformation</p> 1.18107 +<!-- Testing: save()/restore() affects the current transformation matrix --> 1.18108 +<canvas id="c569" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18109 +<script> 1.18110 + 1.18111 + 1.18112 +function test_2d_state_saverestore_transformation() { 1.18113 + 1.18114 +var canvas = document.getElementById('c569'); 1.18115 +var ctx = canvas.getContext('2d'); 1.18116 + 1.18117 +ctx.fillStyle = '#0f0'; 1.18118 +ctx.fillRect(0, 0, 100, 50); 1.18119 +ctx.save(); 1.18120 +ctx.translate(200, 0); 1.18121 +ctx.restore(); 1.18122 +ctx.fillStyle = '#f00'; 1.18123 +ctx.fillRect(-200, 0, 100, 50); 1.18124 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.18125 + 1.18126 + 1.18127 +} 1.18128 +</script> 1.18129 + 1.18130 +<!-- [[[ test_2d.state.saverestore.underflow.html ]]] --> 1.18131 + 1.18132 +<p>Canvas test: 2d.state.saverestore.underflow - bug 296821</p> 1.18133 +<!-- Testing: restore() with an empty stack has no effect --> 1.18134 +<canvas id="c570" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18135 +<script> 1.18136 + 1.18137 +function test_2d_state_saverestore_underflow() { 1.18138 + 1.18139 +var canvas = document.getElementById('c570'); 1.18140 +var ctx = canvas.getContext('2d'); 1.18141 + 1.18142 +for (var i = 0; i < 16; ++i) 1.18143 + ctx.restore(); 1.18144 +ctx.lineWidth = 0.5; 1.18145 +ctx.restore(); 1.18146 +ok(ctx.lineWidth == 0.5, "ctx.lineWidth == 0.5"); 1.18147 + 1.18148 + 1.18149 +} 1.18150 +</script> 1.18151 + 1.18152 +<!-- [[[ test_2d.strokeRect.basic.html ]]] --> 1.18153 + 1.18154 +<p>Canvas test: 2d.strokeRect.basic</p> 1.18155 +<canvas id="c571" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18156 +<script> 1.18157 + 1.18158 + 1.18159 +function test_2d_strokeRect_basic() { 1.18160 + 1.18161 +var canvas = document.getElementById('c571'); 1.18162 +var ctx = canvas.getContext('2d'); 1.18163 + 1.18164 +ctx.strokeStyle = '#0f0'; 1.18165 +ctx.lineWidth = 50; 1.18166 +ctx.strokeRect(25, 24, 50, 2); 1.18167 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.18168 + 1.18169 + 1.18170 +} 1.18171 +</script> 1.18172 + 1.18173 +<!-- [[[ test_2d.strokeRect.clip.html ]]] --> 1.18174 + 1.18175 +<p>Canvas test: 2d.strokeRect.clip</p> 1.18176 +<canvas id="c572" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18177 +<script> 1.18178 + 1.18179 + 1.18180 +function test_2d_strokeRect_clip() { 1.18181 + 1.18182 +var canvas = document.getElementById('c572'); 1.18183 +var ctx = canvas.getContext('2d'); 1.18184 + 1.18185 +ctx.fillStyle = '#0f0'; 1.18186 +ctx.fillRect(0, 0, 100, 50); 1.18187 + 1.18188 +ctx.beginPath(); 1.18189 +ctx.rect(0, 0, 16, 16); 1.18190 +ctx.clip(); 1.18191 + 1.18192 +ctx.strokeStyle = '#f00'; 1.18193 +ctx.lineWidth = 50; 1.18194 +ctx.strokeRect(0, 0, 100, 50); 1.18195 + 1.18196 +ctx.fillStyle = '#0f0'; 1.18197 +ctx.fillRect(0, 0, 16, 16); 1.18198 + 1.18199 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.18200 + 1.18201 + 1.18202 +} 1.18203 +</script> 1.18204 + 1.18205 +<!-- [[[ test_2d.strokeRect.globalalpha.html ]]] --> 1.18206 + 1.18207 +<p>Canvas test: 2d.strokeRect.globalalpha</p> 1.18208 +<canvas id="c573" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18209 +<script> 1.18210 + 1.18211 + 1.18212 +function test_2d_strokeRect_globalalpha() { 1.18213 + 1.18214 +var canvas = document.getElementById('c573'); 1.18215 +var ctx = canvas.getContext('2d'); 1.18216 + 1.18217 +ctx.globalAlpha = 0; 1.18218 +ctx.strokeStyle = '#f00'; 1.18219 +ctx.lineWidth = 50; 1.18220 +ctx.strokeRect(25, 24, 50, 2); 1.18221 +isPixel(ctx, 50,25, 0,0,0,0, 0); 1.18222 + 1.18223 + 1.18224 +} 1.18225 +</script> 1.18226 + 1.18227 +<!-- [[[ test_2d.strokeRect.globalcomposite.html ]]] --> 1.18228 + 1.18229 +<p>Canvas test: 2d.strokeRect.globalcomposite</p> 1.18230 +<canvas id="c574" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18231 +<script> 1.18232 + 1.18233 + 1.18234 +function test_2d_strokeRect_globalcomposite() { 1.18235 + 1.18236 +var canvas = document.getElementById('c574'); 1.18237 +var ctx = canvas.getContext('2d'); 1.18238 + 1.18239 +ctx.globalCompositeOperation = 'source-in'; 1.18240 +ctx.strokeStyle = '#f00'; 1.18241 +ctx.lineWidth = 50; 1.18242 +ctx.strokeRect(25, 24, 50, 2); 1.18243 +isPixel(ctx, 50,25, 0,0,0,0, 0); 1.18244 + 1.18245 + 1.18246 +} 1.18247 +</script> 1.18248 + 1.18249 +<!-- [[[ test_2d.strokeRect.negative.html ]]] --> 1.18250 + 1.18251 +<p>Canvas test: 2d.strokeRect.negative</p> 1.18252 +<canvas id="c575" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18253 +<script> 1.18254 + 1.18255 + 1.18256 +function test_2d_strokeRect_negative() { 1.18257 + 1.18258 +var canvas = document.getElementById('c575'); 1.18259 +var ctx = canvas.getContext('2d'); 1.18260 + 1.18261 +ctx.fillStyle = '#f00'; 1.18262 +ctx.fillRect(0, 0, 100, 50); 1.18263 +ctx.strokeStyle = '#0f0'; 1.18264 +ctx.lineWidth = 25; 1.18265 +ctx.strokeRect(12, 12, 26, 1); 1.18266 +ctx.strokeRect(88, 12, -26, 1); 1.18267 +ctx.strokeRect(12, 38, 26, -1); 1.18268 +ctx.strokeRect(88, 38, -26, -1); 1.18269 +isPixel(ctx, 25,12, 0,255,0,255, 0); 1.18270 +isPixel(ctx, 75,12, 0,255,0,255, 0); 1.18271 +isPixel(ctx, 25,37, 0,255,0,255, 0); 1.18272 +isPixel(ctx, 75,37, 0,255,0,255, 0); 1.18273 + 1.18274 + 1.18275 +} 1.18276 +</script> 1.18277 + 1.18278 +<!-- [[[ test_2d.strokeRect.nonfinite.html ]]] --> 1.18279 + 1.18280 +<p>Canvas test: 2d.strokeRect.nonfinite</p> 1.18281 +<!-- Testing: strokeRect() with Infinity/NaN is ignored --> 1.18282 +<canvas id="c576" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18283 +<script> 1.18284 + 1.18285 + 1.18286 +function test_2d_strokeRect_nonfinite() { 1.18287 + 1.18288 +var canvas = document.getElementById('c576'); 1.18289 +var ctx = canvas.getContext('2d'); 1.18290 + 1.18291 +var _thrown_outer = false; 1.18292 +try { 1.18293 + 1.18294 +ctx.fillStyle = '#0f0'; 1.18295 +ctx.fillRect(0, 0, 100, 50); 1.18296 + 1.18297 +ctx.strokeStyle = '#f00'; 1.18298 +ctx.lineWidth = 150; 1.18299 +ctx.strokeRect(Infinity, 0, 100, 50); 1.18300 +ctx.strokeRect(-Infinity, 0, 100, 50); 1.18301 +ctx.strokeRect(NaN, 0, 100, 50); 1.18302 +ctx.strokeRect(0, Infinity, 100, 50); 1.18303 +ctx.strokeRect(0, -Infinity, 100, 50); 1.18304 +ctx.strokeRect(0, NaN, 100, 50); 1.18305 +ctx.strokeRect(0, 0, Infinity, 50); 1.18306 +ctx.strokeRect(0, 0, -Infinity, 50); 1.18307 +ctx.strokeRect(0, 0, NaN, 50); 1.18308 +ctx.strokeRect(0, 0, 100, Infinity); 1.18309 +ctx.strokeRect(0, 0, 100, -Infinity); 1.18310 +ctx.strokeRect(0, 0, 100, NaN); 1.18311 +ctx.strokeRect(Infinity, Infinity, 100, 50); 1.18312 +ctx.strokeRect(Infinity, Infinity, Infinity, 50); 1.18313 +ctx.strokeRect(Infinity, Infinity, Infinity, Infinity); 1.18314 +ctx.strokeRect(Infinity, Infinity, 100, Infinity); 1.18315 +ctx.strokeRect(Infinity, 0, Infinity, 50); 1.18316 +ctx.strokeRect(Infinity, 0, Infinity, Infinity); 1.18317 +ctx.strokeRect(Infinity, 0, 100, Infinity); 1.18318 +ctx.strokeRect(0, Infinity, Infinity, 50); 1.18319 +ctx.strokeRect(0, Infinity, Infinity, Infinity); 1.18320 +ctx.strokeRect(0, Infinity, 100, Infinity); 1.18321 +ctx.strokeRect(0, 0, Infinity, Infinity); 1.18322 + 1.18323 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.18324 + 1.18325 +} catch (e) { 1.18326 + _thrown_outer = true; 1.18327 +} 1.18328 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.18329 + 1.18330 + 1.18331 +} 1.18332 +</script> 1.18333 + 1.18334 +<!-- [[[ test_2d.strokeRect.path.html ]]] --> 1.18335 + 1.18336 +<p>Canvas test: 2d.strokeRect.path</p> 1.18337 +<canvas id="c577" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18338 +<script> 1.18339 + 1.18340 + 1.18341 +function test_2d_strokeRect_path() { 1.18342 + 1.18343 +var canvas = document.getElementById('c577'); 1.18344 +var ctx = canvas.getContext('2d'); 1.18345 + 1.18346 +ctx.beginPath(); 1.18347 +ctx.rect(0, 0, 100, 50); 1.18348 +ctx.strokeStyle = '#f00'; 1.18349 +ctx.lineWidth = 5; 1.18350 +ctx.strokeRect(0, 0, 16, 16); 1.18351 +ctx.fillStyle = '#0f0'; 1.18352 +ctx.fill(); 1.18353 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.18354 + 1.18355 + 1.18356 +} 1.18357 +</script> 1.18358 + 1.18359 +<!-- [[[ test_2d.strokeRect.shadow.html ]]] --> 1.18360 + 1.18361 +<p>Canvas test: 2d.strokeRect.shadow</p> 1.18362 +<canvas id="c578" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18363 +<script> 1.18364 + 1.18365 + 1.18366 +function test_2d_strokeRect_shadow() { 1.18367 + 1.18368 +var canvas = document.getElementById('c578'); 1.18369 +var ctx = canvas.getContext('2d'); 1.18370 + 1.18371 +ctx.fillStyle = '#0f0'; 1.18372 +ctx.fillRect(0, 0, 100, 50); 1.18373 + 1.18374 +ctx.fillStyle = '#f00'; 1.18375 +ctx.shadowBlur = 0; 1.18376 +ctx.shadowOffsetX = 0; 1.18377 +ctx.shadowOffsetY = 50; 1.18378 + 1.18379 +// Shadows are optional, so just test that if they apply to fill() then they apply to strokeRect() too 1.18380 +ctx.beginPath(); 1.18381 +ctx.rect(0, -50, 100, 50); 1.18382 +ctx.shadowColor = '#f00'; 1.18383 +ctx.fill(); 1.18384 + 1.18385 +ctx.shadowColor = '#0f0'; 1.18386 +ctx.strokeStyle = '#f00'; 1.18387 +ctx.lineWidth = 50; 1.18388 +ctx.strokeRect(0, -75, 100, 50); 1.18389 + 1.18390 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.18391 + 1.18392 + 1.18393 +} 1.18394 +</script> 1.18395 + 1.18396 +<!-- [[[ test_2d.strokeRect.transform.html ]]] --> 1.18397 + 1.18398 +<p>Canvas test: 2d.strokeRect.transform</p> 1.18399 +<canvas id="c579" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18400 +<script> 1.18401 + 1.18402 + 1.18403 +function test_2d_strokeRect_transform() { 1.18404 + 1.18405 +var canvas = document.getElementById('c579'); 1.18406 +var ctx = canvas.getContext('2d'); 1.18407 + 1.18408 +ctx.scale(10, 10); 1.18409 +ctx.translate(0, 5); 1.18410 +ctx.strokeStyle = '#0f0'; 1.18411 +ctx.lineWidth = 5; 1.18412 +ctx.strokeRect(2.5, -2.6, 5, 0.2); 1.18413 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.18414 + 1.18415 + 1.18416 +} 1.18417 +</script> 1.18418 + 1.18419 +<!-- [[[ test_2d.strokeRect.zero.1.html ]]] --> 1.18420 + 1.18421 +<p>Canvas test: 2d.strokeRect.zero.1</p> 1.18422 +<canvas id="c580" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18423 +<script> 1.18424 + 1.18425 + 1.18426 +function test_2d_strokeRect_zero_1() { 1.18427 + 1.18428 +var canvas = document.getElementById('c580'); 1.18429 +var ctx = canvas.getContext('2d'); 1.18430 + 1.18431 +if (!IsD2DEnabled()) { 1.18432 + // Disabled for D2D until we can figure out Bug 587554. 1.18433 + ctx.strokeStyle = '#f00'; 1.18434 + ctx.lineWidth = 250; 1.18435 + ctx.strokeRect(50, 25, 0, 0); 1.18436 + isPixel(ctx, 50,25, 0,0,0,0, 0); 1.18437 +} 1.18438 + 1.18439 +} 1.18440 +</script> 1.18441 + 1.18442 +<!-- [[[ test_2d.strokeRect.zero.2.html ]]] --> 1.18443 + 1.18444 +<p>Canvas test: 2d.strokeRect.zero.2</p> 1.18445 +<canvas id="c581" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18446 +<script> 1.18447 + 1.18448 + 1.18449 + 1.18450 +function test_2d_strokeRect_zero_2() { 1.18451 + 1.18452 +var canvas = document.getElementById('c581'); 1.18453 +var ctx = canvas.getContext('2d'); 1.18454 + 1.18455 +ctx.strokeStyle = '#f00'; 1.18456 +ctx.lineWidth = 250; 1.18457 +ctx.lineCap = 'round'; 1.18458 +ctx.lineJoin = 'round'; 1.18459 +ctx.strokeRect(50, 25, 0, 0); 1.18460 +isPixel(ctx, 50,25, 0,0,0,0, 0); 1.18461 + 1.18462 + 1.18463 +} 1.18464 +</script> 1.18465 + 1.18466 +<!-- [[[ test_2d.strokeRect.zero.3.html ]]] --> 1.18467 + 1.18468 +<p>Canvas test: 2d.strokeRect.zero.3</p> 1.18469 +<canvas id="c582" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18470 +<script> 1.18471 + 1.18472 + 1.18473 +function test_2d_strokeRect_zero_3() { 1.18474 + 1.18475 +var canvas = document.getElementById('c582'); 1.18476 +var ctx = canvas.getContext('2d'); 1.18477 + 1.18478 +ctx.strokeStyle = '#0f0'; 1.18479 +ctx.lineWidth = 50; 1.18480 +ctx.strokeRect(0, 25, 100, 0); 1.18481 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.18482 + 1.18483 + 1.18484 +} 1.18485 +</script> 1.18486 + 1.18487 +<!-- [[[ test_2d.strokeRect.zero.4.html ]]] --> 1.18488 + 1.18489 +<p>Canvas test: 2d.strokeRect.zero.4</p> 1.18490 +<canvas id="c583" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18491 +<script> 1.18492 + 1.18493 + 1.18494 +function test_2d_strokeRect_zero_4() { 1.18495 + 1.18496 +var canvas = document.getElementById('c583'); 1.18497 +var ctx = canvas.getContext('2d'); 1.18498 + 1.18499 +ctx.strokeStyle = '#f00'; 1.18500 +ctx.lineWidth = 250; 1.18501 +ctx.lineCap = 'round'; 1.18502 +ctx.strokeRect(100, 25, 100, 0); 1.18503 +isPixel(ctx, 50,25, 0,0,0,0, 0); 1.18504 + 1.18505 + 1.18506 +} 1.18507 +</script> 1.18508 + 1.18509 +<!-- [[[ test_2d.strokeRect.zero.5.html ]]] --> 1.18510 + 1.18511 +<p>Canvas test: 2d.strokeRect.zero.5</p> 1.18512 +<canvas id="c584" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18513 +<script> 1.18514 + 1.18515 + 1.18516 +function test_2d_strokeRect_zero_5() { 1.18517 + 1.18518 +var canvas = document.getElementById('c584'); 1.18519 +var ctx = canvas.getContext('2d'); 1.18520 + 1.18521 +ctx.strokeStyle = '#0f0'; 1.18522 +ctx.lineWidth = 250; 1.18523 +ctx.lineJoin = 'round'; 1.18524 +ctx.strokeRect(100, 25, 100, 0); 1.18525 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.18526 + 1.18527 + 1.18528 +} 1.18529 +</script> 1.18530 + 1.18531 +<!-- [[[ test_2d.strokeStyle.default.html ]]] --> 1.18532 + 1.18533 +<p>Canvas test: 2d.strokeStyle.default</p> 1.18534 +<canvas id="c585" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18535 +<script> 1.18536 + 1.18537 +function test_2d_strokeStyle_default() { 1.18538 + 1.18539 +var canvas = document.getElementById('c585'); 1.18540 +var ctx = canvas.getContext('2d'); 1.18541 + 1.18542 +ok(ctx.strokeStyle == '#000000', "ctx.strokeStyle == '#000000'"); 1.18543 + 1.18544 + 1.18545 +} 1.18546 +</script> 1.18547 + 1.18548 +<!-- [[[ test_2d.text.align.default.html ]]] --> 1.18549 + 1.18550 +<p>Canvas test: 2d.text.align.default</p> 1.18551 +<canvas height="50" id="c569a" width="100"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18552 +<script> 1.18553 + 1.18554 +function test_2d_text_align_default() { 1.18555 + 1.18556 +var canvas = document.getElementById('c569a'); 1.18557 +var ctx = canvas.getContext('2d'); 1.18558 + 1.18559 +ok(ctx.textAlign === 'start', "ctx.textAlign === 'start'"); 1.18560 + 1.18561 + 1.18562 +} 1.18563 +</script> 1.18564 + 1.18565 +<!-- [[[ test_2d.text.align.invalid.html ]]] --> 1.18566 + 1.18567 +<p>Canvas test: 2d.text.align.invalid</p> 1.18568 +<canvas height="50" id="c570a" width="100"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18569 +<script> 1.18570 + 1.18571 +function test_2d_text_align_invalid() { 1.18572 + 1.18573 +var canvas = document.getElementById('c570a'); 1.18574 +var ctx = canvas.getContext('2d'); 1.18575 + 1.18576 +ctx.textAlign = 'start'; 1.18577 +ctx.textAlign = 'bogus'; 1.18578 +ok(ctx.textAlign === 'start', "ctx.textAlign === 'start'"); 1.18579 + 1.18580 +ctx.textAlign = 'start'; 1.18581 +ctx.textAlign = 'END'; 1.18582 +ok(ctx.textAlign === 'start', "ctx.textAlign === 'start'"); 1.18583 + 1.18584 +ctx.textAlign = 'start'; 1.18585 +ctx.textAlign = 'end '; 1.18586 +ok(ctx.textAlign === 'start', "ctx.textAlign === 'start'"); 1.18587 + 1.18588 +ctx.textAlign = 'start'; 1.18589 +ctx.textAlign = 'end\0'; 1.18590 +ok(ctx.textAlign === 'start', "ctx.textAlign === 'start'"); 1.18591 + 1.18592 + 1.18593 +} 1.18594 +</script> 1.18595 + 1.18596 +<!-- [[[ test_2d.text.baseline.default.html ]]] --> 1.18597 + 1.18598 +<p>Canvas test: 2d.text.baseline.default</p> 1.18599 +<canvas height="50" id="c572a" width="100"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18600 +<script> 1.18601 + 1.18602 +function test_2d_text_baseline_default() { 1.18603 + 1.18604 +var canvas = document.getElementById('c572a'); 1.18605 +var ctx = canvas.getContext('2d'); 1.18606 + 1.18607 +ok(ctx.textBaseline === 'alphabetic', "ctx.textBaseline === 'alphabetic'"); 1.18608 + 1.18609 + 1.18610 +} 1.18611 +</script> 1.18612 + 1.18613 +<!-- [[[ test_2d.text.baseline.invalid.html ]]] --> 1.18614 + 1.18615 +<p>Canvas test: 2d.text.baseline.invalid</p> 1.18616 +<canvas height="50" id="c573a" width="100"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18617 +<script> 1.18618 + 1.18619 +function test_2d_text_baseline_invalid() { 1.18620 + 1.18621 +var canvas = document.getElementById('c573a'); 1.18622 +var ctx = canvas.getContext('2d'); 1.18623 + 1.18624 +ctx.textBaseline = 'top'; 1.18625 +ctx.textBaseline = 'bogus'; 1.18626 +ok(ctx.textBaseline === 'top', "ctx.textBaseline === 'top'"); 1.18627 + 1.18628 +ctx.textBaseline = 'top'; 1.18629 +ctx.textBaseline = 'MIDDLE'; 1.18630 +ok(ctx.textBaseline === 'top', "ctx.textBaseline === 'top'"); 1.18631 + 1.18632 +ctx.textBaseline = 'top'; 1.18633 +ctx.textBaseline = 'middle '; 1.18634 +ok(ctx.textBaseline === 'top', "ctx.textBaseline === 'top'"); 1.18635 + 1.18636 +ctx.textBaseline = 'top'; 1.18637 +ctx.textBaseline = 'middle\0'; 1.18638 +ok(ctx.textBaseline === 'top', "ctx.textBaseline === 'top'"); 1.18639 + 1.18640 + 1.18641 +} 1.18642 +</script> 1.18643 + 1.18644 +<!-- [[[ test_2d.transformation.order.html ]]] --> 1.18645 + 1.18646 +<p>Canvas test: 2d.transformation.order</p> 1.18647 +<!-- Testing: Transformations are applied in the right order --> 1.18648 +<canvas id="c586" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18649 +<script> 1.18650 + 1.18651 + 1.18652 +function test_2d_transformation_order() { 1.18653 + 1.18654 +var canvas = document.getElementById('c586'); 1.18655 +var ctx = canvas.getContext('2d'); 1.18656 + 1.18657 +ctx.fillStyle = '#f00'; 1.18658 +ctx.fillRect(0, 0, 100, 50); 1.18659 + 1.18660 +ctx.scale(2, 1); 1.18661 +ctx.rotate(Math.PI / 2); 1.18662 +ctx.fillStyle = '#0f0'; 1.18663 +ctx.fillRect(0, -50, 50, 50); 1.18664 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.18665 + 1.18666 + 1.18667 +} 1.18668 +</script> 1.18669 + 1.18670 +<!-- [[[ test_2d.transformation.rotate.direction.html ]]] --> 1.18671 + 1.18672 +<p>Canvas test: 2d.transformation.rotate.direction</p> 1.18673 +<!-- Testing: rotate() is clockwise --> 1.18674 +<canvas id="c587" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18675 +<script> 1.18676 + 1.18677 + 1.18678 +function test_2d_transformation_rotate_direction() { 1.18679 + 1.18680 +var canvas = document.getElementById('c587'); 1.18681 +var ctx = canvas.getContext('2d'); 1.18682 + 1.18683 +ctx.fillStyle = '#f00'; 1.18684 +ctx.fillRect(0, 0, 100, 50); 1.18685 + 1.18686 +ctx.rotate(Math.PI / 2); 1.18687 +ctx.fillStyle = '#0f0'; 1.18688 +ctx.fillRect(0, -100, 50, 100); 1.18689 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.18690 + 1.18691 + 1.18692 +} 1.18693 +</script> 1.18694 + 1.18695 +<!-- [[[ test_2d.transformation.rotate.nonfinite.html ]]] --> 1.18696 + 1.18697 +<p>Canvas test: 2d.transformation.rotate.nonfinite</p> 1.18698 +<!-- Testing: rotate() with Infinity/NaN is ignored --> 1.18699 +<canvas id="c588" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18700 +<script> 1.18701 + 1.18702 + 1.18703 +function test_2d_transformation_rotate_nonfinite() { 1.18704 + 1.18705 +var canvas = document.getElementById('c588'); 1.18706 +var ctx = canvas.getContext('2d'); 1.18707 + 1.18708 +var _thrown_outer = false; 1.18709 +try { 1.18710 + 1.18711 +ctx.fillStyle = '#f00'; 1.18712 +ctx.fillRect(0, 0, 100, 50); 1.18713 + 1.18714 +ctx.translate(100, 10); 1.18715 +ctx.rotate(Infinity); 1.18716 +ctx.rotate(-Infinity); 1.18717 +ctx.rotate(NaN); 1.18718 + 1.18719 +ctx.fillStyle = '#0f0'; 1.18720 +ctx.fillRect(-100, -10, 100, 50); 1.18721 + 1.18722 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.18723 + 1.18724 +} catch (e) { 1.18725 + _thrown_outer = true; 1.18726 +} 1.18727 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.18728 + 1.18729 + 1.18730 +} 1.18731 +</script> 1.18732 + 1.18733 +<!-- [[[ test_2d.transformation.rotate.radians.html ]]] --> 1.18734 + 1.18735 +<p>Canvas test: 2d.transformation.rotate.radians</p> 1.18736 +<!-- Testing: rotate() uses radians --> 1.18737 +<canvas id="c589" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18738 +<script> 1.18739 + 1.18740 + 1.18741 +function test_2d_transformation_rotate_radians() { 1.18742 + 1.18743 +var canvas = document.getElementById('c589'); 1.18744 +var ctx = canvas.getContext('2d'); 1.18745 + 1.18746 +ctx.fillStyle = '#f00'; 1.18747 +ctx.fillRect(0, 0, 100, 50); 1.18748 + 1.18749 +ctx.rotate(Math.PI); // should fail obviously if this is 3.1 degrees 1.18750 +ctx.fillStyle = '#0f0'; 1.18751 +ctx.fillRect(-100, -50, 100, 50); 1.18752 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.18753 + 1.18754 + 1.18755 +} 1.18756 +</script> 1.18757 + 1.18758 +<!-- [[[ test_2d.transformation.rotate.wrap.html ]]] --> 1.18759 + 1.18760 +<p>Canvas test: 2d.transformation.rotate.wrap</p> 1.18761 +<!-- Testing: rotate() wraps large positive values correctly --> 1.18762 +<canvas id="c590" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18763 +<script> 1.18764 + 1.18765 + 1.18766 +function test_2d_transformation_rotate_wrap() { 1.18767 + 1.18768 +var canvas = document.getElementById('c590'); 1.18769 +var ctx = canvas.getContext('2d'); 1.18770 + 1.18771 +ctx.fillStyle = '#f00'; 1.18772 +ctx.fillRect(0, 0, 100, 50); 1.18773 + 1.18774 +ctx.rotate(Math.PI * (1 + 4096)); // == pi (mod 2*pi) 1.18775 +// We need about pi +/- 0.001 in order to get correct-looking results 1.18776 +// 32-bit floats can store pi*4097 with precision 2^-10, so that should 1.18777 +// be safe enough on reasonable implementations 1.18778 +ctx.fillStyle = '#0f0'; 1.18779 +ctx.fillRect(-100, -50, 100, 50); 1.18780 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.18781 +isPixel(ctx, 98,2, 0,255,0,255, 0); 1.18782 +isPixel(ctx, 98,47, 0,255,0,255, 0); 1.18783 + 1.18784 + 1.18785 +} 1.18786 +</script> 1.18787 + 1.18788 +<!-- [[[ test_2d.transformation.rotate.wrapnegative.html ]]] --> 1.18789 + 1.18790 +<p>Canvas test: 2d.transformation.rotate.wrapnegative</p> 1.18791 +<!-- Testing: rotate() wraps large negative values correctly --> 1.18792 +<canvas id="c591" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18793 +<script> 1.18794 + 1.18795 + 1.18796 +function test_2d_transformation_rotate_wrapnegative() { 1.18797 + 1.18798 +var canvas = document.getElementById('c591'); 1.18799 +var ctx = canvas.getContext('2d'); 1.18800 + 1.18801 +ctx.fillStyle = '#f00'; 1.18802 +ctx.fillRect(0, 0, 100, 50); 1.18803 + 1.18804 +ctx.rotate(-Math.PI * (1 + 4096)); 1.18805 +ctx.fillStyle = '#0f0'; 1.18806 +ctx.fillRect(-100, -50, 100, 50); 1.18807 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.18808 +isPixel(ctx, 98,2, 0,255,0,255, 0); 1.18809 +isPixel(ctx, 98,47, 0,255,0,255, 0); 1.18810 + 1.18811 + 1.18812 +} 1.18813 +</script> 1.18814 + 1.18815 +<!-- [[[ test_2d.transformation.rotate.zero.html ]]] --> 1.18816 + 1.18817 +<p>Canvas test: 2d.transformation.rotate.zero</p> 1.18818 +<!-- Testing: rotate() by 0 does nothing --> 1.18819 +<canvas id="c592" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18820 +<script> 1.18821 + 1.18822 + 1.18823 +function test_2d_transformation_rotate_zero() { 1.18824 + 1.18825 +var canvas = document.getElementById('c592'); 1.18826 +var ctx = canvas.getContext('2d'); 1.18827 + 1.18828 +ctx.fillStyle = '#f00'; 1.18829 +ctx.fillRect(0, 0, 100, 50); 1.18830 + 1.18831 +ctx.rotate(0); 1.18832 +ctx.fillStyle = '#0f0'; 1.18833 +ctx.fillRect(0, 0, 100, 50); 1.18834 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.18835 + 1.18836 + 1.18837 +} 1.18838 +</script> 1.18839 + 1.18840 +<!-- [[[ test_2d.transformation.scale.basic.html ]]] --> 1.18841 + 1.18842 +<p>Canvas test: 2d.transformation.scale.basic</p> 1.18843 +<!-- Testing: scale() works --> 1.18844 +<canvas id="c593" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18845 +<script> 1.18846 + 1.18847 + 1.18848 +function test_2d_transformation_scale_basic() { 1.18849 + 1.18850 +var canvas = document.getElementById('c593'); 1.18851 +var ctx = canvas.getContext('2d'); 1.18852 + 1.18853 +ctx.fillStyle = '#f00'; 1.18854 +ctx.fillRect(0, 0, 100, 50); 1.18855 + 1.18856 +ctx.scale(2, 4); 1.18857 +ctx.fillStyle = '#0f0'; 1.18858 +ctx.fillRect(0, 0, 50, 12.5); 1.18859 +isPixel(ctx, 90,40, 0,255,0,255, 0); 1.18860 + 1.18861 + 1.18862 +} 1.18863 +</script> 1.18864 + 1.18865 +<!-- [[[ test_2d.transformation.scale.large.html ]]] --> 1.18866 + 1.18867 +<p>Canvas test: 2d.transformation.scale.large</p> 1.18868 +<!-- Testing: scale() with large scale factors works --> 1.18869 +<canvas id="c594" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18870 +<script> 1.18871 + 1.18872 + 1.18873 +function test_2d_transformation_scale_large() { 1.18874 + 1.18875 +var canvas = document.getElementById('c594'); 1.18876 +var ctx = canvas.getContext('2d'); 1.18877 + 1.18878 +ctx.fillStyle = '#f00'; 1.18879 +ctx.fillRect(0, 0, 100, 50); 1.18880 + 1.18881 +ctx.scale(1e5, 1e5); 1.18882 +ctx.fillStyle = '#0f0'; 1.18883 +ctx.fillRect(0, 0, 1, 1); 1.18884 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.18885 + 1.18886 + 1.18887 +} 1.18888 +</script> 1.18889 + 1.18890 +<!-- [[[ test_2d.transformation.scale.multiple.html ]]] --> 1.18891 + 1.18892 +<p>Canvas test: 2d.transformation.scale.multiple</p> 1.18893 +<!-- Testing: Multiple scale()s combine --> 1.18894 +<canvas id="c595" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18895 +<script> 1.18896 + 1.18897 + 1.18898 +function test_2d_transformation_scale_multiple() { 1.18899 + 1.18900 +var canvas = document.getElementById('c595'); 1.18901 +var ctx = canvas.getContext('2d'); 1.18902 + 1.18903 +ctx.fillStyle = '#f00'; 1.18904 +ctx.fillRect(0, 0, 100, 50); 1.18905 + 1.18906 +ctx.scale(Math.sqrt(2), Math.sqrt(2)); 1.18907 +ctx.scale(Math.sqrt(2), Math.sqrt(2)); 1.18908 +ctx.fillStyle = '#0f0'; 1.18909 +ctx.fillRect(0, 0, 50, 25); 1.18910 +isPixel(ctx, 90,40, 0,255,0,255, 0); 1.18911 + 1.18912 + 1.18913 +} 1.18914 +</script> 1.18915 + 1.18916 +<!-- [[[ test_2d.transformation.scale.negative.html ]]] --> 1.18917 + 1.18918 +<p>Canvas test: 2d.transformation.scale.negative</p> 1.18919 +<!-- Testing: scale() with negative scale factors works --> 1.18920 +<canvas id="c596" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18921 +<script> 1.18922 + 1.18923 + 1.18924 +function test_2d_transformation_scale_negative() { 1.18925 + 1.18926 +var canvas = document.getElementById('c596'); 1.18927 +var ctx = canvas.getContext('2d'); 1.18928 + 1.18929 +ctx.fillStyle = '#f00'; 1.18930 +ctx.fillRect(0, 0, 100, 50); 1.18931 + 1.18932 +ctx.save(); 1.18933 +ctx.scale(-1, 1); 1.18934 +ctx.fillStyle = '#0f0'; 1.18935 +ctx.fillRect(-50, 0, 50, 50); 1.18936 +ctx.restore(); 1.18937 + 1.18938 +ctx.save(); 1.18939 +ctx.scale(1, -1); 1.18940 +ctx.fillStyle = '#0f0'; 1.18941 +ctx.fillRect(50, -50, 50, 50); 1.18942 +ctx.restore(); 1.18943 +isPixel(ctx, 25,25, 0,255,0,255, 0); 1.18944 +isPixel(ctx, 75,25, 0,255,0,255, 0); 1.18945 + 1.18946 + 1.18947 +} 1.18948 +</script> 1.18949 + 1.18950 +<!-- [[[ test_2d.transformation.scale.nonfinite.html ]]] --> 1.18951 + 1.18952 +<p>Canvas test: 2d.transformation.scale.nonfinite</p> 1.18953 +<!-- Testing: scale() with Infinity/NaN is ignored --> 1.18954 +<canvas id="c597" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18955 +<script> 1.18956 + 1.18957 + 1.18958 +function test_2d_transformation_scale_nonfinite() { 1.18959 + 1.18960 +var canvas = document.getElementById('c597'); 1.18961 +var ctx = canvas.getContext('2d'); 1.18962 + 1.18963 +var _thrown_outer = false; 1.18964 +try { 1.18965 + 1.18966 +ctx.fillStyle = '#f00'; 1.18967 +ctx.fillRect(0, 0, 100, 50); 1.18968 + 1.18969 +ctx.translate(100, 10); 1.18970 +ctx.scale(Infinity, 0.1); 1.18971 +ctx.scale(-Infinity, 0.1); 1.18972 +ctx.scale(NaN, 0.1); 1.18973 +ctx.scale(0.1, Infinity); 1.18974 +ctx.scale(0.1, -Infinity); 1.18975 +ctx.scale(0.1, NaN); 1.18976 +ctx.scale(Infinity, Infinity); 1.18977 + 1.18978 +ctx.fillStyle = '#0f0'; 1.18979 +ctx.fillRect(-100, -10, 100, 50); 1.18980 + 1.18981 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.18982 + 1.18983 +} catch (e) { 1.18984 + _thrown_outer = true; 1.18985 +} 1.18986 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.18987 + 1.18988 + 1.18989 +} 1.18990 +</script> 1.18991 + 1.18992 +<!-- [[[ test_2d.transformation.scale.zero.html ]]] --> 1.18993 + 1.18994 +<p>Canvas test: 2d.transformation.scale.zero</p> 1.18995 +<!-- Testing: scale() with a scale factor of zero works --> 1.18996 +<canvas id="c598" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.18997 +<script> 1.18998 + 1.18999 + 1.19000 +function test_2d_transformation_scale_zero() { 1.19001 + 1.19002 +var canvas = document.getElementById('c598'); 1.19003 +var ctx = canvas.getContext('2d'); 1.19004 + 1.19005 +ctx.fillStyle = '#0f0'; 1.19006 +ctx.fillRect(0, 0, 100, 50); 1.19007 + 1.19008 +ctx.save(); 1.19009 +ctx.translate(50, 0); 1.19010 +ctx.scale(0, 1); 1.19011 +ctx.fillStyle = '#f00'; 1.19012 +ctx.fillRect(0, 0, 100, 50); 1.19013 +ctx.restore(); 1.19014 + 1.19015 +ctx.save(); 1.19016 +ctx.translate(0, 25); 1.19017 +ctx.scale(1, 0); 1.19018 +ctx.fillStyle = '#f00'; 1.19019 +ctx.fillRect(0, 0, 100, 50); 1.19020 +ctx.restore(); 1.19021 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.19022 + 1.19023 + 1.19024 +} 1.19025 +</script> 1.19026 + 1.19027 +<!-- [[[ test_2d.transformation.setTransform.multiple.html ]]] --> 1.19028 + 1.19029 +<p>Canvas test: 2d.transformation.setTransform.multiple</p> 1.19030 +<canvas id="c599" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19031 +<script> 1.19032 + 1.19033 + 1.19034 +function test_2d_transformation_setTransform_multiple() { 1.19035 + 1.19036 +var canvas = document.getElementById('c599'); 1.19037 +var ctx = canvas.getContext('2d'); 1.19038 + 1.19039 +ctx.fillStyle = '#f00'; 1.19040 +ctx.fillRect(0, 0, 100, 50); 1.19041 + 1.19042 +ctx.setTransform(1/2,0, 0,1/2, 0,0); 1.19043 +ctx.setTransform(2,0, 0,2, 0,0); 1.19044 +ctx.fillStyle = '#0f0'; 1.19045 +ctx.fillRect(0, 0, 50, 25); 1.19046 +isPixel(ctx, 75,35, 0,255,0,255, 0); 1.19047 + 1.19048 + 1.19049 +} 1.19050 +</script> 1.19051 + 1.19052 +<!-- [[[ test_2d.transformation.setTransform.nonfinite.html ]]] --> 1.19053 + 1.19054 +<p>Canvas test: 2d.transformation.setTransform.nonfinite</p> 1.19055 +<!-- Testing: setTransform() with Infinity/NaN is ignored --> 1.19056 +<canvas id="c600" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19057 +<script> 1.19058 + 1.19059 + 1.19060 +function test_2d_transformation_setTransform_nonfinite() { 1.19061 + 1.19062 +var canvas = document.getElementById('c600'); 1.19063 +var ctx = canvas.getContext('2d'); 1.19064 + 1.19065 +var _thrown_outer = false; 1.19066 +try { 1.19067 + 1.19068 +ctx.fillStyle = '#f00'; 1.19069 +ctx.fillRect(0, 0, 100, 50); 1.19070 + 1.19071 +ctx.translate(100, 10); 1.19072 +ctx.setTransform(Infinity, 0, 0, 0, 0, 0); 1.19073 +ctx.setTransform(-Infinity, 0, 0, 0, 0, 0); 1.19074 +ctx.setTransform(NaN, 0, 0, 0, 0, 0); 1.19075 +ctx.setTransform(0, Infinity, 0, 0, 0, 0); 1.19076 +ctx.setTransform(0, -Infinity, 0, 0, 0, 0); 1.19077 +ctx.setTransform(0, NaN, 0, 0, 0, 0); 1.19078 +ctx.setTransform(0, 0, Infinity, 0, 0, 0); 1.19079 +ctx.setTransform(0, 0, -Infinity, 0, 0, 0); 1.19080 +ctx.setTransform(0, 0, NaN, 0, 0, 0); 1.19081 +ctx.setTransform(0, 0, 0, Infinity, 0, 0); 1.19082 +ctx.setTransform(0, 0, 0, -Infinity, 0, 0); 1.19083 +ctx.setTransform(0, 0, 0, NaN, 0, 0); 1.19084 +ctx.setTransform(0, 0, 0, 0, Infinity, 0); 1.19085 +ctx.setTransform(0, 0, 0, 0, -Infinity, 0); 1.19086 +ctx.setTransform(0, 0, 0, 0, NaN, 0); 1.19087 +ctx.setTransform(0, 0, 0, 0, 0, Infinity); 1.19088 +ctx.setTransform(0, 0, 0, 0, 0, -Infinity); 1.19089 +ctx.setTransform(0, 0, 0, 0, 0, NaN); 1.19090 +ctx.setTransform(Infinity, Infinity, 0, 0, 0, 0); 1.19091 +ctx.setTransform(Infinity, Infinity, Infinity, 0, 0, 0); 1.19092 +ctx.setTransform(Infinity, Infinity, Infinity, Infinity, 0, 0); 1.19093 +ctx.setTransform(Infinity, Infinity, Infinity, Infinity, Infinity, 0); 1.19094 +ctx.setTransform(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); 1.19095 +ctx.setTransform(Infinity, Infinity, Infinity, Infinity, 0, Infinity); 1.19096 +ctx.setTransform(Infinity, Infinity, Infinity, 0, Infinity, 0); 1.19097 +ctx.setTransform(Infinity, Infinity, Infinity, 0, Infinity, Infinity); 1.19098 +ctx.setTransform(Infinity, Infinity, Infinity, 0, 0, Infinity); 1.19099 +ctx.setTransform(Infinity, Infinity, 0, Infinity, 0, 0); 1.19100 +ctx.setTransform(Infinity, Infinity, 0, Infinity, Infinity, 0); 1.19101 +ctx.setTransform(Infinity, Infinity, 0, Infinity, Infinity, Infinity); 1.19102 +ctx.setTransform(Infinity, Infinity, 0, Infinity, 0, Infinity); 1.19103 +ctx.setTransform(Infinity, Infinity, 0, 0, Infinity, 0); 1.19104 +ctx.setTransform(Infinity, Infinity, 0, 0, Infinity, Infinity); 1.19105 +ctx.setTransform(Infinity, Infinity, 0, 0, 0, Infinity); 1.19106 +ctx.setTransform(Infinity, 0, Infinity, 0, 0, 0); 1.19107 +ctx.setTransform(Infinity, 0, Infinity, Infinity, 0, 0); 1.19108 +ctx.setTransform(Infinity, 0, Infinity, Infinity, Infinity, 0); 1.19109 +ctx.setTransform(Infinity, 0, Infinity, Infinity, Infinity, Infinity); 1.19110 +ctx.setTransform(Infinity, 0, Infinity, Infinity, 0, Infinity); 1.19111 +ctx.setTransform(Infinity, 0, Infinity, 0, Infinity, 0); 1.19112 +ctx.setTransform(Infinity, 0, Infinity, 0, Infinity, Infinity); 1.19113 +ctx.setTransform(Infinity, 0, Infinity, 0, 0, Infinity); 1.19114 +ctx.setTransform(Infinity, 0, 0, Infinity, 0, 0); 1.19115 +ctx.setTransform(Infinity, 0, 0, Infinity, Infinity, 0); 1.19116 +ctx.setTransform(Infinity, 0, 0, Infinity, Infinity, Infinity); 1.19117 +ctx.setTransform(Infinity, 0, 0, Infinity, 0, Infinity); 1.19118 +ctx.setTransform(Infinity, 0, 0, 0, Infinity, 0); 1.19119 +ctx.setTransform(Infinity, 0, 0, 0, Infinity, Infinity); 1.19120 +ctx.setTransform(Infinity, 0, 0, 0, 0, Infinity); 1.19121 +ctx.setTransform(0, Infinity, Infinity, 0, 0, 0); 1.19122 +ctx.setTransform(0, Infinity, Infinity, Infinity, 0, 0); 1.19123 +ctx.setTransform(0, Infinity, Infinity, Infinity, Infinity, 0); 1.19124 +ctx.setTransform(0, Infinity, Infinity, Infinity, Infinity, Infinity); 1.19125 +ctx.setTransform(0, Infinity, Infinity, Infinity, 0, Infinity); 1.19126 +ctx.setTransform(0, Infinity, Infinity, 0, Infinity, 0); 1.19127 +ctx.setTransform(0, Infinity, Infinity, 0, Infinity, Infinity); 1.19128 +ctx.setTransform(0, Infinity, Infinity, 0, 0, Infinity); 1.19129 +ctx.setTransform(0, Infinity, 0, Infinity, 0, 0); 1.19130 +ctx.setTransform(0, Infinity, 0, Infinity, Infinity, 0); 1.19131 +ctx.setTransform(0, Infinity, 0, Infinity, Infinity, Infinity); 1.19132 +ctx.setTransform(0, Infinity, 0, Infinity, 0, Infinity); 1.19133 +ctx.setTransform(0, Infinity, 0, 0, Infinity, 0); 1.19134 +ctx.setTransform(0, Infinity, 0, 0, Infinity, Infinity); 1.19135 +ctx.setTransform(0, Infinity, 0, 0, 0, Infinity); 1.19136 +ctx.setTransform(0, 0, Infinity, Infinity, 0, 0); 1.19137 +ctx.setTransform(0, 0, Infinity, Infinity, Infinity, 0); 1.19138 +ctx.setTransform(0, 0, Infinity, Infinity, Infinity, Infinity); 1.19139 +ctx.setTransform(0, 0, Infinity, Infinity, 0, Infinity); 1.19140 +ctx.setTransform(0, 0, Infinity, 0, Infinity, 0); 1.19141 +ctx.setTransform(0, 0, Infinity, 0, Infinity, Infinity); 1.19142 +ctx.setTransform(0, 0, Infinity, 0, 0, Infinity); 1.19143 +ctx.setTransform(0, 0, 0, Infinity, Infinity, 0); 1.19144 +ctx.setTransform(0, 0, 0, Infinity, Infinity, Infinity); 1.19145 +ctx.setTransform(0, 0, 0, Infinity, 0, Infinity); 1.19146 +ctx.setTransform(0, 0, 0, 0, Infinity, Infinity); 1.19147 + 1.19148 +ctx.fillStyle = '#0f0'; 1.19149 +ctx.fillRect(-100, -10, 100, 50); 1.19150 + 1.19151 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.19152 + 1.19153 +} catch (e) { 1.19154 + _thrown_outer = true; 1.19155 +} 1.19156 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.19157 + 1.19158 + 1.19159 +} 1.19160 +</script> 1.19161 + 1.19162 +<!-- [[[ test_2d.transformation.setTransform.skewed.html ]]] --> 1.19163 + 1.19164 +<p>Canvas test: 2d.transformation.setTransform.skewed</p> 1.19165 +<canvas id="c601" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19166 +<script> 1.19167 + 1.19168 + 1.19169 +function test_2d_transformation_setTransform_skewed() { 1.19170 + 1.19171 +var canvas = document.getElementById('c601'); 1.19172 +var ctx = canvas.getContext('2d'); 1.19173 + 1.19174 +// Create green with a red square ring inside it 1.19175 +ctx.fillStyle = '#0f0'; 1.19176 +ctx.fillRect(0, 0, 100, 50); 1.19177 +ctx.fillStyle = '#f00'; 1.19178 +ctx.fillRect(20, 10, 60, 30); 1.19179 +ctx.fillStyle = '#0f0'; 1.19180 +ctx.fillRect(40, 20, 20, 10); 1.19181 + 1.19182 +// Draw a skewed shape to fill that gap, to make sure it is aligned correctly 1.19183 +ctx.setTransform(1,4, 2,3, 5,6); 1.19184 +// Post-transform coordinates: 1.19185 +// [[20,10],[80,10],[80,40],[20,40],[20,10],[40,20],[40,30],[60,30],[60,20],[40,20],[20,10]]; 1.19186 +// Hence pre-transform coordinates: 1.19187 +var pts=[[-7.4,11.2],[-43.4,59.2],[-31.4,53.2],[4.6,5.2],[-7.4,11.2], 1.19188 + [-15.4,25.2],[-11.4,23.2],[-23.4,39.2],[-27.4,41.2],[-15.4,25.2], 1.19189 + [-7.4,11.2]]; 1.19190 +ctx.beginPath(); 1.19191 +ctx.moveTo(pts[0][0], pts[0][1]); 1.19192 +for (var i = 0; i < pts.length; ++i) 1.19193 + ctx.lineTo(pts[i][0], pts[i][1]); 1.19194 +ctx.fill(); 1.19195 +isPixel(ctx, 21,11, 0,255,0,255, 0); 1.19196 +isPixel(ctx, 79,11, 0,255,0,255, 0); 1.19197 +isPixel(ctx, 21,39, 0,255,0,255, 0); 1.19198 +isPixel(ctx, 79,39, 0,255,0,255, 0); 1.19199 +isPixel(ctx, 39,19, 0,255,0,255, IsAzureSkia() ? 1 : 0); 1.19200 +isPixel(ctx, 61,19, 0,255,0,255, 0); 1.19201 +isPixel(ctx, 39,31, 0,255,0,255, 0); 1.19202 +isPixel(ctx, 61,31, 0,255,0,255, 0); 1.19203 + 1.19204 + 1.19205 +} 1.19206 +</script> 1.19207 + 1.19208 +<!-- [[[ test_2d.transformation.transform.identity.html ]]] --> 1.19209 + 1.19210 +<p>Canvas test: 2d.transformation.transform.identity</p> 1.19211 +<!-- Testing: transform() with the identity matrix does nothing --> 1.19212 +<canvas id="c602" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19213 +<script> 1.19214 + 1.19215 + 1.19216 +function test_2d_transformation_transform_identity() { 1.19217 + 1.19218 +var canvas = document.getElementById('c602'); 1.19219 +var ctx = canvas.getContext('2d'); 1.19220 + 1.19221 +ctx.fillStyle = '#f00'; 1.19222 +ctx.fillRect(0, 0, 100, 50); 1.19223 + 1.19224 +ctx.transform(1,0, 0,1, 0,0); 1.19225 +ctx.fillStyle = '#0f0'; 1.19226 +ctx.fillRect(0, 0, 100, 50); 1.19227 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.19228 + 1.19229 + 1.19230 +} 1.19231 +</script> 1.19232 + 1.19233 +<!-- [[[ test_2d.transformation.transform.multiply.html ]]] --> 1.19234 + 1.19235 +<p>Canvas test: 2d.transformation.transform.multiply</p> 1.19236 +<!-- Testing: transform() multiplies the CTM --> 1.19237 +<canvas id="c603" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19238 +<script> 1.19239 + 1.19240 + 1.19241 +function test_2d_transformation_transform_multiply() { 1.19242 + 1.19243 +var canvas = document.getElementById('c603'); 1.19244 +var ctx = canvas.getContext('2d'); 1.19245 + 1.19246 +ctx.fillStyle = '#f00'; 1.19247 +ctx.fillRect(0, 0, 100, 50); 1.19248 + 1.19249 +ctx.transform(1,2, 3,4, 5,6); 1.19250 +ctx.transform(-2,1, 3/2,-1/2, 1,-2); 1.19251 +ctx.fillStyle = '#0f0'; 1.19252 +ctx.fillRect(0, 0, 100, 50); 1.19253 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.19254 + 1.19255 + 1.19256 +} 1.19257 +</script> 1.19258 + 1.19259 +<!-- [[[ test_2d.transformation.transform.nonfinite.html ]]] --> 1.19260 + 1.19261 +<p>Canvas test: 2d.transformation.transform.nonfinite</p> 1.19262 +<!-- Testing: transform() with Infinity/NaN is ignored --> 1.19263 +<canvas id="c604" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19264 +<script> 1.19265 + 1.19266 + 1.19267 +function test_2d_transformation_transform_nonfinite() { 1.19268 + 1.19269 +var canvas = document.getElementById('c604'); 1.19270 +var ctx = canvas.getContext('2d'); 1.19271 + 1.19272 +var _thrown_outer = false; 1.19273 +try { 1.19274 + 1.19275 +ctx.fillStyle = '#f00'; 1.19276 +ctx.fillRect(0, 0, 100, 50); 1.19277 + 1.19278 +ctx.translate(100, 10); 1.19279 +ctx.transform(Infinity, 0, 0, 0, 0, 0); 1.19280 +ctx.transform(-Infinity, 0, 0, 0, 0, 0); 1.19281 +ctx.transform(NaN, 0, 0, 0, 0, 0); 1.19282 +ctx.transform(0, Infinity, 0, 0, 0, 0); 1.19283 +ctx.transform(0, -Infinity, 0, 0, 0, 0); 1.19284 +ctx.transform(0, NaN, 0, 0, 0, 0); 1.19285 +ctx.transform(0, 0, Infinity, 0, 0, 0); 1.19286 +ctx.transform(0, 0, -Infinity, 0, 0, 0); 1.19287 +ctx.transform(0, 0, NaN, 0, 0, 0); 1.19288 +ctx.transform(0, 0, 0, Infinity, 0, 0); 1.19289 +ctx.transform(0, 0, 0, -Infinity, 0, 0); 1.19290 +ctx.transform(0, 0, 0, NaN, 0, 0); 1.19291 +ctx.transform(0, 0, 0, 0, Infinity, 0); 1.19292 +ctx.transform(0, 0, 0, 0, -Infinity, 0); 1.19293 +ctx.transform(0, 0, 0, 0, NaN, 0); 1.19294 +ctx.transform(0, 0, 0, 0, 0, Infinity); 1.19295 +ctx.transform(0, 0, 0, 0, 0, -Infinity); 1.19296 +ctx.transform(0, 0, 0, 0, 0, NaN); 1.19297 +ctx.transform(Infinity, Infinity, 0, 0, 0, 0); 1.19298 +ctx.transform(Infinity, Infinity, Infinity, 0, 0, 0); 1.19299 +ctx.transform(Infinity, Infinity, Infinity, Infinity, 0, 0); 1.19300 +ctx.transform(Infinity, Infinity, Infinity, Infinity, Infinity, 0); 1.19301 +ctx.transform(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); 1.19302 +ctx.transform(Infinity, Infinity, Infinity, Infinity, 0, Infinity); 1.19303 +ctx.transform(Infinity, Infinity, Infinity, 0, Infinity, 0); 1.19304 +ctx.transform(Infinity, Infinity, Infinity, 0, Infinity, Infinity); 1.19305 +ctx.transform(Infinity, Infinity, Infinity, 0, 0, Infinity); 1.19306 +ctx.transform(Infinity, Infinity, 0, Infinity, 0, 0); 1.19307 +ctx.transform(Infinity, Infinity, 0, Infinity, Infinity, 0); 1.19308 +ctx.transform(Infinity, Infinity, 0, Infinity, Infinity, Infinity); 1.19309 +ctx.transform(Infinity, Infinity, 0, Infinity, 0, Infinity); 1.19310 +ctx.transform(Infinity, Infinity, 0, 0, Infinity, 0); 1.19311 +ctx.transform(Infinity, Infinity, 0, 0, Infinity, Infinity); 1.19312 +ctx.transform(Infinity, Infinity, 0, 0, 0, Infinity); 1.19313 +ctx.transform(Infinity, 0, Infinity, 0, 0, 0); 1.19314 +ctx.transform(Infinity, 0, Infinity, Infinity, 0, 0); 1.19315 +ctx.transform(Infinity, 0, Infinity, Infinity, Infinity, 0); 1.19316 +ctx.transform(Infinity, 0, Infinity, Infinity, Infinity, Infinity); 1.19317 +ctx.transform(Infinity, 0, Infinity, Infinity, 0, Infinity); 1.19318 +ctx.transform(Infinity, 0, Infinity, 0, Infinity, 0); 1.19319 +ctx.transform(Infinity, 0, Infinity, 0, Infinity, Infinity); 1.19320 +ctx.transform(Infinity, 0, Infinity, 0, 0, Infinity); 1.19321 +ctx.transform(Infinity, 0, 0, Infinity, 0, 0); 1.19322 +ctx.transform(Infinity, 0, 0, Infinity, Infinity, 0); 1.19323 +ctx.transform(Infinity, 0, 0, Infinity, Infinity, Infinity); 1.19324 +ctx.transform(Infinity, 0, 0, Infinity, 0, Infinity); 1.19325 +ctx.transform(Infinity, 0, 0, 0, Infinity, 0); 1.19326 +ctx.transform(Infinity, 0, 0, 0, Infinity, Infinity); 1.19327 +ctx.transform(Infinity, 0, 0, 0, 0, Infinity); 1.19328 +ctx.transform(0, Infinity, Infinity, 0, 0, 0); 1.19329 +ctx.transform(0, Infinity, Infinity, Infinity, 0, 0); 1.19330 +ctx.transform(0, Infinity, Infinity, Infinity, Infinity, 0); 1.19331 +ctx.transform(0, Infinity, Infinity, Infinity, Infinity, Infinity); 1.19332 +ctx.transform(0, Infinity, Infinity, Infinity, 0, Infinity); 1.19333 +ctx.transform(0, Infinity, Infinity, 0, Infinity, 0); 1.19334 +ctx.transform(0, Infinity, Infinity, 0, Infinity, Infinity); 1.19335 +ctx.transform(0, Infinity, Infinity, 0, 0, Infinity); 1.19336 +ctx.transform(0, Infinity, 0, Infinity, 0, 0); 1.19337 +ctx.transform(0, Infinity, 0, Infinity, Infinity, 0); 1.19338 +ctx.transform(0, Infinity, 0, Infinity, Infinity, Infinity); 1.19339 +ctx.transform(0, Infinity, 0, Infinity, 0, Infinity); 1.19340 +ctx.transform(0, Infinity, 0, 0, Infinity, 0); 1.19341 +ctx.transform(0, Infinity, 0, 0, Infinity, Infinity); 1.19342 +ctx.transform(0, Infinity, 0, 0, 0, Infinity); 1.19343 +ctx.transform(0, 0, Infinity, Infinity, 0, 0); 1.19344 +ctx.transform(0, 0, Infinity, Infinity, Infinity, 0); 1.19345 +ctx.transform(0, 0, Infinity, Infinity, Infinity, Infinity); 1.19346 +ctx.transform(0, 0, Infinity, Infinity, 0, Infinity); 1.19347 +ctx.transform(0, 0, Infinity, 0, Infinity, 0); 1.19348 +ctx.transform(0, 0, Infinity, 0, Infinity, Infinity); 1.19349 +ctx.transform(0, 0, Infinity, 0, 0, Infinity); 1.19350 +ctx.transform(0, 0, 0, Infinity, Infinity, 0); 1.19351 +ctx.transform(0, 0, 0, Infinity, Infinity, Infinity); 1.19352 +ctx.transform(0, 0, 0, Infinity, 0, Infinity); 1.19353 +ctx.transform(0, 0, 0, 0, Infinity, Infinity); 1.19354 + 1.19355 +ctx.fillStyle = '#0f0'; 1.19356 +ctx.fillRect(-100, -10, 100, 50); 1.19357 + 1.19358 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.19359 + 1.19360 +} catch (e) { 1.19361 + _thrown_outer = true; 1.19362 +} 1.19363 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.19364 + 1.19365 + 1.19366 +} 1.19367 +</script> 1.19368 + 1.19369 +<!-- [[[ test_2d.transformation.transform.skewed.html ]]] --> 1.19370 + 1.19371 +<p>Canvas test: 2d.transformation.transform.skewed</p> 1.19372 +<!-- Testing: transform() with skewy matrix transforms correctly --> 1.19373 +<canvas id="c605" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19374 +<script> 1.19375 + 1.19376 + 1.19377 +function test_2d_transformation_transform_skewed() { 1.19378 + 1.19379 +var canvas = document.getElementById('c605'); 1.19380 +var ctx = canvas.getContext('2d'); 1.19381 + 1.19382 +// Create green with a red square ring inside it 1.19383 +ctx.fillStyle = '#0f0'; 1.19384 +ctx.fillRect(0, 0, 100, 50); 1.19385 +ctx.fillStyle = '#f00'; 1.19386 +ctx.fillRect(20, 10, 60, 30); 1.19387 +ctx.fillStyle = '#0f0'; 1.19388 +ctx.fillRect(40, 20, 20, 10); 1.19389 + 1.19390 +// Draw a skewed shape to fill that gap, to make sure it is aligned correctly 1.19391 +ctx.transform(1,4, 2,3, 5,6); 1.19392 +// Post-transform coordinates: 1.19393 +// [[20,10],[80,10],[80,40],[20,40],[20,10],[40,20],[40,30],[60,30],[60,20],[40,20],[20,10]]; 1.19394 +// Hence pre-transform coordinates: 1.19395 +var pts=[[-7.4,11.2],[-43.4,59.2],[-31.4,53.2],[4.6,5.2],[-7.4,11.2], 1.19396 + [-15.4,25.2],[-11.4,23.2],[-23.4,39.2],[-27.4,41.2],[-15.4,25.2], 1.19397 + [-7.4,11.2]]; 1.19398 +ctx.beginPath(); 1.19399 +ctx.moveTo(pts[0][0], pts[0][1]); 1.19400 +for (var i = 0; i < pts.length; ++i) 1.19401 + ctx.lineTo(pts[i][0], pts[i][1]); 1.19402 +ctx.fill(); 1.19403 +isPixel(ctx, 21,11, 0,255,0,255, 0); 1.19404 +isPixel(ctx, 79,11, 0,255,0,255, 0); 1.19405 +isPixel(ctx, 21,39, 0,255,0,255, 0); 1.19406 +isPixel(ctx, 79,39, 0,255,0,255, 0); 1.19407 +isPixel(ctx, 39,19, 0,255,0,255, IsAzureSkia() ? 1 : 0); 1.19408 +isPixel(ctx, 61,19, 0,255,0,255, 0); 1.19409 +isPixel(ctx, 39,31, 0,255,0,255, 0); 1.19410 +isPixel(ctx, 61,31, 0,255,0,255, 0); 1.19411 + 1.19412 + 1.19413 +} 1.19414 +</script> 1.19415 + 1.19416 +<!-- [[[ test_2d.transformation.translate.basic.html ]]] --> 1.19417 + 1.19418 +<p>Canvas test: 2d.transformation.translate.basic</p> 1.19419 +<!-- Testing: translate() works --> 1.19420 +<canvas id="c606" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19421 +<script> 1.19422 + 1.19423 + 1.19424 +function test_2d_transformation_translate_basic() { 1.19425 + 1.19426 +var canvas = document.getElementById('c606'); 1.19427 +var ctx = canvas.getContext('2d'); 1.19428 + 1.19429 +ctx.fillStyle = '#f00'; 1.19430 +ctx.fillRect(0, 0, 100, 50); 1.19431 + 1.19432 +ctx.translate(100, 50); 1.19433 +ctx.fillStyle = '#0f0'; 1.19434 +ctx.fillRect(-100, -50, 100, 50); 1.19435 +isPixel(ctx, 90,40, 0,255,0,255, 0); 1.19436 + 1.19437 + 1.19438 +} 1.19439 +</script> 1.19440 + 1.19441 +<!-- [[[ test_2d.transformation.translate.nonfinite.html ]]] --> 1.19442 + 1.19443 +<p>Canvas test: 2d.transformation.translate.nonfinite</p> 1.19444 +<!-- Testing: translate() with Infinity/NaN is ignored --> 1.19445 +<canvas id="c607" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19446 +<script> 1.19447 + 1.19448 + 1.19449 +function test_2d_transformation_translate_nonfinite() { 1.19450 + 1.19451 +var canvas = document.getElementById('c607'); 1.19452 +var ctx = canvas.getContext('2d'); 1.19453 + 1.19454 +var _thrown_outer = false; 1.19455 +try { 1.19456 + 1.19457 +ctx.fillStyle = '#f00'; 1.19458 +ctx.fillRect(0, 0, 100, 50); 1.19459 + 1.19460 +ctx.translate(100, 10); 1.19461 +ctx.translate(Infinity, 0.1); 1.19462 +ctx.translate(-Infinity, 0.1); 1.19463 +ctx.translate(NaN, 0.1); 1.19464 +ctx.translate(0.1, Infinity); 1.19465 +ctx.translate(0.1, -Infinity); 1.19466 +ctx.translate(0.1, NaN); 1.19467 +ctx.translate(Infinity, Infinity); 1.19468 + 1.19469 +ctx.fillStyle = '#0f0'; 1.19470 +ctx.fillRect(-100, -10, 100, 50); 1.19471 + 1.19472 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.19473 + 1.19474 +} catch (e) { 1.19475 + _thrown_outer = true; 1.19476 +} 1.19477 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.19478 + 1.19479 + 1.19480 +} 1.19481 +</script> 1.19482 + 1.19483 +<!-- [[[ test_2d.type.exists.html ]]] --> 1.19484 + 1.19485 +<p>Canvas test: 2d.type.exists</p> 1.19486 +<!-- Testing: The 2D context interface is a property of 'window' --> 1.19487 +<canvas id="c609" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19488 +<script> 1.19489 + 1.19490 +function test_2d_type_exists() { 1.19491 + 1.19492 +var canvas = document.getElementById('c609'); 1.19493 +var ctx = canvas.getContext('2d'); 1.19494 + 1.19495 +ok(window.CanvasRenderingContext2D, "window.CanvasRenderingContext2D"); 1.19496 + 1.19497 + 1.19498 +} 1.19499 +</script> 1.19500 + 1.19501 +<!-- [[[ test_2d.type.extend.html ]]] --> 1.19502 + 1.19503 +<p>Canvas test: 2d.type.extend</p> 1.19504 +<!-- Testing: Interface methods can be added --> 1.19505 +<canvas id="c610" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19506 +<script> 1.19507 + 1.19508 + 1.19509 +function test_2d_type_extend() { 1.19510 + 1.19511 +var canvas = document.getElementById('c610'); 1.19512 +var ctx = canvas.getContext('2d'); 1.19513 + 1.19514 +window.CanvasRenderingContext2D.prototype.fillRectGreen = function (x, y, w, h) 1.19515 +{ 1.19516 + this.fillStyle = '#0f0'; 1.19517 + this.fillRect(x, y, w, h); 1.19518 +}; 1.19519 +ctx.fillStyle = '#f00'; 1.19520 +ctx.fillRectGreen(0, 0, 100, 50); 1.19521 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.19522 + 1.19523 + 1.19524 +} 1.19525 +</script> 1.19526 + 1.19527 +<!-- [[[ test_2d.type.prototype.html ]]] --> 1.19528 + 1.19529 +<p>Canvas test: 2d.type.prototype</p> 1.19530 +<!-- Testing: window.CanvasRenderingContext2D.prototype is { DontDelete, ReadOnly }, and its methods are not --> 1.19531 +<canvas id="c611" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19532 +<script> 1.19533 + 1.19534 +function test_2d_type_prototype() { 1.19535 + 1.19536 +var canvas = document.getElementById('c611'); 1.19537 +var ctx = canvas.getContext('2d'); 1.19538 + 1.19539 +var fill = window.CanvasRenderingContext2D.prototype.fill; 1.19540 +ok(window.CanvasRenderingContext2D.prototype, "window.CanvasRenderingContext2D.prototype"); 1.19541 +ok(window.CanvasRenderingContext2D.prototype.fill, "window.CanvasRenderingContext2D.prototype.fill"); 1.19542 +window.CanvasRenderingContext2D.prototype = null; 1.19543 +ok(window.CanvasRenderingContext2D.prototype, "window.CanvasRenderingContext2D.prototype"); 1.19544 +delete window.CanvasRenderingContext2D.prototype; 1.19545 +ok(window.CanvasRenderingContext2D.prototype, "window.CanvasRenderingContext2D.prototype"); 1.19546 +window.CanvasRenderingContext2D.prototype.fill = 1; 1.19547 +ok(window.CanvasRenderingContext2D.prototype.fill === 1, "window.CanvasRenderingContext2D.prototype.fill === 1"); 1.19548 +delete window.CanvasRenderingContext2D.prototype.fill; 1.19549 +ok(window.CanvasRenderingContext2D.prototype.fill === undefined, "window.CanvasRenderingContext2D.prototype.fill === undefined"); 1.19550 + 1.19551 +//restore the original method to ensure that other tests can run successfully 1.19552 +window.CanvasRenderingContext2D.prototype.fill = fill; 1.19553 +} 1.19554 +</script> 1.19555 + 1.19556 +<!-- [[[ test_2d.type.replace.html ]]] --> 1.19557 + 1.19558 +<p>Canvas test: 2d.type.replace</p> 1.19559 +<!-- Testing: Interface methods can be overridden --> 1.19560 +<canvas id="c612" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19561 +<script> 1.19562 + 1.19563 + 1.19564 +function test_2d_type_replace() { 1.19565 + 1.19566 +var canvas = document.getElementById('c612'); 1.19567 +var ctx = canvas.getContext('2d'); 1.19568 + 1.19569 +var fillRect = window.CanvasRenderingContext2D.prototype.fillRect; 1.19570 +window.CanvasRenderingContext2D.prototype.fillRect = function (x, y, w, h) 1.19571 +{ 1.19572 + this.fillStyle = '#0f0'; 1.19573 + fillRect.call(this, x, y, w, h); 1.19574 +}; 1.19575 +ctx.fillStyle = '#f00'; 1.19576 +ctx.fillRect(0, 0, 100, 50); 1.19577 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.19578 + 1.19579 +//restore the original method to ensure that other tests can run successfully 1.19580 +window.CanvasRenderingContext2D.prototype.fillRect = fillRect; 1.19581 +} 1.19582 +</script> 1.19583 + 1.19584 +<!-- [[[ test_2d.voidreturn.html ]]] --> 1.19585 + 1.19586 +<p>Canvas test: 2d.voidreturn</p> 1.19587 +<!-- Testing: void methods return undefined --> 1.19588 +<canvas id="c613" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19589 +<script> 1.19590 + 1.19591 +function test_2d_voidreturn() { 1.19592 + 1.19593 +var canvas = document.getElementById('c613'); 1.19594 +var ctx = canvas.getContext('2d'); 1.19595 + 1.19596 +ok(ctx.save() === undefined, "ctx.save() === undefined"); 1.19597 +ok(ctx.restore() === undefined, "ctx.restore() === undefined"); 1.19598 +ok(ctx.scale(1, 1) === undefined, "ctx.scale(1, 1) === undefined"); 1.19599 +ok(ctx.rotate(0) === undefined, "ctx.rotate(0) === undefined"); 1.19600 +ok(ctx.translate(0, 0) === undefined, "ctx.translate(0, 0) === undefined"); 1.19601 +if (ctx.transform) { // (avoid spurious failures, since the aim here is not to test that all features are supported) 1.19602 + ok(ctx.transform(1, 0, 0, 1, 0, 0) === undefined, "ctx.transform(1, 0, 0, 1, 0, 0) === undefined"); 1.19603 +} 1.19604 +if (ctx.setTransform) { 1.19605 + ok(ctx.setTransform(1, 0, 0, 1, 0, 0) === undefined, "ctx.setTransform(1, 0, 0, 1, 0, 0) === undefined"); 1.19606 +} 1.19607 +ok(ctx.clearRect(0, 0, 0, 0) === undefined, "ctx.clearRect(0, 0, 0, 0) === undefined"); 1.19608 +ok(ctx.fillRect(0, 0, 0, 0) === undefined, "ctx.fillRect(0, 0, 0, 0) === undefined"); 1.19609 +ok(ctx.strokeRect(0, 0, 0, 0) === undefined, "ctx.strokeRect(0, 0, 0, 0) === undefined"); 1.19610 +ok(ctx.beginPath() === undefined, "ctx.beginPath() === undefined"); 1.19611 +ok(ctx.closePath() === undefined, "ctx.closePath() === undefined"); 1.19612 +ok(ctx.moveTo(0, 0) === undefined, "ctx.moveTo(0, 0) === undefined"); 1.19613 +ok(ctx.lineTo(0, 0) === undefined, "ctx.lineTo(0, 0) === undefined"); 1.19614 +ok(ctx.quadraticCurveTo(0, 0, 0, 0) === undefined, "ctx.quadraticCurveTo(0, 0, 0, 0) === undefined"); 1.19615 +ok(ctx.bezierCurveTo(0, 0, 0, 0, 0, 0) === undefined, "ctx.bezierCurveTo(0, 0, 0, 0, 0, 0) === undefined"); 1.19616 +ok(ctx.arcTo(0, 0, 0, 0, 1) === undefined, "ctx.arcTo(0, 0, 0, 0, 1) === undefined"); 1.19617 +ok(ctx.rect(0, 0, 0, 0) === undefined, "ctx.rect(0, 0, 0, 0) === undefined"); 1.19618 +ok(ctx.arc(0, 0, 1, 0, 0, true) === undefined, "ctx.arc(0, 0, 1, 0, 0, true) === undefined"); 1.19619 +ok(ctx.fill() === undefined, "ctx.fill() === undefined"); 1.19620 +ok(ctx.stroke() === undefined, "ctx.stroke() === undefined"); 1.19621 +ok(ctx.clip() === undefined, "ctx.clip() === undefined"); 1.19622 +if (ctx.putImageData) { 1.19623 + ok(ctx.putImageData(ctx.getImageData(0, 0, 1, 1), 0, 0) === undefined, "ctx.putImageData(ctx.getImageData(0, 0, 1, 1), 0, 0) === undefined"); 1.19624 +} 1.19625 +ok(ctx.drawImage(document.getElementById('yellow_11.png'), 0, 0, 1, 1, 0, 0, 0, 0) === undefined, "ctx.drawImage(document.getElementById('yellow_11.png'), 0, 0, 1, 1, 0, 0, 0, 0) === undefined"); 1.19626 +ok(ctx.drawImage(canvas, 0, 0, 1, 1, 0, 0, 0, 0) === undefined, "ctx.drawImage(canvas, 0, 0, 1, 1, 0, 0, 0, 0) === undefined"); 1.19627 +ok(ctx.createLinearGradient(0, 0, 0, 0).addColorStop(0, 'white') === undefined, "ctx.createLinearGradient(0, 0, 0, 0).addColorStop(0, 'white') === undefined"); 1.19628 + 1.19629 + 1.19630 +} 1.19631 +</script> 1.19632 +<img src="image_yellow.png" id="yellow_11.png" class="resource"> 1.19633 + 1.19634 +<!-- [[[ test_bug397524.html ]]] --> 1.19635 + 1.19636 +<p>Test for Bug 397524</p> 1.19637 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=397524">Mozilla Bug 397524</a> 1.19638 +<p id="display"> 1.19639 + <canvas id="canvas1" width="1" height="1"></canvas> 1.19640 + <canvas id="canvas2" width="1" height="1"></canvas> 1.19641 + <canvas id="canvas3" width="1" height="1"></canvas> 1.19642 + <img id="i1", src="image_green-1x1.png"> 1.19643 + <img id="i2" src="http://example.com/tests/content/canvas/test/image_green-1x1.png"> 1.19644 + <img id="i3" src="image_green-redirect"> 1.19645 +</p> 1.19646 +<div id="content" style="display: none"> 1.19647 + 1.19648 +</div> 1.19649 +<pre id="test"> 1.19650 +<script class="testbody" type="text/javascript"> 1.19651 + 1.19652 +/** Test for Bug 397524 **/ 1.19653 + 1.19654 +function draw(n) { 1.19655 + $("canvas" + n).getContext('2d').drawImage($("i" + n), 0, 0); 1.19656 +} 1.19657 + 1.19658 +function test_bug397524() { 1.19659 + draw(1); 1.19660 + draw(2); 1.19661 + draw(3); 1.19662 + 1.19663 + // Should be able to get the data out of the first canvas 1.19664 + $("canvas1").toDataURL("image/png"); 1.19665 + 1.19666 + // Should not be able to get the data out of a cross-site load 1.19667 + var gotData = false; 1.19668 + try { 1.19669 + $("canvas2").toDataURL("image/png"); 1.19670 + gotData = true; 1.19671 + } catch (ex if (ex.code == 18 && ex.name == "SecurityError")) { 1.19672 + } 1.19673 + is(gotData, false, "Shouldn't be able to read images cross-site!"); 1.19674 + 1.19675 + // Should not be able to get the data out of a redirected cross-site load 1.19676 + var gotData = false; 1.19677 + try { 1.19678 + $("canvas3").toDataURL("image/png"); 1.19679 + gotData = true; 1.19680 + } catch (ex if (ex.code == 18 && ex.name == "SecurityError")) { 1.19681 + } 1.19682 + is(gotData, false, "Shouldn't be able to read images redirected cross-site!"); 1.19683 + 1.19684 +} 1.19685 + 1.19686 +</script> 1.19687 +</pre> 1.19688 + 1.19689 +<!-- [[[ test_bug405982.html ]]] --> 1.19690 + 1.19691 +<p>Canvas test: toDataURL.png</p> 1.19692 +<canvas id="c614" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19693 +<script> 1.19694 +function test_bug405982() { 1.19695 + 1.19696 +var canvas = SpecialPowers.wrap(document.getElementById('c614')); 1.19697 +var ctx = canvas.getContext('2d'); 1.19698 + 1.19699 +var _threw = false; 1.19700 +try { 1.19701 + var data = canvas.toDataURL('image/png', 'quality=100'); 1.19702 +} 1.19703 +catch (e) { 1.19704 + _threw = true; 1.19705 +} 1.19706 +ok(!_threw, "Should not throw an exception for invalid args to png encoder"); 1.19707 + 1.19708 +_threw = false; 1.19709 +try { 1.19710 + var data = canvas.toDataURL('image/jpeg', 'foobar=true'); 1.19711 +} 1.19712 +catch (e) { 1.19713 + _threw = true; 1.19714 +} 1.19715 +ok(!_threw, "Should not throw an exception for invalid args to jpeg encoder"); 1.19716 + 1.19717 +} 1.19718 +</script> 1.19719 +<!-- [[[ test_context.arguments.extra.html ]]] --> 1.19720 + 1.19721 +<p>Canvas test: context.arguments.extra</p> 1.19722 +<canvas id="c615" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19723 +<script> 1.19724 + 1.19725 +function test_context_arguments_extra() { 1.19726 + 1.19727 +var canvas = document.getElementById('c615'); 1.19728 +var ctx = canvas.getContext('2d'); 1.19729 + 1.19730 +ok(canvas.getContext('2d', 'foo') !== null, "canvas.getContext('2d', 'foo') !== null"); 1.19731 + 1.19732 + 1.19733 +} 1.19734 +</script> 1.19735 + 1.19736 +<!-- [[[ test_context.arguments.missing.html ]]] --> 1.19737 + 1.19738 +<p>Canvas test: context.arguments.missing</p> 1.19739 +<canvas id="c616" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19740 +<script> 1.19741 + 1.19742 +function test_context_arguments_missing() { 1.19743 + 1.19744 +var canvas = document.getElementById('c616'); 1.19745 +var ctx = canvas.getContext('2d'); 1.19746 + 1.19747 +var _thrown = undefined; try { 1.19748 + canvas.getContext(); 1.19749 +} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError"); 1.19750 + 1.19751 + 1.19752 +} 1.19753 +</script> 1.19754 + 1.19755 +<!-- [[[ test_context.casesensitive.html ]]] --> 1.19756 + 1.19757 +<p>Canvas test: context.casesensitive - bug 401788</p> 1.19758 +<!-- Testing: Context name "2D" is unrecognised; matching is case sensitive --> 1.19759 +<canvas id="c617" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19760 +<script> 1.19761 + 1.19762 +function test_context_casesensitive() { 1.19763 + 1.19764 +var canvas = document.getElementById('c617'); 1.19765 +var ctx = canvas.getContext('2d'); 1.19766 + 1.19767 +var _thrown_outer = false; 1.19768 +try { 1.19769 + 1.19770 +ok(canvas.getContext('2D') === null, "canvas.getContext('2D') === null"); 1.19771 + 1.19772 +} catch (e) { 1.19773 + _thrown_outer = true; 1.19774 +} 1.19775 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.19776 + 1.19777 + 1.19778 +} 1.19779 +</script> 1.19780 + 1.19781 +<!-- [[[ test_context.emptystring.html ]]] --> 1.19782 + 1.19783 +<p>Canvas test: context.emptystring - bug 401788</p> 1.19784 +<!-- Testing: getContext with empty string returns null --> 1.19785 +<canvas id="c618" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19786 +<script> 1.19787 + 1.19788 +function test_context_emptystring() { 1.19789 + 1.19790 +var canvas = document.getElementById('c618'); 1.19791 +var ctx = canvas.getContext('2d'); 1.19792 + 1.19793 +var _thrown_outer = false; 1.19794 +try { 1.19795 + 1.19796 +ok(canvas.getContext("") === null, "canvas.getContext(\"\") === null"); 1.19797 + 1.19798 +} catch (e) { 1.19799 + _thrown_outer = true; 1.19800 +} 1.19801 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.19802 + 1.19803 + 1.19804 +} 1.19805 +</script> 1.19806 + 1.19807 +<!-- [[[ test_context.unrecognised.badname.html ]]] --> 1.19808 + 1.19809 +<p>Canvas test: context.unrecognised.badname - bug 401788</p> 1.19810 +<!-- Testing: getContext with unrecognised context name returns null --> 1.19811 +<canvas id="c619" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19812 +<script> 1.19813 + 1.19814 +function test_context_unrecognised_badname() { 1.19815 + 1.19816 +var canvas = document.getElementById('c619'); 1.19817 +var ctx = canvas.getContext('2d'); 1.19818 + 1.19819 +var _thrown_outer = false; 1.19820 +try { 1.19821 + 1.19822 +ok(canvas.getContext('This is not an implemented context in any real browser') === null, "canvas.getContext('This is not an implemented context in any real browser') === null"); 1.19823 + 1.19824 +} catch (e) { 1.19825 + _thrown_outer = true; 1.19826 +} 1.19827 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.19828 + 1.19829 + 1.19830 +} 1.19831 +</script> 1.19832 + 1.19833 +<!-- [[[ test_context.unrecognised.badsuffix.html ]]] --> 1.19834 + 1.19835 +<p>Canvas test: context.unrecognised.badsuffix - bug 401788</p> 1.19836 +<!-- Testing: Context name "2d" plus a suffix is unrecognised --> 1.19837 +<canvas id="c620" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19838 +<script> 1.19839 + 1.19840 +function test_context_unrecognised_badsuffix() { 1.19841 + 1.19842 +var canvas = document.getElementById('c620'); 1.19843 +var ctx = canvas.getContext('2d'); 1.19844 + 1.19845 +var _thrown_outer = false; 1.19846 +try { 1.19847 + 1.19848 +ok(canvas.getContext("2d#") === null, "canvas.getContext(\"2d#\") === null"); 1.19849 + 1.19850 +} catch (e) { 1.19851 + _thrown_outer = true; 1.19852 +} 1.19853 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.19854 + 1.19855 + 1.19856 +} 1.19857 +</script> 1.19858 + 1.19859 +<!-- [[[ test_context.unrecognised.nullsuffix.html ]]] --> 1.19860 + 1.19861 +<p>Canvas test: context.unrecognised.nullsuffix - bug 401788</p> 1.19862 +<!-- Testing: Context name "2d" plus a "\0" suffix is unrecognised --> 1.19863 +<canvas id="c621" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19864 +<script> 1.19865 + 1.19866 +function test_context_unrecognised_nullsuffix() { 1.19867 + 1.19868 +var canvas = document.getElementById('c621'); 1.19869 +var ctx = canvas.getContext('2d'); 1.19870 + 1.19871 +var _thrown_outer = false; 1.19872 +try { 1.19873 + 1.19874 +ok(canvas.getContext("2d\0") === null, "canvas.getContext(\"2d\\0\") === null"); 1.19875 + 1.19876 +} catch (e) { 1.19877 + _thrown_outer = true; 1.19878 +} 1.19879 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.19880 + 1.19881 + 1.19882 +} 1.19883 +</script> 1.19884 + 1.19885 +<!-- [[[ test_context.unrecognised.unicode.html ]]] --> 1.19886 + 1.19887 +<p>Canvas test: context.unrecognised.unicode - bug 401788</p> 1.19888 +<!-- Testing: Context name which kind of looks like "2d" is unrecognised --> 1.19889 +<canvas id="c622" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19890 +<script> 1.19891 + 1.19892 +function test_context_unrecognised_unicode() { 1.19893 + 1.19894 +var canvas = document.getElementById('c622'); 1.19895 +var ctx = canvas.getContext('2d'); 1.19896 + 1.19897 +var _thrown_outer = false; 1.19898 +try { 1.19899 + 1.19900 +ok(canvas.getContext("2\uFF44") === null, "canvas.getContext(\"2\\uFF44\") === null"); // Fullwidth Latin Small Letter D 1.19901 + 1.19902 +} catch (e) { 1.19903 + _thrown_outer = true; 1.19904 +} 1.19905 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.19906 + 1.19907 + 1.19908 +} 1.19909 +</script> 1.19910 + 1.19911 +<!-- [[[ test_fallback.basic.html ]]] --> 1.19912 + 1.19913 +<p>Canvas test: fallback.basic</p> 1.19914 +<!-- Testing: Fallback content is inserted into the DOM --> 1.19915 +<canvas id="c623" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19916 +<script> 1.19917 + 1.19918 +function test_fallback_basic() { 1.19919 + 1.19920 +var canvas = document.getElementById('c623'); 1.19921 +var ctx = canvas.getContext('2d'); 1.19922 + 1.19923 +ok(canvas.childNodes.length == 1, "canvas.childNodes.length == 1"); 1.19924 + 1.19925 + 1.19926 +} 1.19927 +</script> 1.19928 + 1.19929 +<!-- [[[ test_fallback.multiple.html ]]] --> 1.19930 + 1.19931 +<p>Canvas test: fallback.multiple</p> 1.19932 +<!-- Testing: Fallback content with multiple elements --> 1.19933 +<canvas id="c624" width="100" height="50"><p class="fallback">FAIL</p><p class="fallback">FAIL</p></canvas> 1.19934 +<script> 1.19935 + 1.19936 +function test_fallback_multiple() { 1.19937 + 1.19938 +var canvas = document.getElementById('c624'); 1.19939 +var ctx = canvas.getContext('2d'); 1.19940 + 1.19941 +ok(canvas.childNodes.length == 2, "canvas.childNodes.length == 2"); 1.19942 + 1.19943 + 1.19944 +} 1.19945 +</script> 1.19946 + 1.19947 +<!-- [[[ test_fallback.nested.html ]]] --> 1.19948 + 1.19949 +<p>Canvas test: fallback.nested</p> 1.19950 +<!-- Testing: Fallback content containing another canvas (mostly testing parsers) --> 1.19951 +<canvas id="c625" width="100" height="50"><canvas><p class="fallback">FAIL (fallback content)</p></canvas><p class="fallback">FAIL (fallback content)</p></canvas> 1.19952 +<script> 1.19953 + 1.19954 +function test_fallback_nested() { 1.19955 + 1.19956 +var canvas = document.getElementById('c625'); 1.19957 +var ctx = canvas.getContext('2d'); 1.19958 + 1.19959 +ok(canvas.childNodes.length == 2, "canvas.childNodes.length == 2"); 1.19960 + 1.19961 + 1.19962 +} 1.19963 +</script> 1.19964 + 1.19965 +<!-- [[[ test_initial.colour.html ]]] --> 1.19966 + 1.19967 +<p>Canvas test: initial.colour</p> 1.19968 +<!-- Testing: Initial state is transparent black --> 1.19969 +<canvas id="c626" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19970 +<script> 1.19971 + 1.19972 + 1.19973 +function test_initial_colour() { 1.19974 + 1.19975 +var canvas = document.getElementById('c626'); 1.19976 +var ctx = canvas.getContext('2d'); 1.19977 + 1.19978 +isPixel(ctx, 20,20, 0,0,0,0, 0); 1.19979 + 1.19980 + 1.19981 +} 1.19982 +</script> 1.19983 + 1.19984 +<!-- [[[ test_initial.reset.2dstate.html ]]] --> 1.19985 + 1.19986 +<p>Canvas test: initial.reset.2dstate</p> 1.19987 +<!-- Testing: Resetting the canvas state resets 2D state variables --> 1.19988 +<canvas id="c627" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.19989 +<script> 1.19990 + 1.19991 +function test_initial_reset_2dstate() { 1.19992 + 1.19993 +var canvas = document.getElementById('c627'); 1.19994 +var ctx = canvas.getContext('2d'); 1.19995 + 1.19996 +canvas.width = 100; 1.19997 +var default_val; 1.19998 + 1.19999 +default_val = ctx.strokeStyle; 1.20000 +ctx.strokeStyle = "#ff0000"; 1.20001 +canvas.width = 100; 1.20002 +ok(ctx.strokeStyle === default_val, "ctx.strokeStyle === default_val"); 1.20003 + 1.20004 +default_val = ctx.fillStyle; 1.20005 +ctx.fillStyle = "#ff0000"; 1.20006 +canvas.width = 100; 1.20007 +ok(ctx.fillStyle === default_val, "ctx.fillStyle === default_val"); 1.20008 + 1.20009 +default_val = ctx.globalAlpha; 1.20010 +ctx.globalAlpha = 0.5; 1.20011 +canvas.width = 100; 1.20012 +ok(ctx.globalAlpha === default_val, "ctx.globalAlpha === default_val"); 1.20013 + 1.20014 +default_val = ctx.lineWidth; 1.20015 +ctx.lineWidth = 0.5; 1.20016 +canvas.width = 100; 1.20017 +ok(ctx.lineWidth === default_val, "ctx.lineWidth === default_val"); 1.20018 + 1.20019 +default_val = ctx.lineCap; 1.20020 +ctx.lineCap = "round"; 1.20021 +canvas.width = 100; 1.20022 +ok(ctx.lineCap === default_val, "ctx.lineCap === default_val"); 1.20023 + 1.20024 +default_val = ctx.lineJoin; 1.20025 +ctx.lineJoin = "round"; 1.20026 +canvas.width = 100; 1.20027 +ok(ctx.lineJoin === default_val, "ctx.lineJoin === default_val"); 1.20028 + 1.20029 +default_val = ctx.miterLimit; 1.20030 +ctx.miterLimit = 0.5; 1.20031 +canvas.width = 100; 1.20032 +ok(ctx.miterLimit === default_val, "ctx.miterLimit === default_val"); 1.20033 + 1.20034 +default_val = ctx.shadowOffsetX; 1.20035 +ctx.shadowOffsetX = 5; 1.20036 +canvas.width = 100; 1.20037 +ok(ctx.shadowOffsetX === default_val, "ctx.shadowOffsetX === default_val"); 1.20038 + 1.20039 +default_val = ctx.shadowOffsetY; 1.20040 +ctx.shadowOffsetY = 5; 1.20041 +canvas.width = 100; 1.20042 +ok(ctx.shadowOffsetY === default_val, "ctx.shadowOffsetY === default_val"); 1.20043 + 1.20044 +default_val = ctx.shadowBlur; 1.20045 +ctx.shadowBlur = 5; 1.20046 +canvas.width = 100; 1.20047 +ok(ctx.shadowBlur === default_val, "ctx.shadowBlur === default_val"); 1.20048 + 1.20049 +default_val = ctx.shadowColor; 1.20050 +ctx.shadowColor = "#ff0000"; 1.20051 +canvas.width = 100; 1.20052 +ok(ctx.shadowColor === default_val, "ctx.shadowColor === default_val"); 1.20053 + 1.20054 +default_val = ctx.globalCompositeOperation; 1.20055 +ctx.globalCompositeOperation = "copy"; 1.20056 +canvas.width = 100; 1.20057 +ok(ctx.globalCompositeOperation === default_val, "ctx.globalCompositeOperation === default_val"); 1.20058 + 1.20059 + 1.20060 +} 1.20061 +</script> 1.20062 + 1.20063 +<!-- [[[ test_initial.reset.clip.html ]]] --> 1.20064 + 1.20065 +<p>Canvas test: initial.reset.clip</p> 1.20066 +<!-- Testing: Resetting the canvas state resets the current clip region --> 1.20067 +<canvas id="c628" width="100" height="50" style="background: #f00"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20068 +<script> 1.20069 + 1.20070 + 1.20071 +function test_initial_reset_clip() { 1.20072 + 1.20073 +var canvas = document.getElementById('c628'); 1.20074 +var ctx = canvas.getContext('2d'); 1.20075 + 1.20076 +canvas.width = 100; 1.20077 +ctx.rect(0, 0, 1, 1); 1.20078 +ctx.clip(); 1.20079 +canvas.width = 100; 1.20080 +ctx.fillStyle = '#0f0'; 1.20081 +ctx.fillRect(0, 0, 100, 50); 1.20082 +isPixel(ctx, 20,20, 0,255,0,255, 0); 1.20083 + 1.20084 + 1.20085 +} 1.20086 +</script> 1.20087 + 1.20088 +<!-- [[[ test_initial.reset.different.html ]]] --> 1.20089 + 1.20090 +<p>Canvas test: initial.reset.different</p> 1.20091 +<!-- Testing: Changing size resets canvas to transparent black --> 1.20092 +<canvas id="c629" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20093 +<script> 1.20094 + 1.20095 + 1.20096 +function test_initial_reset_different() { 1.20097 + 1.20098 +var canvas = document.getElementById('c629'); 1.20099 +var ctx = canvas.getContext('2d'); 1.20100 + 1.20101 +ctx.fillStyle = '#f00'; 1.20102 +ctx.fillRect(0, 0, 50, 50); 1.20103 +isPixel(ctx, 20,20, 255,0,0,255, 0); 1.20104 +canvas.width = 50; 1.20105 +isPixel(ctx, 20,20, 0,0,0,0, 0); 1.20106 + 1.20107 + 1.20108 +} 1.20109 +</script> 1.20110 + 1.20111 +<!-- [[[ test_initial.reset.gradient.html ]]] --> 1.20112 + 1.20113 +<p>Canvas test: initial.reset.gradient</p> 1.20114 +<!-- Testing: Resetting the canvas state does not invalidate any existing gradients --> 1.20115 +<canvas id="c630" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20116 +<script> 1.20117 + 1.20118 + 1.20119 +function test_initial_reset_gradient() { 1.20120 + 1.20121 +var canvas = document.getElementById('c630'); 1.20122 +var ctx = canvas.getContext('2d'); 1.20123 + 1.20124 +canvas.width = 50; 1.20125 +var g = ctx.createLinearGradient(0, 0, 100, 0); 1.20126 +g.addColorStop(0, '#0f0'); 1.20127 +g.addColorStop(1, '#0f0'); 1.20128 +canvas.width = 100; 1.20129 +ctx.fillStyle = '#f00'; 1.20130 +ctx.fillRect(0, 0, 100, 50); 1.20131 +ctx.fillStyle = g; 1.20132 +ctx.fillRect(0, 0, 100, 50); 1.20133 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.20134 + 1.20135 + 1.20136 +} 1.20137 +</script> 1.20138 + 1.20139 +<!-- [[[ test_initial.reset.path.html ]]] --> 1.20140 + 1.20141 +<p>Canvas test: initial.reset.path</p> 1.20142 +<!-- Testing: Resetting the canvas state resets the current path --> 1.20143 +<canvas id="c631" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20144 +<script> 1.20145 + 1.20146 + 1.20147 +function test_initial_reset_path() { 1.20148 + 1.20149 +var canvas = document.getElementById('c631'); 1.20150 +var ctx = canvas.getContext('2d'); 1.20151 + 1.20152 +canvas.width = 100; 1.20153 +ctx.rect(0, 0, 100, 50); 1.20154 +canvas.width = 100; 1.20155 +ctx.fillStyle = '#f00'; 1.20156 +ctx.fill(); 1.20157 +isPixel(ctx, 20,20, 0,0,0,0, 0); 1.20158 + 1.20159 + 1.20160 +} 1.20161 +</script> 1.20162 + 1.20163 +<!-- [[[ test_initial.reset.pattern.html ]]] --> 1.20164 + 1.20165 +<p>Canvas test: initial.reset.pattern</p> 1.20166 +<!-- Testing: Resetting the canvas state does not invalidate any existing patterns --> 1.20167 +<canvas id="c632" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20168 +<script> 1.20169 + 1.20170 + 1.20171 +function test_initial_reset_pattern() { 1.20172 + 1.20173 +var canvas = document.getElementById('c632'); 1.20174 +var ctx = canvas.getContext('2d'); 1.20175 + 1.20176 +canvas.width = 50; 1.20177 +ctx.fillStyle = '#0f0'; 1.20178 +ctx.fillRect(0, 0, 50, 50); 1.20179 +var p = ctx.createPattern(canvas, 'repeat-x'); 1.20180 +canvas.width = 100; 1.20181 +ctx.fillStyle = '#f00'; 1.20182 +ctx.fillRect(0, 0, 100, 50); 1.20183 +ctx.fillStyle = p; 1.20184 +ctx.fillRect(0, 0, 100, 50); 1.20185 +isPixel(ctx, 50,25, 0,255,0,255, 0); 1.20186 + 1.20187 + 1.20188 +} 1.20189 +</script> 1.20190 + 1.20191 +<!-- [[[ test_initial.reset.same.html ]]] --> 1.20192 + 1.20193 +<p>Canvas test: initial.reset.same</p> 1.20194 +<!-- Testing: Setting size (not changing the value) resets canvas to transparent black --> 1.20195 +<canvas id="c633" width="100" height="50" style="background: #0f0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20196 +<script> 1.20197 + 1.20198 + 1.20199 +function test_initial_reset_same() { 1.20200 + 1.20201 +var canvas = document.getElementById('c633'); 1.20202 +var ctx = canvas.getContext('2d'); 1.20203 + 1.20204 +canvas.width = 100; 1.20205 +ctx.fillStyle = '#f00'; 1.20206 +ctx.fillRect(0, 0, 50, 50); 1.20207 +isPixel(ctx, 20,20, 255,0,0,255, 0); 1.20208 +canvas.width = 100; 1.20209 +isPixel(ctx, 20,20, 0,0,0,0, 0); 1.20210 + 1.20211 + 1.20212 +} 1.20213 +</script> 1.20214 + 1.20215 +<!-- [[[ test_initial.reset.transform.html ]]] --> 1.20216 + 1.20217 +<p>Canvas test: initial.reset.transform</p> 1.20218 +<!-- Testing: Resetting the canvas state resets the current transformation matrix --> 1.20219 +<canvas id="c634" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20220 +<script> 1.20221 + 1.20222 + 1.20223 +function test_initial_reset_transform() { 1.20224 + 1.20225 +var canvas = document.getElementById('c634'); 1.20226 +var ctx = canvas.getContext('2d'); 1.20227 + 1.20228 +canvas.width = 100; 1.20229 +ctx.scale(0, 0); 1.20230 +canvas.width = 100; 1.20231 +ctx.fillStyle = '#0f0'; 1.20232 +ctx.fillRect(0, 0, 100, 50); 1.20233 +isPixel(ctx, 20,20, 0,255,0,255, 0); 1.20234 + 1.20235 + 1.20236 +} 1.20237 +</script> 1.20238 + 1.20239 +<!-- [[[ test_size.attributes.default.html ]]] --> 1.20240 + 1.20241 +<p>Canvas test: size.attributes.default</p> 1.20242 +<!-- Testing: Default width/height --> 1.20243 +<canvas id="c635" ><p class="fallback">FAIL (fallback content)</p></canvas> 1.20244 +<script> 1.20245 + 1.20246 +function test_size_attributes_default() { 1.20247 + 1.20248 +var canvas = document.getElementById('c635'); 1.20249 +var ctx = canvas.getContext('2d'); 1.20250 + 1.20251 +ok(canvas.width == 300, "canvas.width == 300"); 1.20252 +ok(canvas.height == 150, "canvas.height == 150"); 1.20253 +ok(!canvas.hasAttribute('width'), "!canvas.hasAttribute('width')"); 1.20254 +ok(!canvas.hasAttribute('height'), "!canvas.hasAttribute('height')"); 1.20255 + 1.20256 + 1.20257 +} 1.20258 +</script> 1.20259 + 1.20260 +<!-- [[[ test_size.attributes.html ]]] --> 1.20261 + 1.20262 +<p>Canvas test: size.attributes</p> 1.20263 +<!-- Testing: width/height DOM attributes and content attributes --> 1.20264 +<canvas id="c636" width="120" height="60"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20265 +<script> 1.20266 + 1.20267 +function test_size_attributes() { 1.20268 + 1.20269 +var canvas = document.getElementById('c636'); 1.20270 +var ctx = canvas.getContext('2d'); 1.20271 + 1.20272 +ok(canvas.width == 120, "canvas.width == 120"); 1.20273 +ok(canvas.height == 60, "canvas.height == 60"); 1.20274 +ok(canvas.getAttribute('width') == 120, "canvas.getAttribute('width') == 120"); 1.20275 +ok(canvas.getAttribute('height') == 60, "canvas.getAttribute('height') == 60"); 1.20276 + 1.20277 + 1.20278 +} 1.20279 +</script> 1.20280 + 1.20281 +<!-- [[[ test_size.attributes.parse.badsuffix.html ]]] --> 1.20282 + 1.20283 +<p>Canvas test: size.attributes.parse.badsuffix</p> 1.20284 +<!-- Testing: Parsing of non-negative integers --> 1.20285 +<canvas id="c637" width="100foo" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20286 +<script> 1.20287 + 1.20288 +function test_size_attributes_parse_badsuffix() { 1.20289 + 1.20290 +var canvas = document.getElementById('c637'); 1.20291 +var ctx = canvas.getContext('2d'); 1.20292 + 1.20293 +is(canvas.width, 100, "canvas.width == 100"); 1.20294 + 1.20295 + 1.20296 +} 1.20297 +</script> 1.20298 + 1.20299 +<!-- [[[ test_size.attributes.parse.floatsuffix.html ]]] --> 1.20300 + 1.20301 +<p>Canvas test: size.attributes.parse.floatsuffix</p> 1.20302 +<!-- Testing: Parsing of non-negative integers --> 1.20303 +<canvas id="c638" width="100.9" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20304 +<script> 1.20305 + 1.20306 +function test_size_attributes_parse_floatsuffix() { 1.20307 + 1.20308 +var canvas = document.getElementById('c638'); 1.20309 +var ctx = canvas.getContext('2d'); 1.20310 + 1.20311 +ok(canvas.width == 100, "canvas.width == 100"); 1.20312 + 1.20313 + 1.20314 +} 1.20315 +</script> 1.20316 + 1.20317 +<!-- [[[ test_size.attributes.parse.negative.html ]]] --> 1.20318 + 1.20319 +<p>Canvas test: size.attributes.parse.negative</p> 1.20320 +<!-- Testing: Parsing of non-negative integers --> 1.20321 +<canvas id="c639" width="-100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20322 +<script> 1.20323 + 1.20324 +function test_size_attributes_parse_negative() { 1.20325 + 1.20326 +var canvas = document.getElementById('c639'); 1.20327 +var ctx = canvas.getContext('2d'); 1.20328 + 1.20329 +ok(canvas.width == 300, "canvas.width == 300"); 1.20330 + 1.20331 + 1.20332 +} 1.20333 +</script> 1.20334 + 1.20335 +<!-- [[[ test_size.attributes.parse.nonnumber.html ]]] --> 1.20336 + 1.20337 +<p>Canvas test: size.attributes.parse.nonnumber</p> 1.20338 +<!-- Testing: Parsing of non-negative integers --> 1.20339 +<canvas id="c640" width="foo" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20340 +<script> 1.20341 + 1.20342 +function test_size_attributes_parse_nonnumber() { 1.20343 + 1.20344 +var canvas = document.getElementById('c640'); 1.20345 +var ctx = canvas.getContext('2d'); 1.20346 + 1.20347 +ok(canvas.width == 300, "canvas.width == 300"); 1.20348 + 1.20349 + 1.20350 +} 1.20351 +</script> 1.20352 + 1.20353 +<!-- [[[ test_size.attributes.parse.percentsuffix.html ]]] --> 1.20354 + 1.20355 +<p>Canvas test: size.attributes.parse.percentsuffix</p> 1.20356 +<!-- Testing: Parsing of non-negative integers --> 1.20357 +<canvas id="c641" width="100%" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20358 +<script> 1.20359 + 1.20360 +function test_size_attributes_parse_percentsuffix() { 1.20361 + 1.20362 +var canvas = document.getElementById('c641'); 1.20363 +var ctx = canvas.getContext('2d'); 1.20364 + 1.20365 +ok(canvas.width == 100, "canvas.width == 100"); 1.20366 + 1.20367 + 1.20368 +} 1.20369 +</script> 1.20370 + 1.20371 +<!-- [[[ test_size.attributes.parse.whitespace.html ]]] --> 1.20372 + 1.20373 +<p>Canvas test: size.attributes.parse.whitespace</p> 1.20374 +<!-- Testing: Parsing of non-negative integers --> 1.20375 +<canvas id="c642" width=" 100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20376 +<script> 1.20377 + 1.20378 +function test_size_attributes_parse_whitespace() { 1.20379 + 1.20380 +var canvas = document.getElementById('c642'); 1.20381 +var ctx = canvas.getContext('2d'); 1.20382 + 1.20383 +ok(canvas.width == 100, "canvas.width == 100"); 1.20384 + 1.20385 + 1.20386 +} 1.20387 +</script> 1.20388 + 1.20389 +<!-- [[[ test_size.attributes.parse.zero.html ]]] --> 1.20390 + 1.20391 +<p>Canvas test: size.attributes.parse.zero</p> 1.20392 +<!-- Testing: Parsing of non-negative integers --> 1.20393 +<canvas id="c643" width="0" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20394 +<script> 1.20395 + 1.20396 +function test_size_attributes_parse_zero() { 1.20397 + 1.20398 +var canvas = document.getElementById('c643'); 1.20399 +var ctx = canvas.getContext('2d'); 1.20400 + 1.20401 +ok(canvas.width == 0, "canvas.width == 0"); 1.20402 + 1.20403 + 1.20404 +} 1.20405 +</script> 1.20406 + 1.20407 +<!-- [[[ test_size.attributes.parse.zerosuffix.html ]]] --> 1.20408 + 1.20409 +<p>Canvas test: size.attributes.parse.zerosuffix</p> 1.20410 +<!-- Testing: Parsing of non-negative integers --> 1.20411 +<canvas id="c644" width="100.0" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20412 +<script> 1.20413 + 1.20414 +function test_size_attributes_parse_zerosuffix() { 1.20415 + 1.20416 +var canvas = document.getElementById('c644'); 1.20417 +var ctx = canvas.getContext('2d'); 1.20418 + 1.20419 +ok(canvas.width == 100, "canvas.width == 100"); 1.20420 + 1.20421 + 1.20422 +} 1.20423 +</script> 1.20424 + 1.20425 +<!-- [[[ test_size.attributes.reflect.1.html ]]] --> 1.20426 + 1.20427 +<p>Canvas test: size.attributes.reflect.1</p> 1.20428 +<!-- Testing: Setting DOM attributes updates DOM and content attributes --> 1.20429 +<canvas id="c645" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20430 +<script> 1.20431 + 1.20432 +function test_size_attributes_reflect_1() { 1.20433 + 1.20434 +var canvas = document.getElementById('c645'); 1.20435 +var ctx = canvas.getContext('2d'); 1.20436 + 1.20437 +canvas.width = 120; 1.20438 +canvas.height = 60; 1.20439 +ok(canvas.getAttribute('width') == '120', "canvas.getAttribute('width') == '120'"); 1.20440 +ok(canvas.getAttribute('height') == '60', "canvas.getAttribute('height') == '60'"); 1.20441 +ok(canvas.width == 120, "canvas.width == 120"); 1.20442 +ok(canvas.height == 60, "canvas.height == 60"); 1.20443 + 1.20444 + 1.20445 +} 1.20446 +</script> 1.20447 + 1.20448 +<!-- [[[ test_size.attributes.reflect.2.html ]]] --> 1.20449 + 1.20450 +<p>Canvas test: size.attributes.reflect.2</p> 1.20451 +<!-- Testing: Setting content attributes updates DOM and content attributes --> 1.20452 +<canvas id="c646" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20453 +<script> 1.20454 + 1.20455 +function test_size_attributes_reflect_2() { 1.20456 + 1.20457 +var canvas = document.getElementById('c646'); 1.20458 +var ctx = canvas.getContext('2d'); 1.20459 + 1.20460 +canvas.setAttribute('width', '120'); 1.20461 +canvas.setAttribute('height', '60'); 1.20462 +ok(canvas.getAttribute('width') == '120', "canvas.getAttribute('width') == '120'"); 1.20463 +ok(canvas.getAttribute('height') == '60', "canvas.getAttribute('height') == '60'"); 1.20464 +ok(canvas.width == 120, "canvas.width == 120"); 1.20465 +ok(canvas.height == 60, "canvas.height == 60"); 1.20466 + 1.20467 + 1.20468 +} 1.20469 +</script> 1.20470 + 1.20471 +<!-- [[[ test_size.attributes.removed.html ]]] --> 1.20472 + 1.20473 +<p>Canvas test: size.attributes.removed</p> 1.20474 +<!-- Testing: Removing content attributes reverts to default size --> 1.20475 +<canvas id="c647" width="120" height="60"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20476 +<script> 1.20477 + 1.20478 +function test_size_attributes_removed() { 1.20479 + 1.20480 +var canvas = document.getElementById('c647'); 1.20481 +var ctx = canvas.getContext('2d'); 1.20482 + 1.20483 +canvas.removeAttribute('width'); 1.20484 +ok(canvas.width == 300, "canvas.width == 300"); 1.20485 + 1.20486 + 1.20487 +} 1.20488 +</script> 1.20489 + 1.20490 +<!-- [[[ test_size.attributes.setAttribute.badsuffix.html ]]] --> 1.20491 + 1.20492 +<p>Canvas test: size.attributes.setAttribute.badsuffix</p> 1.20493 +<!-- Testing: Parsing of non-negative integers in setAttribute --> 1.20494 +<canvas id="c648" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20495 +<script> 1.20496 + 1.20497 +function test_size_attributes_setAttribute_badsuffix() { 1.20498 + 1.20499 +var canvas = document.getElementById('c648'); 1.20500 +var ctx = canvas.getContext('2d'); 1.20501 + 1.20502 +canvas.setAttribute('width', '100foo'); 1.20503 +is(canvas.width, 100, "canvas.width == 100"); 1.20504 + 1.20505 + 1.20506 +} 1.20507 +</script> 1.20508 + 1.20509 +<!-- [[[ test_size.attributes.setAttribute.floatsuffix.html ]]] --> 1.20510 + 1.20511 +<p>Canvas test: size.attributes.setAttribute.floatsuffix</p> 1.20512 +<!-- Testing: Parsing of non-negative integers in setAttribute --> 1.20513 +<canvas id="c649" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20514 +<script> 1.20515 + 1.20516 +function test_size_attributes_setAttribute_floatsuffix() { 1.20517 + 1.20518 +var canvas = document.getElementById('c649'); 1.20519 +var ctx = canvas.getContext('2d'); 1.20520 + 1.20521 +canvas.setAttribute('width', '1'); 1.20522 +canvas.setAttribute('width', '100.9'); 1.20523 +ok(canvas.width == 100, "canvas.width == 100"); 1.20524 + 1.20525 + 1.20526 +} 1.20527 +</script> 1.20528 + 1.20529 +<!-- [[[ test_size.attributes.setAttribute.negative.html ]]] --> 1.20530 + 1.20531 +<p>Canvas test: size.attributes.setAttribute.negative</p> 1.20532 +<!-- Testing: Parsing of non-negative integers in setAttribute --> 1.20533 +<canvas id="c650" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20534 +<script> 1.20535 + 1.20536 +function test_size_attributes_setAttribute_negative() { 1.20537 + 1.20538 +var canvas = document.getElementById('c650'); 1.20539 +var ctx = canvas.getContext('2d'); 1.20540 + 1.20541 +canvas.setAttribute('width', '-100'); 1.20542 +ok(canvas.width == 300, "canvas.width == 300"); 1.20543 + 1.20544 + 1.20545 +} 1.20546 +</script> 1.20547 + 1.20548 +<!-- [[[ test_size.attributes.setAttribute.nonnumber.html ]]] --> 1.20549 + 1.20550 +<p>Canvas test: size.attributes.setAttribute.nonnumber</p> 1.20551 +<!-- Testing: Parsing of non-negative integers in setAttribute --> 1.20552 +<canvas id="c651" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20553 +<script> 1.20554 + 1.20555 +function test_size_attributes_setAttribute_nonnumber() { 1.20556 + 1.20557 +var canvas = document.getElementById('c651'); 1.20558 +var ctx = canvas.getContext('2d'); 1.20559 + 1.20560 +canvas.setAttribute('width', 'foo'); 1.20561 +ok(canvas.width == 300, "canvas.width == 300"); 1.20562 + 1.20563 + 1.20564 +} 1.20565 +</script> 1.20566 + 1.20567 +<!-- [[[ test_size.attributes.setAttribute.percentsuffix.html ]]] --> 1.20568 + 1.20569 +<p>Canvas test: size.attributes.setAttribute.percentsuffix</p> 1.20570 +<!-- Testing: Parsing of non-negative integers in setAttribute --> 1.20571 +<canvas id="c652" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20572 +<script> 1.20573 + 1.20574 +function test_size_attributes_setAttribute_percentsuffix() { 1.20575 + 1.20576 +var canvas = document.getElementById('c652'); 1.20577 +var ctx = canvas.getContext('2d'); 1.20578 + 1.20579 +canvas.setAttribute('width', '100%'); 1.20580 +ok(canvas.width == 100, "canvas.width == 100"); 1.20581 + 1.20582 + 1.20583 +} 1.20584 +</script> 1.20585 + 1.20586 +<!-- [[[ test_size.attributes.setAttribute.whitespace.html ]]] --> 1.20587 + 1.20588 +<p>Canvas test: size.attributes.setAttribute.whitespace</p> 1.20589 +<!-- Testing: Parsing of non-negative integers in setAttribute --> 1.20590 +<canvas id="c653" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20591 +<script> 1.20592 + 1.20593 +function test_size_attributes_setAttribute_whitespace() { 1.20594 + 1.20595 +var canvas = document.getElementById('c653'); 1.20596 +var ctx = canvas.getContext('2d'); 1.20597 + 1.20598 +canvas.setAttribute('width', ' 100'); 1.20599 +ok(canvas.width == 100, "canvas.width == 100"); 1.20600 + 1.20601 + 1.20602 +} 1.20603 +</script> 1.20604 + 1.20605 +<!-- [[[ test_size.attributes.setAttribute.zero.html ]]] --> 1.20606 + 1.20607 +<p>Canvas test: size.attributes.setAttribute.zero</p> 1.20608 +<!-- Testing: Parsing of non-negative integers in setAttribute --> 1.20609 +<canvas id="c654" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20610 +<script> 1.20611 + 1.20612 +function test_size_attributes_setAttribute_zero() { 1.20613 + 1.20614 +var canvas = document.getElementById('c654'); 1.20615 +var ctx = canvas.getContext('2d'); 1.20616 + 1.20617 +canvas.setAttribute('width', '0'); 1.20618 +ok(canvas.width == 0, "canvas.width == 0"); 1.20619 + 1.20620 + 1.20621 +} 1.20622 +</script> 1.20623 + 1.20624 +<!-- [[[ test_size.attributes.setAttribute.zerosuffix.html ]]] --> 1.20625 + 1.20626 +<p>Canvas test: size.attributes.setAttribute.zerosuffix</p> 1.20627 +<!-- Testing: Parsing of non-negative integers in setAttribute --> 1.20628 +<canvas id="c655" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20629 +<script> 1.20630 + 1.20631 +function test_size_attributes_setAttribute_zerosuffix() { 1.20632 + 1.20633 +var canvas = document.getElementById('c655'); 1.20634 +var ctx = canvas.getContext('2d'); 1.20635 + 1.20636 +canvas.setAttribute('width', '1'); 1.20637 +canvas.setAttribute('width', '100.0'); 1.20638 +ok(canvas.width == 100, "canvas.width == 100"); 1.20639 + 1.20640 + 1.20641 +} 1.20642 +</script> 1.20643 + 1.20644 +<!-- [[[ test_size.attributes.style.html ]]] --> 1.20645 + 1.20646 +<p>Canvas test: size.attributes.style</p> 1.20647 +<!-- Testing: Canvas size is independent of CSS resizing --> 1.20648 +<canvas id="c656" width="50" height="30" style="width: 100px; height: 50px"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20649 +<script> 1.20650 + 1.20651 +function test_size_attributes_style() { 1.20652 + 1.20653 +var canvas = document.getElementById('c656'); 1.20654 +var ctx = canvas.getContext('2d'); 1.20655 + 1.20656 +ok(canvas.width == 50, "canvas.width == 50"); 1.20657 +ok(canvas.height == 30, "canvas.height == 30"); 1.20658 + 1.20659 + 1.20660 +} 1.20661 +</script> 1.20662 + 1.20663 +<!-- [[[ test_size.attributes.type.get.html ]]] --> 1.20664 + 1.20665 +<p>Canvas test: size.attributes.type.get</p> 1.20666 +<!-- Testing: width/height DOM/content attributes - string vs number types --> 1.20667 +<canvas id="c657" width="120" height="60"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20668 +<script> 1.20669 + 1.20670 +function test_size_attributes_type_get() { 1.20671 + 1.20672 +var canvas = document.getElementById('c657'); 1.20673 +var ctx = canvas.getContext('2d'); 1.20674 + 1.20675 +ok(canvas.width === 120, "canvas.width === 120"); 1.20676 +ok(canvas.height === 60, "canvas.height === 60"); 1.20677 +ok(canvas.getAttribute('width') === '120', "canvas.getAttribute('width') === '120'"); 1.20678 +ok(canvas.getAttribute('height') === '60', "canvas.getAttribute('height') === '60'"); 1.20679 + 1.20680 + 1.20681 +} 1.20682 +</script> 1.20683 + 1.20684 +<!-- [[[ test_size.attributes.type.set.html ]]] --> 1.20685 + 1.20686 +<p>Canvas test: size.attributes.type.set</p> 1.20687 +<!-- Testing: Setting width/height DOM attributes --> 1.20688 +<canvas id="c658" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20689 +<script> 1.20690 + 1.20691 +function test_size_attributes_type_set() { 1.20692 + 1.20693 +var canvas = document.getElementById('c658'); 1.20694 +var ctx = canvas.getContext('2d'); 1.20695 + 1.20696 +canvas.width = 120; 1.20697 +canvas.height = 60; 1.20698 +ok(canvas.width === 120, "canvas.width === 120"); 1.20699 +ok(canvas.height === 60, "canvas.height === 60"); 1.20700 + 1.20701 + 1.20702 +} 1.20703 +</script> 1.20704 + 1.20705 +<!-- [[[ test_text.font.html ]]] --> 1.20706 + 1.20707 +<p>Canvas test: text.font</p> 1.20708 +<canvas id="c659" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20709 +<script> 1.20710 +var _deferred = true; 1.20711 + 1.20712 +function test_text_font() { 1.20713 + 1.20714 +var canvas = document.getElementById('c659'); 1.20715 +var ctx = canvas.getContext('2d'); 1.20716 + 1.20717 +is(ctx.font, '10px sans-serif', "default font is not '10px sans-serif'"); 1.20718 + 1.20719 +ctx.save(); 1.20720 +ctx.font = '20pt serif'; 1.20721 +is(ctx.font, '20pt serif', 'font getter returns incorrect value'); 1.20722 + 1.20723 +ctx.restore(); 1.20724 +is(ctx.font, '10px sans-serif', 'font not being stored in the context state'); 1.20725 + 1.20726 +if (!_deferred) SimpleTest.finish(); 1.20727 +} 1.20728 +</script> 1.20729 + 1.20730 +<!-- [[[ test_text.measure.html ]]] --> 1.20731 + 1.20732 +<p>Canvas test: text.measure</p> 1.20733 +<canvas id="c660" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20734 +<script> 1.20735 +var _deferred = true; 1.20736 + 1.20737 +function test_text_measure() { 1.20738 + 1.20739 +var canvas = document.getElementById('c660'); 1.20740 +var ctx = canvas.getContext('2d'); 1.20741 + 1.20742 +ctx.font = "10px sans-serif"; 1.20743 +ctx.textAlign = "left"; 1.20744 +ctx.textBaseline = "top"; 1.20745 + 1.20746 +var str = 'Test String'; 1.20747 +var wid = ctx.measureText(str).width; 1.20748 + 1.20749 +ok(wid > 0, "measureText returns nonpositive value for non-empty string"); 1.20750 + 1.20751 +ctx.font = "20px sans-serif"; 1.20752 +isnot(wid, ctx.measureText(str).width, "measureText does not change with a different font size"); 1.20753 + 1.20754 +ctx.font = "10px sans-serif"; 1.20755 +ctx.textAlign = "center"; 1.20756 +ctx.textBaseline = "alphabetic"; 1.20757 + 1.20758 +is(wid, ctx.measureText(str).width, "measureText changes when alignement/baseline is changed"); 1.20759 + 1.20760 + 1.20761 +if (!_deferred) SimpleTest.finish(); 1.20762 +} 1.20763 +</script> 1.20764 + 1.20765 +<!-- [[[ test_text.space.replace.html ]]] --> 1.20766 + 1.20767 +<p>Canvas test: text.space.replace</p> 1.20768 +<canvas id="c661" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20769 +<script> 1.20770 +var _deferred = true; 1.20771 + 1.20772 +function test_text_space_replace() { 1.20773 + 1.20774 +var canvas = document.getElementById('c661'); 1.20775 +var ctx = canvas.getContext('2d'); 1.20776 + 1.20777 +var swid = ctx.measureText(' ').width; 1.20778 +ctx.font = "10px sans-serif"; 1.20779 + 1.20780 +isnot(swid, 0.0, "measureText reutuns zero for a non-empty string"); 1.20781 +is(swid, ctx.measureText('\x09').width, "measureText does not replace whitespace char with a space"); 1.20782 +is(swid, ctx.measureText('\x0A').width, "measureText does not replace whitespace char with a space"); 1.20783 +is(swid, ctx.measureText('\x0B').width, "measureText does not replace whitespace char with a space"); 1.20784 +is(swid, ctx.measureText('\x0C').width, "measureText does not replace whitespace char with a space"); 1.20785 +is(swid, ctx.measureText('\x0D').width, "measureText does not replace whitespace char with a space"); 1.20786 + 1.20787 +if (!_deferred) SimpleTest.finish(); 1.20788 +} 1.20789 +</script> 1.20790 + 1.20791 +<!-- [[[ test_text.textAlign.html ]]] --> 1.20792 + 1.20793 +<p>Canvas test: text.textAlign</p> 1.20794 +<canvas id="c662" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20795 +<script> 1.20796 +var _deferred = true; 1.20797 + 1.20798 +function test_text_textAlign() { 1.20799 + 1.20800 +var canvas = document.getElementById('c662'); 1.20801 +var ctx = canvas.getContext('2d'); 1.20802 + 1.20803 +is(ctx.textAlign, 'start', "default textAlign is not 'start'"); 1.20804 + 1.20805 +ctx.save(); 1.20806 +ctx.textAlign = 'end'; 1.20807 +is(ctx.textAlign, 'end', 'textAlign getter returns incorrect value'); 1.20808 + 1.20809 +ctx.save(); 1.20810 +ctx.textAlign = 'left'; 1.20811 +is(ctx.textAlign, 'left', 'textAlign getter returns incorrect value'); 1.20812 + 1.20813 +ctx.save(); 1.20814 +ctx.textAlign = 'center'; 1.20815 +is(ctx.textAlign, 'center', 'textAlign getter returns incorrect value'); 1.20816 + 1.20817 +ctx.save(); 1.20818 +ctx.textAlign = 'right'; 1.20819 +is(ctx.textAlign, 'right', 'textAlign getter returns incorrect value'); 1.20820 + 1.20821 +ctx.save(); 1.20822 +ctx.textAlign = 'start'; 1.20823 +is(ctx.textAlign, 'start', 'textAlign getter returns incorrect value'); 1.20824 + 1.20825 +ctx.restore(); 1.20826 +is(ctx.textAlign, 'right', 'textAlign not being stored in the context state'); 1.20827 + 1.20828 +ctx.restore(); 1.20829 +is(ctx.textAlign, 'center', 'textAlign not being stored in the context state'); 1.20830 + 1.20831 +ctx.restore(); 1.20832 +is(ctx.textAlign, 'left', 'textAlign not being stored in the context state'); 1.20833 + 1.20834 +ctx.restore(); 1.20835 +is(ctx.textAlign, 'end', 'textAlign not being stored in the context state'); 1.20836 + 1.20837 +ctx.restore(); 1.20838 +is(ctx.textAlign, 'start', 'textAlign not being stored in the context state'); 1.20839 + 1.20840 +if (!_deferred) SimpleTest.finish(); 1.20841 +} 1.20842 +</script> 1.20843 + 1.20844 +<!-- [[[ test_text.textBaseline.html ]]] --> 1.20845 + 1.20846 +<p>Canvas test: text.textBaseline</p> 1.20847 +<canvas id="c663" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20848 +<script> 1.20849 +var _deferred = true; 1.20850 + 1.20851 +function test_text_textBaseline() { 1.20852 + 1.20853 +var canvas = document.getElementById('c663'); 1.20854 +var ctx = canvas.getContext('2d'); 1.20855 + 1.20856 +is(ctx.textBaseline, 'alphabetic', "default textBaseline is not 'alphabetic'"); 1.20857 + 1.20858 +ctx.save(); 1.20859 +ctx.textBaseline = 'ideographic'; 1.20860 +is(ctx.textBaseline, 'ideographic', 'textBaseline getter returns incorrect value'); 1.20861 + 1.20862 +ctx.save(); 1.20863 +ctx.textBaseline = 'top'; 1.20864 +is(ctx.textBaseline, 'top', 'textBaseline getter returns incorrect value'); 1.20865 + 1.20866 +ctx.save(); 1.20867 +ctx.textBaseline = 'middle'; 1.20868 +is(ctx.textBaseline, 'middle', 'textBaseline getter returns incorrect value'); 1.20869 + 1.20870 +ctx.save(); 1.20871 +ctx.textBaseline = 'bottom'; 1.20872 +is(ctx.textBaseline, 'bottom', 'textBaseline getter returns incorrect value'); 1.20873 + 1.20874 +ctx.save(); 1.20875 +ctx.textBaseline = 'hanging'; 1.20876 +is(ctx.textBaseline, 'hanging', 'textBaseline getter returns incorrect value'); 1.20877 + 1.20878 +ctx.save(); 1.20879 +ctx.textBaseline = 'alphabetic'; 1.20880 +is(ctx.textBaseline, 'alphabetic', 'textBaseline getter returns incorrect value'); 1.20881 + 1.20882 +ctx.restore(); 1.20883 +is(ctx.textBaseline, 'hanging', 'textBaseline not being stored in the context state'); 1.20884 + 1.20885 +ctx.restore(); 1.20886 +is(ctx.textBaseline, 'bottom', 'textBaseline not being stored in the context state'); 1.20887 + 1.20888 +ctx.restore(); 1.20889 +is(ctx.textBaseline, 'middle', 'textBaseline not being stored in the context state'); 1.20890 + 1.20891 +ctx.restore(); 1.20892 +is(ctx.textBaseline, 'top', 'textBaseline not being stored in the context state'); 1.20893 + 1.20894 +ctx.restore(); 1.20895 +is(ctx.textBaseline, 'ideographic', 'textBaseline not being stored in the context state'); 1.20896 + 1.20897 +ctx.restore(); 1.20898 +is(ctx.textBaseline, 'alphabetic', 'textBaseline not being stored in the context state'); 1.20899 + 1.20900 +if (!_deferred) SimpleTest.finish(); 1.20901 +} 1.20902 +</script> 1.20903 + 1.20904 +<!-- [[[ test_toDataURL.arguments.1.html ]]] --> 1.20905 + 1.20906 +<p>Canvas test: toDataURL.arguments.1 - bug 401795</p> 1.20907 +<!-- Testing: toDataURL ignores extra arguments --> 1.20908 +<canvas id="c664" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20909 +<script> 1.20910 + 1.20911 +function test_toDataURL_arguments_1() { 1.20912 + 1.20913 +var canvas = document.getElementById('c664'); 1.20914 +var ctx = canvas.getContext('2d'); 1.20915 + 1.20916 +var _thrown_outer = false; 1.20917 +try { 1.20918 + 1.20919 +var data = canvas.toDataURL('image/png', 'another argument that should not raise an exception'); 1.20920 +ok(/^data:image\/png[;,]/.test(data), "data =~ /^data:image\\/png[;,]/"); 1.20921 + 1.20922 +} catch (e) { 1.20923 + _thrown_outer = true; 1.20924 +} 1.20925 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.20926 + 1.20927 + 1.20928 +} 1.20929 +</script> 1.20930 + 1.20931 +<!-- [[[ test_toDataURL.arguments.2.html ]]] --> 1.20932 + 1.20933 +<p>Canvas test: toDataURL.arguments.2 - bug 401795</p> 1.20934 +<!-- Testing: toDataURL ignores extra arguments --> 1.20935 +<canvas id="c665" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20936 +<script> 1.20937 + 1.20938 +function test_toDataURL_arguments_2() { 1.20939 + 1.20940 +var canvas = document.getElementById('c665'); 1.20941 +var ctx = canvas.getContext('2d'); 1.20942 + 1.20943 +var _thrown_outer = false; 1.20944 +try { 1.20945 + 1.20946 +var data = canvas.toDataURL('image/png', 'another argument that should not raise an exception', 'and another'); 1.20947 +ok(/^data:image\/png[;,]/.test(data), "data =~ /^data:image\\/png[;,]/"); 1.20948 + 1.20949 +} catch (e) { 1.20950 + _thrown_outer = true; 1.20951 +} 1.20952 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.20953 + 1.20954 + 1.20955 +} 1.20956 +</script> 1.20957 + 1.20958 +<!-- [[[ test_toDataURL.arguments.3.html ]]] --> 1.20959 + 1.20960 +<p>Canvas test: toDataURL.arguments.3 - bug 401795</p> 1.20961 +<!-- Testing: toDataURL ignores extra arguments --> 1.20962 +<canvas id="c666" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20963 +<script> 1.20964 + 1.20965 +function test_toDataURL_arguments_3() { 1.20966 + 1.20967 +var canvas = document.getElementById('c666'); 1.20968 +var ctx = canvas.getContext('2d'); 1.20969 + 1.20970 +var _thrown_outer = false; 1.20971 +try { 1.20972 + 1.20973 +// More arguments that should not raise exceptions 1.20974 +var data = canvas.toDataURL('image/png', null, null, null); 1.20975 +ok(/^data:image\/png[;,]/.test(data), "data =~ /^data:image\\/png[;,]/"); 1.20976 + 1.20977 +} catch (e) { 1.20978 + _thrown_outer = true; 1.20979 +} 1.20980 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.20981 + 1.20982 + 1.20983 +} 1.20984 +</script> 1.20985 + 1.20986 +<!-- [[[ test_toDataURL.complexcolours.html ]]] --> 1.20987 + 1.20988 +<p>Canvas test: toDataURL.complexcolours</p> 1.20989 +<!-- Testing: toDataURL handles non-primary and non-solid colours correctly --> 1.20990 +<canvas id="c667" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.20991 +<script> 1.20992 + 1.20993 +var canvas667 = document.getElementById('c667'); 1.20994 +var ctx667 = canvas667.getContext('2d'); 1.20995 + 1.20996 +function test_toDataURL_complexcolours() { 1.20997 + 1.20998 +// (These values are chosen to survive relatively alright through being premultiplied) 1.20999 +ctx667.fillStyle = 'rgba(1, 3, 254, 1)'; 1.21000 +ctx667.fillRect(0, 0, 25, 25); 1.21001 +ctx667.fillStyle = 'rgba(8, 252, 248, 0.75)'; 1.21002 +ctx667.fillRect(25, 0, 25, 25); 1.21003 +ctx667.fillStyle = 'rgba(6, 10, 250, 0.502)'; 1.21004 +ctx667.fillRect(50, 0, 25, 25); 1.21005 +ctx667.fillStyle = 'rgba(12, 16, 244, 0.25)'; 1.21006 +ctx667.fillRect(75, 0, 25, 25); 1.21007 +var img = new Image(); 1.21008 +deferTest(); 1.21009 +img.onload = wrapFunction(function () 1.21010 +{ 1.21011 + ctx667.drawImage(img, 0, 25); 1.21012 + // (The alpha values do not really survive float->int conversion, so just 1.21013 + // do approximate comparisons) 1.21014 + isPixel(ctx667, 12,40, 1,3,254,255, 0); 1.21015 + isPixel(ctx667, 37,40, 8,252,248,191, 2); 1.21016 + isPixel(ctx667, 62,40, 6,10,250,127, 4); 1.21017 + isPixel(ctx667, 87,40, 12,16,244,63, 8); 1.21018 +}); 1.21019 +img.src = canvas667.toDataURL(); 1.21020 + 1.21021 + 1.21022 +} 1.21023 +</script> 1.21024 + 1.21025 +<!-- [[[ test_toDataURL.default.html ]]] --> 1.21026 + 1.21027 +<p>Canvas test: toDataURL.default</p> 1.21028 +<!-- Testing: toDataURL with no arguments returns a PNG --> 1.21029 +<canvas id="c668" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.21030 +<script> 1.21031 + 1.21032 +function test_toDataURL_default() { 1.21033 + 1.21034 +var canvas = document.getElementById('c668'); 1.21035 +var ctx = canvas.getContext('2d'); 1.21036 + 1.21037 +var data = canvas.toDataURL(); 1.21038 +ok(/^data:image\/png[;,]/.test(data), "data =~ /^data:image\\/png[;,]/"); 1.21039 + 1.21040 + 1.21041 +} 1.21042 +</script> 1.21043 + 1.21044 +<!-- [[[ test_toDataURL.lowercase.html ]]] --> 1.21045 + 1.21046 +<p>Canvas test: toDataURL.lowercase - bug 401795</p> 1.21047 +<!-- Testing: toDataURL type is case-sensitive --> 1.21048 +<canvas id="c669" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.21049 +<script> 1.21050 + 1.21051 +function test_toDataURL_lowercase() { 1.21052 + 1.21053 +var canvas = document.getElementById('c669'); 1.21054 +var ctx = canvas.getContext('2d'); 1.21055 + 1.21056 +var _thrown_outer = false; 1.21057 +try { 1.21058 + 1.21059 +var data = canvas.toDataURL('ImAgE/PnG'); 1.21060 +ok(/^data:image\/png[;,]/.test(data), "data =~ /^data:image\\/png[;,]/"); 1.21061 + 1.21062 +} catch (e) { 1.21063 + _thrown_outer = true; 1.21064 +} 1.21065 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.21066 + 1.21067 + 1.21068 +} 1.21069 +</script> 1.21070 + 1.21071 +<!-- [[[ test_toDataURL.nocontext.html ]]] --> 1.21072 + 1.21073 +<p>Canvas test: toDataURL.nocontext</p> 1.21074 +<!-- Testing: toDataURL works before any context has been got --> 1.21075 +<canvas id="c670" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.21076 +<script> 1.21077 + 1.21078 +function test_toDataURL_nocontext() { 1.21079 + 1.21080 +var canvas = document.getElementById('c670'); 1.21081 +var ctx = canvas.getContext('2d'); 1.21082 + 1.21083 +var canvas2 = document.createElement('canvas'); 1.21084 + 1.21085 +var data = canvas2.toDataURL(); 1.21086 +ok(/^data:image\/png[;,]/.test(data), "data =~ /^data:image\\/png[;,]/"); 1.21087 + 1.21088 + 1.21089 +} 1.21090 +</script> 1.21091 + 1.21092 +<!-- [[[ test_toDataURL.png.html ]]] --> 1.21093 + 1.21094 +<p>Canvas test: toDataURL.png</p> 1.21095 +<!-- Testing: toDataURL with image/png returns a PNG --> 1.21096 +<canvas id="c671" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.21097 +<script> 1.21098 + 1.21099 +function test_toDataURL_png() { 1.21100 + 1.21101 +var canvas = document.getElementById('c671'); 1.21102 +var ctx = canvas.getContext('2d'); 1.21103 + 1.21104 +var data = canvas.toDataURL('image/png'); 1.21105 +ok(/^data:image\/png[;,]/.test(data), "data =~ /^data:image\\/png[;,]/"); 1.21106 + 1.21107 + 1.21108 +} 1.21109 +</script> 1.21110 + 1.21111 +<!-- [[[ test_toDataURL.primarycolours.html ]]] --> 1.21112 + 1.21113 +<p>Canvas test: toDataURL.primarycolours</p> 1.21114 +<!-- Testing: toDataURL handles simple colours correctly --> 1.21115 +<canvas id="c672" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.21116 +<script> 1.21117 + 1.21118 + 1.21119 +var canvas672 = document.getElementById('c672'); 1.21120 +var ctx672 = canvas672.getContext('2d'); 1.21121 + 1.21122 +function test_toDataURL_primarycolours() { 1.21123 + 1.21124 +ctx672.fillStyle = '#ff0'; 1.21125 +ctx672.fillRect(0, 0, 25, 40); 1.21126 +ctx672.fillStyle = '#0ff'; 1.21127 +ctx672.fillRect(25, 0, 50, 40); 1.21128 +ctx672.fillStyle = '#00f'; 1.21129 +ctx672.fillRect(75, 0, 25, 40); 1.21130 +ctx672.fillStyle = '#fff'; 1.21131 +ctx672.fillRect(0, 40, 100, 10); 1.21132 +var data = canvas672.toDataURL(); 1.21133 +ctx672.fillStyle = '#f00'; 1.21134 +ctx672.fillRect(0, 0, 100, 50); 1.21135 +var img = new Image(); 1.21136 +deferTest(); 1.21137 +img.onload = wrapFunction(function () 1.21138 +{ 1.21139 + ctx672.drawImage(img, 0, 0); 1.21140 + isPixel(ctx672, 12,20, 255,255,0,255, 0); 1.21141 + isPixel(ctx672, 50,20, 0,255,255,255, 0); 1.21142 + isPixel(ctx672, 87,20, 0,0,255,255, 0); 1.21143 + isPixel(ctx672, 50,45, 255,255,255,255, 0); 1.21144 +}); 1.21145 +img.src = data; 1.21146 + 1.21147 + 1.21148 +} 1.21149 +</script> 1.21150 + 1.21151 +<!-- [[[ test_toDataURL.unrecognised.html ]]] --> 1.21152 + 1.21153 +<p>Canvas test: toDataURL.unrecognised - bug 401795</p> 1.21154 +<!-- Testing: toDataURL with an unhandled type returns a PNG --> 1.21155 +<canvas id="c673" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.21156 +<script> 1.21157 + 1.21158 +function test_toDataURL_unrecognised() { 1.21159 + 1.21160 +var canvas = document.getElementById('c673'); 1.21161 +var ctx = canvas.getContext('2d'); 1.21162 + 1.21163 +var _thrown_outer = false; 1.21164 +try { 1.21165 + 1.21166 +var data = canvas.toDataURL('image/example'); 1.21167 +ok(/^data:image\/png[;,]/.test(data), "data =~ /^data:image\\/png[;,]/"); 1.21168 + 1.21169 +} catch (e) { 1.21170 + _thrown_outer = true; 1.21171 +} 1.21172 +ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception'); 1.21173 + 1.21174 + 1.21175 +} 1.21176 +</script> 1.21177 + 1.21178 +<!-- [[[ test_toDataURL.zerosize.html ]]] --> 1.21179 + 1.21180 +<p>Canvas test: toDataURL.zerosize</p> 1.21181 +<!-- Testing: toDataURL on zero-size canvas returns 'data:,' --> 1.21182 +<canvas id="c674" width="0" height="0"><p class="fallback">FAIL (fallback content)</p></canvas> 1.21183 +<script> 1.21184 + 1.21185 +function test_toDataURL_zerosize() { 1.21186 + 1.21187 +var canvas = document.getElementById('c674'); 1.21188 +var ctx = canvas.getContext('2d'); 1.21189 + 1.21190 +var data = canvas.toDataURL(); 1.21191 +ok(data === 'data:,', "data === 'data:,'"); 1.21192 + 1.21193 + 1.21194 +} 1.21195 +</script> 1.21196 + 1.21197 +<!-- [[[ test_type.exists.html ]]] --> 1.21198 + 1.21199 +<p>Canvas test: type.exists</p> 1.21200 +<!-- Testing: HTMLCanvasElement is a property of window --> 1.21201 +<canvas id="c676" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.21202 +<script> 1.21203 + 1.21204 +function test_type_exists() { 1.21205 + 1.21206 +var canvas = document.getElementById('c676'); 1.21207 +var ctx = canvas.getContext('2d'); 1.21208 + 1.21209 +ok(window.HTMLCanvasElement, "window.HTMLCanvasElement"); 1.21210 + 1.21211 + 1.21212 +} 1.21213 +</script> 1.21214 + 1.21215 +<!-- [[[ test_type.extend.html ]]] --> 1.21216 + 1.21217 +<p>Canvas test: type.extend</p> 1.21218 +<!-- Testing: HTMLCanvasElement methods can be added, and the new methods used by canvases --> 1.21219 +<canvas id="c677" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.21220 +<script> 1.21221 + 1.21222 +function test_type_extend() { 1.21223 + 1.21224 +var canvas = document.getElementById('c677'); 1.21225 +var ctx = canvas.getContext('2d'); 1.21226 + 1.21227 +window.HTMLCanvasElement.prototype.getZero = function () { return 0; }; 1.21228 +ok(canvas.getZero() === 0, "canvas.getZero() === 0"); 1.21229 + 1.21230 + 1.21231 +} 1.21232 +</script> 1.21233 + 1.21234 +<!-- [[[ test_type.name.html ]]] --> 1.21235 + 1.21236 +<p>Canvas test: type.name</p> 1.21237 +<!-- Testing: HTMLCanvasElement type and toString --> 1.21238 +<canvas id="c678" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.21239 +<script> 1.21240 + 1.21241 +function test_type_name() { 1.21242 + 1.21243 +var canvas = document.getElementById('c678'); 1.21244 +var ctx = canvas.getContext('2d'); 1.21245 + 1.21246 +ok(Object.prototype.toString.call(canvas) === '[object HTMLCanvasElement]', "Object.prototype.toString.call(canvas) === '[object HTMLCanvasElement]'"); 1.21247 + 1.21248 + 1.21249 +} 1.21250 +</script> 1.21251 + 1.21252 +<!-- [[[ test_type.prototype.html ]]] --> 1.21253 + 1.21254 +<p>Canvas test: type.prototype</p> 1.21255 +<!-- Testing: window.HTMLCanvasElement has prototype, which is { ReadOnly, DontDelete }. prototype has getContext, which is not --> 1.21256 +<canvas id="c679" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.21257 +<script> 1.21258 + 1.21259 +function test_type_prototype() { 1.21260 + 1.21261 +var canvas = document.getElementById('c679'); 1.21262 +var ctx = canvas.getContext('2d'); 1.21263 + 1.21264 +ok(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype"); 1.21265 +ok(window.HTMLCanvasElement.prototype.getContext, "window.HTMLCanvasElement.prototype.getContext"); 1.21266 +window.HTMLCanvasElement.prototype = null; 1.21267 +ok(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype"); 1.21268 +delete window.HTMLCanvasElement.prototype; 1.21269 +ok(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype"); 1.21270 +var getContext = window.HTMLCanvasElement.prototype.getContext; 1.21271 +window.HTMLCanvasElement.prototype.getContext = 1; 1.21272 +ok(window.HTMLCanvasElement.prototype.getContext === 1, "window.HTMLCanvasElement.prototype.getContext === 1"); 1.21273 +delete window.HTMLCanvasElement.prototype.getContext; 1.21274 +ok(window.HTMLCanvasElement.prototype.getContext === undefined, "window.HTMLCanvasElement.prototype.getContext === undefined"); 1.21275 +window.HTMLCanvasElement.prototype.getContext = getContext; 1.21276 + 1.21277 + 1.21278 +} 1.21279 +</script> 1.21280 + 1.21281 +<!-- [[[ test_type.replace.html ]]] --> 1.21282 + 1.21283 +<p>Canvas test: type.replace</p> 1.21284 +<!-- Testing: HTMLCanvasElement methods can be replaced, and the replacement methods used by canvases --> 1.21285 +<canvas id="c680" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> 1.21286 +<script> 1.21287 + 1.21288 +function test_type_replace() { 1.21289 + 1.21290 +var canvas = document.getElementById('c680'); 1.21291 +var ctx = canvas.getContext('2d'); 1.21292 + 1.21293 +var getContext = window.HTMLCanvasElement.prototype.getContext; 1.21294 +window.HTMLCanvasElement.prototype.getContext = function (name) { return 0; }; 1.21295 +ok(canvas.getContext('2d') === 0, "canvas.getContext('2d') === 0"); 1.21296 +window.HTMLCanvasElement.prototype.getContext = getContext; 1.21297 + 1.21298 + 1.21299 +} 1.21300 +</script> 1.21301 + 1.21302 +<!-- [[[ test_2d.imagedata_coercion.html ]]] --> 1.21303 + 1.21304 +<p>Canvas test: 2d.imagedata_coercion</p> 1.21305 +<!-- Testing: imagedata coerced correctly on set --> 1.21306 +<canvas id="c681" width="100" height="1"><p class="fallback">FAIL (fallback content)</p></canvas> 1.21307 +<script> 1.21308 + 1.21309 +/* NOTE: Due to round-tripping through premultiplied values and the rounding 1.21310 +that ensues, values of alpha < 255 will tend to do weird things. In 1.21311 +particular, the premultiplied color values are computed by multiplying by a, 1.21312 +dividing by 255, then always rounding up. The conversion the other way is done 1.21313 +by multiplying by 255/a and rounding down. So if 1.21314 + 1.21315 + 255/a * (amount added when rounding) > 1 1.21316 + 1.21317 +we will get a change in value when we go through a putImageData/getImageData cycle. Therefore, to make sure we don't have to worry about our color 1.21318 +channels, our alpha channel should never be < 250, unless it's 0. And when it's 0, all our color channels will come back as 0 too. */ 1.21319 + 1.21320 +/* Our tests. Each test has two arrays: the array of values to set and the 1.21321 + array of values that should read back as a result. */ 1.21322 +var tests = [ 1.21323 + [ 1.21324 + [ 0, 1, 3, 250 ], [ 0, 1, 3, 250 ] 1.21325 + ], 1.21326 + [ 1.21327 + [ 0, 1, 2, 250, 4, 5, 6, 250 ], [ 0, 1, 2, 250, 4, 5, 6, 250 ] 1.21328 + ], 1.21329 + [ 1.21330 + [ 0, 1000, 2, 300, 400, 5, 600, 250 ], [ 0, 255, 2, 255, 255, 5, 255, 250 ] 1.21331 + ], 1.21332 + [ 1.21333 + [ -10, -5, NaN, 250, 4, 5, 6, -250 ], [ 0, 0, 0, 250, 0, 0, 0, 0 ] 1.21334 + ], 1.21335 + [ 1.21336 + [ 0.5, 12.2, 12.8, 251.5, 12.5, 13.5, 13.2, 250.5 ], 1.21337 + [ 0, 12, 13, 252, 12, 14, 13, 250 ] 1.21338 + ] 1.21339 +]; 1.21340 + 1.21341 +function doTest(type, idx) { 1.21342 + var testPair = tests[idx]; 1.21343 + var test = testPair[0]; 1.21344 + var ref = testPair[1]; 1.21345 + var descSuffix = " for " + type + " test #" + (idx+1); 1.21346 + function myIs(a, b, str) { 1.21347 + is(a, b, str + descSuffix); 1.21348 + } 1.21349 + 1.21350 + myIs(test.length, ref.length, "Length mismatch"); 1.21351 + myIs(test.length % 4, 0, "Length not a multiple of 4"); 1.21352 + var pixels = test.length / 4; 1.21353 + var imageData = ctx681.createImageData(pixels, 1); 1.21354 + myIs(imageData.width, pixels, "Incorrect created data width"); 1.21355 + myIs(imageData.height, 1, "Incorrect created data height"); 1.21356 + myIs(imageData.data.length, test.length, 1.21357 + "Incorrect length in created image data"); 1.21358 + 1.21359 + ctx681.putImageData(imageData, 0, 0); 1.21360 + var testImageData = ctx681.getImageData(0, 0, pixels, 1); 1.21361 + myIs(testImageData.data.length, test.length, 1.21362 + "Incorrect length in test image data after clearing pixels"); 1.21363 + var j; 1.21364 + for (j = 0; j < testImageData.data.length; ++j) { 1.21365 + myIs(testImageData.data[j], 0, 1.21366 + "Nonzero value at position " + j + " in test image data " + 1.21367 + "after clearing pixels"); 1.21368 + } 1.21369 + for (j = 0; j < imageData.data.length; ++j) { 1.21370 + imageData.data[j] = test[j]; 1.21371 + } 1.21372 + if (type == "slow") { 1.21373 + // convert to a non-dense array so we can test that codepath 1.21374 + imageData.data.makeMeSlow = 1; 1.21375 + } 1.21376 + ctx681.putImageData(imageData, 0, 0); 1.21377 + testImageData = ctx681.getImageData(0, 0, pixels, 1); 1.21378 + myIs(testImageData.data.length, test.length, 1.21379 + "Incorrect length in test image data after putting our imagedata"); 1.21380 + for (j = 0; j < testImageData.data.length; ++j) { 1.21381 + myIs(testImageData.data[j], ref[j], 1.21382 + "Incorrect value at position " + j + " in test image data " + 1.21383 + "after putting our imagedata"); 1.21384 + } 1.21385 +} 1.21386 + 1.21387 +function doTests(type) { 1.21388 + for (var i = 0; i < tests.length; ++i) { 1.21389 + doTest(type, i); 1.21390 + } 1.21391 +} 1.21392 + 1.21393 +var canvas681; 1.21394 +var ctx681; 1.21395 + 1.21396 +function test_2d_imagedata_coercion() { 1.21397 + 1.21398 +canvas681 = document.getElementById('c681'); 1.21399 +ctx681 = canvas681.getContext('2d'); 1.21400 + 1.21401 +doTests("fast"); 1.21402 +doTests("slow"); 1.21403 + 1.21404 +} 1.21405 +</script> 1.21406 + 1.21407 +<!-- [[[ test_2d.imageSmoothing.html ]]] --> 1.21408 + 1.21409 +<p>Canvas test: 2d.imageRenderingQuality</p> 1.21410 +<canvas id="c682" width="10" height="10"></canvas><br> 1.21411 +<canvas style="visibility: hidden" id="c683" width="2" height="2"></canvas> 1.21412 +<script type="text/javascript"> 1.21413 + 1.21414 +function setup_test_2d_imageSmoothing() { 1.21415 + var c683 = document.getElementById("c683"); 1.21416 + var cx683 = c683.getContext("2d"); 1.21417 + 1.21418 + cx683.fillStyle = "red"; 1.21419 + cx683.fillRect(0, 0, 2, 2); 1.21420 + 1.21421 + cx683.fillStyle = "rgb(0,255,0)"; 1.21422 + cx683.fillRect(0, 0, 1, 1); 1.21423 +} 1.21424 + 1.21425 +function test_2d_imageSmoothing() { 1.21426 + setup_test_2d_imageSmoothing(); 1.21427 + 1.21428 + var c682 = document.getElementById("c682"); 1.21429 + var c683 = document.getElementById("c683"); 1.21430 + 1.21431 + var cx682 = c682.getContext("2d"); 1.21432 + 1.21433 + ok(cx682.mozImageSmoothingEnabled == true, "initial mozImageSmoothingEnabled is true"); 1.21434 + 1.21435 + // check that mozImageSmoothingEnabled is part of the context 1.21436 + cx682.save(); 1.21437 + cx682.mozImageSmoothingEnabled = false; 1.21438 + ok(cx682.mozImageSmoothingEnabled == false, "mozImageSmoothingEnabled is false after setting"); 1.21439 + cx682.restore(); 1.21440 + ok(cx682.mozImageSmoothingEnabled == true, "mozImageSmoothingEnabled is true after restore"); 1.21441 + 1.21442 + // check that false works 1.21443 + cx682.mozImageSmoothingEnabled = false; 1.21444 + 1.21445 + cx682.scale(10,10); 1.21446 + cx682.drawImage(c683, 0, 0); 1.21447 + 1.21448 + // this should be all red 1.21449 + var data = cx682.getImageData(9, 9, 1, 1); 1.21450 + var pixels = data.data; 1.21451 + ok (pixels[0] == 0 && 1.21452 + pixels[1] == 255 && 1.21453 + pixels[2] == 0 && 1.21454 + pixels[3] == 255, 1.21455 + "pixel is " + pixels.toSource() + " (expected [0,255,0,255])"); 1.21456 +} 1.21457 + 1.21458 +</script> 1.21459 + 1.21460 +<p>Canvas test: zero_dimensions</p> 1.21461 +<canvas id="c684" width="0" height="0"></canvas> 1.21462 +<script type="text/javascript"> 1.21463 +function test_zero_dimensions() { 1.21464 + var c = document.getElementById("c684"); 1.21465 + ok(c.width == 0, "c.width not 0"); 1.21466 + ok(c.height == 0, "c.height not 0"); 1.21467 +} 1.21468 +</script> 1.21469 + 1.21470 +<p>Canvas test: zero_dimensions_image_data</p> 1.21471 +<canvas id="c685" width="0" height="0"></canvas> 1.21472 +<script type="text/javascript"> 1.21473 +function test_zero_dimensions_imagedata() { 1.21474 + var c = document.getElementById("c685"); 1.21475 + var ctx = c.getContext("2d"); 1.21476 + ctx.fillStyle = "blue"; 1.21477 + ctx.fillRect(0, 0, 100, 100); 1.21478 + var imgdata = ctx.getImageData(0, 0, 100, 100); 1.21479 + var isTransparentBlack = true; 1.21480 + for (var i = 0; i < imgdata.data.length; ++i) 1.21481 + if (imgdata.data[i] !== 0) 1.21482 + isTransparentBlack = false; 1.21483 + ok(isTransparentBlack, "isTransparentBlack"); 1.21484 +} 1.21485 +</script> 1.21486 + 1.21487 +<p>Canvas test: getImageData_after_zero_canvas</p> 1.21488 +<canvas id="c686" width="100" height="100"></canvas> 1.21489 +<script type="text/javascript"> 1.21490 +function test_getImageData_after_zero_canvas() { 1.21491 + var c = document.getElementById("c686"); 1.21492 + var ctx = c.getContext("2d"); 1.21493 + ctx.fillStyle = "rgba(0, 0, 0, 1.0)"; 1.21494 + ctx.fillRect(0, 0, c.width, c.height); 1.21495 + var oldimgdata = ctx.getImageData(0, 0, c.width, c.height); 1.21496 + c.width = c.height = 0; 1.21497 + c.width = c.height = 100; 1.21498 + ctx.fillRect(0, 0, c.width, c.height); 1.21499 + var imgdata = ctx.getImageData(0, 0, c.width, c.height); 1.21500 + var same = false; 1.21501 + ok(imgdata.data.length === oldimgdata.data.length, "not the same length"); 1.21502 + for (var i = 0; i < imgdata.data.length; ++i) 1.21503 + same = imgdata.data[i] === oldimgdata.data[i]; 1.21504 + ok(same, "changing dimensions broke canvas"); 1.21505 +} 1.21506 +</script> 1.21507 + 1.21508 +<p>Canvas test: zero_dimensions_image_data</p> 1.21509 +<canvas id="c687" width="150" height="50"></canvas> 1.21510 +<script type="text/javascript"> 1.21511 + 1.21512 +function test_linedash() { 1.21513 + var c = document.getElementById("c687"); 1.21514 + var ctx = c.getContext("2d"); 1.21515 + ok(ctx.lineDashOffset==0, "initial dash offset is not 0"); 1.21516 + 1.21517 + ctx.setLineDash([15, 10]); 1.21518 + ctx.lineDashOffset = 5; 1.21519 + ctx.strokeRect (10,10,100,100); 1.21520 + 1.21521 + var lineDash = ctx.getLineDash(); 1.21522 + ok(lineDash[0]==15&&lineDash[1]==10, "dash pattern [15, 10] is wrong"); 1.21523 + ok(ctx.lineDashOffset==5, "dash offset is wrong"); 1.21524 + 1.21525 + ctx.setLineDash([5, 10, 15]); 1.21526 + ctx.strokeRect(20, 20, 120, 120); 1.21527 + lineDash = ctx.getLineDash(); 1.21528 + ok(lineDash[0]==5 1.21529 + && lineDash[1]==10 1.21530 + && lineDash[2]==15 1.21531 + && lineDash[3]==5 1.21532 + && lineDash[4]==10 1.21533 + && lineDash[5]==15, "dash pattern [5, 10, 15] is wrong"); 1.21534 + 1.21535 + ctx.setLineDash(["1", 2]); 1.21536 + lineDash = ctx.getLineDash(); 1.21537 + ok(lineDash[0] == 1 && lineDash[1] == 2, "dash pattern ['1', 2] is wrong"); 1.21538 + 1.21539 + ctx.clearRect(0, 0, 700, 700); 1.21540 + ok(ctx.lineDashOffset==5, "dash offset is wrong"); 1.21541 + 1.21542 + ctx.setLineDash([20, 10]); 1.21543 + ctx.lineDashOffset = 0; 1.21544 + ctx.lineWidth = 4; // To make the test immune to plaform anti-aliasing discrepancies 1.21545 + ctx.strokeStyle = '#00FF00'; 1.21546 + ctx.strokeRect(10.5, 10.5, 30, 30); 1.21547 + 1.21548 + isPixel(ctx, 25, 10, 0, 255, 0, 255, 0); 1.21549 + isPixel(ctx, 35, 10, 0, 0, 0, 0, 0); 1.21550 + isPixel(ctx, 40, 25, 0, 255, 0, 255, 0); 1.21551 + isPixel(ctx, 40, 35, 0, 0, 0, 0, 0); 1.21552 + isPixel(ctx, 25, 40, 0, 255, 0, 255, 0); 1.21553 + isPixel(ctx, 15, 40, 0, 0, 0, 0, 0); 1.21554 + isPixel(ctx, 10, 25, 0, 255, 0, 255, 0); 1.21555 + isPixel(ctx, 10, 15, 0, 0, 0, 0, 0); 1.21556 + 1.21557 + // Verify that lineDashOffset works as expected 1.21558 + ctx.lineDashOffset = 20; 1.21559 + ctx.strokeRect(50.5, 10.5, 30, 30); 1.21560 + isPixel(ctx, 55, 10, 0, 0, 0, 0, 0); 1.21561 + isPixel(ctx, 65, 10, 0, 255, 0, 255, 0); 1.21562 + isPixel(ctx, 80, 15, 0, 0, 0, 0, 0); 1.21563 + isPixel(ctx, 80, 25, 0, 255, 0, 255, 0); 1.21564 + isPixel(ctx, 75, 40, 0, 0, 0, 0, 0); 1.21565 + isPixel(ctx, 65, 40, 0, 255, 0, 255, 0); 1.21566 + isPixel(ctx, 50, 35, 0, 0, 0, 0, 0); 1.21567 + isPixel(ctx, 50, 25, 0, 255, 0, 255, 0); 1.21568 + 1.21569 + // Verify negative lineDashOffset 1.21570 + ctx.lineDashOffset = -10; 1.21571 + ctx.strokeRect(90.5, 10.5, 30, 30); 1.21572 + isPixel(ctx, 95, 10, 0, 0, 0, 0, 0); 1.21573 + isPixel(ctx, 105, 10, 0, 255, 0, 255, 0); 1.21574 + isPixel(ctx, 120, 15, 0, 0, 0, 0, 0); 1.21575 + isPixel(ctx, 120, 25, 0, 255, 0, 255, 0); 1.21576 + isPixel(ctx, 115, 40, 0, 0, 0, 0, 0); 1.21577 + isPixel(ctx, 105, 40, 0, 255, 0, 255, 0); 1.21578 + isPixel(ctx, 90, 35, 0, 0, 0, 0, 0); 1.21579 + isPixel(ctx, 90, 25, 0, 255, 0, 255, 0); 1.21580 +} 1.21581 +</script> 1.21582 + 1.21583 +<p>Canvas test: test_opaque</p> 1.21584 +<canvas id="c688" width="150" height="50"></canvas> 1.21585 +<script type="text/javascript"> 1.21586 + 1.21587 +function test_opaque() { 1.21588 + var c = document.getElementById("c688"); 1.21589 + var ctx = c.getContext("2d", {alpha: false}); 1.21590 + ctx.fillStyle = "green"; 1.21591 + ctx.fillRect(0,0,10,10); 1.21592 + ctx.fillStyle = "rgba(255,0,0,.5)"; 1.21593 + ctx.fillRect(10,0,10,10); 1.21594 + 1.21595 + isPixel(ctx, 20, 20, 0, 0, 0, 255, 0); 1.21596 + isPixel(ctx, 5, 5, 0, 128, 0, 255, 0); 1.21597 + isPixel(ctx, 15, 5, 128, 0, 0, 255, 0); 1.21598 +} 1.21599 +</script> 1.21600 + 1.21601 +<script> 1.21602 + 1.21603 +function asyncTestsDone() { 1.21604 + if (isDone_test_2d_drawImage_animated_apng && 1.21605 + isDone_test_2d_drawImage_animated_gif) { 1.21606 + SimpleTest.finish(); 1.21607 + } else { 1.21608 + setTimeout(asyncTestsDone, 500); 1.21609 + } 1.21610 + } 1.21611 + 1.21612 +function runTests() { 1.21613 +/** 1.21614 + * xor and lighter aren't well handled by cairo; they mostly work, but we don't want 1.21615 + * to test that 1.21616 + */ 1.21617 + //test_2d_composite_solid_lighter(); 1.21618 + //test_2d_composite_transparent_xor(); 1.21619 + //test_2d_composite_solid_xor(); 1.21620 + //test_2d_composite_transparent_lighter(); 1.21621 + //test_2d_composite_image_xor(); 1.21622 + //test_2d_composite_image_lighter(); 1.21623 + //test_2d_composite_canvas_xor(); 1.21624 + //test_2d_composite_canvas_lighter(); 1.21625 + //test_2d_composite_clip_xor(); 1.21626 + //test_2d_composite_clip_lighter(); 1.21627 + 1.21628 +/** 1.21629 + * Temporarily disabled tests; unbounded operators changed behaviour, need to reevaluate tests 1.21630 + */ 1.21631 + //test_2d_composite_canvas_destination_atop(); 1.21632 + //test_2d_composite_canvas_destination_in(); 1.21633 + //test_2d_composite_canvas_source_in(); 1.21634 + //test_2d_composite_canvas_source_out(); 1.21635 + //test_2d_composite_image_destination_atop(); 1.21636 + //test_2d_composite_image_destination_in(); 1.21637 + //test_2d_composite_image_source_in(); 1.21638 + //test_2d_composite_image_source_out(); 1.21639 + 1.21640 + /** 1.21641 + * These tests only pass on Mac OS X >= 10.5; see bug 450114 1.21642 + */ 1.21643 + //test_2d_gradient_radial_equal(); 1.21644 + //test_2d_gradient_radial_touch1(); 1.21645 + //test_2d_gradient_radial_touch2(); 1.21646 + //test_2d_gradient_radial_touch3(); 1.21647 + 1.21648 + /** 1.21649 + * These 19 tests receive special makefile treatment 1.21650 + */ 1.21651 + //test_2d_composite_uncovered_image_destination_atop(); 1.21652 + //test_2d_composite_uncovered_image_destination_in(); 1.21653 + //test_2d_composite_uncovered_image_source_in(); 1.21654 + //test_2d_composite_uncovered_image_source_out(); 1.21655 + //test_2d_gradient_radial_cone_behind(); 1.21656 + //test_2d_gradient_radial_cone_beside(); 1.21657 + //test_2d_gradient_radial_cone_front(); 1.21658 + //test_2d_gradient_radial_cone_shape2(); 1.21659 + //test_2d_gradient_radial_cone_top(); 1.21660 + //test_2d_gradient_radial_inside2(); 1.21661 + //test_2d_gradient_radial_inside3(); 1.21662 + //test_2d_gradient_radial_outside1(); 1.21663 + //test_2d_gradient_radial_outside2(); 1.21664 + //test_2d_gradient_radial_outside3(); 1.21665 + //test_2d_line_cap_closed(); 1.21666 + //test_2d_line_join_parallel(); 1.21667 + //test_2d_path_arc_shape_3(); 1.21668 + //test_2d_path_rect_selfintersect(); 1.21669 + //test_2d_strokeRect_zero_5(); 1.21670 + 1.21671 + /** 1.21672 + * Other tests not being run 1.21673 + */ 1.21674 + //test_2d_composite_uncovered_fill_destination_atop(); 1.21675 + //test_2d_composite_uncovered_fill_destination_in(); 1.21676 + //test_2d_composite_uncovered_fill_source_in(); 1.21677 + //test_2d_composite_uncovered_fill_source_out(); 1.21678 + //test_2d_composite_uncovered_pattern_destination_atop(); 1.21679 + //test_2d_composite_uncovered_pattern_destination_in(); 1.21680 + //test_2d_composite_uncovered_pattern_source_in(); 1.21681 + //test_2d_composite_uncovered_pattern_source_out(); 1.21682 + 1.21683 + //test_2d_path_rect_zero_6(); // This test is bogus according to the spec; see bug 407107 1.21684 + 1.21685 + // These tests are bogus according to the spec: shadows should not be 1.21686 + // drawn if shadowBlur, shadowOffsetX, and shadowOffsetY are all zero, whic 1.21687 + // they are in these tests 1.21688 + //test_2d_shadow_composite_3(); 1.21689 + //test_2d_shadow_composite_4(); 1.21690 + try { 1.21691 + test_2d_canvas_readonly(); 1.21692 + } catch (e) { 1.21693 + ok(false, "unexpected exception thrown in: test_2d_canvas_readonly"); 1.21694 + } 1.21695 + try { 1.21696 + test_2d_canvas_reference(); 1.21697 + } catch (e) { 1.21698 + ok(false, "unexpected exception thrown in: test_2d_canvas_reference"); 1.21699 + } 1.21700 + try { 1.21701 + test_2d_clearRect_basic(); 1.21702 + } catch (e) { 1.21703 + ok(false, "unexpected exception thrown in: test_2d_clearRect_basic"); 1.21704 + } 1.21705 + try { 1.21706 + test_2d_clearRect_clip(); 1.21707 + } catch (e) { 1.21708 + ok(false, "unexpected exception thrown in: test_2d_clearRect_clip"); 1.21709 + } 1.21710 + try { 1.21711 + test_2d_clearRect_globalalpha(); 1.21712 + } catch (e) { 1.21713 + ok(false, "unexpected exception thrown in: test_2d_clearRect_globalalpha"); 1.21714 + } 1.21715 + try { 1.21716 + test_2d_clearRect_globalcomposite(); 1.21717 + } catch (e) { 1.21718 + ok(false, "unexpected exception thrown in: test_2d_clearRect_globalcomposite"); 1.21719 + } 1.21720 + try { 1.21721 + test_2d_clearRect_negative(); 1.21722 + } catch (e) { 1.21723 + ok(false, "unexpected exception thrown in: test_2d_clearRect_negative"); 1.21724 + } 1.21725 + try { 1.21726 + test_2d_clearRect_nonfinite(); 1.21727 + } catch (e) { 1.21728 + ok(false, "unexpected exception thrown in: test_2d_clearRect_nonfinite"); 1.21729 + } 1.21730 + try { 1.21731 + test_2d_clearRect_path(); 1.21732 + } catch (e) { 1.21733 + ok(false, "unexpected exception thrown in: test_2d_clearRect_path"); 1.21734 + } 1.21735 + try { 1.21736 + test_2d_clearRect_shadow(); 1.21737 + } catch (e) { 1.21738 + ok(false, "unexpected exception thrown in: test_2d_clearRect_shadow"); 1.21739 + } 1.21740 + try { 1.21741 + test_2d_clearRect_transform(); 1.21742 + } catch (e) { 1.21743 + ok(false, "unexpected exception thrown in: test_2d_clearRect_transform"); 1.21744 + } 1.21745 + try { 1.21746 + test_2d_clearRect_zero(); 1.21747 + } catch (e) { 1.21748 + ok(false, "unexpected exception thrown in: test_2d_clearRect_zero"); 1.21749 + } 1.21750 + try { 1.21751 + test_2d_composite_canvas_copy(); 1.21752 + } catch (e) { 1.21753 + ok(false, "unexpected exception thrown in: test_2d_composite_canvas_copy"); 1.21754 + } 1.21755 + try { 1.21756 + test_2d_composite_canvas_destination_out(); 1.21757 + } catch (e) { 1.21758 + ok(false, "unexpected exception thrown in: test_2d_composite_canvas_destination_out"); 1.21759 + } 1.21760 + try { 1.21761 + test_2d_composite_canvas_destination_over(); 1.21762 + } catch (e) { 1.21763 + ok(false, "unexpected exception thrown in: test_2d_composite_canvas_destination_over"); 1.21764 + } 1.21765 + try { 1.21766 + test_2d_composite_canvas_source_atop(); 1.21767 + } catch (e) { 1.21768 + ok(false, "unexpected exception thrown in: test_2d_composite_canvas_source_atop"); 1.21769 + } 1.21770 + try { 1.21771 + test_2d_composite_canvas_source_over(); 1.21772 + } catch (e) { 1.21773 + ok(false, "unexpected exception thrown in: test_2d_composite_canvas_source_over"); 1.21774 + } 1.21775 + try { 1.21776 + test_2d_composite_clip_copy(); 1.21777 + } catch (e) { 1.21778 + ok(false, "unexpected exception thrown in: test_2d_composite_clip_copy"); 1.21779 + } 1.21780 + try { 1.21781 + test_2d_composite_clip_destination_atop(); 1.21782 + } catch (e) { 1.21783 + ok(false, "unexpected exception thrown in: test_2d_composite_clip_destination_atop"); 1.21784 + } 1.21785 + try { 1.21786 + test_2d_composite_clip_destination_in(); 1.21787 + } catch (e) { 1.21788 + ok(false, "unexpected exception thrown in: test_2d_composite_clip_destination_in"); 1.21789 + } 1.21790 + try { 1.21791 + test_2d_composite_clip_destination_out(); 1.21792 + } catch (e) { 1.21793 + ok(false, "unexpected exception thrown in: test_2d_composite_clip_destination_out"); 1.21794 + } 1.21795 + try { 1.21796 + test_2d_composite_clip_destination_over(); 1.21797 + } catch (e) { 1.21798 + ok(false, "unexpected exception thrown in: test_2d_composite_clip_destination_over"); 1.21799 + } 1.21800 + try { 1.21801 + test_2d_composite_clip_source_atop(); 1.21802 + } catch (e) { 1.21803 + ok(false, "unexpected exception thrown in: test_2d_composite_clip_source_atop"); 1.21804 + } 1.21805 + try { 1.21806 + test_2d_composite_clip_source_in(); 1.21807 + } catch (e) { 1.21808 + ok(false, "unexpected exception thrown in: test_2d_composite_clip_source_in"); 1.21809 + } 1.21810 + try { 1.21811 + test_2d_composite_clip_source_out(); 1.21812 + } catch (e) { 1.21813 + ok(false, "unexpected exception thrown in: test_2d_composite_clip_source_out"); 1.21814 + } 1.21815 + try { 1.21816 + test_2d_composite_clip_source_over(); 1.21817 + } catch (e) { 1.21818 + ok(false, "unexpected exception thrown in: test_2d_composite_clip_source_over"); 1.21819 + } 1.21820 + try { 1.21821 + test_2d_composite_globalAlpha_canvas(); 1.21822 + } catch (e) { 1.21823 + ok(false, "unexpected exception thrown in: test_2d_composite_globalAlpha_canvas"); 1.21824 + } 1.21825 + try { 1.21826 + test_2d_composite_globalAlpha_canvaspattern(); 1.21827 + } catch (e) { 1.21828 + ok(false, "unexpected exception thrown in: test_2d_composite_globalAlpha_canvaspattern"); 1.21829 + } 1.21830 + try { 1.21831 + test_2d_composite_globalAlpha_default(); 1.21832 + } catch (e) { 1.21833 + ok(false, "unexpected exception thrown in: test_2d_composite_globalAlpha_default"); 1.21834 + } 1.21835 + try { 1.21836 + test_2d_composite_globalAlpha_fill(); 1.21837 + } catch (e) { 1.21838 + ok(false, "unexpected exception thrown in: test_2d_composite_globalAlpha_fill"); 1.21839 + } 1.21840 + try { 1.21841 + test_2d_composite_globalAlpha_image(); 1.21842 + } catch (e) { 1.21843 + ok(false, "unexpected exception thrown in: test_2d_composite_globalAlpha_image"); 1.21844 + } 1.21845 + try { 1.21846 + test_2d_composite_globalAlpha_imagepattern(); 1.21847 + } catch (e) { 1.21848 + ok(false, "unexpected exception thrown in: test_2d_composite_globalAlpha_imagepattern"); 1.21849 + } 1.21850 + try { 1.21851 + test_2d_composite_globalAlpha_invalid(); 1.21852 + } catch (e) { 1.21853 + ok(false, "unexpected exception thrown in: test_2d_composite_globalAlpha_invalid"); 1.21854 + } 1.21855 + try { 1.21856 + test_2d_composite_globalAlpha_range(); 1.21857 + } catch (e) { 1.21858 + ok(false, "unexpected exception thrown in: test_2d_composite_globalAlpha_range"); 1.21859 + } 1.21860 + try { 1.21861 + test_2d_composite_image_copy(); 1.21862 + } catch (e) { 1.21863 + ok(false, "unexpected exception thrown in: test_2d_composite_image_copy"); 1.21864 + } 1.21865 + try { 1.21866 + test_2d_composite_image_destination_out(); 1.21867 + } catch (e) { 1.21868 + ok(false, "unexpected exception thrown in: test_2d_composite_image_destination_out"); 1.21869 + } 1.21870 + try { 1.21871 + test_2d_composite_image_destination_over(); 1.21872 + } catch (e) { 1.21873 + ok(false, "unexpected exception thrown in: test_2d_composite_image_destination_over"); 1.21874 + } 1.21875 + try { 1.21876 + test_2d_composite_image_source_atop(); 1.21877 + } catch (e) { 1.21878 + ok(false, "unexpected exception thrown in: test_2d_composite_image_source_atop"); 1.21879 + } 1.21880 + try { 1.21881 + test_2d_composite_image_source_over(); 1.21882 + } catch (e) { 1.21883 + ok(false, "unexpected exception thrown in: test_2d_composite_image_source_over"); 1.21884 + } 1.21885 + try { 1.21886 + test_2d_composite_operation_casesensitive(); 1.21887 + } catch (e) { 1.21888 + ok(false, "unexpected exception thrown in: test_2d_composite_operation_casesensitive"); 1.21889 + } 1.21890 + try { 1.21891 + test_2d_composite_operation_clear(); 1.21892 + } catch (e) { 1.21893 + ok(false, "unexpected exception thrown in: test_2d_composite_operation_clear"); 1.21894 + } 1.21895 + try { 1.21896 + test_2d_composite_operation_darker(); 1.21897 + } catch (e) { 1.21898 + ok(false, "unexpected exception thrown in: test_2d_composite_operation_darker"); 1.21899 + } 1.21900 + try { 1.21901 + test_2d_composite_operation_default(); 1.21902 + } catch (e) { 1.21903 + ok(false, "unexpected exception thrown in: test_2d_composite_operation_default"); 1.21904 + } 1.21905 + try { 1.21906 + test_2d_composite_operation_get(); 1.21907 + } catch (e) { 1.21908 + ok(false, "unexpected exception thrown in: test_2d_composite_operation_get"); 1.21909 + } 1.21910 + try { 1.21911 + test_2d_composite_operation_highlight(); 1.21912 + } catch (e) { 1.21913 + ok(false, "unexpected exception thrown in: test_2d_composite_operation_highlight"); 1.21914 + } 1.21915 + try { 1.21916 + test_2d_composite_operation_nullsuffix(); 1.21917 + } catch (e) { 1.21918 + ok(false, "unexpected exception thrown in: test_2d_composite_operation_nullsuffix"); 1.21919 + } 1.21920 + try { 1.21921 + test_2d_composite_operation_over(); 1.21922 + } catch (e) { 1.21923 + ok(false, "unexpected exception thrown in: test_2d_composite_operation_over"); 1.21924 + } 1.21925 + try { 1.21926 + test_2d_composite_operation_unrecognised(); 1.21927 + } catch (e) { 1.21928 + ok(false, "unexpected exception thrown in: test_2d_composite_operation_unrecognised"); 1.21929 + } 1.21930 + try { 1.21931 + test_2d_composite_solid_copy(); 1.21932 + } catch (e) { 1.21933 + ok(false, "unexpected exception thrown in: test_2d_composite_solid_copy"); 1.21934 + } 1.21935 + try { 1.21936 + test_2d_composite_solid_destination_atop(); 1.21937 + } catch (e) { 1.21938 + ok(false, "unexpected exception thrown in: test_2d_composite_solid_destination_atop"); 1.21939 + } 1.21940 + try { 1.21941 + test_2d_composite_solid_destination_in(); 1.21942 + } catch (e) { 1.21943 + ok(false, "unexpected exception thrown in: test_2d_composite_solid_destination_in"); 1.21944 + } 1.21945 + try { 1.21946 + test_2d_composite_solid_destination_out(); 1.21947 + } catch (e) { 1.21948 + ok(false, "unexpected exception thrown in: test_2d_composite_solid_destination_out"); 1.21949 + } 1.21950 + try { 1.21951 + test_2d_composite_solid_destination_over(); 1.21952 + } catch (e) { 1.21953 + ok(false, "unexpected exception thrown in: test_2d_composite_solid_destination_over"); 1.21954 + } 1.21955 + try { 1.21956 + test_2d_composite_solid_source_atop(); 1.21957 + } catch (e) { 1.21958 + ok(false, "unexpected exception thrown in: test_2d_composite_solid_source_atop"); 1.21959 + } 1.21960 + try { 1.21961 + test_2d_composite_solid_source_in(); 1.21962 + } catch (e) { 1.21963 + ok(false, "unexpected exception thrown in: test_2d_composite_solid_source_in"); 1.21964 + } 1.21965 + try { 1.21966 + test_2d_composite_solid_source_out(); 1.21967 + } catch (e) { 1.21968 + ok(false, "unexpected exception thrown in: test_2d_composite_solid_source_out"); 1.21969 + } 1.21970 + try { 1.21971 + test_2d_composite_solid_source_over(); 1.21972 + } catch (e) { 1.21973 + ok(false, "unexpected exception thrown in: test_2d_composite_solid_source_over"); 1.21974 + } 1.21975 + try { 1.21976 + test_2d_composite_transparent_copy(); 1.21977 + } catch (e) { 1.21978 + ok(false, "unexpected exception thrown in: test_2d_composite_transparent_copy"); 1.21979 + } 1.21980 + try { 1.21981 + test_2d_composite_transparent_destination_atop(); 1.21982 + } catch (e) { 1.21983 + ok(false, "unexpected exception thrown in: test_2d_composite_transparent_destination_atop"); 1.21984 + } 1.21985 + try { 1.21986 + test_2d_composite_transparent_destination_in(); 1.21987 + } catch (e) { 1.21988 + ok(false, "unexpected exception thrown in: test_2d_composite_transparent_destination_in"); 1.21989 + } 1.21990 + try { 1.21991 + test_2d_composite_transparent_destination_out(); 1.21992 + } catch (e) { 1.21993 + ok(false, "unexpected exception thrown in: test_2d_composite_transparent_destination_out"); 1.21994 + } 1.21995 + try { 1.21996 + test_2d_composite_transparent_destination_over(); 1.21997 + } catch (e) { 1.21998 + ok(false, "unexpected exception thrown in: test_2d_composite_transparent_destination_over"); 1.21999 + } 1.22000 + try { 1.22001 + test_2d_composite_transparent_source_atop(); 1.22002 + } catch (e) { 1.22003 + ok(false, "unexpected exception thrown in: test_2d_composite_transparent_source_atop"); 1.22004 + } 1.22005 + try { 1.22006 + test_2d_composite_transparent_source_in(); 1.22007 + } catch (e) { 1.22008 + ok(false, "unexpected exception thrown in: test_2d_composite_transparent_source_in"); 1.22009 + } 1.22010 + try { 1.22011 + test_2d_composite_transparent_source_out(); 1.22012 + } catch (e) { 1.22013 + ok(false, "unexpected exception thrown in: test_2d_composite_transparent_source_out"); 1.22014 + } 1.22015 + try { 1.22016 + test_2d_composite_transparent_source_over(); 1.22017 + } catch (e) { 1.22018 + ok(false, "unexpected exception thrown in: test_2d_composite_transparent_source_over"); 1.22019 + } 1.22020 + try { 1.22021 + test_2d_composite_uncovered_fill_copy(); 1.22022 + } catch (e) { 1.22023 + ok(false, "unexpected exception thrown in: test_2d_composite_uncovered_fill_copy"); 1.22024 + } 1.22025 + try { 1.22026 + test_2d_composite_uncovered_image_copy(); 1.22027 + } catch (e) { 1.22028 + ok(false, "unexpected exception thrown in: test_2d_composite_uncovered_image_copy"); 1.22029 + } 1.22030 + try { 1.22031 + test_2d_composite_uncovered_pattern_copy(); 1.22032 + } catch (e) { 1.22033 + ok(false, "unexpected exception thrown in: test_2d_composite_uncovered_pattern_copy"); 1.22034 + } 1.22035 + try { 1.22036 + test_2d_drawImage_3arg(); 1.22037 + } catch (e) { 1.22038 + ok(false, "unexpected exception thrown in: test_2d_drawImage_3arg"); 1.22039 + } 1.22040 + try { 1.22041 + test_2d_drawImage_5arg(); 1.22042 + } catch (e) { 1.22043 + ok(false, "unexpected exception thrown in: test_2d_drawImage_5arg"); 1.22044 + } 1.22045 + try { 1.22046 + test_2d_drawImage_9arg_basic(); 1.22047 + } catch (e) { 1.22048 + ok(false, "unexpected exception thrown in: test_2d_drawImage_9arg_basic"); 1.22049 + } 1.22050 + try { 1.22051 + test_2d_drawImage_9arg_destpos(); 1.22052 + } catch (e) { 1.22053 + ok(false, "unexpected exception thrown in: test_2d_drawImage_9arg_destpos"); 1.22054 + } 1.22055 + try { 1.22056 + test_2d_drawImage_9arg_destsize(); 1.22057 + } catch (e) { 1.22058 + ok(false, "unexpected exception thrown in: test_2d_drawImage_9arg_destsize"); 1.22059 + } 1.22060 + try { 1.22061 + test_2d_drawImage_9arg_sourcepos(); 1.22062 + } catch (e) { 1.22063 + ok(false, "unexpected exception thrown in: test_2d_drawImage_9arg_sourcepos"); 1.22064 + } 1.22065 + try { 1.22066 + test_2d_drawImage_9arg_sourcesize(); 1.22067 + } catch (e) { 1.22068 + ok(false, "unexpected exception thrown in: test_2d_drawImage_9arg_sourcesize"); 1.22069 + } 1.22070 + try { 1.22071 + test_2d_drawImage_alpha(); 1.22072 + } catch (e) { 1.22073 + ok(false, "unexpected exception thrown in: test_2d_drawImage_alpha"); 1.22074 + } 1.22075 + try { 1.22076 + test_2d_drawImage_animated_poster(); 1.22077 + } catch (e) { 1.22078 + ok(false, "unexpected exception thrown in: test_2d_drawImage_animated_poster"); 1.22079 + } 1.22080 + try { 1.22081 + test_2d_drawImage_broken(); 1.22082 + } catch (e) { 1.22083 + ok(false, "unexpected exception thrown in: test_2d_drawImage_broken"); 1.22084 + } 1.22085 + try { 1.22086 + test_2d_drawImage_canvas(); 1.22087 + } catch (e) { 1.22088 + ok(false, "unexpected exception thrown in: test_2d_drawImage_canvas"); 1.22089 + } 1.22090 + try { 1.22091 + test_2d_drawImage_clip(); 1.22092 + } catch (e) { 1.22093 + ok(false, "unexpected exception thrown in: test_2d_drawImage_clip"); 1.22094 + } 1.22095 + try { 1.22096 + test_2d_drawImage_composite(); 1.22097 + } catch (e) { 1.22098 + ok(false, "unexpected exception thrown in: test_2d_drawImage_composite"); 1.22099 + } 1.22100 + try { 1.22101 + test_2d_drawImage_floatsource(); 1.22102 + } catch (e) { 1.22103 + ok(false, "unexpected exception thrown in: test_2d_drawImage_floatsource"); 1.22104 + } 1.22105 + try { 1.22106 + test_2d_drawImage_incomplete(); 1.22107 + } catch (e) { 1.22108 + ok(false, "unexpected exception thrown in: test_2d_drawImage_incomplete"); 1.22109 + } 1.22110 + try { 1.22111 + test_2d_drawImage_negativedest(); 1.22112 + } catch (e) { 1.22113 + ok(false, "unexpected exception thrown in: test_2d_drawImage_negativedest"); 1.22114 + } 1.22115 + try { 1.22116 + test_2d_drawImage_negativesource(); 1.22117 + } catch (e) { 1.22118 + ok(false, "unexpected exception thrown in: test_2d_drawImage_negativesource"); 1.22119 + } 1.22120 + try { 1.22121 + test_2d_drawImage_nonfinite(); 1.22122 + } catch (e) { 1.22123 + ok(false, "unexpected exception thrown in: test_2d_drawImage_nonfinite"); 1.22124 + } 1.22125 + try { 1.22126 + test_2d_drawImage_nowrap(); 1.22127 + } catch (e) { 1.22128 + ok(false, "unexpected exception thrown in: test_2d_drawImage_nowrap"); 1.22129 + } 1.22130 + try { 1.22131 + test_2d_drawImage_null(); 1.22132 + } catch (e) { 1.22133 + ok(false, "unexpected exception thrown in: test_2d_drawImage_null"); 1.22134 + } 1.22135 + try { 1.22136 + test_2d_drawImage_outsidesource(); 1.22137 + } catch (e) { 1.22138 + ok(false, "unexpected exception thrown in: test_2d_drawImage_outsidesource"); 1.22139 + } 1.22140 + try { 1.22141 + test_2d_drawImage_path(); 1.22142 + } catch (e) { 1.22143 + ok(false, "unexpected exception thrown in: test_2d_drawImage_path"); 1.22144 + } 1.22145 + try { 1.22146 + test_2d_drawImage_self_1(); 1.22147 + } catch (e) { 1.22148 + ok(false, "unexpected exception thrown in: test_2d_drawImage_self_1"); 1.22149 + } 1.22150 + try { 1.22151 + test_2d_drawImage_self_2(); 1.22152 + } catch (e) { 1.22153 + ok(false, "unexpected exception thrown in: test_2d_drawImage_self_2"); 1.22154 + } 1.22155 + try { 1.22156 + test_2d_drawImage_transform(); 1.22157 + } catch (e) { 1.22158 + ok(false, "unexpected exception thrown in: test_2d_drawImage_transform"); 1.22159 + } 1.22160 + try { 1.22161 + test_2d_drawImage_wrongtype(); 1.22162 + } catch (e) { 1.22163 + ok(false, "unexpected exception thrown in: test_2d_drawImage_wrongtype"); 1.22164 + } 1.22165 + try { 1.22166 + test_2d_drawImage_zerosource(); 1.22167 + } catch (e) { 1.22168 + ok(false, "unexpected exception thrown in: test_2d_drawImage_zerosource"); 1.22169 + } 1.22170 + try { 1.22171 + test_2d_fillRect_basic(); 1.22172 + } catch (e) { 1.22173 + ok(false, "unexpected exception thrown in: test_2d_fillRect_basic"); 1.22174 + } 1.22175 + try { 1.22176 + test_2d_fillRect_clip(); 1.22177 + } catch (e) { 1.22178 + ok(false, "unexpected exception thrown in: test_2d_fillRect_clip"); 1.22179 + } 1.22180 + try { 1.22181 + test_2d_fillRect_negative(); 1.22182 + } catch (e) { 1.22183 + ok(false, "unexpected exception thrown in: test_2d_fillRect_negative"); 1.22184 + } 1.22185 + try { 1.22186 + test_2d_fillRect_nonfinite(); 1.22187 + } catch (e) { 1.22188 + ok(false, "unexpected exception thrown in: test_2d_fillRect_nonfinite"); 1.22189 + } 1.22190 + try { 1.22191 + test_2d_fillRect_path(); 1.22192 + } catch (e) { 1.22193 + ok(false, "unexpected exception thrown in: test_2d_fillRect_path"); 1.22194 + } 1.22195 + try { 1.22196 + test_2d_fillRect_shadow(); 1.22197 + } catch (e) { 1.22198 + ok(false, "unexpected exception thrown in: test_2d_fillRect_shadow"); 1.22199 + } 1.22200 + try { 1.22201 + test_2d_fillRect_transform(); 1.22202 + } catch (e) { 1.22203 + ok(false, "unexpected exception thrown in: test_2d_fillRect_transform"); 1.22204 + } 1.22205 + try { 1.22206 + test_2d_fillRect_zero(); 1.22207 + } catch (e) { 1.22208 + ok(false, "unexpected exception thrown in: test_2d_fillRect_zero"); 1.22209 + } 1.22210 + try { 1.22211 + test_2d_fillStyle_default(); 1.22212 + } catch (e) { 1.22213 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_default"); 1.22214 + } 1.22215 + try { 1.22216 + test_2d_fillStyle_get_semitransparent(); 1.22217 + } catch (e) { 1.22218 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_get_semitransparent"); 1.22219 + } 1.22220 + try { 1.22221 + test_2d_fillStyle_get_solid(); 1.22222 + } catch (e) { 1.22223 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_get_solid"); 1.22224 + } 1.22225 + try { 1.22226 + test_2d_fillStyle_get_transparent(); 1.22227 + } catch (e) { 1.22228 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_get_transparent"); 1.22229 + } 1.22230 + try { 1.22231 + test_2d_fillStyle_invalidstring(); 1.22232 + } catch (e) { 1.22233 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_invalidstring"); 1.22234 + } 1.22235 + try { 1.22236 + test_2d_fillStyle_invalidtype(); 1.22237 + } catch (e) { 1.22238 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_invalidtype"); 1.22239 + } 1.22240 + try { 1.22241 + test_2d_fillStyle_parse_current_basic(); 1.22242 + } catch (e) { 1.22243 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_current_basic"); 1.22244 + } 1.22245 + try { 1.22246 + test_2d_fillStyle_parse_current_changed(); 1.22247 + } catch (e) { 1.22248 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_current_changed"); 1.22249 + } 1.22250 + try { 1.22251 + test_2d_fillStyle_parse_current_removed(); 1.22252 + } catch (e) { 1.22253 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_current_removed"); 1.22254 + } 1.22255 + try { 1.22256 + test_2d_fillStyle_parse_hex3(); 1.22257 + } catch (e) { 1.22258 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hex3"); 1.22259 + } 1.22260 + try { 1.22261 + test_2d_fillStyle_parse_hex6(); 1.22262 + } catch (e) { 1.22263 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hex6"); 1.22264 + } 1.22265 + try { 1.22266 + test_2d_fillStyle_parse_hsl_1(); 1.22267 + } catch (e) { 1.22268 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hsl_1"); 1.22269 + } 1.22270 + try { 1.22271 + test_2d_fillStyle_parse_hsl_2(); 1.22272 + } catch (e) { 1.22273 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hsl_2"); 1.22274 + } 1.22275 + try { 1.22276 + test_2d_fillStyle_parse_hsl_3(); 1.22277 + } catch (e) { 1.22278 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hsl_3"); 1.22279 + } 1.22280 + try { 1.22281 + test_2d_fillStyle_parse_hsl_4(); 1.22282 + } catch (e) { 1.22283 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hsl_4"); 1.22284 + } 1.22285 + try { 1.22286 + test_2d_fillStyle_parse_hsl_5(); 1.22287 + } catch (e) { 1.22288 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hsl_5"); 1.22289 + } 1.22290 + try { 1.22291 + test_2d_fillStyle_parse_hsl_clamp_1(); 1.22292 + } catch (e) { 1.22293 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hsl_clamp_1"); 1.22294 + } 1.22295 + try { 1.22296 + test_2d_fillStyle_parse_hsl_clamp_2(); 1.22297 + } catch (e) { 1.22298 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hsl_clamp_2"); 1.22299 + } 1.22300 + try { 1.22301 + test_2d_fillStyle_parse_hsl_clamp_3(); 1.22302 + } catch (e) { 1.22303 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hsl_clamp_3"); 1.22304 + } 1.22305 + try { 1.22306 + test_2d_fillStyle_parse_hsl_clamp_4(); 1.22307 + } catch (e) { 1.22308 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hsl_clamp_4"); 1.22309 + } 1.22310 + try { 1.22311 + test_2d_fillStyle_parse_hsla_1(); 1.22312 + } catch (e) { 1.22313 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hsla_1"); 1.22314 + } 1.22315 + try { 1.22316 + test_2d_fillStyle_parse_hsla_2(); 1.22317 + } catch (e) { 1.22318 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hsla_2"); 1.22319 + } 1.22320 + try { 1.22321 + test_2d_fillStyle_parse_hsla_clamp_1(); 1.22322 + } catch (e) { 1.22323 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hsla_clamp_1"); 1.22324 + } 1.22325 + try { 1.22326 + test_2d_fillStyle_parse_hsla_clamp_2(); 1.22327 + } catch (e) { 1.22328 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hsla_clamp_2"); 1.22329 + } 1.22330 + try { 1.22331 + test_2d_fillStyle_parse_hsla_clamp_3(); 1.22332 + } catch (e) { 1.22333 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hsla_clamp_3"); 1.22334 + } 1.22335 + try { 1.22336 + test_2d_fillStyle_parse_hsla_clamp_4(); 1.22337 + } catch (e) { 1.22338 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hsla_clamp_4"); 1.22339 + } 1.22340 + try { 1.22341 + test_2d_fillStyle_parse_hsla_clamp_5(); 1.22342 + } catch (e) { 1.22343 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hsla_clamp_5"); 1.22344 + } 1.22345 + try { 1.22346 + test_2d_fillStyle_parse_hsla_clamp_6(); 1.22347 + } catch (e) { 1.22348 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_hsla_clamp_6"); 1.22349 + } 1.22350 + try { 1.22351 + test_2d_fillStyle_parse_html4(); 1.22352 + } catch (e) { 1.22353 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_html4"); 1.22354 + } 1.22355 + try { 1.22356 + test_2d_fillStyle_parse_invalid_hex3(); 1.22357 + } catch (e) { 1.22358 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_hex3"); 1.22359 + } 1.22360 + try { 1.22361 + test_2d_fillStyle_parse_invalid_hex6(); 1.22362 + } catch (e) { 1.22363 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_hex6"); 1.22364 + } 1.22365 + try { 1.22366 + test_2d_fillStyle_parse_invalid_hsl_1(); 1.22367 + } catch (e) { 1.22368 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_hsl_1"); 1.22369 + } 1.22370 + try { 1.22371 + test_2d_fillStyle_parse_invalid_hsl_2(); 1.22372 + } catch (e) { 1.22373 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_hsl_2"); 1.22374 + } 1.22375 + try { 1.22376 + test_2d_fillStyle_parse_invalid_hsl_3(); 1.22377 + } catch (e) { 1.22378 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_hsl_3"); 1.22379 + } 1.22380 + try { 1.22381 + test_2d_fillStyle_parse_invalid_hsl_4(); 1.22382 + } catch (e) { 1.22383 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_hsl_4"); 1.22384 + } 1.22385 + try { 1.22386 + test_2d_fillStyle_parse_invalid_hsl_5(); 1.22387 + } catch (e) { 1.22388 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_hsl_5"); 1.22389 + } 1.22390 + try { 1.22391 + test_2d_fillStyle_parse_invalid_hsla_1(); 1.22392 + } catch (e) { 1.22393 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_hsla_1"); 1.22394 + } 1.22395 + try { 1.22396 + test_2d_fillStyle_parse_invalid_hsla_2(); 1.22397 + } catch (e) { 1.22398 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_hsla_2"); 1.22399 + } 1.22400 + try { 1.22401 + test_2d_fillStyle_parse_invalid_name_1() 1.22402 + } catch (e) { 1.22403 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_name_1"); 1.22404 + } 1.22405 + try { 1.22406 + test_2d_fillStyle_parse_invalid_name_2() 1.22407 + } catch (e) { 1.22408 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_name_2"); 1.22409 + } 1.22410 + try { 1.22411 + test_2d_fillStyle_parse_invalid_name_3() 1.22412 + } catch (e) { 1.22413 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_name_3"); 1.22414 + } 1.22415 + try { 1.22416 + test_2d_fillStyle_parse_invalid_rgb_1(); 1.22417 + } catch (e) { 1.22418 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_rgb_1"); 1.22419 + } 1.22420 + try { 1.22421 + test_2d_fillStyle_parse_invalid_rgb_2(); 1.22422 + } catch (e) { 1.22423 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_rgb_2"); 1.22424 + } 1.22425 + try { 1.22426 + test_2d_fillStyle_parse_invalid_rgb_3(); 1.22427 + } catch (e) { 1.22428 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_rgb_3"); 1.22429 + } 1.22430 + try { 1.22431 + test_2d_fillStyle_parse_invalid_rgb_4(); 1.22432 + } catch (e) { 1.22433 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_rgb_4"); 1.22434 + } 1.22435 + try { 1.22436 + test_2d_fillStyle_parse_invalid_rgb_5(); 1.22437 + } catch (e) { 1.22438 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_rgb_5"); 1.22439 + } 1.22440 + try { 1.22441 + test_2d_fillStyle_parse_invalid_rgb_6(); 1.22442 + } catch (e) { 1.22443 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_rgb_6"); 1.22444 + } 1.22445 + try { 1.22446 + test_2d_fillStyle_parse_invalid_rgb_7(); 1.22447 + } catch (e) { 1.22448 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_rgb_7"); 1.22449 + } 1.22450 + try { 1.22451 + test_2d_fillStyle_parse_invalid_rgba_1(); 1.22452 + } catch (e) { 1.22453 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_rgba_1"); 1.22454 + } 1.22455 + try { 1.22456 + test_2d_fillStyle_parse_invalid_rgba_2(); 1.22457 + } catch (e) { 1.22458 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_rgba_2"); 1.22459 + } 1.22460 + try { 1.22461 + test_2d_fillStyle_parse_invalid_rgba_3(); 1.22462 + } catch (e) { 1.22463 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_rgba_3"); 1.22464 + } 1.22465 + try { 1.22466 + test_2d_fillStyle_parse_invalid_rgba_4(); 1.22467 + } catch (e) { 1.22468 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_rgba_4"); 1.22469 + } 1.22470 + try { 1.22471 + test_2d_fillStyle_parse_invalid_rgba_5(); 1.22472 + } catch (e) { 1.22473 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_invalid_rgba_5"); 1.22474 + } 1.22475 + try { 1.22476 + test_2d_fillStyle_parse_rgb_clamp_1(); 1.22477 + } catch (e) { 1.22478 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_rgb_clamp_1"); 1.22479 + } 1.22480 + try { 1.22481 + test_2d_fillStyle_parse_rgb_clamp_2(); 1.22482 + } catch (e) { 1.22483 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_rgb_clamp_2"); 1.22484 + } 1.22485 + try { 1.22486 + test_2d_fillStyle_parse_rgb_clamp_3(); 1.22487 + } catch (e) { 1.22488 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_rgb_clamp_3"); 1.22489 + } 1.22490 + try { 1.22491 + test_2d_fillStyle_parse_rgb_clamp_4(); 1.22492 + } catch (e) { 1.22493 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_rgb_clamp_4"); 1.22494 + } 1.22495 + try { 1.22496 + test_2d_fillStyle_parse_rgb_clamp_5(); 1.22497 + } catch (e) { 1.22498 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_rgb_clamp_5"); 1.22499 + } 1.22500 + try { 1.22501 + test_2d_fillStyle_parse_rgb_num(); 1.22502 + } catch (e) { 1.22503 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_rgb_num"); 1.22504 + } 1.22505 + try { 1.22506 + test_2d_fillStyle_parse_rgb_percent(); 1.22507 + } catch (e) { 1.22508 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_rgb_percent"); 1.22509 + } 1.22510 + try { 1.22511 + test_2d_fillStyle_parse_rgba_clamp_1(); 1.22512 + } catch (e) { 1.22513 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_rgba_clamp_1"); 1.22514 + } 1.22515 + try { 1.22516 + test_2d_fillStyle_parse_rgba_clamp_2(); 1.22517 + } catch (e) { 1.22518 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_rgba_clamp_2"); 1.22519 + } 1.22520 + try { 1.22521 + test_2d_fillStyle_parse_rgba_num_1(); 1.22522 + } catch (e) { 1.22523 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_rgba_num_1"); 1.22524 + } 1.22525 + try { 1.22526 + test_2d_fillStyle_parse_rgba_num_2(); 1.22527 + } catch (e) { 1.22528 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_rgba_num_2"); 1.22529 + } 1.22530 + try { 1.22531 + test_2d_fillStyle_parse_rgba_percent(); 1.22532 + } catch (e) { 1.22533 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_rgba_percent"); 1.22534 + } 1.22535 + try { 1.22536 + test_2d_fillStyle_parse_rgba_solid_1(); 1.22537 + } catch (e) { 1.22538 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_rgba_solid_1"); 1.22539 + } 1.22540 + try { 1.22541 + test_2d_fillStyle_parse_rgba_solid_2(); 1.22542 + } catch (e) { 1.22543 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_rgba_solid_2"); 1.22544 + } 1.22545 + try { 1.22546 + test_2d_fillStyle_parse_svg_1(); 1.22547 + } catch (e) { 1.22548 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_svg_1"); 1.22549 + } 1.22550 + try { 1.22551 + test_2d_fillStyle_parse_svg_2(); 1.22552 + } catch (e) { 1.22553 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_svg_2"); 1.22554 + } 1.22555 + try { 1.22556 + test_2d_fillStyle_parse_system(); 1.22557 + } catch (e) { 1.22558 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_system"); 1.22559 + } 1.22560 + try { 1.22561 + test_2d_fillStyle_parse_transparent_1(); 1.22562 + } catch (e) { 1.22563 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_transparent_1"); 1.22564 + } 1.22565 + try { 1.22566 + test_2d_fillStyle_parse_transparent_2(); 1.22567 + } catch (e) { 1.22568 + ok(false, "unexpected exception thrown in: test_2d_fillStyle_parse_transparent_2"); 1.22569 + } 1.22570 + try { 1.22571 + test_2d_getcontext_exists(); 1.22572 + } catch (e) { 1.22573 + ok(false, "unexpected exception thrown in: test_2d_getcontext_exists"); 1.22574 + } 1.22575 + try { 1.22576 + test_2d_getcontext_shared(); 1.22577 + } catch (e) { 1.22578 + ok(false, "unexpected exception thrown in: test_2d_getcontext_shared"); 1.22579 + } 1.22580 + try { 1.22581 + test_2d_getcontext_unique(); 1.22582 + } catch (e) { 1.22583 + ok(false, "unexpected exception thrown in: test_2d_getcontext_unique"); 1.22584 + } 1.22585 + try { 1.22586 + test_2d_gradient_empty(); 1.22587 + } catch (e) { 1.22588 + ok(false, "unexpected exception thrown in: test_2d_gradient_empty"); 1.22589 + } 1.22590 + try { 1.22591 + test_2d_gradient_interpolate_alpha(); 1.22592 + } catch (e) { 1.22593 + ok(false, "unexpected exception thrown in: test_2d_gradient_interpolate_alpha"); 1.22594 + } 1.22595 + try { 1.22596 + test_2d_gradient_interpolate_colour(); 1.22597 + } catch (e) { 1.22598 + ok(false, "unexpected exception thrown in: test_2d_gradient_interpolate_colour"); 1.22599 + } 1.22600 + try { 1.22601 + test_2d_gradient_interpolate_colouralpha(); 1.22602 + } catch (e) { 1.22603 + ok(false, "unexpected exception thrown in: test_2d_gradient_interpolate_colouralpha"); 1.22604 + } 1.22605 + try { 1.22606 + test_2d_gradient_interpolate_multiple(); 1.22607 + } catch (e) { 1.22608 + ok(false, "unexpected exception thrown in: test_2d_gradient_interpolate_multiple"); 1.22609 + } 1.22610 + try { 1.22611 + test_2d_gradient_interpolate_outside(); 1.22612 + } catch (e) { 1.22613 + ok(false, "unexpected exception thrown in: test_2d_gradient_interpolate_outside"); 1.22614 + } 1.22615 + try { 1.22616 + test_2d_gradient_interpolate_overlap(); 1.22617 + } catch (e) { 1.22618 + ok(false, "unexpected exception thrown in: test_2d_gradient_interpolate_overlap"); 1.22619 + } 1.22620 + try { 1.22621 + test_2d_gradient_interpolate_overlap2(); 1.22622 + } catch (e) { 1.22623 + ok(false, "unexpected exception thrown in: test_2d_gradient_interpolate_overlap2"); 1.22624 + } 1.22625 + try { 1.22626 + test_2d_gradient_interpolate_solid(); 1.22627 + } catch (e) { 1.22628 + ok(false, "unexpected exception thrown in: test_2d_gradient_interpolate_solid"); 1.22629 + } 1.22630 + try { 1.22631 + test_2d_gradient_interpolate_vertical(); 1.22632 + } catch (e) { 1.22633 + ok(false, "unexpected exception thrown in: test_2d_gradient_interpolate_vertical"); 1.22634 + } 1.22635 + try { 1.22636 + test_2d_gradient_interpolate_zerosize(); 1.22637 + } catch (e) { 1.22638 + ok(false, "unexpected exception thrown in: test_2d_gradient_interpolate_zerosize"); 1.22639 + } 1.22640 + try { 1.22641 + test_2d_gradient_linear_nonfinite(); 1.22642 + } catch (e) { 1.22643 + ok(false, "unexpected exception thrown in: test_2d_gradient_linear_nonfinite"); 1.22644 + } 1.22645 + try { 1.22646 + test_2d_gradient_linear_transform_1(); 1.22647 + } catch (e) { 1.22648 + ok(false, "unexpected exception thrown in: test_2d_gradient_linear_transform_1"); 1.22649 + } 1.22650 + try { 1.22651 + test_2d_gradient_linear_transform_2(); 1.22652 + } catch (e) { 1.22653 + ok(false, "unexpected exception thrown in: test_2d_gradient_linear_transform_2"); 1.22654 + } 1.22655 + try { 1.22656 + test_2d_gradient_linear_transform_3(); 1.22657 + } catch (e) { 1.22658 + ok(false, "unexpected exception thrown in: test_2d_gradient_linear_transform_3"); 1.22659 + } 1.22660 + try { 1.22661 + test_2d_gradient_object_compare(); 1.22662 + } catch (e) { 1.22663 + ok(false, "unexpected exception thrown in: test_2d_gradient_object_compare"); 1.22664 + } 1.22665 + try { 1.22666 + test_2d_gradient_object_crosscanvas(); 1.22667 + } catch (e) { 1.22668 + ok(false, "unexpected exception thrown in: test_2d_gradient_object_crosscanvas"); 1.22669 + } 1.22670 + try { 1.22671 + test_2d_gradient_object_invalidcolour(); 1.22672 + } catch (e) { 1.22673 + ok(false, "unexpected exception thrown in: test_2d_gradient_object_invalidcolour"); 1.22674 + } 1.22675 + try { 1.22676 + test_2d_gradient_object_invalidoffset(); 1.22677 + } catch (e) { 1.22678 + ok(false, "unexpected exception thrown in: test_2d_gradient_object_invalidoffset"); 1.22679 + } 1.22680 + try { 1.22681 + test_2d_gradient_object_return(); 1.22682 + } catch (e) { 1.22683 + ok(false, "unexpected exception thrown in: test_2d_gradient_object_return"); 1.22684 + } 1.22685 + try { 1.22686 + test_2d_gradient_object_type(); 1.22687 + } catch (e) { 1.22688 + ok(false, "unexpected exception thrown in: test_2d_gradient_object_type"); 1.22689 + } 1.22690 + try { 1.22691 + test_2d_gradient_object_update(); 1.22692 + } catch (e) { 1.22693 + ok(false, "unexpected exception thrown in: test_2d_gradient_object_update"); 1.22694 + } 1.22695 + try { 1.22696 + test_2d_gradient_radial_cone_bottom(); 1.22697 + } catch (e) { 1.22698 + ok(false, "unexpected exception thrown in: test_2d_gradient_radial_cone_bottom"); 1.22699 + } 1.22700 + try { 1.22701 + test_2d_gradient_radial_cone_cylinder(); 1.22702 + } catch (e) { 1.22703 + ok(false, "unexpected exception thrown in: test_2d_gradient_radial_cone_cylinder"); 1.22704 + } 1.22705 + try { 1.22706 + test_2d_gradient_radial_cone_shape1(); 1.22707 + } catch (e) { 1.22708 + ok(false, "unexpected exception thrown in: test_2d_gradient_radial_cone_shape1"); 1.22709 + } 1.22710 + try { 1.22711 + test_2d_gradient_radial_inside1(); 1.22712 + } catch (e) { 1.22713 + ok(false, "unexpected exception thrown in: test_2d_gradient_radial_inside1"); 1.22714 + } 1.22715 + try { 1.22716 + test_2d_gradient_radial_negative(); 1.22717 + } catch (e) { 1.22718 + ok(false, "unexpected exception thrown in: test_2d_gradient_radial_negative"); 1.22719 + } 1.22720 + try { 1.22721 + test_2d_gradient_radial_nonfinite(); 1.22722 + } catch (e) { 1.22723 + ok(false, "unexpected exception thrown in: test_2d_gradient_radial_nonfinite"); 1.22724 + } 1.22725 + try { 1.22726 + test_2d_gradient_radial_transform_1(); 1.22727 + } catch (e) { 1.22728 + ok(false, "unexpected exception thrown in: test_2d_gradient_radial_transform_1"); 1.22729 + } 1.22730 + try { 1.22731 + test_2d_gradient_radial_transform_2(); 1.22732 + } catch (e) { 1.22733 + ok(false, "unexpected exception thrown in: test_2d_gradient_radial_transform_2"); 1.22734 + } 1.22735 + try { 1.22736 + test_2d_gradient_radial_transform_3(); 1.22737 + } catch (e) { 1.22738 + ok(false, "unexpected exception thrown in: test_2d_gradient_radial_transform_3"); 1.22739 + } 1.22740 + try { 1.22741 + test_2d_imageData_create_basic(); 1.22742 + } catch (e) { 1.22743 + ok(false, "unexpected exception thrown in: test_2d_imageData_create_basic"); 1.22744 + } 1.22745 + try { 1.22746 + test_2d_imageData_create1_basic(); 1.22747 + } catch (e) { 1.22748 + ok(false, "unexpected exception thrown in: test_2d_imageData_create1_basic"); 1.22749 + } 1.22750 + try { 1.22751 + test_2d_imageData_create_initial(); 1.22752 + } catch (e) { 1.22753 + ok(false, "unexpected exception thrown in: test_2d_imageData_create_initial"); 1.22754 + } 1.22755 + try { 1.22756 + test_2d_imageData_create1_initial(); 1.22757 + } catch (e) { 1.22758 + ok(false, "unexpected exception thrown in: test_2d_imageData_create1_initial"); 1.22759 + } 1.22760 + try { 1.22761 + test_2d_imageData_create_large(); 1.22762 + } catch (e) { 1.22763 + ok(false, "unexpected exception thrown in: test_2d_imageData_create_large"); 1.22764 + } 1.22765 + try { 1.22766 + test_2d_imageData_create_negative(); 1.22767 + } catch (e) { 1.22768 + ok(false, "unexpected exception thrown in: test_2d_imageData_create_negative"); 1.22769 + } 1.22770 + try { 1.22771 + test_2d_imageData_create_nonfinite(); 1.22772 + } catch (e) { 1.22773 + ok(false, "unexpected exception thrown in: test_2d_imageData_create_nonfinite"); 1.22774 + } 1.22775 + try { 1.22776 + test_2d_imageData_create_round(); 1.22777 + } catch (e) { 1.22778 + ok(false, "unexpected exception thrown in: test_2d_imageData_create_round"); 1.22779 + } 1.22780 + try { 1.22781 + test_2d_imageData_create_tiny(); 1.22782 + } catch (e) { 1.22783 + ok(false, "unexpected exception thrown in: test_2d_imageData_create_tiny"); 1.22784 + } 1.22785 + try { 1.22786 + test_2d_imageData_create_type(); 1.22787 + } catch (e) { 1.22788 + ok(false, "unexpected exception thrown in: test_2d_imageData_create_type"); 1.22789 + } 1.22790 + try { 1.22791 + test_2d_imageData_create1_type(); 1.22792 + } catch (e) { 1.22793 + ok(false, "unexpected exception thrown in: test_2d_imageData_create1_type"); 1.22794 + } 1.22795 + try { 1.22796 + test_2d_imageData_create_zero(); 1.22797 + } catch (e) { 1.22798 + ok(false, "unexpected exception thrown in: test_2d_imageData_create_zero"); 1.22799 + } 1.22800 + try { 1.22801 + test_2d_imageData_create1_zero(); 1.22802 + } catch (e) { 1.22803 + ok(false, "unexpected exception thrown in: test_2d_imageData_create1_zero"); 1.22804 + } 1.22805 + try { 1.22806 + test_2d_imageData_get_basic(); 1.22807 + } catch (e) { 1.22808 + ok(false, "unexpected exception thrown in: test_2d_imageData_get_basic"); 1.22809 + } 1.22810 + try { 1.22811 + test_2d_imageData_get_clamp(); 1.22812 + } catch (e) { 1.22813 + ok(false, "unexpected exception thrown in: test_2d_imageData_get_clamp"); 1.22814 + } 1.22815 + try { 1.22816 + test_2d_imageData_get_nonfinite(); 1.22817 + } catch (e) { 1.22818 + ok(false, "unexpected exception thrown in: test_2d_imageData_get_nonfinite"); 1.22819 + } 1.22820 + try { 1.22821 + test_2d_imageData_get_nonpremul(); 1.22822 + } catch (e) { 1.22823 + ok(false, "unexpected exception thrown in: test_2d_imageData_get_nonpremul"); 1.22824 + } 1.22825 + try { 1.22826 + test_2d_imageData_get_order_alpha(); 1.22827 + } catch (e) { 1.22828 + ok(false, "unexpected exception thrown in: test_2d_imageData_get_order_alpha"); 1.22829 + } 1.22830 + try { 1.22831 + test_2d_imageData_get_order_cols(); 1.22832 + } catch (e) { 1.22833 + ok(false, "unexpected exception thrown in: test_2d_imageData_get_order_cols"); 1.22834 + } 1.22835 + try { 1.22836 + test_2d_imageData_get_order_rgb(); 1.22837 + } catch (e) { 1.22838 + ok(false, "unexpected exception thrown in: test_2d_imageData_get_order_rgb"); 1.22839 + } 1.22840 + try { 1.22841 + test_2d_imageData_get_order_rows(); 1.22842 + } catch (e) { 1.22843 + ok(false, "unexpected exception thrown in: test_2d_imageData_get_order_rows"); 1.22844 + } 1.22845 + try { 1.22846 + test_2d_imageData_get_range(); 1.22847 + } catch (e) { 1.22848 + ok(false, "unexpected exception thrown in: test_2d_imageData_get_range"); 1.22849 + } 1.22850 + try { 1.22851 + test_2d_imageData_get_source_negative(); 1.22852 + } catch (e) { 1.22853 + ok(false, "unexpected exception thrown in: test_2d_imageData_get_source_negative"); 1.22854 + } 1.22855 + try { 1.22856 + test_2d_imageData_get_source_outside(); 1.22857 + } catch (e) { 1.22858 + ok(false, "unexpected exception thrown in: test_2d_imageData_get_source_outside"); 1.22859 + } 1.22860 + try { 1.22861 + test_2d_imageData_get_source_size(); 1.22862 + } catch (e) { 1.22863 + ok(false, "unexpected exception thrown in: test_2d_imageData_get_source_size"); 1.22864 + } 1.22865 + try { 1.22866 + test_2d_imageData_get_tiny(); 1.22867 + } catch (e) { 1.22868 + ok(false, "unexpected exception thrown in: test_2d_imageData_get_tiny"); 1.22869 + } 1.22870 + try { 1.22871 + test_2d_imageData_get_type(); 1.22872 + } catch (e) { 1.22873 + ok(false, "unexpected exception thrown in: test_2d_imageData_get_type"); 1.22874 + } 1.22875 + try { 1.22876 + test_2d_imageData_get_unaffected(); 1.22877 + } catch (e) { 1.22878 + ok(false, "unexpected exception thrown in: test_2d_imageData_get_unaffected"); 1.22879 + } 1.22880 + try { 1.22881 + test_2d_imageData_get_zero(); 1.22882 + } catch (e) { 1.22883 + ok(false, "unexpected exception thrown in: test_2d_imageData_get_zero"); 1.22884 + } 1.22885 + try { 1.22886 + test_2d_imageData_object_clamp(); 1.22887 + } catch (e) { 1.22888 + ok(false, "unexpected exception thrown in: test_2d_imageData_object_clamp"); 1.22889 + } 1.22890 + try { 1.22891 + test_2d_imageData_object_ctor(); 1.22892 + } catch (e) { 1.22893 + ok(false, "unexpected exception thrown in: test_2d_imageData_object_ctor"); 1.22894 + } 1.22895 + try { 1.22896 + test_2d_imageData_object_nan(); 1.22897 + } catch (e) { 1.22898 + ok(false, "unexpected exception thrown in: test_2d_imageData_object_nan"); 1.22899 + } 1.22900 + try { 1.22901 + test_2d_imageData_object_properties(); 1.22902 + } catch (e) { 1.22903 + ok(false, "unexpected exception thrown in: test_2d_imageData_object_properties"); 1.22904 + } 1.22905 + try { 1.22906 + test_2d_imageData_object_readonly(); 1.22907 + } catch (e) { 1.22908 + ok(false, "unexpected exception thrown in: test_2d_imageData_object_readonly"); 1.22909 + } 1.22910 + try { 1.22911 + test_2d_imageData_object_round(); 1.22912 + } catch (e) { 1.22913 + ok(false, "unexpected exception thrown in: test_2d_imageData_object_round"); 1.22914 + } 1.22915 + try { 1.22916 + test_2d_imageData_object_set(); 1.22917 + } catch (e) { 1.22918 + ok(false, "unexpected exception thrown in: test_2d_imageData_object_set"); 1.22919 + } 1.22920 + try { 1.22921 + test_2d_imageData_object_string(); 1.22922 + } catch (e) { 1.22923 + ok(false, "unexpected exception thrown in: test_2d_imageData_object_string"); 1.22924 + } 1.22925 + try { 1.22926 + test_2d_imageData_object_undefined(); 1.22927 + } catch (e) { 1.22928 + ok(false, "unexpected exception thrown in: test_2d_imageData_object_undefined"); 1.22929 + } 1.22930 + try { 1.22931 + test_2d_imageData_put_alpha(); 1.22932 + } catch (e) { 1.22933 + ok(false, "unexpected exception thrown in: test_2d_imageData_put_alpha"); 1.22934 + } 1.22935 + try { 1.22936 + test_2d_imageData_put_basic(); 1.22937 + } catch (e) { 1.22938 + ok(false, "unexpected exception thrown in: test_2d_imageData_put_basic"); 1.22939 + } 1.22940 + try { 1.22941 + test_2d_imageData_put_clip(); 1.22942 + } catch (e) { 1.22943 + ok(false, "unexpected exception thrown in: test_2d_imageData_put_clip"); 1.22944 + } 1.22945 + try { 1.22946 + test_2d_imageData_put_created(); 1.22947 + } catch (e) { 1.22948 + ok(false, "unexpected exception thrown in: test_2d_imageData_put_created"); 1.22949 + } 1.22950 + try { 1.22951 + test_2d_imageData_put_cross(); 1.22952 + } catch (e) { 1.22953 + ok(false, "unexpected exception thrown in: test_2d_imageData_put_cross"); 1.22954 + } 1.22955 + try { 1.22956 + test_2d_imageData_put_dirty_negative(); 1.22957 + } catch (e) { 1.22958 + ok(false, "unexpected exception thrown in: test_2d_imageData_put_dirty_negative"); 1.22959 + } 1.22960 + try { 1.22961 + test_2d_imageData_put_dirty_outside(); 1.22962 + } catch (e) { 1.22963 + ok(false, "unexpected exception thrown in: test_2d_imageData_put_dirty_outside"); 1.22964 + } 1.22965 + try { 1.22966 + test_2d_imageData_put_dirty_rect1(); 1.22967 + } catch (e) { 1.22968 + ok(false, "unexpected exception thrown in: test_2d_imageData_put_dirty_rect1"); 1.22969 + } 1.22970 + try { 1.22971 + test_2d_imageData_put_dirty_rect2(); 1.22972 + } catch (e) { 1.22973 + ok(false, "unexpected exception thrown in: test_2d_imageData_put_dirty_rect2"); 1.22974 + } 1.22975 + try { 1.22976 + test_2d_imageData_put_dirty_zero(); 1.22977 + } catch (e) { 1.22978 + ok(false, "unexpected exception thrown in: test_2d_imageData_put_dirty_zero"); 1.22979 + } 1.22980 + try { 1.22981 + test_2d_imageData_put_modified(); 1.22982 + } catch (e) { 1.22983 + ok(false, "unexpected exception thrown in: test_2d_imageData_put_modified"); 1.22984 + } 1.22985 + try { 1.22986 + test_2d_imageData_put_nonfinite(); 1.22987 + } catch (e) { 1.22988 + ok(false, "unexpected exception thrown in: test_2d_imageData_put_nonfinite"); 1.22989 + } 1.22990 + try { 1.22991 + test_2d_imageData_put_null(); 1.22992 + } catch (e) { 1.22993 + ok(false, "unexpected exception thrown in: test_2d_imageData_put_null"); 1.22994 + } 1.22995 + try { 1.22996 + test_2d_imageData_put_path(); 1.22997 + } catch (e) { 1.22998 + ok(false, "unexpected exception thrown in: test_2d_imageData_put_path"); 1.22999 + } 1.23000 + try { 1.23001 + test_2d_imageData_put_unaffected(); 1.23002 + } catch (e) { 1.23003 + ok(false, "unexpected exception thrown in: test_2d_imageData_put_unaffected"); 1.23004 + } 1.23005 + try { 1.23006 + test_2d_imageData_put_unchanged(); 1.23007 + } catch (e) { 1.23008 + ok(false, "unexpected exception thrown in: test_2d_imageData_put_unchanged"); 1.23009 + } 1.23010 + try { 1.23011 + test_2d_imageData_put_wrongtype(); 1.23012 + } catch (e) { 1.23013 + ok(false, "unexpected exception thrown in: test_2d_imageData_put_wrongtype"); 1.23014 + } 1.23015 + try { 1.23016 + test_2d_line_cap_butt(); 1.23017 + } catch (e) { 1.23018 + ok(false, "unexpected exception thrown in: test_2d_line_cap_butt"); 1.23019 + } 1.23020 + try { 1.23021 + test_2d_line_cap_invalid(); 1.23022 + } catch (e) { 1.23023 + ok(false, "unexpected exception thrown in: test_2d_line_cap_invalid"); 1.23024 + } 1.23025 + try { 1.23026 + test_2d_line_cap_open(); 1.23027 + } catch (e) { 1.23028 + ok(false, "unexpected exception thrown in: test_2d_line_cap_open"); 1.23029 + } 1.23030 + try { 1.23031 + test_2d_line_cap_round(); 1.23032 + } catch (e) { 1.23033 + ok(false, "unexpected exception thrown in: test_2d_line_cap_round"); 1.23034 + } 1.23035 + try { 1.23036 + test_2d_line_cap_square(); 1.23037 + } catch (e) { 1.23038 + ok(false, "unexpected exception thrown in: test_2d_line_cap_square"); 1.23039 + } 1.23040 + try { 1.23041 + test_2d_line_cross(); 1.23042 + } catch (e) { 1.23043 + ok(false, "unexpected exception thrown in: test_2d_line_cross"); 1.23044 + } 1.23045 + try { 1.23046 + test_2d_line_defaults(); 1.23047 + } catch (e) { 1.23048 + ok(false, "unexpected exception thrown in: test_2d_line_defaults"); 1.23049 + } 1.23050 + try { 1.23051 + test_2d_line_join_bevel(); 1.23052 + } catch (e) { 1.23053 + ok(false, "unexpected exception thrown in: test_2d_line_join_bevel"); 1.23054 + } 1.23055 + try { 1.23056 + test_2d_line_join_closed(); 1.23057 + } catch (e) { 1.23058 + ok(false, "unexpected exception thrown in: test_2d_line_join_closed"); 1.23059 + } 1.23060 + try { 1.23061 + test_2d_line_join_invalid(); 1.23062 + } catch (e) { 1.23063 + ok(false, "unexpected exception thrown in: test_2d_line_join_invalid"); 1.23064 + } 1.23065 + try { 1.23066 + test_2d_line_join_miter(); 1.23067 + } catch (e) { 1.23068 + ok(false, "unexpected exception thrown in: test_2d_line_join_miter"); 1.23069 + } 1.23070 + try { 1.23071 + test_2d_line_join_open(); 1.23072 + } catch (e) { 1.23073 + ok(false, "unexpected exception thrown in: test_2d_line_join_open"); 1.23074 + } 1.23075 + try { 1.23076 + test_2d_line_join_round(); 1.23077 + } catch (e) { 1.23078 + ok(false, "unexpected exception thrown in: test_2d_line_join_round"); 1.23079 + } 1.23080 + try { 1.23081 + test_2d_line_miter_acute(); 1.23082 + } catch (e) { 1.23083 + ok(false, "unexpected exception thrown in: test_2d_line_miter_acute"); 1.23084 + } 1.23085 + try { 1.23086 + test_2d_line_miter_exceeded(); 1.23087 + } catch (e) { 1.23088 + ok(false, "unexpected exception thrown in: test_2d_line_miter_exceeded"); 1.23089 + } 1.23090 + try { 1.23091 + test_2d_line_miter_invalid(); 1.23092 + } catch (e) { 1.23093 + ok(false, "unexpected exception thrown in: test_2d_line_miter_invalid"); 1.23094 + } 1.23095 + try { 1.23096 + test_2d_line_miter_lineedge(); 1.23097 + } catch (e) { 1.23098 + ok(false, "unexpected exception thrown in: test_2d_line_miter_lineedge"); 1.23099 + } 1.23100 + try { 1.23101 + test_2d_line_miter_obtuse(); 1.23102 + } catch (e) { 1.23103 + ok(false, "unexpected exception thrown in: test_2d_line_miter_obtuse"); 1.23104 + } 1.23105 + try { 1.23106 + test_2d_line_miter_rightangle(); 1.23107 + } catch (e) { 1.23108 + ok(false, "unexpected exception thrown in: test_2d_line_miter_rightangle"); 1.23109 + } 1.23110 + try { 1.23111 + test_2d_line_miter_within(); 1.23112 + } catch (e) { 1.23113 + ok(false, "unexpected exception thrown in: test_2d_line_miter_within"); 1.23114 + } 1.23115 + try { 1.23116 + test_2d_line_union(); 1.23117 + } catch (e) { 1.23118 + ok(false, "unexpected exception thrown in: test_2d_line_union"); 1.23119 + } 1.23120 + try { 1.23121 + test_2d_line_width_basic(); 1.23122 + } catch (e) { 1.23123 + ok(false, "unexpected exception thrown in: test_2d_line_width_basic"); 1.23124 + } 1.23125 + try { 1.23126 + test_2d_line_width_invalid(); 1.23127 + } catch (e) { 1.23128 + ok(false, "unexpected exception thrown in: test_2d_line_width_invalid"); 1.23129 + } 1.23130 + try { 1.23131 + test_2d_line_width_transformed(); 1.23132 + } catch (e) { 1.23133 + ok(false, "unexpected exception thrown in: test_2d_line_width_transformed"); 1.23134 + } 1.23135 + try { 1.23136 + test_2d_missingargs(); 1.23137 + } catch (e) { 1.23138 + ok(false, "unexpected exception thrown in: test_2d_missingargs"); 1.23139 + } 1.23140 + try { 1.23141 + test_2d_path_arc_angle_1(); 1.23142 + } catch (e) { 1.23143 + ok(false, "unexpected exception thrown in: test_2d_path_arc_angle_1"); 1.23144 + } 1.23145 + try { 1.23146 + test_2d_path_arc_angle_2(); 1.23147 + } catch (e) { 1.23148 + ok(false, "unexpected exception thrown in: test_2d_path_arc_angle_2"); 1.23149 + } 1.23150 + try { 1.23151 + test_2d_path_arc_angle_3(); 1.23152 + } catch (e) { 1.23153 + ok(false, "unexpected exception thrown in: test_2d_path_arc_angle_3"); 1.23154 + } 1.23155 + try { 1.23156 + test_2d_path_arc_angle_4(); 1.23157 + } catch (e) { 1.23158 + ok(false, "unexpected exception thrown in: test_2d_path_arc_angle_4"); 1.23159 + } 1.23160 + try { 1.23161 + test_2d_path_arc_angle_5(); 1.23162 + } catch (e) { 1.23163 + ok(false, "unexpected exception thrown in: test_2d_path_arc_angle_5"); 1.23164 + } 1.23165 + try { 1.23166 + test_2d_path_arc_angle_6(); 1.23167 + } catch (e) { 1.23168 + ok(false, "unexpected exception thrown in: test_2d_path_arc_angle_6"); 1.23169 + } 1.23170 + try { 1.23171 + test_2d_path_arc_empty(); 1.23172 + } catch (e) { 1.23173 + ok(false, "unexpected exception thrown in: test_2d_path_arc_empty"); 1.23174 + } 1.23175 + try { 1.23176 + test_2d_path_arc_end(); 1.23177 + } catch (e) { 1.23178 + ok(false, "unexpected exception thrown in: test_2d_path_arc_end"); 1.23179 + } 1.23180 + try { 1.23181 + test_2d_path_arc_negative(); 1.23182 + } catch (e) { 1.23183 + ok(false, "unexpected exception thrown in: test_2d_path_arc_negative"); 1.23184 + } 1.23185 + try { 1.23186 + test_2d_path_arc_nonempty(); 1.23187 + } catch (e) { 1.23188 + ok(false, "unexpected exception thrown in: test_2d_path_arc_nonempty"); 1.23189 + } 1.23190 + try { 1.23191 + test_2d_path_arc_nonfinite(); 1.23192 + } catch (e) { 1.23193 + ok(false, "unexpected exception thrown in: test_2d_path_arc_nonfinite"); 1.23194 + } 1.23195 + try { 1.23196 + test_2d_path_arc_scale_1(); 1.23197 + } catch (e) { 1.23198 + ok(false, "unexpected exception thrown in: test_2d_path_arc_scale_1"); 1.23199 + } 1.23200 + try { 1.23201 + test_2d_path_arc_scale_2(); 1.23202 + } catch (e) { 1.23203 + ok(false, "unexpected exception thrown in: test_2d_path_arc_scale_2"); 1.23204 + } 1.23205 + try { 1.23206 + test_2d_path_arc_selfintersect_1(); 1.23207 + } catch (e) { 1.23208 + ok(false, "unexpected exception thrown in: test_2d_path_arc_selfintersect_1"); 1.23209 + } 1.23210 + try { 1.23211 + test_2d_path_arc_selfintersect_2(); 1.23212 + } catch (e) { 1.23213 + ok(false, "unexpected exception thrown in: test_2d_path_arc_selfintersect_2"); 1.23214 + } 1.23215 + try { 1.23216 + test_2d_path_arc_shape_1(); 1.23217 + } catch (e) { 1.23218 + ok(false, "unexpected exception thrown in: test_2d_path_arc_shape_1"); 1.23219 + } 1.23220 + try { 1.23221 + test_2d_path_arc_shape_2(); 1.23222 + } catch (e) { 1.23223 + ok(false, "unexpected exception thrown in: test_2d_path_arc_shape_2"); 1.23224 + } 1.23225 + try { 1.23226 + test_2d_path_arc_shape_4(); 1.23227 + } catch (e) { 1.23228 + ok(false, "unexpected exception thrown in: test_2d_path_arc_shape_4"); 1.23229 + } 1.23230 + try { 1.23231 + test_2d_path_arc_shape_5(); 1.23232 + } catch (e) { 1.23233 + ok(false, "unexpected exception thrown in: test_2d_path_arc_shape_5"); 1.23234 + } 1.23235 + try { 1.23236 + test_2d_path_arc_twopie_1(); 1.23237 + } catch (e) { 1.23238 + ok(false, "unexpected exception thrown in: test_2d_path_arc_twopie_1"); 1.23239 + } 1.23240 + try { 1.23241 + test_2d_path_arc_twopie_2(); 1.23242 + } catch (e) { 1.23243 + ok(false, "unexpected exception thrown in: test_2d_path_arc_twopie_2"); 1.23244 + } 1.23245 + try { 1.23246 + test_2d_path_arc_twopie_3(); 1.23247 + } catch (e) { 1.23248 + ok(false, "unexpected exception thrown in: test_2d_path_arc_twopie_3"); 1.23249 + } 1.23250 + try { 1.23251 + test_2d_path_arc_twopie_4(); 1.23252 + } catch (e) { 1.23253 + ok(false, "unexpected exception thrown in: test_2d_path_arc_twopie_4"); 1.23254 + } 1.23255 + try { 1.23256 + test_2d_path_arc_zero_1(); 1.23257 + } catch (e) { 1.23258 + ok(false, "unexpected exception thrown in: test_2d_path_arc_zero_1"); 1.23259 + } 1.23260 + try { 1.23261 + test_2d_path_arc_zero_2(); 1.23262 + } catch (e) { 1.23263 + ok(false, "unexpected exception thrown in: test_2d_path_arc_zero_2"); 1.23264 + } 1.23265 + try { 1.23266 + test_2d_path_arc_zeroradius(); 1.23267 + } catch (e) { 1.23268 + ok(false, "unexpected exception thrown in: test_2d_path_arc_zeroradius"); 1.23269 + } 1.23270 + try { 1.23271 + test_2d_path_arcTo_coincide_1(); 1.23272 + } catch (e) { 1.23273 + ok(false, "unexpected exception thrown in: test_2d_path_arcTo_coincide_1"); 1.23274 + } 1.23275 + try { 1.23276 + test_2d_path_arcTo_coincide_2(); 1.23277 + } catch (e) { 1.23278 + ok(false, "unexpected exception thrown in: test_2d_path_arcTo_coincide_2"); 1.23279 + } 1.23280 + try { 1.23281 + test_2d_path_arcTo_collinear_1(); 1.23282 + } catch (e) { 1.23283 + ok(false, "unexpected exception thrown in: test_2d_path_arcTo_collinear_1"); 1.23284 + } 1.23285 + try { 1.23286 + test_2d_path_arcTo_collinear_2(); 1.23287 + } catch (e) { 1.23288 + ok(false, "unexpected exception thrown in: test_2d_path_arcTo_collinear_2"); 1.23289 + } 1.23290 + try { 1.23291 + test_2d_path_arcTo_collinear_3(); 1.23292 + } catch (e) { 1.23293 + ok(false, "unexpected exception thrown in: test_2d_path_arcTo_collinear_3"); 1.23294 + } 1.23295 + try { 1.23296 + test_2d_path_arcTo_emptysubpath(); 1.23297 + } catch (e) { 1.23298 + ok(false, "unexpected exception thrown in: test_2d_path_arcTo_emptysubpath"); 1.23299 + } 1.23300 + try { 1.23301 + test_2d_path_arcTo_negative(); 1.23302 + } catch (e) { 1.23303 + ok(false, "unexpected exception thrown in: test_2d_path_arcTo_negative"); 1.23304 + } 1.23305 + try { 1.23306 + test_2d_path_arcTo_nonfinite(); 1.23307 + } catch (e) { 1.23308 + ok(false, "unexpected exception thrown in: test_2d_path_arcTo_nonfinite"); 1.23309 + } 1.23310 + try { 1.23311 + test_2d_path_arcTo_scale(); 1.23312 + } catch (e) { 1.23313 + ok(false, "unexpected exception thrown in: test_2d_path_arcTo_scale"); 1.23314 + } 1.23315 + try { 1.23316 + test_2d_path_arcTo_shape_curve1(); 1.23317 + } catch (e) { 1.23318 + ok(false, "unexpected exception thrown in: test_2d_path_arcTo_shape_curve1"); 1.23319 + } 1.23320 + try { 1.23321 + test_2d_path_arcTo_shape_curve2(); 1.23322 + } catch (e) { 1.23323 + ok(false, "unexpected exception thrown in: test_2d_path_arcTo_shape_curve2"); 1.23324 + } 1.23325 + try { 1.23326 + test_2d_path_arcTo_shape_end(); 1.23327 + } catch (e) { 1.23328 + ok(false, "unexpected exception thrown in: test_2d_path_arcTo_shape_end"); 1.23329 + } 1.23330 + try { 1.23331 + test_2d_path_arcTo_shape_start(); 1.23332 + } catch (e) { 1.23333 + ok(false, "unexpected exception thrown in: test_2d_path_arcTo_shape_start"); 1.23334 + } 1.23335 + try { 1.23336 + test_2d_path_arcTo_transformation(); 1.23337 + } catch (e) { 1.23338 + ok(false, "unexpected exception thrown in: test_2d_path_arcTo_transformation"); 1.23339 + } 1.23340 + try { 1.23341 + test_2d_path_arcTo_zero_1(); 1.23342 + } catch (e) { 1.23343 + ok(false, "unexpected exception thrown in: test_2d_path_arcTo_zero_1"); 1.23344 + } 1.23345 + try { 1.23346 + test_2d_path_arcTo_zero_2(); 1.23347 + } catch (e) { 1.23348 + ok(false, "unexpected exception thrown in: test_2d_path_arcTo_zero_2"); 1.23349 + } 1.23350 + try { 1.23351 + test_2d_path_beginPath(); 1.23352 + } catch (e) { 1.23353 + ok(false, "unexpected exception thrown in: test_2d_path_beginPath"); 1.23354 + } 1.23355 + try { 1.23356 + test_2d_path_bezierCurveTo_basic(); 1.23357 + } catch (e) { 1.23358 + ok(false, "unexpected exception thrown in: test_2d_path_bezierCurveTo_basic"); 1.23359 + } 1.23360 + try { 1.23361 + test_2d_path_bezierCurveTo_emptysubpath(); 1.23362 + } catch (e) { 1.23363 + ok(false, "unexpected exception thrown in: test_2d_path_bezierCurveTo_emptysubpath"); 1.23364 + } 1.23365 + try { 1.23366 + test_2d_path_bezierCurveTo_nonfinite(); 1.23367 + } catch (e) { 1.23368 + ok(false, "unexpected exception thrown in: test_2d_path_bezierCurveTo_nonfinite"); 1.23369 + } 1.23370 + try { 1.23371 + test_2d_path_bezierCurveTo_scaled(); 1.23372 + } catch (e) { 1.23373 + ok(false, "unexpected exception thrown in: test_2d_path_bezierCurveTo_scaled"); 1.23374 + } 1.23375 + try { 1.23376 + test_2d_path_bezierCurveTo_shape(); 1.23377 + } catch (e) { 1.23378 + ok(false, "unexpected exception thrown in: test_2d_path_bezierCurveTo_shape"); 1.23379 + } 1.23380 + try { 1.23381 + test_2d_path_clip_basic_1(); 1.23382 + } catch (e) { 1.23383 + ok(false, "unexpected exception thrown in: test_2d_path_clip_basic_1"); 1.23384 + } 1.23385 + try { 1.23386 + test_2d_path_clip_basic_2(); 1.23387 + } catch (e) { 1.23388 + ok(false, "unexpected exception thrown in: test_2d_path_clip_basic_2"); 1.23389 + } 1.23390 + try { 1.23391 + test_2d_path_clip_empty(); 1.23392 + } catch (e) { 1.23393 + ok(false, "unexpected exception thrown in: test_2d_path_clip_empty"); 1.23394 + } 1.23395 + try { 1.23396 + test_2d_path_clip_intersect(); 1.23397 + } catch (e) { 1.23398 + ok(false, "unexpected exception thrown in: test_2d_path_clip_intersect"); 1.23399 + } 1.23400 + try { 1.23401 + test_2d_path_clip_unaffected(); 1.23402 + } catch (e) { 1.23403 + ok(false, "unexpected exception thrown in: test_2d_path_clip_unaffected"); 1.23404 + } 1.23405 + try { 1.23406 + test_2d_path_clip_winding_1(); 1.23407 + } catch (e) { 1.23408 + ok(false, "unexpected exception thrown in: test_2d_path_clip_winding_1"); 1.23409 + } 1.23410 + try { 1.23411 + test_2d_path_clip_winding_2(); 1.23412 + } catch (e) { 1.23413 + ok(false, "unexpected exception thrown in: test_2d_path_clip_winding_2"); 1.23414 + } 1.23415 + try { 1.23416 + test_2d_path_closePath_empty(); 1.23417 + } catch (e) { 1.23418 + ok(false, "unexpected exception thrown in: test_2d_path_closePath_empty"); 1.23419 + } 1.23420 + try { 1.23421 + test_2d_path_closePath_newline(); 1.23422 + } catch (e) { 1.23423 + ok(false, "unexpected exception thrown in: test_2d_path_closePath_newline"); 1.23424 + } 1.23425 + try { 1.23426 + test_2d_path_closePath_nextpoint(); 1.23427 + } catch (e) { 1.23428 + ok(false, "unexpected exception thrown in: test_2d_path_closePath_nextpoint"); 1.23429 + } 1.23430 + try { 1.23431 + test_2d_path_fill_closed_basic(); 1.23432 + } catch (e) { 1.23433 + ok(false, "unexpected exception thrown in: test_2d_path_fill_closed_basic"); 1.23434 + } 1.23435 + try { 1.23436 + test_2d_path_fill_closed_unaffected(); 1.23437 + } catch (e) { 1.23438 + ok(false, "unexpected exception thrown in: test_2d_path_fill_closed_unaffected"); 1.23439 + } 1.23440 + try { 1.23441 + test_2d_path_fill_overlap(); 1.23442 + } catch (e) { 1.23443 + ok(false, "unexpected exception thrown in: test_2d_path_fill_overlap"); 1.23444 + } 1.23445 + try { 1.23446 + test_2d_path_fill_winding_add(); 1.23447 + } catch (e) { 1.23448 + ok(false, "unexpected exception thrown in: test_2d_path_fill_winding_add"); 1.23449 + } 1.23450 + try { 1.23451 + test_2d_path_fill_winding_subtract_1(); 1.23452 + } catch (e) { 1.23453 + ok(false, "unexpected exception thrown in: test_2d_path_fill_winding_subtract_1"); 1.23454 + } 1.23455 + try { 1.23456 + test_2d_path_fill_winding_subtract_2(); 1.23457 + } catch (e) { 1.23458 + ok(false, "unexpected exception thrown in: test_2d_path_fill_winding_subtract_2"); 1.23459 + } 1.23460 + try { 1.23461 + test_2d_path_fill_winding_subtract_3(); 1.23462 + } catch (e) { 1.23463 + ok(false, "unexpected exception thrown in: test_2d_path_fill_winding_subtract_3"); 1.23464 + } 1.23465 + try { 1.23466 + test_2d_path_initial(); 1.23467 + } catch (e) { 1.23468 + ok(false, "unexpected exception thrown in: test_2d_path_initial"); 1.23469 + } 1.23470 + try { 1.23471 + test_2d_path_isPointInPath_arc(); 1.23472 + } catch (e) { 1.23473 + ok(false, "unexpected exception thrown in: test_2d_path_isPointInPath_arc"); 1.23474 + } 1.23475 + try { 1.23476 + test_2d_path_isPointInPath_basic_1(); 1.23477 + } catch (e) { 1.23478 + ok(false, "unexpected exception thrown in: test_2d_path_isPointInPath_basic_1"); 1.23479 + } 1.23480 + try { 1.23481 + test_2d_path_isPointInPath_basic_2(); 1.23482 + } catch (e) { 1.23483 + ok(false, "unexpected exception thrown in: test_2d_path_isPointInPath_basic_2"); 1.23484 + } 1.23485 + try { 1.23486 + test_2d_path_isPointInPath_bezier(); 1.23487 + } catch (e) { 1.23488 + ok(false, "unexpected exception thrown in: test_2d_path_isPointInPath_bezier"); 1.23489 + } 1.23490 + try { 1.23491 + test_2d_path_isPointInPath_bigarc(); 1.23492 + } catch (e) { 1.23493 + ok(false, "unexpected exception thrown in: test_2d_path_isPointInPath_bigarc"); 1.23494 + } 1.23495 + try { 1.23496 + test_2d_path_isPointInPath_edge(); 1.23497 + } catch (e) { 1.23498 + ok(false, "unexpected exception thrown in: test_2d_path_isPointInPath_edge"); 1.23499 + } 1.23500 + try { 1.23501 + test_2d_path_isPointInPath_empty(); 1.23502 + } catch (e) { 1.23503 + ok(false, "unexpected exception thrown in: test_2d_path_isPointInPath_empty"); 1.23504 + } 1.23505 + try { 1.23506 + test_2d_path_isPointInPath_nonfinite(); 1.23507 + } catch (e) { 1.23508 + ok(false, "unexpected exception thrown in: test_2d_path_isPointInPath_nonfinite"); 1.23509 + } 1.23510 + try { 1.23511 + test_2d_path_isPointInPath_outside(); 1.23512 + } catch (e) { 1.23513 + ok(false, "unexpected exception thrown in: test_2d_path_isPointInPath_outside"); 1.23514 + } 1.23515 + try { 1.23516 + test_2d_path_isPointInPath_subpath(); 1.23517 + } catch (e) { 1.23518 + ok(false, "unexpected exception thrown in: test_2d_path_isPointInPath_subpath"); 1.23519 + } 1.23520 + try { 1.23521 + test_2d_path_isPointInPath_transform_1(); 1.23522 + } catch (e) { 1.23523 + ok(false, "unexpected exception thrown in: test_2d_path_isPointInPath_transform_1"); 1.23524 + } 1.23525 + try { 1.23526 + test_2d_path_isPointInPath_transform_2(); 1.23527 + } catch (e) { 1.23528 + ok(false, "unexpected exception thrown in: test_2d_path_isPointInPath_transform_2"); 1.23529 + } 1.23530 + try { 1.23531 + test_2d_path_isPointInPath_transform_3(); 1.23532 + } catch (e) { 1.23533 + ok(false, "unexpected exception thrown in: test_2d_path_isPointInPath_transform_3"); 1.23534 + } 1.23535 + try { 1.23536 + test_2d_path_isPointInPath_unclosed(); 1.23537 + } catch (e) { 1.23538 + ok(false, "unexpected exception thrown in: test_2d_path_isPointInPath_unclosed"); 1.23539 + } 1.23540 + try { 1.23541 + test_2d_path_isPointInPath_winding(); 1.23542 + } catch (e) { 1.23543 + ok(false, "unexpected exception thrown in: test_2d_path_isPointInPath_winding"); 1.23544 + } 1.23545 + try { 1.23546 + test_2d_path_lineTo_basic(); 1.23547 + } catch (e) { 1.23548 + ok(false, "unexpected exception thrown in: test_2d_path_lineTo_basic"); 1.23549 + } 1.23550 + try { 1.23551 + test_2d_path_lineTo_emptysubpath(); 1.23552 + } catch (e) { 1.23553 + ok(false, "unexpected exception thrown in: test_2d_path_lineTo_emptysubpath"); 1.23554 + } 1.23555 + try { 1.23556 + test_2d_path_lineTo_nextpoint(); 1.23557 + } catch (e) { 1.23558 + ok(false, "unexpected exception thrown in: test_2d_path_lineTo_nextpoint"); 1.23559 + } 1.23560 + try { 1.23561 + test_2d_path_lineTo_nonfinite(); 1.23562 + } catch (e) { 1.23563 + ok(false, "unexpected exception thrown in: test_2d_path_lineTo_nonfinite"); 1.23564 + } 1.23565 + try { 1.23566 + test_2d_path_moveTo_basic(); 1.23567 + } catch (e) { 1.23568 + ok(false, "unexpected exception thrown in: test_2d_path_moveTo_basic"); 1.23569 + } 1.23570 + try { 1.23571 + test_2d_path_moveTo_multiple(); 1.23572 + } catch (e) { 1.23573 + ok(false, "unexpected exception thrown in: test_2d_path_moveTo_multiple"); 1.23574 + } 1.23575 + try { 1.23576 + test_2d_path_moveTo_newsubpath(); 1.23577 + } catch (e) { 1.23578 + ok(false, "unexpected exception thrown in: test_2d_path_moveTo_newsubpath"); 1.23579 + } 1.23580 + try { 1.23581 + test_2d_path_moveTo_nonfinite(); 1.23582 + } catch (e) { 1.23583 + ok(false, "unexpected exception thrown in: test_2d_path_moveTo_nonfinite"); 1.23584 + } 1.23585 + try { 1.23586 + test_2d_path_quadraticCurveTo_basic(); 1.23587 + } catch (e) { 1.23588 + ok(false, "unexpected exception thrown in: test_2d_path_quadraticCurveTo_basic"); 1.23589 + } 1.23590 + try { 1.23591 + test_2d_path_quadraticCurveTo_emptysubpath(); 1.23592 + } catch (e) { 1.23593 + ok(false, "unexpected exception thrown in: test_2d_path_quadraticCurveTo_emptysubpath"); 1.23594 + } 1.23595 + try { 1.23596 + test_2d_path_quadraticCurveTo_nonfinite(); 1.23597 + } catch (e) { 1.23598 + ok(false, "unexpected exception thrown in: test_2d_path_quadraticCurveTo_nonfinite"); 1.23599 + } 1.23600 + try { 1.23601 + test_2d_path_quadraticCurveTo_scaled(); 1.23602 + } catch (e) { 1.23603 + ok(false, "unexpected exception thrown in: test_2d_path_quadraticCurveTo_scaled"); 1.23604 + } 1.23605 + try { 1.23606 + test_2d_path_quadraticCurveTo_shape(); 1.23607 + } catch (e) { 1.23608 + ok(false, "unexpected exception thrown in: test_2d_path_quadraticCurveTo_shape"); 1.23609 + } 1.23610 + try { 1.23611 + test_2d_path_rect_basic(); 1.23612 + } catch (e) { 1.23613 + ok(false, "unexpected exception thrown in: test_2d_path_rect_basic"); 1.23614 + } 1.23615 + try { 1.23616 + test_2d_path_rect_closed(); 1.23617 + } catch (e) { 1.23618 + ok(false, "unexpected exception thrown in: test_2d_path_rect_closed"); 1.23619 + } 1.23620 + try { 1.23621 + test_2d_path_rect_end_1(); 1.23622 + } catch (e) { 1.23623 + ok(false, "unexpected exception thrown in: test_2d_path_rect_end_1"); 1.23624 + } 1.23625 + try { 1.23626 + test_2d_path_rect_end_2(); 1.23627 + } catch (e) { 1.23628 + ok(false, "unexpected exception thrown in: test_2d_path_rect_end_2"); 1.23629 + } 1.23630 + try { 1.23631 + test_2d_path_rect_negative(); 1.23632 + } catch (e) { 1.23633 + ok(false, "unexpected exception thrown in: test_2d_path_rect_negative"); 1.23634 + } 1.23635 + try { 1.23636 + test_2d_path_rect_newsubpath(); 1.23637 + } catch (e) { 1.23638 + ok(false, "unexpected exception thrown in: test_2d_path_rect_newsubpath"); 1.23639 + } 1.23640 + try { 1.23641 + test_2d_path_rect_nonfinite(); 1.23642 + } catch (e) { 1.23643 + ok(false, "unexpected exception thrown in: test_2d_path_rect_nonfinite"); 1.23644 + } 1.23645 + try { 1.23646 + test_2d_path_rect_winding(); 1.23647 + } catch (e) { 1.23648 + ok(false, "unexpected exception thrown in: test_2d_path_rect_winding"); 1.23649 + } 1.23650 + try { 1.23651 + test_2d_path_rect_zero_1(); 1.23652 + } catch (e) { 1.23653 + ok(false, "unexpected exception thrown in: test_2d_path_rect_zero_1"); 1.23654 + } 1.23655 + try { 1.23656 + test_2d_path_rect_zero_2(); 1.23657 + } catch (e) { 1.23658 + ok(false, "unexpected exception thrown in: test_2d_path_rect_zero_2"); 1.23659 + } 1.23660 + try { 1.23661 + test_2d_path_rect_zero_3(); 1.23662 + } catch (e) { 1.23663 + ok(false, "unexpected exception thrown in: test_2d_path_rect_zero_3"); 1.23664 + } 1.23665 + try { 1.23666 + test_2d_path_rect_zero_4(); 1.23667 + } catch (e) { 1.23668 + ok(false, "unexpected exception thrown in: test_2d_path_rect_zero_4"); 1.23669 + } 1.23670 + try { 1.23671 + test_2d_path_rect_zero_5(); 1.23672 + } catch (e) { 1.23673 + ok(false, "unexpected exception thrown in: test_2d_path_rect_zero_5"); 1.23674 + } 1.23675 + try { 1.23676 + test_2d_path_stroke_empty(); 1.23677 + } catch (e) { 1.23678 + ok(false, "unexpected exception thrown in: test_2d_path_stroke_empty"); 1.23679 + } 1.23680 + try { 1.23681 + test_2d_path_stroke_overlap(); 1.23682 + } catch (e) { 1.23683 + ok(false, "unexpected exception thrown in: test_2d_path_stroke_overlap"); 1.23684 + } 1.23685 + try { 1.23686 + test_2d_path_stroke_prune_arc(); 1.23687 + } catch (e) { 1.23688 + ok(false, "unexpected exception thrown in: test_2d_path_stroke_prune_arc"); 1.23689 + } 1.23690 + try { 1.23691 + test_2d_path_stroke_prune_closed(); 1.23692 + } catch (e) { 1.23693 + ok(false, "unexpected exception thrown in: test_2d_path_stroke_prune_closed"); 1.23694 + } 1.23695 + try { 1.23696 + test_2d_path_stroke_prune_corner(); 1.23697 + } catch (e) { 1.23698 + ok(false, "unexpected exception thrown in: test_2d_path_stroke_prune_corner"); 1.23699 + } 1.23700 + try { 1.23701 + test_2d_path_stroke_prune_curve(); 1.23702 + } catch (e) { 1.23703 + ok(false, "unexpected exception thrown in: test_2d_path_stroke_prune_curve"); 1.23704 + } 1.23705 + try { 1.23706 + test_2d_path_stroke_prune_line(); 1.23707 + } catch (e) { 1.23708 + ok(false, "unexpected exception thrown in: test_2d_path_stroke_prune_line"); 1.23709 + } 1.23710 + try { 1.23711 + test_2d_path_stroke_prune_rect(); 1.23712 + } catch (e) { 1.23713 + ok(false, "unexpected exception thrown in: test_2d_path_stroke_prune_rect"); 1.23714 + } 1.23715 + try { 1.23716 + test_2d_path_stroke_scale1(); 1.23717 + } catch (e) { 1.23718 + ok(false, "unexpected exception thrown in: test_2d_path_stroke_scale1"); 1.23719 + } 1.23720 + try { 1.23721 + test_2d_path_stroke_scale2(); 1.23722 + } catch (e) { 1.23723 + ok(false, "unexpected exception thrown in: test_2d_path_stroke_scale2"); 1.23724 + } 1.23725 + try { 1.23726 + test_2d_path_stroke_skew(); 1.23727 + } catch (e) { 1.23728 + ok(false, "unexpected exception thrown in: test_2d_path_stroke_skew"); 1.23729 + } 1.23730 + try { 1.23731 + test_2d_path_stroke_unaffected(); 1.23732 + } catch (e) { 1.23733 + ok(false, "unexpected exception thrown in: test_2d_path_stroke_unaffected"); 1.23734 + } 1.23735 + try { 1.23736 + test_2d_path_stroke_union(); 1.23737 + } catch (e) { 1.23738 + ok(false, "unexpected exception thrown in: test_2d_path_stroke_union"); 1.23739 + } 1.23740 + try { 1.23741 + test_2d_path_transformation_basic(); 1.23742 + } catch (e) { 1.23743 + ok(false, "unexpected exception thrown in: test_2d_path_transformation_basic"); 1.23744 + } 1.23745 + try { 1.23746 + test_2d_path_transformation_changing(); 1.23747 + } catch (e) { 1.23748 + ok(false, "unexpected exception thrown in: test_2d_path_transformation_changing"); 1.23749 + } 1.23750 + try { 1.23751 + test_2d_path_transformation_multiple(); 1.23752 + } catch (e) { 1.23753 + ok(false, "unexpected exception thrown in: test_2d_path_transformation_multiple"); 1.23754 + } 1.23755 + try { 1.23756 + test_2d_pattern_animated_gif(); 1.23757 + } catch (e) { 1.23758 + ok(false, "unexpected exception thrown in: test_2d_pattern_animated_gif"); 1.23759 + } 1.23760 + try { 1.23761 + test_2d_pattern_basic_canvas(); 1.23762 + } catch (e) { 1.23763 + ok(false, "unexpected exception thrown in: test_2d_pattern_basic_canvas"); 1.23764 + } 1.23765 + try { 1.23766 + test_2d_pattern_basic_image(); 1.23767 + } catch (e) { 1.23768 + ok(false, "unexpected exception thrown in: test_2d_pattern_basic_image"); 1.23769 + } 1.23770 + try { 1.23771 + test_2d_pattern_basic_nocontext(); 1.23772 + } catch (e) { 1.23773 + ok(false, "unexpected exception thrown in: test_2d_pattern_basic_nocontext"); 1.23774 + } 1.23775 + try { 1.23776 + test_2d_pattern_basic_type(); 1.23777 + } catch (e) { 1.23778 + ok(false, "unexpected exception thrown in: test_2d_pattern_basic_type"); 1.23779 + } 1.23780 + try { 1.23781 + test_2d_pattern_basic_zerocanvas(); 1.23782 + } catch (e) { 1.23783 + ok(false, "unexpected exception thrown in: test_2d_pattern_basic_zerocanvas"); 1.23784 + } 1.23785 + try { 1.23786 + test_2d_pattern_crosscanvas(); 1.23787 + } catch (e) { 1.23788 + ok(false, "unexpected exception thrown in: test_2d_pattern_crosscanvas"); 1.23789 + } 1.23790 + try { 1.23791 + test_2d_pattern_image_broken(); 1.23792 + } catch (e) { 1.23793 + ok(false, "unexpected exception thrown in: test_2d_pattern_image_broken"); 1.23794 + } 1.23795 + try { 1.23796 + test_2d_pattern_image_incomplete(); 1.23797 + } catch (e) { 1.23798 + ok(false, "unexpected exception thrown in: test_2d_pattern_image_incomplete"); 1.23799 + } 1.23800 + try { 1.23801 + test_2d_pattern_image_null(); 1.23802 + } catch (e) { 1.23803 + ok(false, "unexpected exception thrown in: test_2d_pattern_image_null"); 1.23804 + } 1.23805 + try { 1.23806 + test_2d_pattern_image_string(); 1.23807 + } catch (e) { 1.23808 + ok(false, "unexpected exception thrown in: test_2d_pattern_image_string"); 1.23809 + } 1.23810 + try { 1.23811 + test_2d_pattern_image_undefined(); 1.23812 + } catch (e) { 1.23813 + ok(false, "unexpected exception thrown in: test_2d_pattern_image_undefined"); 1.23814 + } 1.23815 + try { 1.23816 + test_2d_pattern_modify_canvas1(); 1.23817 + } catch (e) { 1.23818 + ok(false, "unexpected exception thrown in: test_2d_pattern_modify_canvas1"); 1.23819 + } 1.23820 + try { 1.23821 + test_2d_pattern_modify_canvas2(); 1.23822 + } catch (e) { 1.23823 + ok(false, "unexpected exception thrown in: test_2d_pattern_modify_canvas2"); 1.23824 + } 1.23825 + try { 1.23826 + test_2d_pattern_modify_image1(); 1.23827 + } catch (e) { 1.23828 + ok(false, "unexpected exception thrown in: test_2d_pattern_modify_image1"); 1.23829 + } 1.23830 + try { 1.23831 + test_2d_pattern_modify_image2(); 1.23832 + } catch (e) { 1.23833 + ok(false, "unexpected exception thrown in: test_2d_pattern_modify_image2"); 1.23834 + } 1.23835 + try { 1.23836 + test_2d_pattern_paint_norepeat_basic(); 1.23837 + } catch (e) { 1.23838 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_norepeat_basic"); 1.23839 + } 1.23840 + try { 1.23841 + test_2d_pattern_paint_norepeat_coord1(); 1.23842 + } catch (e) { 1.23843 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_norepeat_coord1"); 1.23844 + } 1.23845 + try { 1.23846 + test_2d_pattern_paint_norepeat_coord2(); 1.23847 + } catch (e) { 1.23848 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_norepeat_coord2"); 1.23849 + } 1.23850 + try { 1.23851 + test_2d_pattern_paint_norepeat_coord3(); 1.23852 + } catch (e) { 1.23853 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_norepeat_coord3"); 1.23854 + } 1.23855 + try { 1.23856 + test_2d_pattern_paint_norepeat_outside(); 1.23857 + } catch (e) { 1.23858 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_norepeat_outside"); 1.23859 + } 1.23860 + try { 1.23861 + test_2d_pattern_paint_orientation_canvas(); 1.23862 + } catch (e) { 1.23863 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_orientation_canvas"); 1.23864 + } 1.23865 + try { 1.23866 + test_2d_pattern_paint_orientation_image(); 1.23867 + } catch (e) { 1.23868 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_orientation_image"); 1.23869 + } 1.23870 + try { 1.23871 + test_2d_pattern_paint_repeat_basic(); 1.23872 + } catch (e) { 1.23873 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_repeat_basic"); 1.23874 + } 1.23875 + try { 1.23876 + test_2d_pattern_paint_repeat_coord1(); 1.23877 + } catch (e) { 1.23878 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_repeat_coord1"); 1.23879 + } 1.23880 + try { 1.23881 + test_2d_pattern_paint_repeat_coord2(); 1.23882 + } catch (e) { 1.23883 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_repeat_coord2"); 1.23884 + } 1.23885 + try { 1.23886 + test_2d_pattern_paint_repeat_coord3(); 1.23887 + } catch (e) { 1.23888 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_repeat_coord3"); 1.23889 + } 1.23890 + try { 1.23891 + test_2d_pattern_paint_repeat_outside(); 1.23892 + } catch (e) { 1.23893 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_repeat_outside"); 1.23894 + } 1.23895 + try { 1.23896 + test_2d_pattern_paint_repeatx_basic(); 1.23897 + } catch (e) { 1.23898 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_repeatx_basic"); 1.23899 + } 1.23900 + try { 1.23901 + test_2d_pattern_paint_repeatx_coord1(); 1.23902 + } catch (e) { 1.23903 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_repeatx_coord1"); 1.23904 + } 1.23905 + try { 1.23906 + test_2d_pattern_paint_repeatx_outside(); 1.23907 + } catch (e) { 1.23908 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_repeatx_outside"); 1.23909 + } 1.23910 + try { 1.23911 + test_2d_pattern_paint_repeaty_basic(); 1.23912 + } catch (e) { 1.23913 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_repeaty_basic"); 1.23914 + } 1.23915 + try { 1.23916 + test_2d_pattern_paint_repeaty_coord1(); 1.23917 + } catch (e) { 1.23918 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_repeaty_coord1"); 1.23919 + } 1.23920 + try { 1.23921 + test_2d_pattern_paint_repeaty_outside(); 1.23922 + } catch (e) { 1.23923 + ok(false, "unexpected exception thrown in: test_2d_pattern_paint_repeaty_outside"); 1.23924 + } 1.23925 + try { 1.23926 + test_2d_pattern_repeat_case(); 1.23927 + } catch (e) { 1.23928 + ok(false, "unexpected exception thrown in: test_2d_pattern_repeat_case"); 1.23929 + } 1.23930 + try { 1.23931 + test_2d_pattern_repeat_empty(); 1.23932 + } catch (e) { 1.23933 + ok(false, "unexpected exception thrown in: test_2d_pattern_repeat_empty"); 1.23934 + } 1.23935 + try { 1.23936 + test_2d_pattern_repeat_null(); 1.23937 + } catch (e) { 1.23938 + ok(false, "unexpected exception thrown in: test_2d_pattern_repeat_null"); 1.23939 + } 1.23940 + try { 1.23941 + test_2d_pattern_repeat_nullsuffix(); 1.23942 + } catch (e) { 1.23943 + ok(false, "unexpected exception thrown in: test_2d_pattern_repeat_nullsuffix"); 1.23944 + } 1.23945 + try { 1.23946 + test_2d_pattern_repeat_undefined(); 1.23947 + } catch (e) { 1.23948 + ok(false, "unexpected exception thrown in: test_2d_pattern_repeat_undefined"); 1.23949 + } 1.23950 + try { 1.23951 + test_2d_pattern_repeat_unrecognised(); 1.23952 + } catch (e) { 1.23953 + ok(false, "unexpected exception thrown in: test_2d_pattern_repeat_unrecognised"); 1.23954 + } 1.23955 + try { 1.23956 + test_2d_scaled(); 1.23957 + } catch (e) { 1.23958 + ok(false, "unexpected exception thrown in: test_2d_scaled"); 1.23959 + } 1.23960 + try { 1.23961 + test_2d_shadow_alpha_1(); 1.23962 + } catch (e) { 1.23963 + ok(false, "unexpected exception thrown in: test_2d_shadow_alpha_1"); 1.23964 + } 1.23965 + try { 1.23966 + test_2d_shadow_alpha_2(); 1.23967 + } catch (e) { 1.23968 + ok(false, "unexpected exception thrown in: test_2d_shadow_alpha_2"); 1.23969 + } 1.23970 + try { 1.23971 + test_2d_shadow_alpha_3(); 1.23972 + } catch (e) { 1.23973 + ok(false, "unexpected exception thrown in: test_2d_shadow_alpha_3"); 1.23974 + } 1.23975 + try { 1.23976 + test_2d_shadow_alpha_4(); 1.23977 + } catch (e) { 1.23978 + ok(false, "unexpected exception thrown in: test_2d_shadow_alpha_4"); 1.23979 + } 1.23980 + try { 1.23981 + test_2d_shadow_alpha_5(); 1.23982 + } catch (e) { 1.23983 + ok(false, "unexpected exception thrown in: test_2d_shadow_alpha_5"); 1.23984 + } 1.23985 + try { 1.23986 + test_2d_shadow_attributes_shadowBlur_1(); 1.23987 + } catch (e) { 1.23988 + ok(false, "unexpected exception thrown in: test_2d_shadow_attributes_shadowBlur_1"); 1.23989 + } 1.23990 + try { 1.23991 + test_2d_shadow_attributes_shadowBlur_2(); 1.23992 + } catch (e) { 1.23993 + ok(false, "unexpected exception thrown in: test_2d_shadow_attributes_shadowBlur_2"); 1.23994 + } 1.23995 + try { 1.23996 + test_2d_shadow_attributes_shadowColor_1(); 1.23997 + } catch (e) { 1.23998 + ok(false, "unexpected exception thrown in: test_2d_shadow_attributes_shadowColor_1"); 1.23999 + } 1.24000 + try { 1.24001 + test_2d_shadow_attributes_shadowColor_2(); 1.24002 + } catch (e) { 1.24003 + ok(false, "unexpected exception thrown in: test_2d_shadow_attributes_shadowColor_2"); 1.24004 + } 1.24005 + try { 1.24006 + test_2d_shadow_attributes_shadowOffset_1(); 1.24007 + } catch (e) { 1.24008 + ok(false, "unexpected exception thrown in: test_2d_shadow_attributes_shadowOffset_1"); 1.24009 + } 1.24010 + try { 1.24011 + test_2d_shadow_attributes_shadowOffset_2(); 1.24012 + } catch (e) { 1.24013 + ok(false, "unexpected exception thrown in: test_2d_shadow_attributes_shadowOffset_2"); 1.24014 + } 1.24015 + try { 1.24016 + test_2d_shadow_basic_1(); 1.24017 + } catch (e) { 1.24018 + ok(false, "unexpected exception thrown in: test_2d_shadow_basic_1"); 1.24019 + } 1.24020 + try { 1.24021 + test_2d_shadow_basic_2(); 1.24022 + } catch (e) { 1.24023 + ok(false, "unexpected exception thrown in: test_2d_shadow_basic_2"); 1.24024 + } 1.24025 + try { 1.24026 + test_2d_shadow_blur_high(); 1.24027 + } catch (e) { 1.24028 + ok(false, "unexpected exception thrown in: test_2d_shadow_blur_high"); 1.24029 + } 1.24030 + try { 1.24031 + test_2d_shadow_blur_low(); 1.24032 + } catch (e) { 1.24033 + ok(false, "unexpected exception thrown in: test_2d_shadow_blur_low"); 1.24034 + } 1.24035 + try { 1.24036 + test_2d_shadow_canvas_alpha(); 1.24037 + } catch (e) { 1.24038 + ok(false, "unexpected exception thrown in: test_2d_shadow_canvas_alpha"); 1.24039 + } 1.24040 + try { 1.24041 + test_2d_shadow_canvas_basic(); 1.24042 + } catch (e) { 1.24043 + ok(false, "unexpected exception thrown in: test_2d_shadow_canvas_basic"); 1.24044 + } 1.24045 + try { 1.24046 + test_2d_shadow_canvas_transparent_1(); 1.24047 + } catch (e) { 1.24048 + ok(false, "unexpected exception thrown in: test_2d_shadow_canvas_transparent_1"); 1.24049 + } 1.24050 + try { 1.24051 + test_2d_shadow_canvas_transparent_2(); 1.24052 + } catch (e) { 1.24053 + ok(false, "unexpected exception thrown in: test_2d_shadow_canvas_transparent_2"); 1.24054 + } 1.24055 + try { 1.24056 + test_2d_shadow_clip_1(); 1.24057 + } catch (e) { 1.24058 + ok(false, "unexpected exception thrown in: test_2d_shadow_clip_1"); 1.24059 + } 1.24060 + try { 1.24061 + test_2d_shadow_clip_2(); 1.24062 + } catch (e) { 1.24063 + ok(false, "unexpected exception thrown in: test_2d_shadow_clip_2"); 1.24064 + } 1.24065 + try { 1.24066 + test_2d_shadow_clip_3(); 1.24067 + } catch (e) { 1.24068 + ok(false, "unexpected exception thrown in: test_2d_shadow_clip_3"); 1.24069 + } 1.24070 + try { 1.24071 + test_2d_shadow_composite_1(); 1.24072 + } catch (e) { 1.24073 + ok(false, "unexpected exception thrown in: test_2d_shadow_composite_1"); 1.24074 + } 1.24075 + try { 1.24076 + test_2d_shadow_composite_2(); 1.24077 + } catch (e) { 1.24078 + ok(false, "unexpected exception thrown in: test_2d_shadow_composite_2"); 1.24079 + } 1.24080 + try { 1.24081 + test_2d_shadow_gradient_alpha(); 1.24082 + } catch (e) { 1.24083 + ok(false, "unexpected exception thrown in: test_2d_shadow_gradient_alpha"); 1.24084 + } 1.24085 + try { 1.24086 + test_2d_shadow_gradient_basic(); 1.24087 + } catch (e) { 1.24088 + ok(false, "unexpected exception thrown in: test_2d_shadow_gradient_basic"); 1.24089 + } 1.24090 + try { 1.24091 + test_2d_shadow_gradient_transparent_1(); 1.24092 + } catch (e) { 1.24093 + ok(false, "unexpected exception thrown in: test_2d_shadow_gradient_transparent_1"); 1.24094 + } 1.24095 + try { 1.24096 + test_2d_shadow_gradient_transparent_2(); 1.24097 + } catch (e) { 1.24098 + ok(false, "unexpected exception thrown in: test_2d_shadow_gradient_transparent_2"); 1.24099 + } 1.24100 + try { 1.24101 + test_2d_shadow_image_alpha(); 1.24102 + } catch (e) { 1.24103 + ok(false, "unexpected exception thrown in: test_2d_shadow_image_alpha"); 1.24104 + } 1.24105 + try { 1.24106 + test_2d_shadow_image_basic(); 1.24107 + } catch (e) { 1.24108 + ok(false, "unexpected exception thrown in: test_2d_shadow_image_basic"); 1.24109 + } 1.24110 + try { 1.24111 + test_2d_shadow_image_scale(); 1.24112 + } catch (e) { 1.24113 + ok(false, "unexpected exception thrown in: test_2d_shadow_image_scale"); 1.24114 + } 1.24115 + try { 1.24116 + test_2d_shadow_image_section(); 1.24117 + } catch (e) { 1.24118 + ok(false, "unexpected exception thrown in: test_2d_shadow_image_section"); 1.24119 + } 1.24120 + try { 1.24121 + test_2d_shadow_image_transparent_1(); 1.24122 + } catch (e) { 1.24123 + ok(false, "unexpected exception thrown in: test_2d_shadow_image_transparent_1"); 1.24124 + } 1.24125 + try { 1.24126 + test_2d_shadow_image_transparent_2(); 1.24127 + } catch (e) { 1.24128 + ok(false, "unexpected exception thrown in: test_2d_shadow_image_transparent_2"); 1.24129 + } 1.24130 + try { 1.24131 + test_2d_shadow_offset_negativeX(); 1.24132 + } catch (e) { 1.24133 + ok(false, "unexpected exception thrown in: test_2d_shadow_offset_negativeX"); 1.24134 + } 1.24135 + try { 1.24136 + test_2d_shadow_offset_negativeY(); 1.24137 + } catch (e) { 1.24138 + ok(false, "unexpected exception thrown in: test_2d_shadow_offset_negativeY"); 1.24139 + } 1.24140 + try { 1.24141 + test_2d_shadow_offset_positiveX(); 1.24142 + } catch (e) { 1.24143 + ok(false, "unexpected exception thrown in: test_2d_shadow_offset_positiveX"); 1.24144 + } 1.24145 + try { 1.24146 + test_2d_shadow_offset_positiveY(); 1.24147 + } catch (e) { 1.24148 + ok(false, "unexpected exception thrown in: test_2d_shadow_offset_positiveY"); 1.24149 + } 1.24150 + try { 1.24151 + test_2d_shadow_outside(); 1.24152 + } catch (e) { 1.24153 + ok(false, "unexpected exception thrown in: test_2d_shadow_outside"); 1.24154 + } 1.24155 + try { 1.24156 + test_2d_shadow_pattern_alpha(); 1.24157 + } catch (e) { 1.24158 + ok(false, "unexpected exception thrown in: test_2d_shadow_pattern_alpha"); 1.24159 + } 1.24160 + try { 1.24161 + test_2d_shadow_pattern_basic(); 1.24162 + } catch (e) { 1.24163 + ok(false, "unexpected exception thrown in: test_2d_shadow_pattern_basic"); 1.24164 + } 1.24165 + try { 1.24166 + test_2d_shadow_pattern_transparent_1(); 1.24167 + } catch (e) { 1.24168 + ok(false, "unexpected exception thrown in: test_2d_shadow_pattern_transparent_1"); 1.24169 + } 1.24170 + try { 1.24171 + test_2d_shadow_pattern_transparent_2(); 1.24172 + } catch (e) { 1.24173 + ok(false, "unexpected exception thrown in: test_2d_shadow_pattern_transparent_2"); 1.24174 + } 1.24175 + try { 1.24176 + test_2d_shadow_stroke_basic(); 1.24177 + } catch (e) { 1.24178 + ok(false, "unexpected exception thrown in: test_2d_shadow_stroke_basic"); 1.24179 + } 1.24180 + try { 1.24181 + test_2d_shadow_stroke_cap_1(); 1.24182 + } catch (e) { 1.24183 + ok(false, "unexpected exception thrown in: test_2d_shadow_stroke_cap_1"); 1.24184 + } 1.24185 + try { 1.24186 + test_2d_shadow_stroke_cap_2(); 1.24187 + } catch (e) { 1.24188 + ok(false, "unexpected exception thrown in: test_2d_shadow_stroke_cap_2"); 1.24189 + } 1.24190 + try { 1.24191 + test_2d_shadow_stroke_join_1(); 1.24192 + } catch (e) { 1.24193 + ok(false, "unexpected exception thrown in: test_2d_shadow_stroke_join_1"); 1.24194 + } 1.24195 + try { 1.24196 + test_2d_shadow_stroke_join_2(); 1.24197 + } catch (e) { 1.24198 + ok(false, "unexpected exception thrown in: test_2d_shadow_stroke_join_2"); 1.24199 + } 1.24200 + try { 1.24201 + test_2d_shadow_stroke_join_3(); 1.24202 + } catch (e) { 1.24203 + ok(false, "unexpected exception thrown in: test_2d_shadow_stroke_join_3"); 1.24204 + } 1.24205 + try { 1.24206 + test_2d_shadow_transform_1(); 1.24207 + } catch (e) { 1.24208 + ok(false, "unexpected exception thrown in: test_2d_shadow_transform_1"); 1.24209 + } 1.24210 + try { 1.24211 + test_2d_shadow_transform_2(); 1.24212 + } catch (e) { 1.24213 + ok(false, "unexpected exception thrown in: test_2d_shadow_transform_2"); 1.24214 + } 1.24215 + try { 1.24216 + test_2d_state_saverestore_bitmap(); 1.24217 + } catch (e) { 1.24218 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_bitmap"); 1.24219 + } 1.24220 + try { 1.24221 + test_2d_state_saverestore_clip(); 1.24222 + } catch (e) { 1.24223 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_clip"); 1.24224 + } 1.24225 + try { 1.24226 + test_2d_state_saverestore_fillStyle(); 1.24227 + } catch (e) { 1.24228 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_fillStyle"); 1.24229 + } 1.24230 + try { 1.24231 + test_2d_state_saverestore_globalAlpha(); 1.24232 + } catch (e) { 1.24233 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_globalAlpha"); 1.24234 + } 1.24235 + try { 1.24236 + test_2d_state_saverestore_globalCompositeOperation(); 1.24237 + } catch (e) { 1.24238 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_globalCompositeOperation"); 1.24239 + } 1.24240 + try { 1.24241 + test_2d_state_saverestore_lineCap(); 1.24242 + } catch (e) { 1.24243 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_lineCap"); 1.24244 + } 1.24245 + try { 1.24246 + test_2d_state_saverestore_lineJoin(); 1.24247 + } catch (e) { 1.24248 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_lineJoin"); 1.24249 + } 1.24250 + try { 1.24251 + test_2d_state_saverestore_lineWidth(); 1.24252 + } catch (e) { 1.24253 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_lineWidth"); 1.24254 + } 1.24255 + try { 1.24256 + test_2d_state_saverestore_miterLimit(); 1.24257 + } catch (e) { 1.24258 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_miterLimit"); 1.24259 + } 1.24260 + try { 1.24261 + test_2d_state_saverestore_path(); 1.24262 + } catch (e) { 1.24263 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_path"); 1.24264 + } 1.24265 + try { 1.24266 + test_2d_state_saverestore_shadowBlur(); 1.24267 + } catch (e) { 1.24268 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_shadowBlur"); 1.24269 + } 1.24270 + try { 1.24271 + test_2d_state_saverestore_shadowColor(); 1.24272 + } catch (e) { 1.24273 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_shadowColor"); 1.24274 + } 1.24275 + try { 1.24276 + test_2d_state_saverestore_shadowOffsetX(); 1.24277 + } catch (e) { 1.24278 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_shadowOffsetX"); 1.24279 + } 1.24280 + try { 1.24281 + test_2d_state_saverestore_shadowOffsetY(); 1.24282 + } catch (e) { 1.24283 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_shadowOffsetY"); 1.24284 + } 1.24285 + try { 1.24286 + test_2d_state_saverestore_stack(); 1.24287 + } catch (e) { 1.24288 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_stack"); 1.24289 + } 1.24290 + try { 1.24291 + test_2d_state_saverestore_stackdepth(); 1.24292 + } catch (e) { 1.24293 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_stackdepth"); 1.24294 + } 1.24295 + try { 1.24296 + test_2d_state_saverestore_strokeStyle(); 1.24297 + } catch (e) { 1.24298 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_strokeStyle"); 1.24299 + } 1.24300 + try { 1.24301 + test_2d_state_saverestore_transformation(); 1.24302 + } catch (e) { 1.24303 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_transformation"); 1.24304 + } 1.24305 + try { 1.24306 + test_2d_state_saverestore_underflow(); 1.24307 + } catch (e) { 1.24308 + ok(false, "unexpected exception thrown in: test_2d_state_saverestore_underflow"); 1.24309 + } 1.24310 + try { 1.24311 + test_2d_strokeRect_basic(); 1.24312 + } catch (e) { 1.24313 + ok(false, "unexpected exception thrown in: test_2d_strokeRect_basic"); 1.24314 + } 1.24315 + try { 1.24316 + test_2d_strokeRect_clip(); 1.24317 + } catch (e) { 1.24318 + ok(false, "unexpected exception thrown in: test_2d_strokeRect_clip"); 1.24319 + } 1.24320 + try { 1.24321 + test_2d_strokeRect_globalalpha(); 1.24322 + } catch (e) { 1.24323 + ok(false, "unexpected exception thrown in: test_2d_strokeRect_globalalpha"); 1.24324 + } 1.24325 + try { 1.24326 + test_2d_strokeRect_globalcomposite(); 1.24327 + } catch (e) { 1.24328 + ok(false, "unexpected exception thrown in: test_2d_strokeRect_globalcomposite"); 1.24329 + } 1.24330 + try { 1.24331 + test_2d_strokeRect_negative(); 1.24332 + } catch (e) { 1.24333 + ok(false, "unexpected exception thrown in: test_2d_strokeRect_negative"); 1.24334 + } 1.24335 + try { 1.24336 + test_2d_strokeRect_nonfinite(); 1.24337 + } catch (e) { 1.24338 + ok(false, "unexpected exception thrown in: test_2d_strokeRect_nonfinite"); 1.24339 + } 1.24340 + try { 1.24341 + test_2d_strokeRect_path(); 1.24342 + } catch (e) { 1.24343 + ok(false, "unexpected exception thrown in: test_2d_strokeRect_path"); 1.24344 + } 1.24345 + try { 1.24346 + test_2d_strokeRect_shadow(); 1.24347 + } catch (e) { 1.24348 + ok(false, "unexpected exception thrown in: test_2d_strokeRect_shadow"); 1.24349 + } 1.24350 + try { 1.24351 + test_2d_strokeRect_transform(); 1.24352 + } catch (e) { 1.24353 + ok(false, "unexpected exception thrown in: test_2d_strokeRect_transform"); 1.24354 + } 1.24355 + try { 1.24356 + test_2d_strokeRect_zero_1(); 1.24357 + } catch (e) { 1.24358 + ok(false, "unexpected exception thrown in: test_2d_strokeRect_zero_1"); 1.24359 + } 1.24360 + try { 1.24361 + test_2d_strokeRect_zero_2(); 1.24362 + } catch (e) { 1.24363 + ok(false, "unexpected exception thrown in: test_2d_strokeRect_zero_2"); 1.24364 + } 1.24365 + try { 1.24366 + test_2d_strokeRect_zero_3(); 1.24367 + } catch (e) { 1.24368 + ok(false, "unexpected exception thrown in: test_2d_strokeRect_zero_3"); 1.24369 + } 1.24370 + try { 1.24371 + test_2d_strokeRect_zero_4(); 1.24372 + } catch (e) { 1.24373 + ok(false, "unexpected exception thrown in: test_2d_strokeRect_zero_4"); 1.24374 + } 1.24375 + try { 1.24376 + test_2d_strokeStyle_default(); 1.24377 + } catch (e) { 1.24378 + ok(false, "unexpected exception thrown in: test_2d_strokeStyle_default"); 1.24379 + } 1.24380 + try { 1.24381 + test_2d_text_align_default(); 1.24382 + } catch (e) { 1.24383 + ok(false, "unexpected exception thrown in: test_2d_text_align_default"); 1.24384 + } 1.24385 + try { 1.24386 + test_2d_text_align_invalid(); 1.24387 + } catch (e) { 1.24388 + ok(false, "unexpected exception thrown in: test_2d_text_align_invalid"); 1.24389 + } 1.24390 + try { 1.24391 + test_2d_text_baseline_default(); 1.24392 + } catch (e) { 1.24393 + ok(false, "unexpected exception thrown in: test_2d_text_baseline_default"); 1.24394 + } 1.24395 + try { 1.24396 + test_2d_text_baseline_invalid(); 1.24397 + } catch (e) { 1.24398 + ok(false, "unexpected exception thrown in: test_2d_text_baseline_invalid"); 1.24399 + } 1.24400 + try { 1.24401 + test_2d_transformation_order(); 1.24402 + } catch (e) { 1.24403 + ok(false, "unexpected exception thrown in: test_2d_transformation_order"); 1.24404 + } 1.24405 + try { 1.24406 + test_2d_transformation_rotate_direction(); 1.24407 + } catch (e) { 1.24408 + ok(false, "unexpected exception thrown in: test_2d_transformation_rotate_direction"); 1.24409 + } 1.24410 + try { 1.24411 + test_2d_transformation_rotate_nonfinite(); 1.24412 + } catch (e) { 1.24413 + ok(false, "unexpected exception thrown in: test_2d_transformation_rotate_nonfinite"); 1.24414 + } 1.24415 + try { 1.24416 + test_2d_transformation_rotate_radians(); 1.24417 + } catch (e) { 1.24418 + ok(false, "unexpected exception thrown in: test_2d_transformation_rotate_radians"); 1.24419 + } 1.24420 + try { 1.24421 + test_2d_transformation_rotate_wrap(); 1.24422 + } catch (e) { 1.24423 + ok(false, "unexpected exception thrown in: test_2d_transformation_rotate_wrap"); 1.24424 + } 1.24425 + try { 1.24426 + test_2d_transformation_rotate_wrapnegative(); 1.24427 + } catch (e) { 1.24428 + ok(false, "unexpected exception thrown in: test_2d_transformation_rotate_wrapnegative"); 1.24429 + } 1.24430 + try { 1.24431 + test_2d_transformation_rotate_zero(); 1.24432 + } catch (e) { 1.24433 + ok(false, "unexpected exception thrown in: test_2d_transformation_rotate_zero"); 1.24434 + } 1.24435 + try { 1.24436 + test_2d_transformation_scale_basic(); 1.24437 + } catch (e) { 1.24438 + ok(false, "unexpected exception thrown in: test_2d_transformation_scale_basic"); 1.24439 + } 1.24440 + try { 1.24441 + test_2d_transformation_scale_large(); 1.24442 + } catch (e) { 1.24443 + ok(false, "unexpected exception thrown in: test_2d_transformation_scale_large"); 1.24444 + } 1.24445 + try { 1.24446 + test_2d_transformation_scale_multiple(); 1.24447 + } catch (e) { 1.24448 + ok(false, "unexpected exception thrown in: test_2d_transformation_scale_multiple"); 1.24449 + } 1.24450 + try { 1.24451 + test_2d_transformation_scale_negative(); 1.24452 + } catch (e) { 1.24453 + ok(false, "unexpected exception thrown in: test_2d_transformation_scale_negative"); 1.24454 + } 1.24455 + try { 1.24456 + test_2d_transformation_scale_nonfinite(); 1.24457 + } catch (e) { 1.24458 + ok(false, "unexpected exception thrown in: test_2d_transformation_scale_nonfinite"); 1.24459 + } 1.24460 + try { 1.24461 + test_2d_transformation_scale_zero(); 1.24462 + } catch (e) { 1.24463 + ok(false, "unexpected exception thrown in: test_2d_transformation_scale_zero"); 1.24464 + } 1.24465 + try { 1.24466 + test_2d_transformation_setTransform_multiple(); 1.24467 + } catch (e) { 1.24468 + ok(false, "unexpected exception thrown in: test_2d_transformation_setTransform_multiple"); 1.24469 + } 1.24470 + try { 1.24471 + test_2d_transformation_setTransform_nonfinite(); 1.24472 + } catch (e) { 1.24473 + ok(false, "unexpected exception thrown in: test_2d_transformation_setTransform_nonfinite"); 1.24474 + } 1.24475 + try { 1.24476 + test_2d_transformation_setTransform_skewed(); 1.24477 + } catch (e) { 1.24478 + ok(false, "unexpected exception thrown in: test_2d_transformation_setTransform_skewed"); 1.24479 + } 1.24480 + try { 1.24481 + test_2d_transformation_transform_identity(); 1.24482 + } catch (e) { 1.24483 + ok(false, "unexpected exception thrown in: test_2d_transformation_transform_identity"); 1.24484 + } 1.24485 + try { 1.24486 + test_2d_transformation_transform_multiply(); 1.24487 + } catch (e) { 1.24488 + ok(false, "unexpected exception thrown in: test_2d_transformation_transform_multiply"); 1.24489 + } 1.24490 + try { 1.24491 + test_2d_transformation_transform_nonfinite(); 1.24492 + } catch (e) { 1.24493 + ok(false, "unexpected exception thrown in: test_2d_transformation_transform_nonfinite"); 1.24494 + } 1.24495 + try { 1.24496 + test_2d_transformation_transform_skewed(); 1.24497 + } catch (e) { 1.24498 + ok(false, "unexpected exception thrown in: test_2d_transformation_transform_skewed"); 1.24499 + } 1.24500 + try { 1.24501 + test_2d_transformation_translate_basic(); 1.24502 + } catch (e) { 1.24503 + ok(false, "unexpected exception thrown in: test_2d_transformation_translate_basic"); 1.24504 + } 1.24505 + try { 1.24506 + test_2d_transformation_translate_nonfinite(); 1.24507 + } catch (e) { 1.24508 + ok(false, "unexpected exception thrown in: test_2d_transformation_translate_nonfinite"); 1.24509 + } 1.24510 + try { 1.24511 + test_2d_type_exists(); 1.24512 + } catch (e) { 1.24513 + ok(false, "unexpected exception thrown in: test_2d_type_exists"); 1.24514 + } 1.24515 + try { 1.24516 + test_2d_type_extend(); 1.24517 + } catch (e) { 1.24518 + ok(false, "unexpected exception thrown in: test_2d_type_extend"); 1.24519 + } 1.24520 + try { 1.24521 + test_2d_type_prototype(); 1.24522 + } catch (e) { 1.24523 + ok(false, "unexpected exception thrown in: test_2d_type_prototype"); 1.24524 + } 1.24525 + try { 1.24526 + test_2d_type_replace(); 1.24527 + } catch (e) { 1.24528 + ok(false, "unexpected exception thrown in: test_2d_type_replace"); 1.24529 + } 1.24530 + try { 1.24531 + test_2d_voidreturn(); 1.24532 + } catch (e) { 1.24533 + ok(false, "unexpected exception thrown in: test_2d_voidreturn"); 1.24534 + } 1.24535 + try { 1.24536 + test_bug397524(); 1.24537 + } catch (e) { 1.24538 + ok(false, "unexpected exception thrown in: test_bug397524"); 1.24539 + } 1.24540 + try { 1.24541 + test_bug405982(); 1.24542 + } catch (e) { 1.24543 + ok(false, "unexpected exception thrown in: test_bug405982"); 1.24544 + } 1.24545 + try { 1.24546 + test_context_arguments_extra(); 1.24547 + } catch (e) { 1.24548 + ok(false, "unexpected exception thrown in: test_context_arguments_extra"); 1.24549 + } 1.24550 + try { 1.24551 + test_context_arguments_missing(); 1.24552 + } catch (e) { 1.24553 + ok(false, "unexpected exception thrown in: test_context_arguments_missing"); 1.24554 + } 1.24555 + try { 1.24556 + test_context_casesensitive(); 1.24557 + } catch (e) { 1.24558 + ok(false, "unexpected exception thrown in: test_context_casesensitive"); 1.24559 + } 1.24560 + try { 1.24561 + test_context_emptystring(); 1.24562 + } catch (e) { 1.24563 + ok(false, "unexpected exception thrown in: test_context_emptystring"); 1.24564 + } 1.24565 + try { 1.24566 + test_context_unrecognised_badname(); 1.24567 + } catch (e) { 1.24568 + ok(false, "unexpected exception thrown in: test_context_unrecognised_badname"); 1.24569 + } 1.24570 + try { 1.24571 + test_context_unrecognised_badsuffix(); 1.24572 + } catch (e) { 1.24573 + ok(false, "unexpected exception thrown in: test_context_unrecognised_badsuffix"); 1.24574 + } 1.24575 + try { 1.24576 + test_context_unrecognised_nullsuffix(); 1.24577 + } catch (e) { 1.24578 + ok(false, "unexpected exception thrown in: test_context_unrecognised_nullsuffix"); 1.24579 + } 1.24580 + try { 1.24581 + test_context_unrecognised_unicode(); 1.24582 + } catch (e) { 1.24583 + ok(false, "unexpected exception thrown in: test_context_unrecognised_unicode"); 1.24584 + } 1.24585 + try { 1.24586 + test_fallback_basic(); 1.24587 + } catch (e) { 1.24588 + ok(false, "unexpected exception thrown in: test_fallback_basic"); 1.24589 + } 1.24590 + try { 1.24591 + test_fallback_multiple(); 1.24592 + } catch (e) { 1.24593 + ok(false, "unexpected exception thrown in: test_fallback_multiple"); 1.24594 + } 1.24595 + try { 1.24596 + test_fallback_nested(); 1.24597 + } catch (e) { 1.24598 + ok(false, "unexpected exception thrown in: test_fallback_nested"); 1.24599 + } 1.24600 + try { 1.24601 + test_initial_colour(); 1.24602 + } catch (e) { 1.24603 + ok(false, "unexpected exception thrown in: test_initial_colour"); 1.24604 + } 1.24605 + try { 1.24606 + test_initial_reset_2dstate(); 1.24607 + } catch (e) { 1.24608 + ok(false, "unexpected exception thrown in: test_initial_reset_2dstate"); 1.24609 + } 1.24610 + try { 1.24611 + test_initial_reset_clip(); 1.24612 + } catch (e) { 1.24613 + ok(false, "unexpected exception thrown in: test_initial_reset_clip"); 1.24614 + } 1.24615 + try { 1.24616 + test_initial_reset_different(); 1.24617 + } catch (e) { 1.24618 + ok(false, "unexpected exception thrown in: test_initial_reset_different"); 1.24619 + } 1.24620 + try { 1.24621 + test_initial_reset_gradient(); 1.24622 + } catch (e) { 1.24623 + ok(false, "unexpected exception thrown in: test_initial_reset_gradient"); 1.24624 + } 1.24625 + try { 1.24626 + test_initial_reset_path(); 1.24627 + } catch (e) { 1.24628 + ok(false, "unexpected exception thrown in: test_initial_reset_path"); 1.24629 + } 1.24630 + try { 1.24631 + test_initial_reset_pattern(); 1.24632 + } catch (e) { 1.24633 + ok(false, "unexpected exception thrown in: test_initial_reset_pattern"); 1.24634 + } 1.24635 + try { 1.24636 + test_initial_reset_same(); 1.24637 + } catch (e) { 1.24638 + ok(false, "unexpected exception thrown in: test_initial_reset_same"); 1.24639 + } 1.24640 + try { 1.24641 + test_initial_reset_transform(); 1.24642 + } catch (e) { 1.24643 + ok(false, "unexpected exception thrown in: test_initial_reset_transform"); 1.24644 + } 1.24645 + try { 1.24646 + test_size_attributes_default(); 1.24647 + } catch (e) { 1.24648 + ok(false, "unexpected exception thrown in: test_size_attributes_default"); 1.24649 + } 1.24650 + try { 1.24651 + test_size_attributes(); 1.24652 + } catch (e) { 1.24653 + ok(false, "unexpected exception thrown in: test_size_attributes"); 1.24654 + } 1.24655 + try { 1.24656 + test_size_attributes_parse_badsuffix(); 1.24657 + } catch (e) { 1.24658 + ok(false, "unexpected exception thrown in: test_size_attributes_parse_badsuffix"); 1.24659 + } 1.24660 + try { 1.24661 + test_size_attributes_parse_floatsuffix(); 1.24662 + } catch (e) { 1.24663 + ok(false, "unexpected exception thrown in: test_size_attributes_parse_floatsuffix"); 1.24664 + } 1.24665 + try { 1.24666 + test_size_attributes_parse_negative(); 1.24667 + } catch (e) { 1.24668 + ok(false, "unexpected exception thrown in: test_size_attributes_parse_negative"); 1.24669 + } 1.24670 + try { 1.24671 + test_size_attributes_parse_nonnumber(); 1.24672 + } catch (e) { 1.24673 + ok(false, "unexpected exception thrown in: test_size_attributes_parse_nonnumber"); 1.24674 + } 1.24675 + try { 1.24676 + test_size_attributes_parse_percentsuffix(); 1.24677 + } catch (e) { 1.24678 + ok(false, "unexpected exception thrown in: test_size_attributes_parse_percentsuffix"); 1.24679 + } 1.24680 + try { 1.24681 + test_size_attributes_parse_whitespace(); 1.24682 + } catch (e) { 1.24683 + ok(false, "unexpected exception thrown in: test_size_attributes_parse_whitespace"); 1.24684 + } 1.24685 + try { 1.24686 + test_size_attributes_parse_zero(); 1.24687 + } catch (e) { 1.24688 + ok(false, "unexpected exception thrown in: test_size_attributes_parse_zero"); 1.24689 + } 1.24690 + try { 1.24691 + test_size_attributes_parse_zerosuffix(); 1.24692 + } catch (e) { 1.24693 + ok(false, "unexpected exception thrown in: test_size_attributes_parse_zerosuffix"); 1.24694 + } 1.24695 + try { 1.24696 + test_size_attributes_reflect_1(); 1.24697 + } catch (e) { 1.24698 + ok(false, "unexpected exception thrown in: test_size_attributes_reflect_1"); 1.24699 + } 1.24700 + try { 1.24701 + test_size_attributes_reflect_2(); 1.24702 + } catch (e) { 1.24703 + ok(false, "unexpected exception thrown in: test_size_attributes_reflect_2"); 1.24704 + } 1.24705 + try { 1.24706 + test_size_attributes_removed(); 1.24707 + } catch (e) { 1.24708 + ok(false, "unexpected exception thrown in: test_size_attributes_removed"); 1.24709 + } 1.24710 + try { 1.24711 + test_size_attributes_setAttribute_badsuffix(); 1.24712 + } catch (e) { 1.24713 + ok(false, "unexpected exception thrown in: test_size_attributes_setAttribute_badsuffix"); 1.24714 + } 1.24715 + try { 1.24716 + test_size_attributes_setAttribute_floatsuffix(); 1.24717 + } catch (e) { 1.24718 + ok(false, "unexpected exception thrown in: test_size_attributes_setAttribute_floatsuffix"); 1.24719 + } 1.24720 + try { 1.24721 + test_size_attributes_setAttribute_negative(); 1.24722 + } catch (e) { 1.24723 + ok(false, "unexpected exception thrown in: test_size_attributes_setAttribute_negative"); 1.24724 + } 1.24725 + try { 1.24726 + test_size_attributes_setAttribute_nonnumber(); 1.24727 + } catch (e) { 1.24728 + ok(false, "unexpected exception thrown in: test_size_attributes_setAttribute_nonnumber"); 1.24729 + } 1.24730 + try { 1.24731 + test_size_attributes_setAttribute_percentsuffix(); 1.24732 + } catch (e) { 1.24733 + ok(false, "unexpected exception thrown in: test_size_attributes_setAttribute_percentsuffix"); 1.24734 + } 1.24735 + try { 1.24736 + test_size_attributes_setAttribute_whitespace(); 1.24737 + } catch (e) { 1.24738 + ok(false, "unexpected exception thrown in: test_size_attributes_setAttribute_whitespace"); 1.24739 + } 1.24740 + try { 1.24741 + test_size_attributes_setAttribute_zero(); 1.24742 + } catch (e) { 1.24743 + ok(false, "unexpected exception thrown in: test_size_attributes_setAttribute_zero"); 1.24744 + } 1.24745 + try { 1.24746 + test_size_attributes_setAttribute_zerosuffix(); 1.24747 + } catch (e) { 1.24748 + ok(false, "unexpected exception thrown in: test_size_attributes_setAttribute_zerosuffix"); 1.24749 + } 1.24750 + try { 1.24751 + test_size_attributes_style(); 1.24752 + } catch (e) { 1.24753 + ok(false, "unexpected exception thrown in: test_size_attributes_style"); 1.24754 + } 1.24755 + try { 1.24756 + test_size_attributes_type_get(); 1.24757 + } catch (e) { 1.24758 + ok(false, "unexpected exception thrown in: test_size_attributes_type_get"); 1.24759 + } 1.24760 + try { 1.24761 + test_size_attributes_type_set(); 1.24762 + } catch (e) { 1.24763 + ok(false, "unexpected exception thrown in: test_size_attributes_type_set"); 1.24764 + } 1.24765 + try { 1.24766 + test_text_font(); 1.24767 + } catch (e) { 1.24768 + ok(false, "unexpected exception thrown in: test_text_font"); 1.24769 + } 1.24770 + try { 1.24771 + test_text_measure(); 1.24772 + } catch (e) { 1.24773 + ok(false, "unexpected exception thrown in: test_text_measure"); 1.24774 + } 1.24775 + try { 1.24776 + test_text_space_replace(); 1.24777 + } catch (e) { 1.24778 + ok(false, "unexpected exception thrown in: test_text_space_replace"); 1.24779 + } 1.24780 + try { 1.24781 + test_text_textAlign(); 1.24782 + } catch (e) { 1.24783 + ok(false, "unexpected exception thrown in: test_text_textAlign"); 1.24784 + } 1.24785 + try { 1.24786 + test_text_textBaseline(); 1.24787 + } catch (e) { 1.24788 + ok(false, "unexpected exception thrown in: test_text_textBaseline"); 1.24789 + } 1.24790 + try { 1.24791 + test_toDataURL_arguments_1(); 1.24792 + } catch (e) { 1.24793 + ok(false, "unexpected exception thrown in: test_toDataURL_arguments_1"); 1.24794 + } 1.24795 + try { 1.24796 + test_toDataURL_arguments_2(); 1.24797 + } catch (e) { 1.24798 + ok(false, "unexpected exception thrown in: test_toDataURL_arguments_2"); 1.24799 + } 1.24800 + try { 1.24801 + test_toDataURL_arguments_3(); 1.24802 + } catch (e) { 1.24803 + ok(false, "unexpected exception thrown in: test_toDataURL_arguments_3"); 1.24804 + } 1.24805 + try { 1.24806 + test_toDataURL_complexcolours(); 1.24807 + } catch (e) { 1.24808 + ok(false, "unexpected exception thrown in: test_toDataURL_complexcolours"); 1.24809 + } 1.24810 + try { 1.24811 + test_toDataURL_default(); 1.24812 + } catch (e) { 1.24813 + ok(false, "unexpected exception thrown in: test_toDataURL_default"); 1.24814 + } 1.24815 + try { 1.24816 + test_toDataURL_lowercase(); 1.24817 + } catch (e) { 1.24818 + ok(false, "unexpected exception thrown in: test_toDataURL_lowercase"); 1.24819 + } 1.24820 + try { 1.24821 + test_toDataURL_nocontext(); 1.24822 + } catch (e) { 1.24823 + ok(false, "unexpected exception thrown in: test_toDataURL_nocontext"); 1.24824 + } 1.24825 + try { 1.24826 + test_toDataURL_png(); 1.24827 + } catch (e) { 1.24828 + ok(false, "unexpected exception thrown in: test_toDataURL_png"); 1.24829 + } 1.24830 + try { 1.24831 + test_toDataURL_primarycolours(); 1.24832 + } catch (e) { 1.24833 + ok(false, "unexpected exception thrown in: test_toDataURL_primarycolours"); 1.24834 + } 1.24835 + try { 1.24836 + test_toDataURL_unrecognised(); 1.24837 + } catch (e) { 1.24838 + ok(false, "unexpected exception thrown in: test_toDataURL_unrecognised"); 1.24839 + } 1.24840 + try { 1.24841 + test_toDataURL_zerosize(); 1.24842 + } catch (e) { 1.24843 + ok(false, "unexpected exception thrown in: test_toDataURL_zerosize"); 1.24844 + } 1.24845 + try { 1.24846 + test_type_exists(); 1.24847 + } catch (e) { 1.24848 + ok(false, "unexpected exception thrown in: test_type_exists"); 1.24849 + } 1.24850 + try { 1.24851 + test_type_extend(); 1.24852 + } catch (e) { 1.24853 + ok(false, "unexpected exception thrown in: test_type_extend"); 1.24854 + } 1.24855 + try { 1.24856 + test_type_name(); 1.24857 + } catch (e) { 1.24858 + ok(false, "unexpected exception thrown in: test_type_name"); 1.24859 + } 1.24860 + try { 1.24861 + test_type_prototype(); 1.24862 + } catch (e) { 1.24863 + ok(false, "unexpected exception thrown in: test_type_prototype"); 1.24864 + } 1.24865 + try { 1.24866 + test_2d_imagedata_coercion(); 1.24867 + } catch (e) { 1.24868 + ok(false, "unexpected exception thrown in: test_2d_imagedata_coercion"); 1.24869 + } 1.24870 + try { 1.24871 + test_2d_imageSmoothing(); 1.24872 + } catch (e) { 1.24873 + ok(false, "unexpected exception thrown in: test_2d_imageSmoothing"); 1.24874 + } 1.24875 + try { 1.24876 + test_zero_dimensions(); 1.24877 + } catch (e) { 1.24878 + ok(false, "unexpected exception thrown in: test_zero_dimensions"); 1.24879 + } 1.24880 + try { 1.24881 + test_zero_dimensions_imagedata(); 1.24882 + } catch(e) { 1.24883 + ok(false, "unexpected exception thrown in: test_zero_dimensions_imagedata"); 1.24884 + } 1.24885 + try { 1.24886 + test_getImageData_after_zero_canvas(); 1.24887 + } catch(e) { 1.24888 + throw e; 1.24889 + ok(false, "unexpected exception thrown in: test_getImageData_after_zero_canvas"); 1.24890 + } 1.24891 + try { 1.24892 + test_linedash(); 1.24893 + } catch(e) { 1.24894 + throw e; 1.24895 + ok(false, "unexpected exception thrown in: test_linedash"); 1.24896 + } 1.24897 +try { 1.24898 + test_opaque(); 1.24899 + } catch(e) { 1.24900 + throw e; 1.24901 + ok(false, "unexpected exception thrown in: test_opaque"); 1.24902 + } 1.24903 + try { 1.24904 + // run this test last since it replaces the getContext method 1.24905 + test_type_replace(); 1.24906 + } catch (e) { 1.24907 + ok(false, "unexpected exception thrown in: test_type_replace"); 1.24908 + } 1.24909 + 1.24910 + //run the asynchronous tests 1.24911 + try { 1.24912 + test_2d_drawImage_animated_apng(); 1.24913 + } catch (e) { 1.24914 + ok(false, "unexpected exception thrown in: test_2d_drawImage_animated_apng"); 1.24915 + } 1.24916 + try { 1.24917 + test_2d_drawImage_animated_gif(); 1.24918 + } catch (e) { 1.24919 + ok(false, "unexpected exception thrown in: test_2d_drawImage_animated_gif"); 1.24920 + } 1.24921 + 1.24922 + setTimeout(asyncTestsDone, 500); 1.24923 +} 1.24924 + 1.24925 +addLoadEvent(runTests); 1.24926 + 1.24927 +</script>