Changeset 110642 in webkit


Ignore:
Timestamp:
Mar 13, 2012 4:57:32 PM (12 years ago)
Author:
mitz@apple.com
Message:

<rdar://problem/11025217> [Mac] Assertion failure in collectComplexTextRunsForCharactersCoreText
https://bugs.webkit.org/show_bug.cgi?id=77044

Reviewed by Sam Weinig.

Source/WebCore:

Test: platform/mac/fast/text/core-text-fallback-to-unknown-font.html

Handle the case of Core Text choosing a fallback font that NSFontManager cannot find by name.

  • platform/graphics/FontCache.h:

(FontCache): Made ComplexTextController a friend class.

  • platform/graphics/mac/ComplexTextControllerCoreText.mm:

(WebCore::ComplexTextController::collectComplexTextRunsForCharactersCoreText): Removed the
failing assertion, which was not true, and added code to handle the case where a font
cannot be found by name by using the font as returned from Core Text.

LayoutTests:

  • platform/mac/fast/text/core-text-fallback-to-unknown-font-expected.txt: Added.
  • platform/mac/fast/text/core-text-fallback-to-unknown-font.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r110641 r110642  
     12012-03-13  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/11025217> [Mac] Assertion failure in collectComplexTextRunsForCharactersCoreText
     4        https://bugs.webkit.org/show_bug.cgi?id=77044
     5
     6        Reviewed by Sam Weinig.
     7
     8        * platform/mac/fast/text/core-text-fallback-to-unknown-font-expected.txt: Added.
     9        * platform/mac/fast/text/core-text-fallback-to-unknown-font.html: Added.
     10
    1112012-03-13  Erik Arvidsson  <arv@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r110641 r110642  
     12012-03-13  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/11025217> [Mac] Assertion failure in collectComplexTextRunsForCharactersCoreText
     4        https://bugs.webkit.org/show_bug.cgi?id=77044
     5
     6        Reviewed by Sam Weinig.
     7
     8        Test: platform/mac/fast/text/core-text-fallback-to-unknown-font.html
     9
     10        Handle the case of Core Text choosing a fallback font that NSFontManager cannot find by name.
     11
     12        * platform/graphics/FontCache.h:
     13        (FontCache): Made ComplexTextController a friend class.
     14        * platform/graphics/mac/ComplexTextControllerCoreText.mm:
     15        (WebCore::ComplexTextController::collectComplexTextRunsForCharactersCoreText): Removed the
     16        failing assertion, which was not true, and added code to handle the case where a font
     17        cannot be found by name by using the font as returned from Core Text.
     18
    1192012-03-13  Erik Arvidsson  <arv@chromium.org>
    220
  • trunk/Source/WebCore/platform/graphics/FontCache.h

    r96342 r110642  
    131131    int m_purgePreventCount;
    132132
     133#if USE(CORE_TEXT)
     134    friend class ComplexTextController;
     135#endif
    133136    friend class SimpleFontData; // For getCachedFontData(const FontPlatformData*)
    134137    friend class FontFallbackList;
  • trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm

    r100765 r110642  
    272272                    }
    273273                    runFontData = fontCache()->getCachedFontData(m_font.fontDescription(), fontName.get(), false, FontCache::DoNotRetain);
     274                    // Core Text may have used a font that is not known to NSFontManager. In that case, fall back on
     275                    // using the font as returned, even though it may not have the best NSFontRenderingMode.
     276                    if (!runFontData) {
     277                        FontPlatformData runFontPlatformData((NSFont *)runFont, CTFontGetSize(runFont));
     278                        runFontData = fontCache()->getCachedFontData(&runFontPlatformData, FontCache::DoNotRetain);
     279                    }
    274280                }
    275                 ASSERT(runFontData);
    276281                if (m_fallbackFonts && runFontData != m_font.primaryFont())
    277282                    m_fallbackFonts->add(runFontData);
Note: See TracChangeset for help on using the changeset viewer.