@@ -941,19 +941,30 @@ module.exports = {
941941 /**
942942 * Check whether the given node is a custom component or not.
943943 * @param {VElement } node The start tag node to check.
944+ * @param {boolean } [ignoreElementNamespaces=false] If `true`, ignore element namespaces.
944945 * @returns {boolean } `true` if the node is a custom component.
945946 */
946- isCustomComponent ( node ) {
947- return (
948- ( this . isHtmlElementNode ( node ) &&
949- ! this . isHtmlWellKnownElementName ( node . rawName ) ) ||
950- ( this . isSvgElementNode ( node ) &&
951- ! this . isSvgWellKnownElementName ( node . rawName ) ) ||
952- ( this . isMathElementNode ( node ) &&
953- ! this . isMathWellKnownElementName ( node . rawName ) ) ||
947+ isCustomComponent ( node , ignoreElementNamespaces = false ) {
948+ if (
954949 hasAttribute ( node , 'is' ) ||
955950 hasDirective ( node , 'bind' , 'is' ) ||
956951 hasDirective ( node , 'is' )
952+ ) {
953+ return true
954+ }
955+
956+ const isHtmlName = this . isHtmlWellKnownElementName ( node . rawName )
957+ const isSvgName = this . isSvgWellKnownElementName ( node . rawName )
958+ const isMathName = this . isMathWellKnownElementName ( node . rawName )
959+
960+ if ( ignoreElementNamespaces ) {
961+ return ! isHtmlName && ! isSvgName && ! isMathName
962+ }
963+
964+ return (
965+ ( this . isHtmlElementNode ( node ) && ! isHtmlName ) ||
966+ ( this . isSvgElementNode ( node ) && ! isSvgName ) ||
967+ ( this . isMathElementNode ( node ) && ! isMathName )
957968 )
958969 } ,
959970
0 commit comments