<!doctype html>
<head>
    <script>
    if (window.testRunner) {
        testRunner.dumpAsText(false);
        testRunner.waitUntilDone();
    }
    function runRepaintTest()
    {
        if (window.internals)
            internals.startTrackingRepaints();

        var target = document.getElementById("target");
        getSelection().setBaseAndExtent(target, 0, target.nextSibling, 0);

        setTimeout(function() {
            if (window.internals) {
                document.querySelector('#repaints').innerHTML = window.internals.repaintRectsAsText();
                internals.stopTrackingRepaints();
            }
            if (window.testRunner)
                testRunner.notifyDone();
        });
    }
    </script>
    <style>
        body { margin: 0px; }
        #target::selection { background-color: green; }
    </style>
</head>
<body onload="runRepaintTest()">
    <div style="position: absolute; margin-left: 200px;">
        <div>Bug <a href="http://webkit.org/b/111000">111000</a>: Selection gaps don't repaint correctly with transforms</div>
        <div>This tests that fixed elements are invalidated correctly.  The box will be competely green if the selected area was invalidated correctly.</div>
    </div>
    <div>
        <div id="target" style="background-color: red; width: 100px; height: 100px; position: fixed;"><br/></div><br/>
    </div>
    <div id="repaints"></div>
</body>
