Bug 141140 - ComplexTextController::offsetForPosition() might erroneously detect a ligature when instead CT simply omitted an invisible glyph
Summary: ComplexTextController::offsetForPosition() might erroneously detect a ligatur...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-01 11:46 PST by Myles C. Maxfield
Modified: 2015-08-27 00:45 PDT (History)
0 users

See Also:


Attachments
Reproduction screenshot (10.02 KB, image/png)
2015-02-01 11:46 PST, Myles C. Maxfield
no flags Details
Reduction (124 bytes, text/html)
2015-08-27 00:17 PDT, Myles C. Maxfield
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2015-02-01 11:46:07 PST
Created attachment 245837 [details]
Reproduction screenshot

https://www.opengl.org/wiki/Geometry_Shader
Double click on "triangle_strip" (see screenshot)
Version 8.0.3 (10600.3.18, r179440)
14C109
Comment 1 Myles C. Maxfield 2015-08-27 00:17:16 PDT
Created attachment 260046 [details]
Reduction
Comment 2 Myles C. Maxfield 2015-08-27 00:20:15 PDT
Not due to simple line layout
Comment 3 Myles C. Maxfield 2015-08-27 00:22:14 PDT
For some reason the ZWS is being layed out to be the right half of the "p"
Comment 4 Myles C. Maxfield 2015-08-27 00:44:05 PDT
offsetForPosition() uses the complex text code path. In this code path, when the string ends with a ZWS, CoreText simply doesn't return a glyph for that character.

However, this means that in ComplexTextController::offsetForPosition(), it appears that the last glyph corresponds with two characters (since that ZWS doesn't get its own glyph). This makes us think that we are encountering a ligature, and we put the break between the two code points in the middle of the last glyph.

When you double click, you select the word, without the ZWS. Therefore, the caret gets placed in the middle of the last glyph.