Closed Bug 59880 Opened 24 years ago Closed 24 years ago

Composer deletes textarea when switching from HTMLsource

Categories

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

PowerPC
Mac System 8.6
defect

Tracking

()

VERIFIED DUPLICATE of bug 55224
mozilla0.9

People

(Reporter: tarahim, Assigned: mozeditor)

References

()

Details

(Keywords: dataloss)

Attachments

(1 file)

Goto the URL (a new bug enry form). File|Edit Page. View|HTMLSource. View|Preview. The result: the line in the source containing textarea tag is deleted, and there is no text area for Description in the entry form. Mac 2000111020MTrunk
over to Editor. Confirmed with 111308 mozilla trunk build on Mac OS9
Assignee: asa → beppe
Component: Browser-General → Editor
QA Contact: doronr → sujay
Target Milestone: --- → mozilla0.9
Attached file Minimal Test Case
assigning to jfrancis -- joe, I believe this is a dup of bug 55224
Assignee: beppe → jfrancis
The textareas are disappearing because we are too aggressive in our deletion of empty nodes after inserting HTML. Here's the stack trace to the code that is actually removing the TextArea and Form node when switching back to normal edit. I think we need to limit our deletion of empty nodes to known block element nodes (ie p, blockquote, div, pre, etc): nsHTMLEditRules::RemoveEmptyNodes() line 5073 nsHTMLEditRules::AfterEditInner(int 14, nsIEditor::EDirection eNext) line 359 + 8 bytes nsHTMLEditRules::AfterEdit(nsHTMLEditRules * const 0x04f40884, int 14, nsIEditor::EDirection eNext) line 283 + 19 bytes nsHTMLEditor::EndOperation(nsHTMLEditor * const 0x04ee2590) line 6724 + 61 bytes nsAutoRules::~nsAutoRules() line 108 nsHTMLEditor::InsertHTMLWithCharsetAndContext(const nsString & {...}, const nsString & {...}, const nsString & {...}, const nsString & {...}) line 2952 + 84 bytes nsHTMLEditor::InsertHTMLWithCharset(nsHTMLEditor * const 0x04ee262c, const nsString & {...}, const nsString & {...}) line 2475 + 48 bytes nsHTMLEditor::InsertHTML(nsHTMLEditor * const 0x04ee262c, const nsString & {...}) line 2463 + 23 bytes nsHTMLEditor::RebuildDocumentFromSource(nsHTMLEditor * const 0x04ee262c, const nsString & {...}) line 3138 + 19 bytes nsEditorShell::RebuildDocumentFromSource(nsEditorShell * const 0x0490d560, const unsigned short * 0x05631ed0) line 2880 + 42 bytes XPTC_InvokeByIndex(nsISupports * 0x0490d560, unsigned int 52, unsigned int 1, nsXPTCVariant * 0x0012d980) line 139 nsXPCWrappedNativeClass::CallWrappedMethod(JSContext * 0x02aace70, nsXPCWrappedNative * 0x04ec1150, const XPCNativeMemberDescriptor * 0x00efb82c, nsXPCWrappedNativeClass::CallMode CALL_METHOD, unsigned int 1, long * 0x00f15cfc, long * 0x0012db68) line 920 + 42 bytes WrappedNative_CallMethod(JSContext * 0x02aace70, JSObject * 0x00de7908, unsigned int 1, long * 0x00f15cfc, long * 0x0012db68) line 228 + 34 bytes js_Invoke(JSContext * 0x02aace70, unsigned int 1, unsigned int 0) line 790 + 23 bytes js_Interpret(JSContext * 0x02aace70, long * 0x0012e8b4) line 2613 + 15 bytes js_Invoke(JSContext * 0x02aace70, unsigned int 1, unsigned int 2) line 807 + 13 bytes js_InternalInvoke(JSContext * 0x02aace70, JSObject * 0x00de73d8, long 15563928, unsigned int 0, unsigned int 1, long * 0x0012ea4c, long * 0x0012e9dc) line 879 + 20 bytes JS_CallFunctionValue(JSContext * 0x02aace70, JSObject * 0x00de73d8, long 15563928, unsigned int 1, long * 0x0012ea4c, long * 0x0012e9dc) line 3250 + 31 bytes nsJSContext::CallEventHandler(nsJSContext * const 0x02aab040, void * 0x00de73d8, void * 0x00ed7c98, unsigned int 1, void * 0x0012ea4c, int * 0x0012ea48, int 0) line 928 + 33 bytes nsJSEventListener::HandleEvent(nsIDOMEvent * 0x055b9574) line 154 + 64 bytes nsEventListenerManager::HandleEventSubType(nsListenerStruct * 0x0449d230, nsIDOMEvent * 0x055b9574, nsIDOMEventTarget * 0x02ae2c08, unsigned int 8, unsigned int 7) line 843 + 19 bytes nsEventListenerManager::HandleEvent(nsIPresContext * 0x0312a930, nsEvent * 0x0012f2ec, nsIDOMEvent * * 0x0012f284, nsIDOMEventTarget * 0x02ae2c08, unsigned int 7, nsEventStatus * 0x0012f330) line 1725 + 39 bytes nsXULElement::HandleDOMEvent(nsXULElement * const 0x02ae2c00, nsIPresContext * 0x0312a930, nsEvent * 0x0012f2ec, nsIDOMEvent * * 0x0012f284, unsigned int 1, nsEventStatus * 0x0012f330) line 3454 PresShell::HandleDOMEventWithTarget(PresShell * const 0x03128a30, nsIContent * 0x02ae2c00, nsEvent * 0x0012f2ec, nsEventStatus * 0x0012f330) line 4923 + 39 bytes nsButtonBoxFrame::MouseClicked(nsIPresContext * 0x0312a930, nsGUIEvent * 0x0012f4b8) line 138 nsButtonBoxFrame::HandleEvent(nsButtonBoxFrame * const 0x00f321cc, nsIPresContext * 0x0312a930, nsGUIEvent * 0x0012f4b8, nsEventStatus * 0x0012f79c) line 99 PresShell::HandleEventInternal(nsEvent * 0x0012f4b8, nsIView * 0x00000000, unsigned int 1, nsEventStatus * 0x0012f79c) line 4891 + 38 bytes PresShell::HandleEventWithTarget(PresShell * const 0x03128a30, nsEvent * 0x0012f4b8, nsIFrame * 0x00f321cc, nsIContent * 0x02ae2c00, unsigned int 1, nsEventStatus * 0x0012f79c) line 4857 + 22 bytes nsEventStateManager::CheckForAndDispatchClick(nsEventStateManager * const 0x0416b0c0, nsIPresContext * 0x0312a930, nsMouseEvent * 0x0012f8a8, nsEventStatus * 0x0012f79c) line 1941 + 61 bytes nsEventStateManager::PostHandleEvent(nsEventStateManager * const 0x0416b0c8, nsIPresContext * 0x0312a930, nsEvent * 0x0012f8a8, nsIFrame * 0x00f321cc, nsEventStatus * 0x0012f79c, nsIView * 0x0312a100) line 1075 + 28 bytes PresShell::HandleEventInternal(nsEvent * 0x0012f8a8, nsIView * 0x0312a100, unsigned int 1, nsEventStatus * 0x0012f79c) line 4896 + 43 bytes PresShell::HandleEvent(PresShell * const 0x03128a34, nsIView * 0x0312a100, nsGUIEvent * 0x0012f8a8, nsEventStatus * 0x0012f79c, int 1, int & 1) line 4811 + 25 bytes nsView::HandleEvent(nsView * const 0x0312a100, nsGUIEvent * 0x0012f8a8, unsigned int 28, nsEventStatus * 0x0012f79c, int 1, int & 1) line 379 nsViewManager2::DispatchEvent(nsViewManager2 * const 0x0312a2e0, nsGUIEvent * 0x0012f8a8, nsEventStatus * 0x0012f79c) line 1439 HandleEvent(nsGUIEvent * 0x0012f8a8) line 68 nsWindow::DispatchEvent(nsWindow * const 0x03128ee4, nsGUIEvent * 0x0012f8a8, nsEventStatus & nsEventStatus_eIgnore) line 686 + 10 bytes nsWindow::DispatchWindowEvent(nsGUIEvent * 0x0012f8a8) line 707 nsWindow::DispatchMouseEvent(unsigned int 301, nsPoint * 0x00000000) line 3982 + 21 bytes ChildWindow::DispatchMouseEvent(unsigned int 301, nsPoint * 0x00000000) line 4192 nsWindow::ProcessMessage(unsigned int 514, unsigned int 0, long 41877549, long * 0x0012fc34) line 3024 + 24 bytes nsWindow::WindowProc(HWND__ * 0x000c0236, unsigned int 514, unsigned int 0, long 41877549) line 942 + 27 bytes USER32! 77e7124c() URILDR! 027f002d()
Cc'ing myself.
Keywords: dataloss
*** This bug has been marked as a duplicate of 55224 ***
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
verified in 1/12 build.
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: