Re: Where does mozilla build a table of attribute for each node
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <22660141-d811-4558-a4b0-3f9e02670e52@k39g2000hsf.googlegroups.com> |
On Jan 28, 6:07 pm, Boris Zbarsky <[email protected]> wrote: > [email protected] wrote: > > Thank you. I have searched for SetAttr, but the result does not show > > nsHTMLContentSink. > > >http://lxr.mozilla.org/mozilla1.8.0/ident?i=SetAttr > > Uh... That URI shows hits in nsHTMLContentSink. > > > And why not all html elements have SetAttr() function? > > You mean the implementation? It's on the superclass (nsGenericElement), > generally speaking. Only the ones that have to do something weird with > attributes override it. > > -Boris I am trying to override SetAttr() of the Embed Element so that if the attribute value has a string 'false', i want to replace it with true' <EMBED attr="false;something something something"> I want to replace it with in c++: <EMBED attr="true;something something something"> Can you please tell me how can I over-ride the SetAttr() to achieve that? The parameter 'aValue' is a const, so I can modify it: SetAttr(PRInt32 aNamespaceID, nsIAtom* aName, nsIAtom* aPrefix, const nsAString& aValue, PRBool aNotify) And how can I allocation memory for the new value string, replace 'false' with 'true' and then call the parent SetAttr()? And do I need to free the memory of the 'aValue' passed in to this SetAttr()? Thank you.