<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[208246] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/208246">208246</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-11-01 14:48:31 -0700 (Tue, 01 Nov 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Replace sublists inside DOM-related model objects with WI.Collection
https://bugs.webkit.org/show_bug.cgi?id=164098

Patch by Devin Rousso &lt;dcrousso+webkit@gmail.com&gt; on 2016-11-01
Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

* UserInterface/Models/DOMTree.js:
* UserInterface/Models/Frame.js:
Add support for WebInspector.Collection.

* UserInterface/Models/Script.js:
(WebInspector.Script):
* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._addResourcesRecursivelyForFrame):
* UserInterface/Views/FrameTreeElement.js:
(WebInspector.FrameTreeElement):
(WebInspector.FrameTreeElement.prototype.onpopulate):
* UserInterface/Views/OpenResourceDialog.js:
(WebInspector.OpenResourceDialog.prototype._addResourcesForFrame):
Use new functions defined by changing to WebInspector.Collection.

LayoutTests:

* http/tests/inspector/console/cross-domain-inspected-node-access-expected.txt:
* http/tests/inspector/console/cross-domain-inspected-node-access.html:
* http/tests/inspector/dom/disconnect-dom-tree-after-main-frame-navigation.html:
* inspector/css/manager-preferredInspectorStyleSheetForFrame-expected.txt:
* inspector/css/manager-preferredInspectorStyleSheetForFrame.html:
* inspector/dom/content-flow-list.html:
* inspector/dom/highlightFrame-expected.txt:
* inspector/dom/highlightFrame.html:
* inspector/dom/highlightNode-expected.txt:
* inspector/dom/highlightNode.html:
* inspector/dom/highlightSelector-expected.txt:
* inspector/dom/highlightSelector.html:
* inspector/model/frame-extra-scripts-expected.txt:
* inspector/model/frame-extra-scripts.html:
Change functionality to support WebInspector.Collection methods.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestsinspectorconsolecrossdomaininspectednodeaccessexpectedtxt">trunk/LayoutTests/http/tests/inspector/console/cross-domain-inspected-node-access-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsinspectorconsolecrossdomaininspectednodeaccesshtml">trunk/LayoutTests/http/tests/inspector/console/cross-domain-inspected-node-access.html</a></li>
<li><a href="#trunkLayoutTestshttptestsinspectordomdisconnectdomtreeaftermainframenavigationhtml">trunk/LayoutTests/http/tests/inspector/dom/disconnect-dom-tree-after-main-frame-navigation.html</a></li>
<li><a href="#trunkLayoutTestsinspectorcssmanagerpreferredInspectorStyleSheetForFrameexpectedtxt">trunk/LayoutTests/inspector/css/manager-preferredInspectorStyleSheetForFrame-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorcssmanagerpreferredInspectorStyleSheetForFramehtml">trunk/LayoutTests/inspector/css/manager-preferredInspectorStyleSheetForFrame.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomcontentflowlisthtml">trunk/LayoutTests/inspector/dom/content-flow-list.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightFrameexpectedtxt">trunk/LayoutTests/inspector/dom/highlightFrame-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightFramehtml">trunk/LayoutTests/inspector/dom/highlightFrame.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightNodeexpectedtxt">trunk/LayoutTests/inspector/dom/highlightNode-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightNodehtml">trunk/LayoutTests/inspector/dom/highlightNode.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightSelectorexpectedtxt">trunk/LayoutTests/inspector/dom/highlightSelector-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightSelectorhtml">trunk/LayoutTests/inspector/dom/highlightSelector.html</a></li>
<li><a href="#trunkLayoutTestsinspectormodelframeextrascriptsexpectedtxt">trunk/LayoutTests/inspector/model/frame-extra-scripts-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectormodelframeextrascriptshtml">trunk/LayoutTests/inspector/model/frame-extra-scripts.html</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsCollectionjs">trunk/Source/WebInspectorUI/UserInterface/Models/Collection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsDOMTreejs">trunk/Source/WebInspectorUI/UserInterface/Models/DOMTree.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsFramejs">trunk/Source/WebInspectorUI/UserInterface/Models/Frame.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsScriptjs">trunk/Source/WebInspectorUI/UserInterface/Models/Script.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFrameTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsOpenResourceDialogjs">trunk/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/LayoutTests/ChangeLog        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2016-11-01  Devin Rousso  &lt;dcrousso+webkit@gmail.com&gt;
+
+        Web Inspector: Replace sublists inside DOM-related model objects with WI.Collection
+        https://bugs.webkit.org/show_bug.cgi?id=164098
+
+        Reviewed by Timothy Hatcher.
+
+        * http/tests/inspector/console/cross-domain-inspected-node-access-expected.txt:
+        * http/tests/inspector/console/cross-domain-inspected-node-access.html:
+        * http/tests/inspector/dom/disconnect-dom-tree-after-main-frame-navigation.html:
+        * inspector/css/manager-preferredInspectorStyleSheetForFrame-expected.txt:
+        * inspector/css/manager-preferredInspectorStyleSheetForFrame.html:
+        * inspector/dom/content-flow-list.html:
+        * inspector/dom/highlightFrame-expected.txt:
+        * inspector/dom/highlightFrame.html:
+        * inspector/dom/highlightNode-expected.txt:
+        * inspector/dom/highlightNode.html:
+        * inspector/dom/highlightSelector-expected.txt:
+        * inspector/dom/highlightSelector.html:
+        * inspector/model/frame-extra-scripts-expected.txt:
+        * inspector/model/frame-extra-scripts.html:
+        Change functionality to support WebInspector.Collection methods.
+
</ins><span class="cx"> 2016-11-01  Antoine Quint  &lt;graouts@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Modern Media Controls] Media Controller: Placard support
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsinspectorconsolecrossdomaininspectednodeaccessexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/inspector/console/cross-domain-inspected-node-access-expected.txt (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/inspector/console/cross-domain-inspected-node-access-expected.txt        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/LayoutTests/http/tests/inspector/console/cross-domain-inspected-node-access-expected.txt        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -3,6 +3,7 @@
</span><span class="cx"> Test that code evaluated in the main frame cannot access $0 that resolves to a node in a frame from a different domain. Bug 105423.
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+PASS: Page should have a subframe.
</ins><span class="cx"> 
</span><span class="cx"> == Running test suite: CommandLineAPI.$0.cross-frame
</span><span class="cx"> -- Running test case: AttemptCrossFrame$0AccessFromMainFrame
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsinspectorconsolecrossdomaininspectednodeaccesshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/inspector/console/cross-domain-inspected-node-access.html (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/inspector/console/cross-domain-inspected-node-access.html        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/LayoutTests/http/tests/inspector/console/cross-domain-inspected-node-access.html        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -7,6 +7,10 @@
</span><span class="cx"> {
</span><span class="cx">     let suite = InspectorTest.createAsyncSuite(&quot;CommandLineAPI.$0.cross-frame&quot;);
</span><span class="cx"> 
</span><ins>+    let mainFrame = WebInspector.frameResourceManager.mainFrame;
+    let childFrames = mainFrame.childFrameCollection.toArray();
+    InspectorTest.expectEqual(childFrames.length, 1, &quot;Page should have a subframe.&quot;);
+
</ins><span class="cx">     let nodeInMainFrameId;
</span><span class="cx">     let nodeInSubFrameId;
</span><span class="cx"> 
</span><span class="lines">@@ -13,7 +17,7 @@
</span><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;AttemptCrossFrame$0AccessFromMainFrame&quot;,
</span><span class="cx">         description: &quot;Should not be able to access $0 node in different domain subframe from the main frame.&quot;,
</span><del>-        test: (resolve, reject) =&gt; {
</del><ins>+        test(resolve, reject) {
</ins><span class="cx">             InspectorTest.log(&quot;Setting $0 to node within subframe.&quot;);
</span><span class="cx">             ConsoleAgent.addInspectedNode(nodeInSubFrameId);
</span><span class="cx">             RuntimeAgent.evaluate.invoke({expression: &quot;$0&quot;, includeCommandLineAPI: true}, (error, remoteObjectPayload, wasThrown) =&gt; {    
</span><span class="lines">@@ -29,7 +33,7 @@
</span><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;AttemptSameFrame$0AccessFromMainFrame&quot;,
</span><span class="cx">         description: &quot;Should be able to access $0 node in the same frame.&quot;,
</span><del>-        test: (resolve, reject) =&gt; {
</del><ins>+        test(resolve, reject) {
</ins><span class="cx">             InspectorTest.log(&quot;Setting $0 to node within the main frame.&quot;);
</span><span class="cx">             ConsoleAgent.addInspectedNode(nodeInMainFrameId);
</span><span class="cx">             RuntimeAgent.evaluate.invoke({expression: &quot;$0&quot;, includeCommandLineAPI: true}, (error, remoteObjectPayload, wasThrown) =&gt; {
</span><span class="lines">@@ -45,11 +49,10 @@
</span><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;AttemptCrossFrame$0AccessFromSubFrame&quot;,
</span><span class="cx">         description: &quot;Should not be able to access $0 node in different domain main frame from the subframe.&quot;,
</span><del>-        test: (resolve, reject) =&gt; {
</del><ins>+        test(resolve, reject) {
</ins><span class="cx">             InspectorTest.log(&quot;Setting $0 to node within the main frame.&quot;);
</span><span class="cx">             ConsoleAgent.addInspectedNode(nodeInMainFrameId);
</span><del>-            const childFrame = WebInspector.frameResourceManager.mainFrame.childFrames[0];
-            RuntimeAgent.evaluate.invoke({expression: &quot;$0&quot;, includeCommandLineAPI: true, contextId: childFrame.pageExecutionContext.id}, (error, remoteObjectPayload, wasThrown) =&gt; {    
</del><ins>+            RuntimeAgent.evaluate.invoke({expression: &quot;$0&quot;, includeCommandLineAPI: true, contextId: childFrames[0].pageExecutionContext.id}, (error, remoteObjectPayload, wasThrown) =&gt; {
</ins><span class="cx">                 InspectorTest.assert(!error, &quot;Should not be a protocol error.&quot;);
</span><span class="cx">                 InspectorTest.assert(!wasThrown, &quot;Should not be an exception.&quot;);
</span><span class="cx">                 let remoteObject = WebInspector.RemoteObject.fromPayload(remoteObjectPayload);
</span><span class="lines">@@ -62,11 +65,10 @@
</span><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;AttemptSameFrame$0AccessFromSubFrame&quot;,
</span><span class="cx">         description: &quot;Should be able to access $0 node in the same frame.&quot;,
</span><del>-        test: (resolve, reject) =&gt; {
</del><ins>+        test(resolve, reject) {
</ins><span class="cx">             InspectorTest.log(&quot;Setting $0 to node within the subframe.&quot;);
</span><span class="cx">             ConsoleAgent.addInspectedNode(nodeInSubFrameId);
</span><del>-            const childFrame = WebInspector.frameResourceManager.mainFrame.childFrames[0];
-            RuntimeAgent.evaluate.invoke({expression: &quot;$0&quot;, includeCommandLineAPI: true, contextId: childFrame.pageExecutionContext.id}, (error, remoteObjectPayload, wasThrown) =&gt; {
</del><ins>+            RuntimeAgent.evaluate.invoke({expression: &quot;$0&quot;, includeCommandLineAPI: true, contextId: childFrames[0].pageExecutionContext.id}, (error, remoteObjectPayload, wasThrown) =&gt; {
</ins><span class="cx">                 InspectorTest.assert(!error, &quot;Should not be a protocol error.&quot;);
</span><span class="cx">                 InspectorTest.assert(!wasThrown, &quot;Should not be an exception.&quot;);
</span><span class="cx">                 let remoteObject = WebInspector.RemoteObject.fromPayload(remoteObjectPayload);
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsinspectordomdisconnectdomtreeaftermainframenavigationhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/inspector/dom/disconnect-dom-tree-after-main-frame-navigation.html (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/inspector/dom/disconnect-dom-tree-after-main-frame-navigation.html        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/LayoutTests/http/tests/inspector/dom/disconnect-dom-tree-after-main-frame-navigation.html        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -30,10 +30,15 @@
</span><span class="cx">             InspectorTest.log(&quot;DOMTree instance count: &quot; + instances.size);
</span><span class="cx"> 
</span><span class="cx">             // Force creation of child DOM trees.
</span><del>-            mainFrame.childFrames[0].domTree;
-            mainFrame.childFrames[0].childFrames[0].domTree;
-            mainFrame.childFrames[0].childFrames[0].childFrames[0].domTree;
</del><ins>+            let childrenLevel1 = mainFrame.childFrameCollection.toArray();
+            childrenLevel1[0].domTree;
</ins><span class="cx"> 
</span><ins>+            let childrenLevel2 = childrenLevel1[0].childFrameCollection.toArray();
+            childrenLevel2[0].domTree;
+
+            let childrenLevel3 = childrenLevel2[0].childFrameCollection.toArray();
+            childrenLevel3[0].domTree;
+
</ins><span class="cx">             instances = WebInspector.domTreeManager.retainedObjectsWithPrototype(WebInspector.DOMTree);
</span><span class="cx">             InspectorTest.expectThat(instances.size === 4, &quot;There should be four DOMTrees listening to DOMTreeManager events after touching each Frame.&quot;);
</span><span class="cx">             InspectorTest.log(&quot;DOMTree instance count: &quot; + instances.size);
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorcssmanagerpreferredInspectorStyleSheetForFrameexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/css/manager-preferredInspectorStyleSheetForFrame-expected.txt (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/css/manager-preferredInspectorStyleSheetForFrame-expected.txt        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/LayoutTests/inspector/css/manager-preferredInspectorStyleSheetForFrame-expected.txt        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> Test CSSManager.preferredInspectorStyleSheetForFrame.
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+PASS: Page should have a subframe.
</ins><span class="cx"> 
</span><span class="cx"> == Running test suite: CSSManager.preferredInspectorStyleSheetForFrame
</span><span class="cx"> -- Running test case: CheckNoStyleSheets
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorcssmanagerpreferredInspectorStyleSheetForFramehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/css/manager-preferredInspectorStyleSheetForFrame.html (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/css/manager-preferredInspectorStyleSheetForFrame.html        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/LayoutTests/inspector/css/manager-preferredInspectorStyleSheetForFrame.html        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -6,7 +6,8 @@
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><span class="cx">     let mainFrame = WebInspector.frameResourceManager.mainFrame;
</span><del>-    let childFrame = mainFrame.childFrames[0];
</del><ins>+    let childFrames = mainFrame.childFrameCollection.toArray();
+    InspectorTest.expectEqual(childFrames.length, 1, &quot;Page should have a subframe.&quot;);
</ins><span class="cx"> 
</span><span class="cx">     let suite = InspectorTest.createAsyncSuite(&quot;CSSManager.preferredInspectorStyleSheetForFrame&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -64,10 +65,10 @@
</span><span class="cx">             .then((event) =&gt; {
</span><span class="cx">                 InspectorTest.expectThat(event.data.styleSheet.origin === WebInspector.CSSStyleSheet.Type.Inspector, &quot;Added StyleSheet origin should be 'inspector'.&quot;);
</span><span class="cx">                 InspectorTest.expectThat(event.data.styleSheet.isInspectorStyleSheet(), &quot;StyleSheet.isInspectorStyleSheet() should be true.&quot;);
</span><del>-                InspectorTest.expectThat(event.data.styleSheet.parentFrame === childFrame, &quot;Added StyleSheet frame should be a child frame.&quot;);
</del><ins>+                InspectorTest.expectThat(event.data.styleSheet.parentFrame === childFrames[0], &quot;Added StyleSheet frame should be a child frame.&quot;);
</ins><span class="cx">             });
</span><span class="cx"> 
</span><del>-            WebInspector.cssStyleManager.preferredInspectorStyleSheetForFrame(childFrame, (styleSheet) =&gt; {
</del><ins>+            WebInspector.cssStyleManager.preferredInspectorStyleSheetForFrame(childFrames[0], (styleSheet) =&gt; {
</ins><span class="cx">                 InspectorTest.expectThat(WebInspector.cssStyleManager.styleSheets.length === 2, &quot;Should be two stylesheets.&quot;);
</span><span class="cx">                 InspectorTest.expectThat(styleSheet.origin === WebInspector.CSSStyleSheet.Type.Inspector, &quot;StyleSheet origin should be 'inspector'.&quot;);
</span><span class="cx">                 InspectorTest.expectThat(styleSheet.isInspectorStyleSheet(), &quot;StyleSheet.isInspectorStyleSheet() should be true.&quot;);
</span><span class="lines">@@ -83,7 +84,7 @@
</span><span class="cx">             let listener = WebInspector.cssStyleManager.singleFireEventListener(WebInspector.CSSStyleManager.Event.StyleSheetAdded, (event) =&gt; {
</span><span class="cx">                 InspectorTest.assert(false, &quot;Should not create a new StyleSheet, should reuse the existing one&quot;);
</span><span class="cx">             });
</span><del>-            WebInspector.cssStyleManager.preferredInspectorStyleSheetForFrame(childFrame, (styleSheet) =&gt; {
</del><ins>+            WebInspector.cssStyleManager.preferredInspectorStyleSheetForFrame(childFrames[0], (styleSheet) =&gt; {
</ins><span class="cx">                 InspectorTest.expectThat(WebInspector.cssStyleManager.styleSheets.length === 2, &quot;Should be two stylesheets.&quot;);
</span><span class="cx">                 InspectorTest.expectThat(styleSheet.origin === WebInspector.CSSStyleSheet.Type.Inspector, &quot;StyleSheet origin should be 'inspector'.&quot;);
</span><span class="cx">                 InspectorTest.expectThat(styleSheet.isInspectorStyleSheet(), &quot;StyleSheet.isInspectorStyleSheet() should be true.&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomcontentflowlisthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/dom/content-flow-list.html (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/content-flow-list.html        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/LayoutTests/inspector/dom/content-flow-list.html        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -16,15 +16,17 @@
</span><span class="cx"> 
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><ins>+    let domTree = WebInspector.frameResourceManager.mainFrame.domTree;
+
</ins><span class="cx">     function onRootDOMNodeInvalidated()
</span><span class="cx">     {
</span><del>-        WebInspector.frameResourceManager.mainFrame.domTree.requestContentFlowList();
</del><ins>+        domTree.requestContentFlowList();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function onContentFlowWasAdded(event)
</span><span class="cx">     {
</span><del>-        InspectorTest.expectThat(event.data.flow.name === &quot;flow1&quot;, &quot;ContentFlow was added&quot;);
-        InspectorTest.expectThat(WebInspector.frameResourceManager.mainFrame.domTree.flowsCount === 1, &quot;Flow count is 1&quot;);
</del><ins>+        InspectorTest.expectEqual(event.data.flow.name, &quot;flow1&quot;, &quot;ContentFlow was added&quot;);
+        InspectorTest.expectEqual(domTree.contentFlowCollection.items.size, 1, &quot;Flow count is 1&quot;);
</ins><span class="cx"> 
</span><span class="cx">         InspectorTest.evaluateInPage(&quot;removeFlow()&quot;);
</span><span class="cx">     }
</span><span class="lines">@@ -31,16 +33,15 @@
</span><span class="cx"> 
</span><span class="cx">     function onContentFlowWasRemoved(event)
</span><span class="cx">     {
</span><del>-        InspectorTest.expectThat(event.data.flow.name === &quot;flow1&quot;, &quot;ContentFlow was removed&quot;);
-        InspectorTest.expectThat(WebInspector.frameResourceManager.mainFrame.domTree.flowsCount === 0, &quot;Flow count is 0&quot;);
</del><ins>+        InspectorTest.expectEqual(event.data.flow.name, &quot;flow1&quot;, &quot;ContentFlow was removed&quot;);
+        InspectorTest.expectEqual(domTree.contentFlowCollection.items.size, 0, &quot;Flow count is 0&quot;);
</ins><span class="cx">         InspectorTest.completeTest();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, function() {
</span><del>-        var domTree = WebInspector.frameResourceManager.mainFrame.domTree;
-        domTree.addEventListener(WebInspector.DOMTree.Event.RootDOMNodeInvalidated, onRootDOMNodeInvalidated, null);
-        domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasAdded, onContentFlowWasAdded, null);
-        domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasRemoved, onContentFlowWasRemoved, null);
</del><ins>+        domTree.addEventListener(WebInspector.DOMTree.Event.RootDOMNodeInvalidated, onRootDOMNodeInvalidated);
+        domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasAdded, onContentFlowWasAdded);
+        domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasRemoved, onContentFlowWasRemoved);
</ins><span class="cx">         domTree.requestContentFlowList();
</span><span class="cx">     });
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightFrameexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/dom/highlightFrame-expected.txt (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlightFrame-expected.txt        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/LayoutTests/inspector/dom/highlightFrame-expected.txt        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> Tests for the DOM.highlightFrame command.
</span><span class="cx"> 
</span><span class="cx">   
</span><ins>+PASS: Page should have subframes.
</ins><span class="cx"> 
</span><span class="cx"> == Running test suite: DOM.highlightFrame
</span><span class="cx"> -- Running test case: CheckEmptyHighlight
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightFramehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/dom/highlightFrame.html (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlightFrame.html        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/LayoutTests/inspector/dom/highlightFrame.html        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -5,11 +5,12 @@
</span><span class="cx"> &lt;script&gt;
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>-    InspectorTest.assert(WebInspector.frameResourceManager.mainFrame.childFrames.length === 2, &quot;Page should have subframes.&quot;);
-    const mainFrame = WebInspector.frameResourceManager.mainFrame;
-    const childFrame1 = WebInspector.frameResourceManager.mainFrame.childFrames[0];
-    const childFrame2 = WebInspector.frameResourceManager.mainFrame.childFrames[1];
</del><ins>+    let suite = InspectorTest.createAsyncSuite(&quot;DOM.highlightFrame&quot;);
</ins><span class="cx"> 
</span><ins>+    let mainFrame = WebInspector.frameResourceManager.mainFrame;
+    let childFrames = mainFrame.childFrameCollection.toArray();
+    InspectorTest.expectEqual(childFrames.length, 2, &quot;Page should have subframes.&quot;);
+
</ins><span class="cx">     function getHighlight(callback) {
</span><span class="cx">         InspectorTest.evaluateInPage(&quot;window.internals.inspectorHighlightObject()&quot;, (error, payload, wasThrown) =&gt; {
</span><span class="cx">             InspectorTest.assert(!error, &quot;Unexpected error dumping highlight: &quot; + error);
</span><span class="lines">@@ -25,12 +26,10 @@
</span><span class="cx">         });
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    let suite = InspectorTest.createAsyncSuite(&quot;DOM.highlightFrame&quot;);
-
</del><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;CheckEmptyHighlight&quot;,
</span><span class="cx">         description: &quot;Should not be a highlight yet.&quot;,
</span><del>-        test: (resolve, reject) =&gt; {
</del><ins>+        test(resolve, reject) {
</ins><span class="cx">             getHighlight((highlightObjectPayload) =&gt; {
</span><span class="cx">                 InspectorTest.expectThat(highlightObjectPayload.length === 0, &quot;Should not be a highlight yet.&quot;);
</span><span class="cx">                 resolve();
</span><span class="lines">@@ -41,7 +40,7 @@
</span><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;HighlightMainFrame&quot;,
</span><span class="cx">         description: &quot;Main frame does not have an owner element, so there will be no highlight.&quot;,
</span><del>-        test: (resolve, reject) =&gt; {
</del><ins>+        test(resolve, reject) {
</ins><span class="cx">             DOMAgent.highlightFrame(mainFrame.id, undefined, undefined, (error) =&gt; {
</span><span class="cx">                 getHighlight((highlightObjectPayload) =&gt; {
</span><span class="cx">                     InspectorTest.expectThat(highlightObjectPayload.length === 0, &quot;Should not be a highlight for the main frame.&quot;);
</span><span class="lines">@@ -54,8 +53,8 @@
</span><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;HighlightChildFrame1&quot;,
</span><span class="cx">         description: &quot;Should highlight child frame 1.&quot;,
</span><del>-        test: (resolve, reject) =&gt; {
-            DOMAgent.highlightFrame(childFrame1.id, undefined, undefined, (error) =&gt; {
</del><ins>+        test(resolve, reject) {
+            DOMAgent.highlightFrame(childFrames[0].id, undefined, undefined, (error) =&gt; {
</ins><span class="cx">                 InspectorTest.assert(!error, &quot;Should not have an error.&quot;);
</span><span class="cx">                 dumpHighlight(resolve);
</span><span class="cx">             });
</span><span class="lines">@@ -65,8 +64,8 @@
</span><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;HighlightChildFrame2&quot;,
</span><span class="cx">         description: &quot;Should highlight child frame 2.&quot;,
</span><del>-        test: (resolve, reject) =&gt; {
-            DOMAgent.highlightFrame(childFrame2.id, undefined, undefined, (error) =&gt; {
</del><ins>+        test(resolve, reject) {
+            DOMAgent.highlightFrame(childFrames[1].id, undefined, undefined, (error) =&gt; {
</ins><span class="cx">                 InspectorTest.assert(!error, &quot;Should not have an error.&quot;);
</span><span class="cx">                 dumpHighlight(resolve);
</span><span class="cx">             });
</span><span class="lines">@@ -78,7 +77,7 @@
</span><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;BadFrameId&quot;,
</span><span class="cx">         description: &quot;Bad frame id should cause an error.&quot;,
</span><del>-        test: (resolve, reject) =&gt; {
</del><ins>+        test(resolve, reject) {
</ins><span class="cx">             DOMAgent.highlightFrame(&quot;bad-frame-id&quot;, undefined, undefined, (error) =&gt; {
</span><span class="cx">                 InspectorTest.expectThat(error, &quot;Should produce an error.&quot;);
</span><span class="cx">                 InspectorTest.log(&quot;Error: &quot; + error);
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightNodeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/dom/highlightNode-expected.txt (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlightNode-expected.txt        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/LayoutTests/inspector/dom/highlightNode-expected.txt        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> Tests for the DOM.highlightNode command.
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+PASS: Page should have a subframe.
</ins><span class="cx"> 
</span><span class="cx"> == Running test suite: DOM.highlightNode
</span><span class="cx"> -- Running test case: CheckEmptyHighlight
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightNodehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/dom/highlightNode.html (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlightNode.html        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/LayoutTests/inspector/dom/highlightNode.html        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -5,9 +5,12 @@
</span><span class="cx"> &lt;script&gt;
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>-    InspectorTest.assert(WebInspector.frameResourceManager.mainFrame.childFrames.length === 1, &quot;Page should have a subframe.&quot;);
-    const mainFrame = WebInspector.frameResourceManager.mainFrame;
-    const childFrame = WebInspector.frameResourceManager.mainFrame.childFrames[0];
</del><ins>+    let suite = InspectorTest.createAsyncSuite(&quot;DOM.highlightNode&quot;);
+
+    let mainFrame = WebInspector.frameResourceManager.mainFrame;
+    let childFrames = mainFrame.childFrameCollection.toArray();
+    InspectorTest.expectEqual(childFrames.length, 1, &quot;Page should have a subframe.&quot;);
+
</ins><span class="cx">     const highlightConfig = {
</span><span class="cx">         showInfo: true,
</span><span class="cx">         contentColor: {r: 255, g: 255, b: 255},
</span><span class="lines">@@ -26,7 +29,7 @@
</span><span class="cx"> 
</span><span class="cx">     function dumpHighlight(callback) {
</span><span class="cx">         getHighlight((highlightObjectPayload) =&gt; {
</span><del>-            InspectorTest.expectThat(highlightObjectPayload.length === 1, &quot;Should be one highlighted node.&quot;);
</del><ins>+            InspectorTest.expectEqual(highlightObjectPayload.length, 1, &quot;Should be one highlighted node.&quot;);
</ins><span class="cx">             InspectorTest.log(&quot;Highlighted Element Data: &quot; + JSON.stringify(highlightObjectPayload[0].elementData));
</span><span class="cx">             callback();
</span><span class="cx">         });
</span><span class="lines">@@ -36,14 +39,12 @@
</span><span class="cx">     let mainFrameDocumentNodeId, mainFrameTargetNode;
</span><span class="cx">     let childFrameDocumentNodeId, childFrameTargetNode;
</span><span class="cx"> 
</span><del>-    let suite = InspectorTest.createAsyncSuite(&quot;DOM.highlightNode&quot;);
-
</del><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;CheckEmptyHighlight&quot;,
</span><span class="cx">         description: &quot;Should not be a highlight yet.&quot;,
</span><del>-        test: (resolve, reject) =&gt; {
</del><ins>+        test(resolve, reject) {
</ins><span class="cx">             getHighlight((highlightObjectPayload) =&gt; {
</span><del>-                InspectorTest.expectThat(highlightObjectPayload.length === 0, &quot;Should not be a highlight yet.&quot;);
</del><ins>+                InspectorTest.expectEqual(highlightObjectPayload.length, 0, &quot;Should not be a highlight yet.&quot;);
</ins><span class="cx">                 resolve();
</span><span class="cx">             });
</span><span class="cx">         }
</span><span class="lines">@@ -52,7 +53,7 @@
</span><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;MainFrameNodeViaNodeId&quot;,
</span><span class="cx">         description: &quot;Should highlight a node in the main frame using node id.&quot;,
</span><del>-        test: (resolve, reject) =&gt; {
</del><ins>+        test(resolve, reject) {
</ins><span class="cx">             WebInspector.domTreeManager.querySelector(mainFrameDocumentNodeId, &quot;#id-one&quot;, function(nodeId) {
</span><span class="cx">                 mainFrameTargetNode = WebInspector.domTreeManager.nodeForId(nodeId);
</span><span class="cx">                 DOMAgent.highlightNode(highlightConfig, mainFrameTargetNode.id, undefined, (error) =&gt; {
</span><span class="lines">@@ -66,7 +67,7 @@
</span><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;ChildFrameNodeViaNodeId&quot;,
</span><span class="cx">         description: &quot;Should highlight a node in the child frame using node id.&quot;,
</span><del>-        test: (resolve, reject) =&gt; {
</del><ins>+        test(resolve, reject) {
</ins><span class="cx">             WebInspector.domTreeManager.querySelector(childFrameDocumentNodeId, &quot;#id-one&quot;, function(nodeId) {
</span><span class="cx">                 childFrameTargetNode = WebInspector.domTreeManager.nodeForId(nodeId);
</span><span class="cx">                 DOMAgent.highlightNode(highlightConfig, childFrameTargetNode.id, undefined, (error) =&gt; {
</span><span class="lines">@@ -80,7 +81,7 @@
</span><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;MainFrameNodeViaObjectId&quot;,
</span><span class="cx">         description: &quot;Should highlight a node in the main frame using object id.&quot;,
</span><del>-        test: (resolve, reject) =&gt; {
</del><ins>+        test(resolve, reject) {
</ins><span class="cx">             WebInspector.RemoteObject.resolveNode(mainFrameTargetNode, &quot;test&quot;, (remoteObject) =&gt; {
</span><span class="cx">                 DOMAgent.highlightNode(highlightConfig, undefined, remoteObject.objectId, (error) =&gt; {
</span><span class="cx">                     InspectorTest.assert(!error, &quot;Should not have an error.&quot;);
</span><span class="lines">@@ -93,7 +94,7 @@
</span><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;ChildFrameNodeViaObjectId&quot;,
</span><span class="cx">         description: &quot;Should highlight a node in the child frame using object id.&quot;,
</span><del>-        test: (resolve, reject) =&gt; {
</del><ins>+        test(resolve, reject) {
</ins><span class="cx">             WebInspector.RemoteObject.resolveNode(childFrameTargetNode, &quot;test&quot;, (remoteObject) =&gt; {
</span><span class="cx">                 DOMAgent.highlightNode(highlightConfig, undefined, remoteObject.objectId, (error) =&gt; {
</span><span class="cx">                     InspectorTest.assert(!error, &quot;Should not have an error.&quot;);
</span><span class="lines">@@ -108,7 +109,7 @@
</span><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;MissingNodeAndObjectIdShouldError&quot;,
</span><span class="cx">         description: &quot;Missing identifiers should cause an error.&quot;,
</span><del>-        test: (resolve, reject) =&gt; {
</del><ins>+        test(resolve, reject) {
</ins><span class="cx">             DOMAgent.highlightNode(highlightConfig, undefined, undefined, (error) =&gt; {
</span><span class="cx">                 InspectorTest.expectThat(error, &quot;Should produce an error.&quot;);
</span><span class="cx">                 InspectorTest.log(&quot;Error: &quot; + error);
</span><span class="lines">@@ -120,7 +121,7 @@
</span><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;BadNodeId&quot;,
</span><span class="cx">         description: &quot;Bad node id should cause an error.&quot;,
</span><del>-        test: (resolve, reject) =&gt; {
</del><ins>+        test(resolve, reject) {
</ins><span class="cx">             DOMAgent.highlightNode(highlightConfig, 9999999, undefined, (error) =&gt; {
</span><span class="cx">                 InspectorTest.expectThat(error, &quot;Should produce an error.&quot;);
</span><span class="cx">                 InspectorTest.log(&quot;Error: &quot; + error);
</span><span class="lines">@@ -132,7 +133,7 @@
</span><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;BadObjectId&quot;,
</span><span class="cx">         description: &quot;Bad object id should cause an error.&quot;,
</span><del>-        test: (resolve, reject) =&gt; {
</del><ins>+        test(resolve, reject) {
</ins><span class="cx">             DOMAgent.highlightNode(highlightConfig, undefined, &quot;bad-object-id&quot;, (error) =&gt; {
</span><span class="cx">                 InspectorTest.expectThat(error, &quot;Should produce an error.&quot;);
</span><span class="cx">                 InspectorTest.log(&quot;Error: &quot; + error);
</span><span class="lines">@@ -143,7 +144,7 @@
</span><span class="cx"> 
</span><span class="cx">     WebInspector.domTreeManager.requestDocument((documentNode) =&gt; {
</span><span class="cx">         mainFrameDocumentNodeId = documentNode.id;
</span><del>-        RuntimeAgent.evaluate.invoke({expression: &quot;document&quot;, objectGroup: &quot;test&quot;, contextId: childFrame.pageExecutionContext.id}, (error, remoteObjectPayload) =&gt; {
</del><ins>+        RuntimeAgent.evaluate.invoke({expression: &quot;document&quot;, objectGroup: &quot;test&quot;, contextId: childFrames[0].pageExecutionContext.id}, (error, remoteObjectPayload) =&gt; {
</ins><span class="cx">             let remoteObject = WebInspector.RemoteObject.fromPayload(remoteObjectPayload)
</span><span class="cx">             remoteObject.pushNodeToFrontend((documentNodeId) =&gt; {
</span><span class="cx">                 childFrameDocumentNodeId = documentNodeId
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightSelectorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/dom/highlightSelector-expected.txt (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlightSelector-expected.txt        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/LayoutTests/inspector/dom/highlightSelector-expected.txt        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> Tests for the DOM.highlightSelector command.
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+PASS: Page should have a subframe.
</ins><span class="cx"> 
</span><span class="cx"> == Running test suite: DOM.highlightSelector
</span><span class="cx"> -- Running test case: MainFrameTagSelector
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightSelectorhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/dom/highlightSelector.html (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlightSelector.html        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/LayoutTests/inspector/dom/highlightSelector.html        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -5,9 +5,15 @@
</span><span class="cx"> &lt;script&gt;
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>-    InspectorTest.assert(WebInspector.frameResourceManager.mainFrame.childFrames.length === 1, &quot;Page should have a subframe.&quot;);
-    const mainFrameId = WebInspector.frameResourceManager.mainFrame.id;
-    const childFrameId = WebInspector.frameResourceManager.mainFrame.childFrames[0].id;
</del><ins>+    let suite = InspectorTest.createAsyncSuite(&quot;DOM.highlightSelector&quot;);
+
+    let mainFrame = WebInspector.frameResourceManager.mainFrame;
+    let childFrames = mainFrame.childFrameCollection.toArray();
+    InspectorTest.expectEqual(childFrames.length, 1, &quot;Page should have a subframe.&quot;);
+
+    let mainFrameId = mainFrame.id;
+    let childFrameId = childFrames[0].id;
+
</ins><span class="cx">     const highlightConfig = {
</span><span class="cx">         showInfo: true,
</span><span class="cx">         contentColor: {r: 255, g: 255, b: 255},
</span><span class="lines">@@ -102,13 +108,10 @@
</span><span class="cx">         });
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    let suite = InspectorTest.createAsyncSuite(&quot;DOM.highlightSelector&quot;);
-
-    for (let testcase of tests) {
-        let {name, frameId, selector, expectedElements, expectError} = testcase;
</del><ins>+    for (let {name, frameId, selector, expectedElements, expectError} of tests) {
</ins><span class="cx">         suite.addTestCase({
</span><span class="cx">             name,
</span><del>-            test: (resolve, reject) =&gt; {
</del><ins>+            test(resolve, reject) {
</ins><span class="cx">                 InspectorTest.log(&quot;- Frame: &quot; + displayNameForFrameId(frameId));
</span><span class="cx">                 InspectorTest.log(&quot;- Selector: &quot; + selector);
</span><span class="cx">                 DOMAgent.highlightSelector(highlightConfig, selector, frameId, (error) =&gt; {
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelframeextrascriptsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/frame-extra-scripts-expected.txt (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/frame-extra-scripts-expected.txt        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/LayoutTests/inspector/model/frame-extra-scripts-expected.txt        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -1,8 +1,8 @@
</span><span class="cx"> CONSOLE MESSAGE: line 1: dynamically added script element
</span><del>-WebInspector.Frame.extraScripts.
</del><ins>+WebInspector.Frame.extraScriptCollection.
</ins><span class="cx"> 
</span><span class="cx"> 
</span><del>-== Running test suite: WebInspector.Frame.extraScripts
</del><ins>+== Running test suite: WebInspector.Frame.extraScriptCollection
</ins><span class="cx"> -- Running test case: FrameHasNoExtraScriptsYet
</span><span class="cx"> PASS: Main frame should have no dynamic scripts.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelframeextrascriptshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/frame-extra-scripts.html (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/frame-extra-scripts.html        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/LayoutTests/inspector/model/frame-extra-scripts.html        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -11,14 +11,15 @@
</span><span class="cx"> 
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>-    let suite = InspectorTest.createAsyncSuite(&quot;WebInspector.Frame.extraScripts&quot;);
</del><ins>+    let suite = InspectorTest.createAsyncSuite(&quot;WebInspector.Frame.extraScriptCollection&quot;);
</ins><span class="cx"> 
</span><ins>+    let mainFrame = WebInspector.frameResourceManager.mainFrame;
+
</ins><span class="cx">     suite.addTestCase({
</span><span class="cx">         name: &quot;FrameHasNoExtraScriptsYet&quot;,
</span><span class="cx">         description: &quot;No extra scripts yet.&quot;,
</span><span class="cx">         test(resolve, reject) {
</span><del>-            let mainFrame = WebInspector.frameResourceManager.mainFrame;
-            InspectorTest.expectThat(mainFrame.extraScripts.length === 0, &quot;Main frame should have no dynamic scripts.&quot;);
</del><ins>+            InspectorTest.expectEqual(mainFrame.extraScriptCollection.items.size, 0, &quot;Main frame should have no dynamic scripts.&quot;);
</ins><span class="cx">             resolve();
</span><span class="cx">         }
</span><span class="cx">     });
</span><span class="lines">@@ -31,9 +32,7 @@
</span><span class="cx">             .then((event) =&gt; {
</span><span class="cx">                 InspectorTest.pass(&quot;ExtraScriptAdded event fired.&quot;);
</span><span class="cx">                 InspectorTest.expectThat(event.data.script.dynamicallyAddedScriptElement, &quot;Script should identify as dynamic.&quot;);
</span><del>-
-                let mainFrame = WebInspector.frameResourceManager.mainFrame;
-                InspectorTest.expectThat(mainFrame.extraScripts.length === 1, &quot;Main frame should have 1 dynamic script.&quot;);
</del><ins>+                InspectorTest.expectEqual(mainFrame.extraScriptCollection.items.size, 1, &quot;Main frame should have 1 dynamic script.&quot;);
</ins><span class="cx">             })
</span><span class="cx">             .then(resolve, reject);
</span><span class="cx"> 
</span><span class="lines">@@ -46,6 +45,6 @@
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body onload=&quot;runTest()&quot;&gt;
</span><del>-&lt;p&gt;WebInspector.Frame.extraScripts.&lt;/p&gt;
</del><ins>+&lt;p&gt;WebInspector.Frame.extraScriptCollection.&lt;/p&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/Source/WebInspectorUI/ChangeLog        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -1,5 +1,27 @@
</span><span class="cx"> 2016-11-01  Devin Rousso  &lt;dcrousso+webkit@gmail.com&gt;
</span><span class="cx"> 
</span><ins>+        Web Inspector: Replace sublists inside DOM-related model objects with WI.Collection
+        https://bugs.webkit.org/show_bug.cgi?id=164098
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Models/DOMTree.js:
+        * UserInterface/Models/Frame.js:
+        Add support for WebInspector.Collection.
+
+        * UserInterface/Models/Script.js:
+        (WebInspector.Script):
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WebInspector.DebuggerSidebarPanel.prototype._addResourcesRecursivelyForFrame):
+        * UserInterface/Views/FrameTreeElement.js:
+        (WebInspector.FrameTreeElement):
+        (WebInspector.FrameTreeElement.prototype.onpopulate):
+        * UserInterface/Views/OpenResourceDialog.js:
+        (WebInspector.OpenResourceDialog.prototype._addResourcesForFrame):
+        Use new functions defined by changing to WebInspector.Collection.
+
+2016-11-01  Devin Rousso  &lt;dcrousso+webkit@gmail.com&gt;
+
</ins><span class="cx">         Web Inspector: Fix double remove of ResourceCollection if type changes
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=164268
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsCollectionjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/Collection.js (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/Collection.js        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Collection.js        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -112,6 +112,7 @@
</span><span class="cx"> 
</span><span class="cx">  WebInspector.Collection.TypeVerifier = {
</span><span class="cx">     Any: (object) =&gt; true,
</span><ins>+    ContentFlow: (object) =&gt; object instanceof WebInspector.ContentFlow,
</ins><span class="cx">     Frame: (object) =&gt; object instanceof WebInspector.Frame,
</span><span class="cx">     Resource: (object) =&gt; object instanceof WebInspector.Resource,
</span><span class="cx">     Script: (object) =&gt; object instanceof WebInspector.Script,
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsDOMTreejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DOMTree.js (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMTree.js        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMTree.js        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> 
</span><span class="cx">         this._rootDOMNode = null;
</span><span class="cx">         this._requestIdentifier = 0;
</span><del>-        this._flowMap = {};
</del><ins>+        this._contentFlowCollection = new WebInspector.Collection(WebInspector.Collection.TypeVerifier.ContentFlow);
</ins><span class="cx"> 
</span><span class="cx">         this._frame.addEventListener(WebInspector.Frame.Event.PageExecutionContextChanged, this._framePageExecutionContextChanged, this);
</span><span class="cx"> 
</span><span class="lines">@@ -52,21 +52,9 @@
</span><span class="cx"> 
</span><span class="cx">     // Public
</span><span class="cx"> 
</span><del>-    get frame()
-    {
-        return this._frame;
-    }
</del><ins>+    get frame() { return this._frame; }
+    get contentFlowCollection() { return this._contentFlowCollection; }
</ins><span class="cx"> 
</span><del>-    get flowMap()
-    {
-        return this._flowMap;
-    }
-
-    get flowsCount()
-    {
-        return Object.keys(this._flowMap).length;
-    }
-
</del><span class="cx">     disconnect()
</span><span class="cx">     {
</span><span class="cx">         WebInspector.domTreeManager.removeEventListener(null, null, this);
</span><span class="lines">@@ -263,51 +251,41 @@
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         // Assume that all the flows have been removed.
</span><del>-        var deletedFlows = {};
-        for (var flowId in this._flowMap)
-            deletedFlows[flowId] = this._flowMap[flowId];
-
-        var newFlows = [];
-
-        var flows = event.data.flows;
-        for (var i = 0; i &lt; flows.length; ++i) {
-            var flow = flows[i];
</del><ins>+        let deletedFlows = new Set(this._contentFlowCollection.items);
+        let newFlows = new Set;
+        for (let flow of event.data.flows) {
</ins><span class="cx">             // All the flows received from WebKit are part of the same document.
</span><span class="cx">             console.assert(this._isContentFlowInCurrentDocument(flow));
</span><span class="cx"> 
</span><del>-            var flowId = flow.id;
-            if (this._flowMap.hasOwnProperty(flowId)) {
</del><ins>+            if (this._contentFlowCollection.items.has(flow)) {
</ins><span class="cx">                 // Remove the flow name from the deleted list.
</span><del>-                console.assert(deletedFlows.hasOwnProperty(flowId));
-                delete deletedFlows[flowId];
</del><ins>+                console.assert(deletedFlows.has(flow));
+                deletedFlows.delete(flow);
</ins><span class="cx">             } else {
</span><del>-                this._flowMap[flowId] = flow;
-                newFlows.push(flow);
</del><ins>+                this._contentFlowCollection.add(flow);
+                newFlows.add(flow);
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        for (var flowId in deletedFlows) {
-            delete this._flowMap[flowId];
-        }
</del><ins>+        for (let flow of deletedFlows)
+            this._contentFlowCollection.remove(flow);
</ins><span class="cx"> 
</span><span class="cx">         // Send update events to listeners.
</span><span class="cx"> 
</span><del>-        for (var flowId in deletedFlows)
-            this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasRemoved, {flow: deletedFlows[flowId]});
</del><ins>+        for (let flow of deletedFlows)
+            this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasRemoved, {flow});
</ins><span class="cx"> 
</span><del>-        for (var i = 0; i &lt; newFlows.length; ++i)
-            this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasAdded, {flow: newFlows[i]});
</del><ins>+        for (let flow of newFlows)
+            this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasAdded, {flow});
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     _contentFlowWasAdded(event)
</span><span class="cx">     {
</span><del>-        var flow = event.data.flow;
</del><ins>+        let flow = event.data.flow;
</ins><span class="cx">         if (!this._isContentFlowInCurrentDocument(flow))
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        var flowId = flow.id;
-        console.assert(!this._flowMap.hasOwnProperty(flowId));
-        this._flowMap[flowId] = flow;
</del><ins>+        this._contentFlowCollection.add(flow);
</ins><span class="cx"> 
</span><span class="cx">         this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasAdded, {flow});
</span><span class="cx">     }
</span><span class="lines">@@ -314,13 +292,11 @@
</span><span class="cx"> 
</span><span class="cx">     _contentFlowWasRemoved(event)
</span><span class="cx">     {
</span><del>-        var flow = event.data.flow;
</del><ins>+        let flow = event.data.flow;
</ins><span class="cx">         if (!this._isContentFlowInCurrentDocument(flow))
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        var flowId = flow.id;
-        console.assert(this._flowMap.hasOwnProperty(flowId));
-        delete this._flowMap[flowId];
</del><ins>+        this._contentFlowCollection.remove(flow);
</ins><span class="cx"> 
</span><span class="cx">         this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasRemoved, {flow});
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsFramejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/Frame.js (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/Frame.js        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Frame.js        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -38,9 +38,9 @@
</span><span class="cx"> 
</span><span class="cx">         this._resourceCollection = new WebInspector.ResourceCollection;
</span><span class="cx">         this._provisionalResourceCollection = new WebInspector.ResourceCollection;
</span><del>-        this._extraScripts = [];
</del><ins>+        this._extraScriptCollection = new WebInspector.Collection(WebInspector.Collection.TypeVerifier.Script);
</ins><span class="cx"> 
</span><del>-        this._childFrames = [];
</del><ins>+        this._childFrameCollection = new WebInspector.Collection(WebInspector.Collection.TypeVerifier.Frame);
</ins><span class="cx">         this._childFrameIdentifierMap = new Map;
</span><span class="cx"> 
</span><span class="cx">         this._parentFrame = null;
</span><span class="lines">@@ -57,6 +57,8 @@
</span><span class="cx">     // Public
</span><span class="cx"> 
</span><span class="cx">     get resourceCollection() { return this._resourceCollection; }
</span><ins>+    get extraScriptCollection() { return this._extraScriptCollection; }
+    get childFrameCollection() { return this._childFrameCollection; }
</ins><span class="cx"> 
</span><span class="cx">     initialize(name, securityOrigin, loaderIdentifier, mainResource)
</span><span class="cx">     {
</span><span class="lines">@@ -130,7 +132,7 @@
</span><span class="cx"> 
</span><span class="cx">         this._resourceCollection = this._provisionalResourceCollection;
</span><span class="cx">         this._provisionalResourceCollection = new WebInspector.ResourceCollection;
</span><del>-        this._extraScripts = [];
</del><ins>+        this._extraScriptCollection.clear();
</ins><span class="cx"> 
</span><span class="cx">         this.clearExecutionContexts(true);
</span><span class="cx">         this.clearProvisionalLoad(true);
</span><span class="lines">@@ -237,11 +239,6 @@
</span><span class="cx">         return this._parentFrame;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    get childFrames()
-    {
-        return this._childFrames;
-    }
-
</del><span class="cx">     get domContentReadyEventTimestamp()
</span><span class="cx">     {
</span><span class="cx">         return this._domContentReadyEventTimestamp;
</span><span class="lines">@@ -306,7 +303,7 @@
</span><span class="cx">         if (frame._parentFrame)
</span><span class="cx">             frame._parentFrame.removeChildFrame(frame);
</span><span class="cx"> 
</span><del>-        this._childFrames.push(frame);
</del><ins>+        this._childFrameCollection.add(frame);
</ins><span class="cx">         this._childFrameIdentifierMap.set(frame._id, frame);
</span><span class="cx"> 
</span><span class="cx">         frame._parentFrame = this;
</span><span class="lines">@@ -318,15 +315,14 @@
</span><span class="cx">     {
</span><span class="cx">         console.assert(frameOrFrameId);
</span><span class="cx"> 
</span><del>-        if (frameOrFrameId instanceof WebInspector.Frame)
-            var childFrameId = frameOrFrameId._id;
-        else
-            var childFrameId = frameOrFrameId;
</del><ins>+        let childFrameId = frameOrFrameId;
+        if (childFrameId instanceof WebInspector.Frame)
+            childFrameId = frameOrFrameId._id;
</ins><span class="cx"> 
</span><span class="cx">         // Fetch the frame by id even if we were passed a WebInspector.Frame.
</span><del>-        // We do this incase the WebInspector.Frame is a new object that isn't in _childFrames,
-        // but the id is a valid child frame.
-        var childFrame = this.childFrameForIdentifier(childFrameId);
</del><ins>+        // We do this incase the WebInspector.Frame is a new object that isn't
+        // in _childFrameCollection, but the id is a valid child frame.
+        let childFrame = this.childFrameForIdentifier(childFrameId);
</ins><span class="cx">         console.assert(childFrame instanceof WebInspector.Frame);
</span><span class="cx">         if (!(childFrame instanceof WebInspector.Frame))
</span><span class="cx">             return;
</span><span class="lines">@@ -333,7 +329,7 @@
</span><span class="cx"> 
</span><span class="cx">         console.assert(childFrame.parentFrame === this);
</span><span class="cx"> 
</span><del>-        this._childFrames.remove(childFrame);
</del><ins>+        this._childFrameCollection.remove(childFrame);
</ins><span class="cx">         this._childFrameIdentifierMap.delete(childFrame._id);
</span><span class="cx"> 
</span><span class="cx">         childFrame._detachFromParentFrame();
</span><span class="lines">@@ -345,10 +341,10 @@
</span><span class="cx">     {
</span><span class="cx">         this._detachFromParentFrame();
</span><span class="cx"> 
</span><del>-        for (let childFrame of this._childFrames)
</del><ins>+        for (let childFrame of this._childFrameCollection.items)
</ins><span class="cx">             childFrame.removeAllChildFrames();
</span><span class="cx"> 
</span><del>-        this._childFrames = [];
</del><ins>+        this._childFrameCollection.clear();
</ins><span class="cx">         this._childFrameIdentifierMap.clear();
</span><span class="cx"> 
</span><span class="cx">         this.dispatchEventToListeners(WebInspector.Frame.Event.AllChildFramesRemoved);
</span><span class="lines">@@ -361,8 +357,8 @@
</span><span class="cx">             return resource;
</span><span class="cx"> 
</span><span class="cx">         // Check the main resources of the child frames for the requested URL.
</span><del>-        for (var i = 0; i &lt; this._childFrames.length; ++i) {
-            resource = this._childFrames[i].mainResource;
</del><ins>+        for (let childFrame of this._childFrameCollection.items) {
+            resource = childFrame.mainResource;
</ins><span class="cx">             if (resource.url === url)
</span><span class="cx">                 return resource;
</span><span class="cx">         }
</span><span class="lines">@@ -371,8 +367,8 @@
</span><span class="cx">             return null;
</span><span class="cx"> 
</span><span class="cx">         // Recursively search resources of child frames.
</span><del>-        for (var i = 0; i &lt; this._childFrames.length; ++i) {
-            resource = this._childFrames[i].resourceForURL(url, true);
</del><ins>+        for (let childFrame of this._childFrameCollection.items) {
+            resource = childFrame.resourceForURL(url, true);
</ins><span class="cx">             if (resource)
</span><span class="cx">                 return resource;
</span><span class="cx">         }
</span><span class="lines">@@ -408,13 +404,11 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    removeResource(resourceOrURL)
</del><ins>+    removeResource(resource)
</ins><span class="cx">     {
</span><span class="cx">         // This does not remove provisional resources.
</span><span class="cx"> 
</span><del>-        var resource = this._resourceCollection.remove(resourceOrURL);
-        if (!resource)
-            return;
</del><ins>+        this._resourceCollection.remove(resource);
</ins><span class="cx"> 
</span><span class="cx">         this._disassociateWithResource(resource);
</span><span class="cx"> 
</span><span class="lines">@@ -437,14 +431,9 @@
</span><span class="cx">         this.dispatchEventToListeners(WebInspector.Frame.Event.AllResourcesRemoved);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    get extraScripts()
-    {
-        return this._extraScripts;
-    }
-
</del><span class="cx">     addExtraScript(script)
</span><span class="cx">     {
</span><del>-        this._extraScripts.push(script);
</del><ins>+        this._extraScriptCollection.add(script);
</ins><span class="cx"> 
</span><span class="cx">         this.dispatchEventToListeners(WebInspector.Frame.Event.ExtraScriptAdded, {script});
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsScriptjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/Script.js (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/Script.js        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Script.js        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">             this._resource = null;
</span><span class="cx">             this._dynamicallyAddedScriptElement = true;
</span><span class="cx">             documentResource.parentFrame.addExtraScript(this);
</span><del>-            this._dynamicallyAddedScriptElementNumber = documentResource.parentFrame.extraScripts.length;
</del><ins>+            this._dynamicallyAddedScriptElementNumber = documentResource.parentFrame.extraScriptCollection.items.size;
</ins><span class="cx">         } else if (this._resource)
</span><span class="cx">             this._resource.associateWithScript(this);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -422,7 +422,7 @@
</span><span class="cx">         for (let resource of frame.resourceCollection.items)
</span><span class="cx">             this._addResource(resource);
</span><span class="cx"> 
</span><del>-        for (var childFrame of frame.childFrames)
</del><ins>+        for (let childFrame of frame.childFrameCollection.items)
</ins><span class="cx">             this._addResourcesRecursivelyForFrame(childFrame);
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFrameTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -51,19 +51,19 @@
</span><span class="cx"> 
</span><span class="cx">         this.registerFolderizeSettings(&quot;frames&quot;, WebInspector.UIString(&quot;Frames&quot;),
</span><span class="cx">             (representedObject) =&gt; representedObject instanceof WebInspector.Frame,
</span><del>-            () =&gt; this.frame.childFrames.length,
</del><ins>+            () =&gt; this.frame.childFrameCollection.items.size,
</ins><span class="cx">             WebInspector.FrameTreeElement
</span><span class="cx">         );
</span><span class="cx"> 
</span><span class="cx">         this.registerFolderizeSettings(&quot;flows&quot;, WebInspector.UIString(&quot;Flows&quot;),
</span><span class="cx">             (representedObject) =&gt; representedObject instanceof WebInspector.ContentFlow,
</span><del>-            () =&gt; this.frame.domTree.flowsCount,
</del><ins>+            () =&gt; this.frame.domTree.contentFlowCollection.items.size,
</ins><span class="cx">             WebInspector.ContentFlowTreeElement
</span><span class="cx">         );
</span><span class="cx"> 
</span><span class="cx">         this.registerFolderizeSettings(&quot;extra-scripts&quot;, WebInspector.UIString(&quot;Extra Scripts&quot;),
</span><span class="cx">             (representedObject) =&gt; representedObject instanceof WebInspector.Script &amp;&amp; representedObject.dynamicallyAddedScriptElement,
</span><del>-            () =&gt; this.frame.extraScripts.length,
</del><ins>+            () =&gt; this.frame.extraScriptCollection.items.size,
</ins><span class="cx">             WebInspector.ScriptTreeElement
</span><span class="cx">         );
</span><span class="cx"> 
</span><span class="lines">@@ -178,8 +178,8 @@
</span><span class="cx">         this.updateParentStatus();
</span><span class="cx">         this.prepareToPopulate();
</span><span class="cx"> 
</span><del>-        for (var i = 0; i &lt; this._frame.childFrames.length; ++i)
-            this.addChildForRepresentedObject(this._frame.childFrames[i]);
</del><ins>+        for (let frame of this._frame.childFrameCollection.items)
+            this.addChildForRepresentedObject(frame);
</ins><span class="cx"> 
</span><span class="cx">         for (let resource of this._frame.resourceCollection.items)
</span><span class="cx">             this.addChildForRepresentedObject(resource);
</span><span class="lines">@@ -191,11 +191,10 @@
</span><span class="cx">                 this.addChildForRepresentedObject(sourceMap.resources[j]);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        var flowMap = this._frame.domTree.flowMap;
-        for (var flowKey in flowMap)
-            this.addChildForRepresentedObject(flowMap[flowKey]);
</del><ins>+        for (let contentFlow of this._frame.domTree.contentFlowCollection.items)
+            this.addChildForRepresentedObject(contentFlow);
</ins><span class="cx"> 
</span><del>-        for (let extraScript of this._frame.extraScripts) {
</del><ins>+        for (let extraScript of this._frame.extraScriptCollection.items) {
</ins><span class="cx">             if (extraScript.sourceURL || extraScript.sourceMappingURL)
</span><span class="cx">                 this.addChildForRepresentedObject(extraScript);
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsOpenResourceDialogjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js (208245 => 208246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js        2016-11-01 21:46:43 UTC (rev 208245)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js        2016-11-01 21:48:31 UTC (rev 208246)
</span><span class="lines">@@ -272,7 +272,7 @@
</span><span class="cx">             for (let resource of resources)
</span><span class="cx">                 this._addResource(resource, suppressFilterUpdate);
</span><span class="cx"> 
</span><del>-            frames = frames.concat(currentFrame.childFrames);
</del><ins>+            frames = frames.concat(currentFrame.childFrameCollection.toArray());
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         this._updateFilter();
</span></span></pre>
</div>
</div>

</body>
</html>