Commit 018e37e6 authored by timothy@apple.com's avatar timothy@apple.com

Fixes the bug where SourceViews would be blank if shown before

the Resource finished loading.

<rdar://problem/5807420> Safari's Web Inspector won't display the
contents of some CSS and JS files

Reviewed by Kevin McCullough.

* page/inspector/Resource.js:
(WebInspector.Resource.prototype.set finished): Dispatch the finished event
(WebInspector.Resource.prototype): Inherit from WebInspector.Object.prototype.
* page/inspector/SourceView.js:
(WebInspector.SourceView): Register for the finished event on the resource.
When the event fires, setup the source frame and deregister the event.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33409 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 187b6eaa
2008-05-13 Timothy Hatcher <timothy@apple.com>
Fixes the bug where SourceViews would be blank if shown before
the Resource finished loading.
<rdar://problem/5807420> Safari's Web Inspector won't display the
contents of some CSS and JS files
Reviewed by Kevin McCullough.
* page/inspector/Resource.js:
(WebInspector.Resource.prototype.set finished): Dispatch the finished event
(WebInspector.Resource.prototype): Inherit from WebInspector.Object.prototype.
* page/inspector/SourceView.js:
(WebInspector.SourceView): Register for the finished event on the resource.
When the event fires, setup the source frame and deregister the event.
2008-05-13 Timothy Hatcher <timothy@apple.com>
Factored most of SourceView out into SourceFrame so it can be shared
......@@ -230,6 +230,7 @@ WebInspector.Resource.prototype = {
if (x) {
this._checkTips();
this._checkWarnings();
this.dispatchEventToListeners("finished");
}
},
......@@ -506,6 +507,8 @@ WebInspector.Resource.prototype = {
}
}
WebInspector.Resource.prototype.__proto__ = WebInspector.Object.prototype;
WebInspector.Resource.CompareByTime = function(a, b)
{
if (a.responseReceivedTime < b.responseReceivedTime)
......
......@@ -30,6 +30,8 @@ WebInspector.SourceView = function(resource)
{
WebInspector.ResourceView.call(this, resource);
resource.addEventListener("finished", this._resourceLoadingFinished, this);
this.element.addStyleClass("source");
this._frameNeedsSetup = true;
......@@ -79,6 +81,13 @@ WebInspector.SourceView.prototype = {
// when it is removed from the document. Is this a bug?
WebInspector.ResourceView.prototype.detach.call(this);
this._frameNeedsSetup = true;
},
_resourceLoadingFinished: function(event)
{
if (this.visible)
this.setupSourceFrameIfNeeded();
this.resource.removeEventListener("finished", this._resourceLoadingFinished, this);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment