Commit f654e09c authored by pfeldman's avatar pfeldman Committed by Commit bot

DevTools: remove dead code, disambiguate expand for sections.

BUG=627306

Review-Url: https://codereview.chromium.org/2153153003
Cr-Commit-Position: refs/heads/master@{#406071}
parent 3fc9f535
...@@ -437,7 +437,7 @@ InspectorTest.toggleMatchedStyleProperty = function(propertyName, checked) ...@@ -437,7 +437,7 @@ InspectorTest.toggleMatchedStyleProperty = function(propertyName, checked)
InspectorTest.eventListenersWidget = function() InspectorTest.eventListenersWidget = function()
{ {
var sidebarPane = WebInspector.panels.elements.sidebarPanes.eventListeners; var sidebarPane = WebInspector.panels.elements.sidebarPanes.eventListeners;
sidebarPane.expand(); sidebarPane.expandPane();
return sidebarPane.children()[0]; return sidebarPane.children()[0];
} }
......
...@@ -24,7 +24,7 @@ function test() ...@@ -24,7 +24,7 @@ function test()
function forceUpdate() function forceUpdate()
{ {
objectEventListenersPane.expand(); objectEventListenersPane.expandPane();
objectEventListenersPane.update(); objectEventListenersPane.update();
} }
......
...@@ -12,7 +12,7 @@ function initialize_extensionsSidebarTest() ...@@ -12,7 +12,7 @@ function initialize_extensionsSidebarTest()
{ {
var sidebar = InspectorTest._extensionSidebar(); var sidebar = InspectorTest._extensionSidebar();
InspectorTest.deprecatedRunAfterPendingDispatches(function() { InspectorTest.deprecatedRunAfterPendingDispatches(function() {
sidebar.expand(); sidebar.expandPane();
callback(); callback();
}); });
} }
......
...@@ -19,7 +19,7 @@ function initialize_extensionsSidebarTest() ...@@ -19,7 +19,7 @@ function initialize_extensionsSidebarTest()
{ {
var sidebar = InspectorTest._extensionSidebar(panelName); var sidebar = InspectorTest._extensionSidebar(panelName);
InspectorTest.deprecatedRunAfterPendingDispatches(function() { InspectorTest.deprecatedRunAfterPendingDispatches(function() {
sidebar.expand(); sidebar.expandPane();
callback(); callback();
}); });
} }
......
...@@ -8,7 +8,7 @@ var foo = 123 ...@@ -8,7 +8,7 @@ var foo = 123
var test = function() var test = function()
{ {
var watchExpressionsPane = WebInspector.panels.sources.sidebarPanes.watchExpressions; var watchExpressionsPane = WebInspector.panels.sources.sidebarPanes.watchExpressions;
watchExpressionsPane.expand(); watchExpressionsPane.expandPane();
watchExpressionsPane.addExpression("#$%"); watchExpressionsPane.addExpression("#$%");
InspectorTest.deprecatedRunAfterPendingDispatches(step1); InspectorTest.deprecatedRunAfterPendingDispatches(step1);
......
...@@ -24,7 +24,7 @@ var test = function() ...@@ -24,7 +24,7 @@ var test = function()
function step1() function step1()
{ {
watchExpressionsPane = WebInspector.panels.sources.sidebarPanes.watchExpressions; watchExpressionsPane = WebInspector.panels.sources.sidebarPanes.watchExpressions;
watchExpressionsPane.expand(); watchExpressionsPane.expandPane();
watchExpressionsPane.addExpression("window.document"); watchExpressionsPane.addExpression("window.document");
watchExpressionsPane.addExpression("windowa.document"); watchExpressionsPane.addExpression("windowa.document");
......
...@@ -27,7 +27,7 @@ for (var i = 0; i < 300; ++i) ...@@ -27,7 +27,7 @@ for (var i = 0; i < 300; ++i)
var test = function() var test = function()
{ {
var watchExpressionsPane = WebInspector.panels.sources.sidebarPanes.watchExpressions; var watchExpressionsPane = WebInspector.panels.sources.sidebarPanes.watchExpressions;
watchExpressionsPane.expand(); watchExpressionsPane.expandPane();
watchExpressionsPane.addExpression("globalObject"); watchExpressionsPane.addExpression("globalObject");
watchExpressionsPane.addExpression("windowAlias"); watchExpressionsPane.addExpression("windowAlias");
watchExpressionsPane.addExpression("array"); watchExpressionsPane.addExpression("array");
......
...@@ -253,11 +253,9 @@ ...@@ -253,11 +253,9 @@
'front_end/ui/panelEnablerView.css', 'front_end/ui/panelEnablerView.css',
'front_end/ui/popover.css', 'front_end/ui/popover.css',
'front_end/ui/progressIndicator.css', 'front_end/ui/progressIndicator.css',
'front_end/ui/propertiesSection.css',
'front_end/ui/radioButton.css', 'front_end/ui/radioButton.css',
'front_end/ui/reportView.css', 'front_end/ui/reportView.css',
'front_end/ui/searchableView.css', 'front_end/ui/searchableView.css',
'front_end/ui/section.css',
'front_end/ui/sidebarPane.css', 'front_end/ui/sidebarPane.css',
'front_end/ui/softContextMenu.css', 'front_end/ui/softContextMenu.css',
'front_end/ui/smallIcon.css', 'front_end/ui/smallIcon.css',
...@@ -294,7 +292,6 @@ ...@@ -294,7 +292,6 @@
'front_end/ui/ResizerWidget.js', 'front_end/ui/ResizerWidget.js',
'front_end/ui/RootView.js', 'front_end/ui/RootView.js',
'front_end/ui/SearchableView.js', 'front_end/ui/SearchableView.js',
'front_end/ui/Section.js',
'front_end/ui/SettingsUI.js', 'front_end/ui/SettingsUI.js',
'front_end/ui/ShortcutRegistry.js', 'front_end/ui/ShortcutRegistry.js',
'front_end/ui/SidebarPane.js', 'front_end/ui/SidebarPane.js',
......
...@@ -57,7 +57,7 @@ WebInspector.AccessibilitySidebarView.prototype = { ...@@ -57,7 +57,7 @@ WebInspector.AccessibilitySidebarView.prototype = {
this._axNodeSubPane = new WebInspector.AXNodeSubPane(); this._axNodeSubPane = new WebInspector.AXNodeSubPane();
this._axNodeSubPane.setNode(this.node()); this._axNodeSubPane.setNode(this.node());
this._axNodeSubPane.show(this.element); this._axNodeSubPane.show(this.element);
this._axNodeSubPane.expand(); this._axNodeSubPane.expandPane();
this._sidebarPaneStack = new WebInspector.SidebarPaneStack(); this._sidebarPaneStack = new WebInspector.SidebarPaneStack();
this._sidebarPaneStack.element.classList.add("flex-auto"); this._sidebarPaneStack.element.classList.add("flex-auto");
......
...@@ -80,7 +80,7 @@ WebInspector.AuditCategoryResultPane = function(categoryResult) ...@@ -80,7 +80,7 @@ WebInspector.AuditCategoryResultPane = function(categoryResult)
var treeElement = this._appendResult(this._treeOutline.rootElement(), ruleResult, ruleResult.severity); var treeElement = this._appendResult(this._treeOutline.rootElement(), ruleResult, ruleResult.severity);
treeElement.listItemElement.classList.add("audit-result"); treeElement.listItemElement.classList.add("audit-result");
} }
this.expand(); this.expandPane();
} }
WebInspector.AuditCategoryResultPane.prototype = { WebInspector.AuditCategoryResultPane.prototype = {
......
...@@ -348,7 +348,7 @@ WebInspector.DOMBreakpointsSidebarPane.prototype = { ...@@ -348,7 +348,7 @@ WebInspector.DOMBreakpointsSidebarPane.prototype = {
var element = this._breakpointElements[breakpointId]; var element = this._breakpointElements[breakpointId];
if (!element) if (!element)
return; return;
this.expand(); this.expandPane();
element.classList.add("breakpoint-hit"); element.classList.add("breakpoint-hit");
this._highlightedElement = element; this._highlightedElement = element;
}, },
...@@ -453,7 +453,7 @@ WebInspector.DOMBreakpointsSidebarPane.prototype = { ...@@ -453,7 +453,7 @@ WebInspector.DOMBreakpointsSidebarPane.prototype = {
*/ */
WebInspector.DOMBreakpointsSidebarPane.Proxy = function(pane, panel) WebInspector.DOMBreakpointsSidebarPane.Proxy = function(pane, panel)
{ {
WebInspector.SidebarPane.call(this, pane.title()); WebInspector.SidebarPane.call(this, WebInspector.UIString("DOM Breakpoints"));
this.registerRequiredCSS("components/breakpointsList.css"); this.registerRequiredCSS("components/breakpointsList.css");
this._wrappedPane = pane; this._wrappedPane = pane;
...@@ -461,9 +461,9 @@ WebInspector.DOMBreakpointsSidebarPane.Proxy = function(pane, panel) ...@@ -461,9 +461,9 @@ WebInspector.DOMBreakpointsSidebarPane.Proxy = function(pane, panel)
} }
WebInspector.DOMBreakpointsSidebarPane.Proxy.prototype = { WebInspector.DOMBreakpointsSidebarPane.Proxy.prototype = {
expand: function() expandPane: function()
{ {
this._wrappedPane.expand(); this._wrappedPane.expandPane();
}, },
onContentReady: function() onContentReady: function()
......
...@@ -101,7 +101,7 @@ WebInspector.ElementsPanel.prototype = { ...@@ -101,7 +101,7 @@ WebInspector.ElementsPanel.prototype = {
_revealProperty: function(cssProperty) _revealProperty: function(cssProperty)
{ {
var stylesSidebarPane = this.sidebarPanes.styles; var stylesSidebarPane = this.sidebarPanes.styles;
this.sidebarPaneView.selectTab(stylesSidebarPane.title()); this.sidebarPaneView.selectTab(WebInspector.UIString("Styles"));
stylesSidebarPane.revealProperty(/** @type {!WebInspector.CSSProperty} */(cssProperty)); stylesSidebarPane.revealProperty(/** @type {!WebInspector.CSSProperty} */(cssProperty));
return Promise.resolve(); return Promise.resolve();
}, },
...@@ -902,9 +902,9 @@ WebInspector.ElementsPanel.prototype = { ...@@ -902,9 +902,9 @@ WebInspector.ElementsPanel.prototype = {
function tabSelected(event) function tabSelected(event)
{ {
var tabId = /** @type {string} */ (event.data.tabId); var tabId = /** @type {string} */ (event.data.tabId);
if (tabId === computedPane.title()) if (tabId === WebInspector.UIString("Computed"))
showMetrics.call(this, true); showMetrics.call(this, true);
else if (tabId === stylesPane.title()) else if (tabId === WebInspector.UIString("Styles"))
showMetrics.call(this, false); showMetrics.call(this, false);
} }
...@@ -918,7 +918,7 @@ WebInspector.ElementsPanel.prototype = { ...@@ -918,7 +918,7 @@ WebInspector.ElementsPanel.prototype = {
if (horizontally) { if (horizontally) {
this._splitWidget.installResizer(this.sidebarPaneView.headerElement()); this._splitWidget.installResizer(this.sidebarPaneView.headerElement());
var compositePane = new WebInspector.SidebarPane(this.sidebarPanes.styles.title()); var compositePane = new WebInspector.SidebarPane(WebInspector.UIString("Styles"));
compositePane.element.classList.add("composite"); compositePane.element.classList.add("composite");
compositePane.element.classList.add("fill"); compositePane.element.classList.add("fill");
...@@ -931,7 +931,7 @@ WebInspector.ElementsPanel.prototype = { ...@@ -931,7 +931,7 @@ WebInspector.ElementsPanel.prototype = {
computedPane.show(computedStylePanesWrapper.element); computedPane.show(computedStylePanesWrapper.element);
this.sidebarPaneView.addPane(compositePane); this.sidebarPaneView.addPane(compositePane);
} else { } else {
var stylesPane = new WebInspector.SidebarPane(this.sidebarPanes.styles.title()); var stylesPane = new WebInspector.SidebarPane(WebInspector.UIString("Styles"));
stylesPane.element.classList.add("composite", "fill", "metrics-and-styles"); stylesPane.element.classList.add("composite", "fill", "metrics-and-styles");
matchedStylesContainer.show(stylesPane.element); matchedStylesContainer.show(stylesPane.element);
...@@ -959,7 +959,7 @@ WebInspector.ElementsPanel.prototype = { ...@@ -959,7 +959,7 @@ WebInspector.ElementsPanel.prototype = {
this._addExtensionSidebarPane(extensionSidebarPanes[i]); this._addExtensionSidebarPane(extensionSidebarPanes[i]);
this._splitWidget.setSidebarWidget(this.sidebarPaneView); this._splitWidget.setSidebarWidget(this.sidebarPaneView);
this.sidebarPanes.styles.expand(); this.sidebarPanes.styles.expandPane();
if (selectedTabId) if (selectedTabId)
this.sidebarPaneView.selectTab(selectedTabId); this.sidebarPaneView.selectTab(selectedTabId);
......
...@@ -430,7 +430,7 @@ WebInspector.StylesSidebarPane.prototype = { ...@@ -430,7 +430,7 @@ WebInspector.StylesSidebarPane.prototype = {
*/ */
_addBlankSection: function(insertAfterSection, styleSheetId, ruleLocation) _addBlankSection: function(insertAfterSection, styleSheetId, ruleLocation)
{ {
this.expand(); this.expandPane();
var node = this.node(); var node = this.node();
var blankSection = new WebInspector.BlankStylePropertiesSection(this, insertAfterSection._matchedStyles, node ? WebInspector.DOMPresentationUtils.simpleSelector(node) : "", styleSheetId, ruleLocation, insertAfterSection._style); var blankSection = new WebInspector.BlankStylePropertiesSection(this, insertAfterSection._matchedStyles, node ? WebInspector.DOMPresentationUtils.simpleSelector(node) : "", styleSheetId, ruleLocation, insertAfterSection._style);
......
...@@ -303,7 +303,7 @@ WebInspector.EventListenerBreakpointsSidebarPane.prototype = { ...@@ -303,7 +303,7 @@ WebInspector.EventListenerBreakpointsSidebarPane.prototype = {
breakpointItem = this._findBreakpointItem(eventName, WebInspector.EventListenerBreakpointsSidebarPane.eventTargetAny); breakpointItem = this._findBreakpointItem(eventName, WebInspector.EventListenerBreakpointsSidebarPane.eventTargetAny);
if (!breakpointItem) if (!breakpointItem)
return; return;
this.expand(); this.expandPane();
breakpointItem.parent.element.expand(); breakpointItem.parent.element.expand();
breakpointItem.element.listItemElement.classList.add("breakpoint-hit"); breakpointItem.element.listItemElement.classList.add("breakpoint-hit");
this._highlightedElement = breakpointItem.element.listItemElement; this._highlightedElement = breakpointItem.element.listItemElement;
......
...@@ -113,7 +113,7 @@ WebInspector.JavaScriptBreakpointsSidebarPane.prototype = { ...@@ -113,7 +113,7 @@ WebInspector.JavaScriptBreakpointsSidebarPane.prototype = {
var breakpointItem = { element: element, checkbox: checkboxLabel.checkboxElement }; var breakpointItem = { element: element, checkbox: checkboxLabel.checkboxElement };
this._items.set(breakpoint, breakpointItem); this._items.set(breakpoint, breakpointItem);
this.expand(); this.expandPane();
}, },
/** /**
......
...@@ -87,7 +87,7 @@ WebInspector.SourcesPanel = function(workspaceForTest) ...@@ -87,7 +87,7 @@ WebInspector.SourcesPanel = function(workspaceForTest)
this.sidebarPanes.eventListenerBreakpoints = new WebInspector.EventListenerBreakpointsSidebarPane(); this.sidebarPanes.eventListenerBreakpoints = new WebInspector.EventListenerBreakpointsSidebarPane();
this.sidebarPanes.objectEventListeners = new WebInspector.ObjectEventListenersSidebarPane(); this.sidebarPanes.objectEventListeners = new WebInspector.ObjectEventListenersSidebarPane();
this._lastSelectedTabSetting = WebInspector.settings.createLocalSetting("lastSelectedSourcesSidebarPaneTab", this.sidebarPanes.scopechain.title()); this._lastSelectedTabSetting = WebInspector.settings.createLocalSetting("lastSelectedSourcesSidebarPaneTab", WebInspector.UIString("Scope"));
this._installDebuggerSidebarController(); this._installDebuggerSidebarController();
...@@ -1104,7 +1104,7 @@ WebInspector.SourcesPanel.prototype = { ...@@ -1104,7 +1104,7 @@ WebInspector.SourcesPanel.prototype = {
this._extensionSidebarPanesContainer = sidebarPaneStack; this._extensionSidebarPanesContainer = sidebarPaneStack;
this.sidebarPaneView = vbox; this.sidebarPaneView = vbox;
this.sidebarPanes.scopechain.expand(); this.sidebarPanes.scopechain.expandPane();
this.sidebarPanes.watchExpressions.expandIfNecessary(); this.sidebarPanes.watchExpressions.expandIfNecessary();
} else { } else {
var splitWidget = new WebInspector.SplitWidget(true, true, "sourcesPanelDebuggerSidebarSplitViewState", 0.5); var splitWidget = new WebInspector.SplitWidget(true, true, "sourcesPanelDebuggerSidebarSplitViewState", 0.5);
...@@ -1136,9 +1136,9 @@ WebInspector.SourcesPanel.prototype = { ...@@ -1136,9 +1136,9 @@ WebInspector.SourcesPanel.prototype = {
this._addExtensionSidebarPane(extensionSidebarPanes[i]); this._addExtensionSidebarPane(extensionSidebarPanes[i]);
this._splitWidget.setSidebarWidget(this.sidebarPaneView); this._splitWidget.setSidebarWidget(this.sidebarPaneView);
this.sidebarPanes.threads.expand(); this.sidebarPanes.threads.expandPane();
this.sidebarPanes.jsBreakpoints.expand(); this.sidebarPanes.jsBreakpoints.expandPane();
this.sidebarPanes.callstack.expand(); this.sidebarPanes.callstack.expandPane();
}, },
/** /**
......
...@@ -75,7 +75,7 @@ WebInspector.WatchExpressionsSidebarPane.prototype = { ...@@ -75,7 +75,7 @@ WebInspector.WatchExpressionsSidebarPane.prototype = {
*/ */
addExpression: function(expressionString) addExpression: function(expressionString)
{ {
this.expand(); this.expandPane();
if (this._requiresUpdate) { if (this._requiresUpdate) {
this._rebuildWatchExpressions(); this._rebuildWatchExpressions();
delete this._requiresUpdate; delete this._requiresUpdate;
...@@ -87,7 +87,7 @@ WebInspector.WatchExpressionsSidebarPane.prototype = { ...@@ -87,7 +87,7 @@ WebInspector.WatchExpressionsSidebarPane.prototype = {
expandIfNecessary: function() expandIfNecessary: function()
{ {
if (this._watchExpressionsSetting.get().length) if (this._watchExpressionsSetting.get().length)
this.expand(); this.expandPane();
}, },
_saveExpressions: function() _saveExpressions: function()
...@@ -116,7 +116,7 @@ WebInspector.WatchExpressionsSidebarPane.prototype = { ...@@ -116,7 +116,7 @@ WebInspector.WatchExpressionsSidebarPane.prototype = {
{ {
if (event) if (event)
event.consume(true); event.consume(true);
this.expand(); this.expandPane();
this._createWatchExpression(null).startEditing(); this._createWatchExpression(null).startEditing();
}, },
......
...@@ -52,7 +52,7 @@ WebInspector.XHRBreakpointsSidebarPane.prototype = { ...@@ -52,7 +52,7 @@ WebInspector.XHRBreakpointsSidebarPane.prototype = {
if (event) if (event)
event.consume(); event.consume();
this.expand(); this.expandPane();
var inputElementContainer = createElementWithClass("p", "breakpoint-condition"); var inputElementContainer = createElementWithClass("p", "breakpoint-condition");
inputElementContainer.textContent = WebInspector.UIString("Break when URL contains:"); inputElementContainer.textContent = WebInspector.UIString("Break when URL contains:");
...@@ -217,7 +217,7 @@ WebInspector.XHRBreakpointsSidebarPane.prototype = { ...@@ -217,7 +217,7 @@ WebInspector.XHRBreakpointsSidebarPane.prototype = {
var element = this._breakpointElements.get(url); var element = this._breakpointElements.get(url);
if (!element) if (!element)
return; return;
this.expand(); this.expandPane();
element.classList.add("breakpoint-hit"); element.classList.add("breakpoint-hit");
this._highlightedElement = element; this._highlightedElement = element;
}, },
......
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @constructor
* @param {string|!Node} title
* @param {string=} subtitle
*/
WebInspector.Section = function(title, subtitle)
{
this.element = createElementWithClass("div", "section");
this.element._section = this;
this.registerRequiredCSS("ui/section.css");
this.headerElement = createElementWithClass("div", "header monospace");
this.titleElement = createElementWithClass("div", "title");
this.subtitleElement = createElementWithClass("div", "subtitle");
this.headerElement.appendChild(this.subtitleElement);
this.headerElement.appendChild(this.titleElement);
this.headerElement.addEventListener("click", this.handleClick.bind(this), false);
this.element.appendChild(this.headerElement);
this.title = title;
if (subtitle) {
this._subtitle = subtitle;
this.subtitleElement.textContent = subtitle;
}
this._expanded = false;
}
WebInspector.Section.prototype = {
get title()
{
return this._title;
},
set title(x)
{
if (this._title === x)
return;
this._title = x;
if (x instanceof Node) {
this.titleElement.removeChildren();
this.titleElement.appendChild(x);
} else
this.titleElement.textContent = x;
},
get subtitle()
{
return this._subtitle;
},
get expanded()
{
return this._expanded;
},
repopulate: function()
{
this._populated = false;
if (this._expanded) {
this.onpopulate();
this._populated = true;
}
},
/**
* @protected
*/
onpopulate: function()
{
// Overridden by subclasses.
},
expand: function()
{
if (this._expanded)
return;
this._expanded = true;
this.element.classList.add("expanded");
if (!this._populated) {
this.onpopulate();
this._populated = true;
}
},
collapse: function()
{
if (!this._expanded)
return;
this._expanded = false;
this.element.classList.remove("expanded");
},
/**
* @param {string} cssFile
*/
registerRequiredCSS: function(cssFile)
{
WebInspector.appendStyle(this.element, cssFile);
},
/**
* @param {!Event} event
* @protected
*/
handleClick: function(event)
{
if (this._doNotExpandOnTitleClick)
return;
if (this._expanded)
this.collapse();
else
this.expand();
event.consume();
},
doNotExpandOnTitleClick: function()
{
this._doNotExpandOnTitleClick = true;
}
}
/**
* @constructor
* @extends {WebInspector.Section}
* @param {string|!Node} title
* @param {string=} subtitle
*/
WebInspector.PropertiesSection = function(title, subtitle)
{
WebInspector.Section.call(this, title, subtitle);
this.registerRequiredCSS("ui/propertiesSection.css");
this.propertiesTreeOutline = new TreeOutline(true);
this.propertiesElement = this.propertiesTreeOutline.element;
this.propertiesElement.classList.add("properties", "properties-tree", "monospace");
this.propertiesTreeOutline.setFocusable(false);
this.propertiesTreeOutline.section = this;
this.element.appendChild(this.propertiesElement);
}
WebInspector.PropertiesSection.prototype = {
__proto__: WebInspector.Section.prototype
}
...@@ -56,15 +56,7 @@ WebInspector.SidebarPane.prototype = { ...@@ -56,15 +56,7 @@ WebInspector.SidebarPane.prototype = {
return this._toolbar; return this._toolbar;
}, },
/** expandPane: function()
* @return {string}
*/
title: function()
{
return this._title;
},
expand: function()
{ {
this.onContentReady(); this.onContentReady();
}, },
...@@ -116,7 +108,7 @@ WebInspector.SidebarPaneTitle = function(container, pane) ...@@ -116,7 +108,7 @@ WebInspector.SidebarPaneTitle = function(container, pane)
this._pane = pane; this._pane = pane;
this.element = container.createChild("div", "sidebar-pane-title"); this.element = container.createChild("div", "sidebar-pane-title");
this.element.textContent = pane.title(); this.element.textContent = pane._title;
this.element.tabIndex = 0; this.element.tabIndex = 0;
this.element.addEventListener("click", this._toggleExpanded.bind(this), false); this.element.addEventListener("click", this._toggleExpanded.bind(this), false);
this.element.addEventListener("keydown", this._onTitleKeyDown.bind(this), false); this.element.addEventListener("keydown", this._onTitleKeyDown.bind(this), false);
...@@ -141,7 +133,7 @@ WebInspector.SidebarPaneTitle.prototype = { ...@@ -141,7 +133,7 @@ WebInspector.SidebarPaneTitle.prototype = {
if (this.element.classList.contains("expanded")) if (this.element.classList.contains("expanded"))
this._collapse(); this._collapse();
else else
this._pane.expand(); this._pane.expandPane();
}, },
/** /**
...@@ -213,7 +205,7 @@ WebInspector.SidebarTabbedPane.prototype = { ...@@ -213,7 +205,7 @@ WebInspector.SidebarTabbedPane.prototype = {
*/ */
addPane: function(pane) addPane: function(pane)
{ {
var title = pane.title(); var title = pane._title;
this.appendTab(title, title, pane); this.appendTab(title, title, pane);
if (pane._toolbar) if (pane._toolbar)
pane.element.insertBefore(pane._toolbar.element, pane.element.firstChild); pane.element.insertBefore(pane._toolbar.element, pane.element.firstChild);
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
"ReportView.js", "ReportView.js",
"RootView.js", "RootView.js",
"SearchableView.js", "SearchableView.js",
"Section.js",
"SettingsUI.js", "SettingsUI.js",
"SidebarTreeElement.js", "SidebarTreeElement.js",
"SoftContextMenu.js", "SoftContextMenu.js",
...@@ -68,11 +67,9 @@ ...@@ -68,11 +67,9 @@
"panelEnablerView.css", "panelEnablerView.css",
"popover.css", "popover.css",
"progressIndicator.css", "progressIndicator.css",
"propertiesSection.css",
"radioButton.css", "radioButton.css",
"reportView.css", "reportView.css",
"searchableView.css", "searchableView.css",
"section.css",
"sidebarPane.css", "sidebarPane.css",
"smallIcon.css", "smallIcon.css",
"softContextMenu.css", "softContextMenu.css",
......
/*
* Copyright (c) 2014 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
.properties-tree {
margin: 0;
padding: 0 6px 2px;
list-style: none;
min-height: 18px;
}
.properties-tree ol {
display: none;
margin: 0;
-webkit-padding-start: 12px;
list-style: none;
}
.properties-tree ol.expanded {
display: block;
}
.properties-tree li {
margin-left: 12px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
-webkit-user-select: text;
cursor: default;
padding-top: 2px;
line-height: 12px;
}
.properties-tree li.parent {
margin-left: 1px;
}
.properties-tree li.parent::before {
-webkit-user-select: none;
background-image: url(Images/toolbarButtonGlyphs.png);
background-size: 352px 168px;
opacity: 0.5;
content: "a";
width: 8px;
float: left;
margin-right: 4px;
color: transparent;
text-shadow: none;
}
@media (-webkit-min-device-pixel-ratio: 1.5) {
.properties-tree li.parent::before {
background-image: url(Images/toolbarButtonGlyphs_2x.png);
}
} /* media */
.properties-tree li.parent::before {
background-position: -4px -96px;
}
.properties-tree li.parent.expanded::before {
background-position: -20px -96px;
}
.properties-tree li .info {
padding-top: 4px;
padding-bottom: 3px;
}
.properties-tree li.editing {
margin-left: 10px;
text-overflow: clip;
}
.properties-tree li.editing-sub-part {
padding: 3px 6px 8px 18px;
margin: -1px -6px -8px -6px;
text-overflow: clip;
}
.properties-tree .name {
color: rgb(136, 19, 145);
flex-shrink: 0;
}
.properties-tree .separator {
flex-shrink: 0;
}
.properties-tree .dimmed {
opacity: 0.6;
}
.properties-tree .value.error {
color: red;
}
.properties-tree .number {
color: blue;
}
.properties-tree .keyword {
color: rgb(136, 19, 79);
}
.properties-tree .color {
color: rgb(118, 15, 21);
}
/*
* Copyright (c) 2014 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
.section {
position: relative;
margin-top: 1px;
}
.section > .header {
padding: 0 8px 0 5px;
min-height: 18px;
white-space: nowrap;
background-origin: padding-box;
background-clip: padding-box;
}
.section > .header::before {
-webkit-user-select: none;
background-image: url(Images/toolbarButtonGlyphs.png);
background-size: 352px 168px;
opacity: 0.5;
content: "a";
color: transparent;
text-shadow: none;
float: left;
width: 8px;
margin-right: 4px;
margin-top: 2px;
}
@media (-webkit-min-device-pixel-ratio: 1.5) {
.section > .header::before {
background-image: url(Images/toolbarButtonGlyphs_2x.png);
}
} /* media */
.section > .header::before {
background-position: -4px -96px;
}
.section.expanded > .header::before {
background-position: -20px -96px;
}
.section > .header .title {
font-weight: normal;
word-wrap: break-word;
white-space: normal;
line-height: 18px;
}
.section > .header label {
display: none;
}
.section.expanded .header label {
display: inline;
}
.section > .header .subtitle {
float: right;
margin-left: 5px;
max-width: 55%;
text-overflow: ellipsis;
overflow: hidden;
}
.section > .header .subtitle a {
color: inherit;
}
.section > .properties {
display: none;
}
.section.expanded > .properties {
display: block;
}
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