Last Comment Bug 73373 - Multiple Selection of Text with CTRL
: Multiple Selection of Text with CTRL
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Selection (show other bugs)
: Trunk
: All All
: -- enhancement with 3 votes (vote)
: Future
Assigned To: selection
:
Mentors:
http://www.windowplanet.net/images/wo...
: 86131 113196 127054 191469 (view as bug list)
Depends on: 285786 285797 337401 415707
Blocks: 32627
  Show dependency treegraph
 
Reported: 2001-03-25 09:10 PST by Dan Nunn
Modified: 2008-03-22 11:43 PDT (History)
21 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (931 bytes, patch)
2005-02-24 08:35 PST, Martijn Wargers [:mwargers] (not working for Mozilla)
no flags Details | Diff | Splinter Review
patch2 (1.08 KB, patch)
2005-03-02 02:38 PST, Martijn Wargers [:mwargers] (not working for Mozilla)
no flags Details | Diff | Splinter Review
patch3 (2.00 KB, patch)
2005-03-04 04:58 PST, Martijn Wargers [:mwargers] (not working for Mozilla)
roc: review+
roc: superreview+
Details | Diff | Splinter Review

Description Dan Nunn 2001-03-25 09:10:10 PST
Office XP introduces a new feature to text selection, and I feel we should
"innovate" it before it's eventually added to IE and mozilla converts notice
Mozilla's lack of support for the feature. Well, we can step ahead of the curb
now. This new feature of text selection is called "Multiple Selection",
something that's been in file windows and spreadsheet programs for ages, but is
making its round in plain old text.

In Office XP, select some text. Hold CTRL, select text from a different area. It
works just the same as if you were to do it in an Explorer window, but with
text. If Mozilla implements "Print Selected" (I assume there's a bug on that, I
didn't check), this could be really handy. The URL included is a screen shot of
Office XP's multiple selecting abilities.
Comment 1 Blake Ross 2001-03-25 09:27:11 PST
I want this feature, like, 8 times a day.

(btw, print selected is already implemented).
Comment 2 Boris Zbarsky [:bz] 2001-03-25 09:38:40 PST
Changing the OS to all.  This would be useful on all platforms (possibly with
varying keybindings...)
Comment 3 Jesse Ruderman 2001-03-25 13:17:54 PST
What would this feature be used for?

Btw, Mozilla currently uses ctrl+click in a table cell to select the entire 
cell, and allows any combination of cells to be selected.  Ctrl+shift+click or 
ctrl+drag selects a rectangle of cells within a table.
Comment 4 Dan Nunn 2001-03-25 13:58:42 PST
This + Print Selection = Good Thing.

For example, say you're doing some research, come upon a huge article, and want
to print only a portion of it. Right now, select what portion you want to print,
print it, and if there's another selection, select that next, print it again, etc.

Or, say you were at Google, found a good page of results. Well, select what
results you want, hold CTRL, select more results you want, then Paste or Print.
If selecting cells is implemented, this couldn't be too far off anyhow (although
selecting cells' keymap would change if this was implemented).

Besides, if every other Windows app implements it (Windows XP common controls?
Who knows), Mozilla will need to eventually, anyway.
Comment 5 Jesse Ruderman 2001-03-25 14:21:30 PST
I'm still not convinced that this would be useful for normal text.  Currently, 
if I want to print several parts of an article, I paste each piece into a 
notepad window.  Using notepad gives me a chance to put an appropriate amount 
of whitespace between each part of the selection, something I probably wouldn't 
be able to do using multiple selections with "print selection".

Btw see also bug 36848, "Should only be one text selection per window".
Comment 6 Blake Ross 2001-03-25 15:53:29 PST
I'm very convinced this would be useful for normal text.  How is `open your 
favorite editor and select, copy and paste each bit at a time' easier than 
discontiguous selection via a modifier?  I find myself trying to use control to 
do this quite often when I want to copy bits and pieces of an article or some 
such (a behavior I learned from the Explorer GUI), only to be surprised when it 
doesn't work.
Comment 7 Jesse Ruderman 2001-03-25 16:24:07 PST
> How is `open your favorite editor and select, copy and paste each bit at a 
> time' easier than discontiguous selection via a modifier?

If you screw up while setting up multiple selections, you have to start over.  
In this case, screwing up could be as easy as accidentally left-clicking.  If 
you screw up while pasting each selection into notepad, you can Ctrl+Z the last 
action in the editor, or start over with one part of the selection.  (That 
problem doesn't mean it's always faster to move several blocks of text one at a 
time, but it could make this new feature less useful than it would be 
otherwise.)

How will spacing be handled, and will it be easy to distinguish between a real 
paragraph break and a selection break in the printed/pasted text?
Comment 8 timeless 2001-03-25 16:49:29 PST
Personally, i just use composer and delete what i don't want. but...
Comment 9 Dan Nunn 2001-03-25 17:43:57 PST
> How will spacing be handled, and will it be easy to distinguish between a real 
paragraph break and a selection break in the printed/pasted text?


That I don't know. I suppose we should wait for Office XP to set the precident
before we go and do something our own way.
Comment 10 Kathleen Brade 2001-03-26 07:49:02 PST
Composer should probably have this feature (at least on Windows) some day.
Reassign to anthonyd.
Comment 11 Boris Zbarsky [:bz] 2001-03-26 08:19:14 PST
The problem with copying each piece into a notepad/emacs/word window is that you
can easily lose markup.  Sometimes this doesn't matter all that much.  Other
times (MathML is the one I'm thinking off) once you've lost markup the content
is gibberish....

Using composer is a decent alternative I guess....
Comment 12 anthonyd 2001-03-26 12:42:33 PST
I have to agree with jesse ruderman on this one.  Orignally mjudge had multiple 
selection implemented, but a lot of people complained because there are a lot 
discrepancies with how other things worked (bold, italics, copy, 
paste(especially!), print).

marking as remind.

Comment 13 Jesse Ruderman 2001-06-15 14:59:38 PDT
*** Bug 86131 has been marked as a duplicate of this bug. ***
Comment 14 Kathleen Brade 2001-10-24 11:39:25 PDT
reopening bug; resolve remind shouldn't really be used
Comment 15 Kathleen Brade 2001-10-24 11:39:43 PDT
-->module owner
Comment 16 Kathleen Brade 2001-10-24 11:40:26 PDT
This bug should be WONTFIX if we don't intend to implement it.
Comment 17 Jesse Ruderman 2001-12-02 21:55:47 PST
*** Bug 113196 has been marked as a duplicate of this bug. ***
Comment 18 Brian 'netdragon' Bober 2001-12-02 23:01:52 PST
Should work on anything that can be selected including URL bar text.

What would be necessary to fix this bug - i.e. how would an implementor go about
this? How much work would be required?
Comment 19 Jonas Jørgensen 2002-02-21 14:14:17 PST
*** Bug 127054 has been marked as a duplicate of this bug. ***
Comment 20 Daniel Clemente 2003-02-08 10:59:37 PST
*** Bug 191469 has been marked as a duplicate of this bug. ***
Comment 21 R.K.Aa. 2004-03-21 07:17:32 PST
*** Bug 238162 has been marked as a duplicate of this bug. ***
Comment 22 Christopher Robert Jaquez 2004-05-02 00:10:52 PDT
Sorry to address this bug again after it has been stagnant for so long but
judging from the number of dupes, people seem to want this feature.  I just
wanted to add my vote into the mix with a little something to back it up. 
First, this feature has been in Windows file managers for many years.  Second,
it first came to text editing with Office XP a few years ago and was popular
enough to be carried over to the next version as well so it seems people are
getting quite accustomed to this behavior and are surprised not to see it elsewhere.

The reason I would like to see this implimented is that I (and many others) copy
the content of many web pages to a text reader.  When I copy the text, there are
often areas of inline content that get copied as well that are not supposed to
be read inline (text ads, related content/links, etc.).  These could be easily
avoided if Mozilla would allow selection up to the content in question and allow
it to resume after.  This would allow the copying of only the relevant content
and make the reading make much more sense.

BTW, I don't think this bug blocks bug 32627 so should someone who knows better
address that?
Comment 23 Martijn Wargers [:mwargers] (not working for Mozilla) 2004-05-07 00:42:43 PDT
Well, the code is all there. 
To get multiple selection with CTRL, all there has to be changed is this:

  rv = frameselection->HandleClick(content, startOffset , endOffset,
me->isShift, PR_FALSE, beginFrameContent);
PR_FALSE has to be changed into me->isControl
at line 1496 in layout/html/base/src/nsFrame.cpp

This works very well, but not for multiple selections on the same line, see bug 
220157.

view selection source uses only the first selection.
search web for/cut/copy uses the text from all the selections.
CTRL selection inside tables won't work. That is already used for selecting tables.

I think the most useful this could be is for Composer. 
Suppose you want different parts of text in the document to become bold.
With CTRL selection you'll have a neat way to do this.
But Composer doesn't handle multiple selections very well yet. It only uses the
first one.
Subsequently the midas commands also only use the first selection.
Comment 24 Martijn Wargers [:mwargers] (not working for Mozilla) 2005-02-24 08:35:24 PST
Created attachment 175439 [details] [diff] [review]
patch
Comment 25 Martijn Wargers [:mwargers] (not working for Mozilla) 2005-02-24 08:43:09 PST
Well, bug 220157 seems to be fixed now.
I've just tried this patch and it works without any real problems (there are
some parts of Mozilla that don't really support multiple selection, like "View
selection Source" and the midas command and possibly more).
Also, it doesn't interfere with the table-cell selection, which seems to have a
higher precedence.
But I don't know if other platforms are using other keybindings for this (isMeta
for the Mac?).
Comment 26 Boris Zbarsky [:bz] 2005-02-24 09:36:00 PST
I don't really know that sort of thing either... ccing Simon in case he does,
for Mac.

Also ccing aaron and some other people.
Comment 27 Simon Fraser 2005-02-24 10:18:04 PST
MS Word on Mac uses the Command key to do multiple selections, so isMeta sounds
right.

We need to make sure that we get all the selected text with copy, drag and drop,
and via the command for getting the selected text.
Comment 28 Christopher Robert Jaquez 2005-02-24 10:35:26 PST
Wow, glad to see this taken care of after all this time waiting and hoping, but
now that I have moved upward and onward to become a diehard Firefox user, I just
wanted to make sure this would be included in 1.1 as I assume that it would
since they are building from the same trunk now.

Anyone able to shed some light on that just to put my mind at rest?  If it is,
then I TRULY cannot wait for 1.1 (yeah, I can't wait anyway, but this will be
THE reason to upgrade for me).

Oh, and while I'm here, I assume it will fix thunderbird as well?  Just
wondering, thanks!
Comment 29 Martijn Wargers [:mwargers] (not working for Mozilla) 2005-03-02 02:38:42 PST
Created attachment 176023 [details] [diff] [review]
patch2

So like this, I guess? I can't check it for the Mac.
Cut, copy, drag and drop, undo, redo seems to work fine (at least here in
Windows), in websites and in textareas.
But it doesn't work fine for "View Selection Source". Also, it doesn't work for
execCommands. It only takes the first selection for those.
Comment 30 Brian 'netdragon' Bober 2005-03-03 10:40:19 PST
Some questions on the patch:
1) Does the patch work for "print selection"? (This is extremely important)
2) For "View Selection Source", what doesn't work? (For instance, does it only
show source the first group of selected text, or not open at all, etc)
3) Have you tested it on the suite (mozilla  and mailnews), along with on
Firefox and Thunderbird?
4) Have you tested it on Linux (if not, can you find people to test it for you)?
5) What are execCommands?
Comment 31 Martijn Wargers [:mwargers] (not working for Mozilla) 2005-03-04 04:58:49 PST
Created attachment 176271 [details] [diff] [review]
patch3

> 1) Does the patch work for "print selection"? (This is extremely important)
No, but this patch should take care of that (I had severe trouble with printing
selections, but that is unrelated to this patch). The printing of multiple
selections seems to work fine (at least to me).
> 2) For "View Selection Source", what doesn't work? (For instance, does it
only
> show source the first group of selected text, or not open at all, etc)
It only shows/uses the first range of the selection. A minor issue, imho.
> 3) Have you tested it on the suite (mozilla  and mailnews), along with on
> Firefox and Thunderbird?
> 4) Have you tested it on Linux (if not, can you find people to test it for
you)?
No, only Firefox windows build, but I see no reason why it shouldn't work in
those programs. But any testing on it would be welcome, though. I'm more
worried about the Mac part.
> 5) What are execCommands?
Commands for designMode/midas (do a Google search on "mozilla
midas/designmode").
Comment 32 Robert O'Callahan (:roc) (email my personal email if necessary) 2005-03-11 00:56:05 PST
Martijn, are you going to request reviews?
Comment 33 Martijn Wargers [:mwargers] (not working for Mozilla) 2005-03-11 01:15:12 PST
Well, drag and drop of multiple selections inside textareas and designmode
iframes doesn't work well, I've just found out. I'll submit a bug report about
this later.
Comment 34 Martijn Wargers [:mwargers] (not working for Mozilla) 2005-03-11 13:55:19 PST
Comment on attachment 176271 [details] [diff] [review]
patch3

Ok, I've submitted the two bugs, which possibly are too serious to consider
this patch.
I've set them to block this bug. I leave the decision to you.
I don't know if this patch works for the mac.
Comment 35 Kathleen Brade 2005-03-11 14:11:03 PST
Martijn (comment 34) -- please mention the two bugs you have filed.  I'm
guessing they are bug 285786 and bug 285797.
Comment 36 Martijn Wargers [:mwargers] (not working for Mozilla) 2005-03-11 14:38:37 PST
Yes, that's correct. I've set those bugs blocking this bug.
Comment 37 Robert O'Callahan (:roc) (email my personal email if necessary) 2005-03-14 15:08:07 PST
Comment on attachment 176271 [details] [diff] [review]
patch3

it sounds like we don't crash. I think we should turn this on.
Comment 38 Robert O'Callahan (:roc) (email my personal email if necessary) 2005-03-20 20:55:08 PST
Martjin, since this doesn't fix anything urgent, it might be best to check this
in at the start of 1.9.
Comment 39 Martijn Wargers [:mwargers] (not working for Mozilla) 2005-08-30 14:46:48 PDT
So if anyone is bored, the patch can be checked in.
Comment 40 Robert O'Callahan (:roc) (email my personal email if necessary) 2005-08-30 19:16:36 PDT
checked in. This could be fun!
Comment 41 Martijn Wargers [:mwargers] (not working for Mozilla) 2005-08-31 15:35:11 PDT
Thanks for checking in, Robert.
This interferes with table selection, which is also CTRL-click (Sorry, I should
have told this earlier).
(and CTRL-click table selection has also a weird issue, namely bug 210197)
Comment 42 Martijn Wargers [:mwargers] (not working for Mozilla) 2005-08-31 16:56:12 PDT
Well, I filed bug 306641 for that.
Comment 43 Joey Bowles 2007-04-04 12:50:19 PDT
This doesn't work as I would expect: Double click to select a word, hold down ctrl, then double click another word.  This deselects the first word. Both words should be selected.

The same should be true for triple-clicking multiple paragraphs.
Comment 44 Martijn Wargers [:mwargers] (not working for Mozilla) 2007-04-04 13:17:12 PDT
Joey, could you file a new bug on that (and mention the bug number here)?
Comment 45 Christopher Robert Jaquez 2007-04-04 13:24:48 PDT
I'm not sure what Joey is referring to is a new bug.  The original goal of this bug never was resolved as far as I can tell.  Multiple selection using the CTRL button has never been enabled on any build that I have ever used.  Anyone else get it to work?
Comment 46 Martijn Wargers [:mwargers] (not working for Mozilla) 2007-04-04 13:30:07 PDT
Christopher, it's fixed on trunk builds, this wasn't landed on the 1.8 branch, which means it isn't in Firefox2.0 builds.
Here you can download the latest trunk build:
http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/
(note that you can get some problems when you use a branch profile with a trunk build)
Comment 47 Uri Bernstein (Google) 2008-03-22 11:43:47 PDT
(In reply to comment #43)
> This doesn't work as I would expect: Double click to select a word, hold down
> ctrl, then double click another word.  This deselects the first word. Both
> words should be selected.
> 
> The same should be true for triple-clicking multiple paragraphs.
> 

This ended up being filed as bug 415707 (now blocking this bug).

Note You need to log in before you can comment on or make changes to this bug.