Bug 181964

Summary: REGRESSION: Trailing zero-width joiner (ZWJ) included in selection on page deactivation and may stay selected
Product: WebKit Reporter: Daniel Bates <dbates>
Component: TextAssignee: Nobody <webkit-unassigned>
Status: ASSIGNED ---    
Severity: Normal CC: ap, hyatt, mitz, mmaxfield, webkit-bug-importer
Priority: P1 Keywords: InRadar, Regression
Version: WebKit Local Build   
Hardware: Mac   
OS: macOS 10.13   
See Also: https://bugs.webkit.org/show_bug.cgi?id=181993
https://bugs.webkit.org/show_bug.cgi?id=182022
Attachments:
Description Flags
Tests none

Description Daniel Bates 2018-01-22 16:58:44 PST
When a line contains a character and a zero-width joiner (ZWJ) in that order, selecting the character by hand, deactivating the page by putting Safari in the background, causes the selection to extend to the ZWJ. Moreover, activating the page by bringing Safari to the foreground and clicking somewhere else in the document to deselect the text may cause the character to be deselected and the ZWJ to remain selected.
Comment 1 Daniel Bates 2018-01-22 17:02:52 PST
Created attachment 331980 [details]
Tests
Comment 2 Daniel Bates 2018-01-23 16:03:47 PST
The extending of the selection highlight to include the zero-width joiner is a regression from the selection highlight behavior seen in shipping Safari version 10.1.2 (12603.3.8) on macOS Sierra (16G1004).
Comment 3 Daniel Bates 2018-01-23 16:05:28 PST
(In reply to Daniel Bates from comment #2)
> The extending of the selection highlight to include the zero-width joiner is
> a regression from the selection highlight behavior seen in shipping Safari
> version 10.1.2 (12603.3.8) on macOS Sierra (16G1004).

Elaborating further, this bug is specific to macOS High Sierra. That is, it does not reproduce on macOS Sierra.
Comment 4 Radar WebKit Bug Importer 2018-01-23 16:26:50 PST
<rdar://problem/36799695>