winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
November 2023
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
989 discussions
Start a n
N
ew thread
Alex Henrie : dplayx: Use CRT allocation functions.
by Alexandre Julliard
02 Nov '23
02 Nov '23
Module: wine Branch: master Commit: 76205649de5dc03f1a27a3a9b90e6ee05d4d3003 URL:
https://gitlab.winehq.org/wine/wine/-/commit/76205649de5dc03f1a27a3a9b90e6e…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Wed Nov 1 23:57:24 2023 -0600 dplayx: Use CRT allocation functions. --- dlls/dplayx/dplay.c | 161 ++++++++++++++++++------------------------ dlls/dplayx/dplaysp.c | 19 +++-- dlls/dplayx/dplayx_messages.c | 18 +++-- dlls/dplayx/dplobby.c | 45 ++++++------ dlls/dplayx/lobbysp.c | 4 +- dlls/dplayx/name_server.c | 27 ++++--- 6 files changed, 118 insertions(+), 156 deletions(-)
1
0
0
0
Giovanni Mascellani : vkd3d-shader: Dump shaders as soon as possible.
by Alexandre Julliard
02 Nov '23
02 Nov '23
Module: vkd3d Branch: master Commit: dd96fe50e2c446990667bcaba76d5bb21569dfe2 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/dd96fe50e2c446990667bcaba76d5…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com> Date: Sat Oct 21 21:35:08 2023 +0200 vkd3d-shader: Dump shaders as soon as possible. So that they are dumped even if parsing fails, which is a circumstance in which one likely wants to see the problematic shader. The downside of that is that for shader types other than HLSL the profile is not written any more in the filename. This should not be a big problem, because in those cases the shader describes its own type. When dumping an HLSL shader, the id is brought in front of the profile in the file name, in order to make it more tab-friendly: when dealing with a directory full of shaders it's likely that the id determines the profile, but the other way around. --- libs/vkd3d-shader/hlsl.c | 6 ++---- libs/vkd3d-shader/hlsl.h | 1 + libs/vkd3d-shader/vkd3d_shader_main.c | 37 +++++++++++++++++++++----------- libs/vkd3d-shader/vkd3d_shader_private.h | 3 +-- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index b6b77a86..c8677f41 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -3260,7 +3260,7 @@ unsigned int hlsl_combine_swizzles(unsigned int first, unsigned int second, unsi return ret; } -static const struct hlsl_profile_info *get_target_info(const char *target) +const struct hlsl_profile_info *hlsl_get_target_info(const char *target) { unsigned int i; @@ -3627,14 +3627,12 @@ int hlsl_compile_shader(const struct vkd3d_shader_code *hlsl, const struct vkd3d } entry_point = hlsl_source_info->entry_point ? hlsl_source_info->entry_point : "main"; - if (!(profile = get_target_info(hlsl_source_info->profile))) + if (!(profile = hlsl_get_target_info(hlsl_source_info->profile))) { FIXME("Unknown compilation target %s.\n", debugstr_a(hlsl_source_info->profile)); return VKD3D_ERROR_NOT_IMPLEMENTED; } - vkd3d_shader_dump_shader(compile_info->source_type, profile->name, &compile_info->source); - if (compile_info->target_type == VKD3D_SHADER_TARGET_D3D_BYTECODE && profile->major_version > 3) { vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_HLSL_INCOMPATIBLE_PROFILE, diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 0655bb8e..309d7080 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -1169,6 +1169,7 @@ void hlsl_free_var(struct hlsl_ir_var *decl); struct hlsl_ir_function *hlsl_get_function(struct hlsl_ctx *ctx, const char *name); struct hlsl_ir_function_decl *hlsl_get_func_decl(struct hlsl_ctx *ctx, const char *name); +const struct hlsl_profile_info *hlsl_get_target_info(const char *target); struct hlsl_type *hlsl_get_type(struct hlsl_scope *scope, const char *name, bool recursive, bool case_insensitive); struct hlsl_ir_var *hlsl_get_var(struct hlsl_scope *scope, const char *name); diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index 89ff96de..28d647b3 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -18,6 +18,7 @@ #include "vkd3d_shader_private.h" #include "vkd3d_version.h" +#include "hlsl.h" #include <stdio.h> #include <math.h> @@ -381,7 +382,7 @@ void set_u32(struct vkd3d_bytecode_buffer *buffer, size_t offset, uint32_t value memcpy(buffer->data + offset, &value, sizeof(value)); } -static void vkd3d_shader_dump_blob(const char *path, const char *prefix, +static void vkd3d_shader_dump_blob(const char *path, const char *profile, const char *suffix, const void *data, size_t size) { static LONG shader_id = 0; @@ -391,8 +392,8 @@ static void vkd3d_shader_dump_blob(const char *path, const char *prefix, id = InterlockedIncrement(&shader_id) - 1; - if (prefix) - snprintf(filename, ARRAY_SIZE(filename), "%s/vkd3d-shader-%s-%u.%s", path, prefix, id, suffix); + if (profile) + snprintf(filename, ARRAY_SIZE(filename), "%s/vkd3d-shader-%u-%s.%s", path, id, profile, suffix); else snprintf(filename, ARRAY_SIZE(filename), "%s/vkd3d-shader-%u.%s", path, id, suffix); if ((f = fopen(filename, "wb"))) @@ -426,9 +427,12 @@ static const char *shader_get_source_type_suffix(enum vkd3d_shader_source_type t } } -void vkd3d_shader_dump_shader(enum vkd3d_shader_source_type source_type, - const char *prefix, const struct vkd3d_shader_code *shader) +void vkd3d_shader_dump_shader(const struct vkd3d_shader_compile_info *compile_info) { + const struct vkd3d_shader_code *shader = &compile_info->source; + const struct vkd3d_shader_hlsl_source_info *hlsl_source_info; + const struct hlsl_profile_info *profile; + const char *profile_name = NULL; static bool enabled = true; const char *path; @@ -441,7 +445,18 @@ void vkd3d_shader_dump_shader(enum vkd3d_shader_source_type source_type, return; } - vkd3d_shader_dump_blob(path, prefix, shader_get_source_type_suffix(source_type), + if (compile_info->source_type == VKD3D_SHADER_SOURCE_HLSL) + { + if (!(hlsl_source_info = vkd3d_find_struct(compile_info->next, HLSL_SOURCE_INFO))) + return; + + if (!(profile = hlsl_get_target_info(hlsl_source_info->profile))) + return; + + profile_name = profile->name; + } + + vkd3d_shader_dump_blob(path, profile_name, shader_get_source_type_suffix(compile_info->source_type), shader->code, shader->size); } @@ -1310,6 +1325,8 @@ int vkd3d_shader_scan(const struct vkd3d_shader_compile_info *compile_info, char vkd3d_shader_message_context_init(&message_context, compile_info->log_level); + vkd3d_shader_dump_shader(compile_info); + switch (compile_info->source_type) { case VKD3D_SHADER_SOURCE_DXBC_TPF: @@ -1351,9 +1368,6 @@ static int vkd3d_shader_parser_compile(struct vkd3d_shader_parser *parser, struct vkd3d_shader_compile_info scan_info; int ret; - vkd3d_shader_dump_shader(compile_info->source_type, shader_get_type_prefix(parser->shader_version.type), - &compile_info->source); - scan_info = *compile_info; if ((ret = scan_with_parser(&scan_info, message_context, &scan_descriptor_info, parser)) < 0) @@ -1437,9 +1451,6 @@ static int compile_d3d_bytecode(const struct vkd3d_shader_compile_info *compile_ return ret; } - vkd3d_shader_dump_shader(compile_info->source_type, shader_get_type_prefix(parser->shader_version.type), - &compile_info->source); - if (compile_info->target_type == VKD3D_SHADER_TARGET_D3D_ASM) { ret = vkd3d_dxbc_binary_to_text(&parser->instructions, &parser->shader_version, compile_info, out); @@ -1486,6 +1497,8 @@ int vkd3d_shader_compile(const struct vkd3d_shader_compile_info *compile_info, vkd3d_shader_message_context_init(&message_context, compile_info->log_level); + vkd3d_shader_dump_shader(compile_info); + switch (compile_info->source_type) { case VKD3D_SHADER_SOURCE_DXBC_TPF: diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 7297e0d1..0146a976 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -1324,8 +1324,7 @@ void vkd3d_shader_vnote(struct vkd3d_shader_message_context *context, const stru void vkd3d_shader_vwarning(struct vkd3d_shader_message_context *context, const struct vkd3d_shader_location *location, enum vkd3d_shader_error error, const char *format, va_list args); -void vkd3d_shader_dump_shader(enum vkd3d_shader_source_type source_type, - const char *prefix, const struct vkd3d_shader_code *shader); +void vkd3d_shader_dump_shader(const struct vkd3d_shader_compile_info *compile_info); void vkd3d_shader_trace_text_(const char *text, size_t size, const char *function); #define vkd3d_shader_trace_text(text, size) \ vkd3d_shader_trace_text_(text, size, __FUNCTION__)
1
0
0
0
Giovanni Mascellani : vkd3d-shader: Expose the whole profile when dumping an HLSL shader.
by Alexandre Julliard
02 Nov '23
02 Nov '23
Module: vkd3d Branch: master Commit: ab09c0b45b29eb3c20caa4bba90ac4e43db2bd25 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/ab09c0b45b29eb3c20caa4bba90ac…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com> Date: Sat Oct 21 20:44:07 2023 +0200 vkd3d-shader: Expose the whole profile when dumping an HLSL shader. The profile cannot be reliably devised by analyzing the HLSL code, so it's useful to have it included in the file name. --- libs/vkd3d-shader/hlsl.c | 2 +- libs/vkd3d-shader/vkd3d_shader_main.c | 17 +++++++++++------ libs/vkd3d-shader/vkd3d_shader_private.h | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index f56ecc90..b6b77a86 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -3633,7 +3633,7 @@ int hlsl_compile_shader(const struct vkd3d_shader_code *hlsl, const struct vkd3d return VKD3D_ERROR_NOT_IMPLEMENTED; } - vkd3d_shader_dump_shader(compile_info->source_type, profile->type, &compile_info->source); + vkd3d_shader_dump_shader(compile_info->source_type, profile->name, &compile_info->source); if (compile_info->target_type == VKD3D_SHADER_TARGET_D3D_BYTECODE && profile->major_version > 3) { diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index dcd40137..89ff96de 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -391,7 +391,10 @@ static void vkd3d_shader_dump_blob(const char *path, const char *prefix, id = InterlockedIncrement(&shader_id) - 1; - snprintf(filename, ARRAY_SIZE(filename), "%s/vkd3d-shader-%s-%u.%s", path, prefix, id, suffix); + if (prefix) + snprintf(filename, ARRAY_SIZE(filename), "%s/vkd3d-shader-%s-%u.%s", path, prefix, id, suffix); + else + snprintf(filename, ARRAY_SIZE(filename), "%s/vkd3d-shader-%u.%s", path, id, suffix); if ((f = fopen(filename, "wb"))) { if (fwrite(data, 1, size, f) != size) @@ -424,7 +427,7 @@ static const char *shader_get_source_type_suffix(enum vkd3d_shader_source_type t } void vkd3d_shader_dump_shader(enum vkd3d_shader_source_type source_type, - enum vkd3d_shader_type shader_type, const struct vkd3d_shader_code *shader) + const char *prefix, const struct vkd3d_shader_code *shader) { static bool enabled = true; const char *path; @@ -438,8 +441,8 @@ void vkd3d_shader_dump_shader(enum vkd3d_shader_source_type source_type, return; } - vkd3d_shader_dump_blob(path, shader_get_type_prefix(shader_type), - shader_get_source_type_suffix(source_type), shader->code, shader->size); + vkd3d_shader_dump_blob(path, prefix, shader_get_source_type_suffix(source_type), + shader->code, shader->size); } static void init_scan_signature_info(const struct vkd3d_shader_compile_info *info) @@ -1348,7 +1351,8 @@ static int vkd3d_shader_parser_compile(struct vkd3d_shader_parser *parser, struct vkd3d_shader_compile_info scan_info; int ret; - vkd3d_shader_dump_shader(compile_info->source_type, parser->shader_version.type, &compile_info->source); + vkd3d_shader_dump_shader(compile_info->source_type, shader_get_type_prefix(parser->shader_version.type), + &compile_info->source); scan_info = *compile_info; @@ -1433,7 +1437,8 @@ static int compile_d3d_bytecode(const struct vkd3d_shader_compile_info *compile_ return ret; } - vkd3d_shader_dump_shader(compile_info->source_type, parser->shader_version.type, &compile_info->source); + vkd3d_shader_dump_shader(compile_info->source_type, shader_get_type_prefix(parser->shader_version.type), + &compile_info->source); if (compile_info->target_type == VKD3D_SHADER_TARGET_D3D_ASM) { diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index f6421cc8..7297e0d1 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -1325,7 +1325,7 @@ void vkd3d_shader_vwarning(struct vkd3d_shader_message_context *context, const s enum vkd3d_shader_error error, const char *format, va_list args); void vkd3d_shader_dump_shader(enum vkd3d_shader_source_type source_type, - enum vkd3d_shader_type shader_type, const struct vkd3d_shader_code *shader); + const char *prefix, const struct vkd3d_shader_code *shader); void vkd3d_shader_trace_text_(const char *text, size_t size, const char *function); #define vkd3d_shader_trace_text(text, size) \ vkd3d_shader_trace_text_(text, size, __FUNCTION__)
1
0
0
0
Gabriel Ivăncescu : mshtml: Keep ref from the OmHistory to the inner window.
by Alexandre Julliard
01 Nov '23
01 Nov '23
Module: wine Branch: master Commit: a3209daea543104fbfac5900bf9ec0c05a0a43fc URL:
https://gitlab.winehq.org/wine/wine/-/commit/a3209daea543104fbfac5900bf9ec0…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Nov 1 17:00:40 2023 +0200 mshtml: Keep ref from the OmHistory to the inner window. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/htmlwindow.c | 1 - dlls/mshtml/omnavigator.c | 24 +++++++++++++++++++++++- dlls/mshtml/tests/events.c | 12 +++++++++++- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index dc1e42020fd..38723919f15 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3994,7 +3994,6 @@ static void HTMLWindow_unlink(DispatchEx *dispex) unlink_ref(&This->screen); if(This->history) { OmHistory *history = This->history; - This->history->window = NULL; This->history = NULL; IOmHistory_Release(&history->IOmHistory_iface); } diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 58cd0c78fb2..db7da8276ef 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -644,7 +644,7 @@ static HRESULT WINAPI OmHistory_get_length(IOmHistory *iface, short *p) TRACE("(%p)->(%p)\n", This, p); - if(This->window && This->window->base.outer_window) + if(This->window->base.outer_window) browser = This->window->base.outer_window->browser; *p = browser && browser->doc->travel_log @@ -703,6 +703,25 @@ static void *OmHistory_query_interface(DispatchEx *dispex, REFIID riid) return NULL; } +static void OmHistory_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb) +{ + OmHistory *This = OmHistory_from_DispatchEx(dispex); + + if(This->window) + note_cc_edge((nsISupports*)&This->window->base.IHTMLWindow2_iface, "window", cb); +} + +static void OmHistory_unlink(DispatchEx *dispex) +{ + OmHistory *This = OmHistory_from_DispatchEx(dispex); + + if(This->window) { + HTMLInnerWindow *window = This->window; + This->window = NULL; + IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface); + } +} + static void OmHistory_destructor(DispatchEx *dispex) { OmHistory *This = OmHistory_from_DispatchEx(dispex); @@ -712,6 +731,8 @@ static void OmHistory_destructor(DispatchEx *dispex) static const dispex_static_data_vtbl_t OmHistory_dispex_vtbl = { .query_interface = OmHistory_query_interface, .destructor = OmHistory_destructor, + .traverse = OmHistory_traverse, + .unlink = OmHistory_unlink, }; static const tid_t OmHistory_iface_tids[] = { @@ -738,6 +759,7 @@ HRESULT create_history(HTMLInnerWindow *window, OmHistory **ret) history->IOmHistory_iface.lpVtbl = &OmHistoryVtbl; history->window = window; + IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface); *ret = history; return S_OK; diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c index 33654fe46b5..64b07c750dc 100644 --- a/dlls/mshtml/tests/events.c +++ b/dlls/mshtml/tests/events.c @@ -3247,8 +3247,10 @@ static void test_window_refs(IHTMLDocument2 *doc) IHTMLWindow5 *window5; IHTMLDocument6 *doc6; IHTMLElement2 *elem; + IOmHistory *history; VARIANT vempty, var; HRESULT hres; + short length; BSTR bstr; V_VT(&vempty) = VT_EMPTY; @@ -3282,6 +3284,8 @@ static void test_window_refs(IHTMLDocument2 *doc) ok(hres == S_OK, "get_Image failed: %08lx\n", hres); hres = IHTMLWindow2_get_Option(window, &option_factory); ok(hres == S_OK, "get_Option failed: %08lx\n", hres); + hres = IHTMLWindow2_get_history(window, &history); + ok(hres == S_OK, "get_history failed: %08lx\n", hres); hres = IHTMLWindow2_get_self(window, &self); ok(hres == S_OK, "get_self failed: %08lx\n", hres); @@ -3316,6 +3320,12 @@ static void test_window_refs(IHTMLDocument2 *doc) ok(option_elem != NULL, "option_elem == NULL\n"); IHTMLOptionElementFactory_Release(option_factory); IHTMLOptionElement_Release(option_elem); + + hres = IOmHistory_get_length(history, &length); + ok(hres == S_OK, "get_length failed: %08lx\n", hres); + todo_wine + ok(length == 42, "length = %d\n", length); + IOmHistory_Release(history); } static void test_doc_obj(IHTMLDocument2 *doc) @@ -4396,7 +4406,7 @@ static HRESULT WINAPI TravelLog_Clone(ITravelLog *iface, ITravelLog **pptl) static DWORD WINAPI TravelLog_CountEntries(ITravelLog *iface, IUnknown *punk) { - return 0; + return 42; } static HRESULT WINAPI TravelLog_Revert(ITravelLog *iface)
1
0
0
0
Gabriel Ivăncescu : mshtml: Keep ref from LocalStorage and SessionStorage to the inner window.
by Alexandre Julliard
01 Nov '23
01 Nov '23
Module: wine Branch: master Commit: c323d9c3e07ec4ebaa0197f4fdfa6b71af56664a URL:
https://gitlab.winehq.org/wine/wine/-/commit/c323d9c3e07ec4ebaa0197f4fdfa6b…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Nov 1 17:00:40 2023 +0200 mshtml: Keep ref from LocalStorage and SessionStorage to the inner window. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/htmlstorage.c | 30 ++++++++++++++++++++++-------- dlls/mshtml/htmlwindow.c | 2 -- dlls/mshtml/mshtml_private.h | 2 -- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/dlls/mshtml/htmlstorage.c b/dlls/mshtml/htmlstorage.c index d3bbb30580e..efd4b2d88ae 100644 --- a/dlls/mshtml/htmlstorage.c +++ b/dlls/mshtml/htmlstorage.c @@ -322,8 +322,6 @@ static HRESULT send_storage_event(HTMLStorage *storage, BSTR key, BSTR old_value HRESULT hres = S_OK; ctx.url = NULL; - if(!window) - goto done; if(window->base.outer_window->uri_nofrag) { hres = IUri_GetDisplayUri(window->base.outer_window->uri_nofrag, &ctx.url); if(hres != S_OK) @@ -1041,6 +1039,25 @@ static void *HTMLStorage_query_interface(DispatchEx *dispex, REFIID riid) return NULL; } +static void HTMLStorage_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb) +{ + HTMLStorage *This = impl_from_DispatchEx(dispex); + + if(This->window) + note_cc_edge((nsISupports*)&This->window->base.IHTMLWindow2_iface, "window", cb); +} + +static void HTMLStorage_unlink(DispatchEx *dispex) +{ + HTMLStorage *This = impl_from_DispatchEx(dispex); + + if(This->window) { + HTMLInnerWindow *window = This->window; + This->window = NULL; + IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface); + } +} + static void HTMLStorage_destructor(DispatchEx *dispex) { HTMLStorage *This = impl_from_DispatchEx(dispex); @@ -1298,6 +1315,8 @@ static HRESULT HTMLStorage_next_dispid(DispatchEx *dispex, DISPID id, DISPID *pi static const dispex_static_data_vtbl_t HTMLStorage_dispex_vtbl = { .query_interface = HTMLStorage_query_interface, .destructor = HTMLStorage_destructor, + .traverse = HTMLStorage_traverse, + .unlink = HTMLStorage_unlink, .get_dispid = HTMLStorage_get_dispid, .get_name = HTMLStorage_get_name, .invoke = HTMLStorage_invoke, @@ -1464,15 +1483,10 @@ HRESULT create_html_storage(HTMLInnerWindow *window, BOOL local, IHTMLStorage ** storage->IHTMLStorage_iface.lpVtbl = &HTMLStorageVtbl; storage->window = window; + IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface); init_dispatch(&storage->dispex, &HTMLStorage_dispex, dispex_compat_mode(&window->event_target.dispex)); *p = &storage->IHTMLStorage_iface; return S_OK; } - -void detach_html_storage(IHTMLStorage *iface) -{ - HTMLStorage *storage = impl_from_IHTMLStorage(iface); - storage->window = NULL; -} diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 36aede7244e..dc1e42020fd 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -4001,13 +4001,11 @@ static void HTMLWindow_unlink(DispatchEx *dispex) unlink_ref(&This->navigator); if(This->session_storage) { IHTMLStorage *session_storage = This->session_storage; - detach_html_storage(session_storage); This->session_storage = NULL; IHTMLStorage_Release(session_storage); } if(This->local_storage) { IHTMLStorage *local_storage = This->local_storage; - detach_html_storage(local_storage); This->local_storage = NULL; IHTMLStorage_Release(local_storage); } diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 7515fbfd2cd..504504dd1d4 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -998,9 +998,7 @@ HRESULT create_history(HTMLInnerWindow*,OmHistory**); HRESULT create_namespace_collection(compat_mode_t,IHTMLNamespaceCollection**); HRESULT create_dom_implementation(HTMLDocumentNode*,IHTMLDOMImplementation**); void detach_dom_implementation(IHTMLDOMImplementation*); - HRESULT create_html_storage(HTMLInnerWindow*,BOOL,IHTMLStorage**); -void detach_html_storage(IHTMLStorage*); void HTMLDocument_View_Init(HTMLDocumentObj*); void HTMLDocumentObj_Persist_Init(HTMLDocumentObj*);
1
0
0
0
Gabriel Ivăncescu : mshtml: Keep ref from the XMLHttpRequestFactory to the inner window.
by Alexandre Julliard
01 Nov '23
01 Nov '23
Module: wine Branch: master Commit: 5aa68f389cf2b5bfbca144030929769b0811cd69 URL:
https://gitlab.winehq.org/wine/wine/-/commit/5aa68f389cf2b5bfbca14403092976…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Nov 1 17:00:40 2023 +0200 mshtml: Keep ref from the XMLHttpRequestFactory to the inner window. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/htmlwindow.c | 1 - dlls/mshtml/tests/events.c | 21 ++++++++++++++++++++- dlls/mshtml/xmlhttprequest.c | 25 +++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 85794b7fe85..36aede7244e 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3987,7 +3987,6 @@ static void HTMLWindow_unlink(DispatchEx *dispex) } if(This->xhr_factory) { HTMLXMLHttpRequestFactory *xhr_factory = This->xhr_factory; - This->xhr_factory->window = NULL; This->xhr_factory = NULL; IHTMLXMLHttpRequestFactory_Release(&xhr_factory->IHTMLXMLHttpRequestFactory_iface); } diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c index 0ccb892603a..33654fe46b5 100644 --- a/dlls/mshtml/tests/events.c +++ b/dlls/mshtml/tests/events.c @@ -3237,14 +3237,17 @@ static void test_iframe_connections(IHTMLDocument2 *doc) static void test_window_refs(IHTMLDocument2 *doc) { IHTMLOptionElementFactory *option_factory; + IHTMLXMLHttpRequestFactory *xhr_factory; IHTMLImageElementFactory *image_factory; IHTMLWindow2 *self, *parent, *child; IHTMLOptionElement *option_elem; IHTMLImgElement *img_elem; + IHTMLXMLHttpRequest *xhr; IHTMLFrameBase2 *iframe; + IHTMLWindow5 *window5; IHTMLDocument6 *doc6; IHTMLElement2 *elem; - VARIANT vempty; + VARIANT vempty, var; HRESULT hres; BSTR bstr; @@ -3265,6 +3268,16 @@ static void test_window_refs(IHTMLDocument2 *doc) ok(hres == S_OK, "get_contentWindow failed: %08lx\n", hres); IHTMLFrameBase2_Release(iframe); + hres = IHTMLWindow2_QueryInterface(window, &IID_IHTMLWindow5, (void**)&window5); + ok(hres == S_OK, "Could not get IHTMLWindow5: %08lx\n", hres); + hres = IHTMLWindow5_get_XMLHttpRequest(window5, &var); + ok(hres == S_OK, "get_XMLHttpRequest failed: %08lx\n", hres); + ok(V_VT(&var) == VT_DISPATCH, "V_VT(XMLHttpRequest) = %d\n", V_VT(&var)); + hres = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IHTMLXMLHttpRequestFactory, (void**)&xhr_factory); + ok(hres == S_OK, "Could not get IHTMLXMLHttpRequestFactory: %08lx\n", hres); + IHTMLWindow5_Release(window5); + VariantClear(&var); + hres = IHTMLWindow2_get_Image(window, &image_factory); ok(hres == S_OK, "get_Image failed: %08lx\n", hres); hres = IHTMLWindow2_get_Option(window, &option_factory); @@ -3286,6 +3299,12 @@ static void test_window_refs(IHTMLDocument2 *doc) IHTMLWindow2_Release(parent); IHTMLWindow2_Release(child); + hres = IHTMLXMLHttpRequestFactory_create(xhr_factory, &xhr); + todo_wine + ok(hres == S_OK, "create failed: %08lx\n", hres); + IHTMLXMLHttpRequestFactory_Release(xhr_factory); + if(hres == S_OK) IHTMLXMLHttpRequest_Release(xhr); + hres = IHTMLImageElementFactory_create(image_factory, vempty, vempty, &img_elem); ok(hres == S_OK, "create failed: %08lx\n", hres); ok(img_elem != NULL, "img_elem == NULL\n"); diff --git a/dlls/mshtml/xmlhttprequest.c b/dlls/mshtml/xmlhttprequest.c index 44f83dd8809..20049a13ee7 100644 --- a/dlls/mshtml/xmlhttprequest.c +++ b/dlls/mshtml/xmlhttprequest.c @@ -1686,6 +1686,9 @@ static HRESULT WINAPI HTMLXMLHttpRequestFactory_create(IHTMLXMLHttpRequestFactor TRACE("(%p)->(%p)\n", This, p); + if(!This->window->base.outer_window) + return E_FAIL; + nsxhr = create_nsxhr(This->window->base.outer_window->nswindow); if(!nsxhr) return E_FAIL; @@ -1768,6 +1771,25 @@ static void *HTMLXMLHttpRequestFactory_query_interface(DispatchEx *dispex, REFII return NULL; } +static void HTMLXMLHttpRequestFactory_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb) +{ + HTMLXMLHttpRequestFactory *This = factory_from_DispatchEx(dispex); + + if(This->window) + note_cc_edge((nsISupports*)&This->window->base.IHTMLWindow2_iface, "window", cb); +} + +static void HTMLXMLHttpRequestFactory_unlink(DispatchEx *dispex) +{ + HTMLXMLHttpRequestFactory *This = factory_from_DispatchEx(dispex); + + if(This->window) { + HTMLInnerWindow *window = This->window; + This->window = NULL; + IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface); + } +} + static void HTMLXMLHttpRequestFactory_destructor(DispatchEx *dispex) { HTMLXMLHttpRequestFactory *This = factory_from_DispatchEx(dispex); @@ -1800,6 +1822,8 @@ static HRESULT HTMLXMLHttpRequestFactory_value(DispatchEx *iface, LCID lcid, WOR static const dispex_static_data_vtbl_t HTMLXMLHttpRequestFactory_dispex_vtbl = { .query_interface = HTMLXMLHttpRequestFactory_query_interface, .destructor = HTMLXMLHttpRequestFactory_destructor, + .traverse = HTMLXMLHttpRequestFactory_traverse, + .unlink = HTMLXMLHttpRequestFactory_unlink, .value = HTMLXMLHttpRequestFactory_value }; @@ -1824,6 +1848,7 @@ HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow* window, HTMLXMLHttpReq ret->IHTMLXMLHttpRequestFactory_iface.lpVtbl = &HTMLXMLHttpRequestFactoryVtbl; ret->window = window; + IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface); init_dispatch(&ret->dispex, &HTMLXMLHttpRequestFactory_dispex, dispex_compat_mode(&window->event_target.dispex));
1
0
0
0
Gabriel Ivăncescu : mshtml: Keep ref from the OptionElementFactory to the inner window.
by Alexandre Julliard
01 Nov '23
01 Nov '23
Module: wine Branch: master Commit: 7f85937158f82bc508aad60d4a27cf3780bb22a5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7f85937158f82bc508aad60d4a27cf…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Nov 1 17:00:40 2023 +0200 mshtml: Keep ref from the OptionElementFactory to the inner window. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/htmlselect.c | 27 ++++++++++++++++++++++----- dlls/mshtml/htmlwindow.c | 1 - dlls/mshtml/tests/events.c | 10 ++++++++++ 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c index 2daed7e8b2c..1b867195595 100644 --- a/dlls/mshtml/htmlselect.c +++ b/dlls/mshtml/htmlselect.c @@ -491,11 +491,6 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory TRACE("(%p)->(%s %s %s %s %p)\n", This, debugstr_variant(&text), debugstr_variant(&value), debugstr_variant(&defaultselected), debugstr_variant(&selected), optelem); - if(!This->window || !This->window->doc) { - WARN("NULL doc\n"); - return E_UNEXPECTED; - } - *optelem = NULL; hres = create_nselem(This->window->doc, L"OPTION", &nselem); @@ -555,6 +550,25 @@ static void *HTMLOptionElementFactory_query_interface(DispatchEx *dispex, REFIID return NULL; } +static void HTMLOptionElementFactory_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb) +{ + HTMLOptionElementFactory *This = HTMLOptionElementFactory_from_DispatchEx(dispex); + + if(This->window) + note_cc_edge((nsISupports*)&This->window->base.IHTMLWindow2_iface, "window", cb); +} + +static void HTMLOptionElementFactory_unlink(DispatchEx *dispex) +{ + HTMLOptionElementFactory *This = HTMLOptionElementFactory_from_DispatchEx(dispex); + + if(This->window) { + HTMLInnerWindow *window = This->window; + This->window = NULL; + IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface); + } +} + static void HTMLOptionElementFactory_destructor(DispatchEx *dispex) { HTMLOptionElementFactory *This = HTMLOptionElementFactory_from_DispatchEx(dispex); @@ -601,6 +615,8 @@ static const tid_t HTMLOptionElementFactory_iface_tids[] = { static const dispex_static_data_vtbl_t HTMLOptionElementFactory_dispex_vtbl = { .query_interface = HTMLOptionElementFactory_query_interface, .destructor = HTMLOptionElementFactory_destructor, + .traverse = HTMLOptionElementFactory_traverse, + .unlink = HTMLOptionElementFactory_unlink, .value = HTMLOptionElementFactory_value, }; @@ -621,6 +637,7 @@ HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow *window, HTMLOptionEleme ret->IHTMLOptionElementFactory_iface.lpVtbl = &HTMLOptionElementFactoryVtbl; ret->window = window; + IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface); init_dispatch(&ret->dispex, &HTMLOptionElementFactory_dispex, dispex_compat_mode(&window->event_target.dispex)); diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 3e08a90d5fc..85794b7fe85 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3982,7 +3982,6 @@ static void HTMLWindow_unlink(DispatchEx *dispex) } if(This->option_factory) { HTMLOptionElementFactory *option_factory = This->option_factory; - This->option_factory->window = NULL; This->option_factory = NULL; IHTMLOptionElementFactory_Release(&option_factory->IHTMLOptionElementFactory_iface); } diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c index 515a2cf443c..0ccb892603a 100644 --- a/dlls/mshtml/tests/events.c +++ b/dlls/mshtml/tests/events.c @@ -3236,8 +3236,10 @@ static void test_iframe_connections(IHTMLDocument2 *doc) static void test_window_refs(IHTMLDocument2 *doc) { + IHTMLOptionElementFactory *option_factory; IHTMLImageElementFactory *image_factory; IHTMLWindow2 *self, *parent, *child; + IHTMLOptionElement *option_elem; IHTMLImgElement *img_elem; IHTMLFrameBase2 *iframe; IHTMLDocument6 *doc6; @@ -3265,6 +3267,8 @@ static void test_window_refs(IHTMLDocument2 *doc) hres = IHTMLWindow2_get_Image(window, &image_factory); ok(hres == S_OK, "get_Image failed: %08lx\n", hres); + hres = IHTMLWindow2_get_Option(window, &option_factory); + ok(hres == S_OK, "get_Option failed: %08lx\n", hres); hres = IHTMLWindow2_get_self(window, &self); ok(hres == S_OK, "get_self failed: %08lx\n", hres); @@ -3287,6 +3291,12 @@ static void test_window_refs(IHTMLDocument2 *doc) ok(img_elem != NULL, "img_elem == NULL\n"); IHTMLImageElementFactory_Release(image_factory); IHTMLImgElement_Release(img_elem); + + hres = IHTMLOptionElementFactory_create(option_factory, vempty, vempty, vempty, vempty, &option_elem); + ok(hres == S_OK, "create failed: %08lx\n", hres); + ok(option_elem != NULL, "option_elem == NULL\n"); + IHTMLOptionElementFactory_Release(option_factory); + IHTMLOptionElement_Release(option_elem); } static void test_doc_obj(IHTMLDocument2 *doc)
1
0
0
0
Gabriel Ivăncescu : mshtml: Keep ref from the ImageElementFactory to the inner window.
by Alexandre Julliard
01 Nov '23
01 Nov '23
Module: wine Branch: master Commit: e0065c3affe52b36120143be620a5f8c7db5f611 URL:
https://gitlab.winehq.org/wine/wine/-/commit/e0065c3affe52b36120143be620a5f…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Nov 1 17:00:40 2023 +0200 mshtml: Keep ref from the ImageElementFactory to the inner window. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/htmlimg.c | 31 +++++++++++++++++++++++-------- dlls/mshtml/htmlwindow.c | 1 - dlls/mshtml/tests/events.c | 15 ++++++++++++++- 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c index cf69b62e744..07ce5643ad1 100644 --- a/dlls/mshtml/htmlimg.c +++ b/dlls/mshtml/htmlimg.c @@ -846,7 +846,7 @@ static HRESULT WINAPI HTMLImageElementFactory_create(IHTMLImageElementFactory *i VARIANT width, VARIANT height, IHTMLImgElement **img_elem) { HTMLImageElementFactory *This = impl_from_IHTMLImageElementFactory(iface); - HTMLDocumentNode *doc; + HTMLDocumentNode *doc = This->window->doc; IHTMLImgElement *img; HTMLElement *elem; nsIDOMElement *nselem; @@ -856,13 +856,6 @@ static HRESULT WINAPI HTMLImageElementFactory_create(IHTMLImageElementFactory *i TRACE("(%p)->(%s %s %p)\n", This, debugstr_variant(&width), debugstr_variant(&height), img_elem); - if(!This->window || !This->window->doc) { - WARN("NULL doc\n"); - return E_UNEXPECTED; - } - - doc = This->window->doc; - *img_elem = NULL; hres = create_nselem(doc, L"IMG", &nselem); @@ -921,6 +914,25 @@ static void *HTMLImageElementFactory_query_interface(DispatchEx *dispex, REFIID return NULL; } +static void HTMLImageElementFactory_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb) +{ + HTMLImageElementFactory *This = impl_from_DispatchEx(dispex); + + if(This->window) + note_cc_edge((nsISupports*)&This->window->base.IHTMLWindow2_iface, "window", cb); +} + +static void HTMLImageElementFactory_unlink(DispatchEx *dispex) +{ + HTMLImageElementFactory *This = impl_from_DispatchEx(dispex); + + if(This->window) { + HTMLInnerWindow *window = This->window; + This->window = NULL; + IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface); + } +} + static void HTMLImageElementFactory_destructor(DispatchEx *dispex) { HTMLImageElementFactory *This = impl_from_DispatchEx(dispex); @@ -963,6 +975,8 @@ static const tid_t HTMLImageElementFactory_iface_tids[] = { static const dispex_static_data_vtbl_t HTMLImageElementFactory_dispex_vtbl = { .query_interface = HTMLImageElementFactory_query_interface, .destructor = HTMLImageElementFactory_destructor, + .traverse = HTMLImageElementFactory_traverse, + .unlink = HTMLImageElementFactory_unlink, .value = HTMLImageElementFactory_value, }; @@ -983,6 +997,7 @@ HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow *window, HTMLImageElement ret->IHTMLImageElementFactory_iface.lpVtbl = &HTMLImageElementFactoryVtbl; ret->window = window; + IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface); init_dispatch(&ret->dispex, &HTMLImageElementFactory_dispex, dispex_compat_mode(&window->event_target.dispex)); diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 47e65472c01..3e08a90d5fc 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3977,7 +3977,6 @@ static void HTMLWindow_unlink(DispatchEx *dispex) if(This->image_factory) { HTMLImageElementFactory *image_factory = This->image_factory; - This->image_factory->window = NULL; This->image_factory = NULL; IHTMLImageElementFactory_Release(&image_factory->IHTMLImageElementFactory_iface); } diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c index a55ebd8d26e..515a2cf443c 100644 --- a/dlls/mshtml/tests/events.c +++ b/dlls/mshtml/tests/events.c @@ -3236,13 +3236,18 @@ static void test_iframe_connections(IHTMLDocument2 *doc) static void test_window_refs(IHTMLDocument2 *doc) { + IHTMLImageElementFactory *image_factory; IHTMLWindow2 *self, *parent, *child; + IHTMLImgElement *img_elem; IHTMLFrameBase2 *iframe; IHTMLDocument6 *doc6; IHTMLElement2 *elem; + VARIANT vempty; HRESULT hres; BSTR bstr; + V_VT(&vempty) = VT_EMPTY; + hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument6, (void**)&doc6); ok(hres == S_OK, "Could not get IHTMLDocument6 iface: %08lx\n", hres); bstr = SysAllocString(L"ifr"); @@ -3258,6 +3263,9 @@ static void test_window_refs(IHTMLDocument2 *doc) ok(hres == S_OK, "get_contentWindow failed: %08lx\n", hres); IHTMLFrameBase2_Release(iframe); + hres = IHTMLWindow2_get_Image(window, &image_factory); + ok(hres == S_OK, "get_Image failed: %08lx\n", hres); + hres = IHTMLWindow2_get_self(window, &self); ok(hres == S_OK, "get_self failed: %08lx\n", hres); hres = IHTMLWindow2_get_parent(child, &parent); @@ -3271,9 +3279,14 @@ static void test_window_refs(IHTMLDocument2 *doc) hres = IHTMLWindow2_get_parent(child, &parent); ok(hres == S_OK, "get_parent failed: %08lx\n", hres); ok(parent == child, "parent != child\n"); - IHTMLWindow2_Release(parent); IHTMLWindow2_Release(child); + + hres = IHTMLImageElementFactory_create(image_factory, vempty, vempty, &img_elem); + ok(hres == S_OK, "create failed: %08lx\n", hres); + ok(img_elem != NULL, "img_elem == NULL\n"); + IHTMLImageElementFactory_Release(image_factory); + IHTMLImgElement_Release(img_elem); } static void test_doc_obj(IHTMLDocument2 *doc)
1
0
0
0
Gabriel Ivăncescu : mshtml/tests: Test parent window links after navigation.
by Alexandre Julliard
01 Nov '23
01 Nov '23
Module: wine Branch: master Commit: bc8c1b5696aeb02ee34df31d47fb631c8db769c9 URL:
https://gitlab.winehq.org/wine/wine/-/commit/bc8c1b5696aeb02ee34df31d47fb63…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Nov 1 17:00:40 2023 +0200 mshtml/tests: Test parent window links after navigation. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/tests/events.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c index 7d139ccafe1..a55ebd8d26e 100644 --- a/dlls/mshtml/tests/events.c +++ b/dlls/mshtml/tests/events.c @@ -3234,6 +3234,48 @@ static void test_iframe_connections(IHTMLDocument2 *doc) IHTMLDocument2_Release(iframes_doc); } +static void test_window_refs(IHTMLDocument2 *doc) +{ + IHTMLWindow2 *self, *parent, *child; + IHTMLFrameBase2 *iframe; + IHTMLDocument6 *doc6; + IHTMLElement2 *elem; + HRESULT hres; + BSTR bstr; + + hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument6, (void**)&doc6); + ok(hres == S_OK, "Could not get IHTMLDocument6 iface: %08lx\n", hres); + bstr = SysAllocString(L"ifr"); + hres = IHTMLDocument6_getElementById(doc6, bstr, &elem); + ok(hres == S_OK, "getElementById failed: %08lx\n", hres); + IHTMLDocument6_Release(doc6); + SysFreeString(bstr); + + hres = IHTMLElement2_QueryInterface(elem, &IID_IHTMLFrameBase2, (void**)&iframe); + ok(hres == S_OK, "Could not get IHTMLFrameBase2 iface: %08lx\n", hres); + IHTMLElement2_Release(elem); + hres = IHTMLFrameBase2_get_contentWindow(iframe, &child); + ok(hres == S_OK, "get_contentWindow failed: %08lx\n", hres); + IHTMLFrameBase2_Release(iframe); + + hres = IHTMLWindow2_get_self(window, &self); + ok(hres == S_OK, "get_self failed: %08lx\n", hres); + hres = IHTMLWindow2_get_parent(child, &parent); + ok(hres == S_OK, "get_parent failed: %08lx\n", hres); + ok(parent == self, "parent != self\n"); + IHTMLWindow2_Release(parent); + IHTMLWindow2_Release(self); + + navigate(doc, L"blank.html"); + + hres = IHTMLWindow2_get_parent(child, &parent); + ok(hres == S_OK, "get_parent failed: %08lx\n", hres); + ok(parent == child, "parent != child\n"); + + IHTMLWindow2_Release(parent); + IHTMLWindow2_Release(child); +} + static void test_doc_obj(IHTMLDocument2 *doc) { static DISPID propput_dispid = DISPID_PROPERTYPUT; @@ -6523,6 +6565,7 @@ START_TEST(events) run_test_from_res(L"doc_with_prop_ie9.html", test_visibilitychange); run_test_from_res(L"blank_ie10.html", test_visibilitychange); run_test_from_res(L"iframe.html", test_unload_event); + run_test_from_res(L"iframe.html", test_window_refs); run_test(empty_doc_ie9_str, test_create_event); run_test(img_doc_ie9_str, test_imgload); run_test(input_image_doc_ie9_str, test_inputload);
1
0
0
0
Gabriel Ivăncescu : mshtml: Properly traverse document nodes.
by Alexandre Julliard
01 Nov '23
01 Nov '23
Module: wine Branch: master Commit: bcf89639e70063eb222ced3dab52301d2e227f36 URL:
https://gitlab.winehq.org/wine/wine/-/commit/bcf89639e70063eb222ced3dab5230…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Nov 1 17:00:40 2023 +0200 mshtml: Properly traverse document nodes. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/htmldoc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index f1da5eaad07..4daf5ccc58d 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5868,6 +5868,10 @@ static void HTMLDocumentNode_traverse(DispatchEx *dispex, nsCycleCollectionTrave if(This->window) note_cc_edge((nsISupports*)&This->window->base.IHTMLWindow2_iface, "window", cb); + if(This->dom_implementation) + note_cc_edge((nsISupports*)This->dom_implementation, "dom_implementation", cb); + if(This->namespaces) + note_cc_edge((nsISupports*)This->namespaces, "namespaces", cb); } static void HTMLDocumentNode_unlink(DispatchEx *dispex)
1
0
0
0
← Newer
1
...
93
94
95
96
97
98
99
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Results per page:
10
25
50
100
200