Index: CKEditor/branches/features/aria/_source/lang/en.js
===================================================================
--- CKEditor/branches/features/aria/_source/lang/en.js	(revision 4956)
+++ CKEditor/branches/features/aria/_source/lang/en.js	(revision 4957)
@@ -502,5 +502,6 @@
 		copyError	: 'Your browser security settings don\'t permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl+C).',
 		pasteMsg	: 'Please paste inside the following box using the keyboard (<strong>Ctrl+V</strong>) and hit OK',
-		securityMsg	: 'Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.'
+		securityMsg	: 'Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.',
+		pasteArea : 'paste area'
 	},
 
Index: CKEditor/branches/features/aria/_source/plugins/clipboard/dialogs/paste.js
===================================================================
--- CKEditor/branches/features/aria/_source/plugins/clipboard/dialogs/paste.js	(revision 4956)
+++ CKEditor/branches/features/aria/_source/plugins/clipboard/dialogs/paste.js	(revision 4957)
@@ -6,42 +6,92 @@
 CKEDITOR.dialog.add( 'paste', function( editor )
 {
+	var lang = editor.lang.clipboard;
 	var isCustomDomain = CKEDITOR.env.isCustomDomain();
 
+	function onPasteFrameLoad( win )
+	{
+		var doc =  new CKEDITOR.dom.document( win.document ),
+			$ = doc.$;
+
+		doc.getById( "cke_actscrpt" ).remove();
+
+		CKEDITOR.env.ie ?
+			$.body.contentEditable = "true" :
+			$.designMode = "on";
+
+		CKEDITOR.env.ie && doc.getWindow().on( 'blur', function()
+		{
+			 $.body.contentEditable = "false";
+		} );
+
+		doc.on( "keydown", function( e )
+		{
+			var domEvent = e.data,
+				key = domEvent.getKeystroke(),
+				processed;
+
+			switch( key )
+			{
+				case 27 :
+					this.hide();
+					processed = 1;
+					break;
+
+				case 9 :
+				case CKEDITOR.SHIFT + 9 :
+					this.changeFocus( true );
+					processed = 1;
+			}
+
+			processed && domEvent.preventDefault();
+		}, this );
+		
+		editor.fire( 'ariaWidget', new CKEDITOR.dom.element( win.frameElement ) );
+	}
+
 	return {
-		title : editor.lang.clipboard.title,
+		title : lang.title,
 
 		minWidth : CKEDITOR.env.ie && CKEDITOR.env.quirks ? 370 : 350,
 		minHeight : CKEDITOR.env.quirks ? 250 : 245,
-		htmlToLoad : '<!doctype html><script type="text/javascript">'
-				+ 'window.onload = function()'
-				+ '{'
-					+ 'if ( ' + CKEDITOR.env.ie + ' ) '
-						+ 'document.body.contentEditable = "true";'
-					+ 'else '
-						+ 'document.designMode = "on";'
-					+ 'var iframe = new window.parent.CKEDITOR.dom.element( frameElement );'
-					+ 'var dialog = iframe.getCustomData( "dialog" );'
-		      + ''
-					+ 'iframe.getFrameDocument().on( "keydown", function( e )\
-						{\
-							if ( e.data.getKeystroke() == 27 )\
-								dialog.hide();\
-						});'
-				+ '};'
-				+ '</script><style>body { margin: 3px; height: 95%; } </style><body></body>',
-
 		onShow : function()
 		{
-			if ( CKEDITOR.env.ie )
-				this.getParentEditor().document.getBody().$.contentEditable = 'false';
-
 			// FIREFOX BUG: Force the browser to render the dialog to make the to-be-
 			// inserted iframe editable. (#3366)
 			this.parts.dialog.$.offsetHeight;
 
-			var container = this.getContentElement( 'general', 'editing_area' ).getElement(),
-				iframe = CKEDITOR.dom.element.createFromHtml( '<iframe src="javascript:void(0)" frameborder="0" allowtransparency="1"></iframe>' );
+			var htmlToLoad = '<!doctype html><html><head><style>body { margin: 3px; height: 95%; } </style></head><body>' +
+							 '<script id="cke_actscrpt" type="text/javascript">' +
+							 'window.parent.CKEDITOR.tools.callFunction( ' + CKEDITOR.tools.addFunction( onPasteFrameLoad, this ) + ', this );' +
+							 '</script></body></html>';
+			
+			var iframe = CKEDITOR.dom.element.createFromHtml(
+						'<iframe' +
+						' frameborder="0" ' +
+						' allowTransparency="true"' +
+						// Support for custom document.domain in IE.
+						( isCustomDomain ?
+							' src="javascript:void((function(){' +
+								'document.open();' +
+								'document.domain=\'' + document.domain + '\';' +
+								'document.close();' +
+							'})())"' : '' ) +
+						' role="region"' +
+						' aria-label="' + lang.pasteArea + '"' +
+						' aria-describedby="' + this.getContentElement( 'general', 'pasteMsg' ).domId + '"' +
+						' aria-multiple="true"' +
+						'></iframe>' );
 
-			var lang = this.getParentEditor().lang;
+			iframe.on( 'load', function( e )
+			{
+				e.removeListener();
+				var 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 );
 
 			iframe.setStyles(
@@ -54,46 +104,16 @@
 			iframe.setCustomData( 'dialog', this );
 
-			var accTitle = lang.editorTitle.replace( '%1', lang.clipboard.title );
+			var field = this.getContentElement( 'general', 'editing_area' ),
+				container = field.getElement();
+			container.setHtml( '' );
+			container.append( iframe );
 
+			field.getInputElement = function(){ return iframe };
+
+			// Force container to scale in IE.
 			if ( CKEDITOR.env.ie )
-				container.setHtml( '<legend style="position:absolute;top:-1000000px;left:-1000000px;">'
-						+ CKEDITOR.tools.htmlEncode( accTitle )
-						+ '</legend>' );
-			else
 			{
-				container.setHtml( '' );
-				container.setAttributes(
-					{
-						role : 'region',
-						title : accTitle
-					} );
-				iframe.setAttributes(
-					{
-						role : 'region',
-						title : ' '
-					} );
-			}
-			container.append( iframe );
-			if ( CKEDITOR.env.ie )
+				container.setStyle( 'display', 'block' );
 				container.setStyle( 'height', ( iframe.$.offsetHeight + 2 ) + 'px' );
-
-			if ( isCustomDomain )
-			{
-				CKEDITOR._cke_htmlToLoad = this.definition.htmlToLoad;
-				iframe.setAttribute( 'src',
-					'javascript:void( (function(){' +
-						   'document.open();' +
-						   'document.domain="' + document.domain + '";' +
-						   'document.write( window.parent.CKEDITOR._cke_htmlToLoad );' +
-						   'delete window.parent.CKEDITOR._cke_htmlToLoad;' +
-						   'document.close();' +
-					'})() )' );
-			}
-			else
-			{
-				var doc = iframe.$.contentWindow.document;
-				doc.open();
-				doc.write( this.definition.htmlToLoad );
-				doc.close();
 			}
 		},
@@ -132,10 +152,10 @@
 						type : 'html',
 						id : 'securityMsg',
-						html : '<div style="white-space:normal;width:340px;">' + editor.lang.clipboard.securityMsg + '</div>'
+						html : '<div style="white-space:normal;width:340px;">' + lang.securityMsg + '</div>'
 					},
 					{
 						type : 'html',
 						id : 'pasteMsg',
-						html : '<div style="white-space:normal;width:340px;">'+editor.lang.clipboard.pasteMsg +'</div>'
+						html : '<div style="white-space:normal;width:340px;">'+lang.pasteMsg +'</div>'
 					},
 					{
@@ -143,12 +163,9 @@
 						id : 'editing_area',
 						style : 'width: 100%; height: 100%;',
-						html : '<fieldset></fieldset>',
+						html : '',
 						focus : function()
 						{
-							var div = this.getElement();
-							var iframe = div.getElementsByTag( 'iframe' );
-							if ( iframe.count() < 1 )
-								return;
-							iframe = iframe.getItem( 0 );
+							var win = this.getInputElement().$.contentWindow,
+								 body = win && win.document.body;
 
 							// #3291 : JAWS needs the 500ms delay to detect that the editor iframe
@@ -157,5 +174,7 @@
 							setTimeout( function()
 							{
-								iframe.$.contentWindow.focus();
+								// Reactivate design mode for IE to make the cursor blinking.
+								CKEDITOR.env.ie && body && ( body.contentEditable = "true" );
+								win.focus();
 							}, 500 );
 						}
Index: CKEditor/branches/features/aria/_source/plugins/dialog/plugin.js
===================================================================
--- CKEditor/branches/features/aria/_source/plugins/dialog/plugin.js	(revision 4956)
+++ CKEditor/branches/features/aria/_source/plugins/dialog/plugin.js	(revision 4957)
@@ -286,4 +286,6 @@
 				focusList[ currentIndex ].select();
 		}
+		
+		this.changeFocus = changeFocus;
 
 		var processed;
@@ -836,5 +838,5 @@
 			page.setAttribute( 'role', 'tabpanel' );
 
-			var env = CKEDITOR.env; 
+			var env = CKEDITOR.env;
 			var tabId = contents.id + '_' + CKEDITOR.tools.getNextNumber(),
 				 tab = CKEDITOR.dom.element.createFromHtml( [
