Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#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: UI/UX:


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)

0001-Remove-non-XML-conditional-comment-that-broke-XHTML.patch (1.6 KB) - added by Gabriel 8 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 8 years ago by Malcolm Tredinnick

Needs documentation: unset
Needs tests: unset
Owner: changed from nobody to Wilson Miner
Patch needs improvement: unset

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.

comment:2 Changed 8 years ago by Reza Mohammadi

According to <![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 Changed 8 years ago by anonymous

$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 Changed 8 years ago by Jacob

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:5 Changed 8 years ago by Gabriel

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.

comment:6 Changed 8 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

Fixed in r10598.

comment:7 Changed 5 years ago by Jacob

milestone: 1.1

Milestone 1.1 deleted

Note: See TracTickets for help on using tickets.
Back to Top