<html>
    <head>
        <script src="resources/dump-list.js"></script>
        <script>
            function test()
            {
                if (window.testRunner)
                    testRunner.dumpAsText();

                var list = document.getElementById("list");
                list.offsetTop; // Force a relayout.

                var b = document.getElementsByTagName("b")[0];
                list.removeChild(b);

                var div = document.getElementById("nested");
                var items = div.children.length;
                for (var i = 0; i < items; ++i)
                    div.removeChild(div.firstElementChild);

                list.removeChild(document.getElementById("item"));

                document.getElementById("console").innerHTML = dumpList(list);

                // Don't show the actual list as it is useless in the text-only mode.
                list.parentNode.removeChild(list);
            }
        </script>
    </head>
    <body onload="test()">
        <p>This tests that list item markers are updated when removing existing items that are not direct children of the list element.</p>
        <ol id="list">
            <li>One</li>
            <li>Two</li>
            <b><li>Foo</li></b>
            <li>Three</li>
            <li>Four</li>
            <li>Five</li>
            <div id="nested">
                <li>Foo</li>
                <li>Bar</li>
                <li>Baz</li>
            </div>
            <li>Six</li>
            <div id="item" style="display: list-item">Foo</div>
            <li>Seven</li>
        </ol>

        <div id="console"></div>
    </body>
</html>
