summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/tab-size.html
blob: 90aae07965295ccb51120e0a461512584fc33b5c (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
<html>
<head>
<style>
pre { margin: 0.1em; }
</style>
<script>

function setupBlock(description, style)
{
    var descriptionBlock = document.createElement("b");
    descriptionBlock.innerHTML = description;
    document.body.appendChild(descriptionBlock);

    var block = document.createElement("div");
    if (style)
        block.setAttribute("style", style);
    block.innerHTML = document.getElementById("template").innerHTML;
    document.body.appendChild(block);
    return block;
}

function test()
{

    setupBlock("Default tab size (8).", null);
    setupBlock("Tab size = -10, should fall back to the default.", "tab-size: -10;");
    setupBlock("Tab size = 2.", "tab-size: 2;");

    var dynamicBlock = setupBlock("Tab size becomes 2 dynamically.", null);

    if (window.testRunner)
        testRunner.waitUntilDone();
    window.setTimeout(function() {
        dynamicBlock.style.setProperty("tab-size", "2");
        if (window.testRunner)
            testRunner.notifyDone();
    }, 0);
}
</script>
</head>
<body onload="test();">
<div id="template" style="display:none;">
<pre>&Tab;x</pre>
<pre>&Tab;&Tab;x</pre>
<pre>&Tab;x&Tab;x</pre>
<pre>xx&Tab;xx&Tab;x</pre>
<pre>xxxxxxxxx&Tab;xx&Tab;x</pre>
</div>

</body>
</html>