Closed Bug 78526 Opened 23 years ago Closed 23 years ago

[FIX]text in form controls has become too small under strict mode

Categories

(Core :: Layout: Form Controls, defect)

x86
Other
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.9.2

People

(Reporter: jameslariviere, Assigned: rods)

References

()

Details

Attachments

(5 files)

Over the past week the default monospace font size used in JUST strict mode has
become smaller (too small in my opinion) for textarea, input[type="text"], etc.
for form controls.  I need a magnifying glass to read damn text in forms.

I will post up a screenshot comparing last weeks nighly to current (5-1-04 win
build) on a site I work on (url field).
I fixed Bug 64331 so the nsDeviceContextWin no longer added 2 point sizes to the 
font when it got it's system properties. The logFontHieght
can come back negative in some instances and the rounding was incorrect. 

I did a lot of testing, but forgot to test it in Strict mode. 

In nsCSStyleRule.cpp (ages ago) Pierre added the platform specific ifdefs when 
we are in quirks mode to use the appropriate font name and
font size. 

Since I have now fixed a kludge in nsDeviceContextWin.cpp the font for a "Field" 
is now 2 point sizes too small, but if we were to use the
default size, but NOT the name, for Strict mode it works again. 
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Summary: text in form controls has become too small under strict mode → [FIX?]text in form controls has become too small under strict mode
Target Milestone: --- → mozilla0.9.1
Then, this should be an easy fix. Good. :-)

THanks rod.
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Attached patch patchSplinter Review
Ignore this last patch....
Attached patch final patchSplinter Review
With the latest patch installed, I have a few questions.
For the eSystemAttr_Font_Field: in strict mode the font size is reduced 2 point
sizes, but for NavQuirks it isn't.

for both eSystemAttr_Font_Button, eSystemAttr_Font_List the font is size is
always reduced by 2 points regardless of whether its strict or NavQuirks?

Is this correct?.  If it is please add a comment to the code to explain why the
size is reduced in at all and why it only needs to be reduced for
eSystemAttr_Font_Field.



   switch (sysID) {
            case eSystemAttr_Font_Field:
              if (eCompatibility_NavQuirks == mode) {
                font->mFont.name.AssignWithConversion("monospace");
                font->mFont.size = defaultFixedFont.size;
              } else {
                font->mFont.size = PR_MAX(defaultFont.size -
NSIntPointsToTwips(2), 0);
              }
              break;
            case eSystemAttr_Font_Button:
            case eSystemAttr_Font_List:
              if (eCompatibility_NavQuirks == mode) {
                font->mFont.name.AssignWithConversion("sans-serif");
              }
              font->mFont.size = PR_MAX(defaultFont.size -
NSIntPointsToTwips(2), 0);
              break;
          }
For the text field the catch is that in NavQuirks we use a fixed font and 
therefore we use the default size as defined by the browser, which happens to be 
the correct point size. 

In strict mode, we now want to use a proportional font and so we use a point 
size as defined by the browser. Well, it wouldn't make any sense to use a 
proportional font and the "fixed" font size to get the correct results. So it 
means we need to use the "defaultFont" size which is a proportional font (and as 
it turns out we are then doing what we need to do for buttons) Which is use the 
default size - minus 2 points sizes because it is too large otherwise. 

For button and selects we always use the default size minus 2 points because 
when in NavQuirks or when using the system font it is always a proportional font 
and since we want to use a size that is defined by the browser, we once again 
use the defaultFont size and decrease it by 2 point sizes.

Also, note that for buttons and select the font difference between sans-serif 
and the system default which is "MS Sans Serif" is very minor, but still very 
important.

I will attach a new patch with a less verbose explanation.
Summary: [FIX?]text in form controls has become too small under strict mode → [FIX]text in form controls has become too small under strict mode
Rod, what does this need to get patched in?
It's now up for review
Keywords: review
sr=attinasi
The patch is the same it has just moved files because og hyatt's rework of style 
resolution.
Blocks: 83989
a=dbaron for trunk checkin (on behalf of drivers)... although I'm a little
concerned that we have to be messing with system fonts at this level (I would
think what happens in gfx ought to work in all cases).

Sorry this one fell through the cracks for a bit.
I agree Pierre should have NEVER put the platform ifdefs in the code, I think I 
may already have filed a bug about removing them.
fixed
fixed, really...
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
verf.

great now I can read form controls again without a microscope ;-).

win build 06-08-20
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: