News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

invalid (X)HTML webpage code

Started by sqvaard, January 17, 2015, 02:09:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sqvaard

The "about" page claims, quote, ""Pages and CSS in these site were validated through W3C validator. This ensures the compatibility of the website among browsers."

As you can easily check by yourself, despite that claim, you're missing the obvious failure to deliver the pages with proper MIME type (also called "Content-Type").

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.simutrans.com%2Fen%2Fabout&charset=%28detect+automatically%29&doctype=Inline&group=0&verbose=1

"Content-Type:   text/html"

You can easily check the error exists by using any other reasonable validator, e.g. validator.nu (which is, FIY, *the* validator, created by Mozilla Foundation and later used in W3C validator for HTML5 validation; if you'd use W3C to validate HTML5, it would say that the checker is based on validator.nu)

https://validator.nu/?doc=http%3A%2F%2Fwww.simutrans.com%2Fen%2Fabout

"Info: The Content-Type was text/html. Using the HTML parser."

No known browser will parse "XHTML" served as text/html as XHTML (i.e. with XML parser) indeed - it will usually just trigger quirks mode and make the page render as HTML 4.01 (or HTML5 in newer browsers), breaking all that's unsupported by it and rendering it as tag soup. OTOH, if your XHTML is already/will be a HTML polyglot (which isn't the on Your pages AFAIK, because of trivial errors in code making it conformant neither to HTML 4.01 nor HTML5), just change the DOCTYPE to respective HTML type and don't bother with serving XHTML at all.

The simplest solution is to just use valid HTML5 code & HTML5 doctype. Alternatively, you can serve your pages with proper MIME types (application/xhtml+xml). Otherwise the "green" validation only signifies the page is *broken*, not working properly.

Further reading:
http://www.w3.org/International/articles/serving-xhtml/
http://www.webstandards.org/learn/articles/askw3c/sep2003/
http://hixie.ch/advocacy/xhtml

Also, the forum pages have XHTML validation link; not only are they served with incorrent MIME type, but they also don't validate at all; if they were served with proper MIME type, all you'd get would be only the infamous Yellow Screen Of Death due to broken parse tree.

Ters

Quote from: sqvaard on January 17, 2015, 02:09:22 PM
Also, the forum pages have XHTML validation link; not only are they served with incorrent MIME type, but they also don't validate at all; if they were served with proper MIME type, all you'd get would be only the infamous Yellow Screen Of Death due to broken parse tree.

That's something you have to report to Simple Machines. It's their software. We just use it, and it appears to work.

Isaac Eiland-Hall

Sooo, I removed the post you made as a guest since you created an account to make this post.

An_dz

The error you pointed has been fixed some time ago. But I found other errors and those are fixed too, all pages now validate as HTML5, compatibility with browsers is the same.