Overview

Some kind of race condition that seems to specifically effect Safari/webkit means that despite the srcdoc being set of the preview canvas iframe, the actual content of the iframe doesn't load in resulting in the following seemingly impossible situation in the DOM

<iframe class="_preview_i3030_1" data-test-xb-content-initialized="true" data-xb-iframe="B" data-xb-preview="true"
        data-xb-swap-active="true"
        scrolling="no" srcdoc="<!DOCTYPE html>
<html dir=&quot;ltr&quot; lang=&quot;en&quot; style=&quot;--color--primary-hue:202;--color--primary-saturation:79%;--color--primary-lightness:50&quot;>
    <head>
        [...trimmed]
    </head>
    <body class=&quot;toolbar-loading user-logged-in path-xb&quot;>
        <a class=&quot;visually-hidden focusable skip-link&quot; href=&quot;#main-content&quot;>Skip to main content</a>
        <div class=&quot;dialog-off-canvas-main-canvas&quot; data-off-canvas-main-canvas>
        
            <div class=&quot;page-wrapper&quot; id=&quot;page-wrapper&quot;>
                <div id=&quot;page&quot;>
                    <header class=&quot;site-header&quot; data-drupal-selector=&quot;site-header&quot; id=&quot;header&quot; role=&quot;banner&quot;>
                        [...trimmed]
                    </header>
        
                    <div class=&quot;layout-main-wrapper layout-container&quot; id=&quot;main-wrapper&quot;>
                        [... trimmed]
                    </div>
        
                    <footer class=&quot;site-footer&quot;>
                        [...trimmed]
                    </footer>
                    <div class=&quot;overlay&quot; data-drupal-selector=&quot;overlay&quot;></div>
                </div>
            </div>
        </div>
        [...trimmed]
    </body>
</html>" style="display: block;" tabindex="-1" title="Preview">
    <html style="overflow: hidden; min-height: 768px;">
    <head></head>
    <body style="min-height: 768px;"></body>
    </html>
</iframe>

Note that the srcdoc has a full HTML document but the iframe's content is just an empty head and body tag.

See screen recording for what this looks like in practice.

Proposed resolution

Perhaps detect the failed iframe initialisation and re-try it.

User interface changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jessebaker created an issue. See original summary.

jessebaker’s picture

Assigned: jessebaker » Unassigned
Status: Active » Needs review
jessebaker’s picture

wim leers’s picture