Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / counters / content-021.html
blobbed9b0c27aff211a7b7697e00b849755a29bd38b
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
2 <html>
3 <head>
4 <title>WebKit's adaptation of http://test.csswg.org/suites/css2.1/20110111/html4/content-021.htm</title>
5 <link rel="originalAuthor" title="Microsoft" href="http://www.microsoft.com/">
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/generate.html#content">
8 <meta name="flags" content="">
9 <meta name="assert" content="The 'content' property properly handles
10 counter autonesting when anonymous renderers intervene between the
11 element and its :before descendant.">
12 <style type="text/css">
13 #testView div:before {
14 content: counters(test, ".");
15 counter-reset: test;
17 #div1 {
18 border: 2px solid black;
20 </style>
21 <script src="../../../resources/js-test.js"></script>
22 <script type="text/javascript">
24 if (window.testRunner)
25 testRunner.dumpAsText();
27 function run()
29 if (!window.testRunner)
30 return;
31 shouldBe("window.internals.counterValue(document.getElementById('div1'))", "'0'");
32 shouldBe("window.internals.counterValue(document.getElementById('div2'))", "'0.0'");
34 debug('');
35 debug('TEST COMPLETE');
36 // Eliminate confusing messages (counter values won't be dumped by dumpAsText).
37 var viewElement = document.getElementById("testView");
38 viewElement.parentNode.removeChild(viewElement);
40 </script>
41 </head>
43 <body onload="run();">
45 <p>This is the WebKit version of <a href="http://test.csswg.org/suites/css2.1/20110111/html4/content-021.htm">CSS
46 Test: Content using a 'counters()' function with a string value</a>.</p>
47 <div id="testView">
48 <p>Test passes if there are the numbers "0" and "0.0" in the box below.</p>
49 <div id="div1">
50 <div id="div2"></div>
51 </div>
52 </div>
53 <div id="console"></div>
54 </body>
55 </html>