| <html> |
| <head> |
| <script src="../../http/tests/inspector/inspector-test.js"></script> |
| <script src="../../http/tests/inspector/elements-test.js"></script> |
| <script> |
| |
| function insertNode() |
| { |
| var dataElement = document.getElementById("data"); |
| dataElement.appendChild(document.createElement("a")); |
| dataElement.removeChild(document.getElementById("id2")); |
| var aElement = document.createElement("a"); |
| dataElement.insertBefore(aElement, document.getElementById("id1")); |
| dataElement.appendChild(aElement); |
| dataElement.insertBefore(aElement, document.getElementById("id1")); |
| } |
| |
| function test() |
| { |
| var dataTreeElement; |
| WebInspector.showPanel("elements"); |
| InspectorTest.nodeWithId("data", step1); |
| |
| function step1(node) |
| { |
| dataTreeElement = WebInspector.panels.elements.treeOutline.findTreeElement(node); |
| dataTreeElement._expandedChildrenLimit = 5; |
| dataTreeElement.reveal(); |
| dataTreeElement.expand(); |
| InspectorTest.runAfterPendingDispatches(step2); |
| } |
| |
| function step2() |
| { |
| InspectorTest.addResult("=========== Loaded 5 children ==========="); |
| InspectorTest.dumpElementsTree(); |
| InspectorTest.evaluateInPage("insertNode()", step3); |
| } |
| |
| function step3() |
| { |
| InspectorTest.runAfterPendingDispatches(step4); |
| } |
| |
| function step4() |
| { |
| InspectorTest.addResult("=========== Modified children ==========="); |
| InspectorTest.dumpElementsTree(); |
| dataTreeElement.handleLoadAllChildren(); |
| InspectorTest.runAfterPendingDispatches(step5); |
| } |
| |
| function step5() |
| { |
| InspectorTest.addResult("=========== Loaded all children ==========="); |
| InspectorTest.dumpElementsTree(); |
| InspectorTest.completeTest(); |
| } |
| } |
| </script> |
| </head> |
| |
| <body onload="runTest()"> |
| <div id="data"> |
| <div id="id1">1</div> |
| <div id="id2">2</div> |
| <div id="id3">3</div> |
| <div id="id4">4</div> |
| <div id="id5">5</div> |
| <div id="id6">6</div> |
| <div id="id7">7</div> |
| <div id="id8">8</div> |
| <div id="id9">9</div> |
| <div id="id10">10</div> |
| </div> |
| <p> |
| Tests that src and href element targets are rewritten properly. |
| </p> |
| </body> |
| </html> |