Rob Shearman : mshtml: Fix HTMLDocument3_get_documentElement to get the right nsIDOMNode.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jun 25 07:28:34 CDT 2007


Module: wine
Branch: master
Commit: 860d30eef269a4fd1b1ceec95b0f7570faf8f77c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=860d30eef269a4fd1b1ceec95b0f7570faf8f77c

Author: Rob Shearman <rob at codeweavers.com>
Date:   Sun Jun 24 09:19:24 2007 +0100

mshtml: Fix HTMLDocument3_get_documentElement to get the right nsIDOMNode.

---

 dlls/mshtml/htmldoc3.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/dlls/mshtml/htmldoc3.c b/dlls/mshtml/htmldoc3.c
index 21ee257..75c089d 100644
--- a/dlls/mshtml/htmldoc3.c
+++ b/dlls/mshtml/htmldoc3.c
@@ -117,6 +117,7 @@ static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, I
     HTMLDocument *This = HTMLDOC3_THIS(iface);
     nsIDOMDocument *nsdoc;
     HTMLDOMNode *node;
+    nsIDOMElement *nselem = NULL;
     nsresult nsres;
 
     TRACE("(%p)->(%p)\n", This, p);
@@ -131,7 +132,12 @@ static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, I
         ERR("GetDocument failed: %08x\n", nsres);
 
     if(nsdoc) {
-        node = get_node(This, (nsIDOMNode*)nsdoc);
+        nsres = nsIDOMHTMLDocument_GetDocumentElement(nsdoc, &nselem);
+        if(NS_FAILED(nsres))
+            ERR("GetDocumentElement failed: %08x\n", nsres);
+    }
+    if(nselem) {
+        node = get_node(This, (nsIDOMNode *)nselem);
         nsIDOMDocument_Release(nsdoc);
 
         IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)p);




More information about the wine-cvs mailing list