Boris Zbarsky wrote:

We have a bunch of chrome and extension code that does things like "instanceof HTMLAnchorElement" (and likewise with other DOM interfaces).

c-c MXR suggests 305 cases of "instanceof HTML.*Element". There are also 18 "instanceof XUL.*Element, 13 "instanceof Element", 14 "instanceof Node" and 16 "instanceof Document". (A few NodeLists crept in there too, but they're affected anyway.)

More importantly it suggests 311 for the similar "instanceof Components.interfaces.nsIDOMHTMLAnchorElement" (or equivalent) often used in components and modules of course.

So although the 360 or so cases could be changed to e.g. Node.isNode(obj), that could still potentially exclude a number of cases. Presumably there's no easy way to avoid the "el instanceof el.ownerDocument.defaultView.HTMLAnchorElement" from a component?

the nsIDOMHTML* interfaces, which we'd like to get rid of to reduce memory usage and whatnot.

Presumably this involves completely removing all XPIDL DOM interfaces from HTML nodes, thus saving one vtable entry per node?

--
Warning: May contain traces of nuts.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to