mshtml and friends

Reece Dunn msclrhd at
Wed Sep 29 07:30:26 CDT 2010

On 29 September 2010 11:39, Jacek Caban <jacek at> wrote:
>  On 9/28/10 9:37 PM, Reece Dunn wrote:
>> On 28 September 2010 15:14, Jacek Caban<jacek at>  wrote:
>>>> I am interested in helping out to improve this area -- my aim is to
>>>> not require the `winetricks ie6` command to get some of these
>>>> applications (specifically the Big Fish Games client) to a usable
>>>> state.
>>>> Therefore, I am wondering if anyone knows where the best place is to
>>>> start looking (e.g. known areas of missing functionality) or how to
>>>> debug applications (and interpret WINEDEBUG output) to identify where
>>>> the issues are.
>>> There is no single answer. You want mshtml debug channel for most cases.
>>> If
>>> the problem is with embedding document in an app, then shdocvw is also
>>> useful. If you have scripts that don't work (and we use jscript for
>>> them),
>>> then jscript debug channel is the answer. If you have a problem with
>>> loading
>>> document, I'd add urlmon,wininet channel.
>> After some digging around, there appears to be some issues with the
>> jscript.dll implementation:
>>    $ trace:jscript:DispatchEx_QueryInterface
>> (0x1dad2d0)->(IID_IDispatchJS 0x33d5e8)
>>    $ trace:jscript:DispatchEx_AddRef (0x1dad2d0) ref=7
>>    $ trace:jscript:prop_get L"SWFObject" ret {VT_EMPTY}
>>    $ trace:jscript:DispatchEx_Release (0x1dad2d0) ref=6
>>    $ trace:jscript:DispatchEx_Release (0x1dad2d0) ref=5
>>    $ fixme:jscript:new_expression_eval throw TypeError
>> The new_expression_eval fixme is because V_VT(&constr) == VT_EMPTY.
>> Now SWFObject is defined in a<script>  file, but there are various
>> script files. For example, given a html file containing:
>>     <script src="a.js"></script>
>>     <script src="b.js"></script>
>> with a.js:
>>     function SWFObject() { this.x = 5; }
>> and b.js:
>>     var swf = new SWFObject(); // appears to be erroring here
>>     alert(swf.x);
>> Is this supported currently in Wine, or am I going down the wrong track?
> It's a known regression. A hack from bug 24365 should work around it.

OK. Thanks. I'll use that to proceed on the issues with Big fish Games.

I am also planning on improving wine's behaviour in this regard on
error (to assist in tracking down regressions/unimplemented
behaviour). The details will likely change as I progress on this.

	1/ new_expression_eval @ dlls/jscript/engine.c -- FIXME: throw TypeError

		a/ add dlls/jscript/tests/api.js test -- 'new null;' throws TypeError
		b/ call throw_type_error @ dlls/jscript/error.c

		==> I have a patch for this, just need to run it on winetestbot to
verify Windows behaviour.

	2/ Test unhandled exceptions when parsing scripts

		a/ dlls/jscript/tests/activex.c -- add a test_jscript_error function
		b/ modify parse_script_a to support expected error code tests
		c/ call parse_script_a(script, "new null;", error)
			i/   thrown error -- throw TypeError();
			ii/  unexpected   -- new null;
			iii/ parse error  -- new ;
			iv/  caught error does not call ActiveScriptSite_OnScriptError --
try { new null; } catch (e) {}
		d/ if FAILED(parse_script_a)
			i/  check if ActiveScriptSite_OnScriptError is called
			ii/ test values on IActiveScriptError object
		e/ implement calling ActiveScriptSite_OnScriptError in wine's
jscript correctly

	3/ ActiveScriptSite_OnScriptError @ dlls/mshtml/script.c

		a/ add dlls/mshtml/tests/script.c test
			==> mshtml.ActiveScriptSite_OnScriptError fires an onerror event
		b/ implement the behaviour in wine

	4/ Real-world test case:

		a/ add a new dlls/mshtml/tests/jserror.html file:
				called_onerror = false;
				function trigger_error(){ throw SomeError(); }
			<body onerror="called_onerror = true;" onload="trigger_error();

	5/ test/investigate the default mshtml onerror behaviour

- Reece

More information about the wine-devel mailing list