Handle null and document fragment nodes in axs.utils.parentElement