summaryrefslogtreecommitdiffstats
path: root/dom/plugins/test/crashtests/626602-1.html
blob: 0a878bbd1d4868cc9d1d8724aeab85bec7aae8ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html class="reftest-wait">
<head>
  <style type="text/css">
#one {
  position:absolute;
  left:0px; top:0px;
  z-index:4;
}
#two {
  position:absolute;
  top:100px; left:100px;
  background-color:rgb(0,0,0,0);
  z-index:3;
}
#three {
  position:absolute;
  left:100px; top:100px;
  width:200px; height:200px;
  background-color: rgb(255,0,0);
  opacity:0.6;
  z-index:2;
}
#four {
  position:absolute;
  top:100px; left:100px;
  z-index:1;
}
  </style>
  <script type="text/javascript">
var plugin, div, canvas;
function start() {
  plugin = document.getElementById("four");
  div = document.getElementById("three");
  canvas = document.getElementById("two");
  paintCanvas();

  requestAnimationFrame(moveSomething);
}

function paintCanvas() {
  var ctx = canvas.getContext("2d");
  ctx.fillStyle = "rgba(255,0,0, 0.6)";
  ctx.fillRect(0,0, 200,200);
}

var i = 0, numLoops = 20;
var pluginIn = true, divIn = true, canvasIn = true;
function moveSomething() {
  var didSomething = (0 === (i % 2)) ? moveSomethingOut() : moveSomethingIn();
  if (!didSomething && ++i >= numLoops) {
    return finish();
  }

  requestAnimationFrame(moveSomething);
}

function finish() {
  document.documentElement.removeAttribute("class");
}

function moveSomethingOut() {
  if (pluginIn) {
    plugin.style.left = "400px";
    pluginIn = false;
  } else if (divIn) {
    div.style.left = "400px";
    divIn = false;
  } else if (canvasIn) {
    canvas.style.left = "400px";
    canvasIn = false;
  } else {
    return false;
  }
  return true;
}

function moveSomethingIn() {
  if (!pluginIn) {
    plugin.style.left = "100px";
    pluginIn = true;
  } else if (!divIn) {
    div.style.left = "100px";
    divIn = true;
  } else if (!canvasIn) {
    canvas.style.left = "100px";
    canvasIn = true;
  } else {
    return false;
  }
  return true;
}

function reset() {

}
  </script>
</style>
</head>
<body onload="start();">
  <embed id="four" type="application/x-test" width="200" height="200"
         drawmode="solid" color="FFFF0000"></embed>
  <div id="three"></div>
  <canvas id="two" width="200" height="200"></canvas>
  <embed id="one" type="application/x-test" width="400" height="400"
         drawmode="solid" color="9900FF00"></embed>
</body>
</html>