[Webkit-unassigned] [Bug 108881] Canvas fillText and measureText handle ideographic spaces differently

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 21 06:21:28 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=108881





--- Comment #47 from Christophe Dumez <dchris at gmail.com>  2013-08-21 06:20:56 PST ---
(From update of attachment 209259)
View in context: https://bugs.webkit.org/attachment.cgi?id=209259&action=review

> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:2112
> +    int textLength = text.length();

This can be moved down a bit to avoid doing this if there is not space that needs replacing.
Also, length() returns an unsigned, not an int.

> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:2114
> +    int i = text.find(spaceNeedsReplacing);

find() returns a size_t, not an int

> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:2116
> +    if (i == -1)

-1 -> use usually use notFound instead (from NotFound.h).

> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:2122
> +    for (; i != textLength; ++i) {

I believe 'i < textLength' is more common.

> LayoutTests/fast/canvas/canvas-measureText-ideographicSpace.html:9
> +<span style="padding: 0px; font-size: 12px; font-family: Osaka; display: inline; visibility: hidden">a&#x3000;b&#x3000;c</span>

Looks like this test is failing on ews?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list