summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/repaint/slider-thumb-float.html
blob: 8a893bb15f9aabb65651d4b1d0ab3ab0d1a4f933 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<html>
<head>
<style>

input {
    float: left;
    -webkit-appearance: none;
    background-color: Red;
    height: 10px;
    width: 100px;
}

input::-webkit-slider-thumb {
    -webkit-appearance: none;
    background-color: Green;
    width: 10px;
    height: 10px;
}

</style>
<script>

// Tests that the slider thumb is repainted correctly when the input element
// is floated.

function clickAndDrag(element)
{
    if (!window.eventSender)
        return;

    var maxX = element.offsetLeft + element.offsetWidth;
    var x = maxX / 2;
    var y = element.offsetTop + element.offsetHeight / 2;
    eventSender.mouseMoveTo(x, y);
    eventSender.mouseDown();
    eventSender.mouseMoveTo(maxX, y);
    eventSender.mouseUp();
}

function runTest()
{
    clickAndDrag(document.getElementById('slider'));
}

</script>
</head>
<body onload="runTest()">
<input id="slider" type="range" value="0">
</body>
</html>