From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlimg.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c index 1a9266b2295..766d01b9eb7 100644 --- a/dlls/mshtml/htmlimg.c +++ b/dlls/mshtml/htmlimg.c @@ -675,17 +675,24 @@ static HRESULT HTMLImgElement_get_readystate(HTMLDOMNode *iface, BSTR *p) return IHTMLImgElement_get_readyState(&This->IHTMLImgElement_iface, p); }
-static void HTMLImgElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb) +static inline HTMLImg *HTMLImg_from_DispatchEx(DispatchEx *iface) { - HTMLImg *This = impl_from_HTMLDOMNode(iface); + return CONTAINING_RECORD(iface, HTMLImg, element.node.event_target.dispex); +} + +static void HTMLImgElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb) +{ + HTMLImg *This = HTMLImg_from_DispatchEx(dispex); + HTMLDOMNode_traverse(dispex, cb);
if(This->nsimg) - note_cc_edge((nsISupports*)This->nsimg, "This->nsimg", cb); + note_cc_edge((nsISupports*)This->nsimg, "nsimg", cb); }
-static void HTMLImgElement_unlink(HTMLDOMNode *iface) +static void HTMLImgElement_unlink(DispatchEx *dispex) { - HTMLImg *This = impl_from_HTMLDOMNode(iface); + HTMLImg *This = HTMLImg_from_DispatchEx(dispex); + HTMLDOMNode_unlink(dispex); unlink_ref(&This->nsimg); }
@@ -698,8 +705,15 @@ static const NodeImplVtbl HTMLImgElementImplVtbl = { .handle_event = HTMLElement_handle_event, .get_attr_col = HTMLElement_get_attr_col, .get_readystate = HTMLImgElement_get_readystate, - .traverse = HTMLImgElement_traverse, - .unlink = HTMLImgElement_unlink +}; + +static const event_target_vtbl_t HTMLImgElement_event_target_vtbl = { + { + HTMLELEMENT_DISPEX_VTBL_ENTRIES, + .traverse = HTMLImgElement_traverse, + .unlink = HTMLImgElement_unlink + }, + HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES, };
static const tid_t HTMLImgElement_iface_tids[] = { @@ -721,7 +735,7 @@ static void HTMLImgElement_init_dispex_info(dispex_data_t *info, compat_mode_t m
static dispex_static_data_t HTMLImgElement_dispex = { "HTMLImageElement", - &HTMLElement_event_target_vtbl.dispex_vtbl, + &HTMLImgElement_event_target_vtbl.dispex_vtbl, DispHTMLImg_tid, HTMLImgElement_iface_tids, HTMLImgElement_init_dispex_info