Bug 34322

Summary: Web Inspector: REGRESSION(r54001): Web inspector monospace font is wrong on some versions of Mac OS X
Product: WebKit Reporter: Mark Rowe (bdash) <mrowe>
Component: Web Inspector (Deprecated)Assignee: Alexander Pavlov (apavlov) <apavlov>
Status: RESOLVED FIXED    
Severity: Normal CC: bweinstein, commit-queue, joepeck, keishi, pfeldman, pmuellr, rik, timothy
Priority: P2 Keywords: InRadar, Regression
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Fix MacOS X version detection (in userAgent can have 2 or 3 segments) none

Description Mark Rowe (bdash) 2010-01-29 03:11:30 PST
On Mac OS X 10.6 the monospace font in the inspector is Monaco rather than Menlo as expected.

This regression was caused by <http://trac.webkit.org/changeset/54001>, which introduced JavaScript code to detect that Mac OS X version and uses that information to choose which monospace font should be used.  However, the manner in which it parses the Mac OS X version is broken.  It assumes that Mac OS X version numbers always have three components, which is clearly not the case.  The code also makes the strange decision that if the user agent string is from a version of Mac OS X it is not familiar with that it must be running on 10.5.

It’s not at all clear to me why the inspector is attempting to detect platforms from JavaScript like this.  The inspector was already set up to use the correct platform-specific monospace fonts by configuring the default fixed-width font and size before creating the inspector’s WebView (see <http://trac.webkit.org/browser/trunk/WebKit/mac/WebCoreSupport/WebInspectorClient.mm#L189> for example).
Comment 1 Mark Rowe (bdash) 2010-01-29 03:23:51 PST
<rdar://problem/7590854>
Comment 2 Alexander Pavlov (apavlov) 2010-01-29 07:18:39 PST
Created attachment 47716 [details]
[PATCH] Fix MacOS X version detection (in userAgent can have 2 or 3 segments)
Comment 3 WebKit Commit Bot 2010-01-29 09:22:30 PST
Comment on attachment 47716 [details]
[PATCH] Fix MacOS X version detection (in userAgent can have 2 or 3 segments)

Clearing flags on attachment: 47716

Committed r54067: <http://trac.webkit.org/changeset/54067>
Comment 4 WebKit Commit Bot 2010-01-29 09:22:37 PST
All reviewed patches have been landed.  Closing bug.