Offset: 'Make sure it's not a disconnected DOM node' performance enhanced

'Make sure it's not a disconnected DOM node' performance enhanced.
Reason: In a document tree,finding a parent is often faster than finding a child.