Code

Opened 6 years ago

Closed 5 years ago

Last modified 3 years ago

#9492 closed (fixed)

Invalid XHTML in admin/base.html template

Reported by: dc Owned by: wilson
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:

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)

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

Download all attachments as: .zip

Change History (8)

comment:1 Changed 6 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to wilson
  • 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 6 years ago by remohammadi

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 Changed 6 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 5 years ago by jacob

  • milestone set to 1.1
  • Triage Stage changed from Unreviewed to Accepted

comment:5 Changed 5 years ago by G2P

  • 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 5 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r10598.

comment:7 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.