<!DOCTYPE html>

<html>
<head>
    <script src="../../../../resources/js-test-pre.js"></script>
    <style>
        body {
            margin: 0;
        }
    </style>
    <meta name="viewport" content="initial-scale=1">
</head>
<body>
    <script>
        description("Check the lifecycle of a touch event handler of a document detached from the top document");

        var detachedDocument = document.implementation.createHTMLDocument();
        detachedDocument.addEventListener('touchstart', (event) => { debug("FAIL, this should not be called"); });
        detachedDocument = undefined;
        gc();
    </script>
    <script src="../../../../resources/js-test-post.js"></script>
</body>
</html>
