summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/search-transformed.html
blob: da802ecc53b139a252649c9edad39f99a64ea1da (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
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>Search Field with Transform</title>
</head>
<body>
    <p>
        Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=22190">https://bugs.webkit.org/show_bug.cgi?id=22190</a>:<br>
        Tests drawing and event handling on transformed search fields.
    </p>
    <p style="-webkit-transform: translate(50px, 50px);">
        <input type="search" id="target" results="5" value="Search me">
    </p>
    <p id="result" style="margin-top: 60px">
        Clicking the (x) button should clear the field.
    </p>
    <script>
        if (window.eventSender) {
            var target = document.getElementById("target");
            var translationAmount = 50;
            var x = target.offsetLeft + target.offsetWidth + translationAmount - 5;
            var y = target.offsetTop + target.offsetHeight + translationAmount - 5;
            eventSender.mouseMoveTo(x, y);
            eventSender.mouseDown();
            eventSender.mouseUp();
            var result = document.getElementById("result");
            if (target.value == "")
                result.innerText = "PASS";
            else
                result.innerText = "FAIL";
            
            target.value = "Some other text";
        }
    </script>
</body>
</html>