Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
7f859371
Commit
7f859371
authored
Nov 01, 2023
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Nov 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Keep ref from the OptionElementFactory to the inner window.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
e0065c3a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
6 deletions
+32
-6
htmlselect.c
dlls/mshtml/htmlselect.c
+22
-5
htmlwindow.c
dlls/mshtml/htmlwindow.c
+0
-1
events.c
dlls/mshtml/tests/events.c
+10
-0
No files found.
dlls/mshtml/htmlselect.c
View file @
7f859371
...
...
@@ -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
));
...
...
dlls/mshtml/htmlwindow.c
View file @
7f859371
...
...
@@ -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
);
}
...
...
dlls/mshtml/tests/events.c
View file @
7f859371
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment