mshtml: Moved more code to handle_docobj_load.

This commit is contained in:
Jacek Caban 2010-10-06 21:35:39 +02:00 committed by Alexandre Julliard
parent 6fff7e7c05
commit f7910c9304
1 changed files with 39 additions and 37 deletions

View File

@ -178,11 +178,18 @@ static nsresult NSAPI handle_keypress(nsIDOMEventListener *iface,
static void handle_docobj_load(HTMLDocumentObj *doc)
{
IOleCommandTarget *olecmd = NULL;
HRESULT hres;
if(!doc->client)
return;
if(doc->nscontainer->editor_controller) {
nsIController_Release(doc->nscontainer->editor_controller);
doc->nscontainer->editor_controller = NULL;
}
if(doc->usermode == EDITMODE)
handle_edit_load(&doc->basedoc);
if(doc->client) {
IOleCommandTarget *olecmd = NULL;
hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(SUCCEEDED(hres)) {
@ -206,37 +213,32 @@ static void handle_docobj_load(HTMLDocumentObj *doc)
IOleCommandTarget_Release(olecmd);
}
}
doc->download_state = 0;
}
static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event)
{
HTMLDocumentNode *doc = NSEVENTLIST_THIS(iface)->This->doc;
HTMLDocumentObj *doc_obj;
nsIDOMHTMLElement *nsbody = NULL;
HTMLDocumentObj *doc_obj = NULL;
TRACE("(%p)\n", doc);
if(!doc || !doc->basedoc.window)
return NS_ERROR_FAILURE;
if(doc->basedoc.doc_obj && doc->basedoc.doc_obj->basedoc.doc_node == doc)
doc_obj = doc->basedoc.doc_obj;
connect_scripts(doc->basedoc.window);
if(doc_obj->nscontainer->editor_controller) {
nsIController_Release(doc_obj->nscontainer->editor_controller);
doc_obj->nscontainer->editor_controller = NULL;
}
if(doc_obj->usermode == EDITMODE)
handle_edit_load(&doc_obj->basedoc);
if(doc == doc_obj->basedoc.doc_node)
if(doc_obj)
handle_docobj_load(doc_obj);
set_ready_state(doc->basedoc.window, READYSTATE_COMPLETE);
if(doc == doc_obj->basedoc.doc_node) {
if(doc_obj) {
if(doc_obj->view_sink)
IAdviseSink_OnViewChange(doc_obj->view_sink, DVASPECT_CONTENT, -1);