Jelajahi Sumber

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

Victor Nakoryakov 3 tahun lalu
induk
melakukan
be9d017eca
1 mengubah file dengan 3 tambahan dan 1 penghapusan
  1. 3 1
      examples/js/loaders/SVGLoader.js

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

@@ -110,7 +110,9 @@
 
 
 					case 'use':
 					case 'use':
 						style = parseStyle( node, style );
 						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 );
 						const usedNode = node.viewportElement.getElementById( usedNodeId );
 
 
 						if ( usedNode ) {
 						if ( usedNode ) {