Module: wine Branch: master Commit: 0a0731ed450e889d924c7266b7829bbb4e4aca45 URL: http://source.winehq.org/git/wine.git/?a=commit;h=0a0731ed450e889d924c7266b7...
Author: Piotr Caban piotr.caban@gmail.com Date: Thu Jul 9 20:09:10 2009 +0200
jscript: Added String_fontsize implementation.
---
dlls/jscript/string.c | 6 ++++-- dlls/jscript/tests/api.js | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index 927d95a..efdff17 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 2368a4b..fe20939 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -318,6 +318,22 @@ ok(tmp === "<FONT COLOR="3">test</FONT>", "'test'.fontcolor(3) = " + tmp); tmp = "test".fontcolor("green"); ok(tmp === "<FONT COLOR="green">test</FONT>", "'test'.fontcolor('green') = " + tmp);
+tmp = "".fontsize(); +ok(tmp === "<FONT SIZE="undefined"></FONT>", "''.fontsize() = " + tmp); +tmp = "".fontsize(3); +ok(tmp === "<FONT SIZE="3"></FONT>", "''.fontsize(3) = " + tmp); +tmp = "".fontsize("red"); +ok(tmp === "<FONT SIZE="red"></FONT>", "''.fontsize('red') = " + tmp); +tmp = "test".fontsize(); +ok(tmp === "<FONT SIZE="undefined">test</FONT>", "'test'.fontsize() = " + tmp); +tmp = "test".fontsize(3); +ok(tmp === "<FONT SIZE="3">test</FONT>", "'test'.fontsize(3) = " + tmp); +tmp = "test".fontsize("green"); +ok(tmp === "<FONT SIZE="green">test</FONT>", "'test'.fontsize('green') = " + tmp); + +tmp = ("".fontcolor()).fontsize(); +ok(tmp === "<FONT SIZE="undefined"><FONT COLOR="undefined"></FONT></FONT>", "(''.fontcolor()).fontsize() = " + tmp); + tmp = "".italics(); ok(tmp === "<I></I>", "''.italics() = " + tmp); tmp = "".italics(3);