Jacek Caban (@jacek) commented about dlls/mshtml/htmlwindow.c:
- if(FAILED(hres))
return;
- nsres = nsIDOMDocument_GetImplementation(doc_node->dom_document, &implementation);
- if(NS_FAILED(nsres))
return;
- nsAString_InitDepend(&nsstr, L"");
- nsres = nsIDOMDOMImplementation_CreateHTMLDocument(implementation, &nsstr, &nsdoc);
- nsIDOMDOMImplementation_Release(implementation);
- nsAString_Finish(&nsstr);
- if(NS_FAILED(nsres))
return;
- hres = create_document_node(nsdoc, window->browser, window->pending_window, COMPAT_MODE_QUIRKS, &window->pending_window->doc);
- nsIDOMDocument_Release(nsdoc);
This seems a bit hackish. The main problem is that those changes are not reflected on Gecko side, so Gecko HTML window will still reference the old document. Maybe we should actually load about:blank instead (possibly by-passing urlmon al letting Gecko take care of it)? Or maybe there is some Gecko API that would do that better?