[webkit-reviews] review requested: [Bug 79961] Font fallback in cr-win is wrong for string contains zero-width-space : [Attachment 130881] patch w/ layout test

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 21 11:19:42 PDT 2012


Xiaomei Ji <xji at chromium.org> has asked  for review:
Bug 79961: Font fallback in cr-win is wrong for string contains
zero-width-space
https://bugs.webkit.org/show_bug.cgi?id=79961

Attachment 130881: patch w/ layout test
https://bugs.webkit.org/attachment.cgi?id=130881&action=review

------- Additional Comments from Xiaomei Ji <xji at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=130881&action=review


>> Source/WebCore/platform/graphics/Font.h:232
>> +	static bool treatAsZeroWidthSpaceInComplexScript(UChar c) { return c <
0x20 || (c >= 0x7F && c < 0xA0) || c == softHyphen || c == zeroWidthSpace || (c
>= 0x200e && c <= 0x200f) || (c >= 0x202a && c <= 0x202e) || c ==
zeroWidthNoBreakSpace || c == objectReplacementCharacter; }
> 
> Are there any other callers of this function?

treatedAsZeroWidthSpaceInComplexScript is only used in
graphics/chromium/UniscribeHelper.cpp and Font::treatedAsZeroWidthSpace().

The bug is directly caused by that zeroWidthSpace (U+200B) itself is not
handled the same way as those characters that could be treated as
zero-width-space-in-complex-script in cr-win code. So, adding zeroWidthSpace
here fixes the cr-win bug.

The above change also makes Font::treatAsZeroWidthSpace() returns true for 
zeroWidthSpace (U+200B).
Font::treatAsZeroWidthSpace()  is used in Font()::normalizeSpaces(),
normalizeSpacesAndMirrorChars() in HarfBuzzShaperBase.cpp,  in which, the
character is normalized to zeroWidthSpace if it could be
treatAsZeroWidthSapce(), so the above change will keep the functionality.

Font::treatAsZeroWidthSpace()  is also used in
graphics/mac/ComplexTextController.cpp and
graphics/win/UniscribeController.cpp, in which, zeroWidthSpace is handled
separately but in the same way as other characters that can be
treatedAsZeroWidthSpace(). so, above change (plus the updated code in this
patch for those 2 files) will keep the functionality too.

There are no other usages.


More information about the webkit-reviews mailing list