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

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
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/elements/selected-element-changes-execution-context-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..18a8b32e3b471c68eadbe15143319db1c46395ff 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() || (!selectedNode.frameId() && !frame.parentFrame))
pfeldman 2016/02/06 02:59:05 - What if there is no frame? - In most of the case
samli 2016/02/08 03:53:50 Appears nodes in the top frame don't get a frameId
pfeldman 2016/02/11 21:47:34 nodes don't get frameids, only document nodes do.
samli 2016/02/15 00:40:13 Ok done. PTAL, I'm not sure this is the best way t
+ WebInspector.context.setFlavor(WebInspector.ExecutionContext, context);
+ }
}
WebInspector.notifications.dispatchEventToListeners(WebInspector.NotificationService.Events.SelectedNodeChanged);
this._selectedNodeChangedForTest();
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/elements/selected-element-changes-execution-context-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698