From ae9e468806e7fb29d68e6d81a3a948123edd26a0 Mon Sep 17 00:00:00 2001 From: Cedric Vivier Date: Mon, 3 Oct 2011 19:08:15 +0800 Subject: [PATCH] Bug 583041 - Style Editor integration; sourceeditor fix; r=rcampbell,msucan --- .../devtools/sourceeditor/source-editor-orion.jsm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/browser/devtools/sourceeditor/source-editor-orion.jsm b/browser/devtools/sourceeditor/source-editor-orion.jsm index aa5980e48a6b..183ec25fb2f5 100644 --- a/browser/devtools/sourceeditor/source-editor-orion.jsm +++ b/browser/devtools/sourceeditor/source-editor-orion.jsm @@ -222,7 +222,17 @@ SourceEditor.prototype = { }, this); if (aCallback) { - aCallback(this); + let iframe = this._view._frame; + let document = iframe.contentDocument; + if (!document || document.readyState != "complete") { + let onIframeLoad = function () { + iframe.contentWindow.removeEventListener("load", onIframeLoad, false); + aCallback(this); + }.bind(this); + iframe.contentWindow.addEventListener("load", onIframeLoad, false); + } else { + aCallback(this); + } } },