File: test_bug1198135.html

package info (click to toggle)
firefox 141.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,550,588 kB
  • sloc: cpp: 7,426,506; javascript: 6,367,238; ansic: 3,707,351; python: 1,369,002; xml: 623,983; asm: 426,918; java: 184,324; sh: 64,488; makefile: 19,203; objc: 13,059; perl: 12,955; yacc: 4,583; cs: 3,846; pascal: 3,352; lex: 1,720; ruby: 1,071; exp: 762; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10
file content (89 lines) | stat: -rw-r--r-- 2,385 bytes parent folder | download | duplicates (31)
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
<!doctype html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1198135
-->
<html><head>
<title>Test for Bug 1198135</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1198135">Mozilla Bug 1198135</a>
<style>
.example {
	perspective: 100px;
	height: 300px;
	width: 300px;
	overflow-x: hidden;
	overflow-y: auto;
	border: 1px solid blue;
}

.example__group {
	position: relative;
	transform-style: preserve-3d;
    height: 300px;
    top: 0;
}
.example__layer {
	position: absolute;
	top:0;
	left: 0;
	right: 0;
	bottom: 0;
}
.layer--a {
	box-shadow: inset 0 0 0 1px red;
}
.layer--b {
	box-shadow: inset 0 0 0 1px blue;
	transform: translateZ(50px) scale(.45);
}
.layer--c {
	box-shadow: inset 0 0 0 1px green;
}
.layer--d {
	box-shadow: inset 00px 0 0px 1px orange;
	transform: translateZ(50px) scale(.45);
}
.layer--e {
	box-shadow: inset 00px 0 0px 1px orange;
	transform: translateZ(50px) scale(.45) translateY(300px);
}
</style>
</head>

<body>

<div class="example" id="first">
  <div class="example__group">
    <div class="example__layer layer--a"></div>
    <div class="example__layer layer--b"></div>
  </div>
  <div class="example__group">
    <div class="example__layer layer--c"></div>
    <div class="example__layer layer--d"></div>
  </div>
</div>

<div class="example" id="second">
  <div class="example__group">
    <div class="example__layer layer--a"></div>
    <div class="example__layer layer--b"></div>
  </div>
  <div class="example__group">
    <div class="example__layer layer--c"></div>
    <div class="example__layer layer--e"></div>
  </div>
</div>

<script>
  is(document.getElementById("first").scrollHeight, 600, "Scroll height should be computed correctly");
  document.getElementById("first").scrollTop = 150;
  is(document.getElementById("first").scrollHeight, 600, "Scroll height should be a constant when scrolling");

  // The true height is 727.5 and we don't always snap the same direction.
  isfuzzy(document.getElementById("second").scrollHeight, 728, 1, "Scroll height should be computed correctly");
  document.getElementById("second").scrollTop = 150;
  isfuzzy(document.getElementById("second").scrollHeight, 728, 1, "Scroll height should be a constant when scrolling");
</script>

</body></html>