<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
 <head>
  <title>Counters in :before node that is hidden inside an anonymous block.</title>
  <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="DumpRenderTree finds couner  when anonymous 
  renderers intervene between the element and its :before descendant.">
  <style type="text/css">
   #div1: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'");

      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();">
 <div id="testView">
  <p>Test passes if there is a "0" in the box below.</p>
  <div id="div1">
   <div id="div2"></div>
  </div>
 </div>
 <div id="console"></div>
 </body>
</html>
