Author Topic: invalid (X)HTML webpage code  (Read 2298 times)

0 Members and 1 Guest are viewing this topic.

sqvaard

  • Guest
invalid (X)HTML webpage code
« on: January 17, 2015, 02:09:22 PM »
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.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4870
  • Total likes: 202
  • Helpful: 108
  • Languages: EN, NO
Re: invalid (X)HTML webpage code
« Reply #1 on: January 17, 2015, 02:19:58 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.

Offline Isaac.Eiland-Hall

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3429
  • Total likes: 321
  • Helpful: 91
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: invalid (X)HTML webpage code
« Reply #2 on: January 17, 2015, 05:27:20 PM »
Sooo, I removed the post you made as a guest since you created an account to make this post.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2594
  • Total likes: 290
  • Helpful: 89
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: invalid (X)HTML webpage code
« Reply #3 on: January 27, 2015, 02:03:33 AM »
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.