Last modified: 2012-01-05 15:07:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T35496, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33496 - Misleading comment regarding preformatted font in commonElements.css
Misleading comment regarding preformatted font in commonElements.css
Status: VERIFIED FIXED
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
1.20.x
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-03 21:57 UTC by Erwin Dokter
Modified: 2012-01-05 15:07 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch for commonElements.css (740 bytes, patch)
2012-01-03 21:57 UTC, Erwin Dokter
Details

Description Erwin Dokter 2012-01-03 21:57:23 UTC
Created attachment 9796 [details]
Patch for commonElements.css

commonElements.css contains the following (annoyingly wrong) comment:

  * It's important for this rule to first reference an actual font name, some browsers will render the monospace text
  * too small otherwise, namely Firefox, Chrome and Safari

However, the rule refers to a generic font-family first for a reason: to trigger the correct font rendering behaviour *without* forcing a specific font. This patch has an updated comment:

  * Some browsers will render the monospace text too small, namely Firefox, Chrome and Safari.
  * Specifying any valid, second value will trigger correct behaviour without forcing a different font.

It also changes '"Courier New"' to just 'Courier', which works equally well (as the font is never selected anyway).
Comment 1 Mark A. Hershberger 2012-01-05 02:25:36 UTC
r108112 (After testing font name on w3's CSS validator)
Comment 2 Antoine "hashar" Musso (WMF) 2012-01-05 09:14:38 UTC
Thanks for the clarification Erwin!
Comment 3 Erwin Dokter 2012-01-05 12:52:32 UTC
You're welcome!

I actually gained some insight behind this 'bug' after viewing the test page. It's actually not a bug, but a result of the combination of a website's default font size and the browsers default font size for monospace.

By default, a (Windows) browser has it's default font-sizes set at 16px for serif and sans-serif, and 13px for monospace. Except in IE, where you cannot set any font-sizes... it uses 16px for all fonts.

Vector has a base font-size of 0.8em, and most browsers *correctly* scale down all fonts, including the monospace font, accordingly. So monospace is shown at 0.8 x 13px = 10px (which is perceived as 'too small'). But when you assign any font besides just "monospace", those browsers will no longer treat it as monospace and use 0.8 x 16px = 13px instead.

Another mystery solved.
Comment 4 Antoine "hashar" Musso (WMF) 2012-01-05 15:07:41 UTC
I have added your comment in r108142 :-D

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links