Bug 62606
| Summary: | When double clicking to select an element text, don't include the ending newline in the selection | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Prodego |
| Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Enhancement | CC: | ap, dbates, enrica, justin.garcia, kaustubh.ra, rniwa, ryuan.choi, silverroots, sullivan, xji |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | All | ||
| OS: | All | ||
Prodego
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
I think this is a good improvement. I get annoyed by this behavior myself.
Alexey Proskuryakov
> 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
(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
Does this happen on Linux as well? I think double click will only select the word
Ryosuke Niwa
See the bug 30234.
Kaustubh Atrawalkar
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
(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
>
> 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.