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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110642
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-03-13 Dan Bernstein <mitz@apple.com>
+
+ <rdar://problem/11025217> [Mac] Assertion failure in collectComplexTextRunsForCharactersCoreText
+ https://bugs.webkit.org/show_bug.cgi?id=77044
+
+ Reviewed by Sam Weinig.
+
+ * 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.
+
2012-03-13 Erik Arvidsson <arv@chromium.org>
[V8] Use v8::V8::AddImplicitReferences instead of SetHiddenValue
--- /dev/null
+This test passes if it does not cause an assertion failure or a crash.
+
+◌̣
--- /dev/null
+<script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+<p>
+ This test passes if it does not cause an assertion failure or a crash.
+</p>
+<span style="font-weight: bold; font-family: helvetica">◌̣</span>
+2012-03-13 Dan Bernstein <mitz@apple.com>
+
+ <rdar://problem/11025217> [Mac] Assertion failure in collectComplexTextRunsForCharactersCoreText
+ https://bugs.webkit.org/show_bug.cgi?id=77044
+
+ Reviewed by Sam Weinig.
+
+ 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.
+
2012-03-13 Erik Arvidsson <arv@chromium.org>
[V8] Use v8::V8::AddImplicitReferences instead of SetHiddenValue
// Don't purge if this count is > 0;
int m_purgePreventCount;
+#if USE(CORE_TEXT)
+ friend class ComplexTextController;
+#endif
friend class SimpleFontData; // For getCachedFontData(const FontPlatformData*)
friend class FontFallbackList;
};
continue;
}
runFontData = fontCache()->getCachedFontData(m_font.fontDescription(), fontName.get(), false, FontCache::DoNotRetain);
+ // Core Text may have used a font that is not known to NSFontManager. In that case, fall back on
+ // using the font as returned, even though it may not have the best NSFontRenderingMode.
+ if (!runFontData) {
+ FontPlatformData runFontPlatformData((NSFont *)runFont, CTFontGetSize(runFont));
+ runFontData = fontCache()->getCachedFontData(&runFontPlatformData, FontCache::DoNotRetain);
+ }
}
- ASSERT(runFontData);
if (m_fallbackFonts && runFontData != m_font.primaryFont())
m_fallbackFonts->add(runFontData);
}