spec/helpers/dom-utils.js
function createChildWindow ( readyDfd, size ) {
    var childWindow, width, height,
        sizedDefaultProps = ",top=0,left=0,location=no,menubar=no,status=no,toolbar=no,resizeable=yes,scrollbars=yes";

    if ( size ) {

        width = size === "parent" ? window.document.documentElement.clientWidth : size.width;
        height = size === "parent" ? window.document.documentElement.clientHeight : size.height;

        childWindow = window.open( "", "", "width=" + width + ",height=" + height + sizedDefaultProps );

    } else {

        childWindow = window.open();

    }

    if ( childWindow ) {

        // Setting the document content (using plain JS - jQuery can't write an entire HTML document, including the
        // doctype and <head> tags).
        childWindow.document.open();
        childWindow.document.write( '<!DOCTYPE html>\n<html>\n<head>\n<meta charset="UTF-8">\n<title></title>\n</head>\n<body>\n</body>\n</html>' );
        childWindow.document.close();

    }

    if ( readyDfd ) {
        if ( ! varExists( $ ) ) throw new Error( "`$` variable is not available. For using a readyDfd, jQuery (or a compatible library) must be loaded" );

        if (  childWindow && childWindow.document ) {
            $( childWindow.document ).ready ( function () {
                windowSizeReady( childWindow, readyDfd );
            } );
        } else {
            readyDfd.reject();
        }
    }

    return childWindow;
}
function createChildWindow ( readyDfd, size ) {
    var childWindow, width, height,
        sizedDefaultProps = ",top=0,left=0,location=no,menubar=no,status=no,toolbar=no,resizeable=yes,scrollbars=yes";

    if ( size ) {

        width = size === "parent" ? window.document.documentElement.clientWidth : size.width;
        height = size === "parent" ? window.document.documentElement.clientHeight : size.height;

        childWindow = window.open( "", "", "width=" + width + ",height=" + height + sizedDefaultProps );

    } else {

        childWindow = window.open();

    }

    if ( childWindow ) {

        // Setting the document content (using plain JS - jQuery can't write an entire HTML document, including the
        // doctype and <head> tags).
        childWindow.document.open();
        childWindow.document.write( '<!DOCTYPE html>\n<html>\n<head>\n<meta charset="UTF-8">\n<title></title>\n</head>\n<body>\n</body>\n</html>' );
        childWindow.document.close();

    }

    if ( readyDfd ) {
        if ( ! varExists( $ ) ) throw new Error( "`$` variable is not available. For using a readyDfd, jQuery (or a compatible library) must be loaded" );

        if (  childWindow && childWindow.document ) {
            $( childWindow.document ).ready ( function () {
                windowSizeReady( childWindow, readyDfd );
            } );
        } else {
            readyDfd.reject();
        }
    }

    return childWindow;
}
function createChildWindow ( readyDfd , size ) { var childWindow , width , height , sizedDefaultProps = ",top=0,left=0,location=no,menubar=no,status=no,toolbar=no,resizeable=yes,scrollbars=yes" ; if ( size ) { width = size === "parent" ? window . document . documentElement . clientWidth : size . width ; height = size === "parent" ? window . document . documentElement . clientHeight : size . height ; childWindow = window . open ( "" , "" , "width=" + width + ",height=" + height + sizedDefaultProps ) ; } else { childWindow = window . open ( ) ; } if ( childWindow ) { // Setting the document content (using plain JS - jQuery can't write an entire HTML document, including the // doctype and <head> tags). childWindow . document . open ( ) ; childWindow . document . write ( '<!DOCTYPE html>\n<html>\n<head>\n<meta charset="UTF-8">\n<title></title>\n</head>\n<body>\n</body>\n</html>' ) ; childWindow . document . close ( ) ; } if ( readyDfd ) { if ( ! varExists ( $ ) ) throw new Error ( "`$` variable is not available. For using a readyDfd, jQuery (or a compatible library) must be loaded" ) ; if ( childWindow && childWindow . document ) { $ ( childWindow . document ) . ready ( function ( ) { windowSizeReady ( childWindow , readyDfd ) ; } ) ; } else { readyDfd . reject ( ) ; } } return childWindow ; }
Creates a child window, including a document with an HTML 5 doctype, UFT-8 charset, head, title, and body tags.
Returns the handle, or undefined if window creation fails.

Optionally accepts a jQuery Deferred. The deferred is resolved when the document in the child window is ready and the
window has expanded to its intended size. If the child window can't be created, the deferred is rejected. (For this,
jQuery needs to be loaded, obviously.)

The size can also be specified. If so, the new window is opened with minimal browser chrome (no menu, location, and
status bars) and is positioned at the top left of the viewport. By default, the window is opened with the default
settings of the browser (usually with browser chrome, and not exactly in the top left corner).

If the child window can't be created, a pop-up blocker usually prevents it. Pop-up blockers are active by default in
most browsers - Chrome, for instance.

@param   {jQuery.Deferred} [readyDfd]
@param   {Object|string}   [size]          "parent" (same size as parent window), or size object
@param   {number}          [size.width]
@param   {number}          [size.height]

@returns {Window|undefined}                the window handle
Creates a child window including a document with an HTML 5 doctype UFT - 8 charset head title and body tags . Returns the handle or undefined if window creation fails .