This is more efficient when the same HTML is reused multiple times, e.g. for measuring it first and then rendering it. The new function also makes it simpler to parse HTML and manipulate it in some way before measuring and rendering it.