| Index: LayoutTests/fast/css/counters/counter-increment-002.html
|
| ===================================================================
|
| --- LayoutTests/fast/css/counters/counter-increment-002.html (revision 0)
|
| +++ LayoutTests/fast/css/counters/counter-increment-002.html (revision 38930)
|
| @@ -0,0 +1,50 @@
|
| +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
| +<html><head>
|
| + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
| + <title>CSS Test: dynamic changes to 'counter-increment'</title>
|
| + <link rel="author" href="http://dbaron.org/" title="L. David Baron">
|
| + <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#counters">
|
| + <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#propdef-content">
|
| + <link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#counter">
|
| + <meta content="dom" name="flags">
|
| + <meta http-equiv="Content-Style-Type" content="text/css">
|
| + <meta http-equiv="Content-Script-Type" content="text/javascript">
|
| + <style type="text/css">
|
| + body { white-space: nowrap; }
|
| + #test, .reset { counter-reset: c; }
|
| + .increment:before, .use:before { content: counters(c, ".") "-"; }
|
| + .increment { counter-increment: c; }
|
| + </style>
|
| + <script type="text/javascript">
|
| + if (window.layoutTestController) {
|
| + layoutTestController.dumpAsText();
|
| + layoutTestController.waitUntilDone();
|
| + }
|
| +
|
| + function run() {
|
| + document.getElementById("one").removeAttribute("class");
|
| + document.getElementById("two").setAttribute("class", "increment");
|
| + document.getElementById("three").setAttribute("style", "counter-increment: c");
|
| + if (window.layoutTestController) {
|
| + testElement = document.getElementById("test");
|
| + console = document.getElementById("console");
|
| + spanList = testElement.getElementsByTagName("span")
|
| + for (i = 0; i < spanList.length; ++i ) {
|
| + newSpanElement = document.createElement("span");
|
| + newSpanElement.innerText =
|
| + layoutTestController.counterValueForElementById(spanList.item(i).getAttribute("id"));
|
| + if (newSpanElement.innerText.length)
|
| + newSpanElement.innerText = newSpanElement.innerText + "-";
|
| + console.appendChild(newSpanElement);
|
| + }
|
| + layoutTestController.notifyDone();
|
| + }
|
| + }
|
| + </script>
|
| +</head><body onload="setTimeout('run()', 0)">
|
| + <p>The following two lines should have the same content:</p>
|
| + <div id="test"><span id="one"></span><span id="parent"><span id="reset" class="reset"><span id="resetchild" class="increment"></span><span class="increment" id="two"></span></span></span><span style="counter-increment: c;" class="use" id="three"></span><span id="upperincrement" class="increment"></span></div>
|
| + <div id="reference">0.1-0.2-1-2-</div>
|
| + <hr>
|
| + <div id="console"></div>
|
| +</body></html>
|
|
|