WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
52403
[chromium] drop backwards iteration in Linux complex text code
https://bugs.webkit.org/show_bug.cgi?id=52403
Summary
[chromium] drop backwards iteration in Linux complex text code
Evan Martin
Reported
2011-01-13 15:29:59 PST
[chromium] drop backwards iteration in Linux complex text code
Attachments
Patch
(12.51 KB, patch)
2011-01-13 15:32 PST
,
Evan Martin
no flags
Details
Formatted Diff
Diff
Patch
(12.65 KB, patch)
2011-01-13 16:24 PST
,
Evan Martin
tony
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Evan Martin
Comment 1
2011-01-13 15:32:42 PST
Created
attachment 78866
[details]
Patch
Tony Chang
Comment 2
2011-01-13 16:07:50 PST
Comment on
attachment 78866
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=78866&action=review
> Source/WebCore/platform/graphics/chromium/FontLinux.cpp:247 > + for (int glyphIndex = 0; static_cast<unsigned>(glyphIndex) < controller.length(); ++glyphIndex) { > + int advance = truncateFixedPointToInteger(controller.advances()[glyphIndex]); > + int nextX = static_cast<int>(controller.xPositions()[glyphIndex]); > + nextX += advance / 2; > + if (std::min(nextX, lastX) <= targetX && targetX <= std::max(nextX, lastX)) > + return glyphIndex; > + lastX = nextX;
A comment explaining this loop sounds like it would be worthwhile.
Adam Langley
Comment 3
2011-01-13 16:13:32 PST
Comment on
attachment 78866
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=78866&action=review
> Source/WebCore/platform/graphics/chromium/ComplexTextControllerLinux.cpp:163 > + const SimpleFontData* nextFontData = m_font->glyphDataForCharacter(m_item.string[m_item.item.pos + endOfRun], false).fontData;
If this is a UTF16 string, will this not consider surrogate-pairs as two code points?
Evan Martin
Comment 4
2011-01-13 16:20:01 PST
Comment on
attachment 78866
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=78866&action=review
>> Source/WebCore/platform/graphics/chromium/ComplexTextControllerLinux.cpp:163 >> + const SimpleFontData* nextFontData = m_font->glyphDataForCharacter(m_item.string[m_item.item.pos + endOfRun], false).fontData; > > If this is a UTF16 string, will this not consider surrogate-pairs as two code points?
Probably. This is just a reindent of L184 in the previous code, so at least I don't think I'm regressing anything.
Evan Martin
Comment 5
2011-01-13 16:24:37 PST
Created
attachment 78875
[details]
Patch
Evan Martin
Comment 6
2011-01-13 16:25:19 PST
BTW, this is a good page for thinking about the logic with respect to glyphIndexForXPositionInScriptRun:
http://www.aestheticallyloyal.com/public/optimize-legibility/
With this patch, selection in the non-complex case matches the complex case.
Evan Martin
Comment 7
2011-01-13 16:49:05 PST
Committed
r75756
: <
http://trac.webkit.org/changeset/75756
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug