Added Element.connected to invoke a function when the element has the ancestor in its hierarchy.