TinyMCE, wpView: bail early when the iframe node is not attached to the DOM. We can't load any HTML in it as here is no iframe.contentWindow in these cases.

See #36434.

git-svn-id: https://develop.svn.wordpress.org/trunk@38157 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2016-07-26 22:05:39 +00:00
parent a08e89ed97
commit 10e93c557b

View File

@ -539,6 +539,14 @@
dom.add( node, 'span', { 'class': 'wpview-end' } );
} );
// Bail if the iframe node is not attached to the DOM.
// Happens when the view is dragged in the editor.
// There is a browser restriction when iframes are moved in the DOM. They get emptied.
// The iframe will be rerendered after dropping the view node at the new location.
if ( ! iframe.contentWindow ) {
return;
}
iframeDoc = iframe.contentWindow.document;
iframeDoc.open();