Skip to content
Permalink
Browse files
Web Inspector: Uncaught Exception: Missing node for given nodeId
https://bugs.webkit.org/show_bug.cgi?id=216067
<rdar://problem/68520144>

Reviewed by Devin Rousso.

* UserInterface/Views/ContentBrowserTabContentView.js:
(WI.ContentBrowserTabContentView.prototype.showDetailsSidebarPanels):
Rewrite `showDetailsSidebarPanels` in such way that causes no more than one change of selectedSidebarPanel.
Previously, `removeSidebarPanel` would cause the change of selectedSidebarPanel, resulting in showing
a panel with outdated `this.domNode`.

* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
Display a useful error with a relevant location instead of a generic Connection.js error.

* UserInterface/Views/Sidebar.js:
(WI.Sidebar.prototype.removeSidebarPanel):
After removing a panel, don't select the nearest panel. There doesn't seem to be a useful case for it.
The selected panel is determined at the removeSidebarPanel callsites.


Canonical link: https://commits.webkit.org/229593@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
NV committed Sep 21, 2020
1 parent e6a90c8 commit 652c3fa202f480c3f6ff695fbaaadf8404c3d00e
Showing 4 changed files with 34 additions and 8 deletions.
@@ -1,3 +1,25 @@
2020-09-21 Nikita Vasilyev <nvasilyev@apple.com>

Web Inspector: Uncaught Exception: Missing node for given nodeId
https://bugs.webkit.org/show_bug.cgi?id=216067
<rdar://problem/68520144>

Reviewed by Devin Rousso.

* UserInterface/Views/ContentBrowserTabContentView.js:
(WI.ContentBrowserTabContentView.prototype.showDetailsSidebarPanels):
Rewrite `showDetailsSidebarPanels` in such way that causes no more than one change of selectedSidebarPanel.
Previously, `removeSidebarPanel` would cause the change of selectedSidebarPanel, resulting in showing
a panel with outdated `this.domNode`.

* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
Display a useful error with a relevant location instead of a generic Connection.js error.

* UserInterface/Views/Sidebar.js:
(WI.Sidebar.prototype.removeSidebarPanel):
After removing a panel, don't select the nearest panel. There doesn't seem to be a useful case for it.
The selected panel is determined at the removeSidebarPanel callsites.

2020-09-21 Patrick Angle <pangle@apple.com>

Web Inspector: Timelines: remove "stop requested" marker
@@ -177,6 +177,7 @@ WI.ContentBrowserTabContentView = class ContentBrowserTabContentView extends WI.
this._ignoreDetailsSidebarPanelCollapsedEvent = true;

let hiddenSidebarPanels = 0;
let sidebarPanelToSelect = null;

for (var i = 0; i < this.detailsSidebarPanels.length; ++i) {
var sidebarPanel = this.detailsSidebarPanels[i];
@@ -192,7 +193,7 @@ WI.ContentBrowserTabContentView = class ContentBrowserTabContentView extends WI.

if (this._lastSelectedDetailsSidebarPanelSetting.value === sidebarPanel.identifier) {
// Restore the sidebar panel selection if this sidebar panel was the last one selected by the user.
WI.detailsSidebar.selectedSidebarPanel = sidebarPanel;
sidebarPanelToSelect = sidebarPanel;
}
} else {
// The sidebar panel can't inspect the current represented objects, so remove the panel and hide the toolbar item.
@@ -201,7 +202,9 @@ WI.ContentBrowserTabContentView = class ContentBrowserTabContentView extends WI.
}
}

if (!WI.detailsSidebar.selectedSidebarPanel && WI.detailsSidebar.sidebarPanels.length)
if (sidebarPanelToSelect)
WI.detailsSidebar.selectedSidebarPanel = sidebarPanelToSelect;
else if (!WI.detailsSidebar.selectedSidebarPanel && WI.detailsSidebar.sidebarPanels.length)
WI.detailsSidebar.selectedSidebarPanel = WI.detailsSidebar.sidebarPanels[0];

if (!WI.detailsSidebar.sidebarPanels.length)
@@ -262,6 +262,12 @@ WI.DOMNodeDetailsSidebarPanel = class DOMNodeDetailsSidebarPanel extends WI.DOMD
const args = undefined;
const generatePreview = false;
object.callFunction(inspectedPage_node_collectPrototypes, args, generatePreview, nodePrototypesReady.bind(this));
}).catch((error) => {
// Bail if the DOM node changed while we were waiting for the async response.
if (this.domNode !== domNode)
return;

console.assert(false, "Cannot resolve node.", error, domNode);
});

function nodePrototypesReady(error, object, wasThrown)
@@ -87,7 +87,7 @@ WI.Sidebar = class Sidebar extends WI.View

removeSidebarPanel(sidebarPanelOrIdentifierOrIndex)
{
var sidebarPanel = this.findSidebarPanel(sidebarPanelOrIdentifierOrIndex);
let sidebarPanel = this.findSidebarPanel(sidebarPanelOrIdentifierOrIndex);
if (!sidebarPanel)
return;

@@ -96,11 +96,6 @@ WI.Sidebar = class Sidebar extends WI.View

sidebarPanel.selected = false;

if (this._selectedSidebarPanel === sidebarPanel) {
var index = this._sidebarPanels.indexOf(sidebarPanel);
this.selectedSidebarPanel = this._sidebarPanels[index - 1] || this._sidebarPanels[index + 1] || null;
}

this._sidebarPanels.remove(sidebarPanel);

if (this._navigationBar) {

0 comments on commit 652c3fa

Please sign in to comment.