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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/css/counters/counter-reset-000.html
===================================================================
--- LayoutTests/fast/css/counters/counter-reset-000.html (revision 0)
+++ LayoutTests/fast/css/counters/counter-reset-000.html (revision 38930)
@@ -0,0 +1,51 @@
+<!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-Script-Type" content="text/javascript">
+ <style type="text/css">
+ body { white-space: nowrap; }
+ #test, .reset { counter-reset: c; }
+ .increment:before { content: counters(c, ".") "-"; }
+ .increment { counter-increment: c; }
+ </style>
+ <script type="text/javascript">
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ function run() {
+ var t = document.getElementById("test");
+ var s = document.createElement("span");
+ s.setAttribute("class", "reset");
+ s.setAttribute("id", "newSpan");
+ t.insertBefore(s, t.childNodes.item(1));
+ 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 be the same:</p>
+ <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>
+ <div id="reference">1-1.1-1.2-</div>
+ <hr>
+ <div id="console"/>
+</body></html>

Powered by Google App Engine
This is Rietveld 408576698