Module: wine Branch: master Commit: 78c60c0718b13f806bf1753611ad799581786cba URL: https://gitlab.winehq.org/wine/wine/-/commit/78c60c0718b13f806bf1753611ad799...
Author: Gabriel Ivăncescu gabrielopcode@gmail.com Date: Fri Sep 15 16:54:17 2023 +0300
mshtml: Traverse and unlink OptionElements using the dispex.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com
---
dlls/mshtml/htmlselect.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c index ba620021822..e4e84fcd5df 100644 --- a/dlls/mshtml/htmlselect.c +++ b/dlls/mshtml/htmlselect.c @@ -360,17 +360,24 @@ static void *HTMLOptionElement_QI(HTMLDOMNode *iface, REFIID riid) return HTMLElement_QI(&This->element.node, riid); }
-static void HTMLOptionElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb) +static inline HTMLOptionElement *HTMLOptionElement_from_DispatchEx(DispatchEx *iface) { - HTMLOptionElement *This = HTMLOptionElement_from_HTMLDOMNode(iface); + return CONTAINING_RECORD(iface, HTMLOptionElement, element.node.event_target.dispex); +} + +static void HTMLOptionElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb) +{ + HTMLOptionElement *This = HTMLOptionElement_from_DispatchEx(dispex); + HTMLDOMNode_traverse(dispex, cb);
if(This->nsoption) - note_cc_edge((nsISupports*)This->nsoption, "This->nsoption", cb); + note_cc_edge((nsISupports*)This->nsoption, "nsoption", cb); }
-static void HTMLOptionElement_unlink(HTMLDOMNode *iface) +static void HTMLOptionElement_unlink(DispatchEx *dispex) { - HTMLOptionElement *This = HTMLOptionElement_from_HTMLDOMNode(iface); + HTMLOptionElement *This = HTMLOptionElement_from_DispatchEx(dispex); + HTMLDOMNode_unlink(dispex); unlink_ref(&This->nsoption); }
@@ -382,8 +389,15 @@ static const NodeImplVtbl HTMLOptionElementImplVtbl = { .clone = HTMLElement_clone, .handle_event = HTMLElement_handle_event, .get_attr_col = HTMLElement_get_attr_col, - .traverse = HTMLOptionElement_traverse, - .unlink = HTMLOptionElement_unlink +}; + +static const event_target_vtbl_t HTMLOptionElement_event_target_vtbl = { + { + HTMLELEMENT_DISPEX_VTBL_ENTRIES, + .traverse = HTMLOptionElement_traverse, + .unlink = HTMLOptionElement_unlink + }, + HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES, };
static const tid_t HTMLOptionElement_iface_tids[] = { @@ -393,7 +407,7 @@ static const tid_t HTMLOptionElement_iface_tids[] = { }; static dispex_static_data_t HTMLOptionElement_dispex = { "HTMLOptionElement", - &HTMLElement_event_target_vtbl.dispex_vtbl, + &HTMLOptionElement_event_target_vtbl.dispex_vtbl, DispHTMLOptionElement_tid, HTMLOptionElement_iface_tids, HTMLElement_init_dispex_info