File: layer-splitting-4.html

package info (click to toggle)
firefox 149.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,767,760 kB
  • sloc: cpp: 7,416,064; javascript: 6,752,859; ansic: 3,774,850; python: 1,250,473; xml: 641,578; asm: 439,191; java: 186,617; sh: 56,634; makefile: 18,856; objc: 13,092; perl: 12,763; pascal: 5,960; yacc: 4,583; cs: 3,846; lex: 1,720; ruby: 1,002; php: 436; lisp: 258; awk: 105; sql: 66; sed: 53; csh: 10; exp: 6
file content (82 lines) | stat: -rw-r--r-- 1,608 bytes parent folder | download | duplicates (35)
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
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>The two items in the scroll box should share a layer, despite all the other stuff that's going on around them</title>

<style>

.content {
  box-sizing: border-box;
  width: 200px;
  height: 200px;
  border: 1px solid blue;
  background: white;
}

body {
  margin: 0;
  padding: 20px;
  height: 3000px;
}

.opacity {
  opacity: 0.9;
  width: 200px;
  height: 200px;
  background-color: yellow;
  will-change: opacity;
}

.overlap {
  margin-top: -100px;
}

.scrollable {
  position: absolute;
  top: 20px;
  left: 240px;
  width: 400px;
  height: 400px;
  border: 1px solid black;
  overflow: auto;
}

.scrollarea {
  height: 800px;
  padding: 40px;
}

.low-z, .mid-z, .high-z {
  position: relative;
}

.low-z  { z-index: 1; }
.mid-z  { z-index: 2; }
.high-z { z-index: 3; }

</style>

<div class="content" reftest-assigned-layer="page-background"></div>
<div class="overlap opacity"></div>
<div class="overlap mid-z content" reftest-assigned-layer="on-top-of-opacity">
  <!--
    This item cannot merge into the page background layer because there's an
    active container layer for the opacity in between.
  -->
</div>

<div class="scrollable">
  <div class="scrollarea">
    <div class="low-z content" reftest-assigned-layer="scrolled-content"></div>
    <div class="high-z overlap content" reftest-assigned-layer="scrolled-content"></div>
  </div>
</div>
<script>

var scrollable = document.querySelector(".scrollable");

// Make .scrollable start out with active scrolling.
scrollable.scrollTop = 0;
scrollable.scrollTop = 20;

</script>