https://bugs.webkit.org/show_bug.cgi?id=89843
Reviewed by Dan Bernstein.
Source/WebCore:
mac port treats ZWJ (zero-width-joiner) and ZWNJ (zero-width-non-joiner) as a part of combining
character sequence. This could cause a problem when the font doesn't have glyph mapping of ZWJ and ZWNJ.
Suppose the text to be rendered is "U+0645(MEEM) U+06CC(FARSI YEH) U+200C(ZWNJ)". In this case, U+0645
and U+06CC are rendered in isolated form if the font doesn't have a glyph for ZWNJ. They should be joined.
This patch changes handling of ZWJ and ZWNJ. Treats ZWJ and ZWNJ as base characters so that a complex text
run isn't separate at the point of ZWJ and ZWNJ even the font doesn't contain glyphs for them.
If ComplexTextController finds ZWJ, it doesn't split the current complex text run.
Test: platform/mac/fast/text/arabic-zwj-and-zwnj.html
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::advanceByCombiningCharacterSequence): Don't treat ZWJ and ZWNJ as a part of combining character sequence.
(WebCore::ComplexTextController::collectComplexTextRuns): Set fontData to nextFontData if the baseCharacter is ZWJ.
LayoutTests:
* platform/mac/fast/text/arabic-zwj-and-zwnj-expected.html: Added.
* platform/mac/fast/text/arabic-zwj-and-zwnj.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121643
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-07-01 Kenichi Ishibashi <bashi@chromium.org>
+
+ Arabic shaping is incorrect if ZWNJ exist
+ https://bugs.webkit.org/show_bug.cgi?id=89843
+
+ Reviewed by Dan Bernstein.
+
+ * platform/mac/fast/text/arabic-zwj-and-zwnj-expected.html: Added.
+ * platform/mac/fast/text/arabic-zwj-and-zwnj.html: Added.
+
2012-07-01 Emil A Eklund <eae@chromium.org>
Unreviewed rebaseline for mac post r121599.
--- /dev/null
+<!DOCTYPE html>
+<meta charset="utf-8">
+<head>
+</head>
+<p>The first word contains ZWJ. The first word should be identical with the second word.</p>
+<div style="font-size: 36pt;">
+میخور
+</div>
+<div style="font-size: 36pt;">
+میخور
+</div>
+
+<p>The last character of the first word is ZWNJ. The first word should be identical with the second word.</p>
+<div style="font-size: 36pt;">
+می
+</div>
+<div style="font-size: 36pt;">
+می
+</div>
--- /dev/null
+<!DOCTYPE html>
+<meta charset="utf-8">
+<head>
+</head>
+<p>The first word contains ZWJ. The first word should be identical with the second word.</p>
+<div style="font-size: 36pt;">
+می‍خور
+</div>
+<div style="font-size: 36pt;">
+میخور
+</div>
+
+<p>The last character of the first word is ZWNJ. The first word should be identical with the second word.</p>
+<div style="font-size: 36pt;">
+می‌
+</div>
+<div style="font-size: 36pt;">
+می
+</div>
+2012-07-01 Kenichi Ishibashi <bashi@chromium.org>
+
+ Arabic shaping is incorrect if ZWNJ exist
+ https://bugs.webkit.org/show_bug.cgi?id=89843
+
+ Reviewed by Dan Bernstein.
+
+ mac port treats ZWJ (zero-width-joiner) and ZWNJ (zero-width-non-joiner) as a part of combining
+ character sequence. This could cause a problem when the font doesn't have glyph mapping of ZWJ and ZWNJ.
+ Suppose the text to be rendered is "U+0645(MEEM) U+06CC(FARSI YEH) U+200C(ZWNJ)". In this case, U+0645
+ and U+06CC are rendered in isolated form if the font doesn't have a glyph for ZWNJ. They should be joined.
+
+ This patch changes handling of ZWJ and ZWNJ. Treats ZWJ and ZWNJ as base characters so that a complex text
+ run isn't separate at the point of ZWJ and ZWNJ even the font doesn't contain glyphs for them.
+ If ComplexTextController finds ZWJ, it doesn't split the current complex text run.
+
+ Test: platform/mac/fast/text/arabic-zwj-and-zwnj.html
+
+ * platform/graphics/mac/ComplexTextController.cpp:
+ (WebCore::advanceByCombiningCharacterSequence): Don't treat ZWJ and ZWNJ as a part of combining character sequence.
+ (WebCore::ComplexTextController::collectComplexTextRuns): Set fontData to nextFontData if the baseCharacter is ZWJ.
+
2012-07-01 Konrad Piascik <kpiascik@rim.com>
[EFL] [GTK] [QT] fast/viewport/viewport-91.html is failing after r121555
UChar32 nextCharacter;
int markLength = 0;
U16_NEXT(iterator, markLength, end - iterator, nextCharacter);
- if (!(U_GET_GC_MASK(nextCharacter) & U_GC_M_MASK) && nextCharacter != zeroWidthJoiner && nextCharacter != zeroWidthNonJoiner)
+ if (!(U_GET_GC_MASK(nextCharacter) & U_GC_M_MASK))
break;
markCount += markLength;
iterator += markLength;
}
nextIsMissingGlyph = false;
+ if (baseCharacter == zeroWidthJoiner)
+ nextFontData = fontData;
#if !PLATFORM(WX)
- nextFontData = m_font.fontDataForCombiningCharacterSequence(cp + index, curr - cp - index, nextIsSmallCaps ? SmallCapsVariant : NormalVariant);
- if (!nextFontData) {
- if (markCount)
- nextFontData = systemFallbackFontData();
- else
- nextIsMissingGlyph = true;
+ else {
+ nextFontData = m_font.fontDataForCombiningCharacterSequence(cp + index, curr - cp - index, nextIsSmallCaps ? SmallCapsVariant : NormalVariant);
+ if (!nextFontData) {
+ if (markCount)
+ nextFontData = systemFallbackFontData();
+ else
+ nextIsMissingGlyph = true;
+ }
}
#endif