downscale-moz-icon-1-ref.html (1253B)
1 <!DOCTYPE html> 2 <!-- Any copyright is dedicated to the Public Domain. 3 - http://creativecommons.org/publicdomain/zero/1.0/ --> 4 <html class="reftest-wait"> 5 <head> 6 <meta charset="utf-8" /> 7 <title>Reference for downscaling moz-icon images (bug 1261964)</title> 8 <script> 9 function beginTest() { 10 var canvas = document.getElementById("canvas"); 11 var image = new Image(); 12 13 image.onload = function() { 14 // When image loads: draw it to canvas, scale down the canvas, and 15 // then let the reftest snapshot happen. 16 // The image can be larger than the requested size, so we resize the 17 // canvas to match it. 18 canvas.width = image.width; 19 canvas.height = image.height; 20 var ctx = canvas.getContext("2d"); 21 ctx.drawImage(image, 0, 0); 22 canvas.setAttribute("class", "downscale"); 23 document.documentElement.removeAttribute("class"); 24 } 25 26 // Kick off the image load: 27 image.src = "moz-icon://bogus-unrecognized-icon?size=100"; 28 } 29 </script> 30 <style> 31 body { margin: 0; } 32 .downscale { 33 transform-origin: 0 0; 34 transform: scale(0.9); 35 } 36 </style> 37 </head> 38 <body onload="beginTest()"> 39 <canvas id="canvas"></canvas> 40 </body> 41 </html>