[webkit-reviews] review granted: [Bug 108881] Canvas fillText and measureText handle ideographic spaces differently : [Attachment 211185] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 10 12:39:58 PDT 2013


Darin Adler <darin at apple.com> has granted Rashmi Shyamasundar
<rashmi.s2 at samsung.com>'s request for review:
Bug 108881: Canvas fillText and measureText handle ideographic spaces
differently
https://bugs.webkit.org/show_bug.cgi?id=108881

Attachment 211185: Patch
https://bugs.webkit.org/attachment.cgi?id=211185&action=review

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


> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:2133
> +    unsigned textLength = text.length();
> +    Vector<UChar> charVector(textLength);
> +    memcpy(charVector.data(), text.characters(), textLength *
sizeof(UChar));
> +
> +    charVector[i++] = ' ';
> +
> +    for (; i < textLength; ++i) {
> +	   if (isSpaceThatNeedsReplacing(charVector[i]))
> +	       charVector[i] = ' ';
> +    }
> +    text = String::adopt(charVector);

If it ever matters, some day we might want to return to this and make an
optimized path for 8-bit character strings; this implementation as is will have
a side effect of expanding any strings with a space that needs replacing to
16-bit characters.


More information about the webkit-reviews mailing list