blob: e25c7747b6cc64163ba04ce47d68976167b5f1e6 [file] [log] [blame]
<!DOCTYPE html>
<title>ContextMenu Key: Reveal Focused Element</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<style>
body {
height: 3000px;
}
</style>
<input type="text" id="txt">
<a href="#" id="anchor">Anchor</a>
<script>
test(function() {
if (!window.eventSender) {
document.write('This test requires eventSender');
return;
}
document.getElementById('txt').focus();
document.scrollingElement.scrollTop = 3000;
assert_not_equals(document.scrollingElement.scrollTop, 0);
eventSender.keyDown("ContextMenu");
assert_equals(document.scrollingElement.scrollTop, 0);
}, 'Testing ContextMenu key should reveal focused input.');
test(function() {
if (!window.eventSender) {
document.write('This test requires eventSender');
return;
}
document.getElementById('anchor').focus();
document.scrollingElement.scrollTop = 3000;
assert_not_equals(document.scrollingElement.scrollTop, 0);
eventSender.keyDown("ContextMenu");
assert_equals(document.scrollingElement.scrollTop, 0);
}, 'Testing ContextMenu key should reveal focused anchor.');
</script>