RESOLVED FIXED 54724
Extending selection by a boundary granularity (LineBoundary/ParagraphBoundary/DocumentBoundary) sets incorrect start/end of selection for RTL
https://bugs.webkit.org/show_bug.cgi?id=54724
Summary Extending selection by a boundary granularity (LineBoundary/ParagraphBoundary...
Benjamin (Ben) Kalman
Reported 2011-02-17 22:54:55 PST
Extending selection by a boundary granularity (LineBoundary/ParagraphBoundary/DocumentBoundary) sets incorrect start/end of selection for RTL
Attachments
Patch (8.35 KB, patch)
2011-02-17 22:59 PST, Benjamin (Ben) Kalman
no flags
Patch (8.76 KB, patch)
2011-02-20 18:57 PST, Benjamin (Ben) Kalman
no flags
Patch for landing (8.78 KB, patch)
2011-02-21 21:36 PST, Benjamin (Ben) Kalman
no flags
Benjamin (Ben) Kalman
Comment 1 2011-02-17 22:59:45 PST
Benjamin (Ben) Kalman
Comment 2 2011-02-17 23:04:18 PST
This bug is impossible to reproduce on any current build of chrome or safari because it was only exposed after 54534. However, to reproduce from tip (>= 78799) open up the test case from that bug (https://bug-54534-attachments.webkit.org/attachment.cgi?id=82596), go to the rightmost side of the text box, press command+shift+left (select to beginning of line) *twice*. The second time should cancel the selection. This is the bug.
Ryosuke Niwa
Comment 3 2011-02-18 04:06:55 PST
Comment on attachment 82925 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=82925&action=review > Source/WebCore/ChangeLog:8 > + Extending selection by a boundary granularity (LineBoundary/ParagraphBoundary/DocumentBoundary) sets incorrect start/end of selection for RTL > + https://bugs.webkit.org/show_bug.cgi?id=54724 > + > + Set the end of the selection if the direction is left within an RTL container, and likewise for the start. I don't think there is sufficient explanation as to how incorrect it is. You should also explain what caused the issue and how you fixed it. r- for insufficient descriptions. Also, since the bug title is really long, you might want to split it into two lines.
Benjamin (Ben) Kalman
Comment 4 2011-02-20 18:48:55 PST
Well, http://trac.webkit.org/changeset/78799 fixed a bug where the selection was extending in the wrong direction for lines in an RTL container. That bug would have masked the existence of this one (i.e. they would have appeared to be the same bug), since extending the selection when there is already a selection hits an additional (buggy) codepath. Namely that on mac the selection is always extended, but this "always extend" code wasn't taking into account the direction (LTR/RTL) of the container. So in RTL when extending right, it should actually set the start of the selection not the end (since start/end is reversed with respect to left/right). And likewise when extending left, it should actually set the end. I'll update the changelog to explain this.
Benjamin (Ben) Kalman
Comment 5 2011-02-20 18:57:15 PST
Ryosuke Niwa
Comment 6 2011-02-21 00:25:55 PST
Comment on attachment 83115 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=83115&action=review > Source/WebCore/ChangeLog:11 > + This is achieved by extending from the start of selection when going left, or extending from the end when going > + right (as opposed from always extending from the extent). I don't think this comment is a bit misleading since selection is always extended logically and we never "go left" or "go right" when extending the selection. I think what you mean is that when the selection is extended by the left arrow key and the right arrow key. Please revise this before landing the patch.
Benjamin (Ben) Kalman
Comment 7 2011-02-21 21:36:04 PST
Created attachment 83267 [details] Patch for landing
WebKit Commit Bot
Comment 8 2011-02-21 22:24:52 PST
Comment on attachment 83267 [details] Patch for landing Clearing flags on attachment: 83267 Committed r79290: <http://trac.webkit.org/changeset/79290>
WebKit Commit Bot
Comment 9 2011-02-21 22:24:58 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.