File: scrollable-containing-block-size.html

package info (click to toggle)
firefox 144.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,637,504 kB
  • sloc: cpp: 7,576,692; javascript: 6,430,831; ansic: 3,748,119; python: 1,398,978; xml: 628,810; asm: 438,679; java: 186,194; sh: 63,212; makefile: 19,159; objc: 13,086; perl: 12,986; yacc: 4,583; cs: 3,846; pascal: 3,448; lex: 1,720; ruby: 1,003; exp: 762; php: 436; lisp: 258; awk: 247; sql: 66; sed: 53; csh: 10
file content (126 lines) | stat: -rw-r--r-- 4,659 bytes parent folder | download | duplicates (2)
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
<!DOCTYPE html>
<title>Tests where the "padding edge" should be for various display types.</title>
<link rel="help" href="https://drafts.csswg.org/css-anchor-position-1/">
<link rel="help" href="https://drafts.csswg.org/css-position-4/#scrollable-containing-block">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/12552">
<style>
.scroller {
  /* Use overflow hidden instead of scroll to mitigate scrollbar differences. */
  overflow: hidden;
  position: relative;
  width: 80px;
  height: 80px;
  margin: 10px;
  border: solid 3px;
  padding: 10px;
}

.filler {
  background: orange;
  min-width: 180px;
  min-height: 180px;
}

.translate {
  translate: 50px;
}

.relative {
  position: relative;
  left: 20px;
  top: 40px;
}

.anchor {
  anchor-name: --a;
}

.target {
  position-anchor: --a;
  position: absolute;
  inset: 0;
  place-self: stretch;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<body onload="checkLayout('.target')">

<!-- Base case, block layout no shift. -->
<div class="scroller">
  <div class="filler"><div class="anchor"></div></div>
  <div class="target" data-offset-x="0" data-offset-y="0" data-expected-width="200" data-expected-height="200"></div>
</div>

<!-- Block layout with relative shift. -->
<div class="scroller">
  <div class="filler relative"><div class="anchor"></div></div>
  <div class="target" data-offset-x="0" data-offset-y="0" data-expected-width="200" data-expected-height="200"></div>
</div>

<!-- Block layout with translate shift. -->
<div class="scroller">
  <div class="filler translate"><div class="anchor"></div></div>
  <div class="target" data-offset-x="0" data-offset-y="0" data-expected-width="200" data-expected-height="200"></div>
</div>

<!-- Flex layout with no shift. -->
<div class="scroller" style="display: flex;">
  <div class="filler"><div class="anchor"></div></div>
  <div class="target" data-offset-x="0" data-offset-y="0" data-expected-width="200" data-expected-height="200"></div>
</div>

<!-- Flex layout with relative shift. -->
<div class="scroller" style="display: flex;">
  <div class="filler relative"><div class="anchor"></div></div>
  <div class="target" data-offset-x="0" data-offset-y="0" data-expected-width="200" data-expected-height="200"></div>
</div>

<!-- Flex layout with translate shift. -->
<div class="scroller" style="display: flex;">
  <div class="filler translate"><div class="anchor"></div></div>
  <div class="target" data-offset-x="0" data-offset-y="0" data-expected-width="200" data-expected-height="200"></div>
</div>

<!-- Grid layout with no shift. -->
<div class="scroller" style="display: grid;">
  <div class="filler"><div class="anchor"></div></div>
  <div class="target" data-offset-x="0" data-offset-y="0" data-expected-width="200" data-expected-height="200"></div>
</div>

<!-- Grid layout with relative shift. -->
<div class="scroller" style="display: grid;">
  <div class="filler relative"><div class="anchor"></div></div>
  <div class="target" data-offset-x="0" data-offset-y="0" data-expected-width="200" data-expected-height="200"></div>
</div>

<!-- Grid layout with translate shift. -->
<div class="scroller" style="display: grid;">
  <div class="filler translate"><div class="anchor"></div></div>
  <div class="target" data-offset-x="0" data-offset-y="0" data-expected-width="200" data-expected-height="200"></div>
</div>

<!-- Grid layout with template. -->
<div class="scroller" style="display: grid; grid-template: 180px / 180px">
  <div class="anchor"></div>
  <div class="target" data-offset-x="0" data-offset-y="0" data-expected-width="200" data-expected-height="200"></div>
</div>

<!-- Use flexbox to trigger up scrollable area. -->
<div class="scroller" style="display: flex; flex-direction: column-reverse;">
  <div class="filler"><div class="anchor"></div></div>
  <div class="target" data-offset-x="0" data-offset-y="-100" data-expected-width="200" data-expected-height="200"></div>
</div>

<!-- Use flexbox to trigger right scrollable area. -->
<div class="scroller" style="display: flex; flex-direction: row-reverse;">
  <div class="filler"><div class="anchor"></div></div>
  <div class="target" data-offset-x="-100" data-offset-y="0" data-expected-width="200" data-expected-height="200"></div>
</div>

<!-- Use RTL to trigger right scrollable area. -->
<div class="scroller" style="direction: rtl;">
  <div class="filler"><div class="anchor"></div></div>
  <div class="target" data-offset-x="-100" data-offset-y="0" data-expected-width="200" data-expected-height="200"></div>
</div>