layout/reftests/image-element/canvas-outside-document-invalidate-01.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 painting in an out-of-document canvas causes a repaint.
     6 -->
     7 <!DOCTYPE html>
     8 <html class="reftest-wait">
     9 <body style="background: -moz-element(#e) darkred">
    11 <script>
    13 var canvas = document.createElement("canvas");
    14 canvas.width = canvas.height = 1;
    15 var ctx = canvas.getContext('2d');
    16 ctx.fillStyle = "red";
    17 ctx.fillRect(0, 0, 1, 1);
    18 window.addEventListener("MozReftestInvalidate", function () {
    19   setTimeout(function () {
    20     ctx.fillStyle = "white";
    21     ctx.fillRect(0, 0, 1, 1);
    22     document.documentElement.className = "";
    23   }, 0);
    24 }, false);
    26 document.mozSetImageElement("e", canvas);
    28 </script>
    29 </body>
    30 </html>

mercurial