Closed Bug 18324 Opened 25 years ago Closed 25 years ago

[4.xP] </SCRIPT> in a document.write ending SCRIPT element

Categories

(Core :: DOM: HTML Parser, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED WONTFIX

People

(Reporter: dbaron, Assigned: harishd)

References

()

Details

Attachments

(2 files)

DESCRIPTION:  I don't see any nice way around this bug, but it is a 4.xP issue.
The following used to work:

<SCRIPT>
...
document.write("</SCRIPT>");
...
</SCRIPT>

According to the specs, of course, the first occurrence of "</" should end a
SCRIPT element (CDATA content model).  I believe that you do that in standard
mode (do you?), and in compatibility mode you wait for "</SCRIPT>".  However,
that's clearly not what NN 4.x did, since the above code worked.

I don't know whether you want to try and figure out how to fix this or whether
you want to just not bother.  (I, of course, don't mind the latter.  The code is
horribly broken.)

STEPS TO REPRODUCE:
 * load http://timb.simplenet.com/dom/

ACTUAL RESULTS:
 * the lower frame starts off with a bit of script (all strung together without
proper line breaks, of course).

EXPECTED RESULTS:
 * the script shouldn't be seen, it should be executed

DOES NOT WORK CORRECTLY ON:
 * Linux, apprunner, 1999-11-08-08-M11

WORKS CORRECTLY ON:
 * NN 4.61 Linux

ADDITIONAL INFORMATION:
This bug spun off of the incorrect reopening of bug 11141.
Assignee: rickg → harishd
One for you.
Attached file SCRIPT content not within a comment (deleted) —
Looks like in Nav.4x contents, within script, wrapped inside a "comment" is
actually thought of as a comment, and hence never get to see the mis-used
</SCRIPT>.  However, if the contents are no wrapped inside the comment then
Gecko and Nav.4.x behave exactly the same.

Fixing this would force me to treat script content as NON CDATA, which I'm not
willing to do.  The work around, for this problem, would be to split the
</SCRIPT>, within document.write, into two pieces. That is, something like

document.write("</+SCRIPT>");

I understand that this work around is not completely per spec. but this is the
maximum that I could do!!! :)
The correct way to do this is of course:

document.write("<\/SCRIPT>");

... and this applies to *any* end-tag.

I filed this bug so you could decide whether you wanted to support this
behavior...
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → WONTFIX
Marking the bug WONTFIX.
Status: RESOLVED → VERIFIED
verified
this is an exact duplicate of 7590
(OCD-style cross referencing) "fixed" for quirks mode in bug 26857
*** Bug 311128 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: