Make spacebar work on document load - fixes bug 864619

This PR fixes [bug 864619](https://bugzilla.mozilla.org/show_bug.cgi?id=864619), which I caused in #2773.