Skip to content

Unwanted detection of SVG elements in foreign namespace #6257

@halfnelson

Description

@halfnelson

Describe the bug
When using a foreign namespace, svelte is detecting some elements as SVG which changes is handling of the elements including lower casing the attributes. Expected behaviour would be to skip special SVG handling when in a foreign namespace.

This has hit svelte-nodegui which has an element called 'view' which is triggering svelte to place it in the SVG namespace and force attributes to match SVG case ( nodegui/svelte-nodegui#43 )

<svelte:options namespace="foreign" />
<window>
    <view class="vertical">
	window_1 = document.createElementNS("https://svelte.dev/docs#svelte_options", "window");
	view2 = svg_element("view");
	view0 = svg_element("view");
	text0 = svg_element("text");

To Reproduce

REPL: https://svelte.dev/repl/a64f21f99f3d48de992a731a76818c32?version=3.37.0

Expected behavior
all elements should be treated as foreign namespace (unless they have an xmlns attribute)

Severity
This is blocking users of svelte-nodegui from using certain attributes like readOnly and wordWrap

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions