Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js | 
| diff --git a/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js b/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js | 
| index 99e46546a0beff60193852d0a43a369db5af30a7..b78042db92476f3c2be904781b067b3b892f47e0 100644 | 
| --- a/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js | 
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js | 
| @@ -319,6 +319,10 @@ UI.TreeElement = class { | 
| this.previousSibling = null; | 
| this.nextSibling = null; | 
| + // Adjust to allow computing margin-left for the selection element. | 
| + // Check the padding-left for the li element for correct value. | 
| + this.paddingSize = 0; | 
| + | 
| this._listItemNode = createElement('li'); | 
| this._titleElement = this._listItemNode.createChild('span', 'tree-element-title'); | 
| this._listItemNode.treeElement = this; | 
| @@ -752,11 +756,26 @@ UI.TreeElement = class { | 
| } | 
| } | 
| + /** | 
| + * @return {number} | 
| + */ | 
| + computeLeftMargin() { | 
| + var treeElement = this.parent; | 
| + var depth = 0; | 
| + while (treeElement !== null) { | 
| + depth++; | 
| + treeElement = treeElement.parent; | 
| 
 
dgozman
2017/01/18 16:06:08
Shouldn't we sum up all paddingSize for parent ele
 
aboxhall
2017/01/19 00:23:05
Done.
 
 | 
| + } | 
| + | 
| + return -(this.paddingSize * (depth - 1) + 4); | 
| + } | 
| + | 
| _ensureSelection() { | 
| if (!this.treeOutline || !this.treeOutline._renderSelection) | 
| return; | 
| if (!this._selectionElement) | 
| this._selectionElement = createElementWithClass('div', 'selection fill'); | 
| + this._selectionElement.style.setProperty('margin-left', this.computeLeftMargin() + 'px'); | 
| 
 
dgozman
2017/01/18 16:06:08
Don't even set this value when it's zero by defaul
 
aboxhall
2017/01/19 00:23:05
Done.
 
 | 
| this._listItemNode.insertBefore(this._selectionElement, this.listItemElement.firstChild); | 
| } |