summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-contain/container-queries/inline-size-containment-vertical-rl.html
blob: 38c88f2df79748747e11a41f35808bae3d55e82e (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
<!doctype html>
<title>CSS Container Queries Test: query of inline-size container in vertical-rl</title>
<link rel="help" href="https://drafts.csswg.org/css-contain-3/#size-container">
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<style>
  #ancestry { writing-mode: vertical-rl; }
  #keg { container-type: inline-size; }
  @container (max-height: 200px) {
    #target { width: 400px; }
  }
  @container (min-height: 400px) {
    #target { width: 20px; }
  }
</style>
<div id="ancestry">
  <div id="keg">
    <div id="target">
      <div style="width:50px;"></div>
    </div>
  </div>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/cq-testcommon.js"></script>
<script>
  setup(() => assert_implements_container_queries());

  test(()=> {
    ancestry.style.height = "100px";
    assert_equals(keg.offsetWidth, 400);

    ancestry.style.height = "300px";
    assert_equals(keg.offsetWidth, 50);

    ancestry.style.height = "500px";
    assert_equals(keg.offsetWidth, 20);
  }, "inline-size containment only");
</script>