element-paint-subimage-sampling-restriction.html 1.7 KB

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