From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmllocation.c | 16 ++++++++++++++++ dlls/mshtml/tests/documentmode.js | 3 +++ 2 files changed, 19 insertions(+)
diff --git a/dlls/mshtml/htmllocation.c b/dlls/mshtml/htmllocation.c index 5c7e66c40df..b176b56280c 100644 --- a/dlls/mshtml/htmllocation.c +++ b/dlls/mshtml/htmllocation.c @@ -225,12 +225,28 @@ static HRESULT WINAPI HTMLLocation_get_host(IHTMLLocation *iface, BSTR *p) HTMLLocation *This = impl_from_IHTMLLocation(iface); URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW)}; HRESULT hres; + IUri *uri;
TRACE("(%p)->(%p)\n", This, p);
if(!p) return E_POINTER;
+ if(dispex_compat_mode(&This->window->base.inner_window->event_target.dispex) >= COMPAT_MODE_IE10) { + if(!(uri = get_uri(This))) { + *p = NULL; + return S_OK; + } + + hres = IUri_GetAuthority(uri, p); + if(hres == S_OK || FAILED(hres)) + return hres; + + SysFreeString(*p); + *p = NULL; + return S_OK; + } + url.dwHostNameLength = 1; hres = get_url_components(This, &url); if(FAILED(hres)) diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 18749938658..e599cf2b96b 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -1184,8 +1184,11 @@ async_test("script_load", function() { });
sync_test("location", function() { + var v = document.documentMode; document.body.innerHTML = '<a name="testanchor">test</a>';
+ ok(location.host === "winetest.example.org" + (v < 10 ? ":80" : ""), "location.host = " + location.host); + ok(location.hash === "", "initial location.hash = " + location.hash); location.hash = "TestAnchor"; ok(location.hash === "#TestAnchor", "location.hash after set to TestAnchor = " + location.hash);