canvas-outside-document-invalidate-02.html 935 B

12345678910111213141516171819202122232425262728293031323334
  1. <!--
  2. Any copyright is dedicated to the Public Domain.
  3. http://creativecommons.org/licenses/publicdomain/
  4. Test that a complete redraw of the context invalidates the rendering observer, too.
  5. (mozDrawText calls nsCanvasRenderingContext2D::Redraw() without a dirty rect to invalidate everything.)
  6. -->
  7. <!DOCTYPE html>
  8. <html class="reftest-wait">
  9. <meta charset="utf-8">
  10. <body style="background: -moz-element(#e) white">
  11. <script>
  12. var canvas = document.createElement("canvas");
  13. canvas.width = canvas.height = 1;
  14. var ctx = canvas.getContext('2d');
  15. ctx.fillStyle = "red";
  16. ctx.fillRect(0, 0, 1, 1);
  17. window.addEventListener("MozReftestInvalidate", function () {
  18. ctx.strokeStyle = "white";
  19. ctx.font = "50px bold Arial";
  20. ctx.translate(-8, 18);
  21. ctx.lineWidth = 50;
  22. ctx.strokeText("•", 0, 0);
  23. document.documentElement.className = "";
  24. }, false);
  25. document.mozSetImageElement("e", canvas);
  26. </script>
  27. </body>
  28. </html>