Refactor tag name resolve into Element::resolveTagName()