summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/table/table-anonymous-row-bug.html
blob: e7d9267e4c1494741bdc799a4d0fbfe300caafd8 (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
<!DOCTYPE html>
<html>
<body style="font-family: Ahem; -webkit-font-smoothing: none;">
<style>
    div.table { display: table; }
    div.cell { display: table-cell; width: 50px; height: 50px; background-color: blue; }
    div.row { display: table-row; }
    div.test { background-color: green; width: 50px; height: 50px; }
</style>

<div class="table" id="table-1">
    <div class="row" id="row-1">
      <div class="cell"></div>
    </div>
    <div class="row" id="row-2">
      <div class="cell"></div>
    </div>
</div>

<script>
    function createDiv()
    {
      var divElement = document.createElement("div");
      divElement.setAttribute("class", "test");
      return divElement;
    }

    function insertDiv(tableID, beforeID)
    {
        var table = document.getElementById(tableID);
        var before = document.getElementById(beforeID);
        table.insertBefore(createDiv(), before);
    }

    document.body.offsetTop;

    insertDiv("table-1", "row-2");
</script>
</body>
</html>