From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/htmldoc.c | 2 +- dlls/mshtml/htmlelem.c | 2 +- dlls/mshtml/htmlnode.c | 23 ++++------------------- dlls/mshtml/mshtml_private.h | 2 +- dlls/mshtml/tests/documentmode.js | 2 +- 5 files changed, 8 insertions(+), 23 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 57851f20b52..2c92b6e3d8f 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -4447,7 +4447,7 @@ static HRESULT WINAPI DocumentSelector_querySelectorAll(IDocumentSelector *iface return map_nsresult(nsres); }
- hres = create_child_collection(node_list, dispex_compat_mode(&This->node.event_target.dispex), pel); + hres = create_child_collection(node_list, &This->node.event_target.dispex, pel); nsIDOMNodeList_Release(node_list); return hres; } diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 24ecf145752..f6be9c8d35e 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -5964,7 +5964,7 @@ static HRESULT WINAPI ElementSelector_querySelectorAll(IElementSelector *iface, return map_nsresult(nsres); }
- hres = create_child_collection(node_list, dispex_compat_mode(&This->node.event_target.dispex), pel); + hres = create_child_collection(node_list, &This->node.event_target.dispex, pel); nsIDOMNodeList_Release(node_list); return hres; } diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index 3123e9dd72e..8f9de03fd93 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -338,21 +338,6 @@ static HRESULT HTMLDOMChildrenCollection_get_dispid(DispatchEx *dispex, const WC return S_OK; }
-static HRESULT HTMLDOMChildrenCollection_get_name(DispatchEx *dispex, DISPID id, BSTR *name) -{ - HTMLDOMChildrenCollection *This = impl_from_DispatchEx(dispex); - DWORD idx = id - DISPID_CHILDCOL_0; - UINT32 len = 0; - WCHAR buf[11]; - - nsIDOMNodeList_GetLength(This->nslist, &len); - if(idx >= len) - return DISP_E_MEMBERNOTFOUND; - - len = swprintf(buf, ARRAY_SIZE(buf), L"%u", idx); - return (*name = SysAllocStringLen(buf, len)) ? S_OK : E_OUTOFMEMORY; -} - static HRESULT HTMLDOMChildrenCollection_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { @@ -389,7 +374,7 @@ static const dispex_static_data_vtbl_t HTMLDOMChildrenCollection_dispex_vtbl = { .traverse = HTMLDOMChildrenCollection_traverse, .unlink = HTMLDOMChildrenCollection_unlink, .get_dispid = HTMLDOMChildrenCollection_get_dispid, - .get_name = HTMLDOMChildrenCollection_get_name, + .get_prop_desc = dispex_index_prop_desc, .invoke = HTMLDOMChildrenCollection_invoke, };
@@ -406,7 +391,7 @@ static dispex_static_data_t HTMLDOMChildrenCollection_dispex = { HTMLDOMNode_init_dispex_info };
-HRESULT create_child_collection(nsIDOMNodeList *nslist, compat_mode_t compat_mode, IHTMLDOMChildrenCollection **ret) +HRESULT create_child_collection(nsIDOMNodeList *nslist, DispatchEx *owner, IHTMLDOMChildrenCollection **ret) { HTMLDOMChildrenCollection *collection;
@@ -418,7 +403,7 @@ HRESULT create_child_collection(nsIDOMNodeList *nslist, compat_mode_t compat_mod nsIDOMNodeList_AddRef(nslist); collection->nslist = nslist;
- init_dispatch(&collection->dispex, &HTMLDOMChildrenCollection_dispex, NULL, compat_mode); + init_dispatch_with_owner(&collection->dispex, &HTMLDOMChildrenCollection_dispex, owner);
*ret = &collection->IHTMLDOMChildrenCollection_iface; return S_OK; @@ -530,7 +515,7 @@ static HRESULT WINAPI HTMLDOMNode_get_childNodes(IHTMLDOMNode *iface, IDispatch return hres; }
- hres = create_child_collection(nslist, dispex_compat_mode(&This->event_target.dispex), + hres = create_child_collection(nslist, &This->event_target.dispex, (IHTMLDOMChildrenCollection**)p); nsIDOMNodeList_Release(nslist); return hres; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index f245acc8d75..1f6119eb339 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1302,7 +1302,7 @@ extern const void *iface_wrapper_vtbl[]; IHTMLElementCollection *create_all_collection(HTMLDOMNode*,BOOL); IHTMLElementCollection *create_collection_from_nodelist(nsIDOMNodeList*,DispatchEx*); IHTMLElementCollection *create_collection_from_htmlcol(nsIDOMHTMLCollection*,DispatchEx*); -HRESULT create_child_collection(nsIDOMNodeList*,compat_mode_t,IHTMLDOMChildrenCollection**); +HRESULT create_child_collection(nsIDOMNodeList*,DispatchEx*,IHTMLDOMChildrenCollection**);
HRESULT attr_value_to_string(VARIANT*); HRESULT get_elem_attr_value_by_dispid(HTMLElement*,DISPID,VARIANT*); diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index e676197d728..f529743d606 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -292,7 +292,7 @@ sync_test("builtin_toString", function() {
test("attribute", document.createAttribute("class"), "Attr"); if(false /* todo_wine */) test("attributes", e.attributes, "NamedNodeMap"); - test("childNodes", document.body.childNodes, "NodeList", null, true); + test("childNodes", document.body.childNodes, "NodeList"); if(clientRects) test("clientRect", clientRects[0], "ClientRect"); if(clientRects) test("clientRects", clientRects, "ClientRectList"); if(currentStyle) test("currentStyle", currentStyle, "MSCurrentStyleCSSProperties", null, true);