Commit 68b773d5 authored by ojan@chromium.org's avatar ojan@chromium.org

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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54748 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 229936d0
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-02-12 Eric Seidel <eric@webkit.org>
No review, rolling out r54694.
......
......@@ -5,44 +5,44 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
Lucida Grande
input
size=1 clientWidth=22
size=2 clientWidth=27
size=3 clientWidth=33
size=4 clientWidth=38
size=5 clientWidth=43
size=10 clientWidth=70
size=20 clientWidth=124
size=50 clientWidth=286
size=100 clientWidth=556
size=500 clientWidth=2712
size=1000 clientWidth=5407
size=1 clientWidth=26
size=2 clientWidth=31
size=3 clientWidth=36
size=4 clientWidth=41
size=5 clientWidth=46
size=10 clientWidth=71
size=20 clientWidth=121
size=50 clientWidth=271
size=100 clientWidth=521
size=500 clientWidth=2521
size=1000 clientWidth=5021
textarea
cols=1 clientWidth=25
cols=2 clientWidth=30
cols=3 clientWidth=36
cols=4 clientWidth=41
cols=5 clientWidth=46
cols=10 clientWidth=73
cols=20 clientWidth=127
cols=50 clientWidth=289
cols=100 clientWidth=559
cols=500 clientWidth=2715
cols=1000 clientWidth=5410
cols=1 clientWidth=26
cols=2 clientWidth=33
cols=3 clientWidth=40
cols=4 clientWidth=47
cols=5 clientWidth=54
cols=10 clientWidth=89
cols=20 clientWidth=159
cols=50 clientWidth=369
cols=100 clientWidth=719
cols=500 clientWidth=3519
cols=1000 clientWidth=7019
Courier
input
size=1 clientWidth=13
size=2 clientWidth=20
size=3 clientWidth=27
size=4 clientWidth=34
size=5 clientWidth=41
size=10 clientWidth=76
size=20 clientWidth=146
size=50 clientWidth=356
size=100 clientWidth=706
size=500 clientWidth=3506
size=1000 clientWidth=7006
size=1 clientWidth=11
size=2 clientWidth=18
size=3 clientWidth=25
size=4 clientWidth=32
size=5 clientWidth=39
size=10 clientWidth=74
size=20 clientWidth=144
size=50 clientWidth=354
size=100 clientWidth=704
size=500 clientWidth=3504
size=1000 clientWidth=7004
textarea
cols=1 clientWidth=26
......@@ -59,44 +59,44 @@ cols=1000 clientWidth=7019
Helvetica
input
size=1 clientWidth=20
size=2 clientWidth=25
size=3 clientWidth=30
size=4 clientWidth=35
size=5 clientWidth=40
size=1 clientWidth=10
size=2 clientWidth=16
size=3 clientWidth=22
size=4 clientWidth=28
size=5 clientWidth=34
size=10 clientWidth=64
size=20 clientWidth=112
size=50 clientWidth=257
size=100 clientWidth=498
size=500 clientWidth=2427
size=1000 clientWidth=4838
size=20 clientWidth=124
size=50 clientWidth=304
size=100 clientWidth=604
size=500 clientWidth=3004
size=1000 clientWidth=6004
textarea
cols=1 clientWidth=24
cols=2 clientWidth=29
cols=3 clientWidth=34
cols=4 clientWidth=39
cols=5 clientWidth=44
cols=10 clientWidth=68
cols=20 clientWidth=116
cols=50 clientWidth=261
cols=100 clientWidth=502
cols=500 clientWidth=2431
cols=1000 clientWidth=4842
cols=1 clientWidth=25
cols=2 clientWidth=31
cols=3 clientWidth=37
cols=4 clientWidth=43
cols=5 clientWidth=49
cols=10 clientWidth=79
cols=20 clientWidth=139
cols=50 clientWidth=319
cols=100 clientWidth=619
cols=500 clientWidth=3019
cols=1000 clientWidth=6019
Monaco
input
size=1 clientWidth=10
size=2 clientWidth=17
size=3 clientWidth=24
size=4 clientWidth=31
size=5 clientWidth=38
size=10 clientWidth=73
size=20 clientWidth=143
size=50 clientWidth=353
size=100 clientWidth=703
size=500 clientWidth=3503
size=1000 clientWidth=7003
size=1 clientWidth=11
size=2 clientWidth=18
size=3 clientWidth=25
size=4 clientWidth=32
size=5 clientWidth=39
size=10 clientWidth=74
size=20 clientWidth=144
size=50 clientWidth=354
size=100 clientWidth=704
size=500 clientWidth=3504
size=1000 clientWidth=7004
textarea
cols=1 clientWidth=26
......@@ -113,44 +113,44 @@ cols=1000 clientWidth=7019
Times
input
size=1 clientWidth=23
size=2 clientWidth=28
size=3 clientWidth=32
size=4 clientWidth=37
size=5 clientWidth=42
size=10 clientWidth=65
size=20 clientWidth=111
size=50 clientWidth=250
size=100 clientWidth=482
size=500 clientWidth=2338
size=1000 clientWidth=4657
size=1 clientWidth=10
size=2 clientWidth=16
size=3 clientWidth=22
size=4 clientWidth=28
size=5 clientWidth=34
size=10 clientWidth=64
size=20 clientWidth=124
size=50 clientWidth=304
size=100 clientWidth=604
size=500 clientWidth=3004
size=1000 clientWidth=6004
textarea
cols=1 clientWidth=24
cols=2 clientWidth=29
cols=3 clientWidth=33
cols=4 clientWidth=38
cols=5 clientWidth=43
cols=10 clientWidth=66
cols=20 clientWidth=112
cols=50 clientWidth=251
cols=100 clientWidth=483
cols=500 clientWidth=2339
cols=1000 clientWidth=4658
cols=1 clientWidth=25
cols=2 clientWidth=31
cols=3 clientWidth=37
cols=4 clientWidth=43
cols=5 clientWidth=49
cols=10 clientWidth=79
cols=20 clientWidth=139
cols=50 clientWidth=319
cols=100 clientWidth=619
cols=500 clientWidth=3019
cols=1000 clientWidth=6019
Andale Mono
input
size=1 clientWidth=10
size=2 clientWidth=17
size=3 clientWidth=24
size=4 clientWidth=31
size=5 clientWidth=38
size=10 clientWidth=73
size=20 clientWidth=143
size=50 clientWidth=353
size=100 clientWidth=703
size=500 clientWidth=3503
size=1000 clientWidth=7003
size=1 clientWidth=11
size=2 clientWidth=18
size=3 clientWidth=25
size=4 clientWidth=32
size=5 clientWidth=39
size=10 clientWidth=74
size=20 clientWidth=144
size=50 clientWidth=354
size=100 clientWidth=704
size=500 clientWidth=3504
size=1000 clientWidth=7004
textarea
cols=1 clientWidth=26
......@@ -167,17 +167,17 @@ cols=1000 clientWidth=7019
Arial
input
size=1 clientWidth=26
size=2 clientWidth=31
size=3 clientWidth=36
size=4 clientWidth=41
size=5 clientWidth=46
size=10 clientWidth=70
size=20 clientWidth=118
size=50 clientWidth=263
size=100 clientWidth=504
size=500 clientWidth=2433
size=1000 clientWidth=4844
size=1 clientWidth=33
size=2 clientWidth=38
size=3 clientWidth=43
size=4 clientWidth=48
size=5 clientWidth=53
size=10 clientWidth=78
size=20 clientWidth=128
size=50 clientWidth=278
size=100 clientWidth=528
size=500 clientWidth=2528
size=1000 clientWidth=5028
textarea
cols=1 clientWidth=24
......@@ -185,12 +185,12 @@ cols=2 clientWidth=29
cols=3 clientWidth=34
cols=4 clientWidth=39
cols=5 clientWidth=44
cols=10 clientWidth=68
cols=20 clientWidth=116
cols=50 clientWidth=261
cols=100 clientWidth=502
cols=500 clientWidth=2431
cols=1000 clientWidth=4842
cols=10 clientWidth=69
cols=20 clientWidth=119
cols=50 clientWidth=269
cols=100 clientWidth=519
cols=500 clientWidth=2519
cols=1000 clientWidth=5019
Comic Sans MS
input
......@@ -199,39 +199,39 @@ size=2 clientWidth=23
size=3 clientWidth=28
size=4 clientWidth=33
size=5 clientWidth=38
size=10 clientWidth=64
size=20 clientWidth=115
size=50 clientWidth=269
size=100 clientWidth=525
size=500 clientWidth=2575
size=1000 clientWidth=5138
size=10 clientWidth=63
size=20 clientWidth=113
size=50 clientWidth=263
size=100 clientWidth=513
size=500 clientWidth=2513
size=1000 clientWidth=5013
textarea
cols=1 clientWidth=25
cols=2 clientWidth=30
cols=3 clientWidth=35
cols=4 clientWidth=40
cols=5 clientWidth=45
cols=10 clientWidth=71
cols=20 clientWidth=122
cols=50 clientWidth=276
cols=100 clientWidth=532
cols=500 clientWidth=2582
cols=1000 clientWidth=5145
cols=1 clientWidth=24
cols=2 clientWidth=29
cols=3 clientWidth=34
cols=4 clientWidth=39
cols=5 clientWidth=44
cols=10 clientWidth=69
cols=20 clientWidth=119
cols=50 clientWidth=269
cols=100 clientWidth=519
cols=500 clientWidth=2519
cols=1000 clientWidth=5019
Courier New
input
size=1 clientWidth=10
size=2 clientWidth=17
size=3 clientWidth=24
size=4 clientWidth=31
size=5 clientWidth=38
size=10 clientWidth=73
size=20 clientWidth=143
size=50 clientWidth=353
size=100 clientWidth=703
size=500 clientWidth=3503
size=1000 clientWidth=7003
size=1 clientWidth=12
size=2 clientWidth=19
size=3 clientWidth=26
size=4 clientWidth=33
size=5 clientWidth=40