layout/reftests/box-properties/CSS21-t100303-make-images.html

Fri, 16 Jan 2015 04:50:19 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 04:50:19 +0100
branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
permissions
-rw-r--r--

Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32

     1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
     2 	"http://www.w3.org/TR/html4/strict.dtd">
     3 <html lang="en-US">
     4 <head>
     5 	<title></title>
     6 	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     7 	<meta http-equiv="Content-Script-Type" content="text/javascript">
     8 	<script type="text/javascript">
    10 	var gWidth = 1024;
    11 	var gHeight = 1;
    12 	var gBarriers = [ 170, 334, 340, 344, 350, 458 ];
    14 	var gColors = [ "green", "red" ];
    16 	function append_url(filename, contents_url) {
    17 	    var p = document.createElement("p");
    18 	    var a = document.createElement("a");
    19 	    a.href = contents_url;
    20 	    var t = document.createTextNode("CSS21-t100303-" + filename);
    21 	    a.appendChild(t);
    22 	    p.appendChild(a);
    23 	    document.body.appendChild(p);
    24 	}
    26 	function run() {
    27 	    var canvas = document.getElementById("canvas");
    28 	    var cx = canvas.getContext("2d");
    29 	    for (var i in gBarriers) {
    30 	        var barrier = gBarriers[i];
    32 	        cx.fillStyle = gColors[1];
    33 	        cx.fillRect(0, 0, gWidth, gHeight);
    34 	        cx.fillStyle = gColors[0];
    35 	        cx.fillRect(0, 0, barrier, gHeight);
    36 	        append_url(gColors[0] + "-in-" + barrier + "px.png",
    37 	                   canvas.toDataURL("image/png"));
    39 	        cx.fillStyle = gColors[0];
    40 	        cx.fillRect(0, 0, gWidth, gHeight);
    41 	        cx.fillStyle = gColors[1];
    42 	        cx.fillRect(0, 0, barrier, gHeight);
    43 	        append_url(gColors[0] + "-outside-" + barrier + "px.png",
    44 	                   canvas.toDataURL("image/png"));
    45 	    }
    46 	}
    48 	</script>
    49 </head>
    50 <body onload="run()">
    52 <canvas width="1024" height="1" id="canvas"></canvas>
    54 </body>
    55 </html>

mercurial