// MathML logic is technically dom-specific, but the logic is placed in core // because splitting it out of core would lead to unnecessary complexity in both // the renderer and compiler implementations. // Related files: // - runtime-core/src/renderer.ts // - compiler-core/src/transforms/transformElement.ts import { vtcKey } from '../../runtime-dom/src/components/Transition' import { h, nextTick, ref, render } from '../src' describe('MathML support', () => { afterEach(() => { document.body.innerHTML = '' }) test('should mount elements with correct html namespace', () => { const root = document.createElement('div') document.body.appendChild(root) const App = { template: ` `, } render(h(App), root) const e0 = document.getElementById('e0')! expect(e0.namespaceURI).toMatch('Math') expect(e0.querySelector('#e1')!.namespaceURI).toMatch('Math') expect(e0.querySelector('#e2')!.namespaceURI).toMatch('Math') expect(e0.querySelector('#e3')!.namespaceURI).toMatch('Math') expect(e0.querySelector('#e4')!.namespaceURI).toMatch('xhtml') expect(e0.querySelector('#e5')!.namespaceURI).toMatch('svg') }) test('should patch elements with correct namespaces', async () => { const root = document.createElement('div') document.body.appendChild(root) const cls = ref('foo') const App = { setup: () => ({ cls }), template: `