From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 14 +++++++++----- dlls/mshtml/tests/navigation.js | 2 ++ 2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index b0872207819..e7ff2771050 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1188,10 +1188,12 @@ static HRESULT WINAPI HTMLDocument_put_cookie(IHTMLDocument2 *iface, BSTR v)
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- if(!This->outer_window) + if(!This->window) return S_OK; + if(!This->window->base.outer_window) + return E_FAIL;
- bret = InternetSetCookieExW(This->outer_window->url, NULL, v, 0, 0); + bret = InternetSetCookieExW(This->window->base.outer_window->url, NULL, v, 0, 0); if(!bret) { FIXME("InternetSetCookieExW failed: %lu\n", GetLastError()); return HRESULT_FROM_WIN32(GetLastError()); @@ -1208,13 +1210,15 @@ static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p)
TRACE("(%p)->(%p)\n", This, p);
- if(!This->outer_window) { + if(!This->window) { *p = NULL; return S_OK; } + if(!This->window->base.outer_window) + return E_FAIL;
size = 0; - bret = InternetGetCookieExW(This->outer_window->url, NULL, NULL, &size, 0, NULL); + bret = InternetGetCookieExW(This->window->base.outer_window->url, NULL, NULL, &size, 0, NULL); if(!bret && GetLastError() != ERROR_INSUFFICIENT_BUFFER) { WARN("InternetGetCookieExW failed: %lu\n", GetLastError()); *p = NULL; @@ -1230,7 +1234,7 @@ static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p) if(!*p) return E_OUTOFMEMORY;
- bret = InternetGetCookieExW(This->outer_window->url, NULL, *p, &size, 0, NULL); + bret = InternetGetCookieExW(This->window->base.outer_window->url, NULL, *p, &size, 0, NULL); if(!bret) { ERR("InternetGetCookieExW failed: %lu\n", GetLastError()); return E_FAIL; diff --git a/dlls/mshtml/tests/navigation.js b/dlls/mshtml/tests/navigation.js index ad10372b4c6..bc24fa646d3 100644 --- a/dlls/mshtml/tests/navigation.js +++ b/dlls/mshtml/tests/navigation.js @@ -119,6 +119,8 @@ function detached_iframe_doc() { expect_exception(function() { origDoc.onclick; }, true); expect_exception(function() { origDoc.toString; }, true); expect_exception(function() { origDoc.toString(); }, true); + expect_exception(function() { origDoc.cookie; }); + expect_exception(function() { origDoc.cookie = "test=val"; }); expect_exception(function() { origDoc.domain; }); expect_exception(function() { origDoc.frames; }); expect_exception(function() { origDoc.readyState; }, true);