Bug 158069 - Web Inspector: sometimes reloading a page with main resource selected will show an empty content view
Summary: Web Inspector: sometimes reloading a page with main resource selected will sh...
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: Joseph Pecoraro
URL: http://bl.ocks.org/syntagmatic/raw/6c...
Keywords: InRadar
: 158402 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-05-25 06:36 PDT by Brian Burg
Modified: 2016-07-06 13:25 PDT (History)
7 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (4.83 KB, patch)
2016-07-05 18:47 PDT, Joseph Pecoraro
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Burg 2016-05-25 06:36:55 PDT
STEPS TO REPRODUCE:

0. Go to http://bl.ocks.org/syntagmatic/raw/6c149c08fc9cde682635/iridium-33-debris.html
1. Open Resources tab.
2. Select the main resource (iridium-33-debris.hmtl)
3. Reload with Cmd-R

EXPECTED:

The main resource tree element is re-selected when available and shows its HTML in editor

ACTUAL:

A blank content view is shown about 50% of the time.

NOTES:

Whether it reprouces or not seems related to resource load ordering. Try clearing caches between loads if it doesn't repro.
Comment 1 Joseph Pecoraro 2016-05-25 11:13:20 PDT
I've noticed this too. I think it has to do with a background tab, thinking it is visible, steals the SourceCodeTextEditor from the actual visible tab... I haven't verified this yet though.
Comment 2 Joseph Pecoraro 2016-05-25 11:13:54 PDT
I have that suspicious because I think switching tabs and switching back fixes the issue.
Comment 3 Brian Burg 2016-05-27 07:18:43 PDT
Ping for import.
Comment 4 Radar WebKit Bug Importer 2016-05-27 07:22:54 PDT
<rdar://problem/26516710>
Comment 5 Timothy Hatcher 2016-06-07 10:28:17 PDT
*** Bug 158402 has been marked as a duplicate of this bug. ***
Comment 6 Joseph Pecoraro 2016-07-05 18:47:54 PDT
Created attachment 282834 [details]
[PATCH] Proposed Fix

This isn't an ideal fix, but it addresses this situation and didn't introduce any regressions with my testing.
Comment 7 Timothy Hatcher 2016-07-05 20:26:50 PDT
Comment on attachment 282834 [details]
[PATCH] Proposed Fix

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

> Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js:213
> +        if (WebInspector.navigationSidebar.selectedSidebarPanel !== this) {

Do sidebar panels have a parent property? Could this be if (this.selected) or if (this.parent.selectedSidebarPanel === this)? That would avoid the layer violation.
Comment 8 Timothy Hatcher 2016-07-06 10:53:04 PDT
Comment on attachment 282834 [details]
[PATCH] Proposed Fix

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

>> Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js:213
>> +        if (WebInspector.navigationSidebar.selectedSidebarPanel !== this) {
> 
> Do sidebar panels have a parent property? Could this be if (this.selected) or if (this.parent.selectedSidebarPanel === this)? That would avoid the layer violation.

Now that I can look at the code, this should be written as:

if (this.selected)

Or

if (this.parentSidebar.selectedSidebarPanel === this)
Comment 9 Joseph Pecoraro 2016-07-06 13:17:37 PDT
(In reply to comment #8)
> Comment on attachment 282834 [details]
> [PATCH] Proposed Fix
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=282834&action=review
> 
> >> Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js:213
> >> +        if (WebInspector.navigationSidebar.selectedSidebarPanel !== this) {
> > 
> > Do sidebar panels have a parent property? Could this be if (this.selected) or if (this.parent.selectedSidebarPanel === this)? That would avoid the layer violation.
> 
> Now that I can look at the code, this should be written as:
> 
> if (this.selected)

Much better!
Comment 10 Joseph Pecoraro 2016-07-06 13:25:17 PDT
<https://trac.webkit.org/changeset/202876>