dom/browser-element/mochitest/file_focus.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/browser-element/mochitest/file_focus.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,24 @@
     1.4 +<html>
     1.5 +<body>
     1.6 +
     1.7 +Aloha!  My URL is <span id='url'></span>.
     1.8 +<script>
     1.9 +document.getElementById('url').innerHTML = window.location;
    1.10 +</script>
    1.11 +
    1.12 +<script>
    1.13 +  // The input element is getting synthesized key events and will prevent
    1.14 +  // default on the first ESC keydown event.
    1.15 +
    1.16 +  var alreadyBlocked = false;
    1.17 +
    1.18 +  addEventListener('keydown', function(e) {
    1.19 +    if (e.keyCode == SpecialPowers.Ci.nsIDOMKeyEvent.DOM_VK_ESCAPE &&
    1.20 +        alreadyBlocked == false) {
    1.21 +      alreadyBlocked = true;
    1.22 +      e.preventDefault();
    1.23 +    }
    1.24 +  });
    1.25 +</script>
    1.26 +</body>
    1.27 +</html>

mercurial