<html>
<head>
    <title></title>
    <style type="text/css">
        div#overflow { margin: 5px; padding: 10px; border: medium solid; width: 100px; height: 100px; overflow: auto; }
        ::selection { background-color: red; }
    </style>
    <script type="text/javascript" src="resources/repaint.js"></script>
    <script type="text/javascript">
        function repaintTest()
        {
            getSelection().empty();
        }
    </script>
</head>
<body onload="runRepaintTest()">
    <p>
        Test for <i><a href="https://bugs.webkit.org/show_bug.cgi?id=34946">https://bugs.webkit.org/show_bug.cgi?id=34946</a>
        REGRESSION: Selection painting issue in bug review textbox</i>.
    </p>
    <div id="overflow">
        <div style="height: 100px;"></div>
        <div style="display: inline-block; width: 94px;"><span id="target">Lorem<br>ipsum</span></div>
    </div>
    <script type="text/javascript">
        var overflow = document.getElementById("overflow");
        overflow.scrollTop = overflow.scrollHeight;
        var selection = getSelection();
        var target = document.getElementById("target");
        selection.setBaseAndExtent(target, 0, target, 3);
    </script>
</body>
</html>
