HTML5

HTML5 is the next generation hypertext markup language standard developed 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, Apple Safari , and Mozilla Firefox have implemented various parts of the language. 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.

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, 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. 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." Such a step would lay the groundwork for the web's increasing dominance over the next decade.

History
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 of 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. 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.

In 2006, the W3C indicated an interest to participate in the development of HTML5 after all, and in 2007 formed a working group chartered to work with the WHATWG on the development of the HTML5 specification. Apple, Mozilla, and Opera allowed the W3C to publish the specification under the W3C copyright, while keeping a version with the less restrictive license on the WHATWG site. A HTML5 W3C Working Draft (dated 20 April 2012) mentions as Editor Ian Hickson of Google, Inc. The HTML5 specification published by the WHATWG is not identical to the W3C specification. The main differences are that the WHATWG version includes features not included in the W3C version; they may be considered for future W3C revisions of HTML beyond HTML5.

Implications and Significance
HTML5 is an important extension to the current web development toolkit, both from a technical perspective and from a social and political standpoint.

Technical Significance
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.

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.

Social and Political Significance
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]." 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.

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."

Standardization process
The W3C standards organization has published both a document containing the specifications of HTML5 and also one on how the specification differs from the now mature and more widely used HTML4 Ian Hickson, a researcher at Google is the editor of many of the WHATWG and W3C publications on HTML5. Discussion of the specification also takes place among the original WHATWG community. The latest status of the WHATWG version of HTML5 is dated March 21, 2012 Note however that, as mentioned at the beginning of this article, the HTML5 specification is still a working draft and is subject to changes.

Brief Overview
Not unlike HTML4, 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). In HTML5, the Document type declaration is a preamble that should be given at the beginning of the html page. It is as shown:

According to the W3C publication A Web Developer’s Guide to HTML 5, 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. It has extended the  interface from DOM Level 2 HTML. The  interface can now be implemented on all objects. 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:

Markup and evolution from HTML4
For a full list of all changes in markup from HTML4 see HTML5 differences from HTML4 - W3C Working Draft 25 May 2011.

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  and , among others. Other new tags include. There is a greater emphasis on structure in this newer version of HTML, and to avoid the overuse of the  and , new tags:     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  and   attributes for the   and   elements. Furthermore, the  element has a new   attribute, and the   element has a new attribute called , 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  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, etc. are also not present in HTML5 for their archaic or redundant nature. Some of the attributes that are now absent include  attributes on   and   attributes on   attribute on   attribute on   and numerous others. A large number of attributes have been removed citing overlapping functionality with CSS elements. These include the  attribute on   and   attributes on.

Overview of new APIs
New APIs (application program interfaces) are available in HTML5, which can be used via a variety of new elements that have been introduced to handle them. 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 and 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  attribute. Other noteworthy changes include a "Drag &amp; Drop" API in combination with a  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 Video and Audio
HTML5 provides a new  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   tag. The  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 with all possible attributes assigned. (Note that the video format used is Ogg Theora.)

Similarly, the new  element is equipped with all of the same attributes except for   and. It also may incorporate the new sub-element  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.

Controversy over codec used for the element
There has been widespread disagreement as to which formats the  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.

As a consequence, the HTML5 specification allows developers to use the video codecs of their choice for the  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. 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.

New Web Storage Options
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. 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.

Competition with Flash
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.

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. 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.

HTML5 Adoption
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.

Browser Support
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.

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.

Website Support
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. 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. 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. Such compilations abound, as HTML5 has begun to be incorporated into all manner of sites and designs.