Bug 169517

Summary: REGRESSION (r211382): Partial right-to-left text runs are painted at an offset (breaks Find indicators, Look Up, and custom ::selection style)
Product: WebKit Reporter: mitz
Component: Layout and RenderingAssignee: Myles C. Maxfield <mmaxfield>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, buildbot, commit-queue, dino, ebrahim, mmaxfield, simon.fraser, thorton, webkit-bug-importer, zalan
Priority: P1 Keywords: InRadar, Regression
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
URL: data:text/html,<meta%20charset=utf-8>עם%20הסתבכויות
See Also: https://bugs.webkit.org/show_bug.cgi?id=166013
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews126 for ios-simulator-wk2
none
Patch
none
Patch none

Description mitz 2017-03-11 20:20:43 PST
To reproduce this bug, navigate to the URL and then control-click the long word on the left, and choose Look Up “הסתבכויות” from the contextual menu. In the yellow lookup highlight, the word is offset to the right but about the width of the other word.
Comment 1 Radar WebKit Bug Importer 2017-03-11 20:25:59 PST
<rdar://problem/30996668>
Comment 2 mitz 2017-03-11 21:10:39 PST
I am pretty sure this was caused by the changes to FontCascade in r211382, but I haven’t confirmed it yet.
Comment 3 mitz 2017-03-11 22:01:27 PST
Caused by <https://trac.webkit.org/r211382>, the fix for bug 166013.
Comment 4 mitz 2017-03-13 19:26:30 PDT
Here is a test case you can use that doesn’t depend on lookup:

<style>
	::selection { color: green; }
</style>
<bdo id=target dir=rtl>neerg si noitceleS</bdo>
<script>
	let textNode = document.getElementById("target").firstChild;
	getSelection().setBaseAndExtent(textNode, 0, textNode, 5)
</script>
Comment 5 Tim Horton 2017-03-28 12:01:31 PDT
Radar is actually rdar://problem/30652443
Comment 6 Myles C. Maxfield 2017-05-01 23:26:26 PDT
Created attachment 308803 [details]
Patch
Comment 7 Build Bot 2017-05-02 01:03:11 PDT
Comment on attachment 308803 [details]
Patch

Attachment 308803 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/3656252

New failing tests:
fast/text/complex-text-selection.html
Comment 8 Build Bot 2017-05-02 01:03:12 PDT
Created attachment 308809 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.6
Comment 9 Myles C. Maxfield 2017-05-02 10:19:43 PDT
Created attachment 308828 [details]
Patch
Comment 10 Myles C. Maxfield 2017-05-02 10:36:54 PDT
Created attachment 308831 [details]
Patch
Comment 11 WebKit Commit Bot 2017-05-02 12:35:28 PDT
Comment on attachment 308831 [details]
Patch

Clearing flags on attachment: 308831

Committed r216088: <http://trac.webkit.org/changeset/216088>
Comment 12 WebKit Commit Bot 2017-05-02 12:35:30 PDT
All reviewed patches have been landed.  Closing bug.
Comment 13 Jon Lee 2017-05-04 15:25:42 PDT
*** Bug 171658 has been marked as a duplicate of this bug. ***