I am getting an Uncaught TypeError: Illegal constructor. for a basically empty constructor:
export class Citation extends HTMLSpanElement {
constructor() {
super();
}
}
A comment in this helpful answer claimed that
I encountered the same error with Web Components but only on Safari (not Firefox). Cause was that I did a class UserAvatar extends HTMLSpanElement (rather than HTMLElement)
This made me try out HTMLElement and this in fact removed the error. So now I am wondering. What HTML elements can I extend? Why can I not extend the span element? There are a couple of similar questions: Uncaught TypeError: Illegal constructor when extending HTMLButtonElement, How to create new instance of an extended class of custom elements. But they are a bit older and in this answer it is claimed that this should now work since october 2018. I am using an up to date firefox browser so I am confused...
Anybody know whats going on?