toggling from Normal to HTML source leave code in Normal window

VERIFIED FIXED in mozilla0.9.6

Status

()

Core
Editor
VERIFIED FIXED
17 years ago
15 years ago

People

(Reporter: sujay, Assigned: Joe Francis)

Tracking

Trunk
mozilla0.9.6
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

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

Attachments

(2 attachments)

(Reporter)

Description

17 years ago
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.

Comment 1

17 years ago
Created attachment 32450 [details] [diff] [review]
Patch that avoids assertions.

Comment 2

17 years ago
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
(Reporter)

Comment 3

17 years ago
 how about we file a bug for #1 in the meantime?
(Assignee)

Comment 4

17 years ago
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
(Assignee)

Comment 5

17 years ago
096
Target Milestone: mozilla1.0 → mozilla0.9.6
(Assignee)

Comment 6

16 years ago
I can use the stuff i did on the mail reply perf branch for this.
Whiteboard: EDITORBASE; 2 days;
(Assignee)

Comment 7

16 years ago
*** Bug 55224 has been marked as a duplicate of this bug. ***
(Assignee)

Comment 8

16 years ago
Created attachment 53181 [details] [diff] [review]
editor diffs
(Assignee)

Comment 9

16 years ago
above patch fixes problem
Whiteboard: EDITORBASE; 2 days; → EDITORBASE; 2 days; FIXINNHAND; need r=, sr=
(Assignee)

Comment 10

16 years ago
note to self: 
1) go through txn manager so we can undo
2) dont insert docfrag, insert list of nodes instead
(Assignee)

Comment 11

16 years ago
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?
(Assignee)

Comment 12

16 years ago
fix checked in on trunk
Status: ASSIGNED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED
(Reporter)

Updated

16 years ago
Whiteboard: EDITORBASE; 2 days; FIXINNHAND; need r=, sr= → EDITORBASE; Will verify after 125270 is fixed

Comment 13

15 years ago
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.