Update behavior of Document.createElement

Fixes #4009.

Only lower-case the argument to Document#createElement if it's a HTML document.