Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
markup
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Dec 2010 at 17:52 UTC
Updated:
16 Dec 2010 at 23:12 UTC
Jump to comment: Most recent
Comments
Comment #1
damien tournoud commentedDrupal 7 uses XHTML+RDFa 1.0. This looks perfectly correct.
For discussions about HTML5 (and more precisely XHTML5), see #963832: Decide how to use HTML5 in Drupal 8.
Comment #2
Bence commentedYes, the syntax is perfectly correct, but the MIME type is wrong!
The MIME type is the boss: user agents don't care if you have the perfect XHTML doctype and syntax, if you send them in text/html, then your code IS HTML, and NOT XHTML.
The internet media type of XHTML+RDFa is application/xhtml+xml. But Bartik uses the text/html, this is simply wrong.
Similarly, you don't send your JPG images in image/png, or your webM videos in video/mp4, or your plain text files in text/xml.
But I know that IE 7-8 doesn't support application/xhtml+xml, so XHTML is not an option, only HTML5.
What's the problem with this code? Isn't RDFa 1.1 backwards compatible with RDF 1.0?
Comment #3
robloachThis is hard coded into html.tpl.php.... Subscribe.
Comment #4
scor commentedI remember looking at the MIME issue many months ago while working on RDFa in Drupal 7. Switching from text/html to application/xhtml+xml was (and still is) a no go since it would blow up in old browsers as you know it. RDFa 1.0 is still the only official RDFa spec today and it requires the doctype XHTML+RDFa 1.0, but to ensure compatility with older browser it is served as text/html. This does not prevent agents to parse your page as XHTML if they like. Serving XHTML document as text/html is still what you will encounter a lot today on the Web (look at http://en.wikipedia.org/wiki/Drupal for example). RDFa 1.1 will allow to serve RDFa with a non-XHTML doctype this but it's still a draft. Given that Drupal 7 is in RC2, I'm closing this issue in favor of the ongoing discussion for Drupal 8 at #963832: Decide how to use HTML5 in Drupal 8.
RDFa in XHTML: Syntax and Processing (RDFa 1.0) says
SHOULD is not a strict requirement, if you have good reasons not follow this, it does not make your document invalid in any way.
Comment #5
Jeff Burnz commentedtext/html utilizes XHTML's backward compatibility mode.
I'm not sure I see the value in changing this for D7, I think we need some really clear guidelines on RDFa before doing so. Certainly for D8 the current motivation is to switch to HTML5 but I am not seeing any reason (so far, please chime in) to hurry that along.
This debate is bigger than Bartik.
Comment #6
Jeff Burnz commentedCross post.
Comment #7
Bence commentedOk, I agree on closing this. HTML5 features (like audio and video tag) work anyway, regardless of the doctype.
Comment #8
jensimmons commentedI wanted to make Bartiks' doctype HTML5. It was for a while (long before anyone but me saw the code). I knew, however, that if Bartik had any chance of being accepted as a core theme, I had to use whatever doctype Drupal core was using. So I copied the doctype from html.tpl.php in core.
In fact, these days Bartik doesn't even have a doctype!! Look at the theme code. There's no doctype anywhere to be found. The html.tpl.php file was removed — so now Bartik pulls the doctype from the htmltpl.php file in the system module.
Also, it's awfully late for this. Drupal 7 is almost done.
AND well, you are just wrong. XHTML 1.0 served as text is a well-known, professional way to do things. There is no way we want to serve Drupal html as xml. Absolutely not. No. No.
If we do that, and someone builds a Drupal site for a client, and that client writes their own HTML but doesn't write it perfectly... then the website will fail. Who wants that? Google this debate and read. All the top HTML/CSS/doctype experts agree. And everyone uses XHTML 1.0 instead of XHTML 1.1 for this reason. Look, from http://happycog.com (The Webstandard's expert's company)
XHTML 1.0 served as text/html.
The same will be true for Drupal 8 HTML5. NOT served as xml.