Added patch to for IHTMLLocation::hash property's getter implementation.

This commit is contained in:
Sebastian Lackner 2015-09-07 00:03:21 +02:00
parent cbe5306706
commit cd7cfab427
5 changed files with 136 additions and 1 deletions

View File

@ -39,8 +39,9 @@ Wine. All those differences are also documented on the
Included bug fixes and improvements
-----------------------------------
**Bug fixes and features included in the next upcoming release [20]:**
**Bug fixes and features included in the next upcoming release [21]:**
* Add IHTMLLocation::hash property's getter implementation ([Wine Bug #32967](https://bugs.winehq.org/show_bug.cgi?id=32967))
* Add stub for dwmapi.DwmUpdateThumbnailProperties
* Add stub for winspool.SetPrinterW level 8 ([Wine Bug #24645](https://bugs.winehq.org/show_bug.cgi?id=24645))
* Allow non-nullterminated string as working directory in kernel32.create_startup_info

1
debian/changelog vendored
View File

@ -37,6 +37,7 @@ wine-staging (1.7.51) UNRELEASED; urgency=low
* Added patch to fix possible memory leak in netprofm init_networks.
* Added patch to properly initialize caps->dwZBufferBitDepths in
ddraw7_GetCaps.
* Added patch to for IHTMLLocation::hash property's getter implementation.
* Removed patch to fix bug in wineserver debug_children inheritance (accepted
upstream).
* Removed patch to use helper function for NtWaitForMultipleObjects and

View File

@ -0,0 +1,113 @@
From ac412bfe66c287d88409abc153c615c014907607 Mon Sep 17 00:00:00 2001
From: Zhenbo Li <litimetal@gmail.com>
Date: Tue, 1 Jul 2014 19:45:43 +0800
Subject: mshtml: Add IHTMLLocation::hash property's getter implementation.
---
dlls/mshtml/htmllocation.c | 11 ++++++++--
dlls/mshtml/tests/htmldoc.c | 53 ++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 61 insertions(+), 3 deletions(-)
diff --git a/dlls/mshtml/htmllocation.c b/dlls/mshtml/htmllocation.c
index 6411eb7..176468f 100644
--- a/dlls/mshtml/htmllocation.c
+++ b/dlls/mshtml/htmllocation.c
@@ -516,8 +516,15 @@ static HRESULT WINAPI HTMLLocation_get_search(IHTMLLocation *iface, BSTR *p)
static HRESULT WINAPI HTMLLocation_put_hash(IHTMLLocation *iface, BSTR v)
{
HTMLLocation *This = impl_from_IHTMLLocation(iface);
- FIXME("(%p)->(%s)\n", This, debugstr_w(v));
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_w(v));
+
+ if(!This->window || !This->window->base.outer_window) {
+ FIXME("No window available\n");
+ return E_FAIL;
+ }
+
+ return navigate_url(This->window->base.outer_window, v, This->window->base.outer_window->uri, 0);
}
static HRESULT WINAPI HTMLLocation_get_hash(IHTMLLocation *iface, BSTR *p)
diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c
index 635302c..409a5da 100644
--- a/dlls/mshtml/tests/htmldoc.c
+++ b/dlls/mshtml/tests/htmldoc.c
@@ -5932,6 +5932,56 @@ static void test_Persist(IHTMLDocument2 *doc, IMoniker *mon)
}
}
+static void test_put_hash(IHTMLDocument2 *doc, const char *new_hash)
+{
+ static char nav_url_buff[256];
+ IHTMLLocation *location;
+ BSTR str;
+ char *psharp;
+ HRESULT hres;
+
+ trace("put_hash, url = %s, new hash = %s\n", nav_url, new_hash);
+
+ location = NULL;
+ hres = IHTMLDocument2_get_location(doc, &location);
+ ok(hres == S_OK, "get_location failed: %08x\n", hres);
+ ok(location != NULL, "location == NULL\n");
+
+ SET_EXPECT(TranslateUrl);
+ SET_EXPECT(Exec_ShellDocView_67);
+ SET_EXPECT(FireBeforeNavigate2);
+ SET_EXPECT(FireDocumentComplete);
+ SET_EXPECT(FireNavigateComplete2);
+
+ /* Edit nav_url */
+ strcpy(nav_url_buff, nav_url);
+ psharp = strchr(nav_url_buff, '#');
+ if (psharp)
+ *psharp = '\0';
+ strcat(nav_url_buff, new_hash);
+ nav_url = nav_url_buff;
+
+ str = a2bstr(new_hash);
+ hres = IHTMLLocation_put_hash(location, str);
+ ok (hres == S_OK, "put_hash failed: %08x\n", hres);
+ SysFreeString(str);
+
+ CHECK_CALLED(TranslateUrl);
+ CHECK_CALLED_BROKEN(Exec_ShellDocView_67); /* Broken on Win7 and 8 */
+ CHECK_CALLED(FireBeforeNavigate2);
+ CHECK_CALLED(FireDocumentComplete);
+ CHECK_CALLED(FireNavigateComplete2);
+
+
+ /* Check the result */
+ hres = IHTMLLocation_get_hash(location, &str);
+ ok(hres == S_OK, "get_hash failed: %08x\n", hres);
+ ok(!strcmp_wa(str, new_hash), "expected %s, got %s\n", new_hash, wine_dbgstr_w(str));
+ SysFreeString(str);
+
+ IHTMLLocation_Release(location);
+}
+
static void test_put_href(IHTMLDocument2 *doc, BOOL use_replace, const char *href, const char *new_nav_url, BOOL is_js,
BOOL is_hash, DWORD dwl_flags)
{
@@ -6116,7 +6166,7 @@ static void test_load_history(IHTMLDocument2 *doc)
ok(hres == S_OK, "Could not get IPersistHistory iface: %08x\n", hres);
prev_url = nav_url;
- nav_url = "http://test.winehq.org/tests/winehq_snapshot/#test";
+ nav_url = "http://test.winehq.org/tests/winehq_snapshot/#hash_test";
nav_serv_url = "http://test.winehq.org/tests/winehq_snapshot/";
SET_EXPECT(Exec_ShellDocView_138);
@@ -7721,6 +7771,7 @@ static void test_HTMLDocument_http(BOOL with_wbapp)
nav_url = nav_serv_url = "http://test.winehq.org/tests/winehq_snapshot/"; /* for valid prev nav_url */
if(support_wbapp) {
test_put_href(doc, FALSE, "#test", "http://test.winehq.org/tests/winehq_snapshot/#test", FALSE, TRUE, 0);
+ test_put_hash(doc, "#hash_test");
test_travellog(doc);
test_refresh(doc);
}
--
2.5.1

View File

@ -0,0 +1 @@
Fixes: [32967] Add IHTMLLocation::hash property's getter implementation

View File

@ -170,6 +170,7 @@ patch_enable_all ()
enable_mmdevapi_AEV_Stubs="$1"
enable_mountmgr_DosDevices="$1"
enable_mscoree_CorValidateImage="$1"
enable_mshtml_HTMLLocation_put_hash="$1"
enable_msvcp90_basic_string_dtor="$1"
enable_msvcrt_Math_Precision="$1"
enable_msvcrt_StdHandle_RefCount="$1"
@ -606,6 +607,9 @@ patch_enable ()
mscoree-CorValidateImage)
enable_mscoree_CorValidateImage="$2"
;;
mshtml-HTMLLocation_put_hash)
enable_mshtml_HTMLLocation_put_hash="$2"
;;
msvcp90-basic_string_dtor)
enable_msvcp90_basic_string_dtor="$2"
;;
@ -3703,6 +3707,21 @@ if test "$enable_mscoree_CorValidateImage" -eq 1; then
) >> "$patchlist"
fi
# Patchset mshtml-HTMLLocation_put_hash
# |
# | This patchset fixes the following Wine bugs:
# | * [#32967] Add IHTMLLocation::hash property's getter implementation
# |
# | Modified files:
# | * dlls/mshtml/htmllocation.c, dlls/mshtml/tests/htmldoc.c
# |
if test "$enable_mshtml_HTMLLocation_put_hash" -eq 1; then
patch_apply mshtml-HTMLLocation_put_hash/0001-mshtml-Add-IHTMLLocation-hash-property-s-getter-impl.patch
(
echo '+ { "Zhenbo Li", "mshtml: Add IHTMLLocation::hash property'\''s getter implementation.", 1 },';
) >> "$patchlist"
fi
# Patchset msvcp90-basic_string_dtor
# |
# | This patchset fixes the following Wine bugs: