Module: wine Branch: master Commit: 9240ed581f5e1f35bb40537bada0b43d9a93b396 URL: https://source.winehq.org/git/wine.git/?a=commit;h=9240ed581f5e1f35bb40537ba...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Mar 21 14:41:02 2019 +0100
mshtml: Use get_parentWindow for IHTMLDocument2::get_Script implementation.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/mshtml/htmldoc.c | 6 +++--- dlls/mshtml/tests/dom.c | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 690ab08..20d1c74 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -213,12 +213,12 @@ static HRESULT WINAPI HTMLDocument_Invoke(IHTMLDocument2 *iface, DISPID dispIdMe static HRESULT WINAPI HTMLDocument_get_Script(IHTMLDocument2 *iface, IDispatch **p) { HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
- *p = (IDispatch*)&This->window->base.IHTMLWindow2_iface; - IDispatch_AddRef(*p); - return S_OK; + hres = IHTMLDocument7_get_parentWindow(&This->IHTMLDocument7_iface, (IHTMLWindow2**)p); + return hres == S_OK && !*p ? E_PENDING : hres; }
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 c4d30ca..8c7548a 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -6925,6 +6925,7 @@ static void test_dom_implementation(IHTMLDocument2 *doc) IHTMLDocument7 *new_document; IHTMLLocation *location; IHTMLWindow2 *window; + IDispatch *disp;
str = a2bstr("test"); hres = IHTMLDOMImplementation2_createHTMLDocument(dom_implementation2, str, &new_document); @@ -6947,6 +6948,9 @@ static void test_dom_implementation(IHTMLDocument2 *doc) hres = IHTMLDocument2_get_parentWindow(new_document2, &window); ok(hres == E_FAIL, "get_parentWindow returned: %08x\n", hres);
+ hres = IHTMLDocument2_get_Script(new_document2, &disp); + ok(hres == E_PENDING, "get_Script returned: %08x\n", hres); + hres = IHTMLDocument2_get_location(new_document2, &location); ok(hres == E_UNEXPECTED, "get_location returned: %08x\n", hres);