adobe/brackets — pull request #2168 by gruehle (2012-11-20 22:09:53+00:00)
Title: Fixed several bugs with highlighting code

This pull request contains fixes for #2152, #2167, and probably a few more that hadn't been logged.

There are two main changes here:

1. The `_screenOffset()` function always uses `getBoundingClientRect()` to calculate the offset. The `getBoundingClientRect()` function doesn't account for document scroll position, so that is added in separately.
2. Add a capture-phase `scroll` event listener. This is called whenever *any* element in the document is scrolled (avoiding the need to add scroll handlers all over the place).