summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-tables/fractional-percent-width.html
blob: cd032ebcc12cbda0f165d90b499d02235ad57467 (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
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<link rel="author" title="Jihwan Marc Kim" href="mailto:bluewhale.marc@gmail.com" />
<link rel="help" href="https://crbug.com/1283025" />
<meta name="flags" content="" />
<meta name="assert" content="percent lengths of fractional td width should rendered correctly" />
<style>
  main div {
    position: relative;
    border: 1px solid black;
    width: 400px;
  }
  .cell {
    background-color: skyblue;
    height: 20px;
  }
</style>
<p>
  Tests that percent lengths of fractional td width should rendered correctly
  even it is smaller than 1.
</p>

<hr />
<output id="log"></output>
<main>
  <div>
    <table width="100%">
      <tbody>
        <tr>
          <td class="cell" width="0.5%" data-expected-client-width="2"></td>
          <td>0.5%</td>
        </tr>
      </tbody>
    </table>
    <table width="100%">
      <tbody>
        <tr>
          <td class="cell" width="1%" data-expected-client-width="4"></td>
          <td>1%</td>
        </tr>
      </tbody>
    </table>
    <table width="100%">
      <tbody>
        <tr>
          <td class="cell" width="5%" data-expected-client-width="20"></td>
          <td>5%</td>
        </tr>
      </tbody>
    </table>
  </div>
</main>
<script>
  checkLayout(".cell");
</script>