mozilla/addon-sdk — pull request #623 by ZER0 (2012-10-18 19:31:34+00:00)
Title: Bug 803027 - Re-implement `selection` module

This is the new version of the Selection module fixes:

- bug 572492: accel-click generates null selection when there are existing selections
- bug 661884: Selection events occur only after (successful!) page load
- bug 801347: `selection` events are not fired for existing document
- bug 801348: `selection` listeners are not removed when the add-on is disabled / uninstalled
- bug 801452: Set `selection.text` should set the value given as text

Plus:

- Removed the additional `span` created in the document every time selection's text is modified
- Added `iterator` method in order to iterate with `for...of`
- Removed usage of deprecated modules like observers and more important Tab Tracker
- Removed mention to WONTFIX bug 560716 from code and unit test
- Update the Unit Test to commonJS ones
- Update the Unit Test with new tests for the bug fixed, plus the test for selection listeners that were missing since the start
- Refactoring the code to make easier supports Fennec (still not supported in this commit)