Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1064)

Unified Diff: third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js

Issue 1668603003: Devtools: Switch JS execution context to match inspected node (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
index d9d112afd364f07db0ca0af07f0bc73b0a1d9cd9..502a67c174676864d6f770d22bb6d01d2121cbf8 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
@@ -385,6 +385,13 @@ WebInspector.ElementsPanel.prototype = {
if (selectedNode) {
selectedNode.setAsInspectedNode();
this._lastValidSelectedNode = selectedNode;
+
+ var executionContexts = selectedNode.target().runtimeModel.executionContexts();
+ for (var context of executionContexts) {
+ var frame = context.target().resourceTreeModel.frameForId(context.frameId);
+ if (context.frameId == selectedNode.frameId())
pfeldman 2016/02/17 01:18:46 Could we not compute this in the loop?
samli 2016/02/18 02:14:36 Yes, done, sorry.
+ WebInspector.context.setFlavor(WebInspector.ExecutionContext, context);
pfeldman 2016/02/17 01:18:46 should we break this n^2 loop sooner?
samli 2016/02/18 02:14:36 Done.
+ }
}
WebInspector.notifications.dispatchEventToListeners(WebInspector.NotificationService.Events.SelectedNodeChanged);
this._selectedNodeChangedForTest();

Powered by Google App Engine
This is Rietveld 408576698