⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 267379 in webkit


Ignore:
Timestamp:
Sep 21, 2020, 4:09:18 PM (6 years ago)
Author:
Nikita Vasilyev
Message:

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.

Location:
trunk/Source/WebInspectorUI
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r267360 r267379  
     12020-09-21  Nikita Vasilyev  <nvasilyev@apple.com>
     2
     3        Web Inspector: Uncaught Exception: Missing node for given nodeId
     4        https://bugs.webkit.org/show_bug.cgi?id=216067
     5        <rdar://problem/68520144>
     6
     7        Reviewed by Devin Rousso.
     8
     9        * UserInterface/Views/ContentBrowserTabContentView.js:
     10        (WI.ContentBrowserTabContentView.prototype.showDetailsSidebarPanels):
     11        Rewrite `showDetailsSidebarPanels` in such way that causes no more than one change of selectedSidebarPanel.
     12        Previously, `removeSidebarPanel` would cause the change of selectedSidebarPanel, resulting in showing
     13        a panel with outdated `this.domNode`.
     14
     15        * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
     16        Display a useful error with a relevant location instead of a generic Connection.js error.
     17
     18        * UserInterface/Views/Sidebar.js:
     19        (WI.Sidebar.prototype.removeSidebarPanel):
     20        After removing a panel, don't select the nearest panel. There doesn't seem to be a useful case for it.
     21        The selected panel is determined at the removeSidebarPanel callsites.
     22
    1232020-09-21  Patrick Angle  <pangle@apple.com>
    224
  • trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js

    r257759 r267379  
    178178
    179179        let hiddenSidebarPanels = 0;
     180        let sidebarPanelToSelect = null;
    180181
    181182        for (var i = 0; i < this.detailsSidebarPanels.length; ++i) {
     
    193194                if (this._lastSelectedDetailsSidebarPanelSetting.value === sidebarPanel.identifier) {
    194195                    // Restore the sidebar panel selection if this sidebar panel was the last one selected by the user.
    195                     WI.detailsSidebar.selectedSidebarPanel = sidebarPanel;
     196                    sidebarPanelToSelect = sidebarPanel;
    196197                }
    197198            } else {
     
    202203        }
    203204
    204         if (!WI.detailsSidebar.selectedSidebarPanel && WI.detailsSidebar.sidebarPanels.length)
     205        if (sidebarPanelToSelect)
     206            WI.detailsSidebar.selectedSidebarPanel = sidebarPanelToSelect;
     207        else if (!WI.detailsSidebar.selectedSidebarPanel && WI.detailsSidebar.sidebarPanels.length)
    205208            WI.detailsSidebar.selectedSidebarPanel = WI.detailsSidebar.sidebarPanels[0];
    206209
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js

    r266975 r267379  
    263263            const generatePreview = false;
    264264            object.callFunction(inspectedPage_node_collectPrototypes, args, generatePreview, nodePrototypesReady.bind(this));
     265        }).catch((error) => {
     266            // Bail if the DOM node changed while we were waiting for the async response.
     267            if (this.domNode !== domNode)
     268                return;
     269
     270            console.assert(false, "Cannot resolve node.", error, domNode);
    265271        });
    266272
  • trunk/Source/WebInspectorUI/UserInterface/Views/Sidebar.js

    r262307 r267379  
    8888    removeSidebarPanel(sidebarPanelOrIdentifierOrIndex)
    8989    {
    90         var sidebarPanel = this.findSidebarPanel(sidebarPanelOrIdentifierOrIndex);
     90        let sidebarPanel = this.findSidebarPanel(sidebarPanelOrIdentifierOrIndex);
    9191        if (!sidebarPanel)
    9292            return;
     
    9696
    9797        sidebarPanel.selected = false;
    98 
    99         if (this._selectedSidebarPanel === sidebarPanel) {
    100             var index = this._sidebarPanels.indexOf(sidebarPanel);
    101             this.selectedSidebarPanel = this._sidebarPanels[index - 1] || this._sidebarPanels[index + 1] || null;
    102         }
    10398
    10499        this._sidebarPanels.remove(sidebarPanel);
Note: See TracChangeset for help on using the changeset viewer.