On Nov 2, 9:43 pm, "Xu Jianbin" <[EMAIL PROTECTED]> wrote:
> HI, all:
> I have added some code in nsDocShell::EndPageLoad:
> nsDocShell::EndPageLoad(nsIWebProgress * aProgress,
> nsIChannel * aChannel, nsresult aStatus)
> {
> //
> // one of many safeguards that prevent death and destruction if
> // someone is so very very rude as to bring this window down
> // during this load handler.
> //
> nsCOMPtr<nsIDocShell> kungFuDeathGrip(this);
> //
> // Notify the ContentViewer that the Document has finished loading...
> //
> // This will cause any OnLoad(...) handlers to fire, if it is a HTML
> // document...
> if (!mEODForCurrentDocument && mContentViewer) {
> mIsExecutingOnLoadHandler = PR_TRUE;
> mContentViewer->LoadComplete(aStatus);
> mIsExecutingOnLoadHandler = PR_FALSE;
>
> mEODForCurrentDocument = PR_TRUE;
>
> //Added By Xu Jianbin Oct 18 2007 for handling time out
> nsCOMPtr<nsIDocumentViewer> DocViwer(do_QueryInterface(mContentViewer));
>
> DocViwer->GetDocument(getter_AddRefs(HtmlDoc));
> nsAutoString ContentType;
> HtmlDoc->GetContentType(ContentType);
>
> if(ContentType.EqualsLiteral("text/html"))
> {
> nsCOMPtr<nsIHTMLDocument> tmpHtmlDoc =do_QueryInterface(HtmlDoc);
> nsIContent *tmpRoot = HtmlDoc->GetRootContent();
>
> // search for body element
> nsIContent *tmpBody =FindTagInHtml( tmpRoot, nsHTMLAtoms::body);
>
> }
> .........
>
> }
>
> nsIContent *FindTagInHtml(nsIContent *aContent, nsIAtom *aTag)
> {
> nsINodeInfo * ni2 =aContent->GetNodeInfo();
>
> // It's possible that some of leaves is special node.
> if(ni2&&(ni2->Equals(aTag)))
> return aContent;
Looks like you need a call to Tag() in there somewhere.
Rob
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout