[Project_owners] XPCNativeWrapper and nsIDOMNSHTMLDocument object

Axel Hecht axel at pike.org
Fri Aug 5 15:49:34 EDT 2005


Didier Ernotte wrote:
> This give me the following error
>  
> Exception... "Node cannot be inserted at the specified point in the
> hierarchy"  code: "3" nsresult: "0x80530003
> (NS_ERROR_DOM_HIERARCHY_REQUEST_ERR)"
> 
> if I add
> 
> while (doc.firstChild != null) { doc.removeChild(doc.firstChild); }
> 
> to clean the doc object before, because it seems that there are a
> pre-defined hierarchy in the browser object like
> <html><body></body></html>, FF does not crash, and I have not
> exception, but nothing append.
> 
> If I replace 
> 
> var htmlElem = document.createElement("html");
> var bodyElem = document.createElement("body");
> var embedElem = document.createElement("embed");
> 

The regular browser will show about:blank (I guess), which already has
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title></title></head><body></body></html>

So you could just append the embed to document.body.

I saw that we have 
http://developer.mozilla.org/en/docs/XPCNativeWrapper#Limitations_of_XPCNativeWrapper, 
too. That may help on the first attempt.

Axel


More information about the Project_owners mailing list