Foren

Proposal to change the DOCTYPE of Liferay to HTML 5

thumbnail
Julio Camarero, geändert vor 15 Jahren.

Proposal to change the DOCTYPE of Liferay to HTML 5

Liferay Legend Beiträge: 1668 Beitrittsdatum: 15.07.08 Neueste Beiträge
Hi guys,

You probably have read many articles already about HTML 5 and the many benefits that will come with it. It also shows a clear shift of the W3C from trying to go towards a more strict syntax with XHTML to HTML again but defining better how browsers should work in all situations.

Why do we care about this now? For several reasons, first because we'd like to start using the benefits of HTML 5 since several browsers are starting to implement them. Second to solve some problems we currently have with validation of pages created with Liferay (including when they are tested for accessibility). The "real world" has shown that our current DOCTYPE is just too strict for a portal environment where the HTML of a page can come from many unrelated sources.

How hard would it be to switch? We have been researching in the web and we have found that HTML 5 deals perfectly with XML syntax such as <br /> so we wouldn't need to change them. In other words, it seems than using HTML would allow us more flexibility, less work dealing with syntax issues and more time to work in more interesting issues such as usability and 'real' accessibility. In addition, HTML5 seems to be the best option in the future.

There is some technical information about this change here: http://ejohn.org/blog/html5-doctype/

These are some other quotes we have found regarding this:

A number of problems resulting from the use of the text/html MIME type in conjunction with XHTML content are discussed. It is suggested that XHTML delivered as text/html is broken and XHTML delivered as text/xml is risky, so authors intending their work for public consumption should stick to HTML 4.01, and authors who wish to use XHTML should deliver their markup as application/xhtml+xml.

This document is somewhat out of date, and has been somewhat overtaken by events, though the core message (don't send XML as text/html) still holds. My recommendation now would be to just use HTML5; it's simpler to use (e.g. the DOCTYPE is just "<!DOCTYPE HTML>"), it has allows XML-like syntax in the same places that XHTML 1.0 Appendix C did (e.g. you can say <br/> instead of just <br>), and it has well-defined processing rules, unlike earlier versions of HTML and XHTML.

Author: Ian Hickson
Source: http://hixie.ch/advocacy/xhtml




What are the advantages of using XHTML rather than HTML?

If your document is just pure XHTML 1.0 (not including other markup languages) then you will not yet notice much difference. However as more and more XML tools become available, such as XSLT for tranforming documents, you will start noticing the advantages of using XHTML. XForms for instance will allow you to edit XHTML documents (or any other sort of XML document) in simple controllable ways. Semantic Web applications will be able to take advantage of XHTML documents.

Source: http://www.w3.org/MarkUp/2004/xhtml-faq#advantages


Is anybody against this change?
thumbnail
Jorge Ferrer, geändert vor 15 Jahren.

RE: Proposal to change the DOCTYPE of Liferay to HTML 5

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
Very well explained Julio. I fully agree with you. I think we should go ahead and make the change now. The first change is just to change our current DOCTYPE in the bundled themes to:




You gotta love how simple it is emoticon

The nice thing of this is that according to what I've read this already validates and works in all browsers, so I see no reason to not do it now.

What I would not do is of course backport it to 5.2 or 5.1EE just in case we find some drawbacks while working with it.
thumbnail
Nate Cavanaugh, geändert vor 15 Jahren.

RE: Proposal to change the DOCTYPE of Liferay to HTML 5

Junior Member Beiträge: 94 Beitrittsdatum: 27.11.06 Neueste Beiträge
My only concern would be validation and how this affects users that need compliance with existing standards such as Section 508 and WIA.

HTML5 isn't a finalized standard and won't be for quite some time. However, this may have an impact on accessibility concerns and would love to hear from the community if there is any issue with validating against an experimental validation?

Thanks Julio and Jorge!
thumbnail
Jorge Ferrer, geändert vor 15 Jahren.

RE: Proposal to change the DOCTYPE of Liferay to HTML 5

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
Hi Nate,

That's a very valid concern. I also was worried about this until I read that the people of the HTML 5 committee themselves are recommending people to start using the new DOCTYPE. Also accessibility and similar standards usually just specify that the page has to validate but AFAIK they don't specify specific versions of the standard.

In any case, I'd like to know if anyone reading this knows more about this.
thumbnail
Boubker TAGNAOUTI, geändert vor 14 Jahren.

RE: Proposal to change the DOCTYPE of Liferay to HTML 5

Regular Member Beiträge: 140 Beitrittsdatum: 29.09.08 Neueste Beiträge
Hi guys,

Sorry for the delay but i wanted to take time to measure the impact of the switch to html5 DOCTYPE for accessibiliy concerns.

As Nate says
HTML5 isn't a finalized standard and won't be for quite some time.


The spec will evolve in particular for accessibility issues:
Some attributes from HTML 4 are no longer allowed in HTML 5 like:
accesskey attribute on a, area, button, input, label, legend and textarea.
longdesc attribute on img and iframe.
summary attribute on table.

The proposal of this change being to make in conformity the portal to the requirements of accessibility according to the various recommendations (WCAG, Section 508, Accessiweb, and others). The choice of HTML5 becomes not easily defensible.

For more informations:
http://dev.w3.org/html5/html4-differences/Overview.html
http://lists.w3.org/Archives/Public/public-html/2007Jun/1068.html
thumbnail
Boubker TAGNAOUTI, geändert vor 14 Jahren.

RE: Proposal to change the DOCTYPE of Liferay to HTML 5

Regular Member Beiträge: 140 Beitrittsdatum: 29.09.08 Neueste Beiträge
Hi guys,

Because the project on which I work require a short-term delivery I will continue my work in setting on conformity of the xhtml code according to the recommendations of Nate: fixing the errors in the level of the view (jsp).

What is your decision about the proposal to change the DOCTYPE?
thumbnail
Julio Camarero, geändert vor 14 Jahren.

RE: Proposal to change the DOCTYPE of Liferay to HTML 5

Liferay Legend Beiträge: 1668 Beitrittsdatum: 15.07.08 Neueste Beiträge
Hi Boubker,

we have been reading a lot lately about this and people from W3C are recommending changing to this new Doctype, as it only says you are using html. Actually, there are several validators out there and they work reasonably well. We also like a lot several ideas of HTML 5, so I guess it is a matter of time that we (and probably most of the websites) change to the new doctype, so, one of my thoughts is that the sooner me make this change, the better prepared we will be for it.

Would you find any problem in your project if we change the doctype to HTML 5? Real projects like yours can help us a lot to make a better decission.

Thanks a lot,
thumbnail
Boubker TAGNAOUTI, geändert vor 14 Jahren.

RE: Proposal to change the DOCTYPE of Liferay to HTML 5

Regular Member Beiträge: 140 Beitrittsdatum: 29.09.08 Neueste Beiträge
Hi Julio,

We had a conversation on this subject with members of my team and the conclusion is that there is no problem with changing the doctype to html5 in regards to accessibility concerns.

In the last HTML 5 Draft Recommendation (14 May 2009 ) they fixes a lots of accessibility issues (longdesc, summary, accesskey and more).

This modification will allow us to gain much time to validate real accessibility problems.

Thanks a lot for the suggestion.