File: overflow-auto-005-ref.html

package info (click to toggle)
firefox-esr 91.12.0esr-1~deb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,375,668 kB
  • sloc: cpp: 5,762,032; javascript: 5,481,714; ansic: 3,121,206; python: 851,492; asm: 331,174; xml: 178,949; java: 155,554; sh: 63,704; makefile: 20,127; perl: 12,825; yacc: 4,583; cs: 3,846; objc: 3,026; lex: 1,720; exp: 762; pascal: 635; php: 436; lisp: 260; awk: 231; ruby: 103; sed: 53; sql: 46; csh: 45
file content (87 lines) | stat: -rw-r--r-- 1,940 bytes parent folder | download | duplicates (20)
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
<!DOCTYPE html>
<html>
<head>
<style>
.test-row {
    display: flex;
    margin-bottom: 5px;
}
.test-row > div {
    flex: none;
}

.container {
    margin-right: 5px;
    border: 5px solid lightgreen;
    width: 100px;
}

.flexbox {
    display: block;
    height: 100px;
    width: 100px;
    overflow: auto;
}

.flexbox > div {
    width: 200px;
    height: 200px;
    background: radial-gradient(at right 60%, red, yellow, green);
}

.vertical-rl {
  writing-mode: vertical-rl;
}

</style>
</head>
<body>
    <p>Scrollbars should work in all the flexboxes.</p>
</body>
<script>
var results = [
    'left top', 'left top', 'right top', 'left bottom',
    'right top', 'right top', 'right bottom', 'left top',
    'left top', 'left top', 'left bottom', 'right top'];

var testContents = '';
for (var i = 0; i < results.length; ++i) {
    if (!(i % 4))
        testContents += "<div class='test-row'>";

    var containerClass = 'container ' + results[i];

    // Use vertical-rl here because Firefox and WebKit put vertical scrollbars
    // on the left in the vertical-rl test cases, and this is the easiest way to
    // match that.
    let maybe_vertical = "";
    if (i > 3 && i < 8)
      maybe_vertical = " vertical-rl";

    testContents +=
        "<div class='" + containerClass + "'>" +
        "<div class='flexbox" + maybe_vertical + "'>" +
        "<div></div>" +
        "</div>" +
        "</div>";
    if (i % 4 == 3)
        testContents += "</div>";
}

document.body.innerHTML += testContents;

Array.prototype.forEach.call(document.querySelectorAll(".left"), function(element) {
    element.firstChild.scrollLeft = -1000;
});

Array.prototype.forEach.call(document.querySelectorAll(".right"), function(element) {
    element.firstChild.scrollLeft = 1000;
});

Array.prototype.forEach.call(document.querySelectorAll(".bottom"), function(element) {
    element.firstChild.scrollTop = 1000;
});

</script>
</body>
</html>