layout/reftests/image-element/canvas-outside-document-invalidate-01.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/reftests/image-element/canvas-outside-document-invalidate-01.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,30 @@
     1.4 +<!--
     1.5 +     Any copyright is dedicated to the Public Domain.
     1.6 +     http://creativecommons.org/licenses/publicdomain/
     1.7 +
     1.8 +     Test that painting in an out-of-document canvas causes a repaint.
     1.9 +-->
    1.10 +<!DOCTYPE html>
    1.11 +<html class="reftest-wait">
    1.12 +<body style="background: -moz-element(#e) darkred">
    1.13 +
    1.14 +<script>
    1.15 +
    1.16 +var canvas = document.createElement("canvas");
    1.17 +canvas.width = canvas.height = 1;
    1.18 +var ctx = canvas.getContext('2d');
    1.19 +ctx.fillStyle = "red";
    1.20 +ctx.fillRect(0, 0, 1, 1);
    1.21 +window.addEventListener("MozReftestInvalidate", function () {
    1.22 +  setTimeout(function () {
    1.23 +    ctx.fillStyle = "white";
    1.24 +    ctx.fillRect(0, 0, 1, 1);
    1.25 +    document.documentElement.className = "";
    1.26 +  }, 0);
    1.27 +}, false);
    1.28 +
    1.29 +document.mozSetImageElement("e", canvas);
    1.30 +
    1.31 +</script>
    1.32 +</body>
    1.33 +</html>

mercurial