RESOLVED FIXED 52760
ComplexTextController incorrectly conflates string length and range of indexes
https://bugs.webkit.org/show_bug.cgi?id=52760
Summary ComplexTextController incorrectly conflates string length and range of indexes
Ned Holbrook
Reported 2011-01-19 15:57:02 PST
Consider a run of 2 characters where each is in its own CTRun. As the ComplexTextRuns are iterated by ComplexTextController::advance(), glyphStartOffset gets 0, but glyphEndOffset gets 2 via complexTextRun.stringLength(), which results in a width of half the first adjusted advance: half because it is divided equally among 2 characters, and no more since"glyphEndOffset + complexTextRun.stringLocation() > m_currentCharacter" is true, which causes the loop to exit. In order to fix this, ComplexTextRun needs to keep track of the original run range in order to return the end index (end in the sense of an STL range, or one past the last included value). Note that the string indices alone are not sufficient to determine the end index, as the last glyph may be a ligature and subsume more than one index.
Attachments
Proposed changes. (12.33 KB, patch)
2011-01-19 16:01 PST, Ned Holbrook
no flags
Ned Holbrook
Comment 1 2011-01-19 16:01:17 PST
Created attachment 79510 [details] Proposed changes.
Eric Seidel (no email)
Comment 2 2011-01-20 02:45:39 PST
This looks right to me, but mitz should really be the one to r+ this.
mitz
Comment 3 2011-01-25 21:30:23 PST
Comment on attachment 79510 [details] Proposed changes. I’m not sure indexEnd is the best name for this but I don’t have a better suggestion.
WebKit Commit Bot
Comment 4 2011-01-25 22:08:03 PST
The commit-queue encountered the following flaky tests while processing attachment 79510 [details]: http/tests/xmlhttprequest/failed-auth.html bug 51835 (author: ap@webkit.org) The commit-queue is continuing to process your patch.
WebKit Commit Bot
Comment 5 2011-01-25 22:08:48 PST
Comment on attachment 79510 [details] Proposed changes. Clearing flags on attachment: 79510 Committed r76674: <http://trac.webkit.org/changeset/76674>
WebKit Commit Bot
Comment 6 2011-01-25 22:08:53 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.