In complex text, a character can correspond with zero, one, or multiple glyphs. Similarly, a glyph can correspond with zero, one, or multiple characters. I noticed that HarfBuzzShaper doesn't handle selection correctly for some cases. It seems that we should return character index like below: +--- cluster 0 --+--- cluster 1 --+-----+---- cluster n-2 ---+---- cluster n-1 ---+ Glyphs | c_0 | .. | c_0 | c_1 | .. | c_1 | ... | c_n-2 | .. | c_n-2 | c_n-1 | .. | c_n-1 | +----------------+----------------+-----+--------------------+--------------------+ CharacterIndex to be returned: LTR 0 | c_1 | ... | c_n-2 | c_n-1 | n RTL n | c_0 | c_1 | ... | c_n-2 | 0 (A cluster is the character index which correspond with a glyph)
Created attachment 164833 [details] Patch
Hi Tony, could you take a look?
Comment on attachment 164833 [details] Patch Attachment 164833 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13951080 New failing tests: fast/text/international/hebrew-selection.html http/tests/css/link-css-disabled-value-with-slow-loading-sheet.html
Created attachment 164852 [details] Patch
Comment on attachment 164852 [details] Patch I like your ref test.
Created attachment 164994 [details] Patch for landing
(In reply to comment #5) > (From update of attachment 164852 [details]) > I like your ref test. Thank you for review!
Comment on attachment 164994 [details] Patch for landing Clearing flags on attachment: 164994 Committed r129175: <http://trac.webkit.org/changeset/129175>
All reviewed patches have been landed. Closing bug.
The test is failing with image diff on Windows too. Looking at the image output I didn't see expected selection so I updated the expectations to mark the test as failing on Win instead of providing Win-specific expectations: http://trac.webkit.org/changeset/129194 Link to the flakiness dashboard: http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=fast%2Ftext%2Finternational%2Fhebrew-selection.html Also reopening the bug as it was specified in TestExpectations. You should either file another bug for tracking the failure or keep this one open.
(In reply to comment #10) > The test is failing with image diff on Windows too. Looking at the image output I didn't see expected selection so I updated the expectations to mark the test as failing on Win instead of providing Win-specific expectations: > http://trac.webkit.org/changeset/129194 > > > Link to the flakiness dashboard: > http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=fast%2Ftext%2Finternational%2Fhebrew-selection.html > > Also reopening the bug as it was specified in TestExpectations. You should either file another bug for tracking the failure or keep this one open. Thanks for the heads-up. I created a bug for tracking the failure.
(In reply to comment #11) > (In reply to comment #10) > > The test is failing with image diff on Windows too. Looking at the image output I didn't see expected selection so I updated the expectations to mark the test as failing on Win instead of providing Win-specific expectations: > > http://trac.webkit.org/changeset/129194 > > > > > > Link to the flakiness dashboard: > > http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=fast%2Ftext%2Finternational%2Fhebrew-selection.html > > > > Also reopening the bug as it was specified in TestExpectations. You should either file another bug for tracking the failure or keep this one open. > > Thanks for the heads-up. I created a bug for tracking the failure. Thanks!