diff options
Diffstat (limited to 'WebCore/inspector/front-end/SourceView.js')
-rw-r--r-- | WebCore/inspector/front-end/SourceView.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/WebCore/inspector/front-end/SourceView.js b/WebCore/inspector/front-end/SourceView.js index 309027e..7510c8c 100644 --- a/WebCore/inspector/front-end/SourceView.js +++ b/WebCore/inspector/front-end/SourceView.js @@ -95,10 +95,15 @@ WebInspector.SourceView.prototype = { this.attach(); - if (!InspectorController.addResourceSourceToFrame(this.resource.identifier, this.sourceFrame.element)) - return; - delete this._frameNeedsSetup; + this.sourceFrame.addEventListener("content loaded", this._contentLoaded, this); + InspectorController.addResourceSourceToFrame(this.resource.identifier, this.sourceFrame.element); + }, + + _contentLoaded: function() + { + delete this._frameNeedsSetup; + this.sourceFrame.removeEventListener("content loaded", this._contentLoaded, this); if (this.resource.type === WebInspector.Resource.Type.Script) { this.sourceFrame.addEventListener("syntax highlighting complete", this._syntaxHighlightingComplete, this); @@ -274,7 +279,7 @@ WebInspector.SourceView.prototype = { if (!foundRange) return; - var selection = window.getSelection(); + var selection = this.sourceFrame.element.contentWindow.getSelection(); selection.removeAllRanges(); selection.addRange(foundRange); |