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()
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);
......@@ -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);
......
......@@ -288,6 +288,7 @@ WebInspector.ExperimentsSettings = function(experimentsEnabled)
this.timelineFlameChart = this._createExperiment("timelineFlameChart", "Enable FlameChart mode in Timeline");
this.heapSnapshotStatistics = this._createExperiment("heapSnapshotStatistics", "Show memory breakdown statistics in heap snapshots");
this.timelineNoLiveUpdate = this._createExperiment("timelineNoLiveUpdate", "Timeline w/o live update");
this.cssStyleSearch = this._createExperiment("cssStyleSearch", "Enable Styles search and Computed style filtering");
this._cleanUpSetting();
}
......
......@@ -219,6 +219,15 @@
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 {
display: inline-block;
position: relative;
......@@ -430,10 +439,6 @@
color: inherit;
}
.styles-section.computed-style .properties {
margin-top: 18px;
}
.styles-section.computed-style .properties .disabled {
text-decoration: none;
opacity: 0.5;
......@@ -449,7 +454,6 @@
}
.styles-element-state-pane {
background-color: rgb(240, 240, 240);
overflow: hidden;
margin-top: -56px;
padding-top: 18px;
......@@ -579,12 +583,38 @@
.sidebar-pane.composite .metrics {
border-bottom: 1px solid rgb(64%, 64%, 64%);
height: 206px;
display: -webkit-flex;
-webkit-flex-direction: column;
display: flex;
flex-direction: column;
-webkit-align-items: 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 {
margin-top: 4px;
margin-bottom: -4px;
......@@ -621,8 +651,8 @@
}
.styles-section.computed-style > .header > .sidebar-pane-subtitle {
top: 4px;
left: 8px;
line-height: 17px;
margin: 2px;
-webkit-user-select: none;
}
......
......@@ -182,7 +182,6 @@ body.platform-windows .sidebar-pane-subtitle {
padding-top: 1px;
}
.sidebar-pane-subtitle input,
.section > .header input[type=checkbox] {
height: 1em;
width: 1em;
......
......@@ -134,7 +134,7 @@ String.prototype.escapeCharacters = function(chars)
*/
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