Closed Bug 77902 Opened 24 years ago Closed 24 years ago

toggling from Normal to HTML source leave code in Normal window

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.9.6

People

(Reporter: sujay, Assigned: mozeditor)

References

()

Details

(Whiteboard: EDITORBASE; Will verify after 125270 is fixed)

Attachments

(2 files)

using 4/27 build of netscape 1) launch netscape 2) jump to URL above 3) right mouse click and Save As HTML4.html 4) launch composer 5) open HTML4.html 6) toggle from Normal to HTML Source 7) toggle back to Normal see all the HTML code at the bottom. shouldn't be there...should have the tags cause you're back in Normal mode.
There seem to be a couple of problems here. 1. The DTD we use in InsertNodeAtPoint() seems to think that a bunch of tags, for example <blink>, are not allowed as children of <body>. 2. When #1 happens, we end up trying to add the document fragment containing the stuff we are trying to paste, directly to the document! Several times, with the sample doc I might add. ;-) When it does this, we get ASSERTIONS galore. So I just finished attatching a patch that fixes #2. Unfortunately it has the side effect of dropping a bunch of tags when switching back to normal, because the DTD thinks they aren't allowed. Not sure what to do with #1.
Assignee: kin → jfrancis
how about we file a bug for #1 in the meantime?
good catch kin. To fix problem one we need a seperate html insertion path. Something like "LoadHTML", where it's part of the semantics that we will NOT do any validation aboveand beyond what the parser does. This shouldn't be hard - it's surely easier than what we already have. Then coming back from source view should use that path instead of the InsertHTML path.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0
096
Target Milestone: mozilla1.0 → mozilla0.9.6
I can use the stuff i did on the mail reply perf branch for this.
Whiteboard: EDITORBASE; 2 days;
*** Bug 55224 has been marked as a duplicate of this bug. ***
Attached patch editor diffsSplinter Review
above patch fixes problem
Whiteboard: EDITORBASE; 2 days; → EDITORBASE; 2 days; FIXINNHAND; need r=, sr=
note to self: 1) go through txn manager so we can undo 2) dont insert docfrag, insert list of nodes instead
I've fixed the part of this that is under editor's control, but there are still issues. The blink tag still disappears, though it's content gets through fine. The tag disappearsa because the parser drops it. It also drops it, I think, when you view the page in the web browser, but you don't notice it there because if you view source it shows you the original source, not the source you would get if the document were written back out. If we want blink to get through we need to have a way to communicate that to the parser. Something like an optional argument to CreateContextualFragment that instructs it to use a different dtd?
fix checked in on trunk
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Whiteboard: EDITORBASE; 2 days; FIXINNHAND; need r=, sr= → EDITORBASE; Will verify after 125270 is fixed
gratuitous verify : it's been checked in for awhile.
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: