blob: 65cf58619e5a069e5f97837aa94c7544de2ff874 [file] [log] [blame]
chrishtr4b1c8f022017-01-07 03:00:261<!DOCTYPE html>
2<style>
3 #containingBlock {
4 height: 200px;
5 font-size: 140px;
6 position: relative;
7 border: 1px solid black;
8 }
9</style>
10<div id="containingBlock">
11 <img id="image" src="../paint/invalidation/resources/bluesquare.png">
12</div>
13<a id="target" href="#">this is a link</a>
14<div id="result"></div>
15<script>
Xiaocheng Hu1d505232018-06-14 21:00:3416if (window.testRunner) {
17 testRunner.dumpAsText();
18 testRunner.waitUntilDone();
19}
20
21// Tests
chrishtr4b1c8f022017-01-07 03:00:2622function test() {
chrishtr4b1c8f022017-01-07 03:00:2623 target.onclick = function() {
24 var result = document.getElementById("result");
25 result.innerHTML += "clicked<br>";
chrishtr4b1c8f022017-01-07 03:00:2626 };
chrishtr4b1c8f022017-01-07 03:00:2627 let x = image.offsetLeft + 10;
28 let y = image.offsetTop + image.offsetHeight;
29
30 if (window.eventSender) {
31 // No click - still inside containingBlock.
32 eventSender.mouseMoveTo(x, y - 10);
33 eventSender.mouseDown();
34 eventSender.mouseUp();
35
36 // Click - over the link. Still inside the height of the inline
37 // image, but outside of containingBlock.
38 eventSender.mouseMoveTo(x, y + 15);
39 finished = true;
40 eventSender.mouseDown();
41 eventSender.mouseUp();
Xiaocheng Hu1d505232018-06-14 21:00:3442
43 testRunner.notifyDone();
chrishtr4b1c8f022017-01-07 03:00:2644 }
45}
46window.onload = test;
47</script>