File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
packages/svelte/tests/runtime-legacy/samples/dynamic-element-svg-implicit-namespace Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { test } from '../../test' ;
2
+
3
+ export default test ( {
4
+ html : '<svg><path></path></svg>' ,
5
+
6
+ test ( { assert, target } ) {
7
+ const svg = target . querySelector ( 'svg' ) ;
8
+ const rect = target . querySelector ( 'path' ) ;
9
+ assert . equal ( svg ?. namespaceURI , 'http://www.w3.org/2000/svg' ) ;
10
+ assert . equal ( rect ?. namespaceURI , 'http://www.w3.org/2000/svg' ) ;
11
+ }
12
+ } ) ;
Original file line number Diff line number Diff line change
1
+ <script >
2
+ // ensure these are treated as dynamic, despite whatever
3
+ // optimisations we might apply
4
+ export let svg = ' svg' ;
5
+ export let path = ' path' ;
6
+ </script >
7
+
8
+ <svelte:element this ={svg }>
9
+ <svelte:element this ={path }></svelte:element >
10
+ </svelte:element >
You can’t perform that action at this time.
0 commit comments