Uppercase element.tagName for HTML elements only

Fixes #3146