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

Side by Side Diff: Source/devtools/front_end/ElementsPanel.js

Issue 16561003: DevTools: Inspect element mode does not select element in ShadowDOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 this._dockSideChanged(); 100 this._dockSideChanged();
101 101
102 this._popoverHelper = new WebInspector.PopoverHelper(this.element, this._get PopoverAnchor.bind(this), this._showPopover.bind(this)); 102 this._popoverHelper = new WebInspector.PopoverHelper(this.element, this._get PopoverAnchor.bind(this), this._showPopover.bind(this));
103 this._popoverHelper.setTimeout(0); 103 this._popoverHelper.setTimeout(0);
104 104
105 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrModi fied, this._updateBreadcrumbIfNeeded, this); 105 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrModi fied, this._updateBreadcrumbIfNeeded, this);
106 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrRemo ved, this._updateBreadcrumbIfNeeded, this); 106 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrRemo ved, this._updateBreadcrumbIfNeeded, this);
107 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.NodeRemo ved, this._nodeRemoved, this); 107 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.NodeRemo ved, this._nodeRemoved, this);
108 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.Document Updated, this._documentUpdatedEvent, this); 108 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.Document Updated, this._documentUpdatedEvent, this);
109 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.InspectE lementRequested, this._inspectElementRequested, this); 109 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.InspectE lementRequested, this._inspectElementRequested, this);
110 WebInspector.settings.showShadowDOM.addChangeListener(this._showShadowDOMCha nged.bind(this));
110 111
111 if (WebInspector.domAgent.existingDocument()) 112 if (WebInspector.domAgent.existingDocument())
112 this._documentUpdated(WebInspector.domAgent.existingDocument()); 113 this._documentUpdated(WebInspector.domAgent.existingDocument());
113 } 114 }
114 115
115 WebInspector.ElementsPanel.prototype = { 116 WebInspector.ElementsPanel.prototype = {
116 get statusBarItems() 117 get statusBarItems()
117 { 118 {
118 return [this.crumbsElement]; 119 return [this.crumbsElement];
119 }, 120 },
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 }, 1059 },
1059 1060
1060 revealAndSelectNode: function(nodeId) 1061 revealAndSelectNode: function(nodeId)
1061 { 1062 {
1062 WebInspector.inspectorView.setCurrentPanel(this); 1063 WebInspector.inspectorView.setCurrentPanel(this);
1063 1064
1064 var node = WebInspector.domAgent.nodeForId(nodeId); 1065 var node = WebInspector.domAgent.nodeForId(nodeId);
1065 if (!node) 1066 if (!node)
1066 return; 1067 return;
1067 1068
1069 while (!WebInspector.settings.showShadowDOM.get() && node && node.isInSh adowTree())
1070 node = node.parentNode;
1071
1068 WebInspector.domAgent.highlightDOMNodeForTwoSeconds(nodeId); 1072 WebInspector.domAgent.highlightDOMNodeForTwoSeconds(nodeId);
1069 this.selectDOMNode(node, true); 1073 this.selectDOMNode(node, true);
1070 }, 1074 },
1071 1075
1072 /** 1076 /**
1073 * @param {WebInspector.ContextMenu} contextMenu 1077 * @param {WebInspector.ContextMenu} contextMenu
1074 * @param {Object} target 1078 * @param {Object} target
1075 */ 1079 */
1076 appendApplicableItems: function(event, contextMenu, target) 1080 appendApplicableItems: function(event, contextMenu, target)
1077 { 1081 {
(...skipping 23 matching lines...) Expand all
1101 contextMenu.show(); 1105 contextMenu.show();
1102 }, 1106 },
1103 1107
1104 _dockSideChanged: function() 1108 _dockSideChanged: function()
1105 { 1109 {
1106 var dockSide = WebInspector.dockController.dockSide(); 1110 var dockSide = WebInspector.dockController.dockSide();
1107 var vertically = dockSide === WebInspector.DockController.State.DockedTo Right && WebInspector.settings.splitVerticallyWhenDockedToRight.get(); 1111 var vertically = dockSide === WebInspector.DockController.State.DockedTo Right && WebInspector.settings.splitVerticallyWhenDockedToRight.get();
1108 this._splitVertically(vertically); 1112 this._splitVertically(vertically);
1109 }, 1113 },
1110 1114
1115 _showShadowDOMChanged: function()
1116 {
1117 this.treeOutline.update();
1118 },
1119
1111 /** 1120 /**
1112 * @param {boolean} vertically 1121 * @param {boolean} vertically
1113 */ 1122 */
1114 _splitVertically: function(vertically) 1123 _splitVertically: function(vertically)
1115 { 1124 {
1116 if (this.sidebarPaneView && vertically === !this.splitView.isVertical()) 1125 if (this.sidebarPaneView && vertically === !this.splitView.isVertical())
1117 return; 1126 return;
1118 1127
1119 if (this.sidebarPaneView) 1128 if (this.sidebarPaneView)
1120 this.sidebarPaneView.detach(); 1129 this.sidebarPaneView.detach();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 * @param {WebInspector.SidebarPane} pane 1171 * @param {WebInspector.SidebarPane} pane
1163 */ 1172 */
1164 addExtensionSidebarPane: function(id, pane) 1173 addExtensionSidebarPane: function(id, pane)
1165 { 1174 {
1166 this.sidebarPanes[id] = pane; 1175 this.sidebarPanes[id] = pane;
1167 this.sidebarPaneView.addPane(pane); 1176 this.sidebarPaneView.addPane(pane);
1168 }, 1177 },
1169 1178
1170 __proto__: WebInspector.Panel.prototype 1179 __proto__: WebInspector.Panel.prototype
1171 } 1180 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698