Re: IsElement() and nsIElement
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <94ef45af-f210-4566-b22c-cf7a76e18c37@s21g2000pri.googlegroups.com> |
On Apr 22, 8:01 pm, Boris Zbarsky <[email protected]> wrote: > So I'm looking at creating a non-virtual IsElement(). > > While examining the callsites, it seems like a lot of the use is in > assertions in places where we want to be sure we're dealing with an > Element node. Would it make sense to create an nsIElement for now, > sitting between nsIContent and nsGenericElement, to just enforce this > sort of invariant in function signatures? Or should we just make such > functions take nsGenericElement arguments? Or maybe that plus rename > nsGenericElement to mozilla::dom::Element or something? > > -Boris I'm not a fan of the idea of spreading nsGenericElement around too widely, but if we rename it mozilla::dom::Element I'd be ok with that. But Ehsan does have a point in that it does contain a lot of internals that are never really meant for code outside of the guts of our elements, but those could of course be made protected etc. So I think if we pay attention to that and protect the internals, it could work, but writing a separate Element (or nsIElement) class would work for me as well.