Module: wine Branch: master Commit: 20d8e72c65034d36772277eb41644fdaef003a4c URL: https://gitlab.winehq.org/wine/wine/-/commit/20d8e72c65034d36772277eb41644fd...
Author: Gabriel Ivăncescu gabrielopcode@gmail.com Date: Wed Sep 13 18:12:37 2023 +0300
mshtml: Traverse and unlink AreaElements using the dispex.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com
---
dlls/mshtml/htmlarea.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-)
diff --git a/dlls/mshtml/htmlarea.c b/dlls/mshtml/htmlarea.c index 0a3a7efee2e..fd810a0baa1 100644 --- a/dlls/mshtml/htmlarea.c +++ b/dlls/mshtml/htmlarea.c @@ -454,17 +454,24 @@ fallback: return HTMLElement_handle_event(&This->element.node, eid, event, prevent_default); }
-static void HTMLAreaElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb) +static inline HTMLAreaElement *impl_from_DispatchEx(DispatchEx *iface) { - HTMLAreaElement *This = impl_from_HTMLDOMNode(iface); + return CONTAINING_RECORD(iface, HTMLAreaElement, element.node.event_target.dispex); +} + +static void HTMLAreaElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb) +{ + HTMLAreaElement *This = impl_from_DispatchEx(dispex); + HTMLDOMNode_traverse(dispex, cb);
if(This->nsarea) note_cc_edge((nsISupports*)This->nsarea, "nsarea", cb); }
-static void HTMLAreaElement_unlink(HTMLDOMNode *iface) +static void HTMLAreaElement_unlink(DispatchEx *dispex) { - HTMLAreaElement *This = impl_from_HTMLDOMNode(iface); + HTMLAreaElement *This = impl_from_DispatchEx(dispex); + HTMLDOMNode_unlink(dispex); unlink_ref(&This->nsarea); }
@@ -476,8 +483,15 @@ static const NodeImplVtbl HTMLAreaElementImplVtbl = { .clone = HTMLElement_clone, .handle_event = HTMLAreaElement_handle_event, .get_attr_col = HTMLElement_get_attr_col, - .traverse = HTMLAreaElement_traverse, - .unlink = HTMLAreaElement_unlink +}; + +static const event_target_vtbl_t HTMLAreaElement_event_target_vtbl = { + { + HTMLELEMENT_DISPEX_VTBL_ENTRIES, + .traverse = HTMLAreaElement_traverse, + .unlink = HTMLAreaElement_unlink + }, + HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES, };
static const tid_t HTMLAreaElement_iface_tids[] = { @@ -487,7 +501,7 @@ static const tid_t HTMLAreaElement_iface_tids[] = { }; static dispex_static_data_t HTMLAreaElement_dispex = { "HTMLAreaElement", - &HTMLElement_event_target_vtbl.dispex_vtbl, + &HTMLAreaElement_event_target_vtbl.dispex_vtbl, DispHTMLAreaElement_tid, HTMLAreaElement_iface_tids, HTMLElement_init_dispex_info