diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index 927d95ab9e5..efdff177cec 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -393,8 +393,10 @@ static HRESULT String_fontcolor(DispatchEx *dispex, LCID lcid, WORD flags, DISPP static HRESULT String_fontsize(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + static const WCHAR fontW[] = {'F','O','N','T',0}; + static const WCHAR colorW[] = {'S','I','Z','E',0}; + + return do_attribute_tag_format(dispex, lcid, flags, dp, retv, ei, sp, fontW, colorW); } static HRESULT String_indexOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 2368a4bd521..fe2093981a0 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -318,6 +318,22 @@ ok(tmp === "test", "'test'.fontcolor(3) = " + tmp); tmp = "test".fontcolor("green"); ok(tmp === "test", "'test'.fontcolor('green') = " + tmp); +tmp = "".fontsize(); +ok(tmp === "", "''.fontsize() = " + tmp); +tmp = "".fontsize(3); +ok(tmp === "", "''.fontsize(3) = " + tmp); +tmp = "".fontsize("red"); +ok(tmp === "", "''.fontsize('red') = " + tmp); +tmp = "test".fontsize(); +ok(tmp === "test", "'test'.fontsize() = " + tmp); +tmp = "test".fontsize(3); +ok(tmp === "test", "'test'.fontsize(3) = " + tmp); +tmp = "test".fontsize("green"); +ok(tmp === "test", "'test'.fontsize('green') = " + tmp); + +tmp = ("".fontcolor()).fontsize(); +ok(tmp === "", "(''.fontcolor()).fontsize() = " + tmp); + tmp = "".italics(); ok(tmp === "", "''.italics() = " + tmp); tmp = "".italics(3);