Fixes an issue where the source for a resource that had errors would
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Apr 2008 21:47:07 +0000 (21:47 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Apr 2008 21:47:07 +0000 (21:47 +0000)
commitbb371b606c996b0e519f05f987f44b6ba5fa1d0b
tree97fa8ec24e8b63440890ad776941998d11ef50af
parent05bd8012d6e67e5642d902c97cd557efdf6dd990
Fixes an issue where the source for a resource that had errors would
not be shown because the view was created before the resource load
finished. The right view is now created, even if the resource isn't
finished. The SourceView just makes sure to not load the source until
the resource is finished. Only if the category changes, does the view
need to be recreated.

Reviewed by Adam Roben.

* page/inspector/Resource.js:
(WebInspector.Resource.prototype.set category): Call recreateViewForResourceIfNeeded.
* page/inspector/ResourcesPanel.js:
(WebInspector.ResourcesPanel.prototype.recreateViewForResourceIfNeeded):
Added. Tries to make a new view, if the view is the same prototype of the
previous view, return early. If they differ, close and detach the old view
and associate the resource with the new view. Calling updateErrorsAndWarnings
is needed, because the errors and warnings that might have been added to the
previous view will be lost, so make the tree element match.
(WebInspector.Resource.prototype._createResourceView): Always create a view
that matches the resource category. Ignore the loading and failed status.
* page/inspector/SourceView.js:
(WebInspector.SourceView.prototype.setupSourceFrameIfNeeded): Don't setup the
frame if the resource hasn't finished or if the load failed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@31967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/page/inspector/Resource.js
WebCore/page/inspector/ResourcesPanel.js
WebCore/page/inspector/SourceView.js