Closed Bug 221719 Opened 21 years ago Closed 21 years ago

"Paste as Quotation" should not apply to single-line textboxes

Categories

(Core :: DOM: Editor, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: neil, Assigned: akkzilla)

Details

Attachments

(1 file)

Steps to reproduce problem: 1. Copy some text to the clipboard 2. Compose a message 3. Place the cursor in the subject field 4. Edit/Paste as Quotation Expected results: disabled menuitem Actual results: "> " + text pasted in As per bug 151332 textareas should still allow paste as quotation.
We should probably disable paste as quotation in the single line case. What should ctrl-middleclick do? Nothing? Or just a normal paste? I guess if it goes through command handlers, the command would be disabled so it would do nothing (which is probably fine).
The command needs to be disabled to affect the menuitem correctly.
This patch only affects Message Compose's Paste As Quotation, because that goes through the command controllers and ctrl+middle-click paste does not. This also means that nsPasteCommand should no longer handle quotations.
Comment on attachment 132956 [details] [diff] [review] Patch for Message Compose only I'm ok with this patch (r=brade) but I'd like akk to review the first chunk since I'm not sure why the code was originally written that way. Also, as Neil commented on irc, it's not clear why this paste as quotation command is registered for single line editors; perhaps due to poor factoring of editors?
Attachment #132956 - Flags: review?(akkzilla)
Looking at the cvs history, it looks like there was no paste as quotation command, just a paste command, and that's why the command was written like that. It looks like the paste as quotation command was added in cvs version 1.28, but the "pasteQuote" stuff in the old command was never removed, so at least for a while there were two different ways of accessing paste as quotation via commands. The question is, does anyone still depend on using the paste command with a "pasteQuote" string? Is that even possible? I'm guessing that the new command structure has no way to call such a thing -- is that right? If so, then the change would be safe, and a good idea from a code cleanup standpoint. (I haven't tested the patch to make sure that nothing breaks.) If anyone still does use that, ideally, we should still take the patch, and fix the caller. Hesitating on marking it reviewed ... can someone reassure me on whether it's possible to call the wrong command, or does one of us need to do an lxr search? Pending that, the patch is fine with me. Adding Joe just in case he has anything to say about any of this.
Comment on attachment 132956 [details] [diff] [review] Patch for Message Compose only Based on Akkana's research, I think she's right that the old code was just never removed. My scanning (via lxr) of the code base found no other uses and Neil also did a similar search. r=brade
Attachment #132956 - Flags: superreview?
Attachment #132956 - Flags: review?(akkzilla)
Attachment #132956 - Flags: review+
Attachment #132956 - Flags: superreview? → superreview?(alecf)
Comment on attachment 132956 [details] [diff] [review] Patch for Message Compose only it really is too bad that the editor has to have a special "mail editor" mode instead of having a bunch of specific features/modes that the mail compose window would just turn on... sr=alecf
Attachment #132956 - Flags: superreview?(alecf) → superreview+
Fix checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: