layout/reftests/image-element/element-paint-subimage-sampling-restriction.html

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 <!--
     2      Any copyright is dedicated to the Public Domain.
     3      http://creativecommons.org/licenses/publicdomain/
     5      Test zooming, image snapping and subimage sampling restriction.
     6      This is like 446100-1a.html.
     7 -->
     8 <!DOCTYPE HTML>
     9 <html reftest-zoom="1.2" class="reftest-wait">
    10 <head>
    11 <style>
    12 div { margin:1em; }
    13 /* A 7x7px image, black with a 5x5 transparent box centered in it */
    14 div.box { background-image:-moz-element(#e5x5in7x7); }
    15 /* A 7x5px image, black with a 5x5 transparent box centered in it */
    16 div.vstrip { background-image:-moz-element(#e5x5in7x5); }
    17 /* A 5x7px image, black with a 5x5 transparent box centered in it */
    18 div.hstrip { background-image:-moz-element(#e5x5in5x7); }
    19 </style>
    20 </head>
    21 <body>
    22 <div class="box" style="background-position:-1px -1px; width:5px; height:5px;"></div>
    23 <div class="vstrip" style="background-position:-1px 0px; width:5px; height:22px;"></div>
    24 <div class="hstrip" style="background-position:0px -1px; width:22px; height:5px;"></div>
    25 <script>
    26 var waitingForLoad = 0;
    27 function setURLImage(name, url) {
    28   var img = new Image();
    29   img.src = url;
    30   document.mozSetImageElement(name, img);
    31   waitingForLoad++;
    32   img.onload = function () { if (--waitingForLoad == 0) document.documentElement.className = ""; };
    33 }
    34 setURLImage("e5x5in7x7", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAFklEQVQImWNgYGD4jwdDCCxgQCWxYgBX8hfpeym4dwAAAABJRU5ErkJggg==");
    35 setURLImage("e5x5in7x5", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAFCAYAAACJmvbYAAAAFElEQVQImWNgYGD4z4Ad/GcYAEkAw+kJ94z5rSYAAAAASUVORK5CYII=");
    36 setURLImage("e5x5in5x7", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAHCAYAAADAp4fuAAAAE0lEQVQImWNgYGD4jwXTD2DYDgDN4Qn3yMcPlwAAAABJRU5ErkJggg==");
    37 </script>
    38 </body>
    39 </html>

mercurial