blob: b573073980a366f2dc12b3a1a57511584fab7611 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="resources/link-highlight-helper.js"></script>
<link rel="stylesheet" href="resources/link-highlight-style.css">
</head>
<body onload="runTest();" onclick="doNothing();">
<div style="will-change: transform; position: relative; left: 10px; top: 40px">
<a href="" id="targetLink" style="-webkit-tap-highlight-color: rgba(0, 255, 0, 0.5)">Target Link.</a>
</div>
<div style="position: relative; left: 10px; top: 70px">
This test is successful if "Target Link" above is covered in a green rectangle.
</div>
<script>
function runTest() {
var clientRect = document.getElementById('targetLink').getBoundingClientRect();
x = (clientRect.left + clientRect.right) / 2;
y = (clientRect.top + clientRect.bottom) / 2;
if (window.testRunner)
testRunner.waitUntilDone();
if (window.eventSender) {
// Generate valid link highlight.
eventSender.gestureShowPress(x, y);
// Send GestureTapCancel, this should cause the highlight to animate away.
// FIXME: remove params from all gestureTapCancel calls in LayoutTests
eventSender.gestureTapCancel(x, y);
window.setTimeout(function() { testRunner.notifyDone(); }, 0);
} else {
debug("This test requires DumpRenderTree.");
}
}
</script>
</body>
</html>