Closed Bug 305602 Opened 19 years ago Closed 19 years ago

Bidi: Difficult to select to end of line using the mouse when line ends with reverse-direction text

Categories

(Core :: DOM: Selection, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: uriber, Unassigned)

References

(Blocks 1 open bug, )

Details

This was originally reported by Behdad Esfahbod in bug 260781, comment #5:

When you select with mouse part of a line and get moving
out of the line from left or right, after passing the extents of the line, you
expect the line to be selected to the extreme (beginning or end, depending on
the edge you pass and the line direction), but this is not happening.  For
example start selection with mouse on the third line of
https://bugzilla.mozilla.org/attachment.cgi?id=186636 and move mouse towards
right.  Watch that no matter how far you
move your mouse after the line ends, you cannot get the Hebrew word at the end
of line selected.

This can also be seen on the fourth line of the RTL block (moving the mouse to
the left of the line).
Thanks Uri.
Blocks: Persian
This one is more difficult than it initially looks like.

My first thought was that mouse positions past the end of the line should just
be mapped to the logical end of the last frame on the line.
This fixes the current problem, but breaks the case where the mouse drag started
somewhere in the middle of a reverse-direction frame at the end of the line (and
then dragged past the end). In that case, we want mouse positions past the end
of the line to be mapped to the *beginning* of the frame.
So there can't be a single consistent way of treating positions horizonatally
outside the text itself.

Also, it's not even clear what we want to do when someone just clicks past the
end of the line in such a case (in composer, or in a textarea).

Simon - thoughts?
Blocks: 115709
I think adding an empty frame at the logical end of the line that also maps to
the visual end of the line solves the problem.  Same about beginning of the line.
(In reply to comment #3)
> I think adding an empty frame at the logical end of the line that also maps to
> the visual end of the line solves the problem.  Same about beginning of the line.

This will create the same problem I describe in comment #2:
Assume the paragraph direction is LTR, and a line ends in a frame of several RTL
words. Dragging from the middle of that frame to the right (past the end of the
line) will select your proposed empty frame, which is logically after the RTL
frame. So the text which will end up selected would be the LEFT half of the RTL
frame (plus the empty frame).
Thanks Uri for the explanation, but I believe that's the desired behavior. 
Otherwise there's no way for the user to select to the end of line.
This appears to be fixed by Eli Friedman's patch for bug 316281.
Depends on: 316281
FIXED by the patch to bug 316281.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.