Closed Bug 103207 Opened 24 years ago Closed 24 years ago

Composer won't break long tags

Categories

(Core :: DOM: Serializers, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.1alpha

People

(Reporter: north, Assigned: t_mutreja)

References

()

Details

(Whiteboard: [patch needs sr=])

Attachments

(1 file)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801 BuildID: 2001080104 When I edit a page with a long tag such as -> <center><a href="../bogus.html"><b><img src="../images/bogus.gif" alt="Dave&apos;s Anchor Tag Is Way Too Long" width="424" height="68" border="0" align="Baseline"> ... composer won't break this line as rendered in the View HTML Source window (and will save it without a normal line break). Probably it should break the tag at some reasonable space... Reproducible: Always Steps to Reproduce: 1.Go to above url 2.File->Edit Page 3.View->HTML Source Actual Results: Great big honking long line running past the end of my monitor and sticking into my girlfriend's ear. Expected Results: A few more modest lines.
Confirming. The html serializer should check the line length before writing each attribute, and break the line if necessary (extra credit, indent it taking into account the tag length when prettyprinting).
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: --- → mozilla1.1
Added a check on current column position before the attribute gets serialzed.
--> myself.
Assignee: akkana → tmutreja
Status: ASSIGNED → NEW
The fix looks good -- thanks! I'll test it when my build finishes, but it looks like it should do the job. Minor request: please try to keep lines (especially comments) under 80 columns wide, so they will be easily readable in all development environments and can be printed on a normal printer. I realize the existing code in that file doesn't follow that rule consistently, but I'd appreciate it if we could at least do that for new code.
Comment on attachment 65975 [details] [diff] [review] Patch for fixing it... The patch works fine and solves the problem reported here. r=akkana If we wanted to get clever, it would be fun to make it smarter about where it indents to (e.g. to the level of the opening < plus one), but that would be another bug.
Attachment #65975 - Flags: review+
*** Bug 101752 has been marked as a duplicate of this bug. ***
Keywords: patch
Whiteboard: [patch needs sr=]
Comment on attachment 65975 [details] [diff] [review] Patch for fixing it... sr=jst
Attachment #65975 - Flags: superreview+
Fixed with checkin C:\mozilla\content\base\src>cvs commit nsHTMLContentSerializer.cpp Checking in nsHTMLContentSerializer.cpp; /cvsroot/mozilla/content/base/src/nsHTMLContentSerializer.cpp,v <-- nsHTMLCont entSerializer.cpp new revision: 1.35; previous revision: 1.34 done
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Verified on trunk build 02-21. If anyone is still seeing this problem, feel free to reopen this bug.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: