http://crbug.com/56971 What steps will reproduce the problem? 1. Put some newlines in an empty textarea. 2. Read its selectionStart property via Javascript. What is the expected result? It should return the a number equal to the number of newlines. What happens instead? It always returns 1. It may be a bug in Webkit, since Safari fails too. I did a reduction that shows the problem very easily: http://martinml.com/textarea.html This is especially annoying in a phpBB forum editor, since if you want to put some newlines and then click the button to insert a bbcode tag, it's inserted just after the last text, and not after the newlines.
Created attachment 85260 [details] demo This is a failed attempt to write a layout out for this bug. It seems like the bug can be reproduced only if we ran it manually.
Created attachment 85262 [details] fixes the bug
Comment on attachment 85262 [details] fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=85262&action=review > Source/WebCore/editing/SelectionController.cpp:171 > + // See https://bugs.webkit.org/show_bug.cgi?id=56061 nit: I feel the bug entry doesn't have additional information and ChangeLog is enough.
(In reply to comment #3) > (From update of attachment 85262 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=85262&action=review > > > Source/WebCore/editing/SelectionController.cpp:171 > > + // See https://bugs.webkit.org/show_bug.cgi?id=56061 > > nit: I feel the bug entry doesn't have additional information and ChangeLog is enough. Ok. Do you think I can also get rid of the line above where I say "// Even if selection was not changed, selection offset may have been changed." ?
(In reply to comment #4) > Do you think I can also get rid of the line above where I say "// Even if selection was not changed, selection offset may have been changed." ? No. This line looks helpful.
(In reply to comment #5) > (In reply to comment #4) > > Do you think I can also get rid of the line above where I say "// Even if selection was not changed, selection offset may have been changed." ? > > No. This line looks helpful. Ok. Thanks for the review. Landing it now.
Committed r80679: <http://trac.webkit.org/changeset/80679>