summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/overlap-map-stack-crash.html
blob: 8ca32a4296b328d82213c76be0922ba5c7f682f3 (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
<!DOCTYPE html>
<html>
<head>

<style>
#container {
  position: absolute;
  z-index: 0;
  top: 50px;
  left: 50px;
  width: 300px;
  height: 300px;
  background-color: gray;
}

#compositedNegZIndex {
  position: absolute;
  z-index: -5;
  width: 100px;
  height: 100px;
  background-color: blue;
  overflow: scroll;
}

#tall {
  height: 1000px;
}

#innocentNegZIndex {
  position: absolute;
  z-index: -2;
  top: 200px;
  left: 200px;
  width: 100px;
  height: 100px;
  background-color: lime;
}

#explanation {
  position: absolute;
  top: 400px;
}
</style>

<script>
if (window.internals) {
    window.internals.settings.setPreferCompositingToLCDTextEnabled(true);
}

function doTest() {
    if (!window.internals)
        document.getElementById("explanation").style.display = "block";

    if (window.testRunner)
        testRunner.dumpAsText();
}

window.addEventListener("load", doTest, false);
</script>

</head>
<body>

<div id="container">
  <div id="compositedNegZIndex">
    <div id="tall"></div>
  </div>
  <div id="innocentNegZIndex"> </div>
</div>

<pre id="explanation" style="display:none;">
Crash after hitting below bottom of overlap stack: https://code.google.com/p/chromium/issues/detail?id=285979

The crashing scenario happened as follows:

 - force-compositing-mode is disabled.  As a result, compositing mode is
   disabled until a compositing trigger.

 - overflow-scroll as the compositing trigger, because it does not enable
   compositing mode before computeCompositingRequirements. Other triggers
   happen during CompositedLayerMapping incremental update entry points.
   (Note: CompositedLayerMapping was formerly known as LayerBacking.)

 - The above two requirements are necessary to create the scenario where
   the root layer does not create an overlap context.

 - The overflow-scroll element has a negative z-index which causes the
   parent layer to be composited, too.

 - As a result, subsequent children layers need to add themselves to the
   overlap map, even if they are not composited.

 - The problem, however, is that we never created an overlap context for
   these negative z-index non-composited layers. When the layers try to add
   themselves to the overlap, they try to access below the bottom of the
   stack, and crash.
</pre>

</body>

</html>