Diff
Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (188275 => 188276)
--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog 2015-08-11 19:36:48 UTC (rev 188275)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog 2015-08-11 19:47:00 UTC (rev 188276)
@@ -1,3 +1,22 @@
+2015-08-11 Matthew Hanson <[email protected]>
+
+ Merge r188263. rdar://problem/22202935
+
+ 2015-08-11 Myles C. Maxfield <[email protected]>
+
+ [iOS] Arabic letter Yeh is drawn in LastResort
+ https://bugs.webkit.org/show_bug.cgi?id=147862
+ <rdar://problem/22202935>
+
+ Reviewed by Darin Adler.
+
+ * fast/text/arabic-glyph-cache-fill-combine-expected.html: Added.
+ * fast/text/arabic-glyph-cache-fill-combine.html: Added.
+ * platform/mac/TestExpectations: Mark test as iOS-specific
+ * platform/gtk/TestExpectations: Mark test as iOS-specific
+ * platform/efl/TestExpectations: Mark test as iOS-specific
+ * platform/efl/TestExpectations: Mark test as iOS-specific
+
2015-08-03 Matthew Hanson <[email protected]>
Merge r187778. rdar://problem/22098457
Added: branches/safari-601.1.46-branch/LayoutTests/fast/text/arabic-glyph-cache-fill-combine-expected.html (0 => 188276)
--- branches/safari-601.1.46-branch/LayoutTests/fast/text/arabic-glyph-cache-fill-combine-expected.html (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/text/arabic-glyph-cache-fill-combine-expected.html 2015-08-11 19:47:00 UTC (rev 188276)
@@ -0,0 +1,10 @@
+<!DOCTYPE>
+<html>
+<body>
+This test hits a codepath where codepoints were being combined before they were being input into our glyph cache.
+This character occurs just before combining marks in Unicode, and therefore was being erroneously combined. The test
+passes if the glyph is drawn in a font other than LastResort (if the test fails, the character looks like a box or like
+three horizontal lines).
+<div style="font: 50px 'Geeza Pro';">ي</div>
+</body>
+</html>
Added: branches/safari-601.1.46-branch/LayoutTests/fast/text/arabic-glyph-cache-fill-combine.html (0 => 188276)
--- branches/safari-601.1.46-branch/LayoutTests/fast/text/arabic-glyph-cache-fill-combine.html (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/text/arabic-glyph-cache-fill-combine.html 2015-08-11 19:47:00 UTC (rev 188276)
@@ -0,0 +1,10 @@
+<!DOCTYPE>
+<html>
+<body>
+This test hits a codepath where codepoints were being combined before they were being input into our glyph cache.
+This character occurs just before combining marks in Unicode, and therefore was being erroneously combined. The test
+passes if the glyph is drawn in a font other than LastResort (if the test fails, the character looks like a box or like
+three horizontal lines).
+<div style="font: 50px UICTFontTextStyleBody;">ي</div>
+</body>
+</html>
Modified: branches/safari-601.1.46-branch/LayoutTests/platform/efl/TestExpectations (188275 => 188276)
--- branches/safari-601.1.46-branch/LayoutTests/platform/efl/TestExpectations 2015-08-11 19:36:48 UTC (rev 188275)
+++ branches/safari-601.1.46-branch/LayoutTests/platform/efl/TestExpectations 2015-08-11 19:47:00 UTC (rev 188276)
@@ -2288,3 +2288,6 @@
accessibility/radio-button-group-members.html [ Missing ]
editing/selection/designmode-no-caret.html [ Missing ]
accessibility/content-editable-as-textarea.html [ Missing ]
+
+# This test relies on iOS-specific font fallback.
+fast/text/arabic-glyph-cache-fill-combine.html [ ImageOnlyFailure ]
Modified: branches/safari-601.1.46-branch/LayoutTests/platform/gtk/TestExpectations (188275 => 188276)
--- branches/safari-601.1.46-branch/LayoutTests/platform/gtk/TestExpectations 2015-08-11 19:36:48 UTC (rev 188275)
+++ branches/safari-601.1.46-branch/LayoutTests/platform/gtk/TestExpectations 2015-08-11 19:47:00 UTC (rev 188276)
@@ -2400,3 +2400,6 @@
# Test requires hardcoded font names, which I do not have for this port.
fast/text/han-generic-font-families.html [ WontFix ]
fast/text/hangul-generic-font-families.html [ WontFix ]
+
+# This test relies on iOS-specific font fallback.
+fast/text/arabic-glyph-cache-fill-combine.html [ ImageOnlyFailure ]
Modified: branches/safari-601.1.46-branch/LayoutTests/platform/mac/TestExpectations (188275 => 188276)
--- branches/safari-601.1.46-branch/LayoutTests/platform/mac/TestExpectations 2015-08-11 19:36:48 UTC (rev 188275)
+++ branches/safari-601.1.46-branch/LayoutTests/platform/mac/TestExpectations 2015-08-11 19:47:00 UTC (rev 188276)
@@ -1360,3 +1360,6 @@
[ ElCapitan+ ] canvas/philip/tests/2d.composite.uncovered.pattern.source-in.html [ Pass Failure ]
[ ElCapitan+ ] canvas/philip/tests/2d.composite.uncovered.fill.source-out.html [ Pass Failure ]
[ ElCapitan+ ] canvas/philip/tests/2d.composite.uncovered.fill.source-in.html [ Pass Failure ]
+
+# This test relies on iOS-specific font fallback.
+[ Mavericks Yosemite ElCapitan ] fast/text/arabic-glyph-cache-fill-combine.html [ ImageOnlyFailure ]
Modified: branches/safari-601.1.46-branch/LayoutTests/platform/win/TestExpectations (188275 => 188276)
--- branches/safari-601.1.46-branch/LayoutTests/platform/win/TestExpectations 2015-08-11 19:36:48 UTC (rev 188275)
+++ branches/safari-601.1.46-branch/LayoutTests/platform/win/TestExpectations 2015-08-11 19:47:00 UTC (rev 188276)
@@ -3124,3 +3124,6 @@
# New test for Bug 144830 (r186388) always fails.
http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-audio.html [ Failure ]
+
+# This test relies on iOS-specific font fallback.
+fast/text/arabic-glyph-cache-fill-combine.html [ ImageOnlyFailure ]
Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (188275 => 188276)
--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog 2015-08-11 19:36:48 UTC (rev 188275)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog 2015-08-11 19:47:00 UTC (rev 188276)
@@ -1,3 +1,44 @@
+2015-08-11 Matthew Hanson <[email protected]>
+
+ Merge r188263. rdar://problem/22202935
+
+ 2015-08-11 Myles C. Maxfield <[email protected]>
+
+ [iOS] Arabic letter Yeh is drawn in LastResort
+ https://bugs.webkit.org/show_bug.cgi?id=147862
+ <rdar://problem/22202935>
+
+ Reviewed by Darin Adler.
+
+ In order to perform font fallback, we must know which fonts support which characters. We
+ perform this check by asking each font to map a sequence of codepoints to glyphs, and
+ any glyphs which end up with a 0 value are unsupported by the font.
+
+ One of the mechanisms that we use to do this is to combine the code points into a string,
+ and tell Core Text to lay out the string. However, this is fundamentally a different
+ operation than the one we are trying to perform. Strings combine adjacent codepoints into
+ grapheme clusters, and CoreText operates on these. However, we are trying to gain
+ information regarding codepoints, not grapheme clusters.
+
+ Instead of taking this string-based approach, we should try harder to use Core Text
+ functions which operate on ordered collections of characters, rather than strings. In
+ particular, CTFontGetGlyphsForCharacters() and CTFontGetVerticalGlyphsForCharacters()
+ have the behavior we want where any unmapped characters end up with a 0 value glyph.
+
+ Previously, we were only using the result of those functions if they were successfully
+ able to map their entire input. However, given the fact that we can degrade gracefully
+ in the case of a partial mapping, we shouldn't need to bail completely to the
+ string-based approach should a partial mapping occur.
+
+ At some point we should delete the string-based approach entirely. However, this path
+ is still explicitly used for composite fonts. Fixing that use case is out of scope
+ for this patch.
+
+ Test: fast/text/arabic-glyph-cache-fill-combine.html
+
+ * platform/graphics/mac/GlyphPageMac.cpp:
+ (WebCore::GlyphPage::fill):
+
2015-08-09 Babak Shafiei <[email protected]>
Merge r188162.
Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp (188275 => 188276)
--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp 2015-08-11 19:36:48 UTC (rev 188275)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp 2015-08-11 19:47:00 UTC (rev 188276)
@@ -87,9 +87,11 @@
haveGlyphs = true;
}
}
- } else if (!fontData->platformData().isCompositeFontReference() && ((fontData->platformData().widthVariant() == RegularWidth)
- ? CTFontGetVerticalGlyphsForCharacters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength)
- : CTFontGetGlyphsForCharacters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength))) {
+ } else if (!fontData->platformData().isCompositeFontReference()) {
+ if (fontData->platformData().widthVariant() == RegularWidth)
+ CTFontGetVerticalGlyphsForCharacters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength);
+ else
+ CTFontGetGlyphsForCharacters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength);
// When buffer consists of surrogate pairs, CTFontGetVerticalGlyphsForCharacters and CTFontGetGlyphsForCharacters
// place the glyphs at indices corresponding to the first character of each pair.
ASSERT(!(bufferLength % length) && (bufferLength / length == 1 || bufferLength / length == 2));
@@ -103,6 +105,9 @@
}
}
} else {
+ // FIXME: webkit.org/b/147859 This code is fundamentally broken. A string is not the same as an ordered sequence of codepoints. In particular, strings
+ // combine adjacent codepoints into grapheme clusters. We should delete this entire else {} block.
+
// We ask CoreText for possible vertical variant glyphs
RetainPtr<CFStringRef> string = adoptCF(CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, buffer, bufferLength, kCFAllocatorNull));
RetainPtr<CFAttributedStringRef> attributedString = adoptCF(CFAttributedStringCreate(kCFAllocatorDefault, string.get(), fontData->getCFStringAttributes(0, fontData->hasVerticalGlyphs() ? Vertical : Horizontal)));