Re: IsElement() and nsIElement

Boris Zbarsky <[email protected]> Fri, 23 Apr 2010 12:46:03 -0400
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
On 4/22/10 11:14 PM, Ehsan Akhgari wrote:
> I've been frustrated more than once because we don't provide any
> obvious way of passing elements around, instead of passing an
> nsIContent and letting the function ensure that it's getting an
> element.  However, I think passing elements as nsGenericElement is a
> mistake, because it's a concerete class with lots of implementation
> details, which not all callers would need.

Here's the thing.  One of the long-term goals here is to get rid of 
virtual dispatch at callsites that know they have an element, as much as 
possible.  That means that either we need to put things that we expect 
to be commonly called on nsIElement and make them non-virtual or 
something along those lines.  That might not lead to us putting too much 
in the way of implementation details on nsIElement, but it's worth 
keeping in mind.

-Boris