tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

style-not-sharing-float.html (1236B)


      1 <!doctype html>
      2 <title>CSS Container Queries Test: Check style is not sharing between cousins in the case of Container Queries</title>
      3 <link rel="help" href="https://drafts.csswg.org/css-conditional-5/#size-container">
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="support/cq-testcommon.js"></script>
      7 <style>
      8  .float {
      9    float: left;
     10    width: 25px;
     11    height: 25px;
     12  }
     13  .item {
     14    container-type: inline-size;
     15    height: 25px;
     16  }
     17  @container (width >= 50px) {
     18    .item div { color: lime; }
     19  }
     20  @container (width >= 150px) {
     21    .item div { color: green; }
     22  }
     23 </style>
     24 <div style="width: 150px">
     25  <div class="float"></div>
     26  <div class="item">
     27    <div id="target1"></div>
     28  </div>
     29  <div class="item">
     30    <div id="target2"></div>
     31  </div>
     32 </div>
     33 <script>
     34  setup(() => assert_implements_size_container_queries());
     35 
     36  test(() => {
     37    assert_equals(getComputedStyle(target1).color, "rgb(0, 255, 0)", "Second item container should be 100px wide");
     38    assert_equals(getComputedStyle(target2).color, "rgb(0, 128, 0)", "First item container should be 200px wide");
     39  }, "Check that style is not sharing in the case of Container Queries");
     40 </script>