summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dynamic/create-renderer-for-whitespace-only-text.html
blob: 13b6fb21f20ac8872c3460a7480b4347af0ac516 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
<style>
    table { border-collapse: collapse; }
    td { border: 1px solid black; padding: 4px; }

    ul.inlineItems li { display: inline; }

    div.inlineDivs div { display: inline; }
</style>
<p>
    Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=14134">http://bugs.webkit.org/show_bug.cgi?id=14134</a>
    REGRESSION (r25353): Whitespace nodes ignored between inline list items</i>.
</p>
<p>
    This tests that whitespace-only text nodes get renderers when they should
    even if initially they did not need a renderer.
</p>
<p>
    The left column should be identical to the right column.
</p>
<table>
    <tr>
        <td>
            <div id="target">suit</div>
        </td>
        <td>
            <div>wet suit</div>
        </td>
    </tr>
    <tr>
        <td>
            <ul id="list">
                <li>wet</li>
                <li>suit</li>
            </ul>
        </td>
        <td>
            <ul class="inlineItems">
                <li>wet</li>
                <li>suit</li>
            </ul>
        </td>
    </tr>
    <tr>
        <td>
            <div id="div">
                <div>wet</div>
                <div>suit</div>
            </div>
        </td>
        <td>
            <div class="inlineDivs">
                <div>wet</div>
                <div>suit</div>
            </div>
        </td>
    </tr>
</table>
<script>
    function test()
    {
        var target = document.getElementById("target");
        target.insertBefore(document.createTextNode(" "), target.firstChild);
        target.insertBefore(document.createTextNode("wet"), target.firstChild);

        document.getElementById("list").className = "inlineItems";

        document.getElementById("div").className = "inlineDivs";
    }

    test();
</script>