Fix spanAffectsWrapping for new Safari versions