-
-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
document.createElement does not create SVGGraphicsElement #1079
Comments
Also this: const element = document.createElement('input');
element instanceof HTMLBodyElement;
// true |
I tested each unimplemented one and they all were console.log(element instanceof HTMLHeadElement); // true
console.log(element instanceof HTMLTitleElement); // true
console.log(element instanceof HTMLBodyElement); // true
console.log(element instanceof HTMLHeadingElement); // true
console.log(element instanceof HTMLParagraphElement); // true
console.log(element instanceof HTMLHRElement); // true
console.log(element instanceof HTMLPreElement); // true
console.log(element instanceof HTMLUListElement); // true
console.log(element instanceof HTMLOListElement); // true
console.log(element instanceof HTMLMenuElement); // true
console.log(element instanceof HTMLDListElement); // true
console.log(element instanceof HTMLDivElement); // true
console.log(element instanceof HTMLAreaElement); // true
console.log(element instanceof HTMLBRElement); // true
console.log(element instanceof HTMLCanvasElement); // true
console.log(element instanceof HTMLDataElement); // true
console.log(element instanceof HTMLDataListElement); // true
console.log(element instanceof HTMLDetailsElement); // true
console.log(element instanceof HTMLDirectoryElement); // true
console.log(element instanceof HTMLFieldSetElement); // true
console.log(element instanceof HTMLFontElement); // true
console.log(element instanceof HTMLHtmlElement); // true
console.log(element instanceof HTMLLegendElement); // true
console.log(element instanceof HTMLMapElement); // true
console.log(element instanceof HTMLMarqueeElement); // true
console.log(element instanceof HTMLMeterElement); // true
console.log(element instanceof HTMLModElement); // true
console.log(element instanceof HTMLOutputElement); // true
console.log(element instanceof HTMLPictureElement); // true
console.log(element instanceof HTMLProgressElement); // true
console.log(element instanceof HTMLQuoteElement); // true
console.log(element instanceof HTMLSourceElement); // true
console.log(element instanceof HTMLSpanElement); // true
console.log(element instanceof HTMLTableCaptionElement); // true
console.log(element instanceof HTMLTableCellElement); // true
console.log(element instanceof HTMLTableColElement); // true
console.log(element instanceof HTMLTableElement); // true
console.log(element instanceof HTMLTableRowElement); // true
console.log(element instanceof HTMLTableSectionElement); // true
console.log(element instanceof HTMLFrameElement); // true
console.log(element instanceof HTMLFrameSetElement); // true
console.log(element instanceof HTMLEmbedElement); // true
console.log(element instanceof HTMLObjectElement); // true
console.log(element instanceof HTMLParamElement); // true
console.log(element instanceof HTMLTrackElement); // true |
I guess this is in the same boat: const g = document.createElementNS("http://www.w3.org/2000/svg", "g");
const check = g instanceof SVGGElement;
// ReferenceError: SVGGElement is not defined (should be true)
const name = g.constructor.name;
// "SVGElement" (should be "SVGGElement") |
@rijenkii Probably so, but it looks like @capricorn86 is actively working on this issue (1a0f247, 1ec0724) 😄 |
Thank you for reporting @runarberg, @knownasilya, @onx2 and @rijenkii! 🙂 @onx2 This is because several HTML elements where not implemented yet. The remaining HTML elements where implemented in v15. As they where not implemented yet, they where assigned as HTMLElement. All remaining SVG elements has now also been implemented in v15.8.0. |
Describe the bug
When you create an element with
document.createElement
ordocument.createElementNS
it will incorrectly create someSVGGraphicsElements
asSVGElements
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The text was updated successfully, but these errors were encountered: