WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
62606
When double clicking to select an element text, don't include the ending newline in the selection
https://bugs.webkit.org/show_bug.cgi?id=62606
Summary
When double clicking to select an element text, don't include the ending newl...
Prodego
Reported
2011-06-13 15:49:53 PDT
When double clicking to select an element of text, the trailing newline of the text is selected. For example (and my apologies as I don't have anywhere to upload a nice example for you), in Google Chrome's about:version page, double clicking the webkit version information selects: "535.1 (branches/chromium/782@88413)\r\n" (dev build on Windows 7). Since the most common reason to select a text segment is to copy and paste it, a trailing newline is usually not desired. It would be better behavior to select the element up to, but not including, the final newline.
Attachments
Add attachment
proposed patch, testcase, etc.
Ryosuke Niwa
Comment 1
2011-06-13 15:53:25 PDT
I think this is a good improvement. I get annoyed by this behavior myself.
Alexey Proskuryakov
Comment 2
2011-06-13 22:47:02 PDT
> and my apologies as I don't have anywhere to upload a nice example for you
You can attach an example to this bug.
Prodego
Comment 3
2011-07-09 18:59:31 PDT
(In reply to
comment #2
)
> > and my apologies as I don't have anywhere to upload a nice example for you > > You can attach an example to this bug.
Ah, yes of course, silly me. But your comment suffices very well as an example. Just double click "You can attach an example to this bug" and note the ending newline is selected as well as the text.
Kaustubh Atrawalkar
Comment 4
2011-08-05 06:05:52 PDT
Does this happen on Linux as well? I think double click will only select the word
Ryosuke Niwa
Comment 5
2011-08-15 10:45:30 PDT
See the
bug 30234
.
Kaustubh Atrawalkar
Comment 6
2011-10-13 22:55:05 PDT
Why not to remove taking next VisiblePostion after selecting the paragraph? Index: WebCore/editing/VisibleSelection.cpp =================================================================== --- WebCore/editing/VisibleSelection.cpp (revision 97353) +++ WebCore/editing/VisibleSelection.cpp (working copy) @@ -356,7 +356,7 @@ // Include the "paragraph break" (the space from the end of this paragraph to the start // of the next one) in the selection. - VisiblePosition end(visibleParagraphEnd.next()); + VisiblePosition end(visibleParagraphEnd); if (Node* table = isFirstPositionAfterTable(end)) { // The paragraph break after the last paragraph in the last cell of a block table ends
Enrica Casucci
Comment 7
2011-10-14 09:48:10 PDT
(In reply to
comment #3
)
> (In reply to
comment #2
) > > > and my apologies as I don't have anywhere to upload a nice example for you > > > > You can attach an example to this bug. > > Ah, yes of course, silly me. But your comment suffices very well as an example. Just double click "You can attach an example to this bug" and note the ending newline is selected as well as the text.
Please provide an example. Is this a Windows only behavior or do you see it on multiple platforms? I've tried what you describe on Mac and I don't see the issue. Is it related to different editing behaviors on the different platforms?
Kaustubh Atrawalkar
Comment 8
2011-10-17 01:27:00 PDT
> > Please provide an example. Is this a Windows only behavior or do you see it on multiple platforms? > I've tried what you describe on Mac and I don't see the issue. Is it related to different editing behaviors on the different platforms?
AFAIK this is issue with paragraph selection. When u double click text on Windows it selects the trailing new line which is annoying. We want to select the paragraph till the end of the line only and not ending \n.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug