HTML5 is the most recent hypertext markup language standard standardized by the World Wide Web Consortium. It is used by web programmers and designers — typically in conjunction with JavaScript and CSS — to lay out web pages, which people can then view in web browsers. As of July 2010, HTML5 is still not widely supported nor standardized, though browsers such as Google Chrome [1], Apple Safari [2], and Mozilla Firefox[3] have implemented various parts of the language.[1] This unofficial status will likely persist for some years still, with the W3C currently expecting HTML5 to become a recommended technology in 2012 and a full standard not before 2022.[2]
HTML5 represents an important step forward technologically, as it gives web developers greater capabilities and more flexibility in interacting with the underlying operating system. One important new capability is offline storage, which allows sites to better handle persistent sessions for their users. For example, if a user is editing a document in an online web editor, HTML5 allows some portion of the state associated with the document to be saved onto the user's computer -- rather than saving all of it to the server, as is currently done. This reduces the server load, and also provides a faster, more responsive experience for the user, as less data needs to be transferred over the network. Other new capabilities include a multipurpose graphical element called canvas
, as well as native embedding of video and audio.
HTML5 also is a milestone politically and socially in the web world. As the web has evolved, many vendors have created proprietary technologies to enable greater functionality for their applications. Some of the most important include Adobe's Flash plugin, as well Microsoft's Silverlight and their browser Internet Explorer. Internet Explorer has a notable reputation for employing non-standard extensions to web technologies.[3] While such innovations enable a richer user experience, they also fragment development, and make cross-browser compliance challenging for developers. HTML5 offers the opportunity to continue to support advanced interface demands, but to do so in an open, community-approved way. Indeed, in the words of Ian Hickson, one of the designers of the language, "One of our goals [for HTML5] is to move the Web away from proprietary technologies."[2] Such a step would lay the groundwork for the web's increasing dominance over the next decade.
HTML5 is largely a creation of the WHATWG, which is an acronym for the longer and less common name Web Hypertext Application Technology Working Group. The WHATWG developed organically in 2004 as an alliance of people interested in rapidly advancing the state of web technology. It can be joined by anyone, though its principal support comes from Apple, Mozilla, and Opera, maker of the alternative browser of the same name. The WHATWG developed in counterpoint to the W3C, as many of the members of the WHATWG felt that the W3C was not doing enough to rapidly introduce new web technologies. Additionally, they were displeased that the W3C had decided to stop developing HTML in favor an XML-compliant alternative known as XHTML, since, though this approach had some academic allure, it ignored the realities of how people actually used the web.[4] Today, the HTML5 specification editor is Ian Hickson, who is also one of the original and most active members of WHATWG. Interestingly, Hickson now works at Google, which has been noted by many as an important signal of Google's commitment to HTML5.[5]
HTML5 is an important extension to the current web development toolkit, both from a technical perspective and from a social and political standpoint.
HTML5 allows webpages to have much greater control over the user's browsing experience, thereby enabling better and more sophisticated web applications. Additionally, in conjunction with superior JavaScript interpreters, it provides more efficient implementations of user interface technologies, thereby providing a smoother, less resource-intensive experience. These innovations build toward the concept of thin-client computing, in which the user accesses the network via a relatively simple client, and where the more intensive computing is performed by servers. This was the original vision of Marc Andreessen, the co-founder of the early web browser company Netscape, though it has not yet been realized.[6]
However, more powerful technical abilities also means that HTML5 presents a potentially greater security threat. A malicious website could use the more sophisticated technologies, such as storing data on the user's client, in order to take over or infect the machine. HTML5 has been developed with an awareness of such issues, though, and has introduced several new security measures to address such concerns. Many of them are focused on ensuring that webpages which pull content from a variety of sources — an increasingly common real-world application — accord each source the proper security rights. The careful and consistent application of such security principles will be an ongoing challenge for the web community as HTML5 grows in popularity.[7]
Tim Berners-Lee, the creator of the World Wide Web and co-chair of the W3C, recently stated that, "HTML 5 is still a markup language for webpages, but the really big shift that's happening here—and, you could argue, what's actually driving the fancy features—is the shift to the Web [supporting applications]."[2] In other words, HTML5's purpose and power lies in a fundamental shift in how people use the web; rather than it being a repository of static information, it is a medium through which users interact with and manipulate the world. The desktop computing paradigm—with its accompanying bulky, expensive hardware—will begin to be replaced by a lighter-weight and more pervasive internet-based paradigm. This change will likely have a profound effect on how society interacts with technology, and how individuals interact with each other. Its eventual ramifications are impossible to predict.[6]
HTML5 also has important political significance within the larger web community. It demonstrates the ability of the non-profit, non-governmental W3C and WHATWG—working in concert with today's most important technology companies—to create modern, relevant standards. It also reflects the growing backlash against closed-source, proprietary, or non-standards-compliant technology solutions. Though some of HTML5's promise can be approximated today with browser plugins like Adobe's Flash and Google Gears, HTML5 has risen with the growing preference—on the part of developers as well as consumers—for solutions which are not controlled by any one entity. In many ways, this movement is only an extension of the larger democratizing effect of the web, but its increasing power reinforces democracy and the individual as central concepts within the global internet movement. In the words of Dave Clark, a prominent member of the Internet Engineering Task Force (IETF), "We [as internet and web technologists] reject: kings, presidents, and voting. We believe in: rough consensus and running code."[8]
The W3C standards organization has published both a document containing the specifications of HTML5[9] and also one on how the specification differs from the now mature and more widely used HTML4[10] Ian Hickson, a researcher at Google is the editor of the working draft, and the W3C HTML Working Group is the W3C working group responsible for this specification's progress. Discussion of the specification also takes place among the original WHATWG community. HTML5 reached Last Call at the WHATWG in October 2009[11] Note however that, as mentioned at the beginning of this article, the HTML5 specification is still a working draft and is subject to changes with the W3C expecting HTML5 to become a recommended technology in 2012 and a full standard not before 2022.
HTML5 documents are built from elements which consists of tags and attributes and have a defined meaning. These elements form a tree using the Document Object Model (DOM).[12] In HTML5, the Document type declaration is a preamble that should be given at the beginning of the html page. It is as shown:[13]
<!DOCTYPE html>
According to the W3C publication A Web Developer’s Guide to HTML 5,[14] each element in HTML falls into zero or more categories that group elements with similar characteristics together. The categories are Metadata content, Flow content, Sectioning root, Sectioning content, Heading content, Phrasing content, Embedded content, Interactive content and Transparent.
HTML5 is defined in terms of the Document Object Model (DOM)—the tree representation used internally by browsers to represent the document—in contrast to HTML4, which is defined in terms of its syntax.[15] It has extended the HTMLDocument
interface from DOM Level 2 HTML. The Document
interface can now be implemented on all objects.[16] This allows HTML5 to be defined independently of syntax and there are two primary syntaxes that can be used to do this: the HTML serialization (known simply as HTML5) and the XML serialization (known as XHTML5).
In addition to this fundamental change, HTML5 is not based on SGML, which formed the foundation of all previous versions of HTML. The reason for this is given in the HTML5 Overview published by the W3C and is quoted here:
Some earlier versions of HTML (in particular from HTML2 to HTML4) were based on SGML and used SGML parsing rules. However, few (if any) web browsers ever implemented true SGML parsing for HTML documents; the only user agents to strictly handle HTML as an SGML application have historically been validators. The resulting confusion — with validators claiming documents to have one representation while widely deployed Web browsers interoperably implemented a different representation — has wasted decades of productivity. This version of HTML thus returns to a non-SGML basis. — HTML5 Overview , 8.2. Parsing HTML documents [17]
For a full list of all changes in markup from HTML4 see HTML5 differences from HTML4 - W3C Working Draft 24 June 2010.
Work on a newer version of HTML was started to address many of the shortcomings of HTML4 in its design, functionality and syntax. As per the published draft document (as of August 2010), HTML5 introduces several new elements, including tags for multimedia content such as <video>
and <audio>
, among others. Other new tags include <canvas>, <details>, <keygen>
. There is a greater emphasis on structure in this newer version of HTML, and to avoid the overuse of the <div>
and <span>
, new tags such as <header>, <footer>, <figure>, <nav>, <article>
, etc. have been introduced. Moreover, the HTML5 syntax now allows for MathML and SVG elements to be used inside a document.
In addition to new elements, new attributes have been added to existing HTML4 tags. Some of the these changes mentioned in the specification include the media
and ping
attributes for the <a>
and <area>
elements. Furthermore, the <style>
element has a new scoped
attribute, and the <script>
element has a new attribute called async
, as well as several other changes.
Finally, other tags and several attributes adopted from the current widely used HTML4 specification are now deprecated. Elements in HTML4 such as the <basefont>, <big>, <center>, <font>, <strike>
have been removed as their function is for presentational purposes, and could therefore be better handled by the use of CSS. Besides these, tags like <frame>, <frameset>, <acronym>
, etc. are also not present in HTML5 for their archaic or redundant nature. Some of the attributes that are now absent include rev and charset
attributes on <link>
and <a>, shape and coords
attributes on <a>, name
attribute on <img>, scope
attribute on td
and numerous others. A large number of attributes have been removed citing overlapping functionality with CSS elements. These include the align
attribute on <caption>, <iframe>, <img>, <input>, <object>, <legend>, <table>, <hr>, <div>
and alink, link, text, background and vlink
attributes on <body>
.
New APIs are available in HTML5, which can be used via a variety of new elements that have been introduced to handle them.[18] The APIs bring about newer and richer functionality in the way content on the web is delivered to the end user. Likely the most discussed to-date is the multimedia API for the playing of video and audio content using the new <video> and <audio> elements. The specification also includes new APIs that enable offline Web application usage and storage, that allow a Web application to register itself for certain protocols or media types, and an editing API which can be used in combination with a new global contenteditable
attribute. Other noteworthy changes include a "Drag & Drop" API in combination with a draggable
attribute, and an API that exposes the browser's history and allows pages to be added to it to, so as to provide reasonable behavior of the "back" button within an application.
Some of the more important new APIs are discussed in more detail below.
HTML5 provides a new <video>
element for the purpose of playing video content on a web page, which previously was only possible via Flash or other third party plug-ins using the <object>
tag.[19] The <video>
element is thus introduced to remove dependencies on proprietary technology for playback of video content.
An example on how the video tag is to be used is given below[20] with all possible attributes assigned. (Note that the video format used is Ogg Theora.)
<video src="movie.ogg"
controls="controls"
height="200"
width="100"
preload="preload"
loop="loop"
autoplay="autoplay">
This text is displayed if your browser does not support the HTML5 video element.
</video>
Similarly, the new <audio>
element is equipped with all of the same attributes except for height
and width
. It also may incorporate the new sub-element source
to link to audio files in different formats (e.g. mp3, ogg, m4a, etc.). This may be desirable in case a particular browser does not support a certain audio format. The browser then interprets the sources one line at a time and stops as soon as a recognized media type is found.[21]
<audio controls="controls"
source src="song.ogg" type="audio/ogg" /
source src="song.mp3" type="audio/mpeg" /
This text is displayed if your browser does not support the HTML5 audio element.
</audio>
<video>
element[edit]There has been widespread disagreement as to which formats the <video>
tag should support, with some of the popular contenders being Ogg Theora, H.264, and the new WebM format released by Google. Typically arguments have revolved around the video quality, compression ratio, licensing terms, degree of adherence to open-source ideals, and propensity for patent infringement. Indeed, this dissent has been so severe that the default codec has been removed from the specification, since no consensus could be reached.[22]
As a consequence, the HTML5 specification allows developers to use the video codecs of their choice for the <video>
tag. Thus far, most developers have used the open-source Ogg Theora codec, or the proprietary H.264. The licensing fees charged by the organization which oversees H.264 have been waived until 2015, but, should the codec become standard, they could later be raised to near-punitive levels. Aware of this danger, the open source community stands by Ogg Theora, and insists on making it the default codec due to its unpatented, royalty-free nature and liberal licensing.[2] On the other hand, Apple, Adobe and Google—citing quality concerns and other issues—oppose the widespread adoption of Ogg Theora, causing browsers like Google's Chrome and Apple's Safari to be bundled with support for H.264 (though Chrome supports the Ogg Theora codec as well). Mozilla's Firefox, due to its open-source nature and development community, supports only the Theora video and the Vorbis audio codec through the Ogg container.
However, standing by its commitment to HTML5, Google recently released a royalty-free, open video compression format of high quality called WebM. The format is based on technology developed by a company called On2 Technologies, which Google acquired. WebM uses video streams compressed with the VP8 video codec and audio streams compressed with the Vorbis audio codec, with the file structure based on the Matroska media container. It is supported by the Google Chrome and Opera browsers, and also by the latest daily builds of Mozilla Firefox. Due to its open-source, royalty-free nature, coupled with higher quality and compression ratios, WebM could become the preferred HTML5 video format. On the other hand, to support the development of Theora, the Mozilla foundation has provided a $100,000 grant to the Wikimedia Foundation.[23]
Due to the stateless nature of the Hypertext Transfer Protocol (HTTP), which is the TCP-based networking protocol used in the World Wide Web, developers have made use of cookies to keep track of states and to seamlessly transmit data from one page to the next with HTML4. However, this is only viable for small amounts of data, as information is inefficiently passed between the client and server upon each new pageview, wasting bandwidth and processing time. This obstacle makes the implementation of a true web-based application difficult, and HTML5 is designed to address this shortcoming.
HTML5 offers two new options for storing data on the client-side machine: local storage and session storage.[24] The difference between the two is that local storage stores data locally without any expiration, whereas session storage stores data only for the life of the current session, removing the stored data once the browser is closed. The advantage of these storage methods over cookies is that the data is only passed back to the server if explicitly requested by the server. This allows the server to store more data on the client-side without negatively impacting website performance. Just as JavaScript was used to handle data in cookies for HTML4, JavaScript is also used here in both new storage methods for HTML5. To prevent cross-site scripting attacks, any data that a website stores on a client machine may only be accessed by the website that generated it.
Additionally, the local storage API can allow web applications to provide significant utility to users even without a network connection. For example, a user could edit a document in a web application while on a plane, without reliable internet. Any changes the user made would then just be saved locally. Then, when the user returned to a location with internet access, all the changes could be synchronized with the remote server.
Adobe's Flash is HTML5's main competitor, and most rich-internet tasks—such as audio and video playback—are accomplished with its help today. However, it has long been detested by the open-source community for its proprietary nature and extensive history of security flaws. Recently, this disdain has come to the forefront, as mobile browsing has risen in popularity and Adobe has been persistently unable to deliver a pervasive, workable mobile Flash implementation. Citing reasons such as reliability, security, performance concerns, and usability issues within a touch screen environment, Apple has decided never to support Flash in their popular iOS-based devices, such as the iPhone and iPad. Steve Jobs, the CEO of Apple, even wrote a lengthy post about his reasons for preferring HTML5, which is more integrated into the browser and does not require a third-party plug-in.[25]
Although beta Flash support is now available in some mobile devices, such as those running the latest version of Android, the backlash against Flash has continued to grow stronger within the web community.[26] In order to cater their services to mobile users, numerous web sites and publishers of news, sports and video have started publishing richer web content using HTML5. This push for mobile accessibility has galvanized the adoption of HTML5 in recent times, with the trend expected to grow dramatically in the future.
Finally, other companies have been quick to notice Adobe's missteps with the Flash platform, and have rushed to demonstrate their support of HTML5. These include Google and Microsoft (in spite of the company's commitment to Silverlight, which is a plug-in that provides a mechanism for delivering rich web content à la Flash). Video sites like YouTube, Vimeo and others have also jumped on the bandwagon, with YouTube now in the process of converting most of its video library to the new HTML5-compatible format.[27]
In order for HTML5 to become a successful technology, it must both be widely supported by users' browsers and widely taken advantage of by web developers and designers. Though official standardization is still years away, significant steps have been made in both areas already.
Web browsers use a component called a layout engine or rendering engine for converting HTML into a human-viewable format. This is the primary component of the web browser, but other components typically include a JavaScript interpreter, as well as associated code for network access and transfers, the graphical user interface (GUI) and more. Each of the major web browsers tends to use its own rendering engine, although the relationship can be somewhat complicated, with Safari and Chrome notably sharing the WebKit engine. The following table, adapted from Wikipedia, outlines the most common layout engines used today.
Layout engine | Release version | Preview version | Used by |
---|---|---|---|
Gecko | 1.9.2.6 | 2.0b2pre | All Mozilla-based software, including Firefox; SeaMonkey and Galeon; Camino; K-Meleon; Epiphany-gecko; GNU IceCat; Debian Iceweasel, Icedove, Iceape and Iceowl |
Presto | 2.6.30 | — | Opera; Opera Mobile, Nintendo DS & DSi Browser; Internet Channel |
Trident | 4.0 (IE 8) | 5.0 (IE 9) | Internet Explorer and other Internet Explorer shells (Microsoft Windows operating systems only) |
WebKit | 533 | — | Apple Safari (including OS X for desktops and iOS for iPhones and iPads), Google Chrome, Shiira, iCab 4, OmniWeb 5.5+, Epiphany, Adobe AIR, Midori, Adobe Dreamweaver CS4, Google Android browser, Palm WebOS browser, Symbian S60 browser, OWB, Steam, Flock |
Each of the aforementioned rendering engines implement HTML5 to varying degrees and in varying forms. The following table, adapted from Wikipedia, summarizes the state of HTML5 support for each engine.
Trident | Gecko | WebKit | Presto | |
---|---|---|---|---|
Selectors API[28] | Yes[4] | Yes[5] | Yes[6] | Yes[7] |
Web Storage[29] | Yes | Yes[8] | Yes | Yes[9] |
Indexed Database API[30] | No | Nightly[10] | Nightly | No |
Web SQL Database[31] | No | No[11] | Yes[12] | Yes |
File API[32] | No | Yes[13] | Partial[14][15] | No |
Media Capture API[33] | No | Depends/Partial[16] | No | No |
Server-sent Events[34] | No | No[17] | Yes[18] | Experimental[19] |
Web Sockets[35] | No | Nightly[20] | Yes | No |
Web Workers[36][37] | No | Yes[21] | Yes | Yes |
Geolocation API[38] | No | Yes[22] | Yes[23] | Yes[24][25] |
Offline Web applications[39] | No | Yes[26] | Yes | Yes |
Though years away from ubiquity, HTML5 has been warmly embraced by many developers. It is the preferred rich internet application development framework of Apple, with its popular iOS (which runs on the iPhone and iPad) completely eschewing Flash and Silverlight, which are HTML5's main competitors today.[40] It also is supported by Google's YouTube, enabling smoother video playback on a wider variety of platforms. Other Google products, such as GMail and Google Maps also take advantage of some HTML5 features, and Google has declared its commitment to the language.[8] Finally, HTML5 is growing in popularity with even small developers. VisionWidget, a well-respected publication in the visual and web design community, recently produced a list of 22 independent websites that take advantage of HTML5 features.[41] Such compilations abound, as HTML5 has begun to be incorporated into all manner of sites and designs.