blob: 16dcbea133670e3ccb1fc6b930bf927024fa32ae (
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
|
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="resources/link-highlight-style.css">
<script src="resources/link-highlight-helper.js"></script>
</head>
<body onload="runTest();">
<div id="targetDiv" style="transform: translateZ(0); position: relative; left: 10px; top: 10px"></div>
<div style="position: relative; left: 10px; top: 40px; width: 200px; height: 100px; overflow-y: scroll; overflow-x: scroll;">
<a href="">Link 1</a><br>
<a href="">Link 2</a><br>
<a href="" id="linkToRemove">Link 3</a><br id="brToRemove">
<a class="opaqueHighlight" href="" id="targetLink">Target Link.</a><br>
<a href="">Link 4</a><br>
<a href="">Link 5</a><br>
</div>
<div style="position: relative; left: 10px; top: 80px">
This test is successful if "Target Link" above is covered in a green rectangle with square corners.
</div>
<script>
function runTest() {
useMockHighlight();
var clientRect = document.getElementById('targetLink').getBoundingClientRect();
x = (clientRect.left + clientRect.right) / 2;
y = (clientRect.top + clientRect.bottom) / 2;
if (window.testRunner) {
testRunner.dumpAsTextWithPixelResults();
testRunner.waitUntilDone();
}
// In this test a link highlight is commenced, then a node is deleted from in front of
// target, forcing a layout change that moves the target node mid-animation.
if (window.eventSender) {
eventSender.gestureShowPress(x, y);
var linkToRemove = document.getElementById('linkToRemove');
linkToRemove.parentNode.removeChild(linkToRemove);
var brToRemove = document.getElementById('brToRemove');
brToRemove.parentNode.removeChild(brToRemove);
window.setTimeout(function() { window.testRunner.notifyDone(); }, 0);
} else {
debug("This test requires DumpRenderTree.");
}
}
</script>
</script>
</body>
</html>
|