Edgewall Software
Modify

Opened 20 years ago

Closed 20 years ago

#1010 closed defect (fixed)

XHTML validation errors in ticket view

Reported by: anonymous Owned by: Jonas Borgström
Priority: low Milestone: 0.9
Component: ticket system Version: 0.8
Severity: minor Keywords: xhtml, html, content, type, invalid
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I have run a few Trac pages through the W3C's validator and although all of Trac's documents assert that they are XHTML 1.0 Strict, they are not.

See http://validator.w3.org/check?uri=http://projects.edgewall.com/trac for an example.

Perhaps a solutions to this would be to use XHTML 1.0 Transitional and improve some of the dynamic markup a little.

An example is as follows:

<ul class="changes"></ul>

(as apears on Line 210, column 27, http://projects.edgewall.com/trac/ticket/323)

This is NOT valid XHTML as the UL element need child LI elements to be complete.

Would it be hard to rectify this situation, or would it help you used a more forgiving DOCTYPE.

Related to this issue is the fact that you are serving (on your site at least) your XHTML with the following header:

Content-Type: text/html;charset=utf-8

This is what *most* other people's servers will be doing as well, and it can be near on impossible for some people to change.

XHTML should be served as Content-Type application/xhtml+xml

You can read more about this at http://www.hixie.ch/advocacy/xhtml

Here is an excerpt:

"If you use XHTML, you should deliver it with the application/xhtml+xml MIME type. If you do not do so, you should use HTML4 instead of XHTML. The alternative, using XHTML but delivering it as text/html, causes numerous problems that are outlined below.

Unfortunately, IE6 does not support application/xhtml+xml (in fact, it does not support XHTML at all)."

Perhaps it would be better to write the pages in HTML 4.01 untill XHTML is better supported by user-agents.

Attachments (0)

Change History (4)

comment:1 by Christopher Lenz, 20 years ago

Component: mod_python frontendgeneral
Owner: changed from Christopher Lenz to Jonas Borgström
Priority: normallowest
Severity: normaltrivial
Summary: Trac does not validate as HTML and content-type problemsTrac XHTML validation errors

We try to keep the pages valid, but naturally it is easy to miss some cases. I don't see how switching to XHTML 1.0 Transitional would help. Your example:

<ul class="changes"></ul>

is as invalid in transitional as in strict (X)HTML as far as I know. It's just a bug in the template that needs to be fixed (somewhat tricky in this case).

As for the whole XHTML mime-type issue, my opinion is that XHTML is a political rather than technical choice. I.e. XHTML as a marketing buzzword.

Anyway, this ticket cannot be acted upon as is. If there are validation errors, they should be logged individually, or in such a way that every validation error is listed and described. Preferrably, the validator should be run over a vanilla Trac install and not over http://projects.edgewall.com/trac/, which adds stuff not in the default templates.

Let's keep this ticket open though (minus the mime-type issue, feel free to log that as separate ticket). Please add other validation errors you found as comments.

comment:2 by anonymous, 20 years ago

Priority: lowestlow
Severity: trivialminor

We try to keep the pages valid, but naturally it is easy to miss some cases. I don't see how switching to XHTML 1.0 Transitional would help.

Point taken, but switching to HTML 4.01 surely would.

I understand your points about XHTML but I do not agree that it is purely political. The article I referenced points out some very valid reasons why serving XHTML up as text/html is a Bad Thing.

In any case, if you are of the opinion that The choice to use XHTML is political and not technical do you see anything wrong with using HTML 4.01 as an alternative.

This would definitely help ease any buggy template engine output.

I am unwilling to submit any further comments RE specific errors in your documents. This would be a mammoth process and one which I would feel to be a futile effort on my part.

Perhaps someone on the dev team who has an understanding of the template engine should experiment with validating pages to see if she/he can identify any common errors.

comment:3 by Christopher Lenz, 20 years ago

No, switching to HTML 4.0.1 Strict or even Transitional does not make a page with an empty unordered list validate. So I really don't see how it "would definitely help ease any buggy template engine output". How?

I have run the Trac templates through the validator from time to time, and tried to fix all problems I could find.

comment:4 by Christopher Lenz, 20 years ago

Component: generalticket system
Milestone: 0.9
Resolution: fixed
Status: newclosed
Summary: Trac XHTML validation errorsXHTML validation errors in ticket view

As this ticket can only be closed if the scope is somewhat narrowed down, I'm going to interpret it as limited to the validation error about the empty unordered list in ticket changelogs. This has been fixed in [1255], together with some other validation problems in the ticket view.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.