On 9/21/21 5:50 PM, Gabriel Ivăncescu wrote:
On 21/09/2021 16:31, Jacek Caban wrote:
On 9/21/21 2:32 PM, Gabriel Ivăncescu wrote:
But where would we even get the name from? In HTMLElement_Create, get_tag_desc is used for specific tags, which is similar, but the "fallback" goes to HTMLGenericElement_Create, since not all tags are included there.
Sure, but I think that's what you need, see this test for an example:
var s = document.createElement("winetest").toString(); ok(s === "[object HTMLUnknownElement]", "s = " + s);
For example the "div" tag is not.
It should probably be made a separated object.
Thanks,
Jacek
Ok, I tested all the tags from:
https://www.w3schools.com/TAGS/default.ASP
It looks like there's way too many tags to properly implement each as separate object just for this.
It's not just for this, objects that return something different class names should eventually expose different sets of interfaces (like IHTMLDivElement in case of div element). It should be easy enough to distinguish between HTMLElement and HTMLUnknownElement using the existing logic. While div would also be nice to have, as long as the logic is right, it's not too bad to return slightly wrong strings objects that we don't support yet.
Jacek