summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-layout-api/child-constraints/fixed-block-size-vrl.https.html
blob: 631c5f82815569d4274c24ad73607d03085b7051 (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
<!DOCTYPE html>
<html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-fixedblocksize">
<link rel="match" href="../green-square-ref.html">
<meta name="assert" content="This test checks that fixing the block size of children works as expected." />

<style>
.test {
  writing-mode: vertical-rl;
  background: red;
  height: 100px;
}

.htb {
  writing-mode: horizontal-tb;
  visibility: hidden;
  width: 3px;
  height: 2px;

  --fixed-block-size: 10;

  --inline-size-expected: 2;
  --block-size-expected: 10;
}

.vrl {
  writing-mode: vertical-rl;
  visibility: hidden;
  width: 3px;
  height: 2px;

  --fixed-block-size: 10;

  --inline-size-expected: 2;
  --block-size-expected: 10;
}

@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="test">
  <div class="htb"></div>
  <div class="vrl"></div>
  <!-- min/max-width should have no effect, fixedBlockSize wins. -->
  <div class="htb" style="max-width: 5px;"></div>
  <div class="vrl" style="max-width: 5px;"></div>
  <div class="htb" style="min-width: 15px;"></div>
  <div class="vrl" style="min-width: 15px;"></div>
</div>

<script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-sizes-worklet.js'});
</script>