Ignore:
Timestamp:
02/12/10 19:20:20 (5 years ago)
Author:
ojan@chromium.org
Message:

2010-01-05 Ojan Vafai <ojan@chromium.org>

Reviewed by Eric Seidel.

Improve text control instrinsic widths.
https://bugs.webkit.org/show_bug.cgi?id=25566
https://bugs.webkit.org/show_bug.cgi?id=25581
https://bugs.webkit.org/show_bug.cgi?id=25958

Excluding list of updated results as the list is so long.

2010-01-05 Ojan Vafai <ojan@chromium.org>

Reviewed by Dan Bernstein.

Improve text control intrinsic widths.
https://bugs.webkit.org/show_bug.cgi?id=25566
https://bugs.webkit.org/show_bug.cgi?id=25581
https://bugs.webkit.org/show_bug.cgi?id=25958

For Mac fonts that have invalid avgCharWidth entries in the OS/2 table,
fallback to the Safari 4- behavior of using the width of a zero. For other
fonts, make Mac match Windows (and thus IE) metrics.

Lucida Grande is hard-coded to match MS Shell Dlg for inputs and
Courier New for textareas in order to match Safari Win, Firefox and, in
some cases IE (IE uses different default fonts depending on encoding).

The only case where we still don't match Windows is if no font-size is
set. The default font-size for form controls on the Mac is smaller and
thus text-control widths will be slightly smaller.

No new tests. Covered by existing tests.

  • platform/graphics/mac/SimpleFontDataMac.mm: (WebCore::SimpleFontData::platformCharWidthInit):
  • rendering/RenderTextControl.cpp: (WebCore::): (WebCore::RenderTextControl::hasValidAvgCharWidth): (WebCore::RenderTextControl::getAvgCharWidth): (WebCore::RenderTextControl::calcPrefWidths):
  • rendering/RenderTextControl.h: (WebCore::RenderTextControl::scaleEmToUnits):
  • rendering/RenderTextControlMultiLine.cpp: (WebCore::RenderTextControlMultiLine::getAvgCharWidth):
  • rendering/RenderTextControlMultiLine.h:
  • rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlSingleLine::getAvgCharWidth): (WebCore::RenderTextControlSingleLine::preferredContentWidth):
  • rendering/RenderTextControlSingleLine.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/platform/mac/fast/forms/input-appearance-disabled-expected.txt

    r43007 r54748  
    77        text run at (0,0) width 397: "This tests that text can not be inserted into a disabled text field. " 
    88      RenderBR {BR} at (397,14) size 0x0 
    9       RenderTextControl {INPUT} at (2,20) size 128x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 
     9      RenderTextControl {INPUT} at (2,20) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 
    1010      RenderText {#text} at (0,0) size 0x0 
    1111      RenderText {#text} at (0,0) size 0x0 
    12 layer at (13,31) size 122x13 
    13   RenderBlock {DIV} at (3,3) size 122x13 [color=#545454] 
     12layer at (13,31) size 119x13 
     13  RenderBlock {DIV} at (3,3) size 119x13 [color=#545454] 
    1414    RenderText {#text} at (1,0) size 63x13 
    1515      text run at (1,0) width 63: "Test Passed" 
Note: See TracChangeset for help on using the changeset viewer.