Closed Bug 163335 Opened 22 years ago Closed 22 years ago

the computed visual width of text <input > fields is wrong ( not wide enough to contain all letters )

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 92980

People

(Reporter: Rick.Ju, Assigned: attinasi)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1b) Gecko/20020722 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1b) Gecko/20020722 With the following HTML, the [13]-[AUG]-[2004] values are truncated. A third of the 3, the G and half of the 4 are truncated. <html> <body> <form name="appForm" method="post" action="NewQ.servlet"> <input value="13" size="2" maxlength="2" name="day">- <input value="AUG" size="3" maxlength="3" name="month">- <input value="2004" size="4" maxlength="4" name="year"> </form> </body> </html> Reproducible: Always Steps to Reproduce: look at Details Some web applications need very much that the text input can display all its text . IE can do it rigthly. I looked at nsTextControlFrame.cpp and can't figure out why we use GetAveCharWith(). It seems that IE is using GetMaxCharWidth().( the input width in IE is always equals a upper-case string's width whild greater than a lower-case string's width) Since there is no GetMaxCharWidth() in nsIFontMetrics & nsRenderContext. Maybe we can simulate one, e.g using char 'X' width. btw, I didn't try it on Windows version.
it's patch for discussing, only for unix platform
*** This bug has been marked as a duplicate of 92980 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Rick, add your comments/discussion to bug 92980 instead. Also read the various bugs referenced in bug 92980. In my opinion a discussion for "Unix only" is not very meaningful. This is a complex issue where finding the right algorithm that works well for *all* platforms and for *all* font families/sizes is difficult (if not impossible). But I agree with you - the current algorithm needs to be improved...
v.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: