#9492 closed (fixed)
Invalid XHTML in admin/base.html template
Reported by: | dc | Owned by: | Wilson Miner |
---|---|---|---|
Component: | contrib.admin | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Changeset [9300] have made [source:django/trunk/django/contrib/admin/templates/admin/base.html admin/base.html] template invalid XHTML. Problem is in conditional tags:
<![if gte IE 6]><link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/base.css{% endblock %}" /><![endif]>
Attachments (1)
Change History (8)
comment:1 by , 16 years ago
Owner: | changed from | to
---|
comment:2 by , 16 years ago
According to http://msdn.microsoft.com/en-us/library/ms537512.aspx#dlrevealed <![if gte IE 6]> is a downlevel-revealed conditional comment, but I'm not sure why that's used here. I guess it was supposed to be <!--[if gte IE 6]>. The content inside of the downlevel-revealed conditional comment block should be parsed/rendered on IEs before 5, and non-IE browsers which will face some unrecognized/non-standard tags. (from the msdn page: "the comment delimiters are treated as unrecognized HTML" (in cold blood, they even didn't dis-recommend this method :D)).
The only browser which will ignore the block would be the IE 5.* which understands <!--[if gte IE 6]> too.
In 9463#file4 there are some changes on the header of base.html. The downlevel-revealed conditional comment is including a comment, a downlevel-hidden conditional comment and the "{% block extrastyle %}{% endblock %}" too. If you are going to change the downlevel-revealed to downlevel-hidden conditional comment, consider that. I think nested html comment is not allowed.
comment:3 by , 16 years ago
$0.02: Maybe we should assume that sane users are running IE 8 which requires less in the way of special case care-and-feeding. Antique versions of IE should be forgotten as quickly as possible, rather than supported by conditional trickery.... Let the nightmare end for web developers everywhere!
comment:4 by , 16 years ago
milestone: | → 1.1 |
---|---|
Triage Stage: | Unreviewed → Accepted |
by , 16 years ago
Attachment: | 0001-Remove-non-XML-conditional-comment-that-broke-XHTML.patch added |
---|
patch
comment:5 by , 16 years ago
Has patch: | set |
---|
Here is a trivial patch. Firefox won't render the admin otherwise if serving as application/xhtml+xml ; I don't think IE5- support is worth it.
Wilson: did you just make a typo and leave off the "--" parts, or is this yet more MS funkiness and the conditional style syntax changed? In any case, it's your baby.