Skip to content

Commit

Permalink
DevTools: preserve computed properties expansion on Computed Style re…
Browse files Browse the repository at this point in the history
…-rendering

Today, when the computed styles widget gets updated, it collapses all the
previously expanded properties.

This patch preserves property expansion on computed style re-rendering.

BUG=623317
R=dgozman

Review-Url: https://codereview.chromium.org/2152313002
Cr-Commit-Position: refs/heads/master@{#405929}
  • Loading branch information
aslushnikov authored and Commit bot committed Jul 16, 2016
1 parent b7f33c1 commit e1f4c5a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions front_end/elements/ComputedStyleWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ WebInspector.ComputedStyleWidget.prototype = {
*/
_innerRebuildUpdate: function(nodeStyle, matchedStyles)
{
/** @type {!Set<string>} */
var expandedProperties = new Set();
for (var treeElement of this._propertiesOutline.rootElement().children()) {
if (!treeElement.expanded)
continue;
var propertyName = treeElement[WebInspector.ComputedStyleWidget._propertySymbol].name;
expandedProperties.add(propertyName);
}
this._propertiesOutline.removeChildren();
this._linkifier.reset();
var cssModel = this._computedStyleModel.cssModel();
Expand Down Expand Up @@ -213,6 +221,8 @@ WebInspector.ComputedStyleWidget.prototype = {
treeElement.listItemElement.addEventListener("click", handleClick.bind(null, treeElement), false);
var gotoSourceElement = propertyValueElement.createChild("div", "goto-source-icon");
gotoSourceElement.addEventListener("click", this._navigateToSource.bind(this, activeProperty));
if (expandedProperties.has(propertyName))
treeElement.expand();
}
}

Expand Down

0 comments on commit e1f4c5a

Please sign in to comment.