Diff
Modified: trunk/LayoutTests/ChangeLog (262805 => 262806)
--- trunk/LayoutTests/ChangeLog 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/LayoutTests/ChangeLog 2020-06-09 20:44:14 UTC (rev 262806)
@@ -1,3 +1,17 @@
+2020-06-09 Devin Rousso <[email protected]>
+
+ Web Inspector: allow multiple resources for a given URL
+ https://bugs.webkit.org/show_bug.cgi?id=212852
+
+ Reviewed by Brian Burg.
+
+ * inspector/unit-tests/set-utilities.html:
+ * inspector/unit-tests/set-utilities-expected.txt:
+ Add test for `Set.prototype.find`.
+
+ * http/tests/websocket/tests/hybi/inspector/resolveWebSocket.html:
+ Update usage of `resourceForURL` to `resourcesForURL` with `Set.prototype.firstValue`.
+
2020-06-09 Youenn Fablet <[email protected]>
BaseAudioSharedUnit should unmute its clients in case of suspension even if not having any audio unit
Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/resolveWebSocket.html (262805 => 262806)
--- trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/resolveWebSocket.html 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/inspector/resolveWebSocket.html 2020-06-09 20:44:14 UTC (rev 262806)
@@ -24,7 +24,7 @@
description: "Should return a valid response for the given request identifier.",
test(resolve, reject) {
const url = ""
- let webSocketResource = WI.networkManager.resourceForURL(url);
+ let webSocketResource = WI.networkManager.resourcesForURL(url).find((resource) => resource instanceof WI.WebSocketResource);
if (!webSocketResource) {
reject("Missing WebSocket resource.");
return;
Modified: trunk/LayoutTests/inspector/unit-tests/set-utilities-expected.txt (262805 => 262806)
--- trunk/LayoutTests/inspector/unit-tests/set-utilities-expected.txt 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/LayoutTests/inspector/unit-tests/set-utilities-expected.txt 2020-06-09 20:44:14 UTC (rev 262806)
@@ -1,5 +1,10 @@
== Running test suite: Set
+-- Running test case: Set.prototype.find
+PASS: Set can find a item it holds.
+PASS: Set finds the first item if the given predicate matches multiple items.
+PASS: Set returns 'undefined' when attempting to find an item if the given predicate doesn't match anything.
+
-- Running test case: Set.prototype.pushAll
Array:
[1,2] => [1,2,"a1","a2"]
Modified: trunk/LayoutTests/inspector/unit-tests/set-utilities.html (262805 => 262806)
--- trunk/LayoutTests/inspector/unit-tests/set-utilities.html 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/LayoutTests/inspector/unit-tests/set-utilities.html 2020-06-09 20:44:14 UTC (rev 262806)
@@ -8,6 +8,16 @@
let suite = InspectorTest.createSyncSuite("Set");
suite.addTestCase({
+ name: "Set.prototype.find",
+ test() {
+ let set = new Set(["a", "b"]);
+ InspectorTest.expectEqual(set.find((item) => item === "b"), "b", "Set can find a item it holds.");
+ InspectorTest.expectEqual(set.find((item) => typeof item === "string"), "a", "Set finds the first item if the given predicate matches multiple items.");
+ InspectorTest.expectEqual(set.find((item) => typeof item === "number"), undefined, "Set returns 'undefined' when attempting to find an item if the given predicate doesn't match anything.");
+ },
+ });
+
+ suite.addTestCase({
name: "Set.prototype.pushAll",
test() {
function test(iterable) {
Modified: trunk/Source/WebInspectorUI/ChangeLog (262805 => 262806)
--- trunk/Source/WebInspectorUI/ChangeLog 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/Source/WebInspectorUI/ChangeLog 2020-06-09 20:44:14 UTC (rev 262806)
@@ -1,3 +1,62 @@
+2020-06-09 Devin Rousso <[email protected]>
+
+ Web Inspector: allow multiple resources for a given URL
+ https://bugs.webkit.org/show_bug.cgi?id=212852
+
+ Reviewed by Brian Burg.
+
+ Previously, when a new resource is added with a URL that matches an existing resource, any
+ `resourceForURL` call with that URL will return the new resource instead of the old one. Now
+ that there is a `Multimap` of URL to resource, it is possible to pick which resource is used
+ instead of always using the newest one.
+
+ * UserInterface/Models/ResourceCollection.js:
+ (WI.ResourceCollection):
+ (WI.ResourceCollection.prototype.resourcesForURL): Added.
+ (WI.ResourceCollection.prototype._associateWithResource):
+ (WI.ResourceCollection.prototype._disassociateWithResource):
+ (WI.ResourceCollection.prototype._resourceURLDidChange):
+ (WI.ResourceCollection.prototype.resourceForURL): Deleted.
+ * UserInterface/Models/Frame.js:
+ (WI.Frame.prototype.resourcesForURL): Added.
+ (WI.Frame.prototype.resourceForURL): Deleted.
+ * UserInterface/Controllers/NetworkManager.js:
+ (WI.NetworkManager.prototype.resourcesForURL): Added.
+ (WI.NetworkManager.prototype.resourceRequestDidReceiveResponse):
+ (WI.NetworkManager.prototype._initiatorSourceCodeLocationFromPayload):
+ (WI.NetworkManager.prototype.resourceForURL): Deleted.
+
+ * UserInterface/Models/Script.js:
+ (WI.Script.prototype._resolveResource):
+ (WI.Script.prototype._resolveResource.isScriptResource): Added.
+ * UserInterface/Controllers/CSSManager.js:
+ (WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent):
+ * UserInterface/Base/Utilities.js:
+ (Set.prototype.find): Added.
+ Add utility for finding an item in a `Set` to avoid having to `Array.from`.
+
+ * UserInterface/Base/Main.js:
+ (WI.openURL):
+ (WI.sourceCodeForURL):
+ * UserInterface/Controllers/TimelineManager.js:
+ (WI.TimelineManager.prototype._processRecord):
+ * UserInterface/Models/CallFrame.js:
+ (WI.CallFrame.fromPayload):
+ * UserInterface/Models/ConsoleMessage.js:
+ (WI.ConsoleMessage.prototype.get sourceCodeLocation):
+ * UserInterface/Models/DOMNodeStyles.js:
+ (WI.DOMNodeStyles.prototype.createSourceCodeLocation):
+ * UserInterface/Models/ScriptTimelineRecord.js:
+ (WI.ScriptTimelineRecord.prototype._initializeProfileFromPayload.profileNodeFromPayload):
+ * UserInterface/Views/ContextMenuUtilities.js:
+ (WI.appendContextMenuItemsForURL):
+ * UserInterface/Views/DOMDetailsSidebarPanel.js:
+ (WI.DOMDetailsSidebarPanel.prototype._mouseWasClicked):
+ * UserInterface/Views/SearchSidebarPanel.js:
+ (WI.SearchSidebarPanel.prototype.performSearch):
+ Use the `firstValue` instead of the implicit `lastValue` to match existing nearby usage of
+ `WI.DebuggerManager.prototype.scriptsForURL`, which explicitly chooses the first script.
+
2020-06-04 Tim Horton <[email protected]>
Work around broken system version macro
Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (262805 => 262806)
--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js 2020-06-09 20:44:14 UTC (rev 262806)
@@ -1106,9 +1106,9 @@
let simplifiedURL = removeURLFragment(url);
if (frame) {
// WI.Frame.resourceForURL does not check the main resource, only sub-resources. So check both.
- resource = frame.url ="" simplifiedURL ? frame.mainResource : frame.resourceForURL(simplifiedURL, searchChildFrames);
+ resource = frame.url ="" simplifiedURL ? frame.mainResource : frame.resourcesForURL(simplifiedURL, searchChildFrames).firstValue;
} else if (WI.sharedApp.debuggableType === WI.DebuggableType.ServiceWorker)
- resource = WI.mainTarget.resourceCollection.resourceForURL(removeURLFragment(url));
+ resource = WI.mainTarget.resourceCollection.resourcesForURL(removeURLFragment(url)).firstValue;
if (resource) {
// Context menu selections may go through this code path; don't clobber the previously-set hint.
@@ -3060,7 +3060,7 @@
WI.sourceCodeForURL = function(url)
{
- var sourceCode = WI.networkManager.resourceForURL(url);
+ let sourceCode = WI.networkManager.resourcesForURL(url).firstValue;
if (!sourceCode) {
sourceCode = WI.debuggerManager.scriptsForURL(url, WI.assumingMainTarget())[0];
if (sourceCode)
Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js (262805 => 262806)
--- trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js 2020-06-09 20:44:14 UTC (rev 262806)
@@ -146,6 +146,18 @@
}
});
+Object.defineProperty(Set.prototype, "find",
+{
+ value(predicate)
+ {
+ for (let item of this) {
+ if (predicate(item, this))
+ return item;
+ }
+ return undefined;
+ },
+});
+
Object.defineProperty(Set.prototype, "addAll",
{
value(iterable)
Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js (262805 => 262806)
--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js 2020-06-09 20:44:14 UTC (rev 262806)
@@ -615,13 +615,10 @@
return;
if (!styleSheet.isInspectorStyleSheet()) {
- representedObject = representedObject.parentFrame.resourceForURL(representedObject.url);
- if (!representedObject)
- return;
-
// Only try to update stylesheet resources. Other resources, like documents, can contain
// multiple stylesheets and we don't have the source ranges to update those.
- if (representedObject.type !== WI.Resource.Type.StyleSheet)
+ representedObject = representedObject.parentFrame.resourcesForURL(representedObject.url).find((resource) => resource.type === WI.Resource.Type.StyleSheet);
+ if (!representedObject)
return;
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js (262805 => 262806)
--- trunk/Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js 2020-06-09 20:44:14 UTC (rev 262806)
@@ -461,15 +461,17 @@
return true;
}
- resourceForURL(url)
+ resourcesForURL(url)
{
- if (!this._mainFrame)
- return null;
+ let resources = new Set;
+ if (this._mainFrame) {
+ if (this._mainFrame.mainResource.url ="" url)
+ resources.add(this._mainFrame.mainResource);
- if (this._mainFrame.mainResource.url ="" url)
- return this._mainFrame.mainResource;
-
- return this._mainFrame.resourceForURL(url, true);
+ const recursivelySearchChildFrames = true;
+ resources.addAll(this._mainFrame.resourcesForURL(url, recursivelySearchChildFrames));
+ }
+ return resources;
}
adoptOrphanedResourcesForTarget(target)
@@ -809,7 +811,7 @@
if (!resource) {
var frame = this.frameForIdentifier(frameIdentifier);
if (frame)
- resource = frame.resourceForURL(response.url);
+ resource = frame.resourcesForURL(response.url).firstValue;
// If we find the resource this way we had marked it earlier as finished via Page.getResourceTree.
// Associate the resource with the requestIdentifier so it can be found in future loading events.
@@ -1083,7 +1085,7 @@
if (!url || isNaN(lineNumber) || lineNumber < 0)
return null;
- var sourceCode = WI.networkManager.resourceForURL(url);
+ let sourceCode = WI.networkManager.resourcesForURL(url).firstValue;
if (!sourceCode)
sourceCode = WI.debuggerManager.scriptsForURL(url, WI.mainTarget)[0];
Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (262805 => 262806)
--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js 2020-06-09 20:44:14 UTC (rev 262806)
@@ -857,7 +857,8 @@
case InspectorBackend.Enum.Timeline.EventType.EvaluateScript:
if (!sourceCodeLocation) {
var mainFrame = WI.networkManager.mainFrame;
- var scriptResource = mainFrame.url ="" recordPayload.data.url ? mainFrame.mainResource : mainFrame.resourceForURL(recordPayload.data.url, true);
+ const recursivelySearchChildFrames = true;
+ let scriptResource = mainFrame.url ="" recordPayload.data.url ? mainFrame.mainResource : mainFrame.resourcesForURL(recordPayload.data.url, recursivelySearchChildFrames).lastValue;
if (scriptResource) {
// The lineNumber is 1-based, but we expect 0-based.
let lineNumber = recordPayload.data.lineNumber - 1;
@@ -907,7 +908,8 @@
if (!sourceCodeLocation) {
var mainFrame = WI.networkManager.mainFrame;
- var scriptResource = mainFrame.url ="" recordPayload.data.scriptName ? mainFrame.mainResource : mainFrame.resourceForURL(recordPayload.data.scriptName, true);
+ const recursivelySearchChildFrames = true;
+ let scriptResource = mainFrame.url ="" recordPayload.data.scriptName ? mainFrame.mainResource : mainFrame.resourcesForURL(recordPayload.data.scriptName, recursivelySearchChildFrames).lastValue;
if (scriptResource) {
// The lineNumber is 1-based, but we expect 0-based.
let lineNumber = recordPayload.data.scriptLine - 1;
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/CallFrame.js (262805 => 262806)
--- trunk/Source/WebInspectorUI/UserInterface/Models/CallFrame.js 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CallFrame.js 2020-06-09 20:44:14 UTC (rev 262806)
@@ -233,7 +233,7 @@
sourceCode = sourceCode.resource;
}
if (!sourceCode)
- sourceCode = WI.networkManager.resourceForURL(url);
+ sourceCode = WI.networkManager.resourcesForURL(url).firstValue;
if (!sourceCode)
sourceCode = WI.debuggerManager.scriptsForURL(url, target)[0];
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js (262805 => 262806)
--- trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js 2020-06-09 20:44:14 UTC (rev 262806)
@@ -84,7 +84,7 @@
// If that doesn't exist try to get a location from the url/line/column in the ConsoleMessage.
// FIXME <http://webkit.org/b/76404>: Remove the string equality checks for undefined once we don't get that value anymore.
if (this._url && this._url !== "undefined") {
- let sourceCode = WI.networkManager.resourceForURL(this._url);
+ let sourceCode = WI.networkManager.resourcesForURL(this._url).firstValue;
if (sourceCode) {
let lineNumber = this._line > 0 ? this._line - 1 : 0;
let columnNumber = this._column > 0 ? this._column - 1 : 0;
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js (262805 => 262806)
--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js 2020-06-09 20:44:14 UTC (rev 262806)
@@ -71,16 +71,16 @@
// Try to use the node to find the frame which has the correct resource first.
if (documentNode) {
- let mainResource = WI.networkManager.resourceForURL(documentNode.documentURL);
+ let mainResource = WI.networkManager.resourcesForURL(documentNode.documentURL).firstValue;
if (mainResource) {
let parentFrame = mainResource.parentFrame;
- sourceCode = parentFrame.resourceForURL(sourceURL);
+ sourceCode = parentFrame.resourcesForURL(sourceURL).firstValue;
}
}
// If that didn't find the resource, then search all frames.
if (!sourceCode)
- sourceCode = WI.networkManager.resourceForURL(sourceURL);
+ sourceCode = WI.networkManager.resourcesForURL(sourceURL).firstValue;
if (!sourceCode)
return null;
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/Frame.js (262805 => 262806)
--- trunk/Source/WebInspectorUI/UserInterface/Models/Frame.js 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Frame.js 2020-06-09 20:44:14 UTC (rev 262806)
@@ -361,30 +361,22 @@
this.dispatchEventToListeners(WI.Frame.Event.AllChildFramesRemoved);
}
- resourceForURL(url, recursivelySearchChildFrames)
+ resourcesForURL(url, recursivelySearchChildFrames)
{
- var resource = this._resourceCollection.resourceForURL(url);
- if (resource)
- return resource;
+ let resources = this._resourceCollection.resourcesForURL(url);
// Check the main resources of the child frames for the requested URL.
for (let childFrame of this._childFrameCollection) {
- resource = childFrame.mainResource;
- if (resource.url ="" url)
- return resource;
+ if (childFrame.mainResource.url ="" url)
+ resources.add(childFrame.mainResource);
}
- if (!recursivelySearchChildFrames)
- return null;
-
- // Recursively search resources of child frames.
- for (let childFrame of this._childFrameCollection) {
- resource = childFrame.resourceForURL(url, true);
- if (resource)
- return resource;
+ if (recursivelySearchChildFrames) {
+ for (let childFrame of this._childFrameCollection)
+ resources.addAll(childFrame.resourcesForURL(url, recursivelySearchChildFrames));
}
- return null;
+ return resources;
}
resourceCollectionForType(type)
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ResourceCollection.js (262805 => 262806)
--- trunk/Source/WebInspectorUI/UserInterface/Models/ResourceCollection.js 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ResourceCollection.js 2020-06-09 20:44:14 UTC (rev 262806)
@@ -31,7 +31,7 @@
super();
this._resourceType = resourceType || null;
- this._resourceURLMap = new Map;
+ this._resourceURLMap = new Multimap;
this._resourcesTypeMap = new Map;
}
@@ -59,9 +59,9 @@
return object.type === this._resourceType;
}
- resourceForURL(url)
+ resourcesForURL(url)
{
- return this._resourceURLMap.get(url) || null;
+ return this._resourceURLMap.get(url) || new Set;
}
resourceCollectionForType(type)
@@ -114,7 +114,7 @@
_associateWithResource(resource)
{
- this._resourceURLMap.set(resource.url, resource);
+ this._resourceURLMap.add(resource.url, resource);
if (!this._resourceType) {
let resourcesCollectionForType = this.resourceCollectionForType(resource.type);
@@ -138,7 +138,7 @@
resourcesCollectionForType.remove(resource);
}
- this._resourceURLMap.delete(resource.url);
+ this._resourceURLMap.delete(resource.url, resource);
}
_resourceURLDidChange(event)
@@ -153,8 +153,8 @@
if (!oldURL)
return;
- this._resourceURLMap.set(resource.url, resource);
- this._resourceURLMap.delete(oldURL);
+ this._resourceURLMap.add(resource.url, resource);
+ this._resourceURLMap.delete(oldURL, resource);
}
_resourceTypeDidChange(event)
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/Script.js (262805 => 262806)
--- trunk/Source/WebInspectorUI/UserInterface/Models/Script.js 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Script.js 2020-06-09 20:44:14 UTC (rev 262806)
@@ -283,9 +283,13 @@
if (this._target && this._target !== WI.mainTarget)
resolver = this._target.resourceCollection;
+ function isScriptResource(item) {
+ return item.type === WI.Resource.Type.Document || item.type === WI.Resource.Type.Script;
+ }
+
try {
// Try with the Script's full URL.
- let resource = resolver.resourceForURL(this._url);
+ let resource = resolver.resourcesForURL(this._url).find(isScriptResource);
if (resource)
return resource;
@@ -292,7 +296,7 @@
// Try with the Script's full decoded URL.
let decodedURL = decodeURI(this._url);
if (decodedURL !== this._url) {
- resource = resolver.resourceForURL(decodedURL);
+ resource = resolver.resourcesForURL(decodedURL).find(isScriptResource);
if (resource)
return resource;
}
@@ -300,7 +304,7 @@
// Next try removing any fragment in the original URL.
let urlWithoutFragment = removeURLFragment(this._url);
if (urlWithoutFragment !== this._url) {
- resource = resolver.resourceForURL(urlWithoutFragment);
+ resource = resolver.resourcesForURL(urlWithoutFragment).find(isScriptResource);
if (resource)
return resource;
}
@@ -308,7 +312,7 @@
// Finally try removing any fragment in the decoded URL.
let decodedURLWithoutFragment = removeURLFragment(decodedURL);
if (decodedURLWithoutFragment !== decodedURL) {
- resource = resolver.resourceForURL(decodedURLWithoutFragment);
+ resource = resolver.resourcesForURL(decodedURLWithoutFragment).find(isScriptResource);
if (resource)
return resource;
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js (262805 => 262806)
--- trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js 2020-06-09 20:44:14 UTC (rev 262806)
@@ -125,7 +125,7 @@
console.assert("id" in nodePayload);
if (nodePayload.url) {
- var sourceCode = WI.networkManager.resourceForURL(nodePayload.url);
+ let sourceCode = WI.networkManager.resourcesForURL(nodePayload.url).firstValue;
if (!sourceCode)
sourceCode = WI.debuggerManager.scriptsForURL(nodePayload.url, WI.assumingMainTarget())[0];
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js (262805 => 262806)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js 2020-06-09 20:44:14 UTC (rev 262806)
@@ -208,7 +208,7 @@
});
}
- if (WI.networkManager.resourceForURL(url)) {
+ if (WI.networkManager.resourcesForURL(url).size) {
if (!WI.isShowingSourcesTab()) {
contextMenu.appendItem(WI.UIString("Reveal in Sources Tab"), () => {
showResourceWithOptions({preferredTabType: WI.SourcesTabContentView.Type});
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMDetailsSidebarPanel.js (262805 => 262806)
--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMDetailsSidebarPanel.js 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMDetailsSidebarPanel.js 2020-06-09 20:44:14 UTC (rev 262806)
@@ -101,10 +101,12 @@
_mouseWasClicked(event)
{
+ let parentFrame = null;
+
if (this._domNode && this._domNode.ownerDocument) {
- var mainResource = WI.networkManager.resourceForURL(this._domNode.ownerDocument.documentURL);
+ let mainResource = WI.networkManager.resourcesForURL(this._domNode.ownerDocument.documentURL).firstValue;
if (mainResource)
- var parentFrame = mainResource.parentFrame;
+ parentFrame = mainResource.parentFrame;
}
const options = {
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js (262805 => 262806)
--- trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js 2020-06-09 19:57:16 UTC (rev 262805)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js 2020-06-09 20:44:14 UTC (rev 262806)
@@ -195,7 +195,7 @@
if (!frame)
return;
- var resource = frame.url ="" url ? frame.mainResource : frame.resourceForURL(url);
+ let resource = frame.url ="" url ? frame.mainResource : frame.resourcesForURL(url).firstValue;
if (!resource)
return;
@@ -286,7 +286,7 @@
continue;
// FIXME: This should use a frame to do resourceForURL, but DOMAgent does not provide a frameId.
- var resource = WI.networkManager.resourceForURL(domNode.ownerDocument.documentURL);
+ let resource = WI.networkManager.resourcesForURL(domNode.ownerDocument.documentURL).firstValue;
if (!resource)
continue;