Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/omnavigator.c | 9 ++++++++- dlls/mshtml/tests/documentmode.js | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 9962cc2..4385c4c 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -299,6 +299,12 @@ static const IHTMLDOMImplementation2Vtbl HTMLDOMImplementation2Vtbl = { HTMLDOMImplementation2_hasFeature };
+static void HTMLDOMImplementation_init_dispex_info(dispex_data_t *info, compat_mode_t compat_mode) +{ + if(compat_mode >= COMPAT_MODE_IE9) + dispex_info_add_interface(info, IHTMLDOMImplementation2_tid, NULL); +} + static const tid_t HTMLDOMImplementation_iface_tids[] = { IHTMLDOMImplementation_tid, 0 @@ -307,7 +313,8 @@ static dispex_static_data_t HTMLDOMImplementation_dispex = { L"DOMImplementation", NULL, DispHTMLDOMImplementation_tid, - HTMLDOMImplementation_iface_tids + HTMLDOMImplementation_iface_tids, + HTMLDOMImplementation_init_dispex_info };
HRESULT create_dom_implementation(HTMLDocumentNode *doc_node, IHTMLDOMImplementation **ret) diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 74e871e..eeeb1c8 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -364,6 +364,23 @@ sync_test("window_props", function() { test_exposed("console", v >= 10); });
+sync_test("domimpl_props", function() { + var domimpl = document.implementation; + function test_exposed(prop, expect) { + if(expect) + ok(prop in domimpl, prop + " not found in DOMImplementation."); + else + ok(!(prop in domimpl), prop + " found in DOMImplementation."); + } + + var v = document.documentMode; + + test_exposed("hasFeature", true); + test_exposed("createDocument", v >= 9); + test_exposed("createDocumentType", v >= 9); + test_exposed("createHTMLDocument", v >= 9); +}); + sync_test("xhr_props", function() { var xhr = new XMLHttpRequest();
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlattr.c | 6 ++++-- dlls/mshtml/tests/dom.c | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlattr.c b/dlls/mshtml/htmlattr.c index 7365b9e..82ded4d 100644 --- a/dlls/mshtml/htmlattr.c +++ b/dlls/mshtml/htmlattr.c @@ -285,8 +285,10 @@ static HRESULT WINAPI HTMLDOMAttribute2_Invoke(IHTMLDOMAttribute2 *iface, DISPID static HRESULT WINAPI HTMLDOMAttribute2_get_name(IHTMLDOMAttribute2 *iface, BSTR *p) { HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute2(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + return IHTMLDOMAttribute_get_nodeName(&This->IHTMLDOMAttribute_iface, p); }
static HRESULT WINAPI HTMLDOMAttribute2_put_value(IHTMLDOMAttribute2 *iface, BSTR v) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 1b1e677..8f78c8d 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -3614,6 +3614,7 @@ static void test_dynamic_properties(IHTMLElement *elem) #define test_attr_node_name(a,b) _test_attr_node_name(__LINE__,a,b) static void _test_attr_node_name(unsigned line, IHTMLDOMAttribute *attr, const WCHAR *exname) { + IHTMLDOMAttribute2 *attr2 = _get_attr2_iface(line, (IUnknown*)attr); BSTR str; HRESULT hres;
@@ -3621,6 +3622,13 @@ static void _test_attr_node_name(unsigned line, IHTMLDOMAttribute *attr, const W ok_(__FILE__,line)(hres == S_OK, "get_nodeName failed: %08lx\n", hres); ok_(__FILE__,line)(!lstrcmpW(str, exname), "node name is %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(exname)); SysFreeString(str); + + hres = IHTMLDOMAttribute2_get_name(attr2, &str); + ok_(__FILE__,line)(hres == S_OK, "get_name failed: %08lx\n", hres); + ok_(__FILE__,line)(!lstrcmpW(str, exname), "name is %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(exname)); + SysFreeString(str); + + IHTMLDOMAttribute2_Release(attr2); }
#define test_attr_parent(a) _test_attr_parent(__LINE__,a)
Signed-off-by: Jacek Caban jacek@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlwindow.c | 15 +++++++++++++++ dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/mshtml_private_iface.idl | 4 +++- dlls/mshtml/task.c | 23 ++++++++++++++++++++++- dlls/mshtml/tests/documentmode.js | 1 + dlls/mshtml/tests/dom.js | 10 +++++++++- 6 files changed, 51 insertions(+), 3 deletions(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index ecd530d..235e29a 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3152,6 +3152,20 @@ static HRESULT WINAPI window_private_requestAnimationFrame(IWineHTMLWindowPrivat return hres; }
+static HRESULT WINAPI window_private_cancelAnimationFrame(IWineHTMLWindowPrivate *iface, VARIANT timer_id) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowPrivateVtbl(iface); + HRESULT hres; + + TRACE("iface %p, timer_id %s\n", iface, debugstr_variant(&timer_id)); + + hres = VariantChangeType(&timer_id, &timer_id, 0, VT_I4); + if(SUCCEEDED(hres)) + clear_animation_timer(This->inner_window, V_I4(&timer_id)); + + return S_OK; +} + static HRESULT WINAPI window_private_get_console(IWineHTMLWindowPrivate *iface, IDispatch **console) { HTMLWindow *This = impl_from_IWineHTMLWindowPrivateVtbl(iface); @@ -3176,6 +3190,7 @@ static const IWineHTMLWindowPrivateVtbl WineHTMLWindowPrivateVtbl = { window_private_GetIDsOfNames, window_private_Invoke, window_private_requestAnimationFrame, + window_private_cancelAnimationFrame, window_private_get_console, };
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index a94f1be..930ab3b 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1247,6 +1247,7 @@ enum timer_type {
HRESULT set_task_timer(HTMLInnerWindow*,LONG,enum timer_type,IDispatch*,LONG*) DECLSPEC_HIDDEN; HRESULT clear_task_timer(HTMLInnerWindow*,DWORD) DECLSPEC_HIDDEN; +HRESULT clear_animation_timer(HTMLInnerWindow*,DWORD) DECLSPEC_HIDDEN;
BOOL parse_compat_version(const WCHAR*,compat_mode_t*) DECLSPEC_HIDDEN;
diff --git a/dlls/mshtml/mshtml_private_iface.idl b/dlls/mshtml/mshtml_private_iface.idl index b9039c9..a273e33 100644 --- a/dlls/mshtml/mshtml_private_iface.idl +++ b/dlls/mshtml/mshtml_private_iface.idl @@ -87,7 +87,9 @@ interface IWineHTMLWindowPrivate : IDispatch { [id(50)] HRESULT requestAnimationFrame([in] VARIANT *expr, [retval, out] VARIANT *timer_id); - [propget, id(51)] + [id(51)] + HRESULT cancelAnimationFrame([in] VARIANT timer_id); + [propget, id(52)] HRESULT console([retval, out] IDispatch **console); }
diff --git a/dlls/mshtml/task.c b/dlls/mshtml/task.c index 088742e..1bb761e 100644 --- a/dlls/mshtml/task.c +++ b/dlls/mshtml/task.c @@ -208,7 +208,8 @@ HRESULT clear_task_timer(HTMLInnerWindow *window, DWORD id)
LIST_FOR_EACH_ENTRY(iter, &thread_data->timer_list, task_timer_t, entry) { if(iter->id == id && iter->window == window) { - release_task_timer(thread_data->thread_hwnd, iter); + if(iter->type != TIMER_ANIMATION_FRAME) + release_task_timer(thread_data->thread_hwnd, iter); return S_OK; } } @@ -217,6 +218,26 @@ HRESULT clear_task_timer(HTMLInnerWindow *window, DWORD id) return S_OK; }
+HRESULT clear_animation_timer(HTMLInnerWindow *window, DWORD id) +{ + thread_data_t *thread_data = get_thread_data(FALSE); + task_timer_t *iter; + + if(!thread_data) + return S_OK; + + LIST_FOR_EACH_ENTRY(iter, &thread_data->timer_list, task_timer_t, entry) { + if(iter->id == id && iter->window == window) { + if(iter->type == TIMER_ANIMATION_FRAME) + release_task_timer(thread_data->thread_hwnd, iter); + return S_OK; + } + } + + WARN("timer not found\n"); + return S_OK; +} + static const char *debugstr_timer_type(enum timer_type type) { switch(type) { diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index eeeb1c8..5f10447 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -357,6 +357,7 @@ sync_test("window_props", function() { test_exposed("getSelection", v >= 9); test_exposed("onfocusout", v >= 9); test_exposed("getComputedStyle", v >= 9); + test_exposed("cancelAnimationFrame", v >= 10); test_exposed("requestAnimationFrame", v >= 10); test_exposed("Map", v >= 11); test_exposed("Set", v >= 11); diff --git a/dlls/mshtml/tests/dom.js b/dlls/mshtml/tests/dom.js index ed5f72c..3939dd9 100644 --- a/dlls/mshtml/tests/dom.js +++ b/dlls/mshtml/tests/dom.js @@ -494,13 +494,21 @@ sync_test("elem_props", function() { });
async_test("animation_frame", function() { - var id = requestAnimationFrame(function(x) { + var id = requestAnimationFrame(function(x) { ok(false, "request was supposed to be cancelled"); }); + id = cancelAnimationFrame(id); + ok(id === undefined, "cancelAnimationFrame returned " + id); + + id = requestAnimationFrame(function(x) { ok(this === window, "this != window"); ok(typeof(x) === "number", "x = " + x); ok(arguments.length === 1, "arguments.length = " + arguments.length); next_test(); }); + cancelAnimationFrame(0); + clearInterval(id); + clearTimeout(id); ok(typeof(id) === "number", "id = " + id); + ok(id !== 0, "id = 0"); });
sync_test("title", 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=115107
Your paranoid android.
=== w8adm (32 bit report) ===
mshtml: events.c:1089: Test failed: unexpected call img_onerror events: Timeout
=== 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
=== w10pro64 (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
=== w10pro64_zh_CN (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:644: Test failed: L"/index.html?es5.js:date_now: unexpected Date.now() result 1652989468933 expected 1652989468996"
=== w7u_el (32 bit report) ===
mshtml: script.c:644: Test failed: L"/index.html?es5.js:date_now: unexpected Date.now() result 1652989569850 expected 1652989569901"
Signed-off-by: Jacek Caban jacek@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
FFXIV Launcher spams clearing zero id for some reason, and I was not sure if it cleared all timers on native or not. Having a test seems handy.
dlls/mshtml/tests/events.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c index 4ceee79..95ed071 100644 --- a/dlls/mshtml/tests/events.c +++ b/dlls/mshtml/tests/events.c @@ -2550,6 +2550,9 @@ static void test_timeout(IHTMLDocument2 *doc) ok(hres == S_OK, "setTimeout failed: %08lx\n", hres); ok(id, "id = 0\n");
+ hres = IHTMLWindow2_clearTimeout(window, 0); + ok(hres == S_OK, "clearTimeout failed: %08lx\n", hres); + SET_EXPECT(timeout); pump_msgs(&called_timeout); CHECK_CALLED(timeout); @@ -2581,6 +2584,13 @@ static void test_timeout(IHTMLDocument2 *doc) pump_msgs(&called_timeout); CHECK_CALLED(timeout);
+ hres = IHTMLWindow2_clearInterval(window, 0); + ok(hres == S_OK, "clearInterval failed: %08lx\n", hres); + + SET_EXPECT(timeout); + pump_msgs(&called_timeout); + CHECK_CALLED(timeout); + hres = IHTMLWindow2_clearInterval(window, id); ok(hres == S_OK, "clearTimeout failer: %08lx\n", hres);
Signed-off-by: Jacek Caban jacek@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/tests/xmlhttprequest.c | 21 +++++++++++++-------- dlls/mshtml/xmlhttprequest.c | 8 ++++++-- 2 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/dlls/mshtml/tests/xmlhttprequest.c b/dlls/mshtml/tests/xmlhttprequest.c index 0db5cb9..868035d 100644 --- a/dlls/mshtml/tests/xmlhttprequest.c +++ b/dlls/mshtml/tests/xmlhttprequest.c @@ -522,16 +522,21 @@ static void test_responseXML(const WCHAR *expect_text) IDispatch_Release(disp); }
-#define xhr_open(a,b) _xhr_open(__LINE__,a,b) -static HRESULT _xhr_open(unsigned line, const WCHAR *url_w, const WCHAR *method_w) +#define xhr_open(a,b,c) _xhr_open(__LINE__,a,b,c) +static HRESULT _xhr_open(unsigned line, const WCHAR *url_w, const WCHAR *method_w, BOOL use_bool) { BSTR method = SysAllocString(method_w); BSTR url = SysAllocString(url_w); VARIANT async, empty; HRESULT hres;
- V_VT(&async) = VT_BOOL; - V_BOOL(&async) = VARIANT_TRUE; + if(use_bool) { + V_VT(&async) = VT_BOOL; + V_BOOL(&async) = VARIANT_TRUE; + }else { + V_VT(&async) = VT_I4; + V_I4(&async) = 1; + } V_VT(&empty) = VT_EMPTY;
hres = IHTMLXMLHttpRequest_open(xhr, method, url, async, empty, empty); @@ -787,7 +792,7 @@ static void test_async_xhr(IHTMLDocument2 *doc, const WCHAR *xml_url, const WCHA ok(val == 0, "Expect UNSENT, got %ld\n", val);
SET_EXPECT(xmlhttprequest_onreadystatechange_opened); - hres = xhr_open(xml_url, L"GET"); + hres = xhr_open(xml_url, L"GET", TRUE); CHECK_CALLED(xmlhttprequest_onreadystatechange_opened);
if(FAILED(hres)) { @@ -898,7 +903,7 @@ static void test_async_xhr_abort(IHTMLDocument2 *doc, const WCHAR *xml_url) hres = IHTMLXMLHttpRequest_put_onreadystatechange(xhr, var);
SET_EXPECT(xmlhttprequest_onreadystatechange_opened); - xhr_open(xml_url, L"GET"); + xhr_open(xml_url, L"GET", TRUE); CHECK_CALLED(xmlhttprequest_onreadystatechange_opened);
hres = IHTMLXMLHttpRequest_abort(xhr); @@ -922,7 +927,7 @@ static void test_async_xhr_abort(IHTMLDocument2 *doc, const WCHAR *xml_url) hres = IHTMLXMLHttpRequest_put_onreadystatechange(xhr, var);
SET_EXPECT(xmlhttprequest_onreadystatechange_opened); - xhr_open(xml_url, L"GET"); + xhr_open(xml_url, L"GET", FALSE); CHECK_CALLED(xmlhttprequest_onreadystatechange_opened);
loading_cnt = 0; @@ -969,7 +974,7 @@ static void test_xhr_post(IHTMLDocument2 *doc) ok(hres == S_OK, "put_onreadystatechange failed: %08lx\n", hres);
SET_EXPECT(xmlhttprequest_onreadystatechange_opened); - xhr_open(L"http://test.winehq.org/tests/post.php", L"POST"); + xhr_open(L"http://test.winehq.org/tests/post.php", L"POST", FALSE); CHECK_CALLED(xmlhttprequest_onreadystatechange_opened);
set_request_header(xhr, L"Content-Type", L"application/x-www-form-urlencoded"); diff --git a/dlls/mshtml/xmlhttprequest.c b/dlls/mshtml/xmlhttprequest.c index 0ae69df..1721959 100644 --- a/dlls/mshtml/xmlhttprequest.c +++ b/dlls/mshtml/xmlhttprequest.c @@ -508,8 +508,12 @@ static HRESULT WINAPI HTMLXMLHttpRequest_open(IHTMLXMLHttpRequest *iface, BSTR b TRACE("(%p)->(%s %s %s %s %s)\n", This, debugstr_w(bstrMethod), debugstr_w(bstrUrl), debugstr_variant(&varAsync), debugstr_variant(&varUser), debugstr_variant(&varPassword));
if(V_VT(&varAsync) != VT_BOOL) { - FIXME("varAsync not supported: %s\n", debugstr_variant(&varAsync)); - return E_FAIL; + LCID lcid = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); + hres = VariantChangeTypeEx(&varAsync, &varAsync, lcid, 0, VT_BOOL); + if(FAILED(hres)) { + WARN("Failed to convert varAsync to BOOL: %#lx\n", hres); + return hres; + } }
/* Note: Starting with Gecko 30.0 (Firefox 30.0 / Thunderbird 30.0 / SeaMonkey 2.27),
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=115105
Your paranoid android.
=== w10pro64 (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
=== w10pro64 (64 bit report) ===
mshtml: htmldoc.c:2541: Test failed: unexpected call UpdateUI htmldoc.c:2853: Test failed: unexpected call Exec_UPDATECOMMANDS
=== w10pro64_ar (testbot log) ===
WineRunTask.pl:error: The previous 1 run(s) terminated abnormally