layout/reftests/image-element/canvas-outside-document-invalidate-02.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 that a complete redraw of the context invalidates the rendering observer, too.
     6      (mozDrawText calls nsCanvasRenderingContext2D::Redraw() without a dirty rect to invalidate everything.)
     7 -->
     8 <!DOCTYPE html>
     9 <html class="reftest-wait">
    10 <meta charset="utf-8">
    11 <body style="background: -moz-element(#e) white">
    13 <script>
    15 var canvas = document.createElement("canvas");
    16 canvas.width = canvas.height = 1;
    17 var ctx = canvas.getContext('2d');
    18 ctx.fillStyle = "red";
    19 ctx.fillRect(0, 0, 1, 1);
    20 window.addEventListener("MozReftestInvalidate", function () {
    21   ctx.strokeStyle = "white";
    22   ctx.font = "50px bold Arial";
    23   ctx.translate(-8, 18);
    24   ctx.lineWidth = 50;
    25   ctx.strokeText("•", 0, 0);
    26   document.documentElement.className = "";
    27 }, false);
    29 document.mozSetImageElement("e", canvas);
    31 </script>
    32 </body>
    33 </html>

mercurial