summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-overflow/scrollable-overflow-padding.html
blob: 6a37f73cb6c87f55e462d90a74070810d57aac30 (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-overflow-3/#scrollable">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/129">
<style>
scrollable-container {
  display: block;
  width: 100px;
  height: 100px;
  overflow: scroll;
  padding: 10px 5px;
  line-height: 0;
}

scrollable-container > div {
  position: relative;
  writing-mode: horizontal-tb;
  direction: ltr;
  outline: solid red 2px;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<body onload="checkLayout('scrollable-container')">

<!--
  All of these tests have a child which contributes to the "alignment rectangle" ("infow-bounds" in Blink).
  However doesn't directly contribute to the scrollable-overflow as it is relative-positioned before the
  "scroll origin" edge(s).

  All of these tests have an inline/block end margin (wrt. the parent writing-mode + direction).
-->

<!-- HTB + LTR -->
<div style="writing-mode: horizontal-tb; direction: ltr;">
  <scrollable-container data-expected-scroll-height="270">
    <div style="width: 0; height: 200px; margin-bottom: 50px; top: -1000px;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-width="260">
    <div style="width: 200px; height: 0; margin-right: 50px; left: -1000px;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-height="270">
    <div style="width: 0; height: 200px; margin-bottom: 50px; top: -1000px; display: inline-block;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-width="260">
    <div style="width: 200px; height: 0; margin-right: 50px; left: -1000px; display: inline-block;"></div>
  </scrollable-container>

  <!-- For this specific case collapsed-margins affect the size of the alignment rectangle. -->
  <scrollable-container data-expected-scroll-height="270">
    <div style="width: 0; margin-bottom: 100px; top: -1000px;">
      <div style="height: 200px; margin-bottom: -50px;"></div>
    </div>
  </scrollable-container>
</div>

<!-- HTB + RTL -->
<div style="writing-mode: horizontal-tb; direction: rtl;">
  <scrollable-container data-expected-scroll-height="270">
    <div style="width: 0; height: 200px; margin-bottom: 50px; top: -1000px;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-width="260">
    <div style="width: 200px; height: 0; margin-left: 50px; right: -1000px;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-height="270">
    <div style="width: 0; height: 200px; margin-bottom: 50px; top: -1000px; display: inline-block;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-width="260">
    <div style="width: 200px; height: 0; margin-left: 50px; right: -1000px; display: inline-block;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-height="270">
    <div style="width: 0; margin-bottom: 100px; top: -1000px;">
      <div style="height: 200px; margin-bottom: -50px;"></div>
    </div>
  </scrollable-container>
</div>

<!-- VRL + LTR -->
<div style="writing-mode: vertical-rl; direction: ltr;">
  <scrollable-container data-expected-scroll-width="260">
    <div style="width: 200px; height: 0; margin-left: 50px; right: -1000px;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-height="270">
    <div style="width: 0; height: 200px; margin-bottom: 50px; top: -1000px;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-width="260">
    <div style="width: 200px; height: 0; margin-left: 50px; right: -1000px; display: inline-block;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-height="270">
    <div style="width: 0; height: 200px; margin-bottom: 50px; top: -1000px; display: inline-block;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-width="260">
    <div style="height: 0; margin-left: 100px; right: -1000px;">
      <div style="width: 200px; margin-left: -50px;"></div>
    </div>
  </scrollable-container>
</div>

<!-- VRL + RTL -->
<div style="writing-mode: vertical-rl; direction: rtl;">
  <scrollable-container data-expected-scroll-width="260">
    <div style="width: 200px; height: 0; margin-left: 50px; right: -1000px;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-height="270">
    <div style="width: 0; height: 200px; margin-top: 50px; bottom: -1000px;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-width="260">
    <div style="width: 200px; height: 0; margin-left: 50px; right: -1000px; display: inline-block;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-height="270">
    <div style="width: 0; height: 200px; margin-top: 50px; bottom: -1000px; display: inline-block;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-width="260">
    <div style="height: 0; margin-left: 100px; right: -1000px;">
      <div style="width: 200px; margin-left: -50px;"></div>
    </div>
  </scrollable-container>
</div>

<!-- VLR + LTR -->
<div style="writing-mode: vertical-lr; direction: ltr;">
  <scrollable-container data-expected-scroll-width="260">
    <div style="width: 200px; height: 0; margin-right: 50px; left: -1000px;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-height="270">
    <div style="width: 0; height: 200px; margin-bottom: 50px; top: -1000px;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-width="260">
    <div style="width: 200px; height: 0; margin-right: 50px; left: -1000px; display: inline-block;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-height="270">
    <div style="width: 0; height: 200px; margin-bottom: 50px; top: -1000px; display: inline-block;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-width="260">
    <div style="height: 0; margin-right: 100px; left: -1000px;">
      <div style="width: 200px; margin-right: -50px;"></div>
    </div>
  </scrollable-container>
</div>

<!-- VLR + RTL -->
<div style="writing-mode: vertical-rl; direction: rtl;">
  <scrollable-container data-expected-scroll-width="260">
    <div style="width: 200px; height: 0; margin-right: 50px; left: -1000px;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-height="270">
    <div style="width: 0; height: 200px; margin-top: 50px; bottom: -1000px;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-width="260">
    <div style="width: 200px; height: 0; margin-right: 50px; left: -1000px; display: inline-block;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-height="270">
    <div style="width: 0; height: 200px; margin-top: 50px; bottom: -1000px; display: inline-block;"></div>
  </scrollable-container>

  <scrollable-container data-expected-scroll-width="260">
    <div style="height: 0; margin-right: 100px; left: -1000px;">
      <div style="width: 200px; margin-right: -50px;"></div>
    </div>
  </scrollable-container>
</div>