Make WordPress Core

Changeset 38157


Ignore:
Timestamp:
07/26/2016 10:05:39 PM (8 years ago)
Author:
azaozz
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/mce-view.js

    r37446 r38157  
    539539                        dom.add( node, 'span', { 'class': 'wpview-end' } );
    540540                    } );
     541
     542                    // Bail if the iframe node is not attached to the DOM.
     543                    // Happens when the view is dragged in the editor.
     544                    // There is a browser restriction when iframes are moved in the DOM. They get emptied.
     545                    // The iframe will be rerendered after dropping the view node at the new location.
     546                    if ( ! iframe.contentWindow ) {
     547                        return;
     548                    }
    541549
    542550                    iframeDoc = iframe.contentWindow.document;
Note: See TracChangeset for help on using the changeset viewer.