Open
Description
Currently, the type of Document.documentElement
is HTMLElement
:
But it is possible for a Document
’s documentElement
property to be of type SVGSVGElement
which is not a subtype of HTMLElement
:
Try to run the following code:
const d = (new DOMParser()).parseFromString('<svg xmlns="http://www.w3.org/2000/svg"></svg>', 'image/svg+xml');
const k = (d instanceof Document) && (d.documentElement instanceof SVGSVGElement);
the value of k
should be true
.
Also, why isn’t there a SVGDocument
in TypeScript?