3 <link href=
"resources/grid.css" rel=
"stylesheet">
7 grid-template-rows: repeat(
5,
100px);
8 grid-template-columns: repeat(
5,
100px);
9 width: -webkit-fit-content;
10 background-color: red;
14 -webkit-writing-mode: vertical-lr;
20 background-color: green;
29 <div>This test checks that we correctly paint scrolled grid container.
</div>
30 <div>There should be no red below.
</div>
32 <div>Default writing mode (horizontal-lr)
</div>
34 <!-- An item in the middle of the grid. -->
35 <div class=
"scrolledDiv" data-scroll-top=
"200" data-scroll-left=
"100">
37 <div class=
"gridItem" style=
"grid-column: 2; grid-row: 3"></div>
41 <!-- Bottom-right corner of the grid. -->
42 <div class=
"scrolledDiv" data-scroll-top=
"400" data-scroll-left=
"400">
44 <div class=
"gridItem" style=
"grid-column: 5; grid-row: 5"></div>
48 <!-- Scroll between 2 horizontal grid items. -->
49 <div class=
"scrolledDiv" data-scroll-top=
"400" data-scroll-left=
"150">
51 <div class=
"gridItem" style=
"grid-column: 2; grid-row: 5"></div>
52 <div class=
"gridItem" style=
"grid-column: 3; grid-row: 5"></div>
56 <!-- Scroll between 2 vertical grid items. -->
57 <div class=
"scrolledDiv" data-scroll-top=
"150" data-scroll-left=
"400">
59 <div class=
"gridItem" style=
"grid-column: 5; grid-row: 2"></div>
60 <div class=
"gridItem" style=
"grid-column: 5; grid-row: 3"></div>
65 <div>Flipped writing mode (vertical-rl)
</div>
68 <!-- An item in the middle of the grid. -->
69 <div class=
"scrolledDiv" data-scroll-top=
"100" data-scroll-left=
"200">
70 <div class=
"grid verticalRL">
71 <div class=
"gridItem" style=
"grid-column: 2; grid-row: 3"></div>
75 <!-- Bottom-right corner of the grid. -->
76 <div class=
"scrolledDiv" data-scroll-top=
"400" data-scroll-left=
"400">
77 <div class=
"grid verticalRL">
78 <div class=
"gridItem" style=
"grid-column: 5; grid-row: 5"></div>
82 <!-- Scroll between 2 vertical grid items. -->
83 <div class=
"scrolledDiv" data-scroll-top=
"150" data-scroll-left=
"400">
84 <div class=
"grid verticalRL">
85 <div class=
"gridItem" style=
"grid-column: 2; grid-row: 5"></div>
86 <div class=
"gridItem" style=
"grid-column: 3; grid-row: 5"></div>
90 <!-- Scroll between 2 horizontal grid items. -->
91 <div class=
"scrolledDiv" data-scroll-top=
"400" data-scroll-left=
"150">
92 <div class=
"grid verticalRL">
93 <div class=
"gridItem" style=
"grid-column: 5; grid-row: 2"></div>
94 <div class=
"gridItem" style=
"grid-column: 5; grid-row: 3"></div>
99 var scrolledDivs
= document
.getElementsByClassName("scrolledDiv");
100 for (i
= 0; i
< scrolledDivs
.length
; ++i
) {
101 scrolledDiv
= scrolledDivs
[i
];
102 scrolledDiv
.scrollTop
= scrolledDiv
.getAttribute("data-scroll-top");
103 scrolledDiv
.scrollLeft
= scrolledDiv
.getAttribute("data-scroll-left");