<!DOCTYPE html>
<style>
    ::selection {
        background-color: lime;
    }
</style>
<body>
    <svg id="svgx" filter="url(#filter)">
        <filter id="filter">
            <feImage xlink:href="#svgx"/>
        </filter>
        <text id="text">This test passes if it does not crash.</text>
    </svg>
    <script>
        if (window.testRunner)
            testRunner.dumpAsText(true);
        window.addEventListener('load', (event) => {
            document.getSelection().setBaseAndExtent(text, 0, text, 1);
        });
    </script>
</body>
