Bug 67851 - inconsistent choice of fonts for form widgets
Summary: inconsistent choice of fonts for form widgets
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml forms (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-11 05:58 UTC by David Chester
Modified: 2004-01-10 22:02 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
a proposed patch (822 bytes, patch)
2003-11-30 20:39 UTC, David Chester
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Chester 2003-11-11 05:58:17 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:          Linux

Consider this HTML form:

<form>
<input type="text" size="25" />
<br>
<input size="25" /> 
<br><br>
<font face="Times New Roman">Enter text:
<input size="25" /> 
</form>

Both Mozilla and Opera display text typed in all three input boxes in a proportional sans-serif default-UI type of font.  

However, in Konqueror these three input boxes have three different fonts applied to text typed in them.  Text in the first input box is rendered in a monospaced font; the second input box gets a sans-serif font (as expected); and the third input box gets Times New Roman.

The HTML for the second input box differs from that of the first only in the omission of 'type="text"', yet the input boxes have different fonts.  (The two input boxes at http://bugs.kde.org/ differ in this way, with the same results as above.)

On the third input box: Neither Mozilla nor Opera applies font styles of text preceding a form element to text within the form element itself.  This is true not only of input boxes, but also of buttons, drop-down menus, and other form elements.  In the example above, Konqueror does not follow that pattern, applying the Times New Roman face to the input box which follows the text for which the font style was meant. 

By "font styles" I mean both face and size. So while Mozilla and Opera will display the following buttons identically, Konqueror will display them very differently:

<form>
<font face="Arial" size="5">
<input type="submit" />
</font>
<font face="Times New Roman" size="1">
<input type="submit" />
</font>
</form>

I think that to emulate the standard way (the Mozilla, Opera way) of handling fonts in form elements is desirable.  Fonts for buttons, drop-downs, lists, and input boxes should either be matched to the "General" UI font, as specified in kdeglobals, or maybe to a relatively small size of the "Sans serif font" selected in Konqueror's font preferences dialog.  However the form widget font is determined, once picked, it should be consistent in face and size on all form elements (unless specifically altered through css).  

It seems worthwhile to note that Mozilla and Opera make an exception for textareas, defaulting to a monospaced font rather than a sans-serif one; and Konqueror does as well.
Comment 1 David Chester 2003-11-30 20:39:44 UTC
Created attachment 3481 [details]
a proposed patch

This patch to kdelibs/khtml/css/html4.css fixes all problems mentioned above
for me.  With this applied, the appearance of fonts in form elements is
consistent with that of Mozilla, IE, Opera.
Comment 2 Dirk Mueller 2004-01-10 22:02:55 UTC
Subject: kdelibs/khtml

CVS commit by mueller: 

fix form default stylings. 
CCMAIL: 67851-done@bugs.kde.org


  M +7 -0      ChangeLog   1.147
  M +4 -2      css/html4.css   1.124


--- kdelibs/khtml/ChangeLog  #1.146:1.147
@@ -1,4 +1,11 @@
 2004-01-10  Dirk Mueller  <mueller@kde.org>
 
+        * css/html4.css: fix default font/fontsize of input,select and textarea
+        (#67851).
+
+        * misc/loader_jpeg.cpp (decode): try hard not to shoot
+        down the machine with large images 
+        (try http://www.parisc-linux.org/~willy/kde/graph.jpg)
+
         * rendering/render_image.cpp (layout): ugh, major stupidity. don't rescale large
         images if nobody explicitely asked for it. makes loading of very large images 

--- kdelibs/khtml/css/html4.css  #1.123:1.124
@@ -379,4 +379,6 @@
 
 INPUT { color: windowtext; 
+        font-family: sans-serif;
+        font-size: medium;
         margin: 0__qem;
 }
@@ -393,5 +395,4 @@
 INPUT[type="text"], INPUT[type="password"] {
         cursor: text;
-        font-family: monospace;
         text-align: left;
 }
@@ -416,5 +417,5 @@
 
 SELECT { 
-        font-size: medium; 
+        font-size: sans-serif;
         color: windowtext; 
         margin: 0__qem;
@@ -423,4 +424,5 @@
 TEXTAREA { 
         color: windowtext; 
+        font-size: normal;
         font-family: monospace; 
         margin: 0__qem;