File: webkit-box-item-shrink-002.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 (124 lines) | stat: -rw-r--r-- 3,676 bytes parent folder | download | duplicates (11)
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
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS -webkit-box Test: Testing no automatic minimum size for flex items in a legacy column-oriented flex container</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://compat.spec.whatwg.org/#valdef-flex--webkit-box">
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#min-size-auto">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1929178">
<link rel="stylesheet" href="/fonts/ahem.css">
<meta name="assert" content="This test verifies that a flex item in a legacy -webkit-box can be shrunk as if it has no automatic minimum size.">

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>

<style>
.webkit-box {
  display: -webkit-inline-box;
  -webkit-box-orient: vertical;
  width: 50px;
  height: 50px;
  border: 1px solid black;
  margin-bottom: 5px;
}
.webkit-box > * {
  /* Make the child block-level, to ensure that it's a flex item (otherwise it
   * may get wrapped in an anonymous box which becomes the flex item). */
  display: block;
  /* Allow the child to shrink. */
  -webkit-box-flex: 1;

  writing-mode: vertical-rl;
  font: 20px/1 Ahem;
  background: lightblue;

  /* Get rid of UA default styles. */
  border: 0;
  padding: 0;
  margin: 0;
}
</style>

<body onload="checkLayout('.webkit-box')">
  <div class="webkit-box">
    <img src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 30'></svg>"
         data-expected-height="50">
  </div>

  <div class="webkit-box">
    <img src="data:image/svg+xml,<svg width='100' height='300' xmlns='http://www.w3.org/2000/svg'></svg>"
         data-expected-height="50">
  </div>

  <div class="webkit-box">
    <svg width="100" height="300" data-expected-client-height="50"></svg>
  </div>

  <div class="webkit-box">
    <input type="text" data-expected-height="50">
  </div>

  <div class="webkit-box">
    <input type="range" data-expected-height="50">
  </div>

  <div class="webkit-box">
    <input type="button" value="XXXXXXX" data-expected-height="50">
  </div>

  <div class="webkit-box">
    <input type="submit" value="XXXXXXX" data-expected-height="50">
  </div>

  <div class="webkit-box">
    <input type="reset" value="XXXXXXX" data-expected-height="50">
  </div>

  <div class="webkit-box">
    <textarea data-expected-height="50">XXXXXXX</textarea>
  </div>

  <div class="webkit-box">
    <select data-expected-height="50">
      <option>XXXXXXX</option>
    </select>
  </div>

  <div class="webkit-box">
    <!-- This is a special case: <fieldset> is not compressible
         in blink, webkit, or gecko. -->
    <fieldset data-expected-height="140">XXXXXXX</fieldset>
  </div>

  <div class="webkit-box">
    <iframe data-expected-height="50"></iframe>
  </div>

  <div class="webkit-box">
    <button data-expected-height="50">XXXXXXX</button>
  </div>

  <div class="webkit-box">
    <canvas width="100" height="300" data-expected-height="50"></canvas>
  </div>

  <!-- We are not testing <video controls> and <audio controls>
       because they work only horizontally. -->

  <div class="webkit-box">
    <progress data-expected-height="50"></progress>
  </div>

  <div class="webkit-box">
    <meter data-expected-height="50"></meter>
  </div>

  <div class="webkit-box">
    <details data-expected-height="50">XXXXXXX</details>
  </div>

  <div class="webkit-box">
    <div style="height: 200px" data-expected-height="50">XXXXXXX</div>
  </div>
</body>