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 --- v3: - embed the typelib into mshtml.dll.
dlls/mshtml/Makefile.in | 1 + dlls/mshtml/mshtml.rc | 3 +++ dlls/mshtml/mshtml_private.h | 2 ++ dlls/mshtml/mshtml_private_iface.idl | 33 ++++++++++++++++++++++++++++ 4 files changed, 39 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..60ad70eede7 --- /dev/null +++ b/dlls/mshtml/mshtml_private_iface.idl @@ -0,0 +1,33 @@ +/* + * 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 + +import "ocidl.idl"; +import "dimm.idl"; +import "shtypes.idl"; +import "dispex.idl"; + +[ + version(1.0), + hidden, + uuid(90de541e-380b-4530-94a9-97367fe49d8d) +] +library MSHTML_private +{ +} /* library MSHTML_private */
On 7/7/21 2:03 PM, Paul Gofman wrote:
+import "ocidl.idl"; +import "dimm.idl"; +import "shtypes.idl"; +import "dispex.idl";
Do you need all those imports?
Jacek
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- v3: - add console getter interface to HTMLWindow.
dlls/mshtml/Makefile.in | 1 + dlls/mshtml/console.c | 294 +++++++++++++++++++++++++++ dlls/mshtml/dispex.c | 21 +- dlls/mshtml/htmlwindow.c | 97 +++++++++ dlls/mshtml/mshtml_private.h | 12 ++ dlls/mshtml/mshtml_private_iface.idl | 115 +++++++++++ dlls/mshtml/tests/es5.js | 64 ++++++ 7 files changed, 601 insertions(+), 3 deletions(-) create mode 100644 dlls/mshtml/console.c
diff --git a/dlls/mshtml/Makefile.in b/dlls/mshtml/Makefile.in index ce7ddb40bde..9c5585ad4b9 100644 --- a/dlls/mshtml/Makefile.in +++ b/dlls/mshtml/Makefile.in @@ -7,6 +7,7 @@ EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ conpoint.c \ + console.c \ dispex.c \ editor.c \ htmlanchor.c \ diff --git a/dlls/mshtml/console.c b/dlls/mshtml/console.c new file mode 100644 index 00000000000..58df32896cc --- /dev/null +++ b/dlls/mshtml/console.c @@ -0,0 +1,294 @@ +/* + * 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 + */ + +#include <stdarg.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "ole2.h" +#include "mshtmdid.h" +#include "shlguid.h" +#include "shobjidl.h" +#include "exdispid.h" + +#include "wine/debug.h" + +#include "mshtml_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(mshtml); + +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(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_NONE); + + *ret = &obj->IWineMSHTMLConsole_iface; +} diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 6d248691d6b..e0c2ea2c121 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,6 +119,8 @@ static REFIID tid_ids[] = { #define XIID(iface) &IID_ ## iface, #define XDIID(iface) &DIID_ ## iface, TID_LIST + NULL, +PRIVATE_TID_LIST #undef XIID #undef XDIID }; @@ -136,7 +138,17 @@ static HRESULT load_typelib(void)
if(InterlockedCompareExchangePointer((void**)&typelib, tl, NULL)) ITypeLib_Release(tl); - return hres; + + hres = LoadTypeLibEx(L"mshtml.dll\1", 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 +163,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 +209,7 @@ void release_typelib(void) ITypeInfo_Release(typeinfos[i]);
ITypeLib_Release(typelib); + ITypeLib_Release(typelib_private); DeleteCriticalSection(&cs_dispex_static_data); }
@@ -210,6 +223,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..f4d83ad26c5 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_IWineConsoleGetter, riid)) { + *ppv = &This->IWineConsoleGetter_iface; }else if(IsEqualGUID(&IID_IMarshal, riid)) { *ppv = NULL; FIXME("(%p)->(IID_IMarshal %p)\n", This, ppv); @@ -314,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 @@ -3033,6 +3038,91 @@ static const IProvideMultipleClassInfoVtbl ProvideMultipleClassInfoVtbl = { ProvideMultipleClassInfo_GetInfoOfIndex };
+static inline HTMLWindow *impl_from_IWineConsoleGetterVtbl(IWineConsoleGetter *iface) +{ + return CONTAINING_RECORD(iface, HTMLWindow, IWineConsoleGetter_iface); +} + +static HRESULT WINAPI console_getter_QueryInterface(IWineConsoleGetter *iface, + REFIID riid, void **ppv) +{ + HTMLWindow *This = impl_from_IWineConsoleGetterVtbl(iface); + + return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv); +} + +static ULONG WINAPI console_getter_AddRef(IWineConsoleGetter *iface) +{ + HTMLWindow *This = impl_from_IWineConsoleGetterVtbl(iface); + + return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface); +} + +static ULONG WINAPI console_getter_Release(IWineConsoleGetter *iface) +{ + HTMLWindow *This = impl_from_IWineConsoleGetterVtbl(iface); + + return IHTMLWindow2_Release(&This->IHTMLWindow2_iface); +} + +static HRESULT WINAPI console_getter_GetTypeInfoCount(IWineConsoleGetter *iface, UINT *pctinfo) +{ + HTMLWindow *This = impl_from_IWineConsoleGetterVtbl(iface); + + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); +} + +static HRESULT WINAPI console_getter_GetTypeInfo(IWineConsoleGetter *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + HTMLWindow *This = impl_from_IWineConsoleGetterVtbl(iface); + + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); +} + +static HRESULT WINAPI console_getter_GetIDsOfNames(IWineConsoleGetter *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) +{ + HTMLWindow *This = impl_from_IWineConsoleGetterVtbl(iface); + + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, + rgDispId); +} + +static HRESULT WINAPI console_getter_Invoke(IWineConsoleGetter *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + HTMLWindow *This = impl_from_IWineConsoleGetterVtbl(iface); + + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI console_getter_get_console(IWineConsoleGetter *iface, IDispatch **console) +{ + HTMLWindow *This = impl_from_IWineConsoleGetterVtbl(iface); + + TRACE("iface %p, console %p.\n", iface, console); + + *console = (IDispatch *)This->console; + if (This->console) + IWineMSHTMLConsole_AddRef(This->console); + return S_OK; +} + +static const IWineConsoleGetterVtbl WineConsoleGetterVtbl = { + console_getter_QueryInterface, + console_getter_AddRef, + console_getter_Release, + console_getter_GetTypeInfoCount, + console_getter_GetTypeInfo, + console_getter_GetIDsOfNames, + console_getter_Invoke, + console_getter_get_console, +}; + static inline HTMLWindow *impl_from_IDispatchEx(IDispatchEx *iface) { return CONTAINING_RECORD(iface, HTMLWindow, IDispatchEx_iface); @@ -3179,6 +3269,7 @@ HRESULT search_window_props(HTMLInnerWindow *This, BSTR bstrName, DWORD grfdex, /* 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); @@ -3566,6 +3657,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, IWineConsoleGetter_tid, NULL); + dispex_info_add_interface(info, IHTMLWindow5_tid, NULL); EventTarget_init_dispex_info(info, compat_mode); } @@ -3627,8 +3721,11 @@ static void *alloc_window(size_t size) window->ITravelLogClient_iface.lpVtbl = &TravelLogClientVtbl; window->IObjectIdentity_iface.lpVtbl = &ObjectIdentityVtbl; window->IProvideMultipleClassInfo_iface.lpVtbl = &ProvideMultipleClassInfoVtbl; + window->IWineConsoleGetter_iface.lpVtbl = &WineConsoleGetterVtbl; window->ref = 1;
+ create_console(&window->console); + return window; }
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 6228cf1298d..89d06de4ca7 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -272,10 +272,18 @@ typedef struct EventTarget EventTarget; XIID(ISVGTSpanElement) \ XIID(ISVGTextContentElement)
+#define PRIVATE_TID_LIST \ + XDIID(DispWineConsoleGetter) \ + XDIID(DispWineMSHTMLConsole) \ + XIID(IWineConsoleGetter) \ + XIID(IWineMSHTMLConsole) + 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 +493,9 @@ struct HTMLWindow { ITravelLogClient ITravelLogClient_iface; IObjectIdentity IObjectIdentity_iface; IProvideMultipleClassInfo IProvideMultipleClassInfo_iface; + IWineConsoleGetter IWineConsoleGetter_iface; + + IWineMSHTMLConsole *console;
LONG ref;
@@ -1401,3 +1412,4 @@ void set_statustext(HTMLDocumentObj*,INT,LPCWSTR) DECLSPEC_HIDDEN; IInternetSecurityManager *get_security_manager(void) DECLSPEC_HIDDEN;
extern HINSTANCE hInst DECLSPEC_HIDDEN; +void create_console(IWineMSHTMLConsole **ret) DECLSPEC_HIDDEN; diff --git a/dlls/mshtml/mshtml_private_iface.idl b/dlls/mshtml/mshtml_private_iface.idl index 60ad70eede7..d721d09190a 100644 --- a/dlls/mshtml/mshtml_private_iface.idl +++ b/dlls/mshtml/mshtml_private_iface.idl @@ -30,4 +30,119 @@ import "dispex.idl"; ] 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); +} + +[ + hidden, + uuid(b61c3206-7c3d-4b56-bf16-a9f264747f58) +] +dispinterface DispWineMSHTMLConsole +{ +properties: +methods: + [id(1)] + void assert([in] VARIANT_BOOL *assertion, + [in, optional] VARIANT *varargStart); + [id(2)] + void clear(); + [id(3)] + void count([in, optional] VARIANT *label); + [id(4)] + void debug([in, optional] VARIANT *varargStart); + [id(5)] + void dir([in, optional] VARIANT *object); + [id(6)] + void dirxml([in, optional] VARIANT *object); + [id(7)] + void error([in, optional] VARIANT *varargStart); + [id(8)] + void group([in, optional] VARIANT *label); + [id(9)] + void groupCollapsed([in, optional] VARIANT *label); + [id(10)] + void groupEnd(); + [id(11)] + void info([in, optional] VARIANT *varargStart); + [id(12)] + void log([in, optional] VARIANT *varargStart); + [id(13)] + void time([in, optional] VARIANT *label); + [id(14)] + void timeEnd([in, optional] VARIANT *label); + [id(15)] + void trace([in, optional] VARIANT *varargStart); + [id(16)] + void warn([in, optional] VARIANT *varargStart); +} + +[ + odl, + oleautomation, + dual, + hidden, + uuid(1b5939fc-8f84-43f3-8d89-f9a92069fad7) +] +interface IWineConsoleGetter : IDispatch +{ + [propget, id(1)] + HRESULT console([retval, out] IDispatch **console); +} + +[ + hidden, + uuid(b84d405a-8057-4cc7-86c6-e872bb6205ad) +] +dispinterface DispWineConsoleGetter +{ +properties: +methods: + [propget, id(1)] + IDispatch *console(); +} + } /* library MSHTML_private */ 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=93817
Your paranoid android.
=== w8adm (32 bit report) ===
mshtml: events.c:1089: Test failed: unexpected call img_onerror events: Timeout
=== w1064_tsign (64 bit report) ===
mshtml: htmldoc.c:2541: Test failed: unexpected call UpdateUI htmldoc.c:2853: Test failed: unexpected call Exec_UPDATECOMMANDS htmldoc.c:350: Test failed: expected Exec_SETTITLE htmldoc.c:2859: Test failed: unexpected call Exec_SETTITLE
=== w7u_adm (32 bit report) ===
mshtml: script.c:624: Test failed: L"/index.html?es5.js:date_now: unexpected Date.now() result 1625664796890 expected 1625664796952"
Hi Paul,
On 7/7/21 2:03 PM, Paul Gofman wrote:
Signed-off-by: Paul Gofman pgofman@codeweavers.com
v3: - add console getter interface to HTMLWindow.
dlls/mshtml/Makefile.in | 1 + dlls/mshtml/console.c | 294 +++++++++++++++++++++++++++
We already have more files than we should in mshtml, this could go to omnavigator.c instead.
+void create_console(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_NONE);
Compat mode affects some basic IDispatchEx behaviour now, so it should be specified properly here. For that, you will probably want to delay object creation.
- *ret = &obj->IWineMSHTMLConsole_iface;
+} diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 6d248691d6b..e0c2ea2c121 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,6 +119,8 @@ static REFIID tid_ids[] = { #define XIID(iface) &IID_ ## iface, #define XDIID(iface) &DIID_ ## iface, TID_LIST
- NULL,
+PRIVATE_TID_LIST #undef XIID #undef XDIID }; @@ -136,7 +138,17 @@ static HRESULT load_typelib(void)
if(InterlockedCompareExchangePointer((void**)&typelib, tl, NULL)) ITypeLib_Release(tl);
- return hres;
- hres = LoadTypeLibEx(L"mshtml.dll\1", REGKIND_NONE, &tl);
It would be better to use something like GetModuleFileName() instead of hardcoding it.
diff --git a/dlls/mshtml/mshtml_private_iface.idl b/dlls/mshtml/mshtml_private_iface.idl index 60ad70eede7..d721d09190a 100644 --- a/dlls/mshtml/mshtml_private_iface.idl +++ b/dlls/mshtml/mshtml_private_iface.idl @@ -30,4 +30,119 @@ import "dispex.idl"; ] 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);
+}
+[
- hidden,
- uuid(b61c3206-7c3d-4b56-bf16-a9f264747f58)
+] +dispinterface DispWineMSHTMLConsole +{ +properties: +methods:
- [id(1)]
- void assert([in] VARIANT_BOOL *assertion,
[in, optional] VARIANT *varargStart);
- [id(2)]
- void clear();
- [id(3)]
- void count([in, optional] VARIANT *label);
- [id(4)]
- void debug([in, optional] VARIANT *varargStart);
- [id(5)]
- void dir([in, optional] VARIANT *object);
- [id(6)]
- void dirxml([in, optional] VARIANT *object);
- [id(7)]
- void error([in, optional] VARIANT *varargStart);
- [id(8)]
- void group([in, optional] VARIANT *label);
- [id(9)]
- void groupCollapsed([in, optional] VARIANT *label);
- [id(10)]
- void groupEnd();
- [id(11)]
- void info([in, optional] VARIANT *varargStart);
- [id(12)]
- void log([in, optional] VARIANT *varargStart);
- [id(13)]
- void time([in, optional] VARIANT *label);
- [id(14)]
- void timeEnd([in, optional] VARIANT *label);
- [id(15)]
- void trace([in, optional] VARIANT *varargStart);
- [id(16)]
- void warn([in, optional] VARIANT *varargStart);
+}
You shouldn't need dispinterface at all.
+[
- odl,
- oleautomation,
- dual,
- hidden,
- uuid(1b5939fc-8f84-43f3-8d89-f9a92069fad7)
+] +interface IWineConsoleGetter : IDispatch +{
- [propget, id(1)]
- HRESULT console([retval, out] IDispatch **console);
+}
It would be have a more generic name for this. I was hoping that we could use it for requestAnimationFrame as well (which would be a nice excuse to introduce it in a separated patch).
+[
- hidden,
- uuid(b84d405a-8057-4cc7-86c6-e872bb6205ad)
+] +dispinterface DispWineConsoleGetter +{ +properties: +methods:
- [propget, id(1)]
- IDispatch *console();
+}
Same here, dispinterface is not needed.
} /* library MSHTML_private */ 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");
+});
A test in documentmode.js "window_props" would be nice as well.
Thanks,
Jacek