Bug 216942 - REGRESSION(r267379): Web Inspector: Sources navigation sidebar is empty every other time it's selected
Summary: REGRESSION(r267379): Web Inspector: Sources navigation sidebar is empty every...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-09-24 12:57 PDT by Nikita Vasilyev
Modified: 2020-09-24 14:47 PDT (History)
5 users (show)

See Also:


Attachments
[Image] Bug (379.22 KB, image/png)
2020-09-24 12:57 PDT, Nikita Vasilyev
no flags Details
Patch (1.72 KB, patch)
2020-09-24 13:30 PDT, Nikita Vasilyev
bburg: review+
bburg: commit-queue-
Details | Formatted Diff | Diff
[Video] With patch applied (7.74 MB, video/quicktime)
2020-09-24 13:37 PDT, Nikita Vasilyev
no flags Details
Patch (1.72 KB, patch)
2020-09-24 14:10 PDT, Nikita Vasilyev
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2020-09-24 12:57:41 PDT
Created attachment 409615 [details]
[Image] Bug

Steps:
1. Select Sources tab
2. Select Elements tab
3. Select Sources tab

Expected:
Sources navigation sidebar shouldn't be empty on step 1 or 3.
Comment 1 Radar WebKit Bug Importer 2020-09-24 12:58:06 PDT
<rdar://problem/69520398>
Comment 2 Nikita Vasilyev 2020-09-24 13:08:42 PDT
TabBrowser.js:407

        this._navigationSidebar.addSidebarPanel(navigationSidebarPanel);

this._navigationSidebar._sidebarPanels is [] here.
Comment 3 Nikita Vasilyev 2020-09-24 13:30:09 PDT
Created attachment 409617 [details]
Patch
Comment 4 Nikita Vasilyev 2020-09-24 13:37:21 PDT
Created attachment 409618 [details]
[Video] With patch applied
Comment 5 BJ Burg 2020-09-24 14:02:16 PDT
Comment on attachment 409617 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=409617&action=review

r=me with some copyediting

> Source/WebInspectorUI/UserInterface/Views/Sidebar.js:75
> +        console.assert(!(sidebarPanel.parentSidebar && sidebarPanel.parentSidebar !== this), "sidebarPanel already has a different parentSidebar", sidebarPanel);

The assertion message seems incorrect, it could assert if sidebarPanel.parentSidebar is falsy as well.

How about a simpler message "Failed to insert sidebar panel". We'd be able to infer which condition failed from looking at the `sidebarPanel` argument, so a more specific message is unnecessary.
Comment 6 Nikita Vasilyev 2020-09-24 14:10:31 PDT
Created attachment 409620 [details]
Patch
Comment 7 EWS 2020-09-24 14:47:49 PDT
Committed r267546: <https://trac.webkit.org/changeset/267546>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 409620 [details].