瀏覽代碼

SVGLoader: get use.href attr with explicit namespace (#23297)

Victor Nakoryakov 3 年之前
父節點
當前提交
be9d017eca
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      examples/js/loaders/SVGLoader.js

+ 3 - 1
examples/js/loaders/SVGLoader.js

@@ -110,7 +110,9 @@
 
 					case 'use':
 						style = parseStyle( node, style );
-						const usedNodeId = node.href.baseVal.substring( 1 );
+
+						const href = node.getAttributeNS( "http://www.w3.org/1999/xlink", "href" ) || "";
+						const usedNodeId = href.substring( 1 );
 						const usedNode = node.viewportElement.getElementById( usedNodeId );
 
 						if ( usedNode ) {