]> Addendum to WebSG HTML5 presentation « log archives « projekt draco

draco.sg

... is where Sunny Wong writes about nothing in particular and everything in general.


Addendum to WebSG HTML5 presentation

In my presentation, for the sake of most non-developers present, I deliberately left out some information about HTML5 that I felt was irrelevant or will be confusing. If you are interested to know more, please read on.

Error handling

One of the main objectives of HTML5 that is missing from previous revisions of HTML is that not only does it define how browser vendors should go about rendering correct codes, it also defines precisely how they should handle erroneous codes. The current lack of such specification resulted in unpredictable error handling/parsing in different browsers today.

This single difference in having a precise error handling ensures that your document marked up in HTML5 will remain interoperable between devices in the future, whether your HTML code conforms to the spec, or not. And this matters because a large percentage of today’s websites do not conform, and may display differently in different browsers.

HTML5 vs XHTML5

Another thing that I wanted to go into was the serializations of HTML5. Today, people are used to calling any document attached with XHTML 1.0 doctype served with the MIME type text/html as XHTML document, and think that XHTML 1.0 Strict is actually more semantic than HTML 4.01 Strict. It is a little confusing, but they are wrong on both counts.

In HTML5, this confusion is resolved by having the only difference between both XHTML and HTML in the serialization. A document marked up in conforming XML syntax is a XHTML5 document if it is served with the media type application/xhtml+xml, and HTML5 document with text/html.

Put it simply, one specification, two serializations. No more specs that define transitional, frameset, nor strict rules. Just one HTML5 spec to rule them all. This single spec will define what is presentation that should be left out, and what is structural that should be included. (Though it does not always make the right choice, especially with font tag.)

New elements, and DOM

It was not immediately obvious why the new elements matter. If you are a purist, you would be aware of their added semantic values to a document marked up in HTML5. Some of them, such as video matter because they have a fallback content and does not require 3rd-party plugins (Flash) to operate, which means users with old browsers will not be greeted with empty space. And if the end-user does not have the codec, further fallback videos could be defined with several sources.

<video>
 <source src=things.ogv type=video/ogg>
 <source src=things.mp4 type=video/mp4>
</video>

If video/ogg is not found, use video/mp4. The ability to do this natively triumphs over the need to use external plugins or JavaScript.

The others, such svg (which I omitted) are important because they are injected right into the DOM. This means that they can be manipulated with JavaScript (attaching event listeners) and CSS(positioning) like any other element such as div. Some of the HTML5 API also make use of this fact to further allow you to manipulate the elements.

Oh, and HTML5 allows svg to be used in HTML serialization!

Conclusion

This is not an exhaustive lists of benefits of HTML5, just something that I personally feel is important and thought people might want to know. Oh if you are still not excited by HTML5, it is fine. Because no matter what, you will eventually have to move on to HTML5 because it is the only successor to HTML and XHTML (for now).

Thanks for listening/reading.

1 comment Post your own »

vinay

Nice Presentation at websg..Hella funny and informative :D

Add a new comment
Your e-mail will be kept confidential.