Skip some keyboard tests on IE and EdgeIE and Edge has some broken behaviour for keyboard events that
prevent the standard tests from running properly.
Use KeyboardEvent.key too look up keysymsAnd emulate it on browsers where it is missing or incorrect. This
makes the code more future oriented as it primarily uses the standardised
fields.
Clean up AltGraph handlingIt doesn't need to be this general as the issue is mostly about
Windows. Also use the same modifier shuffle that RealVNC and
TigerVNC uses to get macOS working well.
Simplify pressed key handlingPrefer avoid having the server simulate multiple key presses by
refusing to use multiple keysyms for the same physical key.
Remove modifier synchronisationThe fields provided cannot tell us if it is the left or right
version of the key that's pressed, so they are inherently unreliable.
It is also not a huge problem in practice as we'll get in sync on
the next press or release of the modifier.
Improve lookup of special keysLook up keys that are independent of layout and state first,
followed by keys that are only mild variations in layouts.
This is more robust as there might be multiple physical keys
generating the same symbols, and Keysyms don't map directly to
Unicode in all cases.
At the same time switch over to using the modern, standardised
'code' field for lookup.
Improve character keysym lookupUse the more modern 'key' field, and remove some legacy fallbacks
that are no longer required. This also removes the "stall" mechanism
as it is not needed with current browsers.
Remove double unescaping of titleCommit fa5b334dcbe7a5dab21580b54cc2f5f142600379 by Joel Martin changed
getQueryVal() to always decode the value using decodeURIComponent(), but
unescape() is still used for extracting the title, leading to
double-unescaping.
As unescape() is deprecated anyway, remove the last user.
Cc: Joel Martin <github@martintribe.org>
Cc: Anthony Young <sleepsonthefloor@gmail.com>
Only load ES6 module loader polyfill if neededSafari now has native support for modules, so we need to make sure
we only load our polyfill when actually needed.
Fix panning test for high DPI devicesThere is a drag-threshold in the panning code which the tests didn't
account for. This caused the tests to fail when window.devicePixelRatio
was higher than 1.
Properly restore the default styleSetting a style to null does restore it in FF, Chrome, Safari and Edge.
But it does not work in Internet Explorer. The proper way to restore to
default values is to set it to the empty string. This works in all
browsers. Fixes issue #808.
Always send mouseUp events properlyIf down is false we can't just toggle the current internal state, even
though this is correct most of the time. There are cases where we don't
get the down event and thus won't have a correct internal state. For
example, when clicking in the session after using the clipboard
textarea.
If down is false, we always want to send a mouse event with the button
in 'up'-state.
Hide internal keyboard functionsThese may change and are not part of a stable API.
This also reindents the object functions to make sure they can
access private functions.