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

mshtml: Keep refs from the Attributes and AttributeCollection to the Element.

parent 6cfe757e
......@@ -810,7 +810,7 @@ static void *HTMLAnchorElement_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLAnchorElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLAnchorElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->nsanchor)
note_cc_edge((nsISupports*)This->nsanchor, "nsanchor", cb);
......@@ -819,7 +819,7 @@ static void HTMLAnchorElement_traverse(DispatchEx *dispex, nsCycleCollectionTrav
static void HTMLAnchorElement_unlink(DispatchEx *dispex)
{
HTMLAnchorElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_unlink(dispex);
HTMLElement_unlink(dispex);
unlink_ref(&This->nsanchor);
}
......
......@@ -426,7 +426,7 @@ static void *HTMLAreaElement_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLAreaElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLAreaElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->nsarea)
note_cc_edge((nsISupports*)This->nsarea, "nsarea", cb);
......@@ -435,7 +435,7 @@ static void HTMLAreaElement_traverse(DispatchEx *dispex, nsCycleCollectionTraver
static void HTMLAreaElement_unlink(DispatchEx *dispex)
{
HTMLAreaElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_unlink(dispex);
HTMLElement_unlink(dispex);
unlink_ref(&This->nsarea);
}
......
......@@ -466,19 +466,27 @@ static void *HTMLDOMAttribute_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLDOMAttribute_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLDOMAttribute *This = impl_from_DispatchEx(dispex);
if(This->elem)
note_cc_edge((nsISupports*)&This->elem->node.IHTMLDOMNode_iface, "elem", cb);
traverse_variant(&This->value, "value", cb);
}
static void HTMLDOMAttribute_unlink(DispatchEx *dispex)
{
HTMLDOMAttribute *This = impl_from_DispatchEx(dispex);
if(This->elem) {
HTMLElement *elem = This->elem;
This->elem = NULL;
IHTMLDOMNode_Release(&elem->node.IHTMLDOMNode_iface);
}
unlink_variant(&This->value);
}
static void HTMLDOMAttribute_destructor(DispatchEx *dispex)
{
HTMLDOMAttribute *This = impl_from_DispatchEx(dispex);
assert(!This->elem);
VariantClear(&This->value);
free(This->name);
free(This);
......@@ -527,6 +535,8 @@ HRESULT HTMLDOMAttribute_Create(const WCHAR *name, HTMLElement *elem, DISPID dis
/* For attributes attached to an element, (elem,dispid) pair should be valid used for its operation. */
if(elem) {
IHTMLDOMNode_AddRef(&elem->node.IHTMLDOMNode_iface);
hres = HTMLElement_get_attr_col(&elem->node, &col);
if(FAILED(hres)) {
IHTMLDOMAttribute_Release(&ret->IHTMLDOMAttribute_iface);
......
......@@ -943,7 +943,7 @@ static void *HTMLBodyElement_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLBodyElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLBodyElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->nsbody)
note_cc_edge((nsISupports*)This->nsbody, "nsbody", cb);
......@@ -952,7 +952,7 @@ static void HTMLBodyElement_traverse(DispatchEx *dispex, nsCycleCollectionTraver
static void HTMLBodyElement_unlink(DispatchEx *dispex)
{
HTMLBodyElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_unlink(dispex);
HTMLElement_unlink(dispex);
unlink_ref(&This->nsbody);
}
......
......@@ -187,8 +187,8 @@ static const event_target_vtbl_t HTMLCommentElement_event_target_vtbl = {
HTMLELEMENT_DISPEX_VTBL_ENTRIES,
.query_interface= HTMLCommentElement_query_interface,
.destructor = HTMLElement_destructor,
.traverse = HTMLDOMNode_traverse,
.unlink = HTMLDOMNode_unlink
.traverse = HTMLElement_traverse,
.unlink = HTMLElement_unlink
},
HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
.handle_event = HTMLElement_handle_event
......
......@@ -4792,6 +4792,7 @@ static HRESULT WINAPI HTMLElement4_setAttributeNode(IHTMLElement4 *iface, IHTMLD
replace->elem = NULL;
}else {
list_add_tail(&attrs->attrs, &attr->entry);
IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface);
}
IHTMLDOMAttribute_AddRef(&attr->IHTMLDOMAttribute_iface);
......@@ -6857,6 +6858,27 @@ void *HTMLElement_query_interface(DispatchEx *dispex, REFIID riid)
return HTMLDOMNode_query_interface(&This->node.event_target.dispex, riid);
}
void HTMLElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_traverse(&This->node.event_target.dispex, cb);
if(This->attrs)
note_cc_edge((nsISupports*)&This->attrs->IHTMLAttributeCollection_iface, "attrs", cb);
}
void HTMLElement_unlink(DispatchEx *dispex)
{
HTMLElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_unlink(&This->node.event_target.dispex);
if(This->attrs) {
HTMLAttributeCollection *attrs = This->attrs;
This->attrs = NULL;
IHTMLAttributeCollection_Release(&attrs->IHTMLAttributeCollection_iface);
}
}
void HTMLElement_destructor(DispatchEx *dispex)
{
HTMLElement *This = impl_from_DispatchEx(dispex);
......@@ -6871,15 +6893,6 @@ void HTMLElement_destructor(DispatchEx *dispex)
This->runtime_style->elem = NULL;
IHTMLStyle_Release(&This->runtime_style->IHTMLStyle_iface);
}
if(This->attrs) {
HTMLDOMAttribute *attr;
LIST_FOR_EACH_ENTRY(attr, &This->attrs->attrs, HTMLDOMAttribute, entry)
attr->elem = NULL;
This->attrs->elem = NULL;
IHTMLAttributeCollection_Release(&This->attrs->IHTMLAttributeCollection_iface);
}
free(This->filter);
HTMLDOMNode_destructor(&This->node.event_target.dispex);
......@@ -7278,8 +7291,8 @@ static const event_target_vtbl_t HTMLElement_event_target_vtbl = {
HTMLELEMENT_DISPEX_VTBL_ENTRIES,
.query_interface = HTMLElement_query_interface,
.destructor = HTMLElement_destructor,
.traverse = HTMLDOMNode_traverse,
.unlink = HTMLDOMNode_unlink,
.traverse = HTMLElement_traverse,
.unlink = HTMLElement_unlink,
},
HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
.handle_event = HTMLElement_handle_event
......@@ -8226,11 +8239,6 @@ static inline HRESULT get_attr_dispid_by_name(HTMLAttributeCollection *This, BST
}
}
if(!This->elem) {
WARN("NULL elem\n");
return E_UNEXPECTED;
}
hres = IDispatchEx_GetDispID(&This->elem->node.event_target.dispex.IDispatchEx_iface,
name, fdexNameCaseInsensitive, id);
return hres;
......@@ -8252,11 +8260,6 @@ static inline HRESULT get_domattr(HTMLAttributeCollection *This, DISPID id, LONG
}
if(!*attr) {
if(!This->elem) {
WARN("NULL elem\n");
return E_UNEXPECTED;
}
hres = HTMLDOMAttribute_Create(NULL, This->elem, id, dispex_compat_mode(&This->elem->node.event_target.dispex), attr);
if(FAILED(hres))
return hres;
......@@ -8811,6 +8814,8 @@ static void HTMLAttributeCollection_traverse(DispatchEx *dispex, nsCycleCollecti
LIST_FOR_EACH_ENTRY(attr, &This->attrs, HTMLDOMAttribute, entry)
note_cc_edge((nsISupports*)&attr->IHTMLDOMAttribute_iface, "attr", cb);
if(This->elem)
note_cc_edge((nsISupports*)&This->elem->node.IHTMLDOMNode_iface, "elem", cb);
}
static void HTMLAttributeCollection_unlink(DispatchEx *dispex)
......@@ -8820,9 +8825,13 @@ static void HTMLAttributeCollection_unlink(DispatchEx *dispex)
HTMLDOMAttribute *attr = LIST_ENTRY(list_head(&This->attrs), HTMLDOMAttribute, entry);
list_remove(&attr->entry);
attr->elem = NULL;
IHTMLDOMAttribute_Release(&attr->IHTMLDOMAttribute_iface);
}
if(This->elem) {
HTMLElement *elem = This->elem;
This->elem = NULL;
IHTMLDOMNode_Release(&elem->node.IHTMLDOMNode_iface);
}
}
static void HTMLAttributeCollection_destructor(DispatchEx *dispex)
......@@ -8938,6 +8947,7 @@ HRESULT HTMLElement_get_attr_col(HTMLDOMNode *iface, HTMLAttributeCollection **a
This->attrs->IHTMLAttributeCollection2_iface.lpVtbl = &HTMLAttributeCollection2Vtbl;
This->attrs->IHTMLAttributeCollection3_iface.lpVtbl = &HTMLAttributeCollection3Vtbl;
IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface);
This->attrs->elem = This;
list_init(&This->attrs->attrs);
init_dispatch(&This->attrs->dispex, &HTMLAttributeCollection_dispex, dispex_compat_mode(&iface->event_target.dispex));
......
......@@ -788,7 +788,7 @@ static void *HTMLFormElement_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLFormElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLFormElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->nsform)
note_cc_edge((nsISupports*)This->nsform, "nsform", cb);
......@@ -797,7 +797,7 @@ static void HTMLFormElement_traverse(DispatchEx *dispex, nsCycleCollectionTraver
static void HTMLFormElement_unlink(DispatchEx *dispex)
{
HTMLFormElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_unlink(dispex);
HTMLElement_unlink(dispex);
unlink_ref(&This->nsform);
}
......
......@@ -944,7 +944,7 @@ static void *HTMLFrameElement_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLFrameElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLFrameElement *This = frame_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->framebase.nsframe)
note_cc_edge((nsISupports*)This->framebase.nsframe, "nsframe", cb);
......@@ -1534,7 +1534,7 @@ static void *HTMLIFrame_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLIFrame_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLIFrame *This = iframe_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->framebase.nsiframe)
note_cc_edge((nsISupports*)This->framebase.nsiframe, "nsiframe", cb);
......
......@@ -150,8 +150,8 @@ static const event_target_vtbl_t HTMLGenericElement_event_target_vtbl = {
HTMLELEMENT_DISPEX_VTBL_ENTRIES,
.query_interface= HTMLGenericElement_query_interface,
.destructor = HTMLElement_destructor,
.traverse = HTMLDOMNode_traverse,
.unlink = HTMLDOMNode_unlink
.traverse = HTMLElement_traverse,
.unlink = HTMLElement_unlink
},
HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
.handle_event = HTMLElement_handle_event
......
......@@ -168,8 +168,8 @@ static const event_target_vtbl_t HTMLTitleElement_event_target_vtbl = {
HTMLELEMENT_DISPEX_VTBL_ENTRIES,
.query_interface= HTMLTitleElement_query_interface,
.destructor = HTMLElement_destructor,
.traverse = HTMLDOMNode_traverse,
.unlink = HTMLDOMNode_unlink
.traverse = HTMLElement_traverse,
.unlink = HTMLElement_unlink
},
HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
.handle_event = HTMLElement_handle_event
......@@ -338,8 +338,8 @@ static const event_target_vtbl_t HTMLHtmlElement_event_target_vtbl = {
HTMLELEMENT_DISPEX_VTBL_ENTRIES,
.query_interface= HTMLHtmlElement_query_interface,
.destructor = HTMLElement_destructor,
.traverse = HTMLDOMNode_traverse,
.unlink = HTMLDOMNode_unlink
.traverse = HTMLElement_traverse,
.unlink = HTMLElement_unlink
},
HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
.handle_event = HTMLElement_handle_event
......@@ -565,8 +565,8 @@ static const event_target_vtbl_t HTMLMetaElement_event_target_vtbl = {
HTMLELEMENT_DISPEX_VTBL_ENTRIES,
.query_interface= HTMLMetaElement_query_interface,
.destructor = HTMLElement_destructor,
.traverse = HTMLDOMNode_traverse,
.unlink = HTMLDOMNode_unlink
.traverse = HTMLElement_traverse,
.unlink = HTMLElement_unlink
},
HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
.handle_event = HTMLElement_handle_event
......@@ -727,8 +727,8 @@ static const event_target_vtbl_t HTMLHeadElement_event_target_vtbl = {
HTMLELEMENT_DISPEX_VTBL_ENTRIES,
.query_interface= HTMLHeadElement_query_interface,
.destructor = HTMLElement_destructor,
.traverse = HTMLDOMNode_traverse,
.unlink = HTMLDOMNode_unlink
.traverse = HTMLElement_traverse,
.unlink = HTMLElement_unlink
},
HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
.handle_event = HTMLElement_handle_event
......
......@@ -683,7 +683,7 @@ static void *HTMLImgElement_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLImgElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLImg *This = HTMLImg_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->nsimg)
note_cc_edge((nsISupports*)This->nsimg, "nsimg", cb);
......@@ -692,7 +692,7 @@ static void HTMLImgElement_traverse(DispatchEx *dispex, nsCycleCollectionTravers
static void HTMLImgElement_unlink(DispatchEx *dispex)
{
HTMLImg *This = HTMLImg_from_DispatchEx(dispex);
HTMLDOMNode_unlink(dispex);
HTMLElement_unlink(dispex);
unlink_ref(&This->nsimg);
}
......
......@@ -1397,7 +1397,7 @@ static void *HTMLInputElement_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLInputElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLInputElement *This = input_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->nsinput)
note_cc_edge((nsISupports*)This->nsinput, "nsinput", cb);
......@@ -1406,7 +1406,7 @@ static void HTMLInputElement_traverse(DispatchEx *dispex, nsCycleCollectionTrave
static void HTMLInputElement_unlink(DispatchEx *dispex)
{
HTMLInputElement *This = input_from_DispatchEx(dispex);
HTMLDOMNode_unlink(dispex);
HTMLElement_unlink(dispex);
unlink_ref(&This->nsinput);
}
......@@ -1621,8 +1621,8 @@ static const event_target_vtbl_t HTMLLabelElement_event_target_vtbl = {
HTMLELEMENT_DISPEX_VTBL_ENTRIES,
.query_interface= HTMLLabelElement_query_interface,
.destructor = HTMLElement_destructor,
.traverse = HTMLDOMNode_traverse,
.unlink = HTMLDOMNode_unlink
.traverse = HTMLElement_traverse,
.unlink = HTMLElement_unlink
},
HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
.handle_event = HTMLElement_handle_event
......@@ -1932,7 +1932,7 @@ static void *HTMLButtonElement_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLButtonElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLButtonElement *This = button_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->nsbutton)
note_cc_edge((nsISupports*)This->nsbutton, "nsbutton", cb);
......@@ -1941,7 +1941,7 @@ static void HTMLButtonElement_traverse(DispatchEx *dispex, nsCycleCollectionTrav
static void HTMLButtonElement_unlink(DispatchEx *dispex)
{
HTMLButtonElement *This = button_from_DispatchEx(dispex);
HTMLDOMNode_unlink(dispex);
HTMLElement_unlink(dispex);
unlink_ref(&This->nsbutton);
}
......
......@@ -404,7 +404,7 @@ static void *HTMLLinkElement_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLLinkElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLLinkElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->nslink)
note_cc_edge((nsISupports*)This->nslink, "nslink", cb);
......@@ -413,7 +413,7 @@ static void HTMLLinkElement_traverse(DispatchEx *dispex, nsCycleCollectionTraver
static void HTMLLinkElement_unlink(DispatchEx *dispex)
{
HTMLLinkElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_unlink(dispex);
HTMLElement_unlink(dispex);
unlink_ref(&This->nslink);
}
static const NodeImplVtbl HTMLLinkElementImplVtbl = {
......
......@@ -687,7 +687,7 @@ static void *HTMLObjectElement_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLObjectElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLObjectElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->nsobject)
note_cc_edge((nsISupports*)This->nsobject, "nsobject", cb);
......@@ -696,7 +696,7 @@ static void HTMLObjectElement_traverse(DispatchEx *dispex, nsCycleCollectionTrav
static void HTMLObjectElement_unlink(DispatchEx *dispex)
{
HTMLObjectElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_unlink(dispex);
HTMLElement_unlink(dispex);
unlink_ref(&This->nsobject);
}
......@@ -1010,8 +1010,8 @@ static const event_target_vtbl_t HTMLEmbedElement_event_target_vtbl = {
HTMLELEMENT_DISPEX_VTBL_ENTRIES,
.query_interface= HTMLEmbedElement_query_interface,
.destructor = HTMLElement_destructor,
.traverse = HTMLDOMNode_traverse,
.unlink = HTMLDOMNode_unlink
.traverse = HTMLElement_traverse,
.unlink = HTMLElement_unlink
},
HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
.handle_event = HTMLElement_handle_event
......
......@@ -398,7 +398,7 @@ static void *HTMLScriptElement_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLScriptElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLScriptElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->nsscript)
note_cc_edge((nsISupports*)This->nsscript, "nsscript", cb);
......@@ -407,7 +407,7 @@ static void HTMLScriptElement_traverse(DispatchEx *dispex, nsCycleCollectionTrav
static void HTMLScriptElement_unlink(DispatchEx *dispex)
{
HTMLScriptElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_unlink(dispex);
HTMLElement_unlink(dispex);
unlink_ref(&This->nsscript);
}
......
......@@ -359,7 +359,7 @@ static void *HTMLOptionElement_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLOptionElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLOptionElement *This = HTMLOptionElement_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->nsoption)
note_cc_edge((nsISupports*)This->nsoption, "nsoption", cb);
......@@ -368,7 +368,7 @@ static void HTMLOptionElement_traverse(DispatchEx *dispex, nsCycleCollectionTrav
static void HTMLOptionElement_unlink(DispatchEx *dispex)
{
HTMLOptionElement *This = HTMLOptionElement_from_DispatchEx(dispex);
HTMLDOMNode_unlink(dispex);
HTMLElement_unlink(dispex);
unlink_ref(&This->nsoption);
}
......@@ -1351,7 +1351,7 @@ static void *HTMLSelectElement_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLSelectElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLSelectElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->nsselect)
note_cc_edge((nsISupports*)This->nsselect, "nsselect", cb);
......@@ -1360,7 +1360,7 @@ static void HTMLSelectElement_traverse(DispatchEx *dispex, nsCycleCollectionTrav
static void HTMLSelectElement_unlink(DispatchEx *dispex)
{
HTMLSelectElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_unlink(dispex);
HTMLElement_unlink(dispex);
unlink_ref(&This->nsselect);
}
......
......@@ -380,7 +380,7 @@ static void *HTMLStyleElement_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLStyleElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLStyleElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->nsstyle)
note_cc_edge((nsISupports*)This->nsstyle, "nsstyle", cb);
......@@ -389,7 +389,7 @@ static void HTMLStyleElement_traverse(DispatchEx *dispex, nsCycleCollectionTrave
static void HTMLStyleElement_unlink(DispatchEx *dispex)
{
HTMLStyleElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_unlink(dispex);
HTMLElement_unlink(dispex);
unlink_ref(&This->nsstyle);
}
......
......@@ -459,7 +459,7 @@ static void *HTMLTableCell_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLTableCell_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLTableCell *This = HTMLTableCell_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->nscell)
note_cc_edge((nsISupports*)This->nscell, "nstablecell", cb);
......@@ -468,7 +468,7 @@ static void HTMLTableCell_traverse(DispatchEx *dispex, nsCycleCollectionTraversa
static void HTMLTableCell_unlink(DispatchEx *dispex)
{
HTMLTableCell *This = HTMLTableCell_from_DispatchEx(dispex);
HTMLDOMNode_unlink(dispex);
HTMLElement_unlink(dispex);
unlink_ref(&This->nscell);
}
......@@ -884,7 +884,7 @@ static void *HTMLTableRow_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLTableRow_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLTableRow *This = HTMLTableRow_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->nsrow)
note_cc_edge((nsISupports*)This->nsrow, "nstablerow", cb);
......@@ -893,7 +893,7 @@ static void HTMLTableRow_traverse(DispatchEx *dispex, nsCycleCollectionTraversal
static void HTMLTableRow_unlink(DispatchEx *dispex)
{
HTMLTableRow *This = HTMLTableRow_from_DispatchEx(dispex);
HTMLDOMNode_unlink(dispex);
HTMLElement_unlink(dispex);
unlink_ref(&This->nsrow);
}
......@@ -1887,7 +1887,7 @@ static void *HTMLTable_query_interface(DispatchEx *dispex, REFIID riid)
static void HTMLTable_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLTable *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->nstable)
note_cc_edge((nsISupports*)This->nstable, "nstable", cb);
......@@ -1896,7 +1896,7 @@ static void HTMLTable_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCal
static void HTMLTable_unlink(DispatchEx *dispex)
{
HTMLTable *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_unlink(dispex);
HTMLElement_unlink(dispex);
unlink_ref(&This->nstable);
}
......
......@@ -425,7 +425,7 @@ static void *HTMLTextAreaElement_query_interface(DispatchEx *dispex, REFIID riid
static void HTMLTextAreaElement_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCallback *cb)
{
HTMLTextAreaElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_traverse(dispex, cb);
HTMLElement_traverse(dispex, cb);
if(This->nstextarea)
note_cc_edge((nsISupports*)This->nstextarea, "nstextarea", cb);
......@@ -434,7 +434,7 @@ static void HTMLTextAreaElement_traverse(DispatchEx *dispex, nsCycleCollectionTr
static void HTMLTextAreaElement_unlink(DispatchEx *dispex)
{
HTMLTextAreaElement *This = impl_from_DispatchEx(dispex);
HTMLDOMNode_unlink(dispex);
HTMLElement_unlink(dispex);
unlink_ref(&This->nstextarea);
}
......
......@@ -1204,6 +1204,8 @@ void HTMLDOMNode_init_dispex_info(dispex_data_t*,compat_mode_t);
void *HTMLElement_query_interface(DispatchEx*,REFIID);
void HTMLElement_destructor(DispatchEx*);
void HTMLElement_traverse(DispatchEx*,nsCycleCollectionTraversalCallback*);
void HTMLElement_unlink(DispatchEx*);
HRESULT HTMLElement_populate_props(DispatchEx*);
HRESULT HTMLElement_clone(HTMLDOMNode*,nsIDOMNode*,HTMLDOMNode**);
HRESULT HTMLElement_get_attr_col(HTMLDOMNode*,HTMLAttributeCollection**);
......
......@@ -200,8 +200,8 @@ static const event_target_vtbl_t SVGElement_event_target_vtbl = {
HTMLELEMENT_DISPEX_VTBL_ENTRIES,
.query_interface= SVGElement_query_interface,
.destructor = HTMLElement_destructor,
.traverse = HTMLDOMNode_traverse,
.unlink = HTMLDOMNode_unlink
.traverse = HTMLElement_traverse,
.unlink = HTMLElement_unlink
},
HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
.handle_event = HTMLElement_handle_event
......@@ -751,8 +751,8 @@ static const event_target_vtbl_t SVGSVGElement_event_target_vtbl = {
HTMLELEMENT_DISPEX_VTBL_ENTRIES,
.query_interface= SVGSVGElement_query_interface,
.destructor = HTMLElement_destructor,
.traverse = HTMLDOMNode_traverse,
.unlink = HTMLDOMNode_unlink
.traverse = HTMLElement_traverse,
.unlink = HTMLElement_unlink
},
HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
.handle_event = HTMLElement_handle_event
......@@ -932,8 +932,8 @@ static const event_target_vtbl_t SVGCircleElement_event_target_vtbl = {
HTMLELEMENT_DISPEX_VTBL_ENTRIES,
.query_interface= SVGCircleElement_query_interface,
.destructor = HTMLElement_destructor,
.traverse = HTMLDOMNode_traverse,
.unlink = HTMLDOMNode_unlink
.traverse = HTMLElement_traverse,
.unlink = HTMLElement_unlink
},
HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
.handle_event = HTMLElement_handle_event
......@@ -1188,8 +1188,8 @@ static const event_target_vtbl_t SVGTSpanElement_event_target_vtbl = {
HTMLELEMENT_DISPEX_VTBL_ENTRIES,
.query_interface= SVGTSpanElement_query_interface,
.destructor = HTMLElement_destructor,
.traverse = HTMLDOMNode_traverse,
.unlink = HTMLDOMNode_unlink
.traverse = HTMLElement_traverse,
.unlink = HTMLElement_unlink
},
HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
.handle_event = HTMLElement_handle_event
......
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