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

VERIFIED WONTFIX

Status

()

Core
HTML: Parser
P3
normal
VERIFIED WONTFIX
19 years ago
13 years ago

People

(Reporter: dbaron, Assigned: harishd)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments)

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.

Updated

19 years ago
Assignee: rickg → harishd

Comment 1

19 years ago
One for you.
(Assignee)

Comment 2

19 years ago
Created attachment 2769 [details]
SCRIPT content enclosed inside a comment
(Assignee)

Comment 3

19 years ago
Created attachment 2770 [details]
SCRIPT content not within a comment
(Assignee)

Comment 4

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

Updated

19 years ago
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → WONTFIX
(Assignee)

Comment 6

19 years ago
Marking the bug WONTFIX.

Updated

19 years ago
Status: RESOLVED → VERIFIED

Comment 7

19 years ago
verified

Comment 8

19 years ago
this is an exact duplicate of 7590

Comment 9

18 years ago
(OCD-style cross referencing) "fixed" for quirks mode in bug 26857

Comment 10

13 years ago
*** 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.