<!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 <dcrousso+webkit@gmail.com> 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 <dcrousso+webkit@gmail.com>
+
+ 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 <graouts@apple.com>
</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("CommandLineAPI.$0.cross-frame");
</span><span class="cx">
</span><ins>+ let mainFrame = WebInspector.frameResourceManager.mainFrame;
+ let childFrames = mainFrame.childFrameCollection.toArray();
+ InspectorTest.expectEqual(childFrames.length, 1, "Page should have a subframe.");
+
</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: "AttemptCrossFrame$0AccessFromMainFrame",
</span><span class="cx"> description: "Should not be able to access $0 node in different domain subframe from the main frame.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> InspectorTest.log("Setting $0 to node within subframe.");
</span><span class="cx"> ConsoleAgent.addInspectedNode(nodeInSubFrameId);
</span><span class="cx"> RuntimeAgent.evaluate.invoke({expression: "$0", includeCommandLineAPI: true}, (error, remoteObjectPayload, wasThrown) => {
</span><span class="lines">@@ -29,7 +33,7 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "AttemptSameFrame$0AccessFromMainFrame",
</span><span class="cx"> description: "Should be able to access $0 node in the same frame.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> InspectorTest.log("Setting $0 to node within the main frame.");
</span><span class="cx"> ConsoleAgent.addInspectedNode(nodeInMainFrameId);
</span><span class="cx"> RuntimeAgent.evaluate.invoke({expression: "$0", includeCommandLineAPI: true}, (error, remoteObjectPayload, wasThrown) => {
</span><span class="lines">@@ -45,11 +49,10 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "AttemptCrossFrame$0AccessFromSubFrame",
</span><span class="cx"> description: "Should not be able to access $0 node in different domain main frame from the subframe.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> InspectorTest.log("Setting $0 to node within the main frame.");
</span><span class="cx"> ConsoleAgent.addInspectedNode(nodeInMainFrameId);
</span><del>- const childFrame = WebInspector.frameResourceManager.mainFrame.childFrames[0];
- RuntimeAgent.evaluate.invoke({expression: "$0", includeCommandLineAPI: true, contextId: childFrame.pageExecutionContext.id}, (error, remoteObjectPayload, wasThrown) => {
</del><ins>+ RuntimeAgent.evaluate.invoke({expression: "$0", includeCommandLineAPI: true, contextId: childFrames[0].pageExecutionContext.id}, (error, remoteObjectPayload, wasThrown) => {
</ins><span class="cx"> InspectorTest.assert(!error, "Should not be a protocol error.");
</span><span class="cx"> InspectorTest.assert(!wasThrown, "Should not be an exception.");
</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: "AttemptSameFrame$0AccessFromSubFrame",
</span><span class="cx"> description: "Should be able to access $0 node in the same frame.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> InspectorTest.log("Setting $0 to node within the subframe.");
</span><span class="cx"> ConsoleAgent.addInspectedNode(nodeInSubFrameId);
</span><del>- const childFrame = WebInspector.frameResourceManager.mainFrame.childFrames[0];
- RuntimeAgent.evaluate.invoke({expression: "$0", includeCommandLineAPI: true, contextId: childFrame.pageExecutionContext.id}, (error, remoteObjectPayload, wasThrown) => {
</del><ins>+ RuntimeAgent.evaluate.invoke({expression: "$0", includeCommandLineAPI: true, contextId: childFrames[0].pageExecutionContext.id}, (error, remoteObjectPayload, wasThrown) => {
</ins><span class="cx"> InspectorTest.assert(!error, "Should not be a protocol error.");
</span><span class="cx"> InspectorTest.assert(!wasThrown, "Should not be an exception.");
</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("DOMTree instance count: " + 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, "There should be four DOMTrees listening to DOMTreeManager events after touching each Frame.");
</span><span class="cx"> InspectorTest.log("DOMTree instance count: " + 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, "Page should have a subframe.");
</ins><span class="cx">
</span><span class="cx"> let suite = InspectorTest.createAsyncSuite("CSSManager.preferredInspectorStyleSheetForFrame");
</span><span class="cx">
</span><span class="lines">@@ -64,10 +65,10 @@
</span><span class="cx"> .then((event) => {
</span><span class="cx"> InspectorTest.expectThat(event.data.styleSheet.origin === WebInspector.CSSStyleSheet.Type.Inspector, "Added StyleSheet origin should be 'inspector'.");
</span><span class="cx"> InspectorTest.expectThat(event.data.styleSheet.isInspectorStyleSheet(), "StyleSheet.isInspectorStyleSheet() should be true.");
</span><del>- InspectorTest.expectThat(event.data.styleSheet.parentFrame === childFrame, "Added StyleSheet frame should be a child frame.");
</del><ins>+ InspectorTest.expectThat(event.data.styleSheet.parentFrame === childFrames[0], "Added StyleSheet frame should be a child frame.");
</ins><span class="cx"> });
</span><span class="cx">
</span><del>- WebInspector.cssStyleManager.preferredInspectorStyleSheetForFrame(childFrame, (styleSheet) => {
</del><ins>+ WebInspector.cssStyleManager.preferredInspectorStyleSheetForFrame(childFrames[0], (styleSheet) => {
</ins><span class="cx"> InspectorTest.expectThat(WebInspector.cssStyleManager.styleSheets.length === 2, "Should be two stylesheets.");
</span><span class="cx"> InspectorTest.expectThat(styleSheet.origin === WebInspector.CSSStyleSheet.Type.Inspector, "StyleSheet origin should be 'inspector'.");
</span><span class="cx"> InspectorTest.expectThat(styleSheet.isInspectorStyleSheet(), "StyleSheet.isInspectorStyleSheet() should be true.");
</span><span class="lines">@@ -83,7 +84,7 @@
</span><span class="cx"> let listener = WebInspector.cssStyleManager.singleFireEventListener(WebInspector.CSSStyleManager.Event.StyleSheetAdded, (event) => {
</span><span class="cx"> InspectorTest.assert(false, "Should not create a new StyleSheet, should reuse the existing one");
</span><span class="cx"> });
</span><del>- WebInspector.cssStyleManager.preferredInspectorStyleSheetForFrame(childFrame, (styleSheet) => {
</del><ins>+ WebInspector.cssStyleManager.preferredInspectorStyleSheetForFrame(childFrames[0], (styleSheet) => {
</ins><span class="cx"> InspectorTest.expectThat(WebInspector.cssStyleManager.styleSheets.length === 2, "Should be two stylesheets.");
</span><span class="cx"> InspectorTest.expectThat(styleSheet.origin === WebInspector.CSSStyleSheet.Type.Inspector, "StyleSheet origin should be 'inspector'.");
</span><span class="cx"> InspectorTest.expectThat(styleSheet.isInspectorStyleSheet(), "StyleSheet.isInspectorStyleSheet() should be true.");
</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 === "flow1", "ContentFlow was added");
- InspectorTest.expectThat(WebInspector.frameResourceManager.mainFrame.domTree.flowsCount === 1, "Flow count is 1");
</del><ins>+ InspectorTest.expectEqual(event.data.flow.name, "flow1", "ContentFlow was added");
+ InspectorTest.expectEqual(domTree.contentFlowCollection.items.size, 1, "Flow count is 1");
</ins><span class="cx">
</span><span class="cx"> InspectorTest.evaluateInPage("removeFlow()");
</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 === "flow1", "ContentFlow was removed");
- InspectorTest.expectThat(WebInspector.frameResourceManager.mainFrame.domTree.flowsCount === 0, "Flow count is 0");
</del><ins>+ InspectorTest.expectEqual(event.data.flow.name, "flow1", "ContentFlow was removed");
+ InspectorTest.expectEqual(domTree.contentFlowCollection.items.size, 0, "Flow count is 0");
</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"> <script>
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>- InspectorTest.assert(WebInspector.frameResourceManager.mainFrame.childFrames.length === 2, "Page should have subframes.");
- 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("DOM.highlightFrame");
</ins><span class="cx">
</span><ins>+ let mainFrame = WebInspector.frameResourceManager.mainFrame;
+ let childFrames = mainFrame.childFrameCollection.toArray();
+ InspectorTest.expectEqual(childFrames.length, 2, "Page should have subframes.");
+
</ins><span class="cx"> function getHighlight(callback) {
</span><span class="cx"> InspectorTest.evaluateInPage("window.internals.inspectorHighlightObject()", (error, payload, wasThrown) => {
</span><span class="cx"> InspectorTest.assert(!error, "Unexpected error dumping highlight: " + 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("DOM.highlightFrame");
-
</del><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "CheckEmptyHighlight",
</span><span class="cx"> description: "Should not be a highlight yet.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> getHighlight((highlightObjectPayload) => {
</span><span class="cx"> InspectorTest.expectThat(highlightObjectPayload.length === 0, "Should not be a highlight yet.");
</span><span class="cx"> resolve();
</span><span class="lines">@@ -41,7 +40,7 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "HighlightMainFrame",
</span><span class="cx"> description: "Main frame does not have an owner element, so there will be no highlight.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> DOMAgent.highlightFrame(mainFrame.id, undefined, undefined, (error) => {
</span><span class="cx"> getHighlight((highlightObjectPayload) => {
</span><span class="cx"> InspectorTest.expectThat(highlightObjectPayload.length === 0, "Should not be a highlight for the main frame.");
</span><span class="lines">@@ -54,8 +53,8 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "HighlightChildFrame1",
</span><span class="cx"> description: "Should highlight child frame 1.",
</span><del>- test: (resolve, reject) => {
- DOMAgent.highlightFrame(childFrame1.id, undefined, undefined, (error) => {
</del><ins>+ test(resolve, reject) {
+ DOMAgent.highlightFrame(childFrames[0].id, undefined, undefined, (error) => {
</ins><span class="cx"> InspectorTest.assert(!error, "Should not have an error.");
</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: "HighlightChildFrame2",
</span><span class="cx"> description: "Should highlight child frame 2.",
</span><del>- test: (resolve, reject) => {
- DOMAgent.highlightFrame(childFrame2.id, undefined, undefined, (error) => {
</del><ins>+ test(resolve, reject) {
+ DOMAgent.highlightFrame(childFrames[1].id, undefined, undefined, (error) => {
</ins><span class="cx"> InspectorTest.assert(!error, "Should not have an error.");
</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: "BadFrameId",
</span><span class="cx"> description: "Bad frame id should cause an error.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> DOMAgent.highlightFrame("bad-frame-id", undefined, undefined, (error) => {
</span><span class="cx"> InspectorTest.expectThat(error, "Should produce an error.");
</span><span class="cx"> InspectorTest.log("Error: " + 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"> <script>
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>- InspectorTest.assert(WebInspector.frameResourceManager.mainFrame.childFrames.length === 1, "Page should have a subframe.");
- const mainFrame = WebInspector.frameResourceManager.mainFrame;
- const childFrame = WebInspector.frameResourceManager.mainFrame.childFrames[0];
</del><ins>+ let suite = InspectorTest.createAsyncSuite("DOM.highlightNode");
+
+ let mainFrame = WebInspector.frameResourceManager.mainFrame;
+ let childFrames = mainFrame.childFrameCollection.toArray();
+ InspectorTest.expectEqual(childFrames.length, 1, "Page should have a subframe.");
+
</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) => {
</span><del>- InspectorTest.expectThat(highlightObjectPayload.length === 1, "Should be one highlighted node.");
</del><ins>+ InspectorTest.expectEqual(highlightObjectPayload.length, 1, "Should be one highlighted node.");
</ins><span class="cx"> InspectorTest.log("Highlighted Element Data: " + 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("DOM.highlightNode");
-
</del><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "CheckEmptyHighlight",
</span><span class="cx"> description: "Should not be a highlight yet.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> getHighlight((highlightObjectPayload) => {
</span><del>- InspectorTest.expectThat(highlightObjectPayload.length === 0, "Should not be a highlight yet.");
</del><ins>+ InspectorTest.expectEqual(highlightObjectPayload.length, 0, "Should not be a highlight yet.");
</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: "MainFrameNodeViaNodeId",
</span><span class="cx"> description: "Should highlight a node in the main frame using node id.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> WebInspector.domTreeManager.querySelector(mainFrameDocumentNodeId, "#id-one", function(nodeId) {
</span><span class="cx"> mainFrameTargetNode = WebInspector.domTreeManager.nodeForId(nodeId);
</span><span class="cx"> DOMAgent.highlightNode(highlightConfig, mainFrameTargetNode.id, undefined, (error) => {
</span><span class="lines">@@ -66,7 +67,7 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "ChildFrameNodeViaNodeId",
</span><span class="cx"> description: "Should highlight a node in the child frame using node id.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> WebInspector.domTreeManager.querySelector(childFrameDocumentNodeId, "#id-one", function(nodeId) {
</span><span class="cx"> childFrameTargetNode = WebInspector.domTreeManager.nodeForId(nodeId);
</span><span class="cx"> DOMAgent.highlightNode(highlightConfig, childFrameTargetNode.id, undefined, (error) => {
</span><span class="lines">@@ -80,7 +81,7 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "MainFrameNodeViaObjectId",
</span><span class="cx"> description: "Should highlight a node in the main frame using object id.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> WebInspector.RemoteObject.resolveNode(mainFrameTargetNode, "test", (remoteObject) => {
</span><span class="cx"> DOMAgent.highlightNode(highlightConfig, undefined, remoteObject.objectId, (error) => {
</span><span class="cx"> InspectorTest.assert(!error, "Should not have an error.");
</span><span class="lines">@@ -93,7 +94,7 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "ChildFrameNodeViaObjectId",
</span><span class="cx"> description: "Should highlight a node in the child frame using object id.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> WebInspector.RemoteObject.resolveNode(childFrameTargetNode, "test", (remoteObject) => {
</span><span class="cx"> DOMAgent.highlightNode(highlightConfig, undefined, remoteObject.objectId, (error) => {
</span><span class="cx"> InspectorTest.assert(!error, "Should not have an error.");
</span><span class="lines">@@ -108,7 +109,7 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "MissingNodeAndObjectIdShouldError",
</span><span class="cx"> description: "Missing identifiers should cause an error.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> DOMAgent.highlightNode(highlightConfig, undefined, undefined, (error) => {
</span><span class="cx"> InspectorTest.expectThat(error, "Should produce an error.");
</span><span class="cx"> InspectorTest.log("Error: " + error);
</span><span class="lines">@@ -120,7 +121,7 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "BadNodeId",
</span><span class="cx"> description: "Bad node id should cause an error.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> DOMAgent.highlightNode(highlightConfig, 9999999, undefined, (error) => {
</span><span class="cx"> InspectorTest.expectThat(error, "Should produce an error.");
</span><span class="cx"> InspectorTest.log("Error: " + error);
</span><span class="lines">@@ -132,7 +133,7 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "BadObjectId",
</span><span class="cx"> description: "Bad object id should cause an error.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> DOMAgent.highlightNode(highlightConfig, undefined, "bad-object-id", (error) => {
</span><span class="cx"> InspectorTest.expectThat(error, "Should produce an error.");
</span><span class="cx"> InspectorTest.log("Error: " + error);
</span><span class="lines">@@ -143,7 +144,7 @@
</span><span class="cx">
</span><span class="cx"> WebInspector.domTreeManager.requestDocument((documentNode) => {
</span><span class="cx"> mainFrameDocumentNodeId = documentNode.id;
</span><del>- RuntimeAgent.evaluate.invoke({expression: "document", objectGroup: "test", contextId: childFrame.pageExecutionContext.id}, (error, remoteObjectPayload) => {
</del><ins>+ RuntimeAgent.evaluate.invoke({expression: "document", objectGroup: "test", contextId: childFrames[0].pageExecutionContext.id}, (error, remoteObjectPayload) => {
</ins><span class="cx"> let remoteObject = WebInspector.RemoteObject.fromPayload(remoteObjectPayload)
</span><span class="cx"> remoteObject.pushNodeToFrontend((documentNodeId) => {
</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"> <script>
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>- InspectorTest.assert(WebInspector.frameResourceManager.mainFrame.childFrames.length === 1, "Page should have a subframe.");
- const mainFrameId = WebInspector.frameResourceManager.mainFrame.id;
- const childFrameId = WebInspector.frameResourceManager.mainFrame.childFrames[0].id;
</del><ins>+ let suite = InspectorTest.createAsyncSuite("DOM.highlightSelector");
+
+ let mainFrame = WebInspector.frameResourceManager.mainFrame;
+ let childFrames = mainFrame.childFrameCollection.toArray();
+ InspectorTest.expectEqual(childFrames.length, 1, "Page should have a subframe.");
+
+ 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("DOM.highlightSelector");
-
- 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) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> InspectorTest.log("- Frame: " + displayNameForFrameId(frameId));
</span><span class="cx"> InspectorTest.log("- Selector: " + selector);
</span><span class="cx"> DOMAgent.highlightSelector(highlightConfig, selector, frameId, (error) => {
</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("WebInspector.Frame.extraScripts");
</del><ins>+ let suite = InspectorTest.createAsyncSuite("WebInspector.Frame.extraScriptCollection");
</ins><span class="cx">
</span><ins>+ let mainFrame = WebInspector.frameResourceManager.mainFrame;
+
</ins><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "FrameHasNoExtraScriptsYet",
</span><span class="cx"> description: "No extra scripts yet.",
</span><span class="cx"> test(resolve, reject) {
</span><del>- let mainFrame = WebInspector.frameResourceManager.mainFrame;
- InspectorTest.expectThat(mainFrame.extraScripts.length === 0, "Main frame should have no dynamic scripts.");
</del><ins>+ InspectorTest.expectEqual(mainFrame.extraScriptCollection.items.size, 0, "Main frame should have no dynamic scripts.");
</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) => {
</span><span class="cx"> InspectorTest.pass("ExtraScriptAdded event fired.");
</span><span class="cx"> InspectorTest.expectThat(event.data.script.dynamicallyAddedScriptElement, "Script should identify as dynamic.");
</span><del>-
- let mainFrame = WebInspector.frameResourceManager.mainFrame;
- InspectorTest.expectThat(mainFrame.extraScripts.length === 1, "Main frame should have 1 dynamic script.");
</del><ins>+ InspectorTest.expectEqual(mainFrame.extraScriptCollection.items.size, 1, "Main frame should have 1 dynamic script.");
</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"> </script>
</span><span class="cx"> </head>
</span><span class="cx"> <body onload="runTest()">
</span><del>-<p>WebInspector.Frame.extraScripts.</p>
</del><ins>+<p>WebInspector.Frame.extraScriptCollection.</p>
</ins><span class="cx"> </body>
</span><span class="cx"> </html>
</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 <dcrousso+webkit@gmail.com>
</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 <dcrousso+webkit@gmail.com>
+
</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) => true,
</span><ins>+ ContentFlow: (object) => object instanceof WebInspector.ContentFlow,
</ins><span class="cx"> Frame: (object) => object instanceof WebInspector.Frame,
</span><span class="cx"> Resource: (object) => object instanceof WebInspector.Resource,
</span><span class="cx"> Script: (object) => 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 < 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 < 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 < 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 < 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("frames", WebInspector.UIString("Frames"),
</span><span class="cx"> (representedObject) => representedObject instanceof WebInspector.Frame,
</span><del>- () => this.frame.childFrames.length,
</del><ins>+ () => 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("flows", WebInspector.UIString("Flows"),
</span><span class="cx"> (representedObject) => representedObject instanceof WebInspector.ContentFlow,
</span><del>- () => this.frame.domTree.flowsCount,
</del><ins>+ () => 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("extra-scripts", WebInspector.UIString("Extra Scripts"),
</span><span class="cx"> (representedObject) => representedObject instanceof WebInspector.Script && representedObject.dynamicallyAddedScriptElement,
</span><del>- () => this.frame.extraScripts.length,
</del><ins>+ () => 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 < 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>