[webkit-reviews] review granted: [Bug 49378] fast/text/justification-padding-mid-word.html fails on Windows : [Attachment 73683] Treat zero-width-space-like and space-like characters correctly in UniscribeController

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 11 17:10:38 PST 2010


Darin Adler <darin at apple.com> has granted mitz at webkit.org's request for review:
Bug 49378: fast/text/justification-padding-mid-word.html fails on Windows
https://bugs.webkit.org/show_bug.cgi?id=49378

Attachment 73683: Treat zero-width-space-like and space-like characters
correctly in UniscribeController
https://bugs.webkit.org/attachment.cgi?id=73683&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=73683&action=review

> WebCore/platform/graphics/win/UniscribeController.cpp:287
> -	   if (Font::treatAsSpace(ch)) {
> +		bool treatAsSpace = Font::treatAsSpace(ch);
> +		bool treatAsZeroWidthSpace = ch == zeroWidthSpace ||
Font::treatAsZeroWidthSpace(ch);
> +		if (treatAsSpace || treatAsZeroWidthSpace) {
>	       // Substitute in the space glyph at the appropriate place in the
glyphs
>	       // array.
>	       glyphs[clusters[k]] = fontData->spaceGlyph();
> -	       advances[clusters[k]] = logicalSpaceWidth;
> -	       spaceCharacters[clusters[k]] = m_currentCharacter + k +
item.iCharPos;
> +	       advances[clusters[k]] = treatAsSpace ? logicalSpaceWidth : 0;
> +			if (treatAsSpace)
> +			    spaceCharacters[clusters[k]] = m_currentCharacter +
k + item.iCharPos;
>	   }

Tabs!

> WebCore/platform/graphics/win/UniscribeController.cpp:342
> -	       if (glyph == fontData->spaceGlyph()) {
> +	       int characterIndex = spaceCharacters[k];
> +	       if (characterIndex >= 0) {

The fact that this is a way to detect treatAsSpace because the code above
leaves spaceCharacters along for those characters, and the buffer is
initialized with -1 is non-obvious. A comment or different coding idiom of some
sort could be helpful.


More information about the webkit-reviews mailing list