Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Side by Side Diff: LayoutTests/fast/css/counters/counter-reset-000.html

Issue 601062: Merge 53506 - 20100119 Carol Szabo <carol.szabo@nokia.com>... (Closed) Base URL: svn://chrome-svn/chrome/branches/WebKit/249/
Patch Set: Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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-cont ent">
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.layoutTestController) {
19 layoutTestController.dumpAsText();
20 layoutTestController.waitUntilDone();
21 }
22
23 function run() {
24 var t = document.getElementById("test");
25 var s = document.createElement("span");
26 s.setAttribute("class", "reset");
27 s.setAttribute("id", "newSpan");
28 t.insertBefore(s, t.childNodes.item(1));
29 if (window.layoutTestController) {
30 testElement = document.getElementById("test");
31 console = document.getElementById("console");
32 spanList = testElement.getElementsByTagName("span")
33 for (i = 0; i < spanList.length; ++i ) {
34 newSpanElement = document.createElement("span");
35 newSpanElement.innerText =
36 layoutTestController.counterValueForElementById(spanList.ite m(i).getAttribute("id"));
37 if (newSpanElement.innerText.length)
38 newSpanElement.innerText = newSpanElement.innerText + "- "
39 console.appendChild(newSpanElement);
40 }
41 layoutTestController.notifyDone();
42 }
43 }
44 </script>
45 </head><body onload="setTimeout('run()', 0)">
46 <p>The following two lines should be the same:</p>
47 <div id="test"><span id="span1" class="increment"></span><span id="span2" cl ass="reset"></span><span id="span3" class="increment"></span><span id="span4" cl ass="increment"></span></div>
48 <div id="reference">1-1.1-1.2-</div>
49 <hr>
50 <div id="console"/>
51 </body></html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698