blob: c961e736e5a9f42d12f55f8c63b18310a9ab2893 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>WebKit's adaptation of http://test.csswg.org/suites/css2.1/20110111/html4/content-021.htm</title>
<link rel="originalAuthor" title="Microsoft" href="http://www.microsoft.com/">
<link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#propdef-content">
<link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#content">
<meta name="flags" content="">
<meta name="assert" content="The 'content' property properly handles
counter autonesting when anonymous renderers intervene between the
element and its :before descendant.">
<style type="text/css">
#testView div:before {
content: counters(test, ".");
counter-reset: test;
}
#div1 {
border: 2px solid black;
}
</style>
<script src="../../../resources/js-test-pre.js"></script>
<script type="text/javascript">
if (window.testRunner)
testRunner.dumpAsText();
function run()
{
if (!window.testRunner)
return;
shouldBe("window.internals.counterValue(document.getElementById('div1'))", "'0'");
shouldBe("window.internals.counterValue(document.getElementById('div2'))", "'0.0'");
debug('');
debug('TEST COMPLETE');
// Eliminate confusing messages (counter values won't be dumped by dumpAsText).
var viewElement = document.getElementById("testView");
viewElement.parentNode.removeChild(viewElement);
}
</script>
</head>
<body onload="run();">
<p>This is the WebKit version of <a href="http://test.csswg.org/suites/css2.1/20110111/html4/content-021.htm">CSS
Test: Content using a 'counters()' function with a string value</a>.</p>
<div id="testView">
<p>Test passes if there are the numbers "0" and "0.0" in the box below.</p>
<div id="div1">
<div id="div2"></div>
</div>
</div>
<div id="console"></div>
</body>
</html>