Open Bug 349353 Opened 20 years ago Updated 5 years ago

double-clicking on space(s) between words should select the space(s), not both adjacent words and the space(s)

Categories

(Core :: DOM: Selection, defect, P5)

PowerPC
macOS
defect

Tracking

()

People

(Reporter: alqahira, Unassigned)

References

Details

In Mac OS X text selection behavior, double-clicking on (one or more) spaces between words (or between punctuation and a word) selects the space(s). In Gecko, double-clicking copies Windows behavior and selects the spaces and both adjacent words/punctuation. (Actually, in the native case, some narrow region adjacent to the word will select the word rather than the space, but just selecting the space when the click is in the space rather than the word would be good enough matching of native behavior for me ;) CCing Uri since he has been fixing some of these broken platform behaviors of late :)
This is basically a duplicate of bug 200098, but let's keep it open because that bug focuses more on the Windows behavior. There are a couple of issues involved here: One issue is that nsTextFrame::GetPositionHelper() returns the offset of the character *boundary* which is closest to the given point. That's all good and well for single click, when you want to determine where to place the caret - but for double click, we actually want to know what character was clicked: we don't care about character boundaries. Once this is resolved, we'll still have to adjust nsFrame::PeekBackwardAndForward to initiate the two peeks from different offsets (backwards from the offset after the double-clicked character, and forwards from the offset before it). I've been thinking about fixing this for a long time, but since I expect to become very busy pretty soon, it's unlikely that I'll get to this anytime in the foreseeable future. So if anyone wants to take this, I hope the analysis above would be useful.
Blocks: word-select
Depends on: 200098
Assignee: selection → nobody
QA Contact: selection

Bulk-downgrade of unassigned, >=3 years untouched DOM/Storage bug's priority.

If you have reason to believe this is wrong, please write a comment and ni :jstutte.

Severity: normal → S4
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.