DarkDOM#contain: support factory