| Index: Source/devtools/front_end/ElementsPanel.js
|
| diff --git a/Source/devtools/front_end/ElementsPanel.js b/Source/devtools/front_end/ElementsPanel.js
|
| index 6ea412127647b60253eb70ba9b3ec579e0ecf47f..ff2f3cd18d0611194fe6bf35fb46231a8dd47bf8 100644
|
| --- a/Source/devtools/front_end/ElementsPanel.js
|
| +++ b/Source/devtools/front_end/ElementsPanel.js
|
| @@ -88,6 +88,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));
|
| +
|
| + this._matchedStylesFilterBoxContainer = document.createElement("div");
|
| + 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);
|
| @@ -426,7 +433,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.
|
| @@ -434,7 +441,7 @@ WebInspector.ElementsPanel.prototype = {
|
| callback();
|
| return;
|
| }
|
| -
|
| +
|
| var node = /** @type {!WebInspector.DOMNode} */ (treeElement.representedObject);
|
|
|
| if (!node.nodeName() || node.nodeName().toLowerCase() !== "img") {
|
| @@ -1203,21 +1210,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);
|
| }
|
|
|
| /**
|
| @@ -1228,16 +1238,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());
|
| @@ -1248,13 +1257,19 @@ 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);
|
| + splitView.mainElement().appendChild(matchedStylePanesWrapper);
|
| + splitView.sidebarElement().appendChild(computedStylePanesWrapper);
|
| +
|
| this.sidebarPanes.styles.setExpandCallback(expandComposite);
|
|
|
| - computedPane.show(splitView.sidebarElement());
|
| + computedPane.show(computedStylePanesWrapper);
|
| 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());
|
| @@ -1262,18 +1277,30 @@ 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.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);
|
| + matchedStylePanesWrapper.appendChild(this.sidebarPanes.styles.titleElement);
|
| + 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);
|
|
|