[PATCH] Implement IHTMLElement get_document

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Thu Oct 30 05:38:23 CDT 2008


---
 dlls/mshtml/htmlelem.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c
index 4e7b747..689acb7 100644
--- a/dlls/mshtml/htmlelem.c
+++ b/dlls/mshtml/htmlelem.c
@@ -579,8 +579,23 @@ static HRESULT WINAPI HTMLElement_get_onmouseup(IHTMLElement *iface, VARIANT *p)
 static HRESULT WINAPI HTMLElement_get_document(IHTMLElement *iface, IDispatch **p)
 {
     HTMLElement *This = HTMLELEM_THIS(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    HRESULT hr;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    if(!p)
+        return E_POINTER;
+
+    *p = NULL;
+
+    if(!This->node.doc->nsdoc) {
+        WARN("NULL nsdoc\n");
+        return E_UNEXPECTED;
+    }
+
+    hr = IHTMLDocument2_QueryInterface(HTMLDOC(This->node.doc), &IID_IHTMLDocument, (void**)p);
+
+    return hr;
 }
 
 static HRESULT WINAPI HTMLElement_put_title(IHTMLElement *iface, BSTR v)
-- 
1.5.4.3


--------------090008040602000905070909--



More information about the wine-patches mailing list