summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/css3/calc/table-border-spacing.html
blob: aff029012fae07805cda84561cb74f833be72666 (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
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<style>
    td { 
        padding: 0; 
        width: 50px; 
        height: 60px; 
        background-color: blue; 
        border: 1px solid black 
    }
    table { 
        border-spacing: calc(10px * 2 + 5px); 
        border: 3px solid black; 
    }
</style>
<table id="stimulus">
    <tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
</table>
<script>
    var innerBorder = 1;
    var outerBorder = 3;
    var innerWidth = 50 + 2 * innerBorder;
    var innerHeight = 60 + 2 * innerBorder;
    var borderSpacing = 25;
    var rows = 2;
    var columns = 5;

    var expectedWidth = innerWidth * columns + borderSpacing * (columns + 1) + 2 * outerBorder;
    var expectedHeight = innerHeight * rows + borderSpacing * (rows + 1) + 2 * outerBorder;

    shouldEvaluateTo('document.getElementById("stimulus").offsetWidth', expectedWidth);
    shouldEvaluateTo('document.getElementById("stimulus").offsetHeight', expectedHeight);
</script>