<html>
<script>
    if (window.testRunner)
        testRunner.dumpAsText();
</script>
<body id="body">
 
    <!-- This test makes sure that spacer elements are not returned as elements. There should be at most 4 elements returned -->
 
   <b>First</b>
   <b>Second</b>
   <a href="http://www.apple.com">Apple</a>
   <a href="http://www.yahoo.com">Yahoo</a>

    
    <div id="result"></div>

     
    <script>
        if (window.accessibilityController) {
            var result = document.getElementById("result");

            var body = document.getElementById("body");
            body.focus();
            var container = accessibilityController.focusedElement.childAtIndex(0);

            // The Gtk and EFL ports ATs expect the bold inline text to not have accessible objects.
            var expectedCount = (testRunner.platformName == "gtk" || testRunner.platformName == "efl") ? 2 : 4;
            if (container.childrenCount == expectedCount) {
                result.innerText += "Test passed\n";
            }
            else {
                 result.innerText += "Test failed\n";
            }
        }
    </script>
</body>
</html>
