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.
Created attachment 79510 [details] Proposed changes.
This looks right to me, but mitz should really be the one to r+ this.
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.
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.
Comment on attachment 79510 [details] Proposed changes. Clearing flags on attachment: 79510 Committed r76674: <http://trac.webkit.org/changeset/76674>
All reviewed patches have been landed. Closing bug.