Closed Bug 154355 Opened 23 years ago Closed 23 years ago

the style element doesn't load stylesheets with an @import rule using " instead of " in XHTML 1.0 documents

Categories

(Core :: DOM: HTML Parser, defect)

defect
Not set
normal

Tracking

()

VERIFIED INVALID

People

(Reporter: dominique.hazael-massieux, Assigned: harishd)

References

()

Details

The XHTML 1.0 specification says: "In XHTML, the script and style elements are declared as having #PCDATA content. As a result, < and & will be treated as the start of markup, and entities such as &lt; and &amp; will be recognized as entity references by the XML processor to < and & respectively." Hence, &quot; in a style element should be treated as ". But when using the @import rule with the URI of the stylesheet between two &quot; (like in this page), Gecko doesn't load it correctly: @import &quot;/scripts/style-header.css&quot; ; @import &quot;/scripts/style.css&quot; ; Note that the W3C CSS Validator detects and loads correctly the stylesheets.
Seems to WFM, Moz 1.0/Win2k.
If you serve the page as text/xml or application/xhtml+xml it will be parsed by the XML parser and the behavior will be exactly as the XHTML spec mandates. As it is, it is parsed by the HTML parser instead. Not sure how that language applies to non-XML parsers given XHTML data, if at all.
Assignee: dbaron → harishd
Component: Style System → Parser
OS: Linux → All
QA Contact: ian → moied
Hardware: PC → All
Status: UNCONFIRMED → NEW
Ever confirmed: true
Ha, this is a tricky one. In HTML 4.01, the content model of <style> is CDATA, so entities aren't replaced. Our behavior is correct. INVALID.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
Not true, this is an XHTML 1.0 document, not an HTML 4.01. Be it served as text/html or text/xml doesn't change the fact it's an XHTML document (note that style being a PCDATA section is shown as being an incompatibility between the 2 versions in XHTML 1.0 spec).
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Sorry, our html parser is not designed for xhtml documents. So, if you want the correct behavior then please serve your document with the appropriate mime type. INVALID
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → INVALID
In particular, the XHTML spec says: However, XHTML Documents which follow the guidelines set forth in Appendix C, "HTML Compatibility Guidelines" may be labeled with the Internet Media Type "text/html", as they are compatible with most HTML browsers. [1] Appendix C, section 4 says: Use external style sheets if your style sheet uses < or & or ]]> or --. [2] [1] http://www.w3.org/TR/xhtml1/#media [2] http://www.w3.org/TR/xhtml1/#guidelines So your document in fact does not follow the "compatibility with HTML" guidelines and should not be sent as text/html
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.