Re: Change DocumentType on a loaded Document
Boris Zbarsky <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Message-ID | <[email protected]> |
[email protected] wrote: > I am now more interested in getting this one to work. My current setup > is first use openUrl() to open "about:blank" page. Then I get a > nsIDOMDocument out of it, I clear the body and repopulate it with the > HTML DOM from the other program. Sometimes the HTML DOM needs to go > through big structural change that I want to batch the changes. If you're doing the append as a single AppendChild() on the root node, that should be all the batching you want, no? > At some point, if I can > swap out the old nsIDOMDocument from the nsIDOMWindow and let it > display the new document, I will be all set. Could you please explain > a little more detail how the last step can be done? See the DOMDocument property on nsIContentViewer. You should be able to get to one from the docshell for the document... Note that this may or may not work depending on the StartLayout() stuff. If it doesn't, then you can't do this from JS. > I also encounter one other problem in this process. Mozilla does not > appear to take the <base> I set in the <head> of the DOM That's correct. <base> is handled at parse-time. There's a bug on this, as I recall. > Is there an attribute that I can set in > DOM API that will achieve the same effect as openUrl()? Not really. -Boris