Created attachment 635385 [details] Test case STR: 1. Load given file. 2. Select a word via long text. 3. After a few seconds selection is collapsed. 4. Handles awkwardly remain, with no highlighted text in between them. Expected result: Handles should go away along with selection.
Created attachment 636853 [details] [diff] [review] patch I was running into a problem where a normal endSelection call was clearing the selection, then my listener was firing and calling endSelection again. I tried fixing this by checking _active in the listener, but that didn't work because _active was being flipped at the bottom of the method. To fix this we should flip _active at the beginning of endSelection, and we never want to be executing the rest of this method if there's no active selection, so I added a check to bail.
Uplifted to aurora as part of a roll-up patch: https://hg.mozilla.org/releases/mozilla-aurora/rev/2fb0a358eaf6