diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index b1f063f0360..e5870d882c4 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -252,8 +252,12 @@ static HRESULT WINAPI HTMLDocument_Invoke(IHTMLDocument2 *iface, DISPID dispIdMe static HRESULT WINAPI HTMLDocument_get_Script(IHTMLDocument2 *iface, IDispatch **p) { HTMLDocument *This = HTMLDOC_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + *p = (IDispatch*)HTMLWINDOW2(This->window); + IDispatch_AddRef(*p); + return S_OK; } static HRESULT WINAPI HTMLDocument_get_all(IHTMLDocument2 *iface, IHTMLElementCollection **p) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index e7a2907b12f..7e8c9bf6fb0 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -2026,6 +2026,7 @@ static void test_window(IHTMLDocument2 *doc) { IHTMLWindow2 *window, *window2, *self; IHTMLDocument2 *doc2 = NULL; + IDispatch *disp; HRESULT hres; hres = IHTMLDocument2_get_parentWindow(doc, &window); @@ -2052,6 +2053,12 @@ static void test_window(IHTMLDocument2 *doc) IHTMLWindow2_Release(window2); IHTMLWindow2_Release(self); + disp = NULL; + hres = IHTMLDocument2_get_Script(doc, &disp); + ok(hres == S_OK, "get_Script failed: %08x\n", hres); + ok(disp == (void*)window, "disp != window\n"); + IDispatch_Release(disp); + IHTMLWindow2_Release(window); }