microsoft / TypeScript-DOM-lib-generator

Tool for generating dom related TypeScript and JavaScript library files
Apache License 2.0
600 stars 417 forks source link

Node.parentElement should be Element, not HTMLElement #1706

Open jonahShaf opened 2 months ago

jonahShaf commented 2 months ago

In lib.dom.d.ts Node.parentElement is defined as being HTMLelement | null. However, it should Element | null. The spec confirms this. This issue was originally fixed by #885 but was reverted in https://github.com/microsoft/TypeScript-DOM-lib-generator/commit/c81fa761df9c4483cd7f5d9767415660d4f1ee90. I didn't see any reasoning attached to that revert commit and the typing is still incorrect after the revert.

HolgerJeromin commented 2 months ago

This whole topic is not about implementing the spec but about usability. https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1151#issuecomment-922664615