enyojs/enyo — pull request #242 by onecrayon (2013-03-06 22:13:20+00:00)
Title: Bugfix for enyo.dom.calcNodePosition

I ran into an edge case where the position calculations could default to measuring from the wrong element when passing a relativeToNode if the relativeToNode was not an offsetParent.

This bugfix tweaks the measurement behavior to ensure that it adjusts for that scenario, and adds some comments explaining the logic in plain English.

**Please note** that the `compareDocumentPosition` function I am using is only supported in IE 9+. If this is a problem, let me know and I will write some code to enable the comparison in older versions of IE.