Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
            
- /css/css-transitions/transition-in-iframe-001.html - WPT Dashboard Interop Dashboard
 
 
<!DOCTYPE html>
<html>
<title>Transitions: Transition in <iframe> on page with empty rAF finishes</title>
<link rel="author" href="mailto:mrobinson@igalia.com">
<link rel="author" href="mailto:obrufau@igalia.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/rendering-utils.js"></script>
<style>
    #iframe {
        width: 100px;
        height: 100px;
        border: none;
    }
</style>
<script>
    let rAFId = null;
    function triggerNeverEndingUselessRAF() {
        rAFId = requestAnimationFrame(triggerNeverEndingUselessRAF);
    }
    promise_test(async t => {
        await waitForAtLeastOneFrame();
        await waitForAtLeastOneFrame();
        let iframe = document.createElement("iframe");
        iframe.id = "iframe";
        iframe.src = "support/transition-in-iframe-001-iframe.html"
        iframe.sandbox = "allow-scripts";
        iframe.addEventListener("load", async () => {
            await waitForAtLeastOneFrame();
            await waitForAtLeastOneFrame();
            iframe.contentWindow.postMessage("loaded", "*");
        });
        triggerNeverEndingUselessRAF();
        document.body.appendChild(iframe);
        await new Promise(resolve => {
            window.addEventListener("message", () => {
                cancelAnimationFrame(rAFId);
                resolve();
            });
        });
    });
</script>
</html>