Module: wine Branch: master Commit: 87a06268fc59e218f4332a45a0d53b6e02905f2a URL: https://gitlab.winehq.org/wine/wine/-/commit/87a06268fc59e218f4332a45a0d53b6...
Author: Gabriel Ivăncescu gabrielopcode@gmail.com Date: Wed Sep 13 18:12:37 2023 +0300
mshtml: Traverse and unlink BodyElements using the dispex.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com
---
dlls/mshtml/htmlbody.c | 48 +++++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 17 deletions(-)
diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c index 19875915efe..46f3ddef0dd 100644 --- a/dlls/mshtml/htmlbody.c +++ b/dlls/mshtml/htmlbody.c @@ -906,20 +906,6 @@ static void *HTMLBodyElement_QI(HTMLDOMNode *iface, REFIID riid) return HTMLElement_QI(&This->element.node, riid); }
-static void HTMLBodyElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb) -{ - HTMLBodyElement *This = impl_from_HTMLDOMNode(iface); - - if(This->nsbody) - note_cc_edge((nsISupports*)This->nsbody, "This->nsbody", cb); -} - -static void HTMLBodyElement_unlink(HTMLDOMNode *iface) -{ - HTMLBodyElement *This = impl_from_HTMLDOMNode(iface); - unlink_ref(&This->nsbody); -} - static EventTarget *HTMLBodyElement_get_event_prop_target(HTMLDOMNode *iface, int event_id) { HTMLBodyElement *This = impl_from_HTMLDOMNode(iface); @@ -953,6 +939,27 @@ static BOOL HTMLBodyElement_is_settable(HTMLDOMNode *iface, DISPID dispid) } }
+static inline HTMLBodyElement *impl_from_DispatchEx(DispatchEx *iface) +{ + return CONTAINING_RECORD(iface, HTMLBodyElement, element.node.event_target.dispex); +} + +static void HTMLBodyElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb) +{ + HTMLBodyElement *This = impl_from_DispatchEx(dispex); + HTMLDOMNode_traverse(dispex, cb); + + if(This->nsbody) + note_cc_edge((nsISupports*)This->nsbody, "nsbody", cb); +} + +static void HTMLBodyElement_unlink(DispatchEx *dispex) +{ + HTMLBodyElement *This = impl_from_DispatchEx(dispex); + HTMLDOMNode_unlink(dispex); + unlink_ref(&This->nsbody); +} + static const cpc_entry_t HTMLBodyElement_cpc[] = { {&DIID_HTMLTextContainerEvents}, {&IID_IPropertyNotifySink}, @@ -969,12 +976,19 @@ static const NodeImplVtbl HTMLBodyElementImplVtbl = { .handle_event = HTMLElement_handle_event, .get_attr_col = HTMLElement_get_attr_col, .get_event_prop_target = HTMLBodyElement_get_event_prop_target, - .traverse = HTMLBodyElement_traverse, - .unlink = HTMLBodyElement_unlink, .is_text_edit = HTMLBodyElement_is_text_edit, .is_settable = HTMLBodyElement_is_settable };
+static const event_target_vtbl_t HTMLBodyElement_event_target_vtbl = { + { + HTMLELEMENT_DISPEX_VTBL_ENTRIES, + .traverse = HTMLBodyElement_traverse, + .unlink = HTMLBodyElement_unlink + }, + HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES, +}; + static const tid_t HTMLBodyElement_iface_tids[] = { IHTMLBodyElement_tid, IHTMLBodyElement2_tid, @@ -985,7 +999,7 @@ static const tid_t HTMLBodyElement_iface_tids[] = {
static dispex_static_data_t HTMLBodyElement_dispex = { "HTMLBodyElement", - &HTMLElement_event_target_vtbl.dispex_vtbl, + &HTMLBodyElement_event_target_vtbl.dispex_vtbl, DispHTMLBody_tid, HTMLBodyElement_iface_tids, HTMLElement_init_dispex_info