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)
Core
DOM: Editor
Tracking
()
VERIFIED
FIXED
M9
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.
Updated•26 years ago
|
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
Comment 1•26 years ago
|
||
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
Comment 2•26 years ago
|
||
I bet this is closely related to 9430, so adding that dependency
Updated•26 years ago
|
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
Comment 3•26 years ago
|
||
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.
Updated•26 years ago
|
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
Comment 4•26 years ago
|
||
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"> </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(¤tItem);
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.
| Assignee | ||
Updated•26 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 5•26 years ago
|
||
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.
| Assignee | ||
Updated•26 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 6•26 years ago
|
||
fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•