Index: _source/core/dom/element.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- _source/core/dom/element.js	(revision 7365)
+++ _source/core/dom/element.js	(revision )
@@ -1430,6 +1430,36 @@
 			var currentScroll = win.getScrollPosition().y;
 			if ( offset > currentScroll || offset < currentScroll - winHeight )
 				win.$.scrollTo( 0, offset );
+
+			// Check whether the host page need to scroll too. (#7946)
+			var doc = CKEDITOR.document;
+			if ( !this.getDocument().equals( doc ) )
+			{
+				var rect = this.$.getBoundingClientRect(),
+					pos = this.getDocumentPosition( doc ),
+					marker = new CKEDITOR.dom.element( 'div', doc );
+
+				// marker will of the same size of the current.
+				marker.setStyles(
+				{
+					position : 'absolute',
+					visibility : 'hidden',
+					left : pos.x + 'px',
+					top : pos.y + 'px',
+					width : ( rect.width || rect.right - rect.left ) + 'px',
+					height : ( rect.height || rect.top - rect.bottom ) + 'px'
+				});
+				doc.getBody().append( marker );
+
+				rect = marker.$.getBoundingClientRect();
+				winHeight = doc.getWindow().getViewPaneSize().height;
+
+				// Scroll host page only when client rectangle is outside of viewport.
+				if ( rect.bottom < 0 || rect.top > winHeight )
+					marker.$.scrollIntoView( alignTop );
+
+				marker.remove();
+			}
 		},
 
 		setState : function( state )
