Changeset 192372 in webkit


Ignore:
Timestamp:
Nov 12, 2015, 11:37:53 AM (10 years ago)
Author:
mmaxfield@apple.com
Message:

[Cocoa] Font fallback is not language-sensitive
https://bugs.webkit.org/show_bug.cgi?id=147390

Reviewed by Dean Jackson.

Source/WebCore:

This re-applies r190754 in a somewhat more performant way.

Test: fast/text/fallback-language-han-2.html

  • platform/graphics/Font.cpp:

(WebCore::CharacterFallbackMapKey::CharacterFallbackMapKey):
(WebCore::CharacterFallbackMapKey::operator==):
(WebCore::CharacterFallbackMapKeyHash::hash):
(WebCore::Font::systemFallbackFontForCharacter):

  • platform/graphics/cocoa/FontCacheCoreText.cpp:

(WebCore::FontCache::systemFallbackForCharacters):

LayoutTests:

This patch adds a mismatch test to make sure a codepoint gets rendered differently given two different langs.

  • fast/text/fallback-language-han-2-expected-mismatch.html: Added.
  • fast/text/fallback-language-han-2.html: Added.
  • platform/efl/TestExpectations:
  • platform/gtk/TestExpectations:
  • platform/mac/TestExpectations:
  • platform/win/TestExpectations:
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r192369 r192372  
     12015-11-12  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [Cocoa] Font fallback is not language-sensitive
     4        https://bugs.webkit.org/show_bug.cgi?id=147390
     5
     6        Reviewed by Dean Jackson.
     7
     8        This patch adds a mismatch test to make sure a codepoint gets rendered differently given two different langs.
     9
     10        * fast/text/fallback-language-han-2-expected-mismatch.html: Added.
     11        * fast/text/fallback-language-han-2.html: Added.
     12        * platform/efl/TestExpectations:
     13        * platform/gtk/TestExpectations:
     14        * platform/mac/TestExpectations:
     15        * platform/win/TestExpectations:
     16
    1172015-11-11  Jon Honeycutt  <jhoneycutt@apple.com>
    218
  • trunk/LayoutTests/platform/efl/TestExpectations

    r191552 r192372  
    23572357# This test hardcodes the result of a platform-dependent font lookup algorithm.
    23582358fast/text/fallback-language-han.html [ Skip ]
     2359fast/text/fallback-language-han-2.html [ Skip ]
    23592360
    23602361# This test uses an MPEG-4 video
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r192365 r192372  
    25602560# This test hardcodes the result of a platform-dependent font lookup algorithm.
    25612561fast/text/fallback-language-han.html [ Skip ]
     2562fast/text/fallback-language-han-2.html [ Skip ]
    25622563
    25632564# This test uses an MPEG-4 video
  • trunk/LayoutTests/platform/mac/TestExpectations

    r192279 r192372  
    12701270# Language-specific font fallback is disabled on certain versions of OS X
    12711271webkit.org/b/147390 [ Mavericks Yosemite ElCapitan ] fast/text/fallback-language-han.html [ ImageOnlyFailure ]
     1272webkit.org/b/147390 [ Mavericks Yosemite ElCapitan ] fast/text/fallback-language-han-2.html [ ImageOnlyFailure ]
    12721273
    12731274# This test relies on iOS-specific font fallback.
  • trunk/LayoutTests/platform/win/TestExpectations

    r192365 r192372  
    31893189# This test hardcodes the result of a platform-dependent font lookup algorithm.
    31903190fast/text/fallback-language-han.html [ Skip ]
     3191fast/text/fallback-language-han-2.html [ Skip ]
    31913192
    31923193# Changing system language is not supported.
  • trunk/Source/WebCore/ChangeLog

    r192369 r192372  
     12015-11-12  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [Cocoa] Font fallback is not language-sensitive
     4        https://bugs.webkit.org/show_bug.cgi?id=147390
     5
     6        Reviewed by Dean Jackson.
     7
     8        This re-applies r190754 in a somewhat more performant way.
     9
     10        Test: fast/text/fallback-language-han-2.html
     11
     12        * platform/graphics/Font.cpp:
     13        (WebCore::CharacterFallbackMapKey::CharacterFallbackMapKey):
     14        (WebCore::CharacterFallbackMapKey::operator==):
     15        (WebCore::CharacterFallbackMapKeyHash::hash):
     16        (WebCore::Font::systemFallbackFontForCharacter):
     17        * platform/graphics/cocoa/FontCacheCoreText.cpp:
     18        (WebCore::FontCache::systemFallbackForCharacters):
     19
    1202015-11-11  Jon Honeycutt  <jhoneycutt@apple.com>
    221
  • trunk/Source/WebCore/platform/graphics/Font.cpp

    r191871 r192372  
    395395    }
    396396
    397     CharacterFallbackMapKey(UChar32 character, bool isForPlatformFont)
    398         : character(character)
     397    CharacterFallbackMapKey(const AtomicString& locale, UChar32 character, bool isForPlatformFont)
     398        : locale(locale)
     399        , character(character)
    399400        , isForPlatformFont(isForPlatformFont)
    400401    {
     
    410411    bool operator==(const CharacterFallbackMapKey& other) const
    411412    {
    412         return character == other.character && isForPlatformFont == other.isForPlatformFont;
     413        return locale == other.locale && character == other.character && isForPlatformFont == other.isForPlatformFont;
    413414    }
    414415
     
    418419    friend struct CharacterFallbackMapKeyHash;
    419420
     421    AtomicString locale;
    420422    UChar32 character { 0 };
    421423    bool isForPlatformFont { false };
     
    425427    static unsigned hash(const CharacterFallbackMapKey& key)
    426428    {
    427         return WTF::pairIntHash(key.character, key.isForPlatformFont);
     429        IntegerHasher hasher;
     430        hasher.add(key.character);
     431        hasher.add(key.isForPlatformFont);
     432        hasher.add(key.locale.isNull() ? 0 : key.locale.impl()->existingHash());
     433        return hasher.hash();
    428434    }
    429435
     
    456462    }
    457463
    458     auto key = CharacterFallbackMapKey(character, isForPlatformFont);
     464    auto key = CharacterFallbackMapKey(description.locale(), character, isForPlatformFont);
    459465    auto characterAddResult = fontAddResult.iterator->value.add(WTF::move(key), nullptr);
    460466
Note: See TracChangeset for help on using the changeset viewer.