Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / counters / counter-reset-001.html
blob00d4556e1b22d3657ddc92db94593f5be970d1bf
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
2 <html>
3 <head>
4 <title>CSS 2.1 Test Suite: dynamic changes to 'counter-increment'</title>
5 <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#counters">
6 <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#propdef-content">
7 <link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#counter">
8 <meta http-equiv="Content-Script-Type" content="text/javascript"></meta>
9 <style type="text/css">
11 body { white-space: nowrap; }
14 #test, .reset { counter-reset: c; }
15 .increment:before { content: counters(c, ".") "-"; }
16 .increment { counter-increment: c; }
18 </style>
19 <script type="text/javascript">
21 function run() {
22 if (window.testRunner) {
23 testRunner.dumpAsText();
24 // This call ensures the layout happened before we modify the DOM tree.
25 window.internals.counterValue(document.getElementById("span1"));
28 var t = document.getElementById("test");
29 t.removeChild(t.childNodes.item(1));
31 if (window.testRunner) {
32 testElement = document.getElementById("test");
33 console = document.getElementById("console");
34 spanList = testElement.getElementsByTagName("span");
35 for (i = 0; i < spanList.length; ++i ) {
36 newSpanElement = document.createElement("span");
37 newSpanElement.innerText = window.internals.counterValue(document.getElementById(spanList.item(i).getAttribute("id")));
38 if (newSpanElement.innerText.length)
39 newSpanElement.innerText = newSpanElement.innerText + "-";
40 console.appendChild(newSpanElement);
45 </script>
46 </head>
47 <body onload="run();">
49 <p>The following two lines should be the same:</p>
51 <div id="test"><span id="span1" class="increment"></span><span id="span2" class="reset"></span><span id="span3" class="increment"></span><span id="span4" class="increment"></span></div>
53 <div id="reference">1-2-3-</div>
54 <hr>
55 <div id="console"/>
56 </body>
57 </html>