summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-layout-api/child-constraints/percentage-size-quirks-mode.https.html
blob: 527149b67a8cd89ec6337484bc5e1c4da5e5e8cc (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
<html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-percentageblocksize">
<link rel="match" href="../green-square-ref.html">
<meta name="assert" content="This test checks that setting a percentage block-size works correctly in quirks mode." />

<style>
.container {
  height: 200px;
}

.test {
  background: red;
  width: 100px;
}

.child {
  visibility: hidden;
  width: 10px;
  line-height: 0;
}

.inline {
  display: inline-block;
  width: 10px;
  height: 10px;
}

@supports (display: layout(test)) {
  .test {
    background: green;
    display: layout(test);
  }
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>

<div class="container">
  <div class="test">
    <!-- TODO explain. -->
    <div class="child" style="--percentage-block-size: 50px; --inline-size-expected: 10px; --block-size-expected: 10px;">
      <div style="height: 20%"></div>
    </div>

    <!-- TODO explain. -->
    <div class="child" style="--inline-size-expected: 10px; --block-size-expected: 10px;">
      <div style="height: 100%">
        <div class="inline"></div>
      </div>
    </div>
  </div>
</div>
<script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-sizes-worklet.js'});
</script>