Hi
I made a chrome over mozilla 1.8.
I sometimes have a problem when I load the DOM with nsIWebNavigation-
>GetDocument().
I use the following code
nsCOMPtr<nsIWebNavigation> mWebNavigation;
nsCOMPtr<nsIDOMDocument> myDomDoc;
nsCOMPtr<nsIDOMHTMLDocument> myHtmlDoc;
mWebNavigation = do_QueryInterface(mWebBrowser, &rv);
rv = mWebNavigation->GetDocument(getter_AddRefs(myDomDoc));
myHtmlDoc = do_QueryInterface(myDomDoc);
nsCOMPtr<nsIDOMNodeList> aLinks;
nsresult result;
result = myHtmlDoc->GetElementsByTagName(strName,getter_AddRefs
(aLinks));
It appears that on the last call (myHtmlDoc->GetElementsByTagName),
myHtmlDoc is null.
in the nsIWebNavigation.h the following comment appears before
GetDOcument
* Retrieves the current DOM document for the frame, or lazily
creates a
* blank document if there is none. This attribute never returns
null except
* for unexpected error situations.
The problem in this cas appears after the following steps
1- I tried to load a page from an unconnected server. I just get
STATE_START:STATE_IS_REQUEST:STATE_IS_DOCUMENT:STATE_IS_NETWORK:STATE_IS_WINDOW
message into onStateCHange
2- after a while I try to load a local page and I get the error.
has anyOne an idea to correct this problem, and why I get it??
I know that unexpected means "you cannot expect", but sometimes things
are corrected.
thank's
philippe
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding