summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-flexbox/overflow-area-003.html
blob: ff86dea30f10bf9e8411871b98a249500d74832b (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
<!DOCTYPE html>
<html>
  <meta charset="utf-8">
  <title>CSS Flexible Box Layout Test: Test flex container's overflow rect</title>
  <link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
  <link rel="author" title="Mozilla" href="https://www.mozilla.org/">
  <link rel="help" href="https://drafts.csswg.org/css-overflow-3/#scrollable">
  <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1712496">
  <link rel="match" href="reference/overflow-area-003-ref.html">
  <meta name="assert" content="This test verifies that a flex container's padding rect should not not affect its overflow rect at all.">

  <style>
  .set {
    clear: both;
    margin: 1em;
  }

  .test {
    display: flex;
    overflow: auto;
    padding: 10px;
    width: 60px;
    height: 60px;
    background: teal;
    margin: 1em 0.5em;
    float: left;
  }

  .item {
    width: 10px;
    height: 10px;
  }

  .absolute {
    position: absolute;
  }

  .center {
    justify-content: center;
    align-items: center
  }

  .relative {
    position: relative;
  }

  .relative > .item {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
  }

  .top-left {
    left: -10px;
    top: -10px;
  }

  .bottom-right {
    bottom: -10px;
    right: -10px;
  }
  </style>

  <p>Test passes if all the teal boxes have no scrollbars.</p>

  <!-- This set tests empty flex containers. -->
  <div class="set">
    <div class="test" style="flex-direction: row;"></div>
    <div class="test" style="flex-direction: column;"></div>
    <div class="test" style="flex-direction: row-reverse;"></div>
    <div class="test" style="flex-direction: column-reverse;"></div>
  </div>

  <!-- This set tests flex containers having only a abs-pos child, but no flex items. -->
  <div class="set">
    <div class="test" style="flex-direction: row;">
      <div class="absolute item"></div>
    </div>
    <div class="test" style="flex-direction: column;">
      <div class="absolute item"></div>
    </div>
    <div class="test" style="flex-direction: row-reverse;">
      <div class="absolute item"></div>
    </div>
    <div class="test" style="flex-direction: column-reverse;">
      <div class="absolute item"></div>
    </div>
  </div>

  <!-- This set tests flex containers having a small centered flex item. -->
  <div class="set">
    <div class="test center" style="flex-direction: row;">
      <div class="item"></div>
    </div>
    <div class="test center" style="flex-direction: column;">
      <div class="item"></div>
    </div>
    <div class="test center" style="flex-direction: row-reverse;">
      <div class="item"></div>
    </div>
    <div class="test center" style="flex-direction: column-reverse;">
      <div class="item"></div>
    </div>
  </div>

  <!-- This set tests flex containers having a relative positioned flex item. -->
  <div class="set">
    <div class="test relative" style="flex-direction: row;">
      <div class="item relative bottom-right"></div>
    </div>
    <div class="test relative" style="flex-direction: column;">
      <div class="item relative bottom-right"></div>
    </div>
    <div class="test relative" style="flex-direction: row-reverse;">
      <div class="item relative top-left"></div>
    </div>
    <div class="test relative" style="flex-direction: column-reverse;">
      <div class="item relative top-left"></div>
    </div>
  </div>

</html>