Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1557)

Unified Diff: Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 944343002: DevTools: migrate treeoutline from hasChildren to is/setExpandable(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/elements/StylesSidebarPane.js
diff --git a/Source/devtools/front_end/elements/StylesSidebarPane.js b/Source/devtools/front_end/elements/StylesSidebarPane.js
index 944f663eb5751f98d34b480885138f09bbcd454d..f0254e9d806a85d18aca7d635ba81b5be1d9bb89 100644
--- a/Source/devtools/front_end/elements/StylesSidebarPane.js
+++ b/Source/devtools/front_end/elements/StylesSidebarPane.js
@@ -2581,9 +2581,9 @@ WebInspector.BlankStylePropertiesSection.prototype = {
* @param {!WebInspector.CSSProperty} property
* @param {boolean} inherited
* @param {boolean} overloaded
- * @param {boolean} hasChildren
+ * @param {boolean} expandable
*/
-WebInspector.StylePropertyTreeElementBase = function(styleRule, property, inherited, overloaded, hasChildren)
+WebInspector.StylePropertyTreeElementBase = function(styleRule, property, inherited, overloaded, expandable)
{
this._styleRule = styleRule;
this.property = property;
@@ -2591,7 +2591,7 @@ WebInspector.StylePropertyTreeElementBase = function(styleRule, property, inheri
this._overloaded = overloaded;
// Pass an empty title, the title gets made later in onattach.
- TreeElement.call(this, "", hasChildren);
+ TreeElement.call(this, "", expandable);
this.selectable = false;
}
@@ -2808,7 +2808,6 @@ WebInspector.StylePropertyTreeElementBase.prototype = {
if (!this.parsedOk) {
// Avoid having longhands under an invalid shorthand.
- this.hasChildren = false;
this.listItemElement.classList.add("not-parsed-ok");
// Add a separate exclamation mark IMG element with a tooltip.
@@ -3217,13 +3216,13 @@ WebInspector.StylePropertyTreeElement.prototype = {
/** @type {!WebInspector.StylePropertyTreeElement.Context} */
var context = {
expanded: this.expanded,
- hasChildren: this.hasChildren,
+ hasChildren: this.isExpandable(),
isEditingName: isEditingName,
previousContent: selectElement.textContent
};
// Lie about our children to prevent expanding on double click and to collapse shorthands.
- this.hasChildren = false;
+ this.setExpandable(false);
if (selectElement.parentElement)
selectElement.parentElement.classList.add("child-editing");
@@ -3414,7 +3413,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
{
this._resetMouseDownElement();
- this.hasChildren = context.hasChildren;
+ this.setExpandable(context.hasChildren);
if (context.expanded)
this.expand();
var editedElement = context.isEditingName ? this.nameElement : this.valueElement;

Powered by Google App Engine
This is Rietveld 408576698