Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e0065c3a
Commit
e0065c3a
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 ImageElementFactory to the inner window.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
bc8c1b56
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
10 deletions
+37
-10
htmlimg.c
dlls/mshtml/htmlimg.c
+23
-8
htmlwindow.c
dlls/mshtml/htmlwindow.c
+0
-1
events.c
dlls/mshtml/tests/events.c
+14
-1
No files found.
dlls/mshtml/htmlimg.c
View file @
e0065c3a
...
...
@@ -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
));
...
...
dlls/mshtml/htmlwindow.c
View file @
e0065c3a
...
...
@@ -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
);
}
...
...
dlls/mshtml/tests/events.c
View file @
e0065c3a
...
...
@@ -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
)
...
...
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