Closed
Bug 256252
Opened 20 years ago
Closed 20 years ago
ctrl+right arrow sometimes skip a word
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: ginnchen+exoracle, Assigned: ginnchen+exoracle)
References
Details
(Keywords: access)
Attachments
(4 files, 3 obsolete files)
489 bytes,
text/html
|
Details | |
4.09 KB,
text/html
|
Details | |
3.56 KB,
text/html
|
Details | |
6.87 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a3) Gecko/20040818 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a3) Gecko/20040818 go to http://www.mozilla.org/start/1.7/ turn on caret browsing put caret in "Getting" of "Getting Started" Press ctrl+right, caret move to end of word "Getting". Press ctrl+right again, caret goes to next line Reproducible: Always Steps to Reproduce:
Comment 2•20 years ago
|
||
Maybe, this bug would dissapear, if Ctrl+right would be stoping at beginings of words (not at ends) (I wrote about this in discussion to bug 142120). But this is only my suggestion.
(In reply to comment #2) > Maybe, this bug would dissapear, if Ctrl+right would be stoping at beginings of > words (not at ends) (I wrote about this in discussion to bug 142120). But this > is only my suggestion. Yes, it would disappear, but it's not linux style, try gedit, emacs.
"aPos->mEatingWS = isWhitespace;" is overwriting "aPos->mEatingWS = !sWordSelectEatSpaceAfter;" so I move it into else-clause.
Assignee: aaronleventhal → ginn.chen
Status: NEW → ASSIGNED
Comment on attachment 157138 [details] [diff] [review] patch Aaron, would you please test it on Windows to make sure I'm not breaking? Thanks.
Attachment #157138 -
Flags: review?(aaronleventhal)
Comment 6•20 years ago
|
||
Can't you test it by changing the work breaking preference, layout.word_select.stop_at_punctuation?
(In reply to comment #6) > Can't you test it by changing the work breaking preference, > layout.word_select.stop_at_punctuation? It doesn't work well for me. Maybe bug 193025.
Comment 8•20 years ago
|
||
(In reply to comment #7) >(In reply to comment #6) >>Can't you test it by changing the work breaking preference, >>layout.word_select.stop_at_punctuation? >It doesn't work well for me. >Maybe bug 193025. Ah, I see what you mean, the preference only seems to work for ctrl+left, not ctrl+right. Perhaps another manifestation of the same bug?
Comment 9•20 years ago
|
||
In fact, neither my windows or linux nightlies ctrl+right correctly. Not only do they both show this bug, neither of them respects the word select preference. ctrl+left is fine on both platforms, both preference settings.
OS: Linux → All
Summary: [linux]ctrl+right arrow sometimes skip a word → ctrl+right arrow sometimes skip a word
Comment 10•20 years ago
|
||
Comment on attachment 157138 [details] [diff] [review] patch * I can't reproduce the original bug on Windows * I can't see any bad effects from the patch on Windows, with either punctuation setting * There is a different problem on Windows. Ctrl+right stops twice before the first character of every line. However, that seems to happen with or without this patch. Do we have a bug filed for that?
Attachment #157138 -
Flags: review?(aaronleventhal) → review?(neil.parkwaycc.co.uk)
Assignee | ||
Comment 11•20 years ago
|
||
Ctrl+right still has some problem even with this patch. I'm on Linux now. 1) It will stop at first letter of next line. 2) If there's some ctrl+right will stop several times.
Assignee | ||
Comment 12•20 years ago
|
||
This patch works quite fine for me on Linux. The other 2 problems are solved. But I don't know if it works on Windows, and RTL language. I'll try to test it tommrrow. I really don't know why eSelectWord + eDirNext need set Amount to NoAmount. It will cause a stop at line beginning.
Attachment #157138 -
Attachment is obsolete: true
Attachment #157138 -
Flags: review?(neil.parkwaycc.co.uk)
Comment 13•20 years ago
|
||
Hmm... this patch does seem to help on Linux, but not on Windows. CC'ing someone who worked on this before to see if they can shed any light.
Assignee | ||
Comment 14•20 years ago
|
||
http://bugzilla.mozilla.org/attachment.cgi?id=146241&action=view This test case still fails... blank <B></B> causes trouble. I'm afraid to fix it will cause regression.
Assignee | ||
Comment 15•20 years ago
|
||
I'm trying to fix windows. It seems that GetPrevWord/GetNextWord are not symmetry with win style.
Assignee | ||
Comment 16•20 years ago
|
||
I'm trying to simplify nsTextFrame::PeekOffset's eSelectWord section. It needn't to be as complex as current. But because we couldn't get information about where there's a punctuation at begin/end of a frame, we don't know whether we need stop. Example: abc+abc+<b>efg</b> abc+abc<b>efg</b> are always having same stoppings. This is boring. Because the word is crossing nsFrames, and in PeekOffset() we go to next nsFrame by recursion, nsTextTransformer is treating them as 2 words. On linux, we usually set "stop_at_punctuation" to false, we don't have this issue, we just care about white_space. What's your thoughts, Neil?
Assignee | ||
Comment 17•20 years ago
|
||
this patch works for me on both Windows and Linux; because of bug 237228, user can't switch to stop at beginning of next word or end of this word now. for abc+abc+<b>efg></b>, abc+abc<b>efg></b> issue, I just follow current behaviour of ctrl+left.
Attachment #157407 -
Attachment is obsolete: true
Assignee | ||
Comment 18•20 years ago
|
||
Comment on attachment 158293 [details] [diff] [review] patch v3 review? roc
Attachment #158293 -
Flags: review?(roc)
I'm lost. Can you carefully explain what was wrong with the logic in the existing code and how you've fixed it?
Assignee | ||
Comment 20•20 years ago
|
||
linux/unix test cases (set layout.word_select.eat_space_to_next_word to false)
Assignee | ||
Comment 21•20 years ago
|
||
windows test cases (set layout.word_select.eat_space_to_next_word to true)
Assignee | ||
Comment 22•20 years ago
|
||
roc, I've created test cases to show what's the problems with exsiting code. I'll explain my patch later. But without getting bug 237228 fixed. We need to test it on windows/linux separately. So I suggest to get bug 237228 fixed before this one. (and the patches have conflicts) BTW: I found a regression of my last patch with www.nytimes.com. caret get stuck before a certain image when pressing ctrl+right. It is caused by removing aPos->mAmount = eSelectNoAmount; in nsFrame::GetFrameFromDirection. I've a workaround in nsFrame::PeekOffset. I'll post it later.
Assignee | ||
Comment 23•20 years ago
|
||
get roc in. patch v3 didn't solve Case 6:empty block "<b></b>" in word I'll fix it later.
Comment on attachment 158293 [details] [diff] [review] patch v3 Minusing to get it off my queue until it gets fixed
Attachment #158293 -
Flags: review?(roc) → review-
Assignee | ||
Comment 25•20 years ago
|
||
after apply this patch, all test cases work well on both linux and windows.
Attachment #158293 -
Attachment is obsolete: true
Assignee | ||
Comment 26•20 years ago
|
||
description of my patch, Part1 nsFrame::PeekOffset aPos->mAmount equals to eSelectCharcter or eSelectWord. Here is the logic, caret enters non-textframe after leaving a textframe. The non-textframe usually is an image or blankblock(<b></b>, <b><i></i></b>). I removed the comparision between newOffset and aPos->mStartOffset, And bring the else-clause ahead. Because newOffset is index of mContent in its parent. nsIContent* newContent = mContent->GetParent(); PRInt32 newOffset = newContent->IndexOf(mContent); It doesn't make sense to compare it with aPos->mStartOffset. We should just assign it to aPos->mContentOffset according to mDirection. FYI: In bug 240665, I added return NS_OK; into else-clause. Sometimes, just press arrowkey again, caret may get through. (the runpath is get aPos->mContentOffset assigned by else-clause, next time it will go into then-caluse) But it's not the approach. We still have bug 259984. After this patch, bug 259984 will gone. Part2 nsFrame::GetFrameFromDirection Because we've fixed Part1, we don't need set aPos->mAmount to eSelectNoAmount now. Part3: nsTextFrame::PeekOffset The most complexe part. I wish I can help you understand the code. We've 2 styles, style 1) wordSelectEatSpaceAfter is true, we'll stop at beginning of next word. style 2) wordSelectEatSpaceAfter is false, we'll stop at end of word. aPos->mEatingWS is a mark of we're eating space after a word. The logic for style 1), go ahead to find whitespace, then set aPos->mEatingWS to true. if aPos->mEatingWS is true, and we find !isWhitespace, stop immediately. The logic for style 2), go ahead to find !isWhitespace, then set aPos->mEatingWS to true. (we think we've already eaten enough spaces) if aPos->mEatingWS is true, and we find space agian, stop immediately.
Attachment #159703 -
Flags: review?(roc)
Comment on attachment 159703 [details] [diff] [review] patch v4 I have to say I don't really understand this code. Maybe you're the only one who does :-). But as far as I understand it, it looks OK.
Attachment #159703 -
Flags: superreview+
Attachment #159703 -
Flags: review?(roc)
Attachment #159703 -
Flags: review+
Comment 28•20 years ago
|
||
Fixed. Checking in nsFrame.cpp; /cvsroot/mozilla/layout/html/base/src/nsFrame.cpp,v <-- nsFrame.cpp new revision: 3.521; previous revision: 3.520 done Checking in nsTextFrame.cpp; /cvsroot/mozilla/layout/html/base/src/nsTextFrame.cpp,v <-- nsTextFrame.cpp new revision: 1.479; previous revision: 1.478 done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 29•20 years ago
|
||
*** Bug 259984 has been marked as a duplicate of this bug. ***
Comment 30•19 years ago
|
||
This caused bug 304891.
Comment 31•19 years ago
|
||
*** Bug 211032 has been marked as a duplicate of this bug. ***
Comment 32•19 years ago
|
||
*** Bug 311358 has been marked as a duplicate of this bug. ***
Comment 33•19 years ago
|
||
*** Bug 236042 has been marked as a duplicate of this bug. ***
Updated•18 years ago
|
Blocks: word-select
Updated•5 years ago
|
Component: Keyboard: Navigation → User events and focus handling
Comment 34•5 years ago
|
||
Keywords: sec508
You need to log in
before you can comment on or make changes to this bug.
Description
•