Jacek Caban : mshtml: Added IHTMLIFrameElement3:: get_contentDocument implementation.

Alexandre Julliard julliard at winehq.org
Thu Oct 11 15:25:16 CDT 2012


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Oct 11 14:09:01 2012 +0200

mshtml: Added IHTMLIFrameElement3::get_contentDocument implementation.

---

 dlls/mshtml/htmliframe.c |   15 +++++++++++++--
 dlls/mshtml/tests/dom.c  |   13 +++++++++++++
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmliframe.c b/dlls/mshtml/htmliframe.c
index 0fc3d5f..0e7b218 100644
--- a/dlls/mshtml/htmliframe.c
+++ b/dlls/mshtml/htmliframe.c
@@ -318,8 +318,19 @@ static HRESULT WINAPI HTMLIFrameElement3_Invoke(IHTMLIFrameElement3 *iface, DISP
 static HRESULT WINAPI HTMLIFrameElement3_get_contentDocument(IHTMLIFrameElement3 *iface, IDispatch **p)
 {
     HTMLIFrame *This = impl_from_IHTMLIFrameElement3(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    IHTMLDocument2 *doc;
+    HRESULT hres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    if(!This->framebase.content_window) {
+        *p = NULL;
+        return S_OK;
+    }
+
+    hres = IHTMLWindow2_get_document(&This->framebase.content_window->base.IHTMLWindow2_iface, &doc);
+    *p = (IDispatch*)doc;
+    return hres;
 }
 
 static HRESULT WINAPI HTMLIFrameElement3_put_src(IHTMLIFrameElement3 *iface, BSTR v)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 371da77..d55c3d7 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -5082,6 +5082,7 @@ static void test_frame_doc(IUnknown *frame_elem, BOOL iframe)
 static void test_iframe_elem(IHTMLElement *elem)
 {
     IHTMLDocument2 *content_doc, *owner_doc;
+    IHTMLIFrameElement3 *iframe3;
     IHTMLElementCollection *col;
     IHTMLWindow2 *content_window;
     IHTMLElement *body;
@@ -5108,6 +5109,18 @@ static void test_iframe_elem(IHTMLElement *elem)
     content_doc = get_window_doc(content_window);
     IHTMLWindow2_Release(content_window);
 
+    hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLIFrameElement3, (void**)&iframe3);
+    if(SUCCEEDED(hres)) {
+        hres = IHTMLIFrameElement3_get_contentDocument(iframe3, &disp);
+        ok(hres == S_OK, "get_contentDocument failed: %08x\n", hres);
+        ok(iface_cmp((IUnknown*)content_doc, (IUnknown*)disp), "content_doc != disp\n");
+        IDispatch_Release(disp);
+
+        IHTMLIFrameElement3_Release(iframe3);
+    }else {
+        win_skip("IHTMLIFrameElement3 not supported\n");
+    }
+
     str = a2bstr("text/html");
     V_VT(&errv) = VT_ERROR;
     disp = NULL;




More information about the wine-cvs mailing list