Bug 187605

Summary: REGRESSION (-r226018): Shift-clicking to extend selection extends it from both ends if granularity is not character
Product: WebKit Reporter: mitz
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, sam, webkit-bug-importer, wenson_hsieh
Priority: P1 Keywords: InRadar, Regression
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
URL: data:text/html,<div>one<br>two<br>three<br>four<br>five<br>six
See Also: https://bugs.webkit.org/show_bug.cgi?id=164519

Description mitz 2018-07-12 10:02:10 PDT
To reproduce this bug, navigate to the URL, then triple-click the word “four”. Then Shift-click in the word “two”, then Shift-click in the word “one”. The selection extends to the words “five” and “six”, but it shouldn’t.
Comment 1 Radar WebKit Bug Importer 2018-07-12 10:07:30 PDT
<rdar://problem/42125941>
Comment 2 mitz 2018-07-12 19:34:14 PDT
I can reproduce this with r233395 in macOS High Sierra 10.13.6.
Comment 3 mitz 2018-07-12 19:44:48 PDT
It also reproduces with built-in Safari in that version of macOS, so it’s not a particularly recent regression.
Comment 4 mitz 2018-07-12 19:55:00 PDT
I was able to reproduce this all the way back to r226018
Comment 5 Wenson Hsieh 2018-07-12 20:15:24 PDT
Oddly, I'm unable to reproduce this on 10.13.4 (I tried both system Safari and STP 60).
Comment 6 mitz 2018-07-12 20:21:14 PDT
This comes down to the behavior of VisibleSelection::expandUsingGranularity, which makes it at least somewhat related to bug 164519.
Comment 7 mitz 2018-07-12 20:24:19 PDT
I wonder if there’s some extra global setting or preference that affects this (something like “smart copy and paste”).