summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/text/input-hit-test-border.html
blob: dff6c82fe7d920345da3f5cdf730a0f5035df6b2 (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
<html>
<head>
<script>
function runTest() {
    if (window.testRunner)
        testRunner.dumpAsText();
        
    var result = document.getElementById('res');
    var input = document.getElementById('tf');
    
    var borderElement = document.elementFromPoint(18, 34);  // in border
    var paddingElement = document.elementFromPoint(25, 41);  // in padding

    if (borderElement == input && paddingElement == input)
        result.innerHTML = "Test Passed";
}

window.addEventListener('click', function(e) {
  window.console.log('page x ' + e.pageX + ' page y ' + e.pageY);
}, false);
</script>
</head>
<body onload="runTest()">
This tests hit testing on the border and padding areas of an input. Clicks in either should hit
the input element.
<input id="tf" style="position: absolute; top: 25px; left: 10px; border: 10px inset gray; padding: 10px;">
<div id="res" style="position: absolute; top: 100px; left: 10px;">Test Failed</div>
</body>
</html>