Bug 49378 - fast/text/justification-padding-mid-word.html fails on Windows
Summary: fast/text/justification-padding-mid-word.html fails on Windows
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL: http://build.webkit.org/results/Windo...
Keywords: InRadar, LayoutTestFailure, PlatformOnly
Depends on:
Blocks:
 
Reported: 2010-11-11 05:14 PST by Adam Roben (:aroben)
Modified: 2010-11-11 17:22 PST (History)
2 users (show)

See Also:


Attachments
Treat zero-width-space-like and space-like characters correctly in UniscribeController (3.90 KB, patch)
2010-11-11 17:02 PST, mitz
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Roben (:aroben) 2010-11-11 05:14:57 PST
fast/text/justification-padding-mid-word.html fails on Windows. See the URL for the (uninteresting) diff. I believe it's been failing since it was added in r71783.

I've checked in new expected results for Windows to get the bots green again.
Comment 1 Adam Roben (:aroben) 2010-11-11 05:28:04 PST
<rdar://problem/8657116>
Comment 2 mitz 2010-11-11 17:02:58 PST
Created attachment 73683 [details]
Treat zero-width-space-like and space-like characters correctly in UniscribeController
Comment 3 WebKit Review Bot 2010-11-11 17:04:12 PST
Attachment 73683 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/platform/win/fast/text/justification-padding-mid-word-expected.txt', u'WebCore/ChangeLog', u'WebCore/platform/graphics/win/UniscribeController.cpp']" exit_code: 1
WebCore/platform/graphics/win/UniscribeController.cpp:278:  Tab found; better to use spaces  [whitespace/tab] [1]
WebCore/platform/graphics/win/UniscribeController.cpp:279:  Tab found; better to use spaces  [whitespace/tab] [1]
WebCore/platform/graphics/win/UniscribeController.cpp:280:  Tab found; better to use spaces  [whitespace/tab] [1]
WebCore/platform/graphics/win/UniscribeController.cpp:285:  Tab found; better to use spaces  [whitespace/tab] [1]
WebCore/platform/graphics/win/UniscribeController.cpp:286:  Tab found; better to use spaces  [whitespace/tab] [1]
Total errors found: 5 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 mitz 2010-11-11 17:06:28 PST
I’ll de-tabify.
Comment 5 Darin Adler 2010-11-11 17:10:39 PST
Comment on attachment 73683 [details]
Treat zero-width-space-like and space-like characters correctly in UniscribeController

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.
Comment 6 mitz 2010-11-11 17:22:11 PST
Fixed in <http://trac.webkit.org/changeset/71870>