Closed Bug 73659 Opened 23 years ago Closed 23 years ago

Textareas disappear when switching from Normal->ViewSource->Normal modes

Categories

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

defect

Tracking

()

VERIFIED FIXED
mozilla0.9

People

(Reporter: kinmoz, Assigned: kinmoz)

Details

(Keywords: dataloss)

Attachments

(2 files)

Textareas disappear in Composer when switching from Normal mode to ViewSource 
mode and back to Normal mode.

There are actually 2 problems:

1. nsHTMLContentSerializer is writing out the contents of
   all textareas as attributes. For example <textarea>foo</textarea>
   becomes <textarea defaultvalue="foo" value="foo"></textarea>
   which causes textareas to appear empty when loading the
   serializer's output into non Gecko based browsers.

   I filed bug #73605 to track this problem.

2. The editor has code in nsHTMLEditor::IsEmptyNode() that is removing
   empty textareas from the content model since the DTD considers a
   textarea to be a container, and it is not one of the listed exceptions.

This bug is supposed to address #2 above.
Attached file Simple Test Case
Status: NEW → ASSIGNED
Keywords: dataloss
Priority: -- → P1
Whiteboard: FIX IN HAND
Target Milestone: --- → mozilla0.9
r = jfrancis
Checked in fix for <textarea> and <map> (Bug #55224) to the trunk:

    mozilla/editor/base/nsHTMLEditUtils.cpp    revision 1.15
    mozilla/editor/base/nsHTMLEditUtils.h      revision 1.10
    mozilla/editor/base/nsHTMLEditor.cpp       revision 1.356

r=jfrancis@netscape.com  sr=sfraser@netscape.com

Note that the fix that was checked in was similar to the 03/27/01 14:46 patch in 
bug #55224, not the patch attatched to this bug.
Clearing white status board. Marking FIXED.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Whiteboard: FIX IN HAND
verifying with optimized linux mozilla build from 8am today.
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: