Index: /CKEditor/branches/features/adobeair/_source/plugins/clipboard/dialogs/paste.js
===================================================================
--- /CKEditor/branches/features/adobeair/_source/plugins/clipboard/dialogs/paste.js	(revision 6175)
+++ /CKEditor/branches/features/adobeair/_source/plugins/clipboard/dialogs/paste.js	(revision 6176)
@@ -76,4 +76,16 @@
 				'</html>';
 
+			var src =
+				CKEDITOR.env.air ?
+					'javascript:void(0)' :
+				isCustomDomain ?
+					'javascript:void((function(){' +
+						'document.open();' +
+						'document.domain=\'' + document.domain + '\';' +
+						'document.close();' +
+						'})())"'
+				:
+					'';
+
 			var iframe = CKEDITOR.dom.element.createFromHtml(
 						'<iframe' +
@@ -81,12 +93,5 @@
 						' frameborder="0" ' +
 						' allowTransparency="true"' +
-						// Support for custom document.domain in IE.
-						( CKEDITOR.env.air ? ' src="javascript:void(0)"' :
-							( isCustomDomain ?
-							' src="javascript:void((function(){' +
-								'document.open();' +
-								'document.domain=\'' + document.domain + '\';' +
-								'document.close();' +
-							'})())"' : '' ) ) +
+						' src="' + src + '"' +
 						' role="region"' +
 						' aria-label="' + lang.pasteArea + '"' +
@@ -96,26 +101,14 @@
 
 			iframe.on( 'load', function( e )
-			{
-				e.removeListener();
-
-				var doc;
-
-				if ( CKEDITOR.env.air )
 				{
-					doc = iframe.getFrameDocument();
+					e.removeListener();
+
+					var doc = iframe.getFrameDocument();
 					doc.write( htmlToLoad );
-					onPasteFrameLoad.call( this, doc.getWindow().$ );
-				}
-				else
-				{
-					doc = iframe.getFrameDocument().$;
-					// Custom domain handling is needed after each document.open().
-					doc.open();
-					if ( isCustomDomain )
-						doc.domain = document.domain;
-					doc.write( htmlToLoad );
-					doc.close();
-				}
-			}, this );
+
+					if ( CKEDITOR.env.air )
+						onPasteFrameLoad.call( this, doc.getWindow().$ );
+				},
+				this );
 
 			iframe.setCustomData( 'dialog', this );
Index: /CKEditor/branches/features/adobeair/_source/plugins/wysiwygarea/plugin.js
===================================================================
--- /CKEditor/branches/features/adobeair/_source/plugins/wysiwygarea/plugin.js	(revision 6175)
+++ /CKEditor/branches/features/adobeair/_source/plugins/wysiwygarea/plugin.js	(revision 6176)
@@ -405,6 +405,5 @@
 							iframe.remove();
 
-
-						var srcScript =
+						var src =
 							'document.open();' +
 
@@ -414,4 +413,15 @@
 
 							'document.close();';
+
+						// With IE, the custom domain has to be taken care at first,
+						// for other browers, the 'src' attribute should be left empty to
+						// trigger iframe's 'load' event.
+  						src =
+							CKEDITOR.env.air ? 
+								'javascript:void(0)' :
+							CKEDITOR.env.ie ?
+								'javascript:void(function(){' + encodeURIComponent( src ) + '}())'
+							:
+								'';
 
 						iframe = CKEDITOR.dom.element.createFromHtml( '<iframe' +
@@ -419,8 +429,5 @@
   							' frameBorder="0"' +
   							' title="' + frameLabel + '"' +
-							// With IE, the custom domain has to be taken care at first,
-							// for other browers, the 'src' attribute should be left empty to
-							// trigger iframe's 'load' event.
-  							' src="' + ( CKEDITOR.env.air ? 'javascript:void(0)' : CKEDITOR.env.ie ? 'javascript:void(function(){' + encodeURIComponent( srcScript ) + '}())' : '' ) + '"' +
+  							' src="' + src + '"' +
 							' tabIndex="' + ( CKEDITOR.env.webkit? -1 : editor.tabIndex ) + '"' +
   							' allowTransparency="true"' +
@@ -433,24 +440,13 @@
 						// With FF, it's better to load the data on iframe.load. (#3894,#4058)
 						iframe.on( 'load', function( ev )
-						{
-							frameLoaded = 1;
-							ev.removeListener();
-
-							var doc;
-							if ( CKEDITOR.env.air )
-							{
-								doc = iframe.getFrameDocument();
+							{
+								frameLoaded = 1;
+								ev.removeListener();
+
+								var doc = iframe.getFrameDocument();
 								doc.write( data );
-								contentDomReady( doc.getWindow().$ );
-							}
-							else
-							{
-								doc = iframe.getFrameDocument().$;
-								// Don't leave any history log in IE. (#5657)
-								doc.open( "text/html", "replace" );
-								doc.write( data );
-								doc.close();
-							}
-						});
+
+								CKEDITOR.env.air && contentDomReady( doc.getWindow().$ );
+							});
 
 						// Reset adjustment back to default (#5689)
