Move HTMLDialogElement handling out of Element::removedFromAncestor() since this is a very hot code path. Instead, move the logic to HTMLDialogElement::removedFromAncestor().
Pull request: https://github.com/WebKit/WebKit/pull/3490