| <!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> |