ded/bonzo — pull request #76 by runningskull (2012-04-06 19:12:12+00:00)
Title: offset() doesn't account for parents' scrollTop & scrollLeft

In the current version, an element's `offset()` doesn't take into account its parents' `scrollLeft` and `scrollTop`. Those should take that into account, for all elements except the body.

This patch teaches `offset()` to take scrolling into account. I included a couple tests, but they don't test every possible edge case (negative scroll values, for instance) b/c it didn't seem necessary.

Let me know if it needs more coverage, or if there's some reason we shouldn't be doing this at all.

ps. This is also how jQuery's `offset()` works, although they use `getBoundingClientRect()` if possible. I haven't looked into the pros/cons of that approach.