Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / counters / counter-reset-002.html
blob270259a93e613c29f4b43af2b312cad787b7d660
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
2 <html><head>
3 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4 <title>CSS Test: dynamic changes to 'counter-increment'</title>
5 <link rel="author" href="http://dbaron.org/" title="L. David Baron">
6 <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#counters">
7 <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#propdef-content">
8 <link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#counter">
9 <meta content="dom" name="flags">
10 <meta http-equiv="Content-Script-Type" content="text/javascript">
11 <style type="text/css">
12 body { white-space: nowrap; }
13 #test, .reset { counter-reset: c; }
14 .increment:before { content: counters(c, ".") "-"; }
15 .increment { counter-increment: c; }
16 </style>
17 <script type="text/javascript">
18 if (window.testRunner) {
19 testRunner.dumpAsText();
20 testRunner.waitUntilDone();
23 function run() {
24 document.getElementById("one").setAttribute("class", "reset");
25 document.getElementById("two").removeAttribute("class");
26 if (window.testRunner) {
27 testElement = document.getElementById("test");
28 console = document.getElementById("console");
29 spanList = testElement.getElementsByTagName("span")
30 for (i = 0; i < spanList.length; ++i ) {
31 newSpanElement = document.createElement("span");
32 newSpanElement.innerText =
33 window.internals.counterValue(document.getElementById(spanList.item(i).getAttribute("id")));
34 if (newSpanElement.innerText.length)
35 newSpanElement.innerText = newSpanElement.innerText + "-";
36 console.appendChild(newSpanElement);
38 testRunner.notifyDone();
41 </script>
42 </head><body onload="setTimeout('run()', 0)">
43 <p>The following two lines should be the same:</p>
44 <div id="test"><span id="span1" class="increment"></span><span id="span2"><span class="reset" id="one"><span id="span4" class="increment"></span></span></span><span id="span5" class="increment"></span><span id="span6"><span id="two"><span id="span7" class="increment"></span></span></span><span id="span8" class="increment"></span></div>
45 <div id="reference">1-1.1-2-3-4-</div>
46 <div id="console" />
47 </body></html>