RESOLVED FIXED 9528
REGRESSION: arrow key skips '>' in Bugzilla replies due to '\n' in text nodes
https://bugs.webkit.org/show_bug.cgi?id=9528
Summary REGRESSION: arrow key skips '>' in Bugzilla replies due to '\n' in text nodes
David Kilzer (:ddkilzer)
Reported 2006-06-21 05:08:08 PDT
Steps to reproduce: 1. Open a Bugzilla bug (like this one). 2. Click "reply" to a comment (like this description field). 3. Position the cursor at the end of a line where the next line starts with a '>' character. 4. Hit the right arrow key. Expected results: The cursor should go to the beginning of the next line (to the left of the '>' character). Actual results: The cursor jumps over the '>' character and lands to its right.
Attachments
patch to handle \n and \r in setInnerText -- no test cases or change log (2.35 KB, patch)
2006-06-25 17:03 PDT, Darin Adler
no flags
Patch with test case (13.27 KB, patch)
2006-07-06 17:40 PDT, Anders Carlsson
adele: review+
Joost de Valk (AlthA)
Comment 1 2006-06-21 05:10:05 PDT
Heh David, i keep wondering how you find bugs like this one :)
David Kilzer (:ddkilzer)
Comment 2 2006-06-21 05:10:43 PDT
(In reply to comment #0) > Steps to reproduce: >  > 1. Open a Bugzilla bug (like this one). > 2. Click "reply" to a comment (like this description field). > 3. Position the cursor at the end of a line where the next line starts with a > '>' character. > 4. Hit the right arrow key.  Actually, you must hit the right arrow key TWICE for the cursor to move. Deleting the '>' characters proves quite challenging as well.  I'm guessing this is related.
David Kilzer (:ddkilzer)
Comment 3 2006-06-21 05:11:45 PDT
(In reply to comment #1) > Heh David, i keep wondering how you find bugs like this one :)  Just by filing bugs! :)  I tend to be very sensitive to the behavior of mouse and keyboard actions, and notice differences very quickly.
David Kilzer (:ddkilzer)
Comment 4 2006-06-21 05:13:05 PDT
Interestingly, if you type your own text with '>' characters, this does not happen.  There is something special about what the "reply" function does when pasting text into the textarea.  Maybe there's some CR/LF wackiness going on?
jonathanjohnsson
Comment 5 2006-06-21 07:57:03 PDT
Maybe you already know this, but this happened somewhere between the nightlies labeled r14926 and r14941.
Darin Adler
Comment 6 2006-06-24 20:04:40 PDT
(In reply to comment #4) > Interestingly, if you type your own text with '>' characters, this does not > happen.  There is something special about what the "reply" function does when > pasting text into the textarea.  Maybe there's some CR/LF wackiness going on? Yes, I'm sure this is a CR/LF issue.
Darin Adler
Comment 7 2006-06-25 16:35:33 PDT
(In reply to comment #6) > Yes, I'm sure this is a CR/LF issue. No, I'm wrong. Not a CR/LF issue at all. Instead the issue is that there are actual newline characters in the reply. But when editing we get <br> elements instead. Presumably we always want one or the other. I'm not sure which. Since <br> works right now, my focus should probably be on translating the newlines to <br> elements on the way in, but it also would be good to have editing work properly with actual newline characters in it. I don't see anything in the CSS style sheet or the code that would set the white space mode properly to make the newline characters work, so I really don't know what's going on there.
Darin Adler
Comment 8 2006-06-25 16:39:16 PDT
This boils down to the fact that we use setInnerText, and setInnerText does not turn the newlines into <br> elements. And it should! At least in some whitespace modes.
Darin Adler
Comment 9 2006-06-25 17:03:19 PDT
Created attachment 9028 [details] patch to handle \n and \r in setInnerText -- no test cases or change log
Darin Adler
Comment 10 2006-06-26 08:22:11 PDT
*** Bug 9592 has been marked as a duplicate of this bug. ***
David Kilzer (:ddkilzer)
Comment 11 2006-07-01 21:11:18 PDT
*** Bug 9681 has been marked as a duplicate of this bug. ***
Anders Carlsson
Comment 12 2006-07-06 17:40:53 PDT
Created attachment 9242 [details] Patch with test case
Adele Peterson
Comment 13 2006-07-06 17:48:49 PDT
Comment on attachment 9242 [details] Patch with test case Anders also tested WinIE and found that this matches their behavior.
Anders Carlsson
Comment 14 2006-07-06 17:55:19 PDT
Committed in r15194
Note You need to log in before you can comment on or make changes to this bug.