Module: wine Branch: master Commit: e604ae3e0cd1275d7722ae5af02b72ea8f9ecde5 URL: http://source.winehq.org/git/wine.git/?a=commit;h=e604ae3e0cd1275d7722ae5af0...
Author: Jacek Caban jacek@codeweavers.com Date: Wed Oct 8 13:27:33 2008 -0500
mshtml: Use stored nsdoc in handle_load.
---
dlls/mshtml/nsevents.c | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c index e79ec4e..d226ccb 100644 --- a/dlls/mshtml/nsevents.c +++ b/dlls/mshtml/nsevents.c @@ -129,9 +129,7 @@ static nsresult NSAPI handle_keypress(nsIDOMEventListener *iface, static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event) { NSContainer *This = NSEVENTLIST_THIS(iface)->This; - nsIDOMHTMLDocument *nshtmldoc; nsIDOMHTMLElement *nsbody = NULL; - nsIDOMDocument *nsdoc; task_t *task;
TRACE("(%p)\n", This); @@ -163,14 +161,12 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event */ push_task(task);
+ if(!This->doc->nsdoc) { + ERR("NULL nsdoc\n"); + return NS_ERROR_FAILURE; + }
- nsIWebNavigation_GetDocument(This->navigation, &nsdoc); - nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc); - nsIDOMDocument_Release(nsdoc); - - nsIDOMHTMLDocument_GetBody(nshtmldoc, &nsbody); - nsIDOMHTMLDocument_Release(nshtmldoc); - + nsIDOMHTMLDocument_GetBody(This->doc->nsdoc, &nsbody); if(nsbody) { fire_event(This->doc, EVENTID_LOAD, (nsIDOMNode*)nsbody); nsIDOMHTMLElement_Release(nsbody);