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

Unified Diff: third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleWidget.js

Issue 2152313002: DevTools: preserve computed properties expansion on Computed Style re-rendering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/elements/styles-3/computed-properties-retain-expanded-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleWidget.js
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleWidget.js b/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleWidget.js
index 15e246aa702ba75a438251a7a50ecc906ad3c7da..f0100c6c94cf83a07e06229dfdbd78cd04927aba 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleWidget.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleWidget.js
@@ -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();
@@ -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))
dgozman 2016/07/16 01:14:56 Why is this inside "if (trace)" block?
lushnikov 2016/07/16 03:47:48 Only properties with traces are expandable; others
+ treeElement.expand();
}
}
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/elements/styles-3/computed-properties-retain-expanded-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698