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 c8f4645b1693cbbd22c23c00b5400f4d6d283ef2..2cdf83aaa1e72e68149b7ebe0c0f4a483d3fdd15 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js |
| @@ -286,6 +286,28 @@ TreeOutline.prototype = { |
| event.consume(true); |
| }, |
| + /** |
| + * @param {!TreeElement} treeElement |
| + */ |
| + _deferredScrollIntoView: function(treeElement) |
| + { |
| + if (!this._treeElementToScrollIntoView) |
| + this.element.window().requestAnimationFrame(deferredScrollIntoView.bind(this)); |
| + this._treeElementToScrollIntoView = treeElement; |
| + /** |
| + * @this {TreeOutline} |
| + */ |
| + function deferredScrollIntoView() |
| + { |
| + var treeElement = this._treeElementToScrollIntoView; |
| + delete this._treeElementToScrollIntoView; |
| + if (treeElement.treeOutline !== this || !treeElement.listItemElement) |
|
pfeldman
2015/11/20 22:48:52
nuke those
|
| + return; |
| + treeElement.listItemElement.scrollIntoViewIfNeeded(); |
| + treeElement.onreveal(); |
| + } |
| + }, |
| + |
| __proto__: WebInspector.Object.prototype |
| } |
| @@ -861,9 +883,12 @@ TreeElement.prototype = { |
| currentAncestor = currentAncestor.parent; |
| } |
| - this.listItemElement.scrollIntoViewIfNeeded(); |
| + this.treeOutline._deferredScrollIntoView(this); |
| + }, |
| - this.onreveal(); |
|
pfeldman
2015/11/20 22:48:52
I think you want it there synchronously.
|
| + _deferredScrollIntoView: function() |
|
pfeldman
2015/11/20 22:48:52
unused
|
| + { |
| + this.listItemElement.scrollIntoViewIfNeeded(); |
| }, |
| /** |