So dispex_to_string returns [object].
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlelem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index dada4de..29aa378 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -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, min(compat_mode, COMPAT_MODE_IE8));
*ret = &collection->IHTMLFiltersCollection_iface; return S_OK;
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlelem.c | 181 +++++++++++++++++++++++++----- dlls/mshtml/tests/documentmode.js | 154 +++++++++++++++++++++++++ 2 files changed, 306 insertions(+), 29 deletions(-)
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 29aa378..de69e2f 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_Ctor(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_Ctor}, + {L"ACRONYM", HTMLElement_Ctor}, + {L"ADDRESS", HTMLElement_Ctor}, + {L"APPLET", HTMLElement_Ctor}, + {L"AREA", HTMLAreaElement_Create}, + {L"ARTICLE", HTMLElement_Ctor}, + {L"ASIDE", HTMLElement_Ctor}, + {L"AUDIO", HTMLElement_Ctor}, + {L"B", HTMLElement_Ctor}, + {L"BASE", HTMLElement_Ctor}, + {L"BASEFONT", HTMLElement_Ctor}, + {L"BDO", HTMLElement_Ctor}, + {L"BIG", HTMLElement_Ctor}, + {L"BLOCKQUOTE", HTMLElement_Ctor}, + {L"BODY", HTMLBodyElement_Create}, + {L"BR", HTMLElement_Ctor}, + {L"BUTTON", HTMLButtonElement_Create}, + {L"CANVAS", HTMLElement_Ctor}, + {L"CAPTION", HTMLElement_Ctor}, + {L"CENTER", HTMLElement_Ctor}, + {L"CITE", HTMLElement_Ctor}, + {L"CODE", HTMLElement_Ctor}, + {L"COL", HTMLElement_Ctor}, + {L"COLGROUP", HTMLElement_Ctor}, + {L"DATALIST", HTMLElement_Ctor}, + {L"DD", HTMLElement_Ctor}, + {L"DEL", HTMLElement_Ctor}, + {L"DFN", HTMLElement_Ctor}, + {L"DIR", HTMLElement_Ctor}, + {L"DIV", HTMLElement_Ctor}, + {L"DL", HTMLElement_Ctor}, + {L"DT", HTMLElement_Ctor}, + {L"EM", HTMLElement_Ctor}, + {L"EMBED", HTMLEmbedElement_Create}, + {L"FIELDSET", HTMLElement_Ctor}, + {L"FIGCAPTION", HTMLElement_Ctor}, + {L"FIGURE", HTMLElement_Ctor}, + {L"FONT", HTMLElement_Ctor}, + {L"FOOTER", HTMLElement_Ctor}, + {L"FORM", HTMLFormElement_Create}, + {L"FRAME", HTMLFrameElement_Create}, + {L"FRAMESET", HTMLElement_Ctor}, + {L"H1", HTMLElement_Ctor}, + {L"H2", HTMLElement_Ctor}, + {L"H3", HTMLElement_Ctor}, + {L"H4", HTMLElement_Ctor}, + {L"H5", HTMLElement_Ctor}, + {L"H6", HTMLElement_Ctor}, + {L"HEAD", HTMLHeadElement_Create}, + {L"HEADER", HTMLElement_Ctor}, + {L"HR", HTMLElement_Ctor}, + {L"HTML", HTMLHtmlElement_Create}, + {L"I", HTMLElement_Ctor}, + {L"IFRAME", HTMLIFrame_Create}, + {L"IMG", HTMLImgElement_Create}, + {L"INPUT", HTMLInputElement_Create}, + {L"INS", HTMLElement_Ctor}, + {L"KBD", HTMLElement_Ctor}, + {L"LABEL", HTMLLabelElement_Create}, + {L"LEGEND", HTMLElement_Ctor}, + {L"LI", HTMLElement_Ctor}, + {L"LINK", HTMLLinkElement_Create}, + {L"MAP", HTMLElement_Ctor}, + {L"MARK", HTMLElement_Ctor}, + {L"META", HTMLMetaElement_Create}, + {L"NAV", HTMLElement_Ctor}, + {L"NOFRAMES", HTMLElement_Ctor}, + {L"NOSCRIPT", HTMLElement_Ctor}, + {L"OBJECT", HTMLObjectElement_Create}, + {L"OL", HTMLElement_Ctor}, + {L"OPTGROUP", HTMLElement_Ctor}, + {L"OPTION", HTMLOptionElement_Create}, + {L"P", HTMLElement_Ctor}, + {L"PARAM", HTMLElement_Ctor}, + {L"PRE", HTMLElement_Ctor}, + {L"PROGRESS", HTMLElement_Ctor}, + {L"Q", HTMLElement_Ctor}, + {L"RP", HTMLElement_Ctor}, + {L"RT", HTMLElement_Ctor}, + {L"RUBY", HTMLElement_Ctor}, + {L"S", HTMLElement_Ctor}, + {L"SAMP", HTMLElement_Ctor}, + {L"SCRIPT", HTMLScriptElement_Create}, + {L"SECTION", HTMLElement_Ctor}, + {L"SELECT", HTMLSelectElement_Create}, + {L"SMALL", HTMLElement_Ctor}, + {L"SOURCE", HTMLElement_Ctor}, + {L"SPAN", HTMLElement_Ctor}, + {L"STRIKE", HTMLElement_Ctor}, + {L"STRONG", HTMLElement_Ctor}, + {L"STYLE", HTMLStyleElement_Create}, + {L"SUB", HTMLElement_Ctor}, + {L"SUP", HTMLElement_Ctor}, + {L"TABLE", HTMLTable_Create}, + {L"TBODY", HTMLElement_Ctor}, + {L"TD", HTMLTableCell_Create}, + {L"TEXTAREA", HTMLTextAreaElement_Create}, + {L"TFOOT", HTMLElement_Ctor}, + {L"TH", HTMLElement_Ctor}, + {L"THEAD", HTMLElement_Ctor}, + {L"TITLE", HTMLTitleElement_Create}, + {L"TR", HTMLTableRow_Create}, + {L"TRACK", HTMLElement_Ctor}, + {L"TT", HTMLElement_Ctor}, + {L"U", HTMLElement_Ctor}, + {L"UL", HTMLElement_Ctor}, + {L"VAR", HTMLElement_Ctor}, + {L"VIDEO", HTMLElement_Ctor}, + {L"WBR", HTMLElement_Ctor} };
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_Ctor(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..ec486e1 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -19,6 +19,160 @@ 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.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,
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=99654
Your paranoid android.
=== w8adm (32 bit report) ===
mshtml: events.c:1089: Test failed: unexpected call img_onerror events: Timeout
=== w7u_adm (32 bit report) ===
mshtml: script.c:624: Test failed: L"/index.html?es5.js:date_now: unexpected Date.now() result 1633623616746 expected 1633623616808"
Signed-off-by: Jacek Caban jacek@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/tests/documentmode.js | 76 +++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+)
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index ec486e1..3396267 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -171,6 +171,82 @@ 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"); + + var currentStyle = e.currentStyle; + if(!currentStyle) win_skip("currentStyle 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); + } + if(!localStorage) win_skip("localStorage is buggy and not available, skipping"); + + 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"); + if(currentStyle) test("currentStyle", currentStyle, "MSCurrentStyleCSSProperties"); + test("history", window.history, "History"); + test("implementation", document.implementation, "DOMImplementation"); + if(localStorage) 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=99655
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: Jacek Caban jacek@codeweavers.com
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 3396267..a392ae4 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=99656
Your paranoid android.
=== w7u_adm (32 bit report) ===
mshtml: script.c:624: Test failed: L"/index.html?es5.js:date_now: unexpected Date.now() result 1633630425608 expected 1633630425671"
Signed-off-by: Jacek Caban jacek@codeweavers.com
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 a392ae4..cf0d7bf 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"); if(currentStyle) test("currentStyle", currentStyle, "MSCurrentStyleCSSProperties"); + test("elements", document.getElementsByTagName("body"), "HTMLCollection"); test("history", window.history, "History"); test("implementation", document.implementation, "DOMImplementation"); if(localStorage) test("localStorage", localStorage, "Storage");
Signed-off-by: Jacek Caban jacek@codeweavers.com
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=99657
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
=== w10pro64_he (64 bit report) ===
mshtml: htmldoc.c:2541: Test failed: unexpected call UpdateUI htmldoc.c:2853: Test failed: unexpected call Exec_UPDATECOMMANDS
=== w7u_adm (32 bit report) ===
mshtml: script.c:624: Test failed: L"/index.html?es5.js:date_now: unexpected Date.now() result 1633630541564 expected 1633630541626"
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 cf0d7bf..91e50c7 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");
Signed-off-by: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com
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=99658
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
=== w1064_tsign (64 bit report) ===
mshtml: htmldoc.c:2541: Test failed: unexpected call UpdateUI htmldoc.c:2853: Test failed: unexpected call Exec_UPDATECOMMANDS
=== w7u_adm (32 bit report) ===
mshtml: script.c:624: Test failed: L"/index.html?es5.js:date_now: unexpected Date.now() result 1633637117535 expected 1633637117598"
=== w7u_el (32 bit report) ===
mshtml: script.c:624: Test failed: L"/index.html?es5.js:date_now: unexpected Date.now() result 1633637005699 expected 1633637005762"
=== debiant2 (32 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 91e50c7..c336472 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");
Signed-off-by: Jacek Caban jacek@codeweavers.com
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=99659
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
=== 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
=== w7u_adm (32 bit report) ===
mshtml: script.c:624: Test failed: L"/index.html?es5.js:date_now: unexpected Date.now() result 1633637226722 expected 1633637226801"
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 c336472..d3d36ee 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); });
Signed-off-by: Jacek Caban jacek@codeweavers.com
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=99660
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
=== w7u_adm (32 bit report) ===
mshtml: script.c:624: Test failed: L"/index.html?es5.js:date_now: unexpected Date.now() result 1633643806369 expected 1633643806432"
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 d3d36ee..db3e566 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -216,6 +216,7 @@ sync_test("builtin_toString", function() { if(localStorage) 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");
Signed-off-by: Jacek Caban jacek@codeweavers.com
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=99661
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/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 db3e566..0194ee1 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");
Signed-off-by: Jacek Caban jacek@codeweavers.com
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=99662
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/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 0194ee1..2c11744 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");
Signed-off-by: Jacek Caban jacek@codeweavers.com
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=99663
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/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 2c11744..0d1dc51 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"); if(currentStyle) test("currentStyle", 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 Gabriel,
On 10/7/21 3:52 PM, Gabriel Ivăncescu wrote:
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;
}
I think it would be good to try harder to avoid this. I'm not sure if those differences are something we need to worry now, but this callback should not really be needed. If we need this, then we could use separated dispex descriptors for different document modes (but I'm not sure it's worth it, using IE11 names seems good enough).
Thanks,
Jacek
On 07/10/2021 22:13, Jacek Caban wrote:
Hi Gabriel,
On 10/7/21 3:52 PM, Gabriel Ivăncescu wrote:
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; + }
I think it would be good to try harder to avoid this. I'm not sure if those differences are something we need to worry now, but this callback should not really be needed. If we need this, then we could use separated dispex descriptors for different document modes (but I'm not sure it's worth it, using IE11 names seems good enough).
Thanks,
Jacek
Yeah but then I wouldn't be able to test it. I also had an idea to encode multiple names in the string itself (see attached diff), but I'm guessing that's too much of a hack?
If not, I'll have to skip the tests though, right? Or should I use separate dispex descriptors?
On 10/8/21 1:38 PM, Gabriel Ivăncescu wrote:
Yeah but then I wouldn't be able to test it. I also had an idea to encode multiple names in the string itself (see attached diff), but I'm guessing that's too much of a hack?
Yeah.
If not, I'll have to skip the tests though, right?
Sure, you can skip them in some modes or use todo_wine.
Or should I use separate dispex descriptors?
I'd defer that until we have a real reason.
Thanks,
Jacek
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=99664
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 | 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 0d1dc51..6c5387f 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"); if(localStorage) 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=99665
Your paranoid android.
=== w7u_el (32 bit report) ===
mshtml: script.c:624: Test failed: L"/index.html?es5.js:date_now: unexpected Date.now() result 1633660290947 expected 1633660291010"
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 6c5387f..7346633 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=99666
Your paranoid android.
=== w8 (32 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
=== 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_el (32 bit report) ===
mshtml: script.c:624: Test failed: L"/index.html?es5.js:date_now: unexpected Date.now() result 1633663125448 expected 1633663125512"