Closed Bug 16706 Opened 25 years ago Closed 25 years ago

[DOGFOOD] [BLOCKER] HTML that is inserted into the editor with InsertAsSource() dissapears after first keystroke

Categories

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

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: rhp, Assigned: akkzilla)

References

Details

(Whiteboard: [PDT+])

Attachments

(1 file)

For mail/news, we use the InsertAsSource() calls to insert the HTML signature
for a new HTML message compose window. After this is done, everything appears
correct, but when you type the first keystroke, the contents that you inserted
vanish.
Status: NEW → ASSIGNED
Depends on: 16708
Target Milestone: M11
Accepting and would like to fix for M11, but right now I can't get signature
insertion to work for me at all due to bug 16708; marking a dependency on that
bug.
No longer depends on: 16708
Summary: HTML that is inserted into the editor with InsertAsSource() dissapears after first keystroke → [BLOCKER] HTML that is inserted into the editor with InsertAsSource() dissapears after first keystroke
Summary: [BLOCKER] HTML that is inserted into the editor with InsertAsSource() dissapears after first keystroke → [DOGFOOD] [BLOCKER] HTML that is inserted into the editor with InsertAsSource() dissapears after first keystroke
Alec helped me get signatures working.  The problem here is that we start with
an empty document containing only the editor bogus node; when the html gets
inserted, it gets inserted *inside* the bogus node, so anything that's typed
subsequently causes it all to disappear.

Cc'ing Joe, with whom I'll probably have to work to figure out how the bogus
node works and how to work around it for InsertHTML.
Blocks: 16907
Blocks: 16906
Whiteboard: [PDT+]
I've attached a patch which solves the problem.  I'm not sure it's the best
permanent solution -- it has InsertHTML calling into the rules code only in the
case where the document is empty, and calling in with kInsertElement even though
it's about to delete something before it does the insert.  But it does cure the
problem and makes both signatures and quoting work correctly with Rich's mail
patches.

It certainly doesn't make things any worse; if someone will review this, I can
go ahead and check it in, and hopefully Joe can advise on whether this is the
right thing to do in the long run.  Oh, ignore the printf in the patch -- I
noticed and removed that right after attaching the patch, and it didn't seem
worth attaching another patch just for that.
For what it's worth, the patch looks fine to me. But I'm not very familiar with
that code.

- rhp
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Checked in the fix as approved by Joe (a slightly different one than the one
attached here).
Status: RESOLVED → VERIFIED
Yes, this is working fine now. Thanks!

- rhp
Blocks: 12658
linking to PDT+ tracking bug 12658
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: