| 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..b32588bfc35d12c21b9acd67704fa02f180d61d7 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js
|
| @@ -51,6 +51,10 @@ UI.TreeOutline = class extends Common.Object {
|
|
|
| this.element = this.contentElement;
|
|
|
| + // Adjust to allow computing margin-left for the selection element.
|
| + // Check the padding-left for the li element for correct value.
|
| + this._paddingSize = 0;
|
| +
|
| /**
|
| * @param {boolean} isFocused
|
| * @this {UI.TreeOutline}
|
| @@ -209,6 +213,13 @@ UI.TreeOutline = class extends Common.Object {
|
| }
|
|
|
| /**
|
| + * @param {number} paddingSize
|
| + */
|
| + setPaddingSize(paddingSize) {
|
| + this._paddingSize = paddingSize;
|
| + }
|
| +
|
| + /**
|
| * @param {!Event} event
|
| */
|
| _treeKeyDown(event) {
|
| @@ -752,11 +763,27 @@ UI.TreeElement = class {
|
| }
|
| }
|
|
|
| + /**
|
| + * @return {number}
|
| + */
|
| + computeLeftMargin() {
|
| + var treeElement = this.parent;
|
| + var depth = 0;
|
| + while (treeElement !== null) {
|
| + depth++;
|
| + treeElement = treeElement.parent;
|
| + }
|
| +
|
| + return -(this.treeOutline._paddingSize * (depth - 1) + 4);
|
| + }
|
| +
|
| _ensureSelection() {
|
| if (!this.treeOutline || !this.treeOutline._renderSelection)
|
| return;
|
| if (!this._selectionElement)
|
| this._selectionElement = createElementWithClass('div', 'selection fill');
|
| + if (this.treeOutline._paddingSize)
|
| + this._selectionElement.style.setProperty('margin-left', this.computeLeftMargin() + 'px');
|
| this._listItemNode.insertBefore(this._selectionElement, this.listItemElement.firstChild);
|
| }
|
|
|
|
|