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.
<rdar://problem/42125941>
I can reproduce this with r233395 in macOS High Sierra 10.13.6.
It also reproduces with built-in Safari in that version of macOS, so it’s not a particularly recent regression.
I was able to reproduce this all the way back to r226018
Oddly, I'm unable to reproduce this on 10.13.4 (I tried both system Safari and STP 60).
This comes down to the behavior of VisibleSelection::expandUsingGranularity, which makes it at least somewhat related to bug 164519.
I wonder if there’s some extra global setting or preference that affects this (something like “smart copy and paste”).