Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / tab-size.html
blob90aae07965295ccb51120e0a461512584fc33b5c
1 <html>
2 <head>
3 <style>
4 pre { margin: 0.1em; }
5 </style>
6 <script>
8 function setupBlock(description, style)
10 var descriptionBlock = document.createElement("b");
11 descriptionBlock.innerHTML = description;
12 document.body.appendChild(descriptionBlock);
14 var block = document.createElement("div");
15 if (style)
16 block.setAttribute("style", style);
17 block.innerHTML = document.getElementById("template").innerHTML;
18 document.body.appendChild(block);
19 return block;
22 function test()
25 setupBlock("Default tab size (8).", null);
26 setupBlock("Tab size = -10, should fall back to the default.", "tab-size: -10;");
27 setupBlock("Tab size = 2.", "tab-size: 2;");
29 var dynamicBlock = setupBlock("Tab size becomes 2 dynamically.", null);
31 if (window.testRunner)
32 testRunner.waitUntilDone();
33 window.setTimeout(function() {
34 dynamicBlock.style.setProperty("tab-size", "2");
35 if (window.testRunner)
36 testRunner.notifyDone();
37 }, 0);
39 </script>
40 </head>
41 <body onload="test();">
42 <div id="template" style="display:none;">
43 <pre>&Tab;x</pre>
44 <pre>&Tab;&Tab;x</pre>
45 <pre>&Tab;x&Tab;x</pre>
46 <pre>xx&Tab;xx&Tab;x</pre>
47 <pre>xxxxxxxxx&Tab;xx&Tab;x</pre>
48 </div>
50 </body>
51 </html>