- fixed <rdar://problem/
4010196> REGRESSION (125-186+): 8-character timestamps in gmail wrap to 2 lines (width:8ex; font-size:80%)
* WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer xHeight]): Return the maximum
of the "x" height and width. Comment in the code explains why in more detail.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8670
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2005-02-23 Darin Adler <darin@apple.com>
+
+ Reviewed by Hyatt.
+
+ - fixed <rdar://problem/4010196> REGRESSION (125-186+): 8-character timestamps in gmail wrap to 2 lines (width:8ex; font-size:80%)
+
+ * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer xHeight]): Return the maximum
+ of the "x" height and width. Comment in the code explains why in more detail.
+
2005-02-22 Richard Williamson <rjw@apple.com>
Fixed <rdar://problem/3937203> when a div adds a scrollbar (overflow:auto) we do not get regions
NSGlyph xGlyph = [font glyphWithName:@"x"];
if (xGlyph) {
NSRect xBox = [font boundingRectForGlyph:xGlyph];
- return NSMaxY(xBox);
+ // Use the maximum of either width or height because "x" is nearly square
+ // and web pages that foolishly use this metric for width will be laid out
+ // poorly if we return an accurate height. Classic case is Times 13 point,
+ // which has an "x" that is 7x6 pixels.
+ return MAX(NSMaxX(xBox), NSMaxY(xBox));
}
return [font xHeight];