Bug 151149

Summary: Web Inspector: blank debugger tab when opening inspector on unvisited website
Product: WebKit Reporter: BJ Burg <bburg>
Component: Web InspectorAssignee: BJ Burg <bburg>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

Description BJ Burg 2015-11-11 12:52:19 PST
.
Comment 1 Radar WebKit Bug Importer 2015-11-11 12:52:31 PST
<rdar://problem/23504427>
Comment 2 BJ Burg 2015-11-11 13:26:35 PST
SUMMARY:

* Sometimes we don't show anything in the main content view of Debugger tab, even when there are resources in the sidebar that could be shown.

STEPS TO REPRODUCE:

* Open the inspector on any page, select the Debugger Tab.
* Close the inspector
* Navigate to a page for which the inspector has never been opened
* Open the inspector

EXPECTED:

* Content view should show the first eligible resource in the debugger sidebar.

ACTUAL:

* Nothing in the sidebar is selected, the main content view is empty.
Comment 3 BJ Burg 2015-11-11 15:03:28 PST
Notes:

 * It seems that at the time when we try to show default content (WebInspector.contentLoaded calls shown() on the active tab), there are no eligible resources added to the tree. So, showDefaultContentView finds no tree elements it can show.


There are two options I see:

 1. inside finalAttemptToRestoreViewStateFromCookie, call showDefaultContentView again if the cookie is empty. This would show some view after the final attempt timeout, which is 300ms or so.

 2. when we add tree elements to the DebuggerSidebarPanel, if there's nothing being shown and there's no cookie pending for restore, show it as the default content.
Comment 4 BJ Burg 2015-11-11 16:27:20 PST
Created attachment 265334 [details]
Patch
Comment 5 Joseph Pecoraro 2015-11-11 17:17:13 PST
Comment on attachment 265334 [details]
Patch

This sounds good to me. It seems a bit arbitrary, but better than a blank view!
Comment 6 WebKit Commit Bot 2015-11-11 19:13:39 PST
Comment on attachment 265334 [details]
Patch

Clearing flags on attachment: 265334

Committed r192344: <http://trac.webkit.org/changeset/192344>
Comment 7 WebKit Commit Bot 2015-11-11 19:13:44 PST
All reviewed patches have been landed.  Closing bug.