Commit a9e5a233 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Traverse and unlink ImageElements using the dispex.

parent 9d10b639
...@@ -675,17 +675,24 @@ static HRESULT HTMLImgElement_get_readystate(HTMLDOMNode *iface, BSTR *p) ...@@ -675,17 +675,24 @@ static HRESULT HTMLImgElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
return IHTMLImgElement_get_readyState(&This->IHTMLImgElement_iface, 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) 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); unlink_ref(&This->nsimg);
} }
...@@ -698,8 +705,15 @@ static const NodeImplVtbl HTMLImgElementImplVtbl = { ...@@ -698,8 +705,15 @@ static const NodeImplVtbl HTMLImgElementImplVtbl = {
.handle_event = HTMLElement_handle_event, .handle_event = HTMLElement_handle_event,
.get_attr_col = HTMLElement_get_attr_col, .get_attr_col = HTMLElement_get_attr_col,
.get_readystate = HTMLImgElement_get_readystate, .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[] = { 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 ...@@ -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 = { static dispex_static_data_t HTMLImgElement_dispex = {
"HTMLImageElement", "HTMLImageElement",
&HTMLElement_event_target_vtbl.dispex_vtbl, &HTMLImgElement_event_target_vtbl.dispex_vtbl,
DispHTMLImg_tid, DispHTMLImg_tid,
HTMLImgElement_iface_tids, HTMLImgElement_iface_tids,
HTMLImgElement_init_dispex_info HTMLImgElement_init_dispex_info
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment