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




10 years ago
7 months ago


(Reporter: Dhruv dahiya, Unassigned)



Windows XP
Dependency tree / graph
Bug Flags:
blocking1.9.0.1 -
wanted1.9.0.x +

Firefox Tracking Flags

(Not tracked)





10 years ago
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: on firefox 2. 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

Comment 1

10 years ago
Something in the javascript that I dunno how to fix


10 years ago
Duplicate of this bug: 438920
Confirmed on Windows XP.
Ever confirmed: true
Regression range is
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


10 years ago
Blocks: 439149

Comment 7

10 years ago
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" "">
<html xmlns="">
    <title>trigger bug with script tag in xhtml</title>
    <script type="text/javascript" src="nowhere" />
    <img alt="void" src="alsonowhere" height="100" width="100" />

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.

Comment 8

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


7 months ago
Last Resolved: 7 months 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.