Closed Bug 9366 Opened 26 years ago Closed 26 years ago

Inserting text after inserting an object in empty page is before instead of after

Categories

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

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: sujay, Assigned: mozeditor)

References

Details

using 7/7 build of apprunner on all platforms: 1) launch apprunner 2) launch editor 3) insert H.Line 4) immediately start typing text. H Line disppears and text gets rendered right over it The way it works in 4.x is that the text gets rendered after the H. Line. all platforms.
Status: NEW → ASSIGNED
Summary: inserting text after H.Line cause HRule to disappear → inserting text after any inserted object cause object to disappear
Target Milestone: M9
This happens when I insert a table as well. I can't test other objects because dialogs don't work now, but it's probably true for all non-text objects The test case won't work. You must: 1. launch editor 2. use edit menu: select all 3. press delete to delete all content 4. insert hline 5. type
Depends on: 9430
I bet this is closely related to 9430, so adding that dependency
Summary: inserting text after any inserted object cause object to disappear → inserting text after any inserting object in empty page is before instead of after
I checked in changes that affected this, but it is not completely fixed. Now, instead of deleting the object, the text typed (after inserting the object) appears before the object rather than after it. I changed the summary to reflect that.
Assignee: cmanske → jfrancis
Status: ASSIGNED → NEW
Summary: inserting text after any inserting object in empty page is before instead of after → Inserting text after inserting an object in empty page is before instead of after
Use Edit | Select All, then press delete key. Click on the H.Line button to insert an <HR>. Here is what the HTML looks like: <body> <p moz_editor_bogus_node="TRUE"></p><hr align="left" height="2" width="100%"> <p moz_editor_bogus_node="TRUE">&nbsp;</p></body> </html> After inserting the HR, the selection is set to just after the HR (body parent, offset = 2). When you type a character, it appears before the line because of a failure with the enumerator code in nsEditor::CreateTxnForInsertText It fails at result = enumerator->CurrentItem(&currentItem); and thus returns NS_ERROR_EDITOR_NO_SELECTION Here's the stack at the offending line: nsEditor::CreateTxnForInsertText(nsEditor * const 0x0231bef0, const nsString & {"a"}, nsIDOMCharacterData * 0x00000000, InsertTextTxn * * 0x0012f670) line 1898 nsEditor::InsertText(nsEditor * const 0x0231bef0, const nsString & {"a"}) line 1806 + 25 bytes nsTextEditor::InsertText(nsTextEditor * const 0x0231bef0, const nsString & {"a"}) line 1023 + 16 bytes nsHTMLEditor::InsertText(nsHTMLEditor * const 0x0231bef0, const nsString & {"a"}) line 188 I think this is one of those cases we discussed where the selection is not in a text node and this confuses the insert text code.
Status: NEW → ASSIGNED
we don't do the right thing with the bogus node when inserting new html elemnts (other than text). don't know if fixing that will fix this, we'll see. accepting bug.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
fixed
Status: RESOLVED → VERIFIED
seems to be working now....verified in 8/12 build.
You need to log in before you can comment on or make changes to this bug.