summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-contain/container-queries/style-query-with-unknown-width.html
blob: 8b05d6c11200c94670a304cf4b490e6f590f6244 (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
<!DOCTYPE html>
<title>CSS Container Queries Test: style and size query against container without a principal box</title>
<link rel="help" href="https://drafts.csswg.org/css-contain-3/#container-queries">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/cq-testcommon.js"></script>
<style>
  #container {
    container-type: inline-size;
    display: contents;
    --foo: bar;
  }
  @container (width >= 0px) or style(--foo: bar) {
    #target { color: green; }
  }
</style>
<div id="container">
  <div id="target">Should be green</div>
</div>
<script>
  setup(() => assert_implements_container_queries());

  test(() => {
    assert_equals(getComputedStyle(target).color, "rgb(0, 128, 0)");
  }, "width query should evaluate to unknown and style query to true");
</script>