Commit 4bacc71d authored by Alexey Kozyatinskiy's avatar Alexey Kozyatinskiy Committed by Commit Bot

[DevTools] always activate first callFrame on pause

R=lushnikov@chromium.org

Bug: none
Change-Id: Ifae8faddcd5d719011cd53289067d4f2f7ca958c
Reviewed-on: https://chromium-review.googlesource.com/1172706Reviewed-by: default avatarAndrey Lushnikov <lushnikov@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582796}
parent 39eca9d4
...@@ -164,7 +164,8 @@ Sources.CallStackSidebarPane = class extends UI.SimpleView { ...@@ -164,7 +164,8 @@ Sources.CallStackSidebarPane = class extends UI.SimpleView {
this._muteActivateItem = true; this._muteActivateItem = true;
if (!this._showBlackboxed && this._items.every(item => item.isBlackboxed)) { if (!this._showBlackboxed && this._items.every(item => item.isBlackboxed)) {
this._showBlackboxed = true; this._showBlackboxed = true;
this._items.replaceAll(Array.from(this._items)); for (let i = 0; i < this._items.length; ++i)
this._list.refreshItemByIndex(i);
this._blackboxedMessageElement.classList.toggle('hidden', true); this._blackboxedMessageElement.classList.toggle('hidden', true);
} else { } else {
const itemsSet = new Set(items); const itemsSet = new Set(items);
...@@ -172,7 +173,7 @@ Sources.CallStackSidebarPane = class extends UI.SimpleView { ...@@ -172,7 +173,7 @@ Sources.CallStackSidebarPane = class extends UI.SimpleView {
for (let i = 0; i < this._items.length; ++i) { for (let i = 0; i < this._items.length; ++i) {
const item = this._items.at(i); const item = this._items.at(i);
if (itemsSet.has(item)) if (itemsSet.has(item))
this._items.replace(i, item); this._list.refreshItemByIndex(i);
hasBlackboxed = hasBlackboxed || item.isBlackboxed; hasBlackboxed = hasBlackboxed || item.isBlackboxed;
} }
this._blackboxedMessageElement.classList.toggle('hidden', this._showBlackboxed || !hasBlackboxed); this._blackboxedMessageElement.classList.toggle('hidden', this._showBlackboxed || !hasBlackboxed);
......
...@@ -136,6 +136,14 @@ UI.ListControl = class { ...@@ -136,6 +136,14 @@ UI.ListControl = class {
console.error('Item to refresh is not present'); console.error('Item to refresh is not present');
return; return;
} }
this.refreshItemByIndex(index);
}
/**
* @param {number} index
*/
refreshItemByIndex(index) {
const item = this._model.at(index);
this._itemToElement.delete(item); this._itemToElement.delete(item);
this.invalidateRange(index, index + 1); this.invalidateRange(index, index + 1);
if (this._selectedIndex !== -1) if (this._selectedIndex !== -1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment