Closed Bug 54283 Opened 24 years ago Closed 24 years ago

Adding javascript to a Composer document

Categories

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

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: bijals, Assigned: akkzilla)

References

Details

(Keywords: dataloss, Whiteboard: [rtm+ NEED INFO][p:1])

Steps:
1) Open a new Composer document
2) Type "Last Updated: "
3) Click the INSERT -> HTML... menu item
4) Type or cut-n-paste the below javascript command
<script>document.write(document.lastModified);</script>
5) Click VIEW -> HTML SOURCE
(notice that you do not see the javascript inside the HTML source of this page
6) Type or cut-n-paste the below javascript command into the HTML SOURCE view
<script>document.write(document.lastModified);</script>
7) Click VIEW -> NORMAL and again VIEW -> HTML SOURCE
(notice that you still do not see the javascript inside the HTML source of this 
page
8) Save page and open again and still not javascript

Actual Results: Javascript does not get included in page

Expected Results: Javascript in page where inserted

Build Date/Platform: 2000092608 using NT
note that if you bring in a file that has javascript and bring it in to
composer, the js renders until you do any edits in the file.

in mail, if the user attaches a file with js in it, it renders fine until the
reply is selected.

in both instances, the js is actually deleted from the file.

This is severe in the respect that numerous web pages use js for a multitude of
reasons, it should not be stripped when reply or select edit the file.
Assignee: beppe → sfraser
Severity: normal → major
Keywords: rtm
Priority: P3 → P2
Whiteboard: [rtm+]
akk knows more about JS in composer, over to her.
Assignee: sfraser → akkana
setting to m19.
Target Milestone: --- → M19
Status: NEW → ASSIGNED
this needs to be corrected for rtm, there is dataloss and the user may not even
know that this has occurred.
Keywords: dataloss
Priority: P2 → P1
Whiteboard: [rtm+] → [rtm+][p:1]
re-add need info
Whiteboard: [rtm+][p:1] → [rtm+ NEED INFO][p:1]
CreateContextualFragment is failing to create a valid fragment when it's passed
JS, but it doesn't return an error code saying so.  Attempting to List() the
returned fragment gives a bunch of asserts:
###!!! ASSERTION: bad content: 'nsnull != mDocument', file nsGenericElement.cpp,
line 2938

Cc'ing vidur and rickg, the original authors of CreateContextualFragment, in
case they have pointers on where to start looking.
The assertions are red herrings: turns out it always does this, even for valid
fragments.

But in the case of JS, the parser is just throwing everything away once it calls
Parse from inside ParseFragment.  I could really use some parser help on this
one.  Rick, Harish?
Fix for this is in bug 50965 ( patch version 1.3 ) - awaiting rtm++ status.
I meant,

Fix for this ( refer akkana's comment 2000-10-02 16:57 ) is in bug 50965 ( patch 
version 1.3 ) - awaiting rtm++ status.
Harish's fix does indeed fix this bug (thanks, Harish!)  It's already awaiting
rtm++ and checkin.  I'll keep this separate and mark a dependency rather than
duping since the symptoms are slightly different.
Depends on: 50965
The depdant bug was fixed; marking this one fixed as well.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
verified in 10/17 build.
Status: RESOLVED → VERIFIED
Sorry for the spam!  But apparently all these closed bugs need to have their
target milestones changed since M19 and M20 are going away.  Since they're
allready closed, I'm choosing M18.
Target Milestone: M19 → M18
You need to log in before you can comment on or make changes to this bug.