From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/htmlobject.c | 35 +++-------------------------------- dlls/mshtml/pluginhost.c | 28 +++++++++++++++++++++++++--- dlls/mshtml/pluginhost.h | 7 +++++-- 3 files changed, 33 insertions(+), 37 deletions(-)
diff --git a/dlls/mshtml/htmlobject.c b/dlls/mshtml/htmlobject.c index 7c9892ce999..8d47dc9306d 100644 --- a/dlls/mshtml/htmlobject.c +++ b/dlls/mshtml/htmlobject.c @@ -653,25 +653,6 @@ static void HTMLObjectElement_unlink(DispatchEx *dispex) unlink_ref(&This->nsobject); }
-static void HTMLObjectElement_destructor(DispatchEx *dispex) -{ - HTMLObjectElement *This = impl_from_DispatchEx(dispex); - - if(This->plugin_container.plugin_host) - detach_plugin_host(This->plugin_container.plugin_host); - - HTMLElement_destructor(&This->plugin_container.element.node.event_target.dispex); -} - -static HRESULT HTMLObjectElement_get_dispid(DispatchEx *dispex, const WCHAR *name, DWORD grfdex, DISPID *dispid) -{ - HTMLObjectElement *This = impl_from_DispatchEx(dispex); - - TRACE("(%p)->(%s %lx %p)\n", This, debugstr_w(name), grfdex, dispid); - - return get_plugin_dispid(&This->plugin_container, name, dispid); -} - static HRESULT HTMLObjectElement_dispex_get_name(DispatchEx *dispex, DISPID id, BSTR *name) { HTMLObjectElement *This = impl_from_DispatchEx(dispex); @@ -681,16 +662,6 @@ static HRESULT HTMLObjectElement_dispex_get_name(DispatchEx *dispex, DISPID id, return E_NOTIMPL; }
-static HRESULT HTMLObjectElement_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, - VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) -{ - HTMLObjectElement *This = impl_from_DispatchEx(dispex); - - TRACE("(%p)->(%ld)\n", This, id); - - return invoke_plugin_prop(&This->plugin_container, id, lcid, flags, params, res, ei); -} - static const NodeImplVtbl HTMLObjectElementImplVtbl = { .clsid = &CLSID_HTMLObjectElement, .cpc_entries = HTMLElement_cpc, @@ -703,12 +674,12 @@ static const event_target_vtbl_t HTMLObjectElement_event_target_vtbl = { { HTMLELEMENT_DISPEX_VTBL_ENTRIES, .query_interface= HTMLObjectElement_query_interface, - .destructor = HTMLObjectElement_destructor, + .destructor = HTMLPluginContainer_destructor, .traverse = HTMLObjectElement_traverse, .unlink = HTMLObjectElement_unlink, - .get_dispid = HTMLObjectElement_get_dispid, + .get_dispid = HTMLPluginContainer_get_dispid, .get_name = HTMLObjectElement_dispex_get_name, - .invoke = HTMLObjectElement_invoke + .invoke = HTMLPluginContainer_invoke }, HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES, .handle_event = HTMLElement_handle_event diff --git a/dlls/mshtml/pluginhost.c b/dlls/mshtml/pluginhost.c index ce184315127..49e3c66a3e1 100644 --- a/dlls/mshtml/pluginhost.c +++ b/dlls/mshtml/pluginhost.c @@ -704,13 +704,32 @@ HRESULT get_plugin_disp(HTMLPluginContainer *plugin_container, IDispatch **ret) return S_OK; }
-HRESULT get_plugin_dispid(HTMLPluginContainer *plugin_container, const WCHAR *name, DISPID *ret) +static inline HTMLPluginContainer *impl_from_DispatchEx(DispatchEx *iface) { + return CONTAINING_RECORD(iface, HTMLPluginContainer, element.node.event_target.dispex); +} + +void HTMLPluginContainer_destructor(DispatchEx *dispex) +{ + HTMLPluginContainer *This = impl_from_DispatchEx(dispex); + + if(This->plugin_host) + detach_plugin_host(This->plugin_host); + free(This->props); + + HTMLElement_destructor(&This->element.node.event_target.dispex); +} + +HRESULT HTMLPluginContainer_get_dispid(DispatchEx *dispex, const WCHAR *name, DWORD grfdex, DISPID *ret) +{ + HTMLPluginContainer *plugin_container = impl_from_DispatchEx(dispex); IDispatch *disp; DISPID id; DWORD i; HRESULT hres;
+ TRACE("(%p)->(%s %lx %p)\n", plugin_container, debugstr_w(name), grfdex, ret); + if(!plugin_container->plugin_host) { WARN("no plugin host\n"); return DISP_E_UNKNOWNNAME; @@ -755,11 +774,14 @@ HRESULT get_plugin_dispid(HTMLPluginContainer *plugin_container, const WCHAR *na return S_OK; }
-HRESULT invoke_plugin_prop(HTMLPluginContainer *plugin_container, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, - VARIANT *res, EXCEPINFO *ei) +HRESULT HTMLPluginContainer_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, + VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { + HTMLPluginContainer *plugin_container = impl_from_DispatchEx(dispex); PluginHost *host;
+ TRACE("(%p)->(%ld)\n", plugin_container, id); + host = plugin_container->plugin_host; if(!host || !host->disp) { FIXME("Called with no disp\n"); diff --git a/dlls/mshtml/pluginhost.h b/dlls/mshtml/pluginhost.h index bdef901bc80..f76aa5b10ca 100644 --- a/dlls/mshtml/pluginhost.h +++ b/dlls/mshtml/pluginhost.h @@ -67,7 +67,10 @@ void update_plugin_window(PluginHost*,HWND,const RECT*); void detach_plugin_host(PluginHost*);
HRESULT get_plugin_disp(HTMLPluginContainer*,IDispatch**); -HRESULT get_plugin_dispid(HTMLPluginContainer*,const WCHAR*,DISPID*); -HRESULT invoke_plugin_prop(HTMLPluginContainer*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*); void notif_container_change(HTMLPluginContainer*,DISPID); void bind_activex_event(HTMLDocumentNode*,HTMLPluginContainer*,WCHAR*,IDispatch*); + +void HTMLPluginContainer_destructor(DispatchEx *dispex); +HRESULT HTMLPluginContainer_get_dispid(DispatchEx *dispex, const WCHAR *name, DWORD grfdex, DISPID *dispid); +HRESULT HTMLPluginContainer_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, + VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller);
From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/pluginhost.c | 25 ++++++++++++++++++------- dlls/mshtml/pluginhost.h | 8 +++++++- 2 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/dlls/mshtml/pluginhost.c b/dlls/mshtml/pluginhost.c index 49e3c66a3e1..bbf93c2b713 100644 --- a/dlls/mshtml/pluginhost.c +++ b/dlls/mshtml/pluginhost.c @@ -712,9 +712,13 @@ static inline HTMLPluginContainer *impl_from_DispatchEx(DispatchEx *iface) void HTMLPluginContainer_destructor(DispatchEx *dispex) { HTMLPluginContainer *This = impl_from_DispatchEx(dispex); + unsigned int i;
if(This->plugin_host) detach_plugin_host(This->plugin_host); + + for(i = 0; i < This->props_len; i++) + free(This->props[i]); free(This->props);
HTMLElement_destructor(&This->element.node.event_target.dispex); @@ -723,9 +727,10 @@ void HTMLPluginContainer_destructor(DispatchEx *dispex) HRESULT HTMLPluginContainer_get_dispid(DispatchEx *dispex, const WCHAR *name, DWORD grfdex, DISPID *ret) { HTMLPluginContainer *plugin_container = impl_from_DispatchEx(dispex); + struct plugin_prop *prop; IDispatch *disp; DISPID id; - DWORD i; + DWORD i, len; HRESULT hres;
TRACE("(%p)->(%s %lx %p)\n", plugin_container, debugstr_w(name), grfdex, ret); @@ -746,21 +751,21 @@ HRESULT HTMLPluginContainer_get_dispid(DispatchEx *dispex, const WCHAR *name, DW }
for(i=0; i < plugin_container->props_len; i++) { - if(id == plugin_container->props[i]) { + if(id == plugin_container->props[i]->id) { *ret = MSHTML_DISPID_CUSTOM_MIN+i; return S_OK; } }
if(!plugin_container->props) { - plugin_container->props = malloc(8 * sizeof(DISPID)); + plugin_container->props = malloc(8 * sizeof(*plugin_container->props)); if(!plugin_container->props) return E_OUTOFMEMORY; plugin_container->props_size = 8; }else if(plugin_container->props_len == plugin_container->props_size) { - DISPID *new_props; + struct plugin_prop **new_props;
- new_props = realloc(plugin_container->props, plugin_container->props_size * 2 * sizeof(DISPID)); + new_props = realloc(plugin_container->props, plugin_container->props_size * 2 * sizeof(*new_props)); if(!new_props) return E_OUTOFMEMORY;
@@ -768,7 +773,13 @@ HRESULT HTMLPluginContainer_get_dispid(DispatchEx *dispex, const WCHAR *name, DW plugin_container->props_size *= 2; }
- plugin_container->props[plugin_container->props_len] = id; + len = wcslen(name); + if(!(prop = malloc(FIELD_OFFSET(struct plugin_prop, name[len + 1])))) + return E_OUTOFMEMORY; + + prop->id = id; + wcscpy(prop->name, name); + plugin_container->props[plugin_container->props_len] = prop; *ret = MSHTML_DISPID_CUSTOM_MIN+plugin_container->props_len; plugin_container->props_len++; return S_OK; @@ -798,7 +809,7 @@ HRESULT HTMLPluginContainer_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WOR return E_FAIL; }
- return IDispatch_Invoke(host->disp, plugin_container->props[id-MSHTML_DISPID_CUSTOM_MIN], &IID_NULL, + return IDispatch_Invoke(host->disp, plugin_container->props[id-MSHTML_DISPID_CUSTOM_MIN]->id, &IID_NULL, lcid, flags, params, res, ei, NULL); }
diff --git a/dlls/mshtml/pluginhost.h b/dlls/mshtml/pluginhost.h index f76aa5b10ca..afbbc40e657 100644 --- a/dlls/mshtml/pluginhost.h +++ b/dlls/mshtml/pluginhost.h @@ -48,12 +48,18 @@ typedef struct { HTMLPluginContainer *element; } PluginHost;
+struct plugin_prop +{ + DISPID id; + WCHAR name[1]; +}; + struct HTMLPluginContainer { HTMLElement element;
PluginHost *plugin_host;
- DISPID *props; + struct plugin_prop **props; DWORD props_size; DWORD props_len; };
From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/htmlobject.c | 11 +---------- dlls/mshtml/pluginhost.c | 26 ++++++++++++++++++++++++++ dlls/mshtml/pluginhost.h | 1 + dlls/mshtml/tests/documentmode.js | 2 +- 4 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/dlls/mshtml/htmlobject.c b/dlls/mshtml/htmlobject.c index 8d47dc9306d..b75dea24272 100644 --- a/dlls/mshtml/htmlobject.c +++ b/dlls/mshtml/htmlobject.c @@ -653,15 +653,6 @@ static void HTMLObjectElement_unlink(DispatchEx *dispex) unlink_ref(&This->nsobject); }
-static HRESULT HTMLObjectElement_dispex_get_name(DispatchEx *dispex, DISPID id, BSTR *name) -{ - HTMLObjectElement *This = impl_from_DispatchEx(dispex); - - FIXME("(%p)->(%lx %p)\n", This, id, name); - - return E_NOTIMPL; -} - static const NodeImplVtbl HTMLObjectElementImplVtbl = { .clsid = &CLSID_HTMLObjectElement, .cpc_entries = HTMLElement_cpc, @@ -678,7 +669,7 @@ static const event_target_vtbl_t HTMLObjectElement_event_target_vtbl = { .traverse = HTMLObjectElement_traverse, .unlink = HTMLObjectElement_unlink, .get_dispid = HTMLPluginContainer_get_dispid, - .get_name = HTMLObjectElement_dispex_get_name, + .get_prop_desc = HTMLPluginContainer_get_prop_desc, .invoke = HTMLPluginContainer_invoke }, HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES, diff --git a/dlls/mshtml/pluginhost.c b/dlls/mshtml/pluginhost.c index bbf93c2b713..5479e25b0b8 100644 --- a/dlls/mshtml/pluginhost.c +++ b/dlls/mshtml/pluginhost.c @@ -813,6 +813,32 @@ HRESULT HTMLPluginContainer_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WOR lcid, flags, params, res, ei, NULL); }
+HRESULT HTMLPluginContainer_get_prop_desc(DispatchEx *dispex, DISPID id, struct property_info *desc) +{ + HTMLPluginContainer *plugin_container = impl_from_DispatchEx(dispex); + PluginHost *host; + + if(id >= MSHTML_DISPID_CUSTOM_MIN + plugin_container->props_len) + return DISP_E_MEMBERNOTFOUND; + + host = plugin_container->plugin_host; + if(!host || !host->disp) { + WARN("Called with no disp\n"); + return E_UNEXPECTED; + } + + if(!check_script_safety(host)) { + FIXME("Insecure object\n"); + return E_FAIL; + } + + desc->id = id; + desc->flags = 0; + desc->name = plugin_container->props[id - MSHTML_DISPID_CUSTOM_MIN]->name; + desc->func_iid = 0; + return S_OK; +} + typedef struct { DISPID id; IDispatch *disp; diff --git a/dlls/mshtml/pluginhost.h b/dlls/mshtml/pluginhost.h index afbbc40e657..96490f8652e 100644 --- a/dlls/mshtml/pluginhost.h +++ b/dlls/mshtml/pluginhost.h @@ -80,3 +80,4 @@ void HTMLPluginContainer_destructor(DispatchEx *dispex); HRESULT HTMLPluginContainer_get_dispid(DispatchEx *dispex, const WCHAR *name, DWORD grfdex, DISPID *dispid); HRESULT HTMLPluginContainer_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller); +HRESULT HTMLPluginContainer_get_prop_desc(DispatchEx *dispex, DISPID id, struct property_info *desc); diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index ec670ec0756..0a9be1204e4 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -181,7 +181,7 @@ sync_test("builtin_toString", function() { [ "nav", "" ], [ "noframes", "" ], [ "noscript", "" ], - [ "object", "Object", -1 ], + [ "object", "Object" ], [ "ol", "OList", -1 ], [ "optgroup", "OptGroup", -1 ], [ "option", "Option" ],
From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/htmlevent.c | 7 ------- dlls/mshtml/htmlnode.c | 6 +----- dlls/mshtml/htmlselect.c | 15 +-------------- dlls/mshtml/mshtml_private.h | 1 - dlls/mshtml/tests/documentmode.js | 2 +- 5 files changed, 3 insertions(+), 28 deletions(-)
diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 8125a3eebc8..ba30eb41f53 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -5140,13 +5140,6 @@ static int event_id_cmp(const void *key, const struct wine_rb_entry *entry) return wcscmp(key, WINE_RB_ENTRY_VALUE(entry, listener_container_t, entry)->type); }
-void EventTarget_Init(EventTarget *event_target, dispex_static_data_t *dispex_data, compat_mode_t compat_mode) -{ - init_dispatch(&event_target->dispex, dispex_data, NULL, compat_mode); - event_target->IEventTarget_iface.lpVtbl = &EventTargetVtbl; - wine_rb_init(&event_target->handler_map, event_id_cmp); -} - void init_event_target(EventTarget *event_target, dispex_static_data_t *dispex_data, HTMLInnerWindow *script_global) { compat_mode_t compat_mode = script_global && script_global->doc ? script_global->doc->document_mode : COMPAT_MODE_NONE; diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index f752d2595d0..3123e9dd72e 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -1288,11 +1288,7 @@ void HTMLDOMNode_Init(HTMLDocumentNode *doc, HTMLDOMNode *node, nsIDOMNode *nsno node->IHTMLDOMNode2_iface.lpVtbl = &HTMLDOMNode2Vtbl; node->IHTMLDOMNode3_iface.lpVtbl = &HTMLDOMNode3Vtbl;
- /* FIXME: We can't use new bindings for nodes with custom properties yet */ - if(dispex_data->vtbl->get_name) - EventTarget_Init(&node->event_target, dispex_data, doc->document_mode); - else - init_event_target(&node->event_target, dispex_data, doc->script_global); + init_event_target(&node->event_target, dispex_data, doc->script_global);
if(&doc->node != node) IHTMLDOMNode_AddRef(&doc->node.IHTMLDOMNode_iface); diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c index 8cfbbe58c45..4fb0b05f85f 100644 --- a/dlls/mshtml/htmlselect.c +++ b/dlls/mshtml/htmlselect.c @@ -1234,19 +1234,6 @@ static HRESULT HTMLSelectElement_get_dispid(DispatchEx *dispex, const WCHAR *nam return S_OK; }
-static HRESULT HTMLSelectElement_dispex_get_name(DispatchEx *dispex, DISPID id, BSTR *name) -{ - DWORD idx = id - DISPID_OPTIONCOL_0; - WCHAR buf[11]; - UINT len; - - if(idx > MSHTML_CUSTOM_DISPID_CNT) - return DISP_E_MEMBERNOTFOUND; - - len = swprintf(buf, ARRAY_SIZE(buf), L"%u", idx); - return (*name = SysAllocStringLen(buf, len)) ? S_OK : E_OUTOFMEMORY; -} - static HRESULT HTMLSelectElement_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { @@ -1297,7 +1284,7 @@ static const event_target_vtbl_t HTMLSelectElement_event_target_vtbl = { .traverse = HTMLSelectElement_traverse, .unlink = HTMLSelectElement_unlink, .get_dispid = HTMLSelectElement_get_dispid, - .get_name = HTMLSelectElement_dispex_get_name, + .get_prop_desc = dispex_index_prop_desc, .invoke = HTMLSelectElement_invoke }, HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES, diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 35cb705d0a5..d48ba2f32ac 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1263,7 +1263,6 @@ HRESULT create_svg_element(HTMLDocumentNode*,nsIDOMSVGElement*,const WCHAR*,HTML void HTMLDOMNode_Init(HTMLDocumentNode*,HTMLDOMNode*,nsIDOMNode*,dispex_static_data_t*); void HTMLElement_Init(HTMLElement*,HTMLDocumentNode*,nsIDOMElement*,dispex_static_data_t*);
-void EventTarget_Init(EventTarget*,dispex_static_data_t*,compat_mode_t); void init_event_target(EventTarget*,dispex_static_data_t*,HTMLInnerWindow*); void *EventTarget_query_interface(EventTarget*,REFIID); void EventTarget_init_dispex_info(dispex_data_t*,compat_mode_t); diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 0a9be1204e4..6be48816645 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -199,7 +199,7 @@ sync_test("builtin_toString", function() { [ "samp", "Phrase", -1 ], [ "script", "Script" ], [ "section", "" ], - [ "select", "Select", -1 ], + [ "select", "Select" ], [ "small", "Phrase", -1 ], [ "source", "Source", -1 ], [ "span", "Span", -1 ],
From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/htmlelem.c | 10 +++++----- dlls/mshtml/tests/documentmode.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 7fea9065659..4939e11ac2a 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -769,7 +769,7 @@ static dispex_static_data_t HTMLRect_dispex = { HTMLRect_init_dispex_info };
-static HRESULT create_html_rect(nsIDOMClientRect *nsrect, compat_mode_t compat_mode, IHTMLRect **ret) +static HRESULT create_html_rect(nsIDOMClientRect *nsrect, DispatchEx *owner, IHTMLRect **ret) { HTMLRect *rect;
@@ -780,7 +780,7 @@ static HRESULT create_html_rect(nsIDOMClientRect *nsrect, compat_mode_t compat_m rect->IHTMLRect_iface.lpVtbl = &HTMLRectVtbl; rect->IHTMLRect2_iface.lpVtbl = &HTMLRect2Vtbl;
- init_dispatch(&rect->dispex, &HTMLRect_dispex, NULL, compat_mode); + init_dispatch_with_owner(&rect->dispex, &HTMLRect_dispex, owner);
nsIDOMClientRect_AddRef(nsrect); rect->nsrect = nsrect; @@ -995,7 +995,7 @@ static HRESULT WINAPI HTMLRectCollection_item(IHTMLRectCollection *iface, VARIAN return S_OK; }
- hres = create_html_rect(nsrect, dispex_compat_mode(&This->dispex), &rect); + hres = create_html_rect(nsrect, &This->dispex, &rect); nsIDOMClientRect_Release(nsrect); if(FAILED(hres)) return hres; @@ -1093,7 +1093,7 @@ static HRESULT HTMLRectCollection_invoke(DispatchEx *dispex, DISPID id, LCID lci return DISP_E_MEMBERNOTFOUND; }
- hres = create_html_rect(rect, dispex_compat_mode(&This->dispex), &html_rect); + hres = create_html_rect(rect, &This->dispex, &html_rect); nsIDOMClientRect_Release(rect); if(FAILED(hres)) return hres; @@ -3065,7 +3065,7 @@ static HRESULT WINAPI HTMLElement2_getBoundingClientRect(IHTMLElement2 *iface, I return E_FAIL; }
- hres = create_html_rect(nsrect, dispex_compat_mode(&This->node.event_target.dispex), pRect); + hres = create_html_rect(nsrect, &This->node.event_target.dispex, pRect);
nsIDOMClientRect_Release(nsrect); return hres; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 6be48816645..f6dafd8e300 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -293,7 +293,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); - if(clientRects) test("clientRect", clientRects[0], "ClientRect", null, true); + if(clientRects) test("clientRect", clientRects[0], "ClientRect"); if(clientRects) test("clientRects", clientRects, "ClientRectList"); if(currentStyle) test("currentStyle", currentStyle, "MSCurrentStyleCSSProperties", null, true); if(v >= 11 /* todo_wine */) test("document", document, v < 11 ? "Document" : "HTMLDocument");
From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/htmlelem.c | 22 ++++++---------------- dlls/mshtml/tests/documentmode.js | 2 +- 2 files changed, 7 insertions(+), 17 deletions(-)
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 4939e11ac2a..0b0981a454d 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -7085,16 +7085,6 @@ static HRESULT token_list_get_dispid(DispatchEx *dispex, const WCHAR *name, DWOR return S_OK; }
-static HRESULT token_list_get_name(DispatchEx *dispex, DISPID id, BSTR *name) -{ - LONG idx = id - MSHTML_DISPID_CUSTOM_MIN; - WCHAR buf[12]; - UINT len; - - len = swprintf(buf, ARRAY_SIZE(buf), L"%d", idx); - return (*name = SysAllocStringLen(buf, len)) ? S_OK : E_OUTOFMEMORY; -} - static HRESULT token_list_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { @@ -7127,7 +7117,7 @@ static const dispex_static_data_vtbl_t token_list_dispex_vtbl = { .unlink = token_list_unlink, .value = token_list_value, .get_dispid = token_list_get_dispid, - .get_name = token_list_get_name, + .get_prop_desc = dispex_index_prop_desc, .invoke = token_list_invoke };
@@ -7142,7 +7132,7 @@ static dispex_static_data_t token_list_dispex = { token_list_iface_tids };
-static HRESULT create_token_list(compat_mode_t compat_mode, IHTMLElement *element, IWineDOMTokenList **ret) +static HRESULT create_token_list(compat_mode_t compat_mode, HTMLElement *element, IWineDOMTokenList **ret) { struct token_list *obj;
@@ -7154,9 +7144,9 @@ static HRESULT create_token_list(compat_mode_t compat_mode, IHTMLElement *elemen }
obj->IWineDOMTokenList_iface.lpVtbl = &WineDOMTokenListVtbl; - init_dispatch(&obj->dispex, &token_list_dispex, NULL, compat_mode); - IHTMLElement_AddRef(element); - obj->element = element; + init_dispatch_with_owner(&obj->dispex, &token_list_dispex, &element->node.event_target.dispex); + obj->element = &element->IHTMLElement_iface; + IHTMLElement_AddRef(obj->element);
*ret = &obj->IWineDOMTokenList_iface; return S_OK; @@ -7230,7 +7220,7 @@ static HRESULT WINAPI htmlelement_private_get_classList(IWineHTMLElementPrivate
TRACE("iface %p, class_list %p.\n", iface, class_list);
- return create_token_list(dispex_compat_mode(&This->node.event_target.dispex), &This->IHTMLElement_iface, + return create_token_list(dispex_compat_mode(&This->node.event_target.dispex), This, (IWineDOMTokenList **)class_list); }
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index f6dafd8e300..1586a7d5a4f 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -337,7 +337,7 @@ sync_test("builtin_toString", function() { test("UIEvent", document.createEvent("UIEvent"), "UIEvent"); } if(v >= 10) { - test("classList", e.classList, "DOMTokenList", "testclass another ", true); + test("classList", e.classList, "DOMTokenList", "testclass another "); test("console", window.console, "Console"); test("mediaQueryList", window.matchMedia("(hover:hover)"), "MediaQueryList"); }
From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/htmlelem.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 0b0981a454d..05f4cfd1177 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -7450,16 +7450,6 @@ static HRESULT HTMLFiltersCollection_get_dispid(DispatchEx *dispex, const WCHAR return S_OK; }
-static HRESULT HTMLFiltersCollection_get_name(DispatchEx *dispex, DISPID id, BSTR *name) -{ - DWORD idx = id - MSHTML_DISPID_CUSTOM_MIN; - WCHAR buf[11]; - UINT len; - - len = swprintf(buf, ARRAY_SIZE(buf), L"%u", idx); - return (*name = SysAllocStringLen(buf, len)) ? S_OK : E_OUTOFMEMORY; -} - static HRESULT HTMLFiltersCollection_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { @@ -7477,7 +7467,7 @@ static const dispex_static_data_vtbl_t HTMLFiltersCollection_dispex_vtbl = { .query_interface = HTMLFiltersCollection_query_interface, .destructor = HTMLFiltersCollection_destructor, .get_dispid = HTMLFiltersCollection_get_dispid, - .get_name = HTMLFiltersCollection_get_name, + .get_prop_desc = dispex_index_prop_desc, .invoke = HTMLFiltersCollection_invoke, };
From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/htmlelem.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 05f4cfd1177..bc140b14984 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -8033,15 +8033,6 @@ static HRESULT HTMLAttributeCollection_get_dispid(DispatchEx *dispex, const WCHA return S_OK; }
-static HRESULT HTMLAttributeCollection_get_name(DispatchEx *dispex, DISPID id, BSTR *name) -{ - HTMLAttributeCollection *This = HTMLAttributeCollection_from_DispatchEx(dispex); - - FIXME("(%p)->(%lx %p)\n", This, id, name); - - return E_NOTIMPL; -} - static HRESULT HTMLAttributeCollection_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { @@ -8082,7 +8073,7 @@ static const dispex_static_data_vtbl_t HTMLAttributeCollection_dispex_vtbl = { .traverse = HTMLAttributeCollection_traverse, .unlink = HTMLAttributeCollection_unlink, .get_dispid = HTMLAttributeCollection_get_dispid, - .get_name = HTMLAttributeCollection_get_name, + .get_prop_desc = dispex_index_prop_desc, .invoke = HTMLAttributeCollection_invoke, };
@@ -8121,8 +8112,8 @@ HRESULT HTMLElement_get_attr_col(HTMLDOMNode *iface, HTMLAttributeCollection **a IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); This->attrs->elem = This; list_init(&This->attrs->attrs); - init_dispatch(&This->attrs->dispex, &HTMLAttributeCollection_dispex, NULL, - dispex_compat_mode(&iface->event_target.dispex)); + init_dispatch(&This->attrs->dispex, &HTMLAttributeCollection_dispex, This->node.doc->script_global, + dispex_compat_mode(&This->node.event_target.dispex));
*ac = This->attrs; IHTMLAttributeCollection_AddRef(&This->attrs->IHTMLAttributeCollection_iface);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=147439
Your paranoid android.
=== w10pro64_ar (64 bit report) ===
mshtml: htmldoc.c:353: Test failed: expected Exec_SETTITLE
=== debian11 (build log) ===
error: patch failed: dlls/mshtml/htmlobject.c:653 error: patch failed: dlls/mshtml/pluginhost.c:704 error: patch failed: dlls/mshtml/pluginhost.h:67 error: patch failed: dlls/mshtml/pluginhost.c:712 error: patch failed: dlls/mshtml/pluginhost.h:48 error: patch failed: dlls/mshtml/htmlobject.c:653 error: patch failed: dlls/mshtml/pluginhost.c:813 error: patch failed: dlls/mshtml/pluginhost.h:80 error: patch failed: dlls/mshtml/tests/documentmode.js:181 error: patch failed: dlls/mshtml/htmlevent.c:5140 error: patch failed: dlls/mshtml/htmlnode.c:1288 error: patch failed: dlls/mshtml/htmlselect.c:1234 error: patch failed: dlls/mshtml/mshtml_private.h:1263 error: patch failed: dlls/mshtml/tests/documentmode.js:199 error: patch failed: dlls/mshtml/htmlelem.c:769 error: patch failed: dlls/mshtml/tests/documentmode.js:293 error: patch failed: dlls/mshtml/htmlelem.c:7085 error: patch failed: dlls/mshtml/tests/documentmode.js:337 error: patch failed: dlls/mshtml/htmlelem.c:7450 error: patch failed: dlls/mshtml/htmlelem.c:8033 Task: Patch failed to apply