Re: FireFox 4 crashes when trying to find the parent document for an internal document using DOM API GetParentDocument()
smaug <[email protected]> Tue, 03 May 2011 14:49:53 +0300
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Message-ID | <[email protected]> |
On 05/03/2011 02:36 PM, Madhu Tadiparthi wrote:
> I have a web application where I have frames/Iframes in that. What I am
> trying is to get the top level document from the internal document which is
> a child of Frame/Iframe. I am facing an issue in getting the parent document
> node from an internal document node in FireFox 4 using GetParentDocument
> API. The browser is crashing at the Line 7 in the sample code. Here is the
> sample code that I tried. The same is working good till Firefox 3.6
>
> nsIDocument* getParentDocument(nsIDOMHTMLDocumentPtr htmlDocument )
> {
> nsIDocumentPtr document = do_QueryInterface(htmlDocument) ;
> nsIDocument* parentDoc ;
> parentDoc = document->GetParentDocument(); //Line 7
> return parentDoc;
> }
>
> How can I get the parent document for the internal documents. Any
> inputs/comments are higly appreciated.
Have you debugged why the code is crashing?
Is 'document' null when you call GetParentDocument()?
If so, I assume also htmlDocument is null, unless you use
the same binary for Fx3.6 and Fx4.0.
(nsIDocument interface has changed in Fx4.0, so you can't use the
exactly *binary* code to access the object in Fx3.6 and Fx4.0.
You need to at least recompile the code.)
-Olli
>
> Thanks
> Madhu Tadiparthi