Bug 181993 - REGRESSION (r226138): Selecting a line that ends with zero-width joiner (ZWJ) may cause text transformation
Summary: REGRESSION (r226138): Selecting a line that ends with zero-width joiner (ZWJ)...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: WebKit Local Build
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL: data:text/html,<p%20style="font-famil...
Keywords: InRadar, Regression
Depends on: 180984
Blocks:
  Show dependency treegraph
 
Reported: 2018-01-23 10:47 PST by Daniel Bates
Modified: 2018-01-24 11:17 PST (History)
9 users (show)

See Also:


Attachments
Patch and layout test (20.71 KB, patch)
2018-01-23 10:50 PST, Daniel Bates
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews103 for mac-sierra (2.20 MB, application/zip)
2018-01-23 11:50 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews104 for mac-sierra-wk2 (2.51 MB, application/zip)
2018-01-23 11:55 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews112 for mac-sierra (2.90 MB, application/zip)
2018-01-23 12:21 PST, EWS Watchlist
no flags Details
Patch and layout test (21.27 KB, patch)
2018-01-23 16:24 PST, Daniel Bates
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews100 for mac-sierra (2.29 MB, application/zip)
2018-01-23 17:21 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews107 for mac-sierra-wk2 (2.74 MB, application/zip)
2018-01-23 17:31 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews114 for mac-sierra (2.90 MB, application/zip)
2018-01-23 17:55 PST, EWS Watchlist
no flags Details
Patch and layout test (21.19 KB, patch)
2018-01-23 20:50 PST, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2018-01-23 10:47:26 PST
When using certain fonts (e.g. -apple-system on macOS) selecting a line that end with a zero-width joiner (ZWJ) may cause a text transformation of the character before the ZWJ.

On macOS you can observe this issue by performing the following:

1. Visit <data:text/html,<p%20style="font-family:%20-apple-system">12&zwj;</p>>.
2. Select the '2'.

Then the '2' will transform to Ä. But it should not transform at all and remain '2'.
Comment 1 Daniel Bates 2018-01-23 10:50:31 PST
Created attachment 332038 [details]
Patch and layout test
Comment 2 Daniel Bates 2018-01-23 10:51:08 PST
<rdar://problem/36421080>
Comment 3 Daniel Bates 2018-01-23 10:52:54 PST
Ideally we need to fix bug #181964 so that selection and zero-width joiners interact well.
Comment 4 EWS Watchlist 2018-01-23 11:50:26 PST
Comment on attachment 332038 [details]
Patch and layout test

Attachment 332038 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/6184541

New failing tests:
fast/text/mac/select-character-before-zero-width-joiner.html
Comment 5 EWS Watchlist 2018-01-23 11:50:27 PST Comment hidden (obsolete)
Comment 6 EWS Watchlist 2018-01-23 11:55:46 PST Comment hidden (obsolete)
Comment 7 EWS Watchlist 2018-01-23 11:55:47 PST Comment hidden (obsolete)
Comment 8 EWS Watchlist 2018-01-23 12:21:02 PST Comment hidden (obsolete)
Comment 9 EWS Watchlist 2018-01-23 12:21:04 PST Comment hidden (obsolete)
Comment 10 Daniel Bates 2018-01-23 16:23:21 PST
(In reply to Build Bot from comment #4)
> Comment on attachment 332038 [details]
> Patch and layout test
> 
> Attachment 332038 [details] did not pass mac-ews (mac):
> Output: http://webkit-queues.webkit.org/results/6184541
> 
> New failing tests:
> fast/text/mac/select-character-before-zero-width-joiner.html

This test failure is because I inadvertently wrote the expected file taking advantage of bug #181964 (only occurs on macOS High Sierra). On another note the actual rendering of this test on macOS Sierra is wrong. See bug #182022 for more details.
Comment 11 Daniel Bates 2018-01-23 16:24:14 PST
Created attachment 332093 [details]
Patch and layout test
Comment 12 EWS Watchlist 2018-01-23 17:21:57 PST Comment hidden (obsolete)
Comment 13 EWS Watchlist 2018-01-23 17:21:59 PST Comment hidden (obsolete)
Comment 14 EWS Watchlist 2018-01-23 17:31:42 PST Comment hidden (obsolete)
Comment 15 EWS Watchlist 2018-01-23 17:31:44 PST Comment hidden (obsolete)
Comment 16 EWS Watchlist 2018-01-23 17:54:59 PST Comment hidden (obsolete)
Comment 17 EWS Watchlist 2018-01-23 17:55:00 PST Comment hidden (obsolete)
Comment 18 Daniel Bates 2018-01-23 20:50:52 PST
Created attachment 332120 [details]
Patch and layout test
Comment 19 Dave Hyatt 2018-01-24 11:10:12 PST
Comment on attachment 332120 [details]
Patch and layout test

r=me
Comment 20 Daniel Bates 2018-01-24 11:17:34 PST
Comment on attachment 332120 [details]
Patch and layout test

Clearing flags on attachment: 332120

Committed r227533: <https://trac.webkit.org/changeset/227533>
Comment 21 Daniel Bates 2018-01-24 11:17:36 PST
All reviewed patches have been landed.  Closing bug.