Closed Bug 438921 Opened 16 years ago Closed 7 years ago

javascript does not run properly on a .xhtml.gz document -

Categories

(Core :: XML, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: dsinghdahiya257, Unassigned)

References

()

Details

(Keywords: regression)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9) Gecko/2008052906 Firefox/3.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9) Gecko/2008052906 Firefox/3.0

works fine on firefox 2, problem may also be linked to using CDATA to comment the js

Reproducible: Always

Steps to Reproduce:
1.open http://www.dubhappy.com/death-note-episode-33-english-dubbed/ on firefox 2.
2.open http://www.dubhappy.com/death-note-episode-33-english-dubbed/ on firefox 3.
3.see the difference.
Actual Results:  
on firefox 2 the js works fine , with the page working properly.
on firefox 3 the page does'nt load right

Expected Results:  
it shood open it exactly like it is on firefox 2

bug found on firefox 3 - release candidate 3
Something in the javascript that I dunno how to fix
Confirmed on Windows XP.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Regression range is http://bonsai.mozilla.org/cvsquery.cgi?module=PhoenixTinderbox&date=explicit&mindate=1208459280&maxdate=1208474879
Caused by Bug 419716 ?
Blocks: 419716
Component: General → XML
Keywords: regression
Product: Firefox → Core
QA Contact: general → xml
Version: unspecified → Trunk
Flags: blocking1.9.0.1?
--> Core::JavaScript Engine
Assignee: nobody → general
Component: XML → JavaScript Engine
Flags: wanted1.9.0.x+
Flags: blocking1.9.0.1?
Flags: blocking1.9.0.1-
QA Contact: xml → general
Not a JS engine issue, regression range and symptoms point at Core : XML.
Assignee: general → nobody
Component: JavaScript Engine → XML
QA Contact: general → xml
Blocks: 439149
Where is the difference between the two links in the "steps to reproduce"?

Anyway, I suppose this is the same problem that I encountered recently. Here a small code snippet showing what is going wrong:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>trigger bug with script tag in xhtml</title>
  </head>
  <body>
    <script type="text/javascript" src="nowhere" />
    <img alt="void" src="alsonowhere" height="100" width="100" />
  </body>
</html>

No image (placeholder) is being displayed.
When viewing the code in the editor, the syntax highlighting is broken.
As it seems, the script tag is being evaluated correctly, but although the tag closing slash is recognized, the img tag is treated as content of the script tag. When replacing the script tag line with

    <script type="text/javascript" src="nowhere"></script>

everything works fine.
I have simmilar problem, that can be reduced to the example snippet presented by Martin Walch above. After re-reading of relevant specs (HTML 4.0, XHTML 1.0) it apears that the minimized script tag is valid XHTML 1.0 (section 4.6) and invalid HTML 4.0 (section 18.2.1) construct. Since DTD above declares XHTML document such behaviour IMHO schould be considered as a bug.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
To be clear, this is invalid because the file was being served with a text/html MIME type, which is only valid for XHTML 1.0 documents if the document complies with XHTML 1.0 Appendix C.  And the document doesn't comply with Appendix C: it's using the no-end-tag closing-slash syntax for a tag that's not an empty tag.

Since it's the MIME type, not the DTD, that determines how things are parsed, this document is parsed with the HTML parser, not the XML one, and the <script> is therefore unclosed and behaves accordingly.
You need to log in before you can comment on or make changes to this bug.