Closed Bug 101755 Opened 23 years ago Closed 23 years ago

Anomalous spaces added in the middle of HTML

Categories

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

x86
All
defect

Tracking

()

VERIFIED DUPLICATE of bug 85184
mozilla1.2alpha

People

(Reporter: TucsonTester2, Assigned: t_mutreja)

Details

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:0.9.4) Gecko/20010924 Netscape6/6.2 BuildID: 20010924 When editing a page in composer, there are three different actions which cause anomalous spaces to be added to the html source code. When you open a saved file, a space is added to the beginning of each line in the page (source code only, space does not show up when browsing page). When you copy and paste multiple lines of text, a space is added to the beginning of each line of the pasted text except for the first line (source code only, does not show up when browsing page). The third action that can cause an anomalous space only happens if all of the following conditions are met. If you are formatting a portion of a line of text that does not include the end of the line. If you end the formatting within a series of characters and not at a blank space. If the tag for ending the formatting (for instance, </u>) occurs at the end of a line in the html source code, with the text immediately after the format change wrapping to the next line. This will cause a apace to be added at that point (this will not show up until you browse the page, or save/close/reopen the page in composer). Reproducible: Always Steps to Reproduce: 1.Open a new composer page 2.Type in 012345678901234567890123456789012345678901234567890 3.Press Cntrl a to highlight the line, and then Cntrl c to copy 4.Pressing right arrow key should remove highlighting and put cursor at end of line 5.Hit enter and then Cnrtl v to paste 6.Hit enter and then Cntrl v to paste 7.Press Cntrl a to highlight all three lines, and then cntrl c to copy 8.Press right arrow key to remove highlight, cursor should be at end of third line 9.Hit enter and then cntrl v to paste 10.With mouse, highlight a portion of the first line, end of highlighting needs to be between the final 3 and final 0 on the line. 11.Click on color picker, and change text color to a different color 12.Save the page and close composer 13.Open composer, select file->open file 14.Select the file you had saved Actual Results: In normal view, on the line of text where the color was changed, there will be a space where the color switches back to default color (you will also see the added space if you browse the page). If you change to html source view, you will see that a apace has been added to the beginning of each line (caused by opening a saved file). You will also see that the final two lines have an additional space at the beginning of the line (caused by the copy and paste, first line of pasted text does not have the extra space). Also note that the first line of text ends with </font>, with the numbers following the color change wrapped to the next line in the html source code (which is what caused the space to be added at the point the color changed). Expected Results: There should be no space added by the color change. There should be no spaces added to the html source code for opening a saved file or for copying/pasting multiple lines of text. The space added by copying and pasting text only occurs when copying/pasting within composer (either same window or from copying from one composer window to another). If you copy text from another source (including navigator window) and then paste into composer, the extra space is not added. Other format changes besides color (ie bold, italic, underline) will also cause the additional space to be added, its just easiest to reproduce with a color change, since the tags for color take up more space in the html source code.
The saved file looks like this: <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <title>bug 101755</title> </head> <body> 0123456789012345678901<font color="#cc0000">23456789012345678901234567</font> 890<br> 012345678901234567890123456789012345678901234567890<br> 012345678901234567890123456789012345678901234567890<br> 012345678901234567890123456789012345678901234567890<br> 012345678901234567890123456789012345678901234567890<br> 012345678901234567890123456789012345678901234567890<br> <br> </body> </html>
Status: UNCONFIRMED → NEW
Ever confirmed: true
CCing composer folks for input.
Bug #61228 seemed to deal with this problem, it was showing as verified/fixed on 0514 trunk (05/14/01). I initially added a comment to that bug indicating that the bug was showing up in the 20010924 build. Received a reply telling me to file as a new bug under the dom to text conversion component. Had meant to reference that bug number in my report, looks like I missed it.
Adding peterv to the cc list. Since he's our new serializer guru.
Giving bug to peterv since he is our new serializer dude ;-)
Assignee: harishd → peterv
Priority: -- → P3
Target Milestone: --- → mozilla1.2
Should be marked as "Duplicate" of bug#85184 as it seems to be fixed with the same patch as that of 85184.
Assignee: peterv → tmutreja
Cause of the bug is same as the one for 85184. Problem occurs when we add a new line character to wrap the lines. Marking as "Duplicate" of 85184. *** This bug has been marked as a duplicate of 85184 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.