Summary: | Problem of using "size" attribute to determine width of text input field | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yuzhu Shen <yuzhu.shen> | ||||||
Component: | Forms | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED DUPLICATE | ||||||||
Severity: | Normal | CC: | zsurocking | ||||||
Priority: | P2 | ||||||||
Version: | 523.x (Safari 3) | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Attachments: |
|
Description
Yuzhu Shen
2008-01-08 19:04:24 PST
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 |