When using "size" attribute to determine the width of text input field, "its value refers to the (integer) number of characters" (HTML 4.0.1). Webkit (Safari 3.0.4 / 523.15) multiplies character width with this "size" value to determine the width, while IE & FF seem to use a non-linear algorithm. The html file in the attachment illustrates the difference between these browsers, please view it in various browsers and observe the width of the input fields. This problem affects many popular Chinese websites. For example: (Please refer to the attachment for snapshot.) http://vip.bokee.com/register.php http://www.5show.com/ http://www.cnfol.com/ http://www.people.com.cn/ http://www.92wy.com/ http://www.uusee.com/ http://www.wangyou.com/index2.html
Created attachment 18338 [details] Snapshot
Created attachment 18339 [details] An example for the problem.
I think this bug lies in RenderTextControl::calcPrefWidths(). It's better to use tmAveCharWidth rather than "using 0 as the nominal character" Also, in order to match IE, Firefox use "tmAveCharWidth * size + tmMaxCharWidth - 4" as the actual pixel width of the input text filed. The code is here: http://lxr.mozilla.org/mozilla/source/layout/forms/nsTextControlFrame.cpp in nsTextControlFrame::CalcIntrinsicSize
*** This bug has been marked as a duplicate of 15312 ***