Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/dispex.c | 29 +++++++++++++++++++++++++++++ dlls/mshtml/htmlanchor.c | 1 + dlls/mshtml/htmlarea.c | 1 + dlls/mshtml/htmlattr.c | 1 + dlls/mshtml/htmlbody.c | 1 + dlls/mshtml/htmlcomment.c | 1 + dlls/mshtml/htmlcurstyle.c | 1 + dlls/mshtml/htmldoc.c | 2 ++ dlls/mshtml/htmlelem.c | 6 ++++++ dlls/mshtml/htmlelemcol.c | 1 + dlls/mshtml/htmlevent.c | 6 ++++++ dlls/mshtml/htmlform.c | 1 + dlls/mshtml/htmlframe.c | 2 ++ dlls/mshtml/htmlgeneric.c | 1 + dlls/mshtml/htmlhead.c | 4 ++++ dlls/mshtml/htmlimg.c | 2 ++ dlls/mshtml/htmlinput.c | 3 +++ dlls/mshtml/htmllink.c | 1 + dlls/mshtml/htmllocation.c | 1 + dlls/mshtml/htmlnode.c | 2 ++ dlls/mshtml/htmlobject.c | 2 ++ dlls/mshtml/htmlscript.c | 1 + dlls/mshtml/htmlselect.c | 3 +++ dlls/mshtml/htmlstorage.c | 1 + dlls/mshtml/htmlstyle.c | 2 ++ dlls/mshtml/htmlstyleelem.c | 1 + dlls/mshtml/htmlstylesheet.c | 4 ++++ dlls/mshtml/htmltable.c | 3 +++ dlls/mshtml/htmltextarea.c | 1 + dlls/mshtml/htmltextnode.c | 1 + dlls/mshtml/htmlwindow.c | 1 + dlls/mshtml/mshtml_private.h | 2 ++ dlls/mshtml/omnavigator.c | 18 ++++++++++++------ dlls/mshtml/range.c | 2 ++ dlls/mshtml/selection.c | 1 + dlls/mshtml/xmlhttprequest.c | 2 ++ 36 files changed, 106 insertions(+), 6 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 64ead8f..1adcc67 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -886,6 +886,7 @@ static const dispex_static_data_vtbl_t function_dispex_vtbl = { static const tid_t function_iface_tids[] = {0};
static dispex_static_data_t function_dispex = { + L"Function", &function_dispex_vtbl, NULL_tid, function_iface_tids @@ -1482,6 +1483,34 @@ compat_mode_t dispex_compat_mode(DispatchEx *dispex) : dispex->info->desc->vtbl->get_compat_mode(dispex); }
+HRESULT dispex_to_string(DispatchEx *dispex, BSTR *ret) +{ + static const WCHAR prefix[8] = L"[object "; + static const WCHAR suffix[] = L"]"; + WCHAR buf[ARRAY_SIZE(prefix) + 28 + ARRAY_SIZE(suffix)], *p = buf; + compat_mode_t compat_mode = dispex_compat_mode(dispex); + const WCHAR *name = dispex->info->desc->name; + unsigned len; + + if(!ret) + return E_INVALIDARG; + + memcpy(p, prefix, sizeof(prefix)); + p += ARRAY_SIZE(prefix); + if(compat_mode < COMPAT_MODE_IE9) + p--; + else { + len = wcslen(name); + assert(len <= 28); + memcpy(p, name, len * sizeof(WCHAR)); + p += len; + } + memcpy(p, suffix, sizeof(suffix)); + + *ret = SysAllocString(buf); + return *ret ? S_OK : E_OUTOFMEMORY; +} + static dispex_data_t *ensure_dispex_info(dispex_static_data_t *desc, compat_mode_t compat_mode) { if(!desc->info_cache[compat_mode]) { diff --git a/dlls/mshtml/htmlanchor.c b/dlls/mshtml/htmlanchor.c index da48601..4416624 100644 --- a/dlls/mshtml/htmlanchor.c +++ b/dlls/mshtml/htmlanchor.c @@ -857,6 +857,7 @@ static const tid_t HTMLAnchorElement_iface_tids[] = { };
static dispex_static_data_t HTMLAnchorElement_dispex = { + L"HTMLAnchorElement", NULL, DispHTMLAnchorElement_tid, HTMLAnchorElement_iface_tids, diff --git a/dlls/mshtml/htmlarea.c b/dlls/mshtml/htmlarea.c index e785871..6c0da36 100644 --- a/dlls/mshtml/htmlarea.c +++ b/dlls/mshtml/htmlarea.c @@ -477,6 +477,7 @@ static const tid_t HTMLAreaElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLAreaElement_dispex = { + L"HTMLAreaElement", NULL, DispHTMLAreaElement_tid, HTMLAreaElement_iface_tids, diff --git a/dlls/mshtml/htmlattr.c b/dlls/mshtml/htmlattr.c index dc8c45e..e10c7c3 100644 --- a/dlls/mshtml/htmlattr.c +++ b/dlls/mshtml/htmlattr.c @@ -484,6 +484,7 @@ static const tid_t HTMLDOMAttribute_iface_tids[] = { 0 }; static dispex_static_data_t HTMLDOMAttribute_dispex = { + L"Attr", NULL, DispHTMLDOMAttribute_tid, HTMLDOMAttribute_iface_tids diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c index 32c49fe..551c3a1 100644 --- a/dlls/mshtml/htmlbody.c +++ b/dlls/mshtml/htmlbody.c @@ -1008,6 +1008,7 @@ static const tid_t HTMLBodyElement_iface_tids[] = { };
static dispex_static_data_t HTMLBodyElement_dispex = { + L"HTMLBodyElement", NULL, DispHTMLBody_tid, HTMLBodyElement_iface_tids, diff --git a/dlls/mshtml/htmlcomment.c b/dlls/mshtml/htmlcomment.c index 85eceef..7815865 100644 --- a/dlls/mshtml/htmlcomment.c +++ b/dlls/mshtml/htmlcomment.c @@ -199,6 +199,7 @@ static const tid_t HTMLCommentElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLCommentElement_dispex = { + L"Comment", NULL, DispHTMLCommentElement_tid, HTMLCommentElement_iface_tids, diff --git a/dlls/mshtml/htmlcurstyle.c b/dlls/mshtml/htmlcurstyle.c index 2abe5df..e66a42c 100644 --- a/dlls/mshtml/htmlcurstyle.c +++ b/dlls/mshtml/htmlcurstyle.c @@ -1300,6 +1300,7 @@ static const tid_t HTMLCurrentStyle_iface_tids[] = { 0 }; static dispex_static_data_t HTMLCurrentStyle_dispex = { + L"MSCurrentStyleCSSProperties", &CSSStyle_dispex_vtbl, DispHTMLCurrentStyle_tid, HTMLCurrentStyle_iface_tids, diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 9faf987..6bbf058 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5654,6 +5654,7 @@ static void HTMLDocumentNode_init_dispex_info(dispex_data_t *info, compat_mode_t }
static dispex_static_data_t HTMLDocumentNode_dispex = { + L"HTMLDocument", &HTMLDocumentNode_event_target_vtbl.dispex_vtbl, DispHTMLDocument_tid, HTMLDocumentNode_iface_tids, @@ -5949,6 +5950,7 @@ static const tid_t HTMLDocumentObj_iface_tids[] = { 0 }; static dispex_static_data_t HTMLDocumentObj_dispex = { + L"HTMLDocumentObj", NULL, DispHTMLDocument_tid, HTMLDocumentObj_iface_tids diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index b07de03..cb7a528 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -527,6 +527,7 @@ static const tid_t HTMLRect_iface_tids[] = { 0 }; static dispex_static_data_t HTMLRect_dispex = { + L"ClientRect", NULL, IHTMLRect_tid, HTMLRect_iface_tids @@ -788,6 +789,7 @@ static const tid_t HTMLRectCollection_iface_tids[] = { 0 }; static dispex_static_data_t HTMLRectCollection_dispex = { + L"ClientRectList", &HTMLRectCollection_dispex_vtbl, IHTMLRectCollection_tid, HTMLRectCollection_iface_tids @@ -6669,6 +6671,7 @@ static const tid_t token_list_iface_tids[] = { 0 }; static dispex_static_data_t token_list_dispex = { + L"DOMTokenList", &token_list_dispex_vtbl, IWineDOMTokenList_tid, token_list_iface_tids @@ -6779,6 +6782,7 @@ static const IWineHTMLElementPrivateVtbl WineHTMLElementPrivateVtbl = { };
static dispex_static_data_t HTMLElement_dispex = { + L"HTMLElement", &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLUnknownElement_tid, HTMLElement_iface_tids, @@ -7053,6 +7057,7 @@ static const tid_t HTMLFiltersCollection_iface_tids[] = { 0 }; static dispex_static_data_t HTMLFiltersCollection_dispex = { + L"FiltersCollection", &HTMLFiltersCollection_dispex_vtbl, IHTMLFiltersCollection_tid, HTMLFiltersCollection_iface_tids @@ -7626,6 +7631,7 @@ static const tid_t HTMLAttributeCollection_iface_tids[] = { };
static dispex_static_data_t HTMLAttributeCollection_dispex = { + L"NamedNodeMap", &HTMLAttributeCollection_dispex_vtbl, DispHTMLAttributeCollection_tid, HTMLAttributeCollection_iface_tids diff --git a/dlls/mshtml/htmlelemcol.c b/dlls/mshtml/htmlelemcol.c index e72f21f..86ef3a3 100644 --- a/dlls/mshtml/htmlelemcol.c +++ b/dlls/mshtml/htmlelemcol.c @@ -618,6 +618,7 @@ static const tid_t HTMLElementCollection_iface_tids[] = { };
static dispex_static_data_t HTMLElementCollection_dispex = { + L"HTMLCollection", &HTMLElementColection_dispex_vtbl, DispHTMLElementCollection_tid, HTMLElementCollection_iface_tids diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 5b040c4..3f545bb 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -750,6 +750,7 @@ static const tid_t HTMLEventObj_iface_tids[] = { };
static dispex_static_data_t HTMLEventObj_dispex = { + L"MSEventObj", NULL, DispCEventObj_tid, HTMLEventObj_iface_tids @@ -2135,6 +2136,7 @@ static const tid_t DOMEvent_iface_tids[] = { };
static dispex_static_data_t DOMEvent_dispex = { + L"Event", NULL, DispDOMEvent_tid, DOMEvent_iface_tids @@ -2147,6 +2149,7 @@ static const tid_t DOMUIEvent_iface_tids[] = { };
static dispex_static_data_t DOMUIEvent_dispex = { + L"UIEvent", NULL, DispDOMUIEvent_tid, DOMUIEvent_iface_tids @@ -2160,6 +2163,7 @@ static const tid_t DOMMouseEvent_iface_tids[] = { };
static dispex_static_data_t DOMMouseEvent_dispex = { + L"MouseEvent", NULL, DispDOMMouseEvent_tid, DOMMouseEvent_iface_tids @@ -2173,6 +2177,7 @@ static const tid_t DOMKeyboardEvent_iface_tids[] = { };
static dispex_static_data_t DOMKeyboardEvent_dispex = { + L"KeyboardEvent", NULL, DispDOMKeyboardEvent_tid, DOMKeyboardEvent_iface_tids @@ -2185,6 +2190,7 @@ static const tid_t DOMCustomEvent_iface_tids[] = { };
static dispex_static_data_t DOMCustomEvent_dispex = { + L"CustomEvent", NULL, DispDOMCustomEvent_tid, DOMCustomEvent_iface_tids diff --git a/dlls/mshtml/htmlform.c b/dlls/mshtml/htmlform.c index 5d0928e..566612f 100644 --- a/dlls/mshtml/htmlform.c +++ b/dlls/mshtml/htmlform.c @@ -827,6 +827,7 @@ static const tid_t HTMLFormElement_iface_tids[] = { };
static dispex_static_data_t HTMLFormElement_dispex = { + L"HTMLFormElement", NULL, DispHTMLFormElement_tid, HTMLFormElement_iface_tids, diff --git a/dlls/mshtml/htmlframe.c b/dlls/mshtml/htmlframe.c index 7118ea8..e794284 100644 --- a/dlls/mshtml/htmlframe.c +++ b/dlls/mshtml/htmlframe.c @@ -1023,6 +1023,7 @@ static const tid_t HTMLFrameElement_iface_tids[] = { };
static dispex_static_data_t HTMLFrameElement_dispex = { + L"HTMLFrameElement", NULL, DispHTMLFrameElement_tid, HTMLFrameElement_iface_tids, @@ -1603,6 +1604,7 @@ static const tid_t HTMLIFrame_iface_tids[] = { };
static dispex_static_data_t HTMLIFrame_dispex = { + L"HTMLIFrameElement", NULL, DispHTMLIFrame_tid, HTMLIFrame_iface_tids, diff --git a/dlls/mshtml/htmlgeneric.c b/dlls/mshtml/htmlgeneric.c index 639c95e..459fc78 100644 --- a/dlls/mshtml/htmlgeneric.c +++ b/dlls/mshtml/htmlgeneric.c @@ -168,6 +168,7 @@ static const tid_t HTMLGenericElement_iface_tids[] = { };
static dispex_static_data_t HTMLGenericElement_dispex = { + L"HTMLUnknownElement", NULL, DispHTMLGenericElement_tid, HTMLGenericElement_iface_tids, diff --git a/dlls/mshtml/htmlhead.c b/dlls/mshtml/htmlhead.c index 5dbf8d6..1bad06e 100644 --- a/dlls/mshtml/htmlhead.c +++ b/dlls/mshtml/htmlhead.c @@ -169,6 +169,7 @@ static const tid_t HTMLTitleElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLTitleElement_dispex = { + L"HTMLTitleElement", NULL, DispHTMLTitleElement_tid, HTMLTitleElement_iface_tids, @@ -352,6 +353,7 @@ static const tid_t HTMLHtmlElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLHtmlElement_dispex = { + L"HTMLHtmlElement", NULL, DispHTMLHtmlElement_tid, HTMLHtmlElement_iface_tids, @@ -588,6 +590,7 @@ static const tid_t HTMLMetaElement_iface_tids[] = { };
static dispex_static_data_t HTMLMetaElement_dispex = { + L"HTMLMetaElement", NULL, DispHTMLMetaElement_tid, HTMLMetaElement_iface_tids, @@ -751,6 +754,7 @@ static const tid_t HTMLHeadElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLHeadElement_dispex = { + L"HTMLHeadElement", NULL, DispHTMLHeadElement_tid, HTMLHeadElement_iface_tids, diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c index f89e8e5..96b8d31 100644 --- a/dlls/mshtml/htmlimg.c +++ b/dlls/mshtml/htmlimg.c @@ -730,6 +730,7 @@ static const tid_t HTMLImgElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLImgElement_dispex = { + L"HTMLImageElement", NULL, DispHTMLImg_tid, HTMLImgElement_iface_tids, @@ -974,6 +975,7 @@ static const dispex_static_data_vtbl_t HTMLImageElementFactory_dispex_vtbl = { };
static dispex_static_data_t HTMLImageElementFactory_dispex = { + L"Function", &HTMLImageElementFactory_dispex_vtbl, IHTMLImageElementFactory_tid, HTMLImageElementFactory_iface_tids diff --git a/dlls/mshtml/htmlinput.c b/dlls/mshtml/htmlinput.c index 1a0a739..e9b53da 100644 --- a/dlls/mshtml/htmlinput.c +++ b/dlls/mshtml/htmlinput.c @@ -1441,6 +1441,7 @@ static const tid_t HTMLInputElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLInputElement_dispex = { + L"HTMLInputElement", NULL, DispHTMLInputElement_tid, HTMLInputElement_iface_tids, @@ -1637,6 +1638,7 @@ static const tid_t HTMLLabelElement_iface_tids[] = { };
static dispex_static_data_t HTMLLabelElement_dispex = { + L"HTMLLabelElement", NULL, DispHTMLLabelElement_tid, HTMLLabelElement_iface_tids, @@ -1983,6 +1985,7 @@ static const tid_t HTMLButtonElement_iface_tids[] = { };
static dispex_static_data_t HTMLButtonElement_dispex = { + L"HTMLButtonElement", NULL, DispHTMLButtonElement_tid, HTMLButtonElement_iface_tids, diff --git a/dlls/mshtml/htmllink.c b/dlls/mshtml/htmllink.c index ddf67ca..1dd4873 100644 --- a/dlls/mshtml/htmllink.c +++ b/dlls/mshtml/htmllink.c @@ -446,6 +446,7 @@ static const tid_t HTMLLinkElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLLinkElement_dispex = { + L"HTMLLinkElement", NULL, DispHTMLLinkElement_tid, HTMLLinkElement_iface_tids, diff --git a/dlls/mshtml/htmllocation.c b/dlls/mshtml/htmllocation.c index a85c9a6..85dfc40 100644 --- a/dlls/mshtml/htmllocation.c +++ b/dlls/mshtml/htmllocation.c @@ -631,6 +631,7 @@ static const tid_t HTMLLocation_iface_tids[] = { 0 }; static dispex_static_data_t HTMLLocation_dispex = { + L"Object", NULL, DispHTMLLocation_tid, HTMLLocation_iface_tids diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index b5ff02b..996c28c 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -429,6 +429,7 @@ static const tid_t HTMLDOMChildrenCollection_iface_tids[] = { };
static dispex_static_data_t HTMLDOMChildrenCollection_dispex = { + L"NodeList", &HTMLDOMChildrenCollection_dispex_vtbl, DispDOMChildrenCollection_tid, HTMLDOMChildrenCollection_iface_tids, @@ -1476,6 +1477,7 @@ static const tid_t HTMLDOMNode_iface_tids[] = { 0 }; static dispex_static_data_t HTMLDOMNode_dispex = { + L"Node", NULL, IHTMLDOMNode_tid, HTMLDOMNode_iface_tids, diff --git a/dlls/mshtml/htmlobject.c b/dlls/mshtml/htmlobject.c index 6702548..9c8af17 100644 --- a/dlls/mshtml/htmlobject.c +++ b/dlls/mshtml/htmlobject.c @@ -766,6 +766,7 @@ static const tid_t HTMLObjectElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLObjectElement_dispex = { + L"HTMLObjectElement", NULL, DispHTMLObjectElement_tid, HTMLObjectElement_iface_tids, @@ -1028,6 +1029,7 @@ static const tid_t HTMLEmbedElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLEmbedElement_dispex = { + L"HTMLEmbedElement", NULL, DispHTMLEmbed_tid, HTMLEmbedElement_iface_tids, diff --git a/dlls/mshtml/htmlscript.c b/dlls/mshtml/htmlscript.c index 9b7f95e..9f3a0b2 100644 --- a/dlls/mshtml/htmlscript.c +++ b/dlls/mshtml/htmlscript.c @@ -479,6 +479,7 @@ static const tid_t HTMLScriptElement_iface_tids[] = { };
static dispex_static_data_t HTMLScriptElement_dispex = { + L"HTMLScriptElement", NULL, DispHTMLScriptElement_tid, HTMLScriptElement_iface_tids, diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c index ad801f8..7869a8e 100644 --- a/dlls/mshtml/htmlselect.c +++ b/dlls/mshtml/htmlselect.c @@ -416,6 +416,7 @@ static const tid_t HTMLOptionElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLOptionElement_dispex = { + L"HTMLOptionElement", NULL, DispHTMLOptionElement_tid, HTMLOptionElement_iface_tids, @@ -595,6 +596,7 @@ static const tid_t HTMLOptionElementFactory_iface_tids[] = { };
static dispex_static_data_t HTMLOptionElementFactory_dispex = { + L"Function", NULL, IHTMLOptionElementFactory_tid, HTMLOptionElementFactory_iface_tids, @@ -1281,6 +1283,7 @@ static const tid_t HTMLSelectElement_tids[] = { };
static dispex_static_data_t HTMLSelectElement_dispex = { + L"HTMLSelectElement", NULL, DispHTMLSelectElement_tid, HTMLSelectElement_tids, diff --git a/dlls/mshtml/htmlstorage.c b/dlls/mshtml/htmlstorage.c index c389647..9c1f904 100644 --- a/dlls/mshtml/htmlstorage.c +++ b/dlls/mshtml/htmlstorage.c @@ -195,6 +195,7 @@ static const tid_t HTMLStorage_iface_tids[] = { 0 }; static dispex_static_data_t HTMLStorage_dispex = { + L"Storage", NULL, IHTMLStorage_tid, HTMLStorage_iface_tids diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 4ee81ba..7dd7000 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -10006,6 +10006,7 @@ static const tid_t HTMLStyle_iface_tids[] = { 0 }; static dispex_static_data_t HTMLStyle_dispex = { + L"MSStyleCSSProperties", &CSSStyle_dispex_vtbl, DispHTMLStyle_tid, HTMLStyle_iface_tids, @@ -10100,6 +10101,7 @@ static const tid_t HTMLW3CComputedStyle_iface_tids[] = { 0 }; static dispex_static_data_t HTMLW3CComputedStyle_dispex = { + L"CSSStyleDeclaration", &CSSStyle_dispex_vtbl, DispHTMLW3CComputedStyle_tid, HTMLW3CComputedStyle_iface_tids, diff --git a/dlls/mshtml/htmlstyleelem.c b/dlls/mshtml/htmlstyleelem.c index d2a4a75..cf57547 100644 --- a/dlls/mshtml/htmlstyleelem.c +++ b/dlls/mshtml/htmlstyleelem.c @@ -462,6 +462,7 @@ static const tid_t HTMLStyleElement_iface_tids[] = { 0 }; static dispex_static_data_t HTMLStyleElement_dispex = { + L"HTMLStyleElement", NULL, DispHTMLStyleElement_tid, HTMLStyleElement_iface_tids, diff --git a/dlls/mshtml/htmlstylesheet.c b/dlls/mshtml/htmlstylesheet.c index b6f1c98..cbc2adf 100644 --- a/dlls/mshtml/htmlstylesheet.c +++ b/dlls/mshtml/htmlstylesheet.c @@ -202,6 +202,7 @@ static const tid_t HTMLStyleSheetRule_iface_tids[] = { 0 }; static dispex_static_data_t HTMLStyleSheetRule_dispex = { + L"CSSStyleRule", NULL, DispHTMLStyleSheetRule_tid, HTMLStyleSheetRule_iface_tids @@ -376,6 +377,7 @@ static const tid_t HTMLStyleSheetRulesCollection_iface_tids[] = { 0 }; static dispex_static_data_t HTMLStyleSheetRulesCollection_dispex = { + L"MSCSSRuleList", NULL, DispHTMLStyleSheetRulesCollection_tid, HTMLStyleSheetRulesCollection_iface_tids @@ -575,6 +577,7 @@ static const tid_t HTMLStyleSheetsCollection_iface_tids[] = { 0 }; static dispex_static_data_t HTMLStyleSheetsCollection_dispex = { + L"StyleSheetList", NULL, DispHTMLStyleSheetsCollection_tid, HTMLStyleSheetsCollection_iface_tids @@ -1144,6 +1147,7 @@ static const tid_t HTMLStyleSheet_iface_tids[] = { 0 }; static dispex_static_data_t HTMLStyleSheet_dispex = { + L"CSSStyleSheet", NULL, DispHTMLStyleSheet_tid, HTMLStyleSheet_iface_tids, diff --git a/dlls/mshtml/htmltable.c b/dlls/mshtml/htmltable.c index 178e9e5..53c9820 100644 --- a/dlls/mshtml/htmltable.c +++ b/dlls/mshtml/htmltable.c @@ -520,6 +520,7 @@ static const tid_t HTMLTableCell_iface_tids[] = { };
static dispex_static_data_t HTMLTableCell_dispex = { + L"HTMLTableDataCellElement", NULL, DispHTMLTableCell_tid, HTMLTableCell_iface_tids, @@ -964,6 +965,7 @@ static const tid_t HTMLTableRow_iface_tids[] = { };
static dispex_static_data_t HTMLTableRow_dispex = { + L"HTMLTableRowElement", NULL, DispHTMLTableRow_tid, HTMLTableRow_iface_tids, @@ -1996,6 +1998,7 @@ static const tid_t HTMLTable_iface_tids[] = { };
static dispex_static_data_t HTMLTable_dispex = { + L"HTMLTableElement", NULL, DispHTMLTable_tid, HTMLTable_iface_tids, diff --git a/dlls/mshtml/htmltextarea.c b/dlls/mshtml/htmltextarea.c index 57f3373..f95b559 100644 --- a/dlls/mshtml/htmltextarea.c +++ b/dlls/mshtml/htmltextarea.c @@ -479,6 +479,7 @@ static const tid_t HTMLTextAreaElement_iface_tids[] = { };
static dispex_static_data_t HTMLTextAreaElement_dispex = { + L"HTMLTextAreaElement", NULL, DispHTMLTextAreaElement_tid, HTMLTextAreaElement_iface_tids, diff --git a/dlls/mshtml/htmltextnode.c b/dlls/mshtml/htmltextnode.c index 56a0572..afe5d21 100644 --- a/dlls/mshtml/htmltextnode.c +++ b/dlls/mshtml/htmltextnode.c @@ -358,6 +358,7 @@ static const tid_t HTMLDOMTextNode_iface_tids[] = { 0 }; static dispex_static_data_t HTMLDOMTextNode_dispex = { + L"Text", NULL, DispHTMLDOMTextNode_tid, HTMLDOMTextNode_iface_tids, diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 870d7e8..2dfa879 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3687,6 +3687,7 @@ static const tid_t HTMLWindow_iface_tids[] = { };
static dispex_static_data_t HTMLWindow_dispex = { + L"Window", &HTMLWindow_event_target_vtbl.dispex_vtbl, DispHTMLWindow2_tid, HTMLWindow_iface_tids, diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index c1e7e78..9429a4b 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -327,6 +327,7 @@ typedef struct { } dispex_static_data_vtbl_t;
typedef struct { + const WCHAR *name; const dispex_static_data_vtbl_t *vtbl; const tid_t disp_tid; const tid_t* const iface_tids; @@ -393,6 +394,7 @@ HRESULT get_class_typeinfo(const CLSID*,ITypeInfo**) DECLSPEC_HIDDEN; const void *dispex_get_vtbl(DispatchEx*) DECLSPEC_HIDDEN; void dispex_info_add_interface(dispex_data_t*,tid_t,const dispex_hook_t*) DECLSPEC_HIDDEN; compat_mode_t dispex_compat_mode(DispatchEx*) DECLSPEC_HIDDEN; +HRESULT dispex_to_string(DispatchEx*,BSTR*) DECLSPEC_HIDDEN;
typedef enum { DISPEXPROP_CUSTOM, diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index eff9576..7b41563 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -304,6 +304,7 @@ static const tid_t HTMLDOMImplementation_iface_tids[] = { 0 }; static dispex_static_data_t HTMLDOMImplementation_dispex = { + L"DOMImplementation", NULL, DispHTMLDOMImplementation_tid, HTMLDOMImplementation_iface_tids @@ -555,6 +556,7 @@ static const tid_t HTMLScreen_iface_tids[] = { 0 }; static dispex_static_data_t HTMLScreen_dispex = { + L"Screen", NULL, DispHTMLScreen_tid, HTMLScreen_iface_tids @@ -718,6 +720,7 @@ static const tid_t OmHistory_iface_tids[] = { 0 }; static dispex_static_data_t OmHistory_dispex = { + L"History", NULL, DispHTMLHistory_tid, OmHistory_iface_tids @@ -874,6 +877,7 @@ static const tid_t HTMLPluginsCollection_iface_tids[] = { 0 }; static dispex_static_data_t HTMLPluginsCollection_dispex = { + L"PluginArray", NULL, DispCPlugins_tid, HTMLPluginsCollection_iface_tids @@ -1018,6 +1022,7 @@ static const tid_t HTMLMimeTypesCollection_iface_tids[] = { 0 }; static dispex_static_data_t HTMLMimeTypesCollection_dispex = { + L"MimeTypeArray", NULL, IHTMLMimeTypesCollection_tid, HTMLMimeTypesCollection_iface_tids @@ -1310,12 +1315,7 @@ static HRESULT WINAPI OmNavigator_toString(IOmNavigator *iface, BSTR *String)
TRACE("(%p)->(%p)\n", This, String);
- if(!String) - return E_INVALIDARG; - - *String = SysAllocString(dispex_compat_mode(&This->dispex) < COMPAT_MODE_IE9 - ? L"[object]" : L"[object Navigator]"); - return *String ? S_OK : E_OUTOFMEMORY; + return dispex_to_string(&This->dispex, String); }
static HRESULT WINAPI OmNavigator_get_cpuClass(IOmNavigator *iface, BSTR *p) @@ -1469,6 +1469,7 @@ static const tid_t OmNavigator_iface_tids[] = { 0 }; static dispex_static_data_t OmNavigator_dispex = { + L"Navigator", NULL, DispHTMLNavigator_tid, OmNavigator_iface_tids @@ -1849,6 +1850,7 @@ static const tid_t HTMLPerformanceTiming_iface_tids[] = { 0 }; static dispex_static_data_t HTMLPerformanceTiming_dispex = { + L"PerformanceTiming", NULL, IHTMLPerformanceTiming_tid, HTMLPerformanceTiming_iface_tids @@ -1998,6 +2000,7 @@ static const tid_t HTMLPerformanceNavigation_iface_tids[] = { 0 }; static dispex_static_data_t HTMLPerformanceNavigation_dispex = { + L"PerformanceNavigation", NULL, IHTMLPerformanceNavigation_tid, HTMLPerformanceNavigation_iface_tids @@ -2188,6 +2191,7 @@ static const tid_t HTMLPerformance_iface_tids[] = { 0 }; static dispex_static_data_t HTMLPerformance_dispex = { + L"Performance", NULL, IHTMLPerformance_tid, HTMLPerformance_iface_tids @@ -2346,6 +2350,7 @@ static const tid_t HTMLNamespaceCollection_iface_tids[] = { 0 }; static dispex_static_data_t HTMLNamespaceCollection_dispex = { + L"MSNamespaceInfoCollection", NULL, DispHTMLNamespaceCollection_tid, HTMLNamespaceCollection_iface_tids @@ -2601,6 +2606,7 @@ static const tid_t console_iface_tids[] = { 0 }; static dispex_static_data_t console_dispex = { + L"Console", NULL, IWineMSHTMLConsole_tid, console_iface_tids diff --git a/dlls/mshtml/range.c b/dlls/mshtml/range.c index 89f6804..bea5ac6 100644 --- a/dlls/mshtml/range.c +++ b/dlls/mshtml/range.c @@ -1715,6 +1715,7 @@ static const tid_t HTMLTxtRange_iface_tids[] = { 0 }; static dispex_static_data_t HTMLTxtRange_dispex = { + L"TextRange", NULL, IHTMLTxtRange_tid, HTMLTxtRange_iface_tids @@ -2060,6 +2061,7 @@ static const tid_t HTMLDOMRange_iface_tids[] = { };
static dispex_static_data_t HTMLDOMRange_dispex = { + L"Range", NULL, DispHTMLDOMRange_tid, HTMLDOMRange_iface_tids diff --git a/dlls/mshtml/selection.c b/dlls/mshtml/selection.c index 786c2bd..280fdaa 100644 --- a/dlls/mshtml/selection.c +++ b/dlls/mshtml/selection.c @@ -330,6 +330,7 @@ static const tid_t HTMLSelectionObject_iface_tids[] = { 0 }; static dispex_static_data_t HTMLSelectionObject_dispex = { + L"MSSelection", NULL, IHTMLSelectionObject_tid, /* FIXME: We have a test for that, but it doesn't expose IHTMLSelectionObject2 iface. */ HTMLSelectionObject_iface_tids diff --git a/dlls/mshtml/xmlhttprequest.c b/dlls/mshtml/xmlhttprequest.c index d7d8ce5..56e18d0 100644 --- a/dlls/mshtml/xmlhttprequest.c +++ b/dlls/mshtml/xmlhttprequest.c @@ -895,6 +895,7 @@ static const tid_t HTMLXMLHttpRequest_iface_tids[] = { 0 }; static dispex_static_data_t HTMLXMLHttpRequest_dispex = { + L"XMLHttpRequest", &HTMLXMLHttpRequest_event_target_vtbl.dispex_vtbl, DispHTMLXMLHttpRequest_tid, HTMLXMLHttpRequest_iface_tids, @@ -1066,6 +1067,7 @@ static const tid_t HTMLXMLHttpRequestFactory_iface_tids[] = { 0 }; static dispex_static_data_t HTMLXMLHttpRequestFactory_dispex = { + L"Function", &HTMLXMLHttpRequestFactory_dispex_vtbl, IHTMLXMLHttpRequestFactory_tid, HTMLXMLHttpRequestFactory_iface_tids
So dispex_to_string returns [object].
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlelem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index cb7a528..2293a34 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -261,7 +261,7 @@ static inline HTMLFiltersCollection *impl_from_IHTMLFiltersCollection(IHTMLFilte return CONTAINING_RECORD(iface, HTMLFiltersCollection, IHTMLFiltersCollection_iface); }
-static HRESULT create_filters_collection(compat_mode_t compat_mode, IHTMLFiltersCollection **ret); +static HRESULT create_filters_collection(IHTMLFiltersCollection **ret);
static inline HTMLElement *impl_from_IHTMLElement(IHTMLElement *iface) { @@ -2090,7 +2090,7 @@ static HRESULT WINAPI HTMLElement_get_filters(IHTMLElement *iface, IHTMLFiltersC if(!p) return E_POINTER;
- return create_filters_collection(dispex_compat_mode(&This->node.event_target.dispex), p); + return create_filters_collection(p); }
static HRESULT WINAPI HTMLElement_put_ondragstart(IHTMLElement *iface, VARIANT v) @@ -7063,7 +7063,7 @@ static dispex_static_data_t HTMLFiltersCollection_dispex = { HTMLFiltersCollection_iface_tids };
-static HRESULT create_filters_collection(compat_mode_t compat_mode, IHTMLFiltersCollection **ret) +static HRESULT create_filters_collection(IHTMLFiltersCollection **ret) { HTMLFiltersCollection *collection;
@@ -7074,7 +7074,7 @@ static HRESULT create_filters_collection(compat_mode_t compat_mode, IHTMLFilters collection->ref = 1;
init_dispatch(&collection->dispex, (IUnknown*)&collection->IHTMLFiltersCollection_iface, - &HTMLFiltersCollection_dispex, compat_mode); + &HTMLFiltersCollection_dispex, COMPAT_MODE_IE8);
*ret = &collection->IHTMLFiltersCollection_iface; return S_OK;
On 10/6/21 5:11 PM, Gabriel Ivăncescu wrote:
@@ -7074,7 +7074,7 @@ static HRESULT create_filters_collection(compat_mode_t compat_mode, IHTMLFilters collection->ref = 1;
init_dispatch(&collection->dispex, (IUnknown*)&collection->IHTMLFiltersCollection_iface,
&HTMLFiltersCollection_dispex, compat_mode);
&HTMLFiltersCollection_dispex, COMPAT_MODE_IE8);
How about using something like min(compat_mode, COMPAT_MODE_IE8)?
Thanks,
Jacek
Rather than always returning "[object]" in every mode.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
This is needed for next patch (and matches native).
dlls/mshtml/dispex.c | 14 ++++++++------ dlls/mshtml/tests/dom.c | 6 +++++- 2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 1adcc67..96a776d 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -715,15 +715,17 @@ HRESULT dispex_get_dynid(DispatchEx *This, const WCHAR *name, DISPID *id) static HRESULT dispex_value(DispatchEx *This, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { + HRESULT hres; + if(This->info->desc->vtbl && This->info->desc->vtbl->value) return This->info->desc->vtbl->value(This, lcid, flags, params, res, ei, caller);
switch(flags) { case DISPATCH_PROPERTYGET: V_VT(res) = VT_BSTR; - V_BSTR(res) = SysAllocString(L"[object]"); - if(!V_BSTR(res)) - return E_OUTOFMEMORY; + hres = dispex_to_string(This, &V_BSTR(res)); + if(FAILED(hres)) + return hres; break; default: FIXME("Unimplemented flags %x\n", flags); @@ -1305,9 +1307,9 @@ static HRESULT function_invoke(DispatchEx *This, func_info_t *func, WORD flags, if(func->id == DISPID_VALUE) { BSTR ret;
- ret = SysAllocString(L"[object]"); - if(!ret) - return E_OUTOFMEMORY; + hres = dispex_to_string(This, &ret); + if(FAILED(hres)) + return hres;
V_VT(res) = VT_BSTR; V_BSTR(res) = ret; diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 3bae9e0..9daaf9d 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -107,7 +107,11 @@ static const char noscript_str[] = "<body><noscript><div>test</div></noscript></body></html>"; static const char doctype_str[] = "<!DOCTYPE html>" - "<html><head><title>emptydiv test</title></head>" + "<html>" + " <head>" + " <meta http-equiv="x-ua-compatible" content="IE=8" />" + " <title>emptydiv test</title>" + " </head>" "<body><div id="divid"></div></body></html>";
static WCHAR characterW[] = {'c','h','a','r','a','c','t','e','r',0};
Signed-off-by: Jacek Caban jacek@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlelem.c | 181 +++++++++++++++++++++++++----- dlls/mshtml/tests/documentmode.js | 158 ++++++++++++++++++++++++++ 2 files changed, 310 insertions(+), 29 deletions(-)
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 2293a34..29deec9 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -46,32 +46,119 @@ typedef struct { HRESULT (*constructor)(HTMLDocumentNode*,nsIDOMElement*,HTMLElement**); } tag_desc_t;
+static HRESULT HTMLElement_Constr(HTMLDocumentNode*,nsIDOMElement*,HTMLElement**); + static const tag_desc_t tag_descs[] = { - {L"A", HTMLAnchorElement_Create}, - {L"AREA", HTMLAreaElement_Create}, - {L"BODY", HTMLBodyElement_Create}, - {L"BUTTON", HTMLButtonElement_Create}, - {L"EMBED", HTMLEmbedElement_Create}, - {L"FORM", HTMLFormElement_Create}, - {L"FRAME", HTMLFrameElement_Create}, - {L"HEAD", HTMLHeadElement_Create}, - {L"HTML", HTMLHtmlElement_Create}, - {L"IFRAME", HTMLIFrame_Create}, - {L"IMG", HTMLImgElement_Create}, - {L"INPUT", HTMLInputElement_Create}, - {L"LABEL", HTMLLabelElement_Create}, - {L"LINK", HTMLLinkElement_Create}, - {L"META", HTMLMetaElement_Create}, - {L"OBJECT", HTMLObjectElement_Create}, - {L"OPTION", HTMLOptionElement_Create}, - {L"SCRIPT", HTMLScriptElement_Create}, - {L"SELECT", HTMLSelectElement_Create}, - {L"STYLE", HTMLStyleElement_Create}, - {L"TABLE", HTMLTable_Create}, - {L"TD", HTMLTableCell_Create}, - {L"TEXTAREA", HTMLTextAreaElement_Create}, - {L"TITLE", HTMLTitleElement_Create}, - {L"TR", HTMLTableRow_Create} + {L"A", HTMLAnchorElement_Create}, + {L"ABBR", HTMLElement_Constr}, + {L"ACRONYM", HTMLElement_Constr}, + {L"ADDRESS", HTMLElement_Constr}, + {L"APPLET", HTMLElement_Constr}, + {L"AREA", HTMLAreaElement_Create}, + {L"ARTICLE", HTMLElement_Constr}, + {L"ASIDE", HTMLElement_Constr}, + {L"AUDIO", HTMLElement_Constr}, + {L"B", HTMLElement_Constr}, + {L"BASE", HTMLElement_Constr}, + {L"BASEFONT", HTMLElement_Constr}, + {L"BDO", HTMLElement_Constr}, + {L"BIG", HTMLElement_Constr}, + {L"BLOCKQUOTE", HTMLElement_Constr}, + {L"BODY", HTMLBodyElement_Create}, + {L"BR", HTMLElement_Constr}, + {L"BUTTON", HTMLButtonElement_Create}, + {L"CANVAS", HTMLElement_Constr}, + {L"CAPTION", HTMLElement_Constr}, + {L"CENTER", HTMLElement_Constr}, + {L"CITE", HTMLElement_Constr}, + {L"CODE", HTMLElement_Constr}, + {L"COL", HTMLElement_Constr}, + {L"COLGROUP", HTMLElement_Constr}, + {L"DATALIST", HTMLElement_Constr}, + {L"DD", HTMLElement_Constr}, + {L"DEL", HTMLElement_Constr}, + {L"DFN", HTMLElement_Constr}, + {L"DIR", HTMLElement_Constr}, + {L"DIV", HTMLElement_Constr}, + {L"DL", HTMLElement_Constr}, + {L"DT", HTMLElement_Constr}, + {L"EM", HTMLElement_Constr}, + {L"EMBED", HTMLEmbedElement_Create}, + {L"FIELDSET", HTMLElement_Constr}, + {L"FIGCAPTION", HTMLElement_Constr}, + {L"FIGURE", HTMLElement_Constr}, + {L"FONT", HTMLElement_Constr}, + {L"FOOTER", HTMLElement_Constr}, + {L"FORM", HTMLFormElement_Create}, + {L"FRAME", HTMLFrameElement_Create}, + {L"FRAMESET", HTMLElement_Constr}, + {L"H1", HTMLElement_Constr}, + {L"H2", HTMLElement_Constr}, + {L"H3", HTMLElement_Constr}, + {L"H4", HTMLElement_Constr}, + {L"H5", HTMLElement_Constr}, + {L"H6", HTMLElement_Constr}, + {L"HEAD", HTMLHeadElement_Create}, + {L"HEADER", HTMLElement_Constr}, + {L"HR", HTMLElement_Constr}, + {L"HTML", HTMLHtmlElement_Create}, + {L"I", HTMLElement_Constr}, + {L"IFRAME", HTMLIFrame_Create}, + {L"IMG", HTMLImgElement_Create}, + {L"INPUT", HTMLInputElement_Create}, + {L"INS", HTMLElement_Constr}, + {L"KBD", HTMLElement_Constr}, + {L"LABEL", HTMLLabelElement_Create}, + {L"LEGEND", HTMLElement_Constr}, + {L"LI", HTMLElement_Constr}, + {L"LINK", HTMLLinkElement_Create}, + {L"MAP", HTMLElement_Constr}, + {L"MARK", HTMLElement_Constr}, + {L"META", HTMLMetaElement_Create}, + {L"NAV", HTMLElement_Constr}, + {L"NOFRAMES", HTMLElement_Constr}, + {L"NOSCRIPT", HTMLElement_Constr}, + {L"OBJECT", HTMLObjectElement_Create}, + {L"OL", HTMLElement_Constr}, + {L"OPTGROUP", HTMLElement_Constr}, + {L"OPTION", HTMLOptionElement_Create}, + {L"P", HTMLElement_Constr}, + {L"PARAM", HTMLElement_Constr}, + {L"PRE", HTMLElement_Constr}, + {L"PROGRESS", HTMLElement_Constr}, + {L"Q", HTMLElement_Constr}, + {L"RP", HTMLElement_Constr}, + {L"RT", HTMLElement_Constr}, + {L"RUBY", HTMLElement_Constr}, + {L"S", HTMLElement_Constr}, + {L"SAMP", HTMLElement_Constr}, + {L"SCRIPT", HTMLScriptElement_Create}, + {L"SECTION", HTMLElement_Constr}, + {L"SELECT", HTMLSelectElement_Create}, + {L"SMALL", HTMLElement_Constr}, + {L"SOURCE", HTMLElement_Constr}, + {L"SPAN", HTMLElement_Constr}, + {L"STRIKE", HTMLElement_Constr}, + {L"STRONG", HTMLElement_Constr}, + {L"STYLE", HTMLStyleElement_Create}, + {L"SUB", HTMLElement_Constr}, + {L"SUP", HTMLElement_Constr}, + {L"TABLE", HTMLTable_Create}, + {L"TBODY", HTMLElement_Constr}, + {L"TD", HTMLTableCell_Create}, + {L"TEXTAREA", HTMLTextAreaElement_Create}, + {L"TFOOT", HTMLElement_Constr}, + {L"TH", HTMLElement_Constr}, + {L"THEAD", HTMLElement_Constr}, + {L"TITLE", HTMLTitleElement_Create}, + {L"TR", HTMLTableRow_Create}, + {L"TRACK", HTMLElement_Constr}, + {L"TT", HTMLElement_Constr}, + {L"U", HTMLElement_Constr}, + {L"UL", HTMLElement_Constr}, + {L"VAR", HTMLElement_Constr}, + {L"VIDEO", HTMLElement_Constr}, + {L"WBR", HTMLElement_Constr} };
static const tag_desc_t *get_tag_desc(const WCHAR *tag_name) @@ -2114,8 +2201,21 @@ static HRESULT WINAPI HTMLElement_get_ondragstart(IHTMLElement *iface, VARIANT * static HRESULT WINAPI HTMLElement_toString(IHTMLElement *iface, BSTR *String) { HTMLElement *This = impl_from_IHTMLElement(iface); - FIXME("(%p)->(%p)\n", This, String); - return E_NOTIMPL; + HRESULT hres; + VARIANT var; + + TRACE("(%p)->(%p)\n", This, String); + + if(!String) + return E_INVALIDARG; + + hres = IDispatchEx_InvokeEx(&This->node.event_target.dispex.IDispatchEx_iface, DISPID_VALUE, + LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYGET, NULL, &var, NULL, NULL); + if(SUCCEEDED(hres)) { + assert(V_VT(&var) == VT_BSTR); + *String = V_BSTR(&var); + } + return hres; }
static HRESULT WINAPI HTMLElement_put_onbeforeupdate(IHTMLElement *iface, VARIANT v) @@ -6789,6 +6889,14 @@ static dispex_static_data_t HTMLElement_dispex = { HTMLElement_init_dispex_info };
+static dispex_static_data_t HTMLUnknownElement_dispex = { + L"HTMLUnknownElement", + &HTMLElement_event_target_vtbl.dispex_vtbl, + DispHTMLUnknownElement_tid, + HTMLElement_iface_tids, + HTMLElement_init_dispex_info +}; + void HTMLElement_Init(HTMLElement *This, HTMLDocumentNode *doc, nsIDOMElement *nselem, dispex_static_data_t *dispex_data) { This->IHTMLElement_iface.lpVtbl = &HTMLElementVtbl; @@ -6810,7 +6918,7 @@ void HTMLElement_Init(HTMLElement *This, HTMLDocumentNode *doc, nsIDOMElement *n nsIDOMHTMLElement *html_element; nsresult nsres;
- HTMLDOMNode_Init(doc, &This->node, (nsIDOMNode*)nselem, dispex_data ? dispex_data : &HTMLElement_dispex); + HTMLDOMNode_Init(doc, &This->node, (nsIDOMNode*)nselem, dispex_data ? dispex_data : &HTMLUnknownElement_dispex);
/* No AddRef, share reference with HTMLDOMNode */ assert((nsIDOMNode*)nselem == This->node.nsnode); @@ -6865,7 +6973,7 @@ HRESULT HTMLElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, BOOL use_g elem = heap_alloc_zero(sizeof(HTMLElement)); if(elem) { elem->node.vtbl = &HTMLElementImplVtbl; - HTMLElement_Init(elem, doc, nselem, &HTMLElement_dispex); + HTMLElement_Init(elem, doc, nselem, &HTMLUnknownElement_dispex); hres = S_OK; }else { hres = E_OUTOFMEMORY; @@ -6884,6 +6992,21 @@ HRESULT HTMLElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, BOOL use_g return S_OK; }
+static HRESULT HTMLElement_Constr(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem) +{ + HTMLElement *ret; + + ret = heap_alloc_zero(sizeof(*ret)); + if(!ret) + return E_OUTOFMEMORY; + + ret->node.vtbl = &HTMLElementImplVtbl; + HTMLElement_Init(ret, doc, nselem, &HTMLElement_dispex); + + *elem = ret; + return S_OK; +} + HRESULT get_element(nsIDOMElement *nselem, HTMLElement **ret) { HTMLDOMNode *node; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index c20f6ee..f62202a 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -19,6 +19,164 @@ var compat_version; var tests = [];
+sync_test("builtin_toString", function() { + var tags = [ + [ "abbr", "Phrase" ], + [ "acronym", "Phrase" ], + [ "address", "Block" ], + // [ "applet", "Applet" ], // makes Windows pop up a dialog box + [ "article", "" ], + [ "aside", "" ], + [ "audio", "Audio" ], + [ "b", "Phrase" ], + [ "base", "Base" ], + [ "basefont", "BaseFont" ], + [ "bdi", "Unknown" ], + [ "bdo", "Phrase" ], + [ "big", "Phrase" ], + [ "blockquote", "Block" ], + [ "body", "Body" ], + [ "br", "BR" ], + [ "button", "Button" ], + [ "canvas", "Canvas" ], + [ "caption", "TableCaption" ], + [ "center", "Block" ], + [ "cite", "Phrase" ], + [ "code", "Phrase" ], + [ "col", "TableCol" ], + [ "colgroup", "TableCol" ], + [ "data", "Unknown" ], + [ "datalist", "DataList", 10 ], + [ "dd", "DD" ], + [ "del", "Mod" ], + [ "details", "Unknown" ], + [ "dfn", "Phrase" ], + [ "dialog", "Unknown" ], + [ "dir", "Directory" ], + [ "div", "Div" ], + [ "dl", "DList" ], + [ "dt", "DT" ], + [ "em", "Phrase" ], + [ "embed", "Embed" ], + [ "fieldset", "FieldSet" ], + [ "figcaption", "" ], + [ "figure", "" ], + [ "font", "Font" ], + [ "footer", "" ], + [ "form", "Form" ], + [ "frame", "Frame" ], + [ "frameset", "FrameSet" ], + [ "h1", "Heading" ], + [ "h2", "Heading" ], + [ "h3", "Heading" ], + [ "h4", "Heading" ], + [ "h5", "Heading" ], + [ "h6", "Heading" ], + [ "h7", "Unknown" ], + [ "head", "Head" ], + [ "header", "" ], + [ "hr", "HR" ], + [ "html", "Html" ], + [ "i", "Phrase" ], + [ "iframe", "IFrame" ], + [ "img", "Image" ], + [ "input", "Input" ], + [ "ins", "Mod" ], + [ "kbd", "Phrase" ], + [ "label", "Label" ], + [ "legend", "Legend" ], + [ "li", "LI" ], + [ "link", "Link" ], + [ "main", "Unknown" ], + [ "map", "Map" ], + [ "mark", "" ], + [ "meta", "Meta" ], + [ "meter", "Unknown" ], + [ "nav", "" ], + [ "noframes", "" ], + [ "noscript", "" ], + [ "object", "Object" ], + [ "ol", "OList" ], + [ "optgroup", "OptGroup" ], + [ "option", "Option" ], + [ "output", "Unknown" ], + [ "p", "Paragraph" ], + [ "param", "Param" ], + [ "picture", "Unknown" ], + [ "pre", "Pre" ], + [ "progress", "Progress", 10 ], + [ "q", "Quote" ], + [ "rp", "Phrase" ], + [ "rt", "Phrase" ], + [ "ruby", "Phrase" ], + [ "s", "Phrase" ], + [ "samp", "Phrase" ], + [ "script", "Script" ], + [ "section", "" ], + [ "select", "Select" ], + [ "small", "Phrase" ], + [ "source", "Source" ], + [ "span", "Span" ], + [ "strike", "Phrase" ], + [ "strong", "Phrase" ], + [ "style", "Style" ], + [ "sub", "Phrase" ], + [ "summary", "Unknown" ], + [ "sup", "Phrase" ], + [ "svg", "Unknown" ], + [ "table", "Table" ], + [ "tbody", "TableSection" ], + [ "td", "TableDataCell" ], + [ "template", "Unknown" ], + [ "textarea", "TextArea" ], + [ "tfoot", "TableSection" ], + [ "th", "TableHeaderCell" ], + [ "thead", "TableSection" ], + [ "time", "Unknown" ], + [ "title", "Title" ], + [ "tr", "TableRow" ], + [ "track", "Track", 10 ], + [ "tt", "Phrase" ], + [ "u", "Phrase" ], + [ "ul", "UList" ], + [ "var", "Phrase" ], + [ "video", "Video" ], + [ "wbr", "" ], + [ "winetest", "Unknown" ] + ]; + var v = document.documentMode, e; + + function test(msg, obj, name, tostr) { + var s; + if(!obj) { + win_skip(msg + " is buggy and not available, skipping"); + return; + } + if(obj.toString) { + s = obj.toString(); + todo_wine_if(name !== "HTMLElement" && s === "[object HTMLElement]"). + ok(s === (tostr ? tostr : (v < 9 ? "[object]" : "[object " + name + "]")), msg + " toString returned " + s); + } + s = Object.prototype.toString.call(obj); + todo_wine_if(v >= 9 && name != "Object"). + ok(s === (v < 9 ? "[object Object]" : "[object " + name + "]"), msg + " Object.toString returned " + s); + } + + for(var i = 0; i < tags.length; i++) + if(tags[i].length < 3 || v >= tags[i][2]) + test("tag '" + tags[i][0] + "'", document.createElement(tags[i][0]), "HTML" + tags[i][1] + "Element"); + + e = document.createElement("a"); + ok(e.toString() === "", "tag 'a' (without href) toString returned " + e.toString()); + e.href = "https://www.winehq.org/"; + test("tag 'a'", e, "HTMLAnchorElement", "https://www.winehq.org/"); + + e = document.createElement("area"); + ok(e.toString() === "", "tag 'area' (without href) toString returned " + e.toString()); + e.href = "https://www.winehq.org/"; + test("tag 'area'", e, "HTMLAreaElement", "https://www.winehq.org/"); +}); + sync_test("elem_props", function() { var elem = document.documentElement;
Hi Gabriel,
On 10/6/21 5:11 PM, Gabriel Ivăncescu wrote:
if(!obj) {
win_skip(msg + " is buggy and not available, skipping");
return;
}
Where do you see it happening? It seems to be unneeded for this patch and if you need it later, it's probably better to handle in the caller rather than the generic helper.
Thanks,
Jacek
On 06/10/2021 21:15, Jacek Caban wrote:
Hi Gabriel,
On 10/6/21 5:11 PM, Gabriel Ivăncescu wrote:
+ if(!obj) { + win_skip(msg + " is buggy and not available, skipping"); + return; + }
Where do you see it happening? It seems to be unneeded for this patch and if you need it later, it's probably better to handle in the caller rather than the generic helper.
Thanks,
Jacek
Yeah it's pretty weird. Seems to happen on the w10pro64 VM for some reason.
https://testbot.winehq.org/JobDetails.pl?Key=99570&f212=exe32.report#k21...
So far only currentStyle seems to be also needing special handling.
The thing is that, while testing this out, the getClientRects() also had such bug, but I wasn't able to reproduce it on the testbots again after that (I can't reproduce any of them at all locally).
So I tried to play it safe and put it in the test function itself—but if that's not desirable I can add exception just for currentStyle. I just hope nothing else pops up randomly at some point.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
Needed for next patch, which makes use of the compat mode indirectly via dispex_to_string.
dlls/mshtml/htmlattr.c | 3 +-- dlls/mshtml/htmldoc.c | 2 +- dlls/mshtml/htmlelem.c | 2 +- dlls/mshtml/mshtml_private.h | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/dlls/mshtml/htmlattr.c b/dlls/mshtml/htmlattr.c index e10c7c3..e4c98d9 100644 --- a/dlls/mshtml/htmlattr.c +++ b/dlls/mshtml/htmlattr.c @@ -495,9 +495,8 @@ HTMLDOMAttribute *unsafe_impl_from_IHTMLDOMAttribute(IHTMLDOMAttribute *iface) return iface->lpVtbl == &HTMLDOMAttributeVtbl ? impl_from_IHTMLDOMAttribute(iface) : NULL; }
-HRESULT HTMLDOMAttribute_Create(const WCHAR *name, HTMLElement *elem, DISPID dispid, HTMLDOMAttribute **attr) +HRESULT HTMLDOMAttribute_Create(const WCHAR *name, HTMLElement *elem, DISPID dispid, compat_mode_t compat_mode, HTMLDOMAttribute **attr) { - compat_mode_t compat_mode = elem ? dispex_compat_mode(&elem->node.event_target.dispex) : COMPAT_MODE_QUIRKS; HTMLAttributeCollection *col; HTMLDOMAttribute *ret; HRESULT hres; diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 6bbf058..12fce6d 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -2856,7 +2856,7 @@ static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrattrName), ppattribute);
- hres = HTMLDOMAttribute_Create(bstrattrName, NULL, 0, &attr); + hres = HTMLDOMAttribute_Create(bstrattrName, NULL, 0, dispex_compat_mode(&This->doc_node->node.event_target.dispex), &attr); if(FAILED(hres)) return hres;
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 29deec9..5d0ea5c 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -7374,7 +7374,7 @@ static inline HRESULT get_domattr(HTMLAttributeCollection *This, DISPID id, LONG return E_UNEXPECTED; }
- hres = HTMLDOMAttribute_Create(NULL, This->elem, id, attr); + hres = HTMLDOMAttribute_Create(NULL, This->elem, id, dispex_compat_mode(&This->elem->node.event_target.dispex), attr); if(FAILED(hres)) return hres; } diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 9429a4b..6ee5105 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1090,7 +1090,7 @@ typedef struct {
HTMLDOMAttribute *unsafe_impl_from_IHTMLDOMAttribute(IHTMLDOMAttribute*) DECLSPEC_HIDDEN;
-HRESULT HTMLDOMAttribute_Create(const WCHAR*,HTMLElement*,DISPID,HTMLDOMAttribute**) DECLSPEC_HIDDEN; +HRESULT HTMLDOMAttribute_Create(const WCHAR*,HTMLElement*,DISPID,compat_mode_t,HTMLDOMAttribute**) DECLSPEC_HIDDEN;
HRESULT HTMLElement_Create(HTMLDocumentNode*,nsIDOMNode*,BOOL,HTMLElement**) DECLSPEC_HIDDEN; HRESULT HTMLCommentElement_Create(HTMLDocumentNode*,nsIDOMNode*,HTMLElement**) DECLSPEC_HIDDEN;
Signed-off-by: Jacek Caban jacek@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/tests/documentmode.js | 72 +++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+)
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index f62202a..225f446 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -175,6 +175,78 @@ sync_test("builtin_toString", function() { ok(e.toString() === "", "tag 'area' (without href) toString returned " + e.toString()); e.href = "https://www.winehq.org/"; test("tag 'area'", e, "HTMLAreaElement", "https://www.winehq.org/"); + + e = document.createElement("style"); + document.body.appendChild(e); + var sheet = v >= 9 ? e.sheet : e.styleSheet; + if(v >= 9) + sheet.insertRule("div { border: none }", 0); + else + sheet.addRule("div", "border: none", 0); + + e = document.createElement("p"); + e.className = "testclass another "; + e.textContent = "Test content"; + e.style.border = "1px solid black"; + document.body.appendChild(e); + + var txtRange = document.body.createTextRange(); + txtRange.moveToElementText(e); + + var clientRects = e.getClientRects(); + if(!clientRects) win_skip("getClientRects() is buggy and not available, skipping"); + + // w10pro64 testbot VM throws WININET_E_INTERNAL_ERROR for some reason + var localStorage; + try { + localStorage = window.localStorage; + }catch(e) { + ok(e.number === 0x72ee4 - 0x80000000, "localStorage threw " + e.number + ": " + e); + } + + test("attribute", document.createAttribute("class"), "Attr"); + if(false /* todo_wine */) test("attributes", e.attributes, "NamedNodeMap"); + test("childNodes", document.body.childNodes, "NodeList"); + if(clientRects) test("clientRect", clientRects[0], "ClientRect"); + if(clientRects) test("clientRects", clientRects, "ClientRectList"); + test("currentStyle", e.currentStyle, "MSCurrentStyleCSSProperties"); + test("history", window.history, "History"); + test("implementation", document.implementation, "DOMImplementation"); + test("localStorage", localStorage, "Storage"); + test("location", window.location, "Object", window.location.href); + test("navigator", window.navigator, "Navigator"); + test("screen", window.screen, "Screen"); + test("sessionStorage", window.sessionStorage, "Storage"); + test("styleSheet", sheet, "CSSStyleSheet"); + test("styleSheetRule", sheet.rules.item(0), "CSSStyleRule"); + test("styleSheetRules", sheet.rules, "MSCSSRuleList"); + test("styleSheets", document.styleSheets, "StyleSheetList"); + test("textRange", txtRange, "TextRange"); + test("xmlHttpRequest", new XMLHttpRequest(), "XMLHttpRequest"); + if(v < 10) { + test("namespaces", document.namespaces, "MSNamespaceInfoCollection"); + } + if(v < 11) { + test("eventObject", document.createEventObject(), "MSEventObj"); + test("selection", document.selection, "MSSelection"); + } + if(v >= 9) { + test("computedStyle", window.getComputedStyle(e), "CSSStyleDeclaration"); + + test("Event", document.createEvent("Event"), "Event"); + test("CustomEvent", document.createEvent("CustomEvent"), "CustomEvent"); + test("KeyboardEvent", document.createEvent("KeyboardEvent"), "KeyboardEvent"); + test("MouseEvent", document.createEvent("MouseEvent"), "MouseEvent"); + test("UIEvent", document.createEvent("UIEvent"), "UIEvent"); + } + if(v >= 10) { + test("classList", e.classList, "DOMTokenList", "testclass another "); + test("console", window.console, "Console"); + } + if(v >= 9) { + document.body.innerHTML = "<!--...-->"; + test("comment", document.body.firstChild, "Comment"); + } });
sync_test("elem_props", function() {
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=99580
Your paranoid android.
=== w8adm (32 bit report) ===
mshtml: events.c:1089: Test failed: unexpected call img_onerror events: Timeout
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlwindow.c | 2 +- dlls/mshtml/tests/documentmode.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 2dfa879..2d4cf68 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -1457,7 +1457,7 @@ static HRESULT WINAPI HTMLWindow2_toString(IHTMLWindow2 *iface, BSTR *String) if(!String) return E_INVALIDARG;
- *String = SysAllocString(L"[object]"); + *String = SysAllocString(L"[object Window]"); return *String ? S_OK : E_OUTOFMEMORY; }
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 225f446..dcbb43f 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -222,6 +222,7 @@ sync_test("builtin_toString", function() { test("styleSheetRules", sheet.rules, "MSCSSRuleList"); test("styleSheets", document.styleSheets, "StyleSheetList"); test("textRange", txtRange, "TextRange"); + test("window", window, "Window", "[object Window]"); test("xmlHttpRequest", new XMLHttpRequest(), "XMLHttpRequest"); if(v < 10) { test("namespaces", document.namespaces, "MSNamespaceInfoCollection");
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=99581
Your paranoid android.
=== w8adm (32 bit report) ===
mshtml: htmldoc.c:3084: Test failed: Incorrect error code: -2146697211 htmldoc.c:3089: Test failed: Page address: L"http://test.winehq.org/tests/winehq_snapshot/" htmldoc.c:5861: Test failed: expected OnChanged_1012 htmldoc.c:5862: Test failed: expected Exec_HTTPEQUIV htmldoc.c:5864: Test failed: expected Exec_SETTITLE htmldoc.c:5905: Test failed: expected FireNavigateComplete2
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlelemcol.c | 6 ++++-- dlls/mshtml/tests/documentmode.js | 1 + 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlelemcol.c b/dlls/mshtml/htmlelemcol.c index 86ef3a3..895b3db 100644 --- a/dlls/mshtml/htmlelemcol.c +++ b/dlls/mshtml/htmlelemcol.c @@ -301,8 +301,10 @@ static HRESULT WINAPI HTMLElementCollection_toString(IHTMLElementCollection *ifa BSTR *String) { HTMLElementCollection *This = impl_from_IHTMLElementCollection(iface); - FIXME("(%p)->(%p)\n", This, String); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, String); + + return dispex_to_string(&This->dispex, String); }
static HRESULT WINAPI HTMLElementCollection_put_length(IHTMLElementCollection *iface, diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index dcbb43f..ac33cfc 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -210,6 +210,7 @@ sync_test("builtin_toString", function() { if(clientRects) test("clientRect", clientRects[0], "ClientRect"); if(clientRects) test("clientRects", clientRects, "ClientRectList"); test("currentStyle", e.currentStyle, "MSCurrentStyleCSSProperties"); + test("elements", document.getElementsByTagName("body"), "HTMLCollection"); test("history", window.history, "History"); test("implementation", document.implementation, "DOMImplementation"); test("localStorage", localStorage, "Storage");
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=99582
Your paranoid android.
=== w8adm (32 bit report) ===
mshtml: htmldoc.c:3084: Test failed: Incorrect error code: -2146697211 htmldoc.c:3089: Test failed: Page address: L"http://test.winehq.org/tests/winehq_snapshot/" htmldoc.c:5861: Test failed: expected OnChanged_1012 htmldoc.c:5862: Test failed: expected Exec_HTTPEQUIV htmldoc.c:5864: Test failed: expected Exec_SETTITLE htmldoc.c:5905: Test failed: expected FireNavigateComplete2
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlstyle.c | 6 ++++-- dlls/mshtml/tests/documentmode.js | 1 + 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 7dd7000..2cbd8a5 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -3025,8 +3025,10 @@ static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttri static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String) { HTMLStyle *This = impl_from_IHTMLStyle(iface); - FIXME("(%p)->(%p)\n", This, String); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, String); + + return dispex_to_string(&This->css_style.dispex, String); }
static const IHTMLStyleVtbl HTMLStyleVtbl = { diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index ac33cfc..7cb7dc0 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -218,6 +218,7 @@ sync_test("builtin_toString", function() { test("navigator", window.navigator, "Navigator"); test("screen", window.screen, "Screen"); test("sessionStorage", window.sessionStorage, "Storage"); + test("style", document.body.style, "MSStyleCSSProperties"); test("styleSheet", sheet, "CSSStyleSheet"); test("styleSheetRule", sheet.rules.item(0), "CSSStyleRule"); test("styleSheetRules", sheet.rules, "MSCSSRuleList");
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=99583
Your paranoid android.
=== w10pro64_ja (64 bit report) ===
mshtml: htmldoc.c:2541: Test failed: unexpected call UpdateUI htmldoc.c:2853: Test failed: unexpected call Exec_UPDATECOMMANDS
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmltextnode.c | 12 ++++++++++-- dlls/mshtml/tests/documentmode.js | 1 + 2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmltextnode.c b/dlls/mshtml/htmltextnode.c index afe5d21..d899fa0 100644 --- a/dlls/mshtml/htmltextnode.c +++ b/dlls/mshtml/htmltextnode.c @@ -128,8 +128,16 @@ static HRESULT WINAPI HTMLDOMTextNode_get_data(IHTMLDOMTextNode *iface, BSTR *p) static HRESULT WINAPI HTMLDOMTextNode_toString(IHTMLDOMTextNode *iface, BSTR *String) { HTMLDOMTextNode *This = impl_from_IHTMLDOMTextNode(iface); - FIXME("(%p)->(%p)\n", This, String); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, String); + + if(!String) + return E_INVALIDARG; + + if(dispex_compat_mode(&This->node.event_target.dispex) < COMPAT_MODE_IE9) + return IHTMLDOMTextNode_get_data(&This->IHTMLDOMTextNode_iface, String); + + return dispex_to_string(&This->node.event_target.dispex, String); }
static HRESULT WINAPI HTMLDOMTextNode_get_length(IHTMLDOMTextNode *iface, LONG *p) diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 7cb7dc0..2cc8301 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -223,6 +223,7 @@ sync_test("builtin_toString", function() { test("styleSheetRule", sheet.rules.item(0), "CSSStyleRule"); test("styleSheetRules", sheet.rules, "MSCSSRuleList"); test("styleSheets", document.styleSheets, "StyleSheetList"); + test("textNode", document.createTextNode("testNode"), "Text", v < 9 ? "testNode" : null); test("textRange", txtRange, "TextRange"); test("window", window, "Window", "[object Window]"); test("xmlHttpRequest", new XMLHttpRequest(), "XMLHttpRequest");
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=99584
Your paranoid android.
=== w8adm (32 bit report) ===
mshtml: htmldoc.c:3084: Test failed: Incorrect error code: -2146697211 htmldoc.c:3089: Test failed: Page address: L"http://test.winehq.org/tests/winehq_snapshot/" htmldoc.c:5861: Test failed: expected OnChanged_1012 htmldoc.c:5862: Test failed: expected Exec_HTTPEQUIV htmldoc.c:5864: Test failed: expected Exec_SETTITLE htmldoc.c:5905: Test failed: expected FireNavigateComplete2
=== w1064_tsign (64 bit report) ===
mshtml: htmldoc.c:2541: Test failed: unexpected call UpdateUI htmldoc.c:2853: Test failed: unexpected call Exec_UPDATECOMMANDS htmldoc.c:350: Test failed: expected Exec_SETTITLE htmldoc.c:2859: Test failed: unexpected call Exec_SETTITLE
=== w10pro64_ar (64 bit report) ===
mshtml: htmldoc.c:2541: Test failed: unexpected call UpdateUI htmldoc.c:2853: Test failed: unexpected call Exec_UPDATECOMMANDS htmldoc.c:350: Test failed: expected Exec_SETTITLE htmldoc.c:2859: Test failed: unexpected call Exec_SETTITLE
=== w10pro64_zh_CN (64 bit report) ===
mshtml: htmldoc.c:2541: Test failed: unexpected call UpdateUI htmldoc.c:2853: Test failed: unexpected call Exec_UPDATECOMMANDS
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlwindow.c | 93 ++++++++++++++++++++++++++++ dlls/mshtml/mshtml_private.h | 2 + dlls/mshtml/mshtml_private_iface.idl | 18 ++++++ dlls/mshtml/tests/documentmode.js | 3 +- 4 files changed, 114 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 2d4cf68..0b25e71 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -191,6 +191,8 @@ static HRESULT WINAPI HTMLWindow2_QueryInterface(IHTMLWindow2 *iface, REFIID rii *ppv = &This->IProvideMultipleClassInfo_iface; }else if(IsEqualGUID(&IID_IWineHTMLWindowPrivate, riid)) { *ppv = &This->IWineHTMLWindowPrivate_iface; + }else if(IsEqualGUID(&IID_IWineHTMLWindowCompatPrivate, riid)) { + *ppv = &This->IWineHTMLWindowCompatPrivate_iface; }else if(IsEqualGUID(&IID_IMarshal, riid)) { *ppv = NULL; FIXME("(%p)->(IID_IMarshal %p)\n", This, ppv); @@ -3145,6 +3147,94 @@ static const IWineHTMLWindowPrivateVtbl WineHTMLWindowPrivateVtbl = { window_private_get_console, };
+static inline HTMLWindow *impl_from_IWineHTMLWindowCompatPrivateVtbl(IWineHTMLWindowCompatPrivate *iface) +{ + return CONTAINING_RECORD(iface, HTMLWindow, IWineHTMLWindowCompatPrivate_iface); +} + +static HRESULT WINAPI window_compat_private_QueryInterface(IWineHTMLWindowCompatPrivate *iface, + REFIID riid, void **ppv) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowCompatPrivateVtbl(iface); + + return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv); +} + +static ULONG WINAPI window_compat_private_AddRef(IWineHTMLWindowCompatPrivate *iface) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowCompatPrivateVtbl(iface); + + return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface); +} + +static ULONG WINAPI window_compat_private_Release(IWineHTMLWindowCompatPrivate *iface) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowCompatPrivateVtbl(iface); + + return IHTMLWindow2_Release(&This->IHTMLWindow2_iface); +} + +static HRESULT WINAPI window_compat_private_GetTypeInfoCount(IWineHTMLWindowCompatPrivate *iface, UINT *pctinfo) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowCompatPrivateVtbl(iface); + + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); +} + +static HRESULT WINAPI window_compat_private_GetTypeInfo(IWineHTMLWindowCompatPrivate *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowCompatPrivateVtbl(iface); + + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); +} + +static HRESULT WINAPI window_compat_private_GetIDsOfNames(IWineHTMLWindowCompatPrivate *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowCompatPrivateVtbl(iface); + + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, + rgDispId); +} + +static HRESULT WINAPI window_compat_private_Invoke(IWineHTMLWindowCompatPrivate *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowCompatPrivateVtbl(iface); + + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI window_compat_private_put_performance(IWineHTMLWindowCompatPrivate *iface, VARIANT v) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowCompatPrivateVtbl(iface); + + return IHTMLWindow7_put_performance(&This->IHTMLWindow7_iface, v); +} + +static HRESULT WINAPI window_compat_private_get_performance(IWineHTMLWindowCompatPrivate *iface, VARIANT *p) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowCompatPrivateVtbl(iface); + + return IHTMLWindow7_get_performance(&This->IHTMLWindow7_iface, p); +} + +static const IWineHTMLWindowCompatPrivateVtbl WineHTMLWindowCompatPrivateVtbl = { + window_compat_private_QueryInterface, + window_compat_private_AddRef, + window_compat_private_Release, + window_compat_private_GetTypeInfoCount, + window_compat_private_GetTypeInfo, + window_compat_private_GetIDsOfNames, + window_compat_private_Invoke, + window_compat_private_put_performance, + window_compat_private_get_performance, +}; + static inline HTMLWindow *impl_from_IDispatchEx(IDispatchEx *iface) { return CONTAINING_RECORD(iface, HTMLWindow, IDispatchEx_iface); @@ -3649,6 +3739,8 @@ static void HTMLWindow_init_dispex_info(dispex_data_t *info, compat_mode_t compa { if(compat_mode >= COMPAT_MODE_IE9) dispex_info_add_interface(info, IHTMLWindow7_tid, NULL); + else + dispex_info_add_interface(info, IWineHTMLWindowCompatPrivate_tid, NULL); if(compat_mode >= COMPAT_MODE_IE10) dispex_info_add_interface(info, IWineHTMLWindowPrivate_tid, NULL);
@@ -3715,6 +3807,7 @@ static void *alloc_window(size_t size) window->IObjectIdentity_iface.lpVtbl = &ObjectIdentityVtbl; window->IProvideMultipleClassInfo_iface.lpVtbl = &ProvideMultipleClassInfoVtbl; window->IWineHTMLWindowPrivate_iface.lpVtbl = &WineHTMLWindowPrivateVtbl; + window->IWineHTMLWindowCompatPrivate_iface.lpVtbl = &WineHTMLWindowCompatPrivateVtbl; window->ref = 1;
return window; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 6ee5105..5cf53bb 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -276,6 +276,7 @@ typedef struct EventTarget EventTarget; XIID(IWineDOMTokenList) \ XIID(IWineHTMLElementPrivate) \ XIID(IWineHTMLWindowPrivate) \ + XIID(IWineHTMLWindowCompatPrivate) \ XIID(IWineMSHTMLConsole)
typedef enum { @@ -496,6 +497,7 @@ struct HTMLWindow { IObjectIdentity IObjectIdentity_iface; IProvideMultipleClassInfo IProvideMultipleClassInfo_iface; IWineHTMLWindowPrivate IWineHTMLWindowPrivate_iface; + IWineHTMLWindowCompatPrivate IWineHTMLWindowCompatPrivate_iface;
IWineMSHTMLConsole *console;
diff --git a/dlls/mshtml/mshtml_private_iface.idl b/dlls/mshtml/mshtml_private_iface.idl index 5755afd..b9039c9 100644 --- a/dlls/mshtml/mshtml_private_iface.idl +++ b/dlls/mshtml/mshtml_private_iface.idl @@ -18,6 +18,8 @@
#pragma makedep typelib
+#include <mshtmdid.h> + import "ocidl.idl";
[ @@ -89,6 +91,22 @@ interface IWineHTMLWindowPrivate : IDispatch HRESULT console([retval, out] IDispatch **console); }
+[ + odl, + oleautomation, + dual, + hidden, + uuid(1b5939fc-8f84-43f3-8d89-f9a92069fad6) +] +interface IWineHTMLWindowCompatPrivate : IDispatch +{ + [propput, id(DISPID_IHTMLWINDOW7_PERFORMANCE)] + HRESULT performance([in] VARIANT v); + + [propget, id(DISPID_IHTMLWINDOW7_PERFORMANCE)] + HRESULT performance([out, retval] VARIANT *p); +} + [ odl, oleautomation, diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 2cc8301..c489964 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -354,8 +354,7 @@ sync_test("window_props", function() { test_exposed("requestAnimationFrame", v >= 10); test_exposed("Map", v >= 11); test_exposed("Set", v >= 11); - if(v >= 9) /* FIXME: native exposes it in all compat modes */ - test_exposed("performance", true); + test_exposed("performance", true); test_exposed("console", v >= 10); });
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=99585
Your paranoid android.
=== w8adm (32 bit report) ===
mshtml: events.c:1089: Test failed: unexpected call img_onerror events: Timeout
=== w1064_tsign (32 bit report) ===
mshtml: htmldoc.c:2541: Test failed: unexpected call UpdateUI htmldoc.c:2853: Test failed: unexpected call Exec_UPDATECOMMANDS
=== w10pro64_ja (64 bit report) ===
mshtml: htmldoc.c:2541: Test failed: unexpected call UpdateUI htmldoc.c:2853: Test failed: unexpected call Exec_UPDATECOMMANDS
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/omnavigator.c | 6 ++++-- dlls/mshtml/tests/documentmode.js | 1 + 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 7b41563..c4b7b6a 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -2161,8 +2161,10 @@ static HRESULT WINAPI HTMLPerformance_get_timing(IHTMLPerformance *iface, IHTMLP static HRESULT WINAPI HTMLPerformance_toString(IHTMLPerformance *iface, BSTR *string) { HTMLPerformance *This = impl_from_IHTMLPerformance(iface); - FIXME("(%p)->(%p)\n", This, string); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, string); + + return dispex_to_string(&This->dispex, string); }
static HRESULT WINAPI HTMLPerformance_toJSON(IHTMLPerformance *iface, VARIANT *var) diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index c489964..2209650 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -216,6 +216,7 @@ sync_test("builtin_toString", function() { test("localStorage", localStorage, "Storage"); test("location", window.location, "Object", window.location.href); test("navigator", window.navigator, "Navigator"); + test("performance", window.performance, "Performance"); test("screen", window.screen, "Screen"); test("sessionStorage", window.sessionStorage, "Storage"); test("style", document.body.style, "MSStyleCSSProperties");
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=99586
Your paranoid android.
=== w8adm (32 bit report) ===
mshtml: events.c:1089: Test failed: unexpected call img_onerror events: Timeout
=== w10pro64_zh_CN (64 bit report) ===
mshtml: htmldoc.c:2541: Test failed: unexpected call UpdateUI htmldoc.c:2853: Test failed: unexpected call Exec_UPDATECOMMANDS htmldoc.c:350: Test failed: expected Exec_SETTITLE htmldoc.c:2859: Test failed: unexpected call Exec_SETTITLE
=== w7u_adm (32 bit report) ===
mshtml: script.c:624: Test failed: L"/index.html?es5.js:date_now: unexpected Date.now() result 1633562949838 expected 1633562949901"
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/omnavigator.c | 6 ++++-- dlls/mshtml/tests/documentmode.js | 1 + 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index c4b7b6a..868ec22 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1970,8 +1970,10 @@ static HRESULT WINAPI HTMLPerformanceNavigation_get_redirectCount(IHTMLPerforman static HRESULT WINAPI HTMLPerformanceNavigation_toString(IHTMLPerformanceNavigation *iface, BSTR *string) { HTMLPerformanceNavigation *This = impl_from_IHTMLPerformanceNavigation(iface); - FIXME("(%p)->(%p)\n", This, string); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, string); + + return dispex_to_string(&This->dispex, string); }
static HRESULT WINAPI HTMLPerformanceNavigation_toJSON(IHTMLPerformanceNavigation *iface, VARIANT *p) diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 2209650..fc8ecfb 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -217,6 +217,7 @@ sync_test("builtin_toString", function() { test("location", window.location, "Object", window.location.href); test("navigator", window.navigator, "Navigator"); test("performance", window.performance, "Performance"); + test("performanceNavigation", window.performance.navigation, "PerformanceNavigation"); test("screen", window.screen, "Screen"); test("sessionStorage", window.sessionStorage, "Storage"); test("style", document.body.style, "MSStyleCSSProperties");
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=99587
Your paranoid android.
=== w8adm (32 bit report) ===
mshtml: events.c:1089: Test failed: unexpected call img_onerror events: Timeout
=== w8adm (32 bit report) ===
mshtml: htmldoc.c:3084: Test failed: Incorrect error code: -2146697211 htmldoc.c:3089: Test failed: Page address: L"http://test.winehq.org/tests/winehq_snapshot/" htmldoc.c:5861: Test failed: expected OnChanged_1012 htmldoc.c:5862: Test failed: expected Exec_HTTPEQUIV htmldoc.c:5864: Test failed: expected Exec_SETTITLE htmldoc.c:5905: Test failed: expected FireNavigateComplete2
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/omnavigator.c | 6 ++++-- dlls/mshtml/tests/documentmode.js | 1 + 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 868ec22..70e8e56 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1801,8 +1801,10 @@ static HRESULT WINAPI HTMLPerformanceTiming_get_msFirstPaint(IHTMLPerformanceTim static HRESULT WINAPI HTMLPerformanceTiming_toString(IHTMLPerformanceTiming *iface, BSTR *string) { HTMLPerformanceTiming *This = impl_from_IHTMLPerformanceTiming(iface); - FIXME("(%p)->(%p)\n", This, string); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, string); + + return dispex_to_string(&This->dispex, string); }
static HRESULT WINAPI HTMLPerformanceTiming_toJSON(IHTMLPerformanceTiming *iface, VARIANT *p) diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index fc8ecfb..411abac 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -218,6 +218,7 @@ sync_test("builtin_toString", function() { test("navigator", window.navigator, "Navigator"); test("performance", window.performance, "Performance"); test("performanceNavigation", window.performance.navigation, "PerformanceNavigation"); + test("performanceTiming", window.performance.timing, "PerformanceTiming"); test("screen", window.screen, "Screen"); test("sessionStorage", window.sessionStorage, "Storage"); test("style", document.body.style, "MSStyleCSSProperties");
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=99588
Your paranoid android.
=== w8adm (32 bit report) ===
mshtml: events.c:1089: Test failed: unexpected call img_onerror events: Timeout
=== w8adm (32 bit report) ===
mshtml: htmldoc.c:3084: Test failed: Incorrect error code: -2146697211 htmldoc.c:3089: Test failed: Page address: L"http://test.winehq.org/tests/winehq_snapshot/" htmldoc.c:5861: Test failed: expected OnChanged_1012 htmldoc.c:5862: Test failed: expected Exec_HTTPEQUIV htmldoc.c:5864: Test failed: expected Exec_SETTITLE htmldoc.c:5905: Test failed: expected FireNavigateComplete2
=== w7u_adm (32 bit report) ===
mshtml: script.c:624: Test failed: L"/index.html?es5.js:date_now: unexpected Date.now() result 1633569706774 expected 1633569706837"
=== w7u_el (32 bit report) ===
mshtml: script.c:624: Test failed: L"/index.html?es5.js:date_now: unexpected Date.now() result 1633569596744 expected 1633569596807"
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/dispex.c | 4 ++++ dlls/mshtml/htmldoc.c | 15 ++++++++------- dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/tests/documentmode.js | 1 + 4 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 96a776d..59135f6 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -1502,6 +1502,10 @@ HRESULT dispex_to_string(DispatchEx *dispex, BSTR *ret) if(compat_mode < COMPAT_MODE_IE9) p--; else { + if(dispex->info->desc->vtbl && dispex->info->desc->vtbl->get_compat_name) { + const WCHAR *tmp = dispex->info->desc->vtbl->get_compat_name(compat_mode); + if(tmp) name = tmp; + } len = wcslen(name); assert(len <= 28); memcpy(p, name, len * sizeof(WCHAR)); diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 12fce6d..35f31ef 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1703,12 +1703,7 @@ static HRESULT WINAPI HTMLDocument_toString(IHTMLDocument2 *iface, BSTR *String)
TRACE("(%p)->(%p)\n", This, String);
- if(!String) - return E_INVALIDARG; - - *String = SysAllocString(L"[object]"); - return *String ? S_OK : E_OUTOFMEMORY; - + return dispex_to_string(&This->doc_node->node.event_target.dispex, String); }
static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR bstrHref, @@ -5563,6 +5558,11 @@ static compat_mode_t HTMLDocumentNode_get_compat_mode(DispatchEx *dispex) return lock_document_mode(This); }
+static const WCHAR *HTMLDocumentNode_get_compat_name(compat_mode_t compat_mode) +{ + return compat_mode < COMPAT_MODE_IE11 ? L"Document" : NULL; +} + static nsISupports *HTMLDocumentNode_get_gecko_target(DispatchEx *dispex) { HTMLDocumentNode *This = impl_from_DispatchEx(dispex); @@ -5605,7 +5605,8 @@ static const event_target_vtbl_t HTMLDocumentNode_event_target_vtbl = { NULL, HTMLDocumentNode_invoke, HTMLDocumentNode_get_compat_mode, - NULL + NULL, + HTMLDocumentNode_get_compat_name }, HTMLDocumentNode_get_gecko_target, HTMLDocumentNode_bind_event, diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 5cf53bb..483fc58 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -325,6 +325,7 @@ typedef struct { HRESULT (*invoke)(DispatchEx*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*); compat_mode_t (*get_compat_mode)(DispatchEx*); HRESULT (*populate_props)(DispatchEx*); + const WCHAR* (*get_compat_name)(compat_mode_t); } dispex_static_data_vtbl_t;
typedef struct { diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 411abac..f039122 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -210,6 +210,7 @@ sync_test("builtin_toString", function() { if(clientRects) test("clientRect", clientRects[0], "ClientRect"); if(clientRects) test("clientRects", clientRects, "ClientRectList"); test("currentStyle", e.currentStyle, "MSCurrentStyleCSSProperties"); + test("document", document, v < 11 ? "Document" : "HTMLDocument"); test("elements", document.getElementsByTagName("body"), "HTMLCollection"); test("history", window.history, "History"); test("implementation", document.implementation, "DOMImplementation");
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=99589
Your paranoid android.
=== w8adm (32 bit report) ===
mshtml: events.c:1089: Test failed: unexpected call img_onerror events: Timeout
=== w8adm (32 bit report) ===
mshtml: htmldoc.c:3084: Test failed: Incorrect error code: -2146697211 htmldoc.c:3089: Test failed: Page address: L"http://test.winehq.org/tests/winehq_snapshot/" htmldoc.c:5861: Test failed: expected OnChanged_1012 htmldoc.c:5862: Test failed: expected Exec_HTTPEQUIV htmldoc.c:5864: Test failed: expected Exec_SETTITLE htmldoc.c:5905: Test failed: expected FireNavigateComplete2
=== w10pro64_he (64 bit report) ===
mshtml: htmldoc.c:2541: Test failed: unexpected call UpdateUI htmldoc.c:2853: Test failed: unexpected call Exec_UPDATECOMMANDS htmldoc.c:350: Test failed: expected Exec_SETTITLE htmldoc.c:2859: Test failed: unexpected call Exec_SETTITLE
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/omnavigator.c | 16 +++++++++++++++- dlls/mshtml/tests/documentmode.js | 1 + 2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 70e8e56..377be34 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -1017,13 +1017,27 @@ static const IHTMLMimeTypesCollectionVtbl HTMLMimeTypesCollectionVtbl = { HTMLMimeTypesCollection_get_length };
+static const WCHAR *HTMLMimeTypesCollection_get_compat_name(compat_mode_t compat_mode) +{ + return compat_mode < COMPAT_MODE_IE11 ? L"MSMimeTypesCollection" : NULL; +} + +static const dispex_static_data_vtbl_t HTMLMimeTypesCollection_dispex_vtbl = { + NULL, + NULL, + NULL, + NULL, + NULL, + HTMLMimeTypesCollection_get_compat_name +}; + static const tid_t HTMLMimeTypesCollection_iface_tids[] = { IHTMLMimeTypesCollection_tid, 0 }; static dispex_static_data_t HTMLMimeTypesCollection_dispex = { L"MimeTypeArray", - NULL, + &HTMLMimeTypesCollection_dispex_vtbl, IHTMLMimeTypesCollection_tid, HTMLMimeTypesCollection_iface_tids }; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index f039122..6b61a8f 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -216,6 +216,7 @@ sync_test("builtin_toString", function() { test("implementation", document.implementation, "DOMImplementation"); test("localStorage", localStorage, "Storage"); test("location", window.location, "Object", window.location.href); + test("mimeTypes", window.navigator.mimeTypes, v < 11 ? "MSMimeTypesCollection" : "MimeTypeArray"); test("navigator", window.navigator, "Navigator"); test("performance", window.performance, "Performance"); test("performanceNavigation", window.performance.navigation, "PerformanceNavigation");
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=99590
Your paranoid android.
=== w8adm (32 bit report) ===
mshtml: events.c:1089: Test failed: unexpected call img_onerror events: Timeout
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/omnavigator.c | 16 +++++++++++++++- dlls/mshtml/tests/documentmode.js | 1 + 2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 377be34..edccd4e 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -860,6 +860,20 @@ static HRESULT WINAPI HTMLPluginsCollection_refresh(IHTMLPluginsCollection *ifac return S_OK; }
+static const WCHAR *HTMLPluginsCollection_get_compat_name(compat_mode_t compat_mode) +{ + return compat_mode < COMPAT_MODE_IE11 ? L"MSPluginsCollection" : NULL; +} + +static const dispex_static_data_vtbl_t HTMLPluginsCollection_dispex_vtbl = { + NULL, + NULL, + NULL, + NULL, + NULL, + HTMLPluginsCollection_get_compat_name +}; + static const IHTMLPluginsCollectionVtbl HTMLPluginsCollectionVtbl = { HTMLPluginsCollection_QueryInterface, HTMLPluginsCollection_AddRef, @@ -878,7 +892,7 @@ static const tid_t HTMLPluginsCollection_iface_tids[] = { }; static dispex_static_data_t HTMLPluginsCollection_dispex = { L"PluginArray", - NULL, + &HTMLPluginsCollection_dispex_vtbl, DispCPlugins_tid, HTMLPluginsCollection_iface_tids }; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 6b61a8f..a8a7c09 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -221,6 +221,7 @@ sync_test("builtin_toString", function() { test("performance", window.performance, "Performance"); test("performanceNavigation", window.performance.navigation, "PerformanceNavigation"); test("performanceTiming", window.performance.timing, "PerformanceTiming"); + test("plugins", window.navigator.plugins, v < 11 ? "MSPluginsCollection" : "PluginArray"); test("screen", window.screen, "Screen"); test("sessionStorage", window.sessionStorage, "Storage"); test("style", document.body.style, "MSStyleCSSProperties");
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=99591
Your paranoid android.
=== w8adm (32 bit report) ===
mshtml: events.c:1089: Test failed: unexpected call img_onerror events: Timeout