Closed Bug 105487 Opened 23 years ago Closed 23 years ago

When copying and pasting text with different text styles (bold, italic, or underline) in composer, the spaces inbetween the different styles is lost.

Categories

(SeaMonkey :: Composer, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.9

People

(Reporter: dslmichael, Assigned: mozeditor)

References

Details

(Whiteboard: EDITORBASE; fixinhand; need r=)

Attachments

(1 file)

Spaces are lost when copying and pasting text that has different text styles in it.

Steps to Reproduce:
1.Open composer
2.Type "This sentance is going to lose some spaces."
3.Highlight the first two words (This sentance) and make them bold
4.Highlight the next two words (is going) and make them italic
5.Highlight the next two words (to lose) and make them underline
6.Highlight the whole selection, and copy it to the clipboard (Ctrl+C)
7.Deselect the text, and hit enter twice to get you to a new line
8.Paste the text (Ctrl+V)

Actual results: The spaces inbetween where the text style changed are gone.

Expected results: The text should appear exactly as it appeared before it was
copied.  The only way to get it to copy over as it appears is to make sure when
you highlight the words, you also highlight the space inbetween the last word of
the first style and the first word of the next style.  Otherwise the space is
not within the bold italic or underline tags, and gets lost.


Reproduced on Win XP, Win 98, and Mac OSX all using build 20011017.
-->serializer
Assignee: syd → harishd
Component: Editor: Composer → DOM to Text Conversion
Whiteboard: EDITORBASE
-->peterv
Assignee: harishd → peterv
*** Bug 105772 has been marked as a duplicate of this bug. ***
In build # 2001121003 This is still happening. 
Confirming based on the dupe and recent comment.
Status: UNCONFIRMED → NEW
Ever confirmed: true
I don't see it happening in Serializer. It seems that in the copy process nodes 
(specially with white spaces) are properly retained and problem occurs while 
pasting in "Editor" somewhere.
Also content is getting pasted properly on notepad, where PlainTextSerializer 
comes into picture. 

Would someone please verify it and assign it to the right person !
If it's not happening in the html serializer, then it's probably either edit
rules or copy encoding, both of which would be Joe ...
snarfing bug.  099
Assignee: peterv → jfrancis
Target Milestone: --- → mozilla0.9.9
uhh, this is worksforme folks.  followed instructions exactly.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
I am still seeing this problem on Win ME using trunk build 2002020908.

One thing I might not have been clear on is that in steps 3 - 5 you have to 
make sure not to highlight the spaces inbetween the words.  So the HTML created 
by the first 5 steps will look like the selection below.  And then when you 
copy and paste the text, the whitespace between the tags is deleted.

Original HTML:  <b>This sentance</b> <i>is going</i> <u>to lose</u> some 
spaces.   
Which gets pasted as:  <b>This sentance</b><i>is going</i><u>to lose</u> some 
spaces.

I am reopening this bug.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
ok. i believe you, but I really did follow the directions :-)  I have some 
changes in my tree, maybe they fixed this (although that seems unlikely).  I'll 
investigate some more...
I'm also able to reproduce it with Feb 11'02 build on Windows 98 and NT.
Component-->Editor:Composer
Component: DOM to Text Conversion → Editor: Composer
this should do the trick.
Whiteboard: EDITORBASE → EDITORBASE; fixinhand; need r=, sr=
Comment on attachment 69449 [details] [diff] [review]
patch for editor/libeditor/html/nsHTMLDataTransfer.cpp

sr=kin@netscape.com

Do you know why we were stripping formatting nodes in the first place?

If it really is necessary, perhaps the strip formatting nodes method needs to
be more savvy to context like the WSRunObject?
Attachment #69449 - Flags: superreview+
Whiteboard: EDITORBASE; fixinhand; need r=, sr= → EDITORBASE; fixinhand; need r=
Kin, I thought long about why I might have done that.  I believe that I had to
add it for the contextual fragment that I build in that same routine.  Otherwise
the serializer might have put in some whitespace, which then breaks my
assumption that the dom we get back from it is a straight parent-child chain
from top to bottom.

I could come up with no reason why I shold have to strip it for the regualr html
stream, though, so I took it out.  I played around some with pasting parts of
tables during testing and didnt have any trouble.  I guess i should expirement
with list item pasting as well.

I didn't put a comment with the stripping, which leads me to think that it was
on a whim rather than for a good reason.
fixed on tip
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
Verified on Mac OS9 and Win XP using teh 02-20 trunk builds.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: