Bug 144662 - Web Inspector: SourceCodeTextEditor shows "undefined" instead of resource content when pausing during resource load
Summary: Web Inspector: SourceCodeTextEditor shows "undefined" instead of resource con...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-05-05 21:12 PDT by Joseph Pecoraro
Modified: 2015-05-06 00:08 PDT (History)
9 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (4.79 KB, patch)
2015-05-05 21:33 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-05-05 21:12:02 PDT
* SUMMARY
SourceCodeTextEditor shows "undefined" instead of resource content when pausing during resource load

* STEPS TO REPRODUCE
1. Inspect <http://bogojoker.com/shell/>
2. Set a breakpoint on easySlider.min.js:2
3. Reload the page
  => Script content loads, then goes undefined
Comment 1 Radar WebKit Bug Importer 2015-05-05 21:12:16 PDT
<rdar://problem/20831216>
Comment 2 Joseph Pecoraro 2015-05-05 21:14:43 PDT
There are a few issues at play here.

This is the "pause during load" scenario. The frontend doesn't yet have the Resource, but it has the Script.

1. The Frontend successfully loads the Script contents. But the Resource content load overwrites the editor with a fail message.

2. ResourceContentView.js does:
> resource.requestContent().then(this._contentAvailable.bind(this)).catch(this._contentError.bind(this));

  - The promise can succeed with an error in which case it calls _contentError with an object.
  - The promise can fail with an error in which case it calls _contentError with a string.

This inconsistency results in the "undefined" message instead of the expected "No data found for resource with given identifier" message here.
Comment 3 Joseph Pecoraro 2015-05-05 21:33:59 PDT
Created attachment 252445 [details]
[PATCH] Proposed Fix
Comment 4 WebKit Commit Bot 2015-05-06 00:08:16 PDT
Comment on attachment 252445 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 252445

Committed r183863: <http://trac.webkit.org/changeset/183863>
Comment 5 WebKit Commit Bot 2015-05-06 00:08:20 PDT
All reviewed patches have been landed.  Closing bug.