7 -webkit-flow-into: flow;
10 <script type="text/javascript" src="../../http/tests/inspector-protocol/resources/protocol-test.js"></script>
12 function changeFlowContent()
14 document.getElementById("contentRemoved").remove();
19 InspectorTest.initializeInspectorModels();
23 WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.MainFrameDidChange, function(event) {
24 var domTree = WebInspector.frameResourceManager.mainFrame.domTree;
25 domTree.addEventListener(WebInspector.DOMTree.Event.RootDOMNodeInvalidated, onRootDOMNodeInvalidated, null);
26 domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasAdded, onContentFlowWasAdded, null);
27 domTree.requestContentFlowList();
30 function onRootDOMNodeInvalidated()
32 WebInspector.frameResourceManager.mainFrame.domTree.requestContentFlowList();
35 function onContentFlowWasAdded(event)
37 contentFlow = event.data.flow;
38 InspectorTest.assert(contentFlow.name === "flow", "ContentFlow was added.");
39 InspectorTest.assert(contentFlow.contentNodes.length === 2, "ContentFlow.contentNodes has a length of 2.");
40 InspectorTest.assert(contentFlow.contentNodes[0].getAttribute("id") === "contentStatic", "ContentFlow.contentNodes[0].id is \"#contentStatic\".");
41 InspectorTest.assert(contentFlow.contentNodes[1].getAttribute("id") === "contentRemoved", "ContentFlow.contentNodes[1].id is \"#contentRemoved\".");
43 contentFlow.addEventListener(WebInspector.ContentFlow.Event.ContentNodeWasRemoved, onContentNodeWasRemoved, null);
45 InspectorTest.sendCommand("Runtime.evaluate", {expression: "changeFlowContent()"});
48 function onContentNodeWasRemoved(event)
50 InspectorTest.assert(event.data.node.getAttribute("id") === "contentRemoved", "\"#contentRemoved\" was removed.");
51 InspectorTest.assert(contentFlow.contentNodes.indexOf(event.data.node) === -1, "\"#contentRemoved\" cannot be found in the contentNodes list.");
52 InspectorTest.completeTest();
57 <body onload="runTest()">
58 <p>Testing that the ContentFlows events are correctly dispatched when content nodes are detached from the DOM.</p>
60 <div id="contentStatic" class="content"></div>
61 <div id="contentRemoved" class="content"></div>