Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/mshtml/dispex.c | 1 - dlls/mshtml/htmlanchor.c | 1 - dlls/mshtml/htmlarea.c | 1 - dlls/mshtml/htmlattr.c | 1 - dlls/mshtml/htmlbody.c | 1 - dlls/mshtml/htmlcurstyle.c | 1 - dlls/mshtml/htmldoc.c | 1 - dlls/mshtml/htmlelem.c | 1 - dlls/mshtml/htmlelemcol.c | 1 - dlls/mshtml/htmlevent.c | 1 - dlls/mshtml/htmlform.c | 1 - dlls/mshtml/htmlframe.c | 1 - dlls/mshtml/htmlimg.c | 1 - dlls/mshtml/htmlinput.c | 1 - dlls/mshtml/htmllink.c | 1 - dlls/mshtml/htmlnode.c | 1 - dlls/mshtml/htmlobject.c | 1 - dlls/mshtml/htmlscript.c | 1 - dlls/mshtml/htmlselect.c | 1 - dlls/mshtml/htmlstyle.c | 1 - dlls/mshtml/htmlstyleelem.c | 1 - dlls/mshtml/htmlstylesheet.c | 1 - dlls/mshtml/htmltable.c | 1 - dlls/mshtml/htmltextarea.c | 1 - dlls/mshtml/htmltextnode.c | 1 - dlls/mshtml/htmlwindow.c | 1 - dlls/mshtml/mshtml_private.h | 2 ++ dlls/mshtml/mutation.c | 1 - dlls/mshtml/navigate.c | 1 - dlls/mshtml/nsembed.c | 1 - dlls/mshtml/nsevents.c | 1 - dlls/mshtml/nsio.c | 1 - dlls/mshtml/oleobj.c | 1 - dlls/mshtml/omnavigator.c | 1 - dlls/mshtml/pluginhost.c | 1 - dlls/mshtml/range.c | 1 - dlls/mshtml/script.c | 1 - dlls/mshtml/secmgr.c | 1 - dlls/mshtml/svg.c | 1 - dlls/mshtml/task.c | 1 - dlls/mshtml/xmlhttprequest.c | 1 - 41 files changed, 2 insertions(+), 40 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 39630590228..6d248691d6b 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS #define NONAMELESSUNION diff --git a/dlls/mshtml/htmlanchor.c b/dlls/mshtml/htmlanchor.c index a0e96af822e..da48601fe87 100644 --- a/dlls/mshtml/htmlanchor.c +++ b/dlls/mshtml/htmlanchor.c @@ -18,7 +18,6 @@
#include <stdarg.h> #include <stdio.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmlarea.c b/dlls/mshtml/htmlarea.c index a5ebfe757ae..a0708c4b062 100644 --- a/dlls/mshtml/htmlarea.c +++ b/dlls/mshtml/htmlarea.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmlattr.c b/dlls/mshtml/htmlattr.c index 14b79812eb0..dc8c45e488a 100644 --- a/dlls/mshtml/htmlattr.c +++ b/dlls/mshtml/htmlattr.c @@ -18,7 +18,6 @@
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c index 9955a8e6498..32c49fe1214 100644 --- a/dlls/mshtml/htmlbody.c +++ b/dlls/mshtml/htmlbody.c @@ -18,7 +18,6 @@
#include <stdarg.h> #include <stdio.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmlcurstyle.c b/dlls/mshtml/htmlcurstyle.c index 85ac99aef92..2abe5df30ec 100644 --- a/dlls/mshtml/htmlcurstyle.c +++ b/dlls/mshtml/htmlcurstyle.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 79241fc34cc..9faf987d7b9 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -18,7 +18,6 @@
#include <stdarg.h> #include <stdio.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 8187cbf867e..b9677ec867a 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h> #include <math.h>
#define COBJMACROS diff --git a/dlls/mshtml/htmlelemcol.c b/dlls/mshtml/htmlelemcol.c index f4722d96729..e72f21ffaa5 100644 --- a/dlls/mshtml/htmlelemcol.c +++ b/dlls/mshtml/htmlelemcol.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index b3b95083f80..17f5fb35b71 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmlform.c b/dlls/mshtml/htmlform.c index 5906202f1c7..5d0928e4a9c 100644 --- a/dlls/mshtml/htmlform.c +++ b/dlls/mshtml/htmlform.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmlframe.c b/dlls/mshtml/htmlframe.c index 972ddc80a50..7118ea86b57 100644 --- a/dlls/mshtml/htmlframe.c +++ b/dlls/mshtml/htmlframe.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c index 2dfd53eb0b9..f89e8e5ae84 100644 --- a/dlls/mshtml/htmlimg.c +++ b/dlls/mshtml/htmlimg.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmlinput.c b/dlls/mshtml/htmlinput.c index 2ba5833f3c0..1a0a739d5d5 100644 --- a/dlls/mshtml/htmlinput.c +++ b/dlls/mshtml/htmlinput.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h> #include <limits.h>
#define COBJMACROS diff --git a/dlls/mshtml/htmllink.c b/dlls/mshtml/htmllink.c index 22342027cbc..ddf67ca0f73 100644 --- a/dlls/mshtml/htmllink.c +++ b/dlls/mshtml/htmllink.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index a2692b1a230..b5ff02bcee2 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmlobject.c b/dlls/mshtml/htmlobject.c index b71b0e7db6f..67025489751 100644 --- a/dlls/mshtml/htmlobject.c +++ b/dlls/mshtml/htmlobject.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmlscript.c b/dlls/mshtml/htmlscript.c index 4d7997e31a6..9b7f95e3bb0 100644 --- a/dlls/mshtml/htmlscript.c +++ b/dlls/mshtml/htmlscript.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c index 301d9fa5dc3..ad801f8433b 100644 --- a/dlls/mshtml/htmlselect.c +++ b/dlls/mshtml/htmlselect.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index c4bd3a84867..4ee81ba7e99 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h> #include <math.h>
#define COBJMACROS diff --git a/dlls/mshtml/htmlstyleelem.c b/dlls/mshtml/htmlstyleelem.c index 538e79f0b5e..d2a4a75fe90 100644 --- a/dlls/mshtml/htmlstyleelem.c +++ b/dlls/mshtml/htmlstyleelem.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmlstylesheet.c b/dlls/mshtml/htmlstylesheet.c index 243aea2e618..4519b06155e 100644 --- a/dlls/mshtml/htmlstylesheet.c +++ b/dlls/mshtml/htmlstylesheet.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmltable.c b/dlls/mshtml/htmltable.c index ad74ad30966..178e9e52304 100644 --- a/dlls/mshtml/htmltable.c +++ b/dlls/mshtml/htmltable.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmltextarea.c b/dlls/mshtml/htmltextarea.c index fb8c3830862..57f33732a01 100644 --- a/dlls/mshtml/htmltextarea.c +++ b/dlls/mshtml/htmltextarea.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmltextnode.c b/dlls/mshtml/htmltextnode.c index c2e7f375ada..56a0572459a 100644 --- a/dlls/mshtml/htmltextnode.c +++ b/dlls/mshtml/htmltextnode.c @@ -18,7 +18,6 @@
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 0ca4cd6397e..4196d1f45ad 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 7bc645e549f..e3486aa3314 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -40,6 +40,8 @@
#include "nsiface.h"
+#include <assert.h> + #define NS_ERROR_GENERATE_FAILURE(module,code) \ ((nsresult) (((UINT32)(1u<<31)) | ((UINT32)(module+0x45)<<16) | ((UINT32)(code)))) #define NS_ERROR_GENERATE_SUCCESS(module,code) \ diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c index 247a3277927..abe403ea976 100644 --- a/dlls/mshtml/mutation.c +++ b/dlls/mshtml/mutation.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index 233f58c89fd..8cbe0ec9304 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS #define NONAMELESSUNION diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index d4fe7e96fc2..ae94f224fac 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c index b060ae521c5..21908b09563 100644 --- a/dlls/mshtml/nsevents.c +++ b/dlls/mshtml/nsevents.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index ea8eae2007d..abf05aaa41b 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index fb3ff8a8b73..c7ce641a949 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -18,7 +18,6 @@
#include <stdarg.h> #include <stdio.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 43067b813a1..a8f829b6a57 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/pluginhost.c b/dlls/mshtml/pluginhost.c index d880cc89a9d..ad67db5548c 100644 --- a/dlls/mshtml/pluginhost.c +++ b/dlls/mshtml/pluginhost.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/range.c b/dlls/mshtml/range.c index 8c802ee9ede..89f68046a33 100644 --- a/dlls/mshtml/range.c +++ b/dlls/mshtml/range.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/script.c b/dlls/mshtml/script.c index 8f7f502e121..28e07a50c8e 100644 --- a/dlls/mshtml/script.c +++ b/dlls/mshtml/script.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/secmgr.c b/dlls/mshtml/secmgr.c index 019327caa47..a72099f33b9 100644 --- a/dlls/mshtml/secmgr.c +++ b/dlls/mshtml/secmgr.c @@ -18,7 +18,6 @@
#include <stdarg.h> #include <stdio.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/svg.c b/dlls/mshtml/svg.c index e1de57fc4b1..75036cb39d6 100644 --- a/dlls/mshtml/svg.c +++ b/dlls/mshtml/svg.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h> #include <math.h>
#define COBJMACROS diff --git a/dlls/mshtml/task.c b/dlls/mshtml/task.c index 28cb88ab5f1..67b7633a5b4 100644 --- a/dlls/mshtml/task.c +++ b/dlls/mshtml/task.c @@ -18,7 +18,6 @@
#include <stdarg.h> #include <stdio.h> -#include <assert.h>
#define COBJMACROS
diff --git a/dlls/mshtml/xmlhttprequest.c b/dlls/mshtml/xmlhttprequest.c index 814162acbbc..d7d8ce51593 100644 --- a/dlls/mshtml/xmlhttprequest.c +++ b/dlls/mshtml/xmlhttprequest.c @@ -17,7 +17,6 @@ */
#include <stdarg.h> -#include <assert.h>
#define COBJMACROS
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- v4: - remove redundant includes.
dlls/mshtml/Makefile.in | 1 + dlls/mshtml/mshtml.rc | 3 +++ dlls/mshtml/mshtml_private.h | 2 ++ dlls/mshtml/mshtml_private_iface.idl | 28 ++++++++++++++++++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 dlls/mshtml/mshtml_private_iface.idl
diff --git a/dlls/mshtml/Makefile.in b/dlls/mshtml/Makefile.in index 469667081e3..ce7ddb40bde 100644 --- a/dlls/mshtml/Makefile.in +++ b/dlls/mshtml/Makefile.in @@ -71,4 +71,5 @@ RC_SRCS = mshtml.rc
IDL_SRCS = \ mshtml_classes.idl \ + mshtml_private_iface.idl \ nsiface.idl diff --git a/dlls/mshtml/mshtml.rc b/dlls/mshtml/mshtml.rc index 22926e1643e..156e1ad734d 100644 --- a/dlls/mshtml/mshtml.rc +++ b/dlls/mshtml/mshtml.rc @@ -74,3 +74,6 @@ REGINST REGINST mshtml.inf
/* @makedep: blank.htm */ blank.htm HTML "blank.htm" + +/* @makedep: mshtml_private_iface.tlb */ +1 TYPELIB mshtml_private_iface.tlb diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index e3486aa3314..6228cf1298d 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -40,6 +40,8 @@
#include "nsiface.h"
+#include "mshtml_private_iface.h" + #include <assert.h>
#define NS_ERROR_GENERATE_FAILURE(module,code) \ diff --git a/dlls/mshtml/mshtml_private_iface.idl b/dlls/mshtml/mshtml_private_iface.idl new file mode 100644 index 00000000000..5a01c6c1b27 --- /dev/null +++ b/dlls/mshtml/mshtml_private_iface.idl @@ -0,0 +1,28 @@ +/* + * Copyright 2021 Paul Gofman for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep typelib + +[ + version(1.0), + hidden, + uuid(90de541e-380b-4530-94a9-97367fe49d8d) +] +library MSHTML_private +{ +} /* library MSHTML_private */
Signed-off-by: Jacek Caban jacek@codeweavers.com
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- v4: - split off the private interface creation and put requestAnimationFrame there; - use GetModuleFileName() instead of hardcoding "mshtml.dll"; - remove unneeded dispinterfaces; - renamed IWineConsoleGetter to IWineHTMLWindowPrivate;
dlls/mshtml/dispex.c | 31 ++++++- dlls/mshtml/htmlwindow.c | 126 +++++++++++++++++++++------ dlls/mshtml/mshtml_private.h | 6 ++ dlls/mshtml/mshtml_private_iface.idl | 18 ++++ 4 files changed, 149 insertions(+), 32 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 6d248691d6b..c7588006295 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -111,7 +111,7 @@ struct dispex_dynamic_data_t {
#define FDEX_VERSION_MASK 0xf0000000
-static ITypeLib *typelib; +static ITypeLib *typelib, *typelib_private; static ITypeInfo *typeinfos[LAST_tid]; static struct list dispex_data_list = LIST_INIT(dispex_data_list);
@@ -119,14 +119,18 @@ static REFIID tid_ids[] = { #define XIID(iface) &IID_ ## iface, #define XDIID(iface) &DIID_ ## iface, TID_LIST + NULL, +PRIVATE_TID_LIST #undef XIID #undef XDIID };
static HRESULT load_typelib(void) { + WCHAR module_path[MAX_PATH + 3]; HRESULT hres; ITypeLib *tl; + DWORD len;
hres = LoadRegTypeLib(&LIBID_MSHTML, 4, 0, LOCALE_SYSTEM_DEFAULT, &tl); if(FAILED(hres)) { @@ -136,7 +140,25 @@ static HRESULT load_typelib(void)
if(InterlockedCompareExchangePointer((void**)&typelib, tl, NULL)) ITypeLib_Release(tl); - return hres; + + len = GetModuleFileNameW(hInst, module_path, MAX_PATH + 1); + if (!len || len == MAX_PATH + 1) + { + ERR("Could not get module file name, len %u.\n", len); + return E_FAIL; + } + lstrcatW(module_path, L"\1"); + + hres = LoadTypeLibEx(module_path, REGKIND_NONE, &tl); + if(FAILED(hres)) { + ERR("LoadTypeLibEx failed for private typelib: %08x\n", hres); + return hres; + } + + if(InterlockedCompareExchangePointer((void**)&typelib_private, tl, NULL)) + ITypeLib_Release(tl); + + return S_OK; }
static HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo) @@ -151,7 +173,7 @@ static HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo) if(!typeinfos[tid]) { ITypeInfo *ti;
- hres = ITypeLib_GetTypeInfoOfGuid(typelib, tid_ids[tid], &ti); + hres = ITypeLib_GetTypeInfoOfGuid(tid > LAST_public_tid ? typelib_private : typelib, tid_ids[tid], &ti); if(FAILED(hres)) { ERR("GetTypeInfoOfGuid(%s) failed: %08x\n", debugstr_mshtml_guid(tid_ids[tid]), hres); return hres; @@ -197,6 +219,7 @@ void release_typelib(void) ITypeInfo_Release(typeinfos[i]);
ITypeLib_Release(typelib); + ITypeLib_Release(typelib_private); DeleteCriticalSection(&cs_dispex_static_data); }
@@ -210,6 +233,8 @@ HRESULT get_class_typeinfo(const CLSID *clsid, ITypeInfo **typeinfo) return hres;
hres = ITypeLib_GetTypeInfoOfGuid(typelib, clsid, typeinfo); + if (FAILED(hres)) + hres = ITypeLib_GetTypeInfoOfGuid(typelib_private, clsid, typeinfo); if(FAILED(hres)) ERR("GetTypeInfoOfGuid failed: %08x\n", hres); return hres; diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 4196d1f45ad..dce329d9ec6 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -189,6 +189,8 @@ static HRESULT WINAPI HTMLWindow2_QueryInterface(IHTMLWindow2 *iface, REFIID rii *ppv = &This->IProvideMultipleClassInfo_iface; }else if(IsEqualGUID(&IID_IProvideMultipleClassInfo, riid)) { *ppv = &This->IProvideMultipleClassInfo_iface; + }else if(IsEqualGUID(&IID_IWineHTMLWindowPrivate, riid)) { + *ppv = &This->IWineHTMLWindowPrivate_iface; }else if(IsEqualGUID(&IID_IMarshal, riid)) { *ppv = NULL; FIXME("(%p)->(IID_IMarshal %p)\n", This, ppv); @@ -3033,6 +3035,97 @@ static const IProvideMultipleClassInfoVtbl ProvideMultipleClassInfoVtbl = { ProvideMultipleClassInfo_GetInfoOfIndex };
+static inline HTMLWindow *impl_from_IWineHTMLWindowPrivateVtbl(IWineHTMLWindowPrivate *iface) +{ + return CONTAINING_RECORD(iface, HTMLWindow, IWineHTMLWindowPrivate_iface); +} + +static HRESULT WINAPI window_private_QueryInterface(IWineHTMLWindowPrivate *iface, + REFIID riid, void **ppv) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowPrivateVtbl(iface); + + return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv); +} + +static ULONG WINAPI window_private_AddRef(IWineHTMLWindowPrivate *iface) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowPrivateVtbl(iface); + + return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface); +} + +static ULONG WINAPI window_private_Release(IWineHTMLWindowPrivate *iface) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowPrivateVtbl(iface); + + return IHTMLWindow2_Release(&This->IHTMLWindow2_iface); +} + +static HRESULT WINAPI window_private_GetTypeInfoCount(IWineHTMLWindowPrivate *iface, UINT *pctinfo) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowPrivateVtbl(iface); + + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); +} + +static HRESULT WINAPI window_private_GetTypeInfo(IWineHTMLWindowPrivate *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowPrivateVtbl(iface); + + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); +} + +static HRESULT WINAPI window_private_GetIDsOfNames(IWineHTMLWindowPrivate *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowPrivateVtbl(iface); + + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, + rgDispId); +} + +static HRESULT WINAPI window_private_Invoke(IWineHTMLWindowPrivate *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowPrivateVtbl(iface); + + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI window_private_requestAnimationFrame(IWineHTMLWindowPrivate *iface, + VARIANT *expr, VARIANT *timer_id) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowPrivateVtbl(iface); + HRESULT hres; + LONG r; + + FIXME("iface %p, expr %p, timer_id %p semi-stub.\n", iface, expr, timer_id); + + hres = window_set_timer(This->inner_window, expr, 50, NULL, TIMER_ANIMATION_FRAME, &r); + if(SUCCEEDED(hres) && timer_id) { + V_VT(timer_id) = VT_I4; + V_I4(timer_id) = r; + } + + return hres; +} + +static const IWineHTMLWindowPrivateVtbl WineHTMLWindowPrivateVtbl = { + window_private_QueryInterface, + window_private_AddRef, + window_private_Release, + window_private_GetTypeInfoCount, + window_private_GetTypeInfo, + window_private_GetIDsOfNames, + window_private_Invoke, + window_private_requestAnimationFrame, +}; + static inline HTMLWindow *impl_from_IDispatchEx(IDispatchEx *iface) { return CONTAINING_RECORD(iface, HTMLWindow, IDispatchEx_iface); @@ -3176,9 +3269,6 @@ HRESULT search_window_props(HTMLInnerWindow *This, BSTR bstrName, DWORD grfdex, return DISP_E_UNKNOWNNAME; }
-/* DISPIDs not exposed by interfaces */ -#define DISPID_IHTMLWINDOW_IE10_REQUESTANIMATIONFRAME 1300 - static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) { HTMLWindow *This = impl_from_IDispatchEx(iface); @@ -3195,13 +3285,6 @@ static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName, if(hres != DISP_E_UNKNOWNNAME) return hres;
- if(dispex_compat_mode(&window->event_target.dispex) >= COMPAT_MODE_IE10 && - !wcscmp(bstrName, L"requestAnimationFrame")) { - TRACE("requestAnimationFrame\n"); - *pid = DISPID_IHTMLWINDOW_IE10_REQUESTANIMATIONFRAME; - return S_OK; - } - if(This->outer_window) { HTMLOuterWindow *frame;
@@ -3288,25 +3371,6 @@ static HRESULT WINAPI WindowDispEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID return IDispatchEx_InvokeEx(&window->event_target.dispex.IDispatchEx_iface, id, lcid, wFlags, &dp, pvarRes, pei, pspCaller); } - case DISPID_IHTMLWINDOW_IE10_REQUESTANIMATIONFRAME: { - HRESULT hres; - LONG r; - - FIXME("requestAnimationFrame: semi-stub\n"); - - if(!(wFlags & DISPATCH_METHOD) || pdp->cArgs != 1 || pdp->cNamedArgs) { - FIXME("unsupported args\n"); - return E_INVALIDARG; - } - - hres = window_set_timer(window, pdp->rgvarg, 50, NULL, TIMER_ANIMATION_FRAME, &r); - if(SUCCEEDED(hres) && pvarRes) { - V_VT(pvarRes) = VT_I4; - V_I4(pvarRes) = r; - } - - return hres; - } }
return IDispatchEx_InvokeEx(&window->event_target.dispex.IDispatchEx_iface, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); @@ -3566,6 +3630,9 @@ 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); + if(compat_mode >= COMPAT_MODE_IE10) + dispex_info_add_interface(info, IWineHTMLWindowPrivate_tid, NULL); + dispex_info_add_interface(info, IHTMLWindow5_tid, NULL); EventTarget_init_dispex_info(info, compat_mode); } @@ -3627,6 +3694,7 @@ static void *alloc_window(size_t size) window->ITravelLogClient_iface.lpVtbl = &TravelLogClientVtbl; window->IObjectIdentity_iface.lpVtbl = &ObjectIdentityVtbl; window->IProvideMultipleClassInfo_iface.lpVtbl = &ProvideMultipleClassInfoVtbl; + window->IWineHTMLWindowPrivate_iface.lpVtbl = &WineHTMLWindowPrivateVtbl; window->ref = 1;
return window; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 6228cf1298d..08b4df86e31 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -272,10 +272,15 @@ typedef struct EventTarget EventTarget; XIID(ISVGTSpanElement) \ XIID(ISVGTextContentElement)
+#define PRIVATE_TID_LIST \ + XIID(IWineHTMLWindowPrivate) + typedef enum { #define XIID(iface) iface ## _tid, #define XDIID(iface) iface ## _tid, TID_LIST + LAST_public_tid, +PRIVATE_TID_LIST #undef XIID #undef XDIID LAST_tid @@ -485,6 +490,7 @@ struct HTMLWindow { ITravelLogClient ITravelLogClient_iface; IObjectIdentity IObjectIdentity_iface; IProvideMultipleClassInfo IProvideMultipleClassInfo_iface; + IWineHTMLWindowPrivate IWineHTMLWindowPrivate_iface;
LONG ref;
diff --git a/dlls/mshtml/mshtml_private_iface.idl b/dlls/mshtml/mshtml_private_iface.idl index 5a01c6c1b27..c147b2445dc 100644 --- a/dlls/mshtml/mshtml_private_iface.idl +++ b/dlls/mshtml/mshtml_private_iface.idl @@ -18,6 +18,8 @@
#pragma makedep typelib
+import "ocidl.idl"; + [ version(1.0), hidden, @@ -25,4 +27,20 @@ ] library MSHTML_private { + +importlib("stdole2.tlb"); + +[ + odl, + oleautomation, + dual, + hidden, + uuid(1b5939fc-8f84-43f3-8d89-f9a92069fad7) +] +interface IWineHTMLWindowPrivate : IDispatch +{ + [id(1)] + HRESULT requestAnimationFrame([in] VARIANT *expr, [retval, out] VARIANT *timer_id); +} + } /* library MSHTML_private */
Signed-off-by: Jacek Caban jacek@codeweavers.com
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- v4: - move console class to omnavigator.c instead of a new file; - use actual compat mode for console creation (and delay console creation until the first query); - add test to ocumentmode.js (window_props).
dlls/mshtml/htmlwindow.c | 19 ++ dlls/mshtml/mshtml_private.h | 6 +- dlls/mshtml/mshtml_private_iface.idl | 46 +++++ dlls/mshtml/omnavigator.c | 258 +++++++++++++++++++++++++++ dlls/mshtml/tests/documentmode.js | 1 + dlls/mshtml/tests/es5.js | 64 +++++++ 6 files changed, 393 insertions(+), 1 deletion(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index dce329d9ec6..870d7e8f100 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -316,6 +316,9 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface) TRACE("(%p) ref=%d\n", This, ref);
if(!ref) { + if (This->console) + IWineMSHTMLConsole_Release(This->console); + if(is_outer_window(This)) release_outer_window(This->outer_window); else @@ -3115,6 +3118,21 @@ static HRESULT WINAPI window_private_requestAnimationFrame(IWineHTMLWindowPrivat return hres; }
+static HRESULT WINAPI window_private_get_console(IWineHTMLWindowPrivate *iface, IDispatch **console) +{ + HTMLWindow *This = impl_from_IWineHTMLWindowPrivateVtbl(iface); + + TRACE("iface %p, console %p.\n", iface, console); + + if (!This->console) + create_console(dispex_compat_mode(&This->inner_window->event_target.dispex), &This->console); + + *console = (IDispatch *)This->console; + if (This->console) + IWineMSHTMLConsole_AddRef(This->console); + return S_OK; +} + static const IWineHTMLWindowPrivateVtbl WineHTMLWindowPrivateVtbl = { window_private_QueryInterface, window_private_AddRef, @@ -3124,6 +3142,7 @@ static const IWineHTMLWindowPrivateVtbl WineHTMLWindowPrivateVtbl = { window_private_GetIDsOfNames, window_private_Invoke, window_private_requestAnimationFrame, + window_private_get_console, };
static inline HTMLWindow *impl_from_IDispatchEx(IDispatchEx *iface) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 08b4df86e31..e2c1f221372 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -273,7 +273,8 @@ typedef struct EventTarget EventTarget; XIID(ISVGTextContentElement)
#define PRIVATE_TID_LIST \ - XIID(IWineHTMLWindowPrivate) + XIID(IWineHTMLWindowPrivate) \ + XIID(IWineMSHTMLConsole)
typedef enum { #define XIID(iface) iface ## _tid, @@ -492,6 +493,8 @@ struct HTMLWindow { IProvideMultipleClassInfo IProvideMultipleClassInfo_iface; IWineHTMLWindowPrivate IWineHTMLWindowPrivate_iface;
+ IWineMSHTMLConsole *console; + LONG ref;
HTMLInnerWindow *inner_window; @@ -1407,3 +1410,4 @@ void set_statustext(HTMLDocumentObj*,INT,LPCWSTR) DECLSPEC_HIDDEN; IInternetSecurityManager *get_security_manager(void) DECLSPEC_HIDDEN;
extern HINSTANCE hInst DECLSPEC_HIDDEN; +void create_console(compat_mode_t compat_mode, IWineMSHTMLConsole **ret) DECLSPEC_HIDDEN; diff --git a/dlls/mshtml/mshtml_private_iface.idl b/dlls/mshtml/mshtml_private_iface.idl index c147b2445dc..6c5c5db991f 100644 --- a/dlls/mshtml/mshtml_private_iface.idl +++ b/dlls/mshtml/mshtml_private_iface.idl @@ -30,6 +30,50 @@ library MSHTML_private
importlib("stdole2.tlb");
+[ + odl, + oleautomation, + dual, + hidden, + uuid(fd55b4b6-2813-4fb4-829d-380099474ab1) +] +interface IWineMSHTMLConsole : IDispatch +{ + [id(1)] + HRESULT assert([in] VARIANT_BOOL *assertion, + [in, optional] VARIANT *varargStart); + [id(2)] + HRESULT clear(); + [id(3)] + HRESULT count([in, optional] VARIANT *label); + [id(4)] + HRESULT debug([in, optional] VARIANT *varargStart); + [id(5)] + HRESULT dir([in, optional] VARIANT *object); + [id(6)] + HRESULT dirxml([in, optional] VARIANT *object); + [id(7)] + HRESULT error([in, optional] VARIANT *varargStart); + [id(8)] + HRESULT group([in, optional] VARIANT *label); + [id(9)] + HRESULT groupCollapsed([in, optional] VARIANT *label); + [id(10)] + HRESULT groupEnd(); + [id(11)] + HRESULT info([in, optional] VARIANT *varargStart); + [id(12)] + HRESULT log([in, optional] VARIANT *varargStart); + [id(13)] + HRESULT time([in, optional] VARIANT *label); + [id(14)] + HRESULT timeEnd([in, optional] VARIANT *label); + [id(15)] + HRESULT trace([in, optional] VARIANT *varargStart); + [id(16)] + HRESULT warn([in, optional] VARIANT *varargStart); +} + [ odl, oleautomation, @@ -41,6 +85,8 @@ interface IWineHTMLWindowPrivate : IDispatch { [id(1)] HRESULT requestAnimationFrame([in] VARIANT *expr, [retval, out] VARIANT *timer_id); + [propget, id(2)] + HRESULT console([retval, out] IDispatch **console); }
} /* library MSHTML_private */ diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index a8f829b6a57..eff9576a955 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -2365,3 +2365,261 @@ HRESULT create_namespace_collection(compat_mode_t compat_mode, IHTMLNamespaceCol *ret = &namespaces->IHTMLNamespaceCollection_iface; return S_OK; } + +struct console { + DispatchEx dispex; + IWineMSHTMLConsole IWineMSHTMLConsole_iface; + LONG ref; +}; + +static inline struct console *impl_from_IWineMSHTMLConsole(IWineMSHTMLConsole *iface) +{ + return CONTAINING_RECORD(iface, struct console, IWineMSHTMLConsole_iface); +} + +static HRESULT WINAPI console_QueryInterface(IWineMSHTMLConsole *iface, REFIID riid, void **ppv) +{ + struct console *console = impl_from_IWineMSHTMLConsole(iface); + + TRACE("(%p)->(%s %p)\n", console, debugstr_mshtml_guid(riid), ppv); + + if(IsEqualGUID(&IID_IUnknown, riid)) { + *ppv = &console->IWineMSHTMLConsole_iface; + }else if(IsEqualGUID(&IID_IWineMSHTMLConsole, riid)) { + *ppv = &console->IWineMSHTMLConsole_iface; + }else if(dispex_query_interface(&console->dispex, riid, ppv)) { + return *ppv ? S_OK : E_NOINTERFACE; + }else { + WARN("(%p)->(%s %p)\n", console, debugstr_mshtml_guid(riid), ppv); + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI console_AddRef(IWineMSHTMLConsole *iface) +{ + struct console *console = impl_from_IWineMSHTMLConsole(iface); + LONG ref = InterlockedIncrement(&console->ref); + + TRACE("(%p) ref=%d\n", console, ref); + + return ref; +} + +static ULONG WINAPI console_Release(IWineMSHTMLConsole *iface) +{ + struct console *console = impl_from_IWineMSHTMLConsole(iface); + LONG ref = InterlockedDecrement(&console->ref); + + TRACE("(%p) ref=%d\n", console, ref); + + if(!ref) { + release_dispex(&console->dispex); + heap_free(console); + } + + return ref; +} + +static HRESULT WINAPI console_GetTypeInfoCount(IWineMSHTMLConsole *iface, UINT *pctinfo) +{ + struct console *console = impl_from_IWineMSHTMLConsole(iface); + FIXME("(%p)->(%p)\n", console, pctinfo); + return E_NOTIMPL; +} + +static HRESULT WINAPI console_GetTypeInfo(IWineMSHTMLConsole *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + struct console *console = impl_from_IWineMSHTMLConsole(iface); + + return IDispatchEx_GetTypeInfo(&console->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo); +} + +static HRESULT WINAPI console_GetIDsOfNames(IWineMSHTMLConsole *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + struct console *console = impl_from_IWineMSHTMLConsole(iface); + + return IDispatchEx_GetIDsOfNames(&console->dispex.IDispatchEx_iface, riid, rgszNames, cNames, + lcid, rgDispId); +} + +static HRESULT WINAPI console_Invoke(IWineMSHTMLConsole *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + struct console *console = impl_from_IWineMSHTMLConsole(iface); + + return IDispatchEx_Invoke(&console->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI console_assert(IWineMSHTMLConsole *iface, VARIANT_BOOL *assertion, VARIANT *vararg_start) +{ + FIXME("iface %p, assertion %p, vararg_start %p stub.\n", iface, assertion, vararg_start); + + return S_OK; +} + +static HRESULT WINAPI console_clear(IWineMSHTMLConsole *iface) +{ + FIXME("iface %p stub.\n", iface); + + return S_OK; +} + +static HRESULT WINAPI console_count(IWineMSHTMLConsole *iface, VARIANT *label) +{ + FIXME("iface %p, label %p stub.\n", iface, label); + + return S_OK; +} + +static HRESULT WINAPI console_debug(IWineMSHTMLConsole *iface, VARIANT *vararg_start) +{ + FIXME("iface %p, vararg_start %p stub.\n", iface, vararg_start); + + return S_OK; +} + +static HRESULT WINAPI console_dir(IWineMSHTMLConsole *iface, VARIANT *object) +{ + FIXME("iface %p, object %p stub.\n", iface, object); + + return S_OK; +} + +static HRESULT WINAPI console_dirxml(IWineMSHTMLConsole *iface, VARIANT *object) +{ + FIXME("iface %p, object %p stub.\n", iface, object); + + return S_OK; +} + +static HRESULT WINAPI console_error(IWineMSHTMLConsole *iface, VARIANT *vararg_start) +{ + FIXME("iface %p, vararg_start %p stub.\n", iface, vararg_start); + + return S_OK; +} + +static HRESULT WINAPI console_group(IWineMSHTMLConsole *iface, VARIANT *label) +{ + FIXME("iface %p, label %p stub.\n", iface, label); + + return S_OK; +} + +static HRESULT WINAPI console_group_collapsed(IWineMSHTMLConsole *iface, VARIANT *label) +{ + FIXME("iface %p, label %p stub.\n", iface, label); + + return S_OK; +} + +static HRESULT WINAPI console_group_end(IWineMSHTMLConsole *iface) +{ + FIXME("iface %p, stub.\n", iface); + + return S_OK; +} + +static HRESULT WINAPI console_info(IWineMSHTMLConsole *iface, VARIANT *vararg_start) +{ + FIXME("iface %p, vararg_start %p stub.\n", iface, vararg_start); + + return S_OK; +} + +static HRESULT WINAPI console_log(IWineMSHTMLConsole *iface, VARIANT *vararg_start) +{ + FIXME("iface %p, vararg_start %p stub.\n", iface, vararg_start); + + return S_OK; +} + +static HRESULT WINAPI console_time(IWineMSHTMLConsole *iface, VARIANT *label) +{ + FIXME("iface %p, label %p stub.\n", iface, label); + + return S_OK; +} + +static HRESULT WINAPI console_time_end(IWineMSHTMLConsole *iface, VARIANT *label) +{ + FIXME("iface %p, label %p stub.\n", iface, label); + + return S_OK; +} + +static HRESULT WINAPI console_trace(IWineMSHTMLConsole *iface, VARIANT *vararg_start) +{ + FIXME("iface %p, vararg_start %p stub.\n", iface, vararg_start); + + return S_OK; +} + +static HRESULT WINAPI console_warn(IWineMSHTMLConsole *iface, VARIANT *vararg_start) +{ + FIXME("iface %p, vararg_start %p stub.\n", iface, vararg_start); + + return S_OK; +} + +static const IWineMSHTMLConsoleVtbl WineMSHTMLConsoleVtbl = { + console_QueryInterface, + console_AddRef, + console_Release, + console_GetTypeInfoCount, + console_GetTypeInfo, + console_GetIDsOfNames, + console_Invoke, + console_assert, + console_clear, + console_count, + console_debug, + console_dir, + console_dirxml, + console_error, + console_group, + console_group_collapsed, + console_group_end, + console_info, + console_log, + console_time, + console_time_end, + console_trace, + console_warn, +}; + +static const tid_t console_iface_tids[] = { + IWineMSHTMLConsole_tid, + 0 +}; +static dispex_static_data_t console_dispex = { + NULL, + IWineMSHTMLConsole_tid, + console_iface_tids +}; + +void create_console(compat_mode_t compat_mode, IWineMSHTMLConsole **ret) +{ + struct console *obj; + + obj = heap_alloc_zero(sizeof(*obj)); + if(!obj) + { + ERR("No memory.\n"); + return; + } + + obj->IWineMSHTMLConsole_iface.lpVtbl = &WineMSHTMLConsoleVtbl; + obj->ref = 1; + init_dispatch(&obj->dispex, (IUnknown*)&obj->IWineMSHTMLConsole_iface, &console_dispex, compat_mode); + + *ret = &obj->IWineMSHTMLConsole_iface; +} diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 26aa451db0b..859e1fe53db 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -121,6 +121,7 @@ sync_test("window_props", function() { test_exposed("Set", v >= 11); if(v >= 9) /* FIXME: native exposes it in all compat modes */ test_exposed("performance", true); + test_exposed("console", v >= 10); });
sync_test("xhr_props", function() { diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index a520253569c..e57aed5ca35 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -1448,3 +1448,67 @@ sync_test("functions scope", function() { ok(val == 8, "val != 8"); ok(w == 9, "w != 9"); }); + +sync_test("console", function() { + var except + + window.console.log('1', '2'); + console.info('1', '2', '3'); + console.info(); + console.log(); + console.trace(); + console.warn(); + console.debug(); + console.error(); + + console.assert(false, '1'); + console.assert(true, '1'); + console.assert('1'); + + console.clear(); + console.count('1'); + console.count(1); + + + except = false; + try + { + console.countReset('1'); + } + catch(e) + { + except = true; + } + ok(except, "console.countReset: expected exception"); + console.dir(document); + console.dir(); + console.dirxml(document); + console.group('1'); + console.groupCollapsed('1'); + console.groupEnd(); + + except = false; + try + { + console.table(['1', '2']); + } + catch(e) + { + except = true; + } + ok(except, "console.table: expected exception"); + + console.time('1'); + console.timeEnd('1'); + + except = false; + try + { + console.timeLog('1'); + } + catch(e) + { + except = true; + } + ok(except, "console.timeLog: expected exception"); +});
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=93846
Your paranoid android.
=== w8adm (32 bit report) ===
mshtml: events.c:1089: Test failed: unexpected call img_onerror events: Timeout
Signed-off-by: Jacek Caban jacek@codeweavers.com