summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-flexbox/percentage-size-quirks-002.html
blob: c66ebd4428e963cd90ad93a204ce4840bf20b2fc (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
<!doctype quirks>
<title>CSS Flexbox: percentage size in flexbox children in quirks mode</title>
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
<link rel="author" title="David Grogan" href="mailto:dgrogan@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-containers">
<link rel="help" href="https://quirks.spec.whatwg.org/#the-percentage-height-calculation-quirk" title="Number 4">
<link rel="help" href="https://crbug.com/1054185">
<meta name="assert" content="This test checks that percentage height/width values in flexbox descendants are correctly resolved in quirks mode.">

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

<style>
.fixed-height { height: 100px; }
.flex {
  display: flex;
  border: 3px solid black;
}

.pct {
    height: 100%;
    min-height: 10px;
    width: 50px;
    display: inline-block;
    vertical-align: top;
    background: purple;
}
.px {
    height: 50px;
    width: 50px;
    display: inline-block;
    vertical-align: top;
    background: blue
};
</style>

flex with 1 wrapper div inside:
<div class="fixed-height">
  <div class="flex">
    <div>
      <div class="pct" data-expected-height=50></div>
      <div class="px"></div>
    </div>
  </div>
</div>
flex with several wrapper divs inside:
<div class="fixed-height">
  <div class="flex">
    <div>
      <div>
        <div>
          <div class="pct" data-expected-height=50></div>
          <div class="px"></div>
        </div>
      </div>
    </div>
  </div>
</div>

<script>
checkLayout('.pct');
</script>