When navigating vi the up/down arrow keys, the user often wants to move
multiple lines in sequence (e.g., to visually place the caret in one of
the following lines). To stop the caret suddenly jumping to the left
side of the page when crossing an empty paragraph, the caret's X position
will be stored and re-used by subsequent up/down movement for up to 2s
after navigating by line.
Any other operations performed by the local user (e.g., cursor movement
to the left or right), or edit operations by collaborative users will
immediately clear the stored X position.
Deleting the caret before calling ensures there is no way for any external
sources to get access to the soon-to-be destroyed caret.
As part of tracking this down, scheduled tasks will now throw an error
if an attempt is made to trigger the task (either delayed or immediate)
after the particular instance has been destroyed.
This then showed that functions bound to browser events swallow errors
quietly, so additional logging was added to the EventManager delegation
code to ensure errors generated when processing an event are logged.
* remove @license tag (to prevent Closure compiler keeping the comment)
* use copyright@kogmbh.com email address everywhere
* remove "additional permission", to be added only to released webodf.js
* separate license header by empty line from following content
Using requestAnimationFrame ensures the callback is executed prior to
the next redraw, eliminating undesirable & highly visible flickers for
UI updates.
Fixes issue #491.
Drawing the cursor on every mouse move event badly impacts the responsiveness
of the application, because the move events buffer in the browser until
every single event is processed. By setting these on a background timer,
the cursor is updated asap, but is able to aggregate multiple move events
received in this time period.