Closed Bug 509383 Opened 11 years ago Closed 11 years ago

InputHandler.js thrown errors sometimes

Categories

(Firefox for Android Graveyard :: General, defect)

x86
Linux
defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: vingtetun, Assigned: froystig)

References

Details

Attachments

(1 file)

I've not found the exact way to reproduce this problem but it's very common.

Error: this._downUpEvents[1] is undefined
Source File: chrome://browser/content/InputHandler.js
Line: 697

Sometimes I've also this._downUpEvents[3] is undefined
The problem was that the single click timeout was clearing the queue of recorded mouse up and mouse down events entirely.  The steps to reproduce were:

1) mousedown
2) mouseup and immediately mousedown again, holding the mousedown
3) mouseup
4) error

The single click timeout gets fired during (2), while mousedown is being held, which means the second mousedown event was recorded and then wiped.  When the final mouseup event gets recorded, it is placed in the first index of the _downUpEvents array and therefore everything is in a lower index than we assume.

Attached is a patch that fixes this by only splicing out from the front of the recorded mousedown/mouseup events queue precisely the events recorded in determining the click type (so bottom two on single click, bottom four on double click).  The MouseModule._cleanClickBuffer function still accepts no arguments in case we want to clear the queue entirely.
Assignee: nobody → froystig
Attachment #394149 - Flags: review?(pavlov)
Attachment #394149 - Flags: review?(pavlov) → review+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
hard to verify this, but after 5 minutes of mousedown/up I didn't see any errors.

verified on nightly build 08/13/2009
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.