Closed Bug 19137 Opened 20 years ago Closed 20 years ago

[feature] Pasting characters will lose the style of characters

Categories

(Core :: DOM: Editor, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: teruko, Assigned: akkzilla)

References

Details

Attachments

(1 file)

When you copy the characters with some style, Italic, Underline, or Bold, and
paste the characters in the same composer, you can paste only characters.
Composer does not past style of characters.

Steps of reproduce
1. Open Composer
2. Type ABC
3. Select the characters and change the style by using Style buttons or menu
   Format - style menu
4. Paste to the same composer

Notice that the characters are pasted fine, but style of the characters does not
show.

Tested 111708 Win32 111709 Linux and 111612 Linux build.
I also see this on Macintosh with a build from yesterday (17th).

We need to decide if we want it to pick up the style or not.

Teruko: please note that if you had made only the "B" bold, and copied the entire
text, the "B" would remain bold.
Whiteboard: [PDT-]
This is a 2nd order problem. The fact that paste of characters works is
sufficient for dogfood.
Assignee: beppe → akkana
Target Milestone: M13
moving this to m13 for now and assiging to akkana
Status: NEW → ASSIGNED
Just noting that the current behavior is basically intentional.  Beth posted a
message on mozilla.editor a few days ago asking whether anyone thought it should
do anything different, and I've seen no replies at all.  If no one replies and
comes up with a better heuristic for which style elements should be included in
a copy, this bug will be closed as wontfix.  So if you have an idea of what
heuristic we should use to determine which style elements get copied, post them
to the editor group now.
Summary: [dogfood]Pasting characters will lose the style of characters → Pasting characters will lose the style of characters
Whiteboard: [PDT-]
updating the summary fields, removing PDT- & [dogfood]
Summary: Pasting characters will lose the style of characters → [feature] Pasting characters will lose the style of characters
forgot to add [feature] in the summary field
Target Milestone: M13 → M20
Moving out to M20 because we don't have a plan for how we want to do things
differently, or even if we do want to.
*** Bug 26576 has been marked as a duplicate of this bug. ***
moving this up to M15; our intent is to grab all of the styles up to the nearest 
block
Target Milestone: M20 → M15
Fixed!  Try it and see if this is the right algorithm.
(fixed)
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
I tested this in 2000041009 Win32 build using Japanese Input method.
Coping Italic, Underline, and Bold characters and pasting the characters 
sometimes the pasted characters do not have the style. I tried to find 
reproduciable steps,but I have not found it.  I will reopen this, and I will 
test this more.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Changed QA contact to teruko@netscape.com.
QA Contact: sujay → teruko
moving to M16 for now; I can't reproduce in English on Mac
Target Milestone: M15 → M16
Still not clear what the problem was.  It sounds like it probably ought to be a
new bug, anyway, if you see it again.
Status: REOPENED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → FIXED
I tested this in 2000041306 Win32, 2000041307 Mac, and 2000041310 Linux M15 
builds.  I found the case this does not work.

When you copy some characters with some style and paste these characters to just
after some other characters with different style, the characters' style you 
paste is same as the characters next to.

Steps reproduce
1. Open Composer
2. Type ABC, select characters and change characters style to Bold
3. Hit the return to the next line
4. Type DEF, select characters and change characters style to Underline
5. Move cursor to the first line and select character ABC 
6. Select menu Edit|Copy to copy
7. Move cursor to just after DEF in the second line
8. Select menu Edit|Past to paste
Look at the characters you just pasted.  ABC is underlined.  They should be 
Bold.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I see the same behavior you describe ... but it's not part of this bug, which
was to include the style of the character along with the paste.  If you paste
into a new blank composer window, you'll see that the style is indeed included
in the copy of the ABC characters.

What you're seeing is that the edit rules, when you put the caret after an
underlined section of text, make any new text typed or pasted after that take on
the style of whatever is just before the caret.  I also noticed that DEF was
both bold and underlined, not just underlined, because when I put the caret
after ABC and hit return, I was still in "bold mode" because of the ABC -- the
same rule is operating there.

I think this is acting as intended, but if you think it's doing the wrong thing,
please file a bug to jfrancis.
Status: REOPENED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → FIXED
Ok, I will log the different bug about what I said in my previous comment.

I tested this in 2000041909 Win32 build on Winnt 4.0.
I found that the underlined characters sometimes lose the style after I pasted.

Steps of reproduce
1. Open the Composer
2. Type "aaaaa" and hit enter to go to next line
3. Select menu Format|Text Style->Underline
4. Type "bbbbb" ("bbbbb" is underlined)
5. Select "bbbbb" and select menu Edit|Copy to copy
6. Hit return to move to next line
7. Select menu Edit|Paste
   Notice that "bbbbb" is not underlined.

I tried this without step #2 and #3. Sometimes I could reprocude, but I could
reproduce all the time with these steps.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Accepting.  This seems to have regressed.  I'll investigate.
Status: REOPENED → ASSIGNED
Turns out this wasn't a regression, it was just that <u> had never been added to
the list of inline tags in nsHTMLDocument.cpp.  I have a fix, will check in
ASAP.
Checked in the fix for <u>.  Please let me know if you encounter any other tags
which behave badly.  Thanks for catching that!
Status: ASSIGNED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → FIXED
I tested this in 2000042109 Win32 build.  Pasting Underline works fine.  I 
logged the additional problem in 36994, so I mark this as verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.