| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <link rel="import" href="inspector/backend/dom-agent.html" as="DOMAgent" /> | |
| 3 <div></div> | |
| 4 <script> | |
| 5 // FIXME: This shows a bug in our DOM mutation handling, we should | |
| 6 // only get one childNodeInserted record here, but we get two, which | |
| 7 // means the inspector shows two nodes where it should only show one. | |
| 8 | |
| 9 // setTimeout to flush pending DOM modifications and measure | |
| 10 // only the changes we want to. | |
| 11 setTimeout(function() { | |
| 12 var delegate = { | |
| 13 sendMessage: function(message, params) { | |
| 14 console.log(message); | |
| 15 if (params.node) | |
| 16 console.log(params.node.nodeId); | |
| 17 if (params.node && params.node.children) | |
| 18 console.log(params.node.children[0].nodeId); | |
| 19 } | |
| 20 }; | |
| 21 | |
| 22 var domAgent = new DOMAgent(delegate); | |
| 23 domAgent.enable(); | |
| 24 | |
| 25 var adding = document.createElement('adding'); | |
| 26 document.querySelector('div').appendChild(adding); | |
| 27 adding.textContent = 'adding'; | |
| 28 | |
| 29 setTimeout(function() { | |
| 30 internals.notifyTestComplete(internals.contentAsText()); | |
| 31 }); | |
| 32 }); | |
| 33 </script> | |
| 34 </html> | |
| OLD | NEW |