Chromium Code Reviews| Index: Source/devtools/front_end/ElementsPanel.js |
| diff --git a/Source/devtools/front_end/ElementsPanel.js b/Source/devtools/front_end/ElementsPanel.js |
| index f6d767e5f047a6829a7ed81a7518c2515bbdccca..90a463e36f1f6e0cee9a6c864764664ab655afe4 100644 |
| --- a/Source/devtools/front_end/ElementsPanel.js |
| +++ b/Source/devtools/front_end/ElementsPanel.js |
| @@ -93,6 +93,13 @@ WebInspector.ElementsPanel = function() |
| this.sidebarPanes.platformFonts = new WebInspector.PlatformFontsSidebarPane(); |
| this.sidebarPanes.computedStyle = new WebInspector.ComputedStyleSidebarPane(); |
| this.sidebarPanes.styles = new WebInspector.StylesSidebarPane(this.sidebarPanes.computedStyle, this._setPseudoClassForNodeId.bind(this)); |
| + if (WebInspector.experimentsSettings.cssStyleSearch.isEnabled()) { |
| + this._matchedStylesFilterBoxContainer = document.createElement("div"); |
|
pfeldman
2014/03/24 15:18:54
Lets create them regardless.
|
| + this._matchedStylesFilterBoxContainer.className = "filter-box-container inspector-footer status-bar"; |
| + this._computedStylesFilterBoxContainer = document.createElement("div"); |
| + this._computedStylesFilterBoxContainer.className = "filter-box-container inspector-footer status-bar"; |
| + this.sidebarPanes.styles.setFilterBoxContainers(this._matchedStylesFilterBoxContainer, this._computedStylesFilterBoxContainer); |
| + } |
| this.sidebarPanes.metrics = new WebInspector.MetricsSidebarPane(); |
| this.sidebarPanes.properties = new WebInspector.PropertiesSidebarPane(); |
| this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane.createProxy(this); |
| @@ -440,7 +447,7 @@ WebInspector.ElementsPanel.prototype = { |
| } |
| return anchor; |
| }, |
| - |
| + |
| _loadDimensionsForNode: function(treeElement, callback) |
| { |
| // We get here for CSS properties, too, so bail out early for non-DOM treeElements. |
| @@ -448,7 +455,7 @@ WebInspector.ElementsPanel.prototype = { |
| callback(); |
| return; |
| } |
| - |
| + |
| var node = /** @type {!WebInspector.DOMNode} */ (treeElement.representedObject); |
| if (!node.nodeName() || node.nodeName().toLowerCase() !== "img") { |
| @@ -1216,21 +1223,24 @@ WebInspector.ElementsPanel.prototype = { |
| computedPane.element.classList.add("fill"); |
| var expandComputed = computedPane.expand.bind(computedPane); |
| - computedPane.bodyElement.appendChild(this.sidebarPanes.computedStyle.titleElement); |
| computedPane.bodyElement.classList.add("metrics-and-computed"); |
| - this.sidebarPanes.computedStyle.show(computedPane.bodyElement); |
| this.sidebarPanes.computedStyle.setExpandCallback(expandComputed); |
| - this.sidebarPanes.platformFonts.show(computedPane.bodyElement); |
| + var matchedStylePanesWrapper = document.createElement("div"); |
| + matchedStylePanesWrapper.className = "style-panes-wrapper"; |
| + var computedStylePanesWrapper = document.createElement("div"); |
| + computedStylePanesWrapper.className = "style-panes-wrapper"; |
| /** |
| - * @param {!WebInspector.SidebarPane} pane |
| - * @param {!Element=} beforeElement |
| + * @param {boolean} inComputedStyle |
| * @this {WebInspector.ElementsPanel} |
| */ |
| - function showMetrics(pane, beforeElement) |
| + function showMetrics(inComputedStyle) |
| { |
| - this.sidebarPanes.metrics.show(pane.bodyElement, beforeElement); |
| + if (inComputedStyle) |
| + this.sidebarPanes.metrics.show(computedStylePanesWrapper, this.sidebarPanes.computedStyle.element); |
| + else |
| + this.sidebarPanes.metrics.show(matchedStylePanesWrapper); |
| } |
| /** |
| @@ -1241,16 +1251,15 @@ WebInspector.ElementsPanel.prototype = { |
| { |
| var tabId = /** @type {string} */ (event.data.tabId); |
| if (tabId === computedPane.title()) |
| - showMetrics.call(this, computedPane, this.sidebarPanes.computedStyle.element); |
| - if (tabId === stylesPane.title()) |
| - showMetrics.call(this, stylesPane); |
| + showMetrics.call(this, true); |
| + else if (tabId === stylesPane.title()) |
| + showMetrics.call(this, false); |
| } |
| this.sidebarPaneView = new WebInspector.SidebarTabbedPane(); |
| if (vertically) { |
| this._splitView.installResizer(this.sidebarPaneView.headerElement()); |
| - this.sidebarPanes.metrics.show(computedPane.bodyElement, this.sidebarPanes.computedStyle.element); |
| this.sidebarPanes.metrics.setExpandCallback(expandComputed); |
| var compositePane = new WebInspector.SidebarPane(this.sidebarPanes.styles.title()); |
| @@ -1261,13 +1270,20 @@ WebInspector.ElementsPanel.prototype = { |
| var splitView = new WebInspector.SplitView(true, true, "stylesPaneSplitViewState", 0.5); |
| splitView.show(compositePane.bodyElement); |
| - this.sidebarPanes.styles.show(splitView.mainElement()); |
| - splitView.mainElement().appendChild(this.sidebarPanes.styles.titleElement); |
| + matchedStylePanesWrapper.appendChild(this.sidebarPanes.styles.titleElement); |
| + splitView.mainElement().appendChild(matchedStylePanesWrapper); |
| + splitView.sidebarElement().appendChild(computedStylePanesWrapper); |
| + |
| this.sidebarPanes.styles.setExpandCallback(expandComposite); |
| computedPane.show(splitView.sidebarElement()); |
| computedPane.setExpandCallback(expandComposite); |
| + if (WebInspector.experimentsSettings.cssStyleSearch.isEnabled()) { |
| + splitView.mainElement().appendChild(this._matchedStylesFilterBoxContainer); |
| + splitView.sidebarElement().appendChild(this._computedStylesFilterBoxContainer); |
| + } |
| + |
| this.sidebarPaneView.addPane(compositePane); |
| } else { |
| var stylesPane = new WebInspector.SidebarPane(this.sidebarPanes.styles.title()); |
| @@ -1275,18 +1291,29 @@ WebInspector.ElementsPanel.prototype = { |
| stylesPane.element.classList.add("fill"); |
| var expandStyles = stylesPane.expand.bind(stylesPane); |
| stylesPane.bodyElement.classList.add("metrics-and-styles"); |
| - this.sidebarPanes.styles.show(stylesPane.bodyElement); |
| + |
| + stylesPane.bodyElement.appendChild(matchedStylePanesWrapper); |
| + computedPane.bodyElement.appendChild(computedStylePanesWrapper); |
| + |
| this.sidebarPanes.styles.setExpandCallback(expandStyles); |
| this.sidebarPanes.metrics.setExpandCallback(expandStyles); |
| - stylesPane.bodyElement.appendChild(this.sidebarPanes.styles.titleElement); |
| + this.sidebarPanes.styles.element.appendChild(this.sidebarPanes.styles.titleElement); |
| this.sidebarPaneView.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected, tabSelected, this); |
| - showMetrics.call(this, stylesPane); |
| + if (WebInspector.experimentsSettings.cssStyleSearch.isEnabled()) { |
| + stylesPane.bodyElement.appendChild(this._matchedStylesFilterBoxContainer); |
| + computedPane.bodyElement.appendChild(this._computedStylesFilterBoxContainer); |
| + } |
| this.sidebarPaneView.addPane(stylesPane); |
| this.sidebarPaneView.addPane(computedPane); |
| } |
| + this.sidebarPanes.styles.show(matchedStylePanesWrapper); |
| + this.sidebarPanes.computedStyle.show(computedStylePanesWrapper); |
| + showMetrics.call(this, vertically); |
| + this.sidebarPanes.platformFonts.show(computedStylePanesWrapper); |
| + |
| this.sidebarPaneView.addPane(this.sidebarPanes.eventListeners); |
| this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints); |
| this.sidebarPaneView.addPane(this.sidebarPanes.properties); |