Closed
Bug 391464
Opened 17 years ago
Closed 17 years ago
CTRL-right arrow (or SHIFT-CTRL-right) advance caret (or selection) past first word on next line
Categories
(Core :: Layout: Text and Fonts, defect, P2)
Tracking
()
VERIFIED
FIXED
People
(Reporter: info, Assigned: roc)
References
Details
(Keywords: qawanted, regression, Whiteboard: [dbaron-1.9:RuCt])
Attachments
(2 files)
6.56 KB,
patch
|
smontagu
:
review+
mrbkap
:
superreview+
|
Details | Diff | Splinter Review |
3.87 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a8pre) Gecko/2007080805 Minefield/3.0a8pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a8pre) Gecko/2007080805 Minefield/3.0a8pre ID:2007080805
If you press CTRL-right arrow to advance through a text area, the caret skips past the first word of the next line.
This also happens in regular HTML when you extend a selection (SHIFT-CTRL-right arrow), it selects the word at the end of the line *and* the first word of the next line.
Reproducible: Always
Steps to Reproduce:
To see caret problem in textarea,
1. Enter several lines of text
2. Click in first row and repeatedly press CTRL-right arrow.
To see selection problem in regular HTML:
1. In a bugzilla bug report, double-click a word in the first line of a comment, like "regular" in the line above.
2. Press SHIFT-CTRL-right arrow repeatedly.
Actual Results:
When the caret or selection end is on the last word of the line, it jumps *PAST* the first word on the next line.
Expected Results:
The caret should advance to the start of the next line; the selection end should advance to select the last word of the current line and any whitespace. That's what happens in Thunderbird 2 and Windows Notepad.
I guessed GFX:Thebes as the component for this bug since it's sort of like bug 383542. It doesn't seem like an Editor bug since it occurs selecting in HTML as well as in Textarea.
Comment 1•17 years ago
|
||
I can confirm this using Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9a8pre) Gecko/2007080815 Minefield/3.0a8pre.
The STR are exactly as listed in comment 0. Searching for dupes...
Keywords: qawanted,
regression
Whiteboard: [needs-regression-range]
Comment 2•17 years ago
|
||
Didn't see any dupes, confirming. Requesting blocking for 1.9. I'm not sure this is the right component, but I'll leave it here per comment 0 and someone else can move it to a more appropriate one (Core::Selection maybe?).
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking1.9?
Comment 3•17 years ago
|
||
CC'ing roc.
Assignee | ||
Comment 4•17 years ago
|
||
The changes in bug 389421 might affect this. I don't have a build to test right now.
Depends on: 389421
Comment 5•17 years ago
|
||
This is not fixed by the patch on bug 389421.
Updated•17 years ago
|
Component: GFX: Thebes → Layout: Fonts and Text
QA Contact: thebes → layout.fonts-and-text
Assignee | ||
Updated•17 years ago
|
Assignee: nobody → roc
Assignee | ||
Updated•17 years ago
|
Flags: blocking1.9? → blocking1.9+
Assignee | ||
Updated•17 years ago
|
Whiteboard: [needs-regression-range]
Assignee | ||
Comment 6•17 years ago
|
||
I don't know who reviews this code these days other than me ... picking mrbkap as a super-reviewer, and Simon as a reviewer. Uri, if you could look at it too, that'd be great.
The idea should be completely clear from the comment in nsFrame.
I figured out why things were acting weird in my general word-movement tests with eat_space_next_to_word set to true, so I added those tests as well as specific tests for this bug. I'm adding tests to the same mochitest file because I don't want to clone all its infrastructure.
Attachment #285027 -
Flags: superreview?(mrbkap)
Attachment #285027 -
Flags: review?(smontagu)
Assignee | ||
Updated•17 years ago
|
Whiteboard: [needs review]
Comment 7•17 years ago
|
||
Comment on attachment 285027 [details] [diff] [review]
fix
sr=mrbkap
Attachment #285027 -
Flags: superreview?(mrbkap) → superreview+
Updated•17 years ago
|
Attachment #285027 -
Flags: review?(smontagu) → review+
Whiteboard: [needs review] → [needs review][dbaron-1.9:RuCt]
Comment 8•17 years ago
|
||
As far as I can see, the patch doesn't accomplish the desired behavior: The caret first moves to after the space at the end of the line (instead of the beginning of the next line), and then, pressing option-right again, moves to the end of the first word on the next line (although it should only stop at beginnings of words).
The root cause of the bug is, I think, the issue referred to in [1]. The beginning of the "next" line, being a beginning of a frame, is not considered a valid place to stop. I'll try to see if I can work around this for this case.
[1] http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/layout/generic/nsTextFrameThebes.cpp&rev=3.115&mark=4578-4582#4548
Assignee | ||
Comment 9•17 years ago
|
||
Actually on Mac at least the platform behaviour seems to be "stop at the end of the current line *and* at the start of the next line".
By stopping at the end of the line at least we don't skip over two words, just one. I thought that was the most important thing.
Comment 10•17 years ago
|
||
(In reply to comment #9)
> Actually on Mac at least the platform behaviour seems to be "stop at the end of
> the current line *and* at the start of the next line".
That's not what I'm seeing, neither in Safari nor in TextEdit. Using option-right, the caret first stops at the end of the last word on the line, then at the end of the first word on the next line.
Windows is the same, with s/end/beginning/.
Comment 11•17 years ago
|
||
This attempts to work around the fact that cIter.HaveWordBreakBefore() returns PR_FALSE at beginnings of lines.
As far as I can tell, it restores the original behavior.
Attachment #285598 -
Flags: review?(roc)
Assignee | ||
Comment 12•17 years ago
|
||
Huh, so Textwrangler is different/wrong.
Probably a better fix would be to make cIter.HaveWordBreakBefore() return PR_TRUE at the beginning of the line. I should try that. If that doesn't work out or is hard, we'll do it your way instead.
Assignee | ||
Updated•17 years ago
|
Whiteboard: [needs review][dbaron-1.9:RuCt] → [dbaron-1.9:RuCt]
Assignee | ||
Comment 13•17 years ago
|
||
I want 391584 to land before I work on this.
Whiteboard: [dbaron-1.9:RuCt] → [dbaron-1.9:RuCt][depends on 391584]
Assignee | ||
Updated•17 years ago
|
Priority: -- → P2
Assignee | ||
Updated•17 years ago
|
Whiteboard: [dbaron-1.9:RuCt][depends on 391584] → [dbaron-1.9:RuCt]
Assignee | ||
Comment 14•17 years ago
|
||
Actually I think 391584 completely fixed this on trunk. Anyone disagree?
Assignee | ||
Comment 15•17 years ago
|
||
Well, I'm sure 391584 fixed this bug as filed. If there are any more bugs in this area, please file them.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Attachment #285598 -
Flags: review?(roc)
Comment 16•17 years ago
|
||
We should make sure the particular situation described here is tested in Mochitests.
Flags: in-testsuite?
Comment 17•17 years ago
|
||
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008050810 Minefield/3.0pre
Verified.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•