mirror of https://github.com/sveltejs/svelte
fix: check options namespace for top level `svelte:element`s (#14101)
We were checking it for nested elements, but not root elements fixes #13875pull/14109/head
parent
96c299afc6
commit
4ec9986cba
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: check options namespace for top level `svelte:element`s
|
@ -0,0 +1,12 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: '<svg><rect fill="black" width="10" height="90"></rect></svg>',
|
||||
|
||||
test({ assert, target }) {
|
||||
const svg = target.querySelector('svg');
|
||||
const rect = target.querySelector('rect');
|
||||
assert.equal(svg?.namespaceURI, 'http://www.w3.org/2000/svg');
|
||||
assert.equal(rect?.namespaceURI, 'http://www.w3.org/2000/svg');
|
||||
}
|
||||
});
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
import Rect from './rect.svelte';
|
||||
</script>
|
||||
|
||||
<svg>
|
||||
<Rect />
|
||||
</svg>
|
@ -0,0 +1,7 @@
|
||||
<svelte:options namespace="svg" />
|
||||
|
||||
<script>
|
||||
const tag = 'rect';
|
||||
</script>
|
||||
|
||||
<svelte:element this={tag} fill="black" width="10" height="90" />
|
Loading…
Reference in new issue