dom/plugins/test/crashtests/626602-1.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/plugins/test/crashtests/626602-1.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,109 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html class="reftest-wait">
     1.6 +<head>
     1.7 +  <style type="text/css">
     1.8 +#one {
     1.9 +  position:absolute;
    1.10 +  left:0px; top:0px;
    1.11 +  z-index:4;
    1.12 +}
    1.13 +#two {
    1.14 +  position:absolute;
    1.15 +  top:100px; left:100px;
    1.16 +  background-color:rgb(0,0,0,0);
    1.17 +  z-index:3;
    1.18 +}
    1.19 +#three {
    1.20 +  position:absolute;
    1.21 +  left:100px; top:100px;
    1.22 +  width:200px; height:200px;
    1.23 +  background-color: rgb(255,0,0);
    1.24 +  opacity:0.6;
    1.25 +  z-index:2;
    1.26 +}
    1.27 +#four {
    1.28 +  position:absolute;
    1.29 +  top:100px; left:100px;
    1.30 +  z-index:1;
    1.31 +}
    1.32 +  </style>
    1.33 +  <script type="text/javascript">
    1.34 +var plugin, div, canvas;
    1.35 +function start() {
    1.36 +  plugin = document.getElementById("four");
    1.37 +  div = document.getElementById("three");
    1.38 +  canvas = document.getElementById("two");
    1.39 +  paintCanvas();
    1.40 +
    1.41 +  mozRequestAnimationFrame(moveSomething);
    1.42 +}
    1.43 +
    1.44 +function paintCanvas() {
    1.45 +  var ctx = canvas.getContext("2d");
    1.46 +  ctx.fillStyle = "rgba(255,0,0, 0.6)";
    1.47 +  ctx.fillRect(0,0, 200,200);
    1.48 +}
    1.49 +
    1.50 +var i = 0, numLoops = 20;
    1.51 +var pluginIn = true, divIn = true, canvasIn = true;
    1.52 +function moveSomething() {
    1.53 +  var didSomething = (0 === (i % 2)) ? moveSomethingOut() : moveSomethingIn();
    1.54 +  if (!didSomething && ++i >= numLoops) {
    1.55 +    return finish();
    1.56 +  }
    1.57 +
    1.58 +  mozRequestAnimationFrame(moveSomething);
    1.59 +}
    1.60 +
    1.61 +function finish() {
    1.62 +  document.documentElement.removeAttribute("class");
    1.63 +}
    1.64 +
    1.65 +function moveSomethingOut() {
    1.66 +  if (pluginIn) {
    1.67 +    plugin.style.left = "400px";
    1.68 +    pluginIn = false;
    1.69 +  } else if (divIn) {
    1.70 +    div.style.left = "400px";
    1.71 +    divIn = false;
    1.72 +  } else if (canvasIn) {
    1.73 +    canvas.style.left = "400px";
    1.74 +    canvasIn = false;
    1.75 +  } else {
    1.76 +    return false;
    1.77 +  }
    1.78 +  return true;
    1.79 +}
    1.80 +
    1.81 +function moveSomethingIn() {
    1.82 +  if (!pluginIn) {
    1.83 +    plugin.style.left = "100px";
    1.84 +    pluginIn = true;
    1.85 +  } else if (!divIn) {
    1.86 +    div.style.left = "100px";
    1.87 +    divIn = true;
    1.88 +  } else if (!canvasIn) {
    1.89 +    canvas.style.left = "100px";
    1.90 +    canvasIn = true;
    1.91 +  } else {
    1.92 +    return false;
    1.93 +  }
    1.94 +  return true;
    1.95 +}
    1.96 +
    1.97 +function reset() {
    1.98 +
    1.99 +}
   1.100 +  </script>
   1.101 +</style>
   1.102 +</head>
   1.103 +<body onload="start();">
   1.104 +  <embed id="four" type="application/x-test" width="200" height="200"
   1.105 +         drawmode="solid" color="FFFF0000"></embed>
   1.106 +  <div id="three"></div>
   1.107 +  <canvas id="two" width="200" height="200"></canvas>
   1.108 +  <embed id="one" type="application/x-test" width="400" height="400"
   1.109 +         drawmode="solid" color="9900FF00"></embed>
   1.110 +</body>
   1.111 +</html>
   1.112 +

mercurial