getElementDocumentPosition function
Implementation
Pair<num> getElementDocumentPosition(Element element) {
var obj = getVisibleNode(element);
num top = obj!.offsetTop;
num left = obj.offsetLeft;
if (obj.offsetParent != null) {
do {
top += obj!.offsetTop;
left += obj.offsetLeft;
} while ((obj = obj.offsetParent) != null);
}
return Pair<num>(left, top);
}