Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 3828)
+++ /CKEditor/trunk/CHANGES.html	(revision 3829)
@@ -1,3 +1,3 @@
-﻿﻿﻿﻿﻿﻿﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+﻿﻿﻿﻿﻿﻿﻿﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <!--
 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
@@ -106,4 +106,5 @@
 		<li><a href="http://dev.fckeditor.net/ticket/3896">#3896</a> : The editing area was 
 			flashing when switching forth and back to source view.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/3894">#3894</a> : Fixed an issue where editor failed to initialize when using the on-demand loading way.</li>
 	</ul>
 	<h3>
Index: /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js	(revision 3828)
+++ /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js	(revision 3829)
@@ -1,3 +1,3 @@
-﻿/*
+/*
 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
@@ -229,6 +229,11 @@
 
 						// The document domain must be set within the src
-						// attribute.
-						var src = 'void( (function(){' +
+						// attribute;
+						// Defer the script execution until iframe
+						// has been added to main window, this is needed for some
+						// browsers which will begin to load the frame content
+						// prior to it's presentation in DOM.(#3894)
+						var src = 'void( '
+								+ ( CKEDITOR.env.gecko ? 'setTimeout' : '' ) + '( function(){' +
 								'document.open();' +
 								( CKEDITOR.env.ie && isCustomDomain ? 'document.domain="' + document.domain + '";' : '' ) +
@@ -236,5 +241,7 @@
 								'document.close();' +
 								'window.parent._cke_htmlToLoad_' + editor.name + ' = null;' +
-							'})() )';
+								'}'
+								+ ( CKEDITOR.env.gecko ? ', 0 )' : ')()' )
+								+ ' )';
 
 						// Loading via src attribute does not work in Opera.
