From 8d8fdb8a567fd74f5a5e656cf07bb0e966703261 Mon Sep 17 00:00:00 2001 From: Christoph Sanz <22081130+christophsanz@users.noreply.github.com> Date: Fri, 6 Jun 2025 23:25:51 +0200 Subject: [PATCH] fix: add `xmlns` attribute to HTMLAttributes type (#16080) * Add `xmlns` attribute to HTMLAttributes type The `xmlns` attribute is not only allowed on SVG elements, but on all HTML elements. * move to DOMAttributes --------- Co-authored-by: Rich Harris --- .changeset/metal-rivers-laugh.md | 5 +++++ packages/svelte/elements.d.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/metal-rivers-laugh.md diff --git a/.changeset/metal-rivers-laugh.md b/.changeset/metal-rivers-laugh.md new file mode 100644 index 0000000000..2b6f47e84b --- /dev/null +++ b/.changeset/metal-rivers-laugh.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: move xmlns attribute from SVGAttributes to to DOMAttributes diff --git a/packages/svelte/elements.d.ts b/packages/svelte/elements.d.ts index 7a7889ad9e..8a1bdd0e6d 100644 --- a/packages/svelte/elements.d.ts +++ b/packages/svelte/elements.d.ts @@ -463,6 +463,8 @@ export interface DOMAttributes { 'on:fullscreenerror'?: EventHandler | undefined | null; onfullscreenerror?: EventHandler | undefined | null; onfullscreenerrorcapture?: EventHandler | undefined | null; + + xmlns?: string | undefined | null; } // All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/ @@ -1809,7 +1811,6 @@ export interface SVGAttributes extends AriaAttributes, DO 'xlink:type'?: string | undefined | null; 'xml:base'?: string | undefined | null; 'xml:lang'?: string | undefined | null; - xmlns?: string | undefined | null; 'xmlns:xlink'?: string | undefined | null; 'xml:space'?: string | undefined | null; y1?: number | string | undefined | null;