Changeset 149880 in webkit


Ignore:
Timestamp:
May 10, 2013 9:18:31 AM (11 years ago)
Author:
dino@apple.com
Message:

Don't trust character widths for internal OS X fonts in form controls
https://bugs.webkit.org/show_bug.cgi?id=115883
<rdar://problem/13817757>

Reviewed by Darin Adler.

We ignore the character width for a bunch of fonts when predicting
the width of a form control. Some of the internal fonts in OS X are
not in the ignored list. Rather than add them, simply test for
fonts whose family begins with a period character ".".

  • rendering/RenderTextControl.cpp:

(WebCore::RenderTextControl::hasValidAvgCharWidth): Return false for

any family that starts with "."

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r149879 r149880  
     12013-05-09  Dean Jackson  <dino@apple.com>
     2
     3        Don't trust character widths for internal OS X fonts in form controls
     4        https://bugs.webkit.org/show_bug.cgi?id=115883
     5        <rdar://problem/13817757>
     6
     7        Reviewed by Darin Adler.
     8
     9        We ignore the character width for a bunch of fonts when predicting
     10        the width of a form control. Some of the internal fonts in OS X are
     11        not in the ignored list. Rather than add them, simply test for
     12        fonts whose family begins with a period character ".".
     13
     14        * rendering/RenderTextControl.cpp:
     15        (WebCore::RenderTextControl::hasValidAvgCharWidth): Return false for
     16            any family that starts with "."
     17
    1182013-05-10  Carlos Garcia Campos  <cgarcia@igalia.com>
    219
  • trunk/Source/WebCore/rendering/RenderTextControl.cpp

    r147135 r149880  
    219219bool RenderTextControl::hasValidAvgCharWidth(AtomicString family)
    220220{
    221     static HashSet<AtomicString>* fontFamiliesWithInvalidCharWidthMap = 0;
    222 
    223221    if (family.isEmpty())
    224222        return false;
    225223
     224    // Internal fonts on OS X also have an invalid entry in the table for avgCharWidth.
     225    // They are hidden by having a name that begins with a period, so simply search
     226    // for that here rather than try to keep the list up to date.
     227    if (family.startsWith('.'))
     228        return false;
     229
     230    static HashSet<AtomicString>* fontFamiliesWithInvalidCharWidthMap = 0;
     231   
    226232    if (!fontFamiliesWithInvalidCharWidthMap) {
    227233        fontFamiliesWithInvalidCharWidthMap = new HashSet<AtomicString>;
Note: See TracChangeset for help on using the changeset viewer.