1. A method comprising: receiving a user event at a touchscreen of an electronic device during display of a document by the touchscreen; dispatching the user event for processing by a main thread of a web browser, the main thread of the web browser configured to process user events and non-user events; after a predetermined period of time has elapsed following the dispatch of the user event for processing by the main thread of the web browser, processing the user event by a secondary thread, the secondary thread configured to process the user event using a default handling method; and upon a first one of the main thread and the secondary thread completing processing of the user event, updating the display of the document according to the processing completed by that first one of the main thread and the secondary thread.