Microsoft/TypeScript

Wrong createElementNS() type definitions

Open

#24.269 aberto em 19 de mai. de 2018

Ver no GitHub
 (5 comments) (0 reactions) (0 assignees)TypeScript (6.726 forks)batch import
BugDomain: lib.d.tsHelp Wanted

Métricas do repositório

Stars
 (48.455 stars)
Métricas de merge de PR
 (Mesclagem média 6d 17h) (9 fundiu PRs em 30d)

Description

Document.createElementNS() allows to create a few nonexistent SVG elements. In particular, this function has signatures that allow creating componentTransferFunction, textContent and textPositioning, but these correspond to SVG interfaces which do not have any real element associated.

This can be easily verified by running:

document.createElementNS('http://www.w3.org/2000/svg', 'textContent') instanceof SVGTextElement; // false
document.createElementNS('http://www.w3.org/2000/svg', 'text') instanceof SVGTextElement; // true

(Note that SVGTextElement implements SVGTextContentElement.)

Guia do colaborador