Commit 5c590cc8 authored by apavlov@chromium.org's avatar apavlov@chromium.org

DevTools: Re-land r169860 with UI fixed (empty boxes and missing Styles toolbar buttons)

TBR=pfeldman

Review URL: https://codereview.chromium.org/208653013

git-svn-id: svn://svn.chromium.org/blink/trunk@169937 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 4f491f69
...@@ -88,6 +88,13 @@ WebInspector.ElementsPanel = function() ...@@ -88,6 +88,13 @@ WebInspector.ElementsPanel = function()
this.sidebarPanes.platformFonts = new WebInspector.PlatformFontsSidebarPane(); this.sidebarPanes.platformFonts = new WebInspector.PlatformFontsSidebarPane();
this.sidebarPanes.computedStyle = new WebInspector.ComputedStyleSidebarPane(); this.sidebarPanes.computedStyle = new WebInspector.ComputedStyleSidebarPane();
this.sidebarPanes.styles = new WebInspector.StylesSidebarPane(this.sidebarPanes.computedStyle, this._setPseudoClassForNodeId.bind(this)); 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.metrics = new WebInspector.MetricsSidebarPane();
this.sidebarPanes.properties = new WebInspector.PropertiesSidebarPane(); this.sidebarPanes.properties = new WebInspector.PropertiesSidebarPane();
this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane.createProxy(this); this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane.createProxy(this);
...@@ -426,7 +433,7 @@ WebInspector.ElementsPanel.prototype = { ...@@ -426,7 +433,7 @@ WebInspector.ElementsPanel.prototype = {
} }
return anchor; return anchor;
}, },
_loadDimensionsForNode: function(treeElement, callback) _loadDimensionsForNode: function(treeElement, callback)
{ {
// We get here for CSS properties, too, so bail out early for non-DOM treeElements. // We get here for CSS properties, too, so bail out early for non-DOM treeElements.
...@@ -434,7 +441,7 @@ WebInspector.ElementsPanel.prototype = { ...@@ -434,7 +441,7 @@ WebInspector.ElementsPanel.prototype = {
callback(); callback();
return; return;
} }
var node = /** @type {!WebInspector.DOMNode} */ (treeElement.representedObject); var node = /** @type {!WebInspector.DOMNode} */ (treeElement.representedObject);
if (!node.nodeName() || node.nodeName().toLowerCase() !== "img") { if (!node.nodeName() || node.nodeName().toLowerCase() !== "img") {
...@@ -1203,21 +1210,24 @@ WebInspector.ElementsPanel.prototype = { ...@@ -1203,21 +1210,24 @@ WebInspector.ElementsPanel.prototype = {
computedPane.element.classList.add("fill"); computedPane.element.classList.add("fill");
var expandComputed = computedPane.expand.bind(computedPane); var expandComputed = computedPane.expand.bind(computedPane);
computedPane.bodyElement.appendChild(this.sidebarPanes.computedStyle.titleElement);
computedPane.bodyElement.classList.add("metrics-and-computed"); computedPane.bodyElement.classList.add("metrics-and-computed");
this.sidebarPanes.computedStyle.show(computedPane.bodyElement);
this.sidebarPanes.computedStyle.setExpandCallback(expandComputed); 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 {boolean} inComputedStyle
* @param {!Element=} beforeElement
* @this {WebInspector.ElementsPanel} * @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 = { ...@@ -1228,16 +1238,15 @@ WebInspector.ElementsPanel.prototype = {
{ {
var tabId = /** @type {string} */ (event.data.tabId); var tabId = /** @type {string} */ (event.data.tabId);
if (tabId === computedPane.title()) if (tabId === computedPane.title())
showMetrics.call(this, computedPane, this.sidebarPanes.computedStyle.element); showMetrics.call(this, true);
if (tabId === stylesPane.title()) else if (tabId === stylesPane.title())
showMetrics.call(this, stylesPane); showMetrics.call(this, false);
} }
this.sidebarPaneView = new WebInspector.SidebarTabbedPane(); this.sidebarPaneView = new WebInspector.SidebarTabbedPane();
if (vertically) { if (vertically) {
this._splitView.installResizer(this.sidebarPaneView.headerElement()); this._splitView.installResizer(this.sidebarPaneView.headerElement());
this.sidebarPanes.metrics.show(computedPane.bodyElement, this.sidebarPanes.computedStyle.element);
this.sidebarPanes.metrics.setExpandCallback(expandComputed); this.sidebarPanes.metrics.setExpandCallback(expandComputed);
var compositePane = new WebInspector.SidebarPane(this.sidebarPanes.styles.title()); var compositePane = new WebInspector.SidebarPane(this.sidebarPanes.styles.title());
...@@ -1248,13 +1257,19 @@ WebInspector.ElementsPanel.prototype = { ...@@ -1248,13 +1257,19 @@ WebInspector.ElementsPanel.prototype = {
var splitView = new WebInspector.SplitView(true, true, "stylesPaneSplitViewState", 0.5); var splitView = new WebInspector.SplitView(true, true, "stylesPaneSplitViewState", 0.5);
splitView.show(compositePane.bodyElement); splitView.show(compositePane.bodyElement);
this.sidebarPanes.styles.show(splitView.mainElement()); splitView.mainElement().appendChild(matchedStylePanesWrapper);
splitView.mainElement().appendChild(this.sidebarPanes.styles.titleElement); splitView.sidebarElement().appendChild(computedStylePanesWrapper);
this.sidebarPanes.styles.setExpandCallback(expandComposite); this.sidebarPanes.styles.setExpandCallback(expandComposite);
computedPane.show(splitView.sidebarElement()); computedPane.show(computedStylePanesWrapper);
computedPane.setExpandCallback(expandComposite); computedPane.setExpandCallback(expandComposite);
if (WebInspector.experimentsSettings.cssStyleSearch.isEnabled()) {
splitView.mainElement().appendChild(this._matchedStylesFilterBoxContainer);
splitView.sidebarElement().appendChild(this._computedStylesFilterBoxContainer);
}
this.sidebarPaneView.addPane(compositePane); this.sidebarPaneView.addPane(compositePane);
} else { } else {
var stylesPane = new WebInspector.SidebarPane(this.sidebarPanes.styles.title()); var stylesPane = new WebInspector.SidebarPane(this.sidebarPanes.styles.title());
...@@ -1262,18 +1277,30 @@ WebInspector.ElementsPanel.prototype = { ...@@ -1262,18 +1277,30 @@ WebInspector.ElementsPanel.prototype = {
stylesPane.element.classList.add("fill"); stylesPane.element.classList.add("fill");
var expandStyles = stylesPane.expand.bind(stylesPane); var expandStyles = stylesPane.expand.bind(stylesPane);
stylesPane.bodyElement.classList.add("metrics-and-styles"); 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.styles.setExpandCallback(expandStyles);
this.sidebarPanes.metrics.setExpandCallback(expandStyles); this.sidebarPanes.metrics.setExpandCallback(expandStyles);
stylesPane.bodyElement.appendChild(this.sidebarPanes.styles.titleElement);
this.sidebarPaneView.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected, tabSelected, this); 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(stylesPane);
this.sidebarPaneView.addPane(computedPane); 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.eventListeners);
this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints); this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints);
this.sidebarPaneView.addPane(this.sidebarPanes.properties); this.sidebarPaneView.addPane(this.sidebarPanes.properties);
......
...@@ -288,6 +288,7 @@ WebInspector.ExperimentsSettings = function(experimentsEnabled) ...@@ -288,6 +288,7 @@ WebInspector.ExperimentsSettings = function(experimentsEnabled)
this.timelineFlameChart = this._createExperiment("timelineFlameChart", "Enable FlameChart mode in Timeline"); this.timelineFlameChart = this._createExperiment("timelineFlameChart", "Enable FlameChart mode in Timeline");
this.heapSnapshotStatistics = this._createExperiment("heapSnapshotStatistics", "Show memory breakdown statistics in heap snapshots"); this.heapSnapshotStatistics = this._createExperiment("heapSnapshotStatistics", "Show memory breakdown statistics in heap snapshots");
this.timelineNoLiveUpdate = this._createExperiment("timelineNoLiveUpdate", "Timeline w/o live update"); this.timelineNoLiveUpdate = this._createExperiment("timelineNoLiveUpdate", "Timeline w/o live update");
this.cssStyleSearch = this._createExperiment("cssStyleSearch", "Enable Styles search and Computed style filtering");
this._cleanUpSetting(); this._cleanUpSetting();
} }
......
...@@ -219,6 +219,15 @@ ...@@ -219,6 +219,15 @@
margin-left: -6px; margin-left: -6px;
} }
.styles-section .properties li.filter-match,
.styles-section .simple-selector.filter-match {
background-color: rgba(255, 255, 0, 0.5);
}
.styles-section .properties li.overloaded.filter-match {
background-color: rgba(255, 255, 0, 0.25);
}
.styles-section .properties li.not-parsed-ok .exclamation-mark { .styles-section .properties li.not-parsed-ok .exclamation-mark {
display: inline-block; display: inline-block;
position: relative; position: relative;
...@@ -430,10 +439,6 @@ ...@@ -430,10 +439,6 @@
color: inherit; color: inherit;
} }
.styles-section.computed-style .properties {
margin-top: 18px;
}
.styles-section.computed-style .properties .disabled { .styles-section.computed-style .properties .disabled {
text-decoration: none; text-decoration: none;
opacity: 0.5; opacity: 0.5;
...@@ -449,7 +454,6 @@ ...@@ -449,7 +454,6 @@
} }
.styles-element-state-pane { .styles-element-state-pane {
background-color: rgb(240, 240, 240);
overflow: hidden; overflow: hidden;
margin-top: -56px; margin-top: -56px;
padding-top: 18px; padding-top: 18px;
...@@ -579,12 +583,38 @@ ...@@ -579,12 +583,38 @@
.sidebar-pane.composite .metrics { .sidebar-pane.composite .metrics {
border-bottom: 1px solid rgb(64%, 64%, 64%); border-bottom: 1px solid rgb(64%, 64%, 64%);
height: 206px; height: 206px;
display: -webkit-flex; display: flex;
-webkit-flex-direction: column; flex-direction: column;
-webkit-align-items: center; -webkit-align-items: center;
-webkit-justify-content: center; -webkit-justify-content: center;
} }
.sidebar-pane .metrics-and-styles,
.sidebar-pane .metrics-and-computed {
display: flex !important;
flex-direction: column !important;
position: relative;
}
.sidebar-pane .style-panes-wrapper {
flex: 1;
overflow-y: auto;
position: relative;
}
.sidebar-pane.composite .metrics-and-computed .sidebar-pane-toolbar,
.sidebar-pane.composite .metrics-and-styles .sidebar-pane-toolbar {
position: absolute;
}
input.filter-box {
outline: none !important;
}
.sidebar-pane .filter-box-container > .filter-box {
margin: 1px 1px 1px 2px;
}
.sidebar-pane.composite .metrics-and-computed .sidebar-pane-toolbar { .sidebar-pane.composite .metrics-and-computed .sidebar-pane-toolbar {
margin-top: 4px; margin-top: 4px;
margin-bottom: -4px; margin-bottom: -4px;
...@@ -621,8 +651,8 @@ ...@@ -621,8 +651,8 @@
} }
.styles-section.computed-style > .header > .sidebar-pane-subtitle { .styles-section.computed-style > .header > .sidebar-pane-subtitle {
top: 4px; line-height: 17px;
left: 8px; margin: 2px;
-webkit-user-select: none; -webkit-user-select: none;
} }
......
...@@ -182,7 +182,6 @@ body.platform-windows .sidebar-pane-subtitle { ...@@ -182,7 +182,6 @@ body.platform-windows .sidebar-pane-subtitle {
padding-top: 1px; padding-top: 1px;
} }
.sidebar-pane-subtitle input,
.section > .header input[type=checkbox] { .section > .header input[type=checkbox] {
height: 1em; height: 1em;
width: 1em; width: 1em;
......
...@@ -134,7 +134,7 @@ String.prototype.escapeCharacters = function(chars) ...@@ -134,7 +134,7 @@ String.prototype.escapeCharacters = function(chars)
*/ */
String.regexSpecialCharacters = function() String.regexSpecialCharacters = function()
{ {
return "^[]{}()\\.$*+?|-,"; return "^[]{}()\\.^$*+?|-,";
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment