HTML5: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Noah Ready-Campbell
(adding in browser support section)
mNo edit summary
 
(156 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{CZ:Special Topics 2010/EZnotice}}
{{subpages}}
{{subpages}}
'''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 [[World Wide Web|web]] pages, which people can then view in [[web browser|web browsers]]. As of July 2010, HTML5 is still not widely supported nor standardized, though browsers such as Google Chrome [http://www.google.com/chrome], Apple Safari [http://www.apple.com/safari/], and Mozilla Firefox[http://www.firefox.com/] have implemented various parts of the language.<ref name="mulroy">Mulroy, James. "Web 101: New Site-Design Tools Are Coming." PC World 28.7 (2010): 18. EBSCO MegaFILE. EBSCO. Web. 26 July 2010.</ref> This unofficial status will likely persist for some years still, with the [[World Wide Web Consortium|W3C]] currently expecting HTML5 to become a recommended technology in 2012 and a full standard not before 2022. <ref name="nichols">Vaughan-Nichols, Steven J. "Will HTML 5 Restandardize the Web?." Computer 43.4 (2010): 13-15. EBSCO MegaFILE. EBSCO. Web. 26 July 2010.</ref>
'''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 [[World Wide Web|web]] pages, which people can then view in [[web browser|web browsers]]. As of July 2010, HTML5 is still not widely supported nor standardized, though browsers such as Google Chrome [http://www.google.com/chrome], Apple Safari [http://www.apple.com/safari/], and Mozilla Firefox[http://www.firefox.com/] have implemented various parts of the language.<ref name="mulroy">Mulroy, James. "Web 101: New Site-Design Tools Are Coming." PC World 28.7 (2010).</ref> This unofficial status will likely persist for some years still, with the [[World Wide Web Consortium|W3C]] currently expecting HTML5 to become a recommended technology in 2012 and a full standard not before 2022.<ref name="nichols">Vaughan-Nichols, Steven J. "Will HTML 5 Restandardize the Web?." Computer 43.4 (2010): 13-15.</ref>


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 (computers)|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 <code>canvas</code>, as well as native embedding of video and audio.
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 (computers)|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 <code>canvas</code>, 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|Adobe's]] [[Flash]] plugin, as well [[Microsoft|Microsoft's]] [[Microsoft Silverlight|Silverlight]] and their browser [[Internet Explorer]]. Internet Explorer has a notable reputation for employing non-standard extensions to web technologies.<ref name="pirillo">{{cite web|url=http://www.lockergnome.com/news/2004/06/15/why-you-should-dump-internet-explorer/|title=Why You Should Dump Internet Explorer|author=Chris Pirillo}}</ref> 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 at [[World Wide Web Consortium|W3C]], "One of our goals [for HTML5] is to move the Web away from proprietary technologies."<ref name="nichols" /> Such a step would lay the groundwork for the web's increasing dominance over the next decade.
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|Adobe's]] [[Flash]] plugin, as well [[Microsoft|Microsoft's]] [[Microsoft Silverlight|Silverlight]] and their browser [[Internet Explorer]]. Internet Explorer has a notable reputation for employing non-standard extensions to web technologies.<ref name="pirillo">{{cite web|url=http://www.lockergnome.com/news/2004/06/15/why-you-should-dump-internet-explorer/|title=Why You Should Dump Internet Explorer|author=Chris Pirillo}}</ref> 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."<ref name="nichols" /> Such a step would lay the groundwork for the web's increasing dominance over the next decade.


{{TOC}}
{{TOC}}
Line 11: Line 10:
==History==
==History==


==Implications and Importance==
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_Inc.|Apple]], [[Mozilla]], and [[Opera Software ASA|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.<ref name="whatwg">{{cite web|url=http://www.whatwg.org/specs/web-apps/current-work/multipage/introduction.html|title=Introduction — HTML5 (including next generation additions still in development)}}</ref> 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.<ref>Pilgrim, Mark. ''HTML5: Up and Running.'' O'Reilly Media. 2010.</ref>


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


===Technical Importance===
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.<ref name="wright">Wright, Alex. "Ready for a Web OS?." Communications of the ACM 52.12 (2009): 16-17. EBSCO MegaFILE. EBSCO. Web. 26 July 2010.</ref>
===Technical Significance===


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.<ref name="mansfield">Mansfield-Devine, Steve. "Divide and conquer: the threats posed by hybrid apps and HTML 5." Network Security 2010.3 (2010): 4-6. EBSCO MegaFILE. EBSCO. Web. 26 July 2010.</ref>
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.<ref name="wright">Wright, Alex. "Ready for a Web OS?." Communications of the ACM 52.12 (2009): 16-17.</ref>


===Social and Political Importance===
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.<ref name="mansfield">Mansfield-Devine, Steve. "Divide and conquer: the threats posed by hybrid apps and HTML 5." Network Security 2010.3 (2010): 4-6.</ref>
Tim Berners-Lee: "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]."<ref name="nichols" />
 
===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]."<ref name="nichols" /> 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.<ref name="wright" />
 
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."<ref name="o'reilly">{{cite web|title=Google Bets Big on HTML 5: News from Google I/O|url=http://radar.oreilly.com/2009/05/google-bets-big-on-html-5.html}}</ref>
 
==Standardization process==
 
The W3C standards organization has published both a document containing the specifications of HTML5<ref>{{cite web |url=http://www.w3.org/TR/html5/ | title=Official HTML5 Specification}} 2 Aug 2010.</ref> and also one on how the specification differs from the now mature and more widely used HTML4<ref>{{cite web |url=http://dev.w3.org/html5/html4-differences/ | title=HTML5 differences from HTML4}} 2 Aug 2010.</ref> 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<ref>{{cite web |url=http://www.whatwg.org/specs/web-apps/current-work/ | title=HTML5}} 8 Aug 2010.</ref> 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.


==Language Details==
==Language Details==
===Evolution from HTML4===
===Brief Overview===


The W3C standards organisation has published both a document containing the specifications of HTML5<ref>{{cite web |url=http://www.w3.org/TR/html5/ | title=Official HTML5 Specification}} 2 Aug 2010.</ref> and also one on how the specification differs from the now mature and more widely used HTML4<ref>{{cite web |url=http://dev.w3.org/html5/html4-differences/ | title=HTML5 differences from HTML4}} 2 Aug 2010.</ref> (Note that the HTML5 specification is a working draft and is subject to changes). 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 WHATWG(Web Hypertext Application Technology Working Group) community. As per the published draft document (as of 02 Aug 2010), in addition to several new elements which include tags for multimedia content such as video and audio among others, there has been addition (and deprecation) of several attributes of various existing elements of the HTML4 specification.
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).<ref>{{cite web |url=http://www.whatwg.org/specs/web-apps/current-work/#syntax | title=HTML5 Syntax}} 8 Aug 2010.</ref> In HTML5, the Document type declaration is a preamble that should be given at the beginning of the html page. It is as shown:<ref>{{cite web |url=http://www.w3.org/TR/html5/ | title=Official HTML5 Specification}} 7 Aug 2010.</ref>


===Effect on Flash===
<code><!DOCTYPE html></code>


===Controversy over codec used for the <video> element===
According to the [[W3C]] publication ''A Web Developer’s Guide to HTML 5'',<ref>{{cite web |url=http://dev.w3.org/html5/html-author/ | title=A Web Developer’s Guide to HTML 5}} 7 Aug 2010.</ref> 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.


The HTML5 specification is such that it enables developers to use non-proprietary video codecs of their choice for the video tag. Popular video codecs of choice include the open source Ogg-Theora and h.264 codecs. However, there has been dispute over the default codec to be used. The open source community stands by and insists making Ogg-Theora the default codec due to its lesser patent regulations and licensing advantages.<ref name="nichols" /> On the other hand, Apple, Adobe and Google citing quality concerns and other issues opposes the widespread adoption of Ogg-Theora causing browsers like Google's Chrome and Apple's Safari to be bundled with support for h.264 and Mozilla's Firefox supporting the Theora codec.
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.<ref>{{cite web |url=http://www.alistapart.com/articles/previewofhtml5 | title=A Preview of HTML 5 by Lachlan Hunt}} 7 Aug 2010.</ref> It has extended the <code>HTMLDocument</code> interface from DOM Level 2 HTML. The <code>Document</code> interface can now be implemented on all objects.<ref>{{cite web |url=http://dev.w3.org/html5/html4-differences/ | title=HTML5 differences from HTML4}} 2 Aug 2010.</ref> 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).  


==Browser Support==
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
[http://dev.w3.org/html5/spec/Overview.html HTML5 Overview] published by the W3C and is quoted here:
 
{{Quotation|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 <ref>{{cite web |url=http://dev.w3.org/html5/spec/Overview.html | title=HTML5 Overview}} 8 Aug 2010.</ref>}}
 
===Markup and evolution from HTML4===
 
For a full list of all changes in markup from HTML4 see [http://www.w3.org/TR/html5-diff/ 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 <code><video></code> and <code><audio></code>, among others. Other new tags include <code><canvas>, <details>, <keygen></code>. There is a greater emphasis on structure in this newer version of HTML, and to avoid the overuse of the <code><nowiki><div></nowiki></code> and <code><nowiki><span></nowiki></code>, new tags such as <code><header>, <footer>, <figure>, <nav>, <article></code>, 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 <code>media</code> and <code>ping</code> attributes for the <code><nowiki><a></nowiki></code> and <code><nowiki><area></nowiki></code> elements. Furthermore, the <code><nowiki><style></nowiki></code> element has a new <code>scoped</code> attribute, and the <code><nowiki><script></nowiki></code> element has a new attribute called <code>async</code>, 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 <code><basefont>, <nowiki><big>, <center>, <font>, <strike></nowiki></code> 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 <code><frame>, <frameset>, <acronym></code>, etc. are also not present in HTML5 for their archaic or redundant nature. Some of the attributes that are now absent include <code>rev and charset</code> attributes on <code><link></code> and <code><a>, shape and coords</code> attributes on <code><a>, name</code> attribute on <code><img>, scope</code> attribute on <code><nowiki>td</nowiki></code> and numerous others. A large number of attributes have been removed citing overlapping functionality with CSS elements. These include the <code>align</code> attribute on <code><nowiki><caption>, <iframe>, <img>, <input>, <object>, <legend>, <table>, <hr>, <div></nowiki></code> and <code>alink, link, text, background and vlink</code> attributes on <code><body></code>.
 
===Overview of New APIs===
 
New APIs are available in HTML5, which can be used via a variety of new elements that have been introduced to handle them.<ref>{{cite web |url=http://dev.w3.org/html5/html4-differences/ | title=HTML5 differences from HTML4}} 2 Aug 2010</ref> 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 <code>contenteditable</code> attribute. Other noteworthy changes include a "Drag & Drop" API in combination with a <code>draggable</code> 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 <code><video></code> 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 <code><object></code> tag.<ref>{{cite web |url=http://www.w3.org/TR/html5/video.html#video | title=HTML5 video element}} 8 Aug 2010</ref> The <code><video></code> 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<ref>{{cite web |url=http://www.w3schools.com/html5/tag_video.asp | title=HTML 5 <video> Tag}} 8 Aug 2010</ref> with all possible attributes assigned. (Note that the video format used is Ogg Theora.)
 
<code>
<video src="movie.ogg"
        controls="controls"
        height="200"
        width="100"
        preload="preload"
        loop="loop"
        autoplay="autoplay"><br/>
    This text is displayed if your browser does not support the HTML5 video element.<br/>
</video>
</code>
 
Similarly, the new <code><audio></code> element is equipped with all of the same attributes except for <code>height</code> and <code>width</code>. It also may incorporate the new sub-element <code>source</code> 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.<ref>{{cite web|url=http://www.w3schools.com/html5/html5_audio.asp | title=HTML5 audio element}} 9 Aug 2010</ref>
 
<code>
<audio controls="controls"
  source src="song.ogg" type="audio/ogg" /
  source src="song.mp3" type="audio/mpeg" /<br/>
  This text is displayed if your browser does not support the HTML5 audio element.<br/>
</audio>
</code>
 
====Controversy over codec used for the <code><video></code> element====
 
There has been widespread disagreement as to which formats the <code><video></code> 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.<ref>{{cite web |url=http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2007-December/013135.html | title=Video codec requirements changed - Ian Hickson}} 8 Aug 2010</ref>
 
As a consequence, the HTML5 specification allows developers to use the video codecs of their choice for the <code><video></code> 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.<ref name="nichols" /> 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.<ref>{{cite web |url=http://blog.wikimedia.org/2009/mozilla-and-wikimedia-join-forces-to-support-open-video/ | title=Mozilla and Wikimedia on open video codecs}} 2 Aug 2010.</ref>
 
===New Web Storage Options===
Due to the [[State (computers)|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 [[Cookie (computers)|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.<ref>{{cite web|url=http://www.w3schools.com/html5/html5_webstorage.asp|title=HTML5 Web Storage Methods}} 9 Aug 2010</ref>  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 Inc.|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.<ref>{{cite web |url=http://www.apple.com/hotnews/thoughts-on-flash/ | title=Thoughts on Flash - Steve Jobs}} 4 Aug 2010</ref>
 
Although beta Flash support is now available in some mobile devices, such as those running the latest version of [[Android (smartphone)|Android]], the backlash against Flash has continued to grow stronger within the web community.<ref>{{cite web |url=http://labs.adobe.com/wiki/index.php/Flash_Player_10.1_for_Android | title=Adobe flash player for  Android}} 4 Aug 2010</ref> 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 [[Microsoft Silverlight|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.<ref>{{cite web |url=http://youtube-global.blogspot.com/2010/01/introducing-youtube-html5-supported.html | title=Introducing Youtube HTML5 videos}} 4 Aug 2010</ref>
 
==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 (computer)|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.


{| class="wikitable"
{| class="wikitable"
Line 44: Line 130:


|-
|-
!{{Rh}}|[[Gecko (layout engine)|Gecko]]
!|[[Gecko (layout engine)|Gecko]]
| 1.9.2.6
| 1.9.2.6
| 2.0b2pre
| 2.0b2pre
|All [[Mozilla]] [[software]], including [[Mozilla Firefox|Firefox]]; [[SeaMonkey]] and [[Galeon]]; [[Camino]]; [[K-Meleon]]; [[Flock (web browser)|Flock]]; [[Epiphany (web browser)|Epiphany-gecko]]; [[GNU IceCat]]; [[Debian]] [[Mozilla Corporation software rebranded by the Debian project|Iceweasel]], [[Mozilla Corporation software rebranded by the Debian project#Icedove|Icedove]], [[Mozilla Corporation software rebranded by the Debian project#Iceape|Iceape]] and [[Mozilla Corporation software rebranded by the Debian project#Iceowl|Iceowl]]
|All [[Mozilla]]-based [[software]], including [[Mozilla Firefox|Firefox]]; [[SeaMonkey]] and [[Galeon]]; [[Camino]]; [[K-Meleon]]; [[Epiphany (web browser)|Epiphany-gecko]]; [[GNU IceCat]]; [[Debian]] [[Mozilla Corporation software rebranded by the Debian project|Iceweasel]], [[Mozilla Corporation software rebranded by the Debian project#Icedove|Icedove]], [[Mozilla Corporation software rebranded by the Debian project#Iceape|Iceape]] and [[Mozilla Corporation software rebranded by the Debian project#Iceowl|Iceowl]]


|-
|-
!{{Rh}}|[[Presto (layout engine)|Presto]]
![[Presto (layout engine)|Presto]]
| 2.6.30
| 2.6.30
| —
| —
Line 56: Line 142:


|-
|-
!{{Rh}}|[[Trident (layout engine)|Trident]]
![[Trident (layout engine)|Trident]]
| 4.0 (IE 8)
| 4.0 (IE 8)
| 5.0 (IE 9)
| 5.0 (IE 9)
Line 62: Line 148:


|-
|-
!{{Rh}}|[[WebKit]]
![[WebKit]]
| 533
| 533
| —
| —
|[[Apple Inc.|Apple]] [[Safari (web browser)|Safari]] (including [[OS X]] for desktops and [[iOS (Apple)|iOS]] for [[iPhone]]s and [[iPad]]s), [[Google Chrome]], [[Shiira]], [[iCab|iCab 4]], [[OmniWeb|OmniWeb 5.5]]+,  [[Epiphany (web browser)|Epiphany]], [[Adobe AIR]], [[Midori (browser)|Midori]], [[Adobe Dreamweaver]] [[CS4]], [[Google]] [[Android (operating system)|Android]] browser, [[Palm, Inc.|Palm]] [[WebOS]] browser, [[Symbian S60]] browser, [[Origyn Web Browser|OWB]], [[Steam (content delivery)|Steam]]
|[[Apple Inc.|Apple]] [[Safari (web browser)|Safari]] (including [[OS X]] for desktops and [[iOS (Apple)|iOS]] for [[iPhone]]s and [[iPad]]s), [[Google Chrome]], [[Shiira]], [[iCab|iCab 4]], [[OmniWeb|OmniWeb 5.5]]+,  [[Epiphany (web browser)|Epiphany]], [[Adobe AIR]], [[Midori (browser)|Midori]], [[Adobe Dreamweaver]] [[CS4]], [[Google]] [[Android (operating system)|Android]] browser, [[Palm, Inc.|Palm]] [[WebOS]] browser, [[Symbian S60]] browser, [[Origyn Web Browser|OWB]], [[Steam (content delivery)|Steam]], [[Flock (web browser)|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.
 
{| class="wikitable" style="text-align: center; width: 95%"
! |
! style="width: 18%;" | [[Trident (layout engine)|Trident]]
! style="width: 18%;" | [[Gecko (layout engine)|Gecko]]
! style="width: 18%;" | [[WebKit]]
! style="width: 18%;" | [[Presto (layout engine)|Presto]]
|-
! style="text-align: left;" | Selectors API<ref>{{citation |url=http://dev.w3.org/2006/webapi/selectors-api/ |title=Selectors API Level 1 |publisher=W3C}}</ref>
| {{yes|8.0}}[http://ejohn.org/blog/javascript-in-internet-explorer-8/]
| {{yes|1.9.1}}[https://developer.mozilla.org/En/DOM/Document.querySelector]
| {{yes|525}}[http://webkit.org/blog/156/queryselector-and-queryselectorall/]
| {{yes|2.2}}[http://my.opera.com/core/blog/selectors-api]
|-
! style="text-align: left;" | [[Web Storage]]<ref>{{citation |url=http://dev.w3.org/html5/webstorage/ |title=Web Storage |publisher=W3C}}</ref>
| {{yes|8.0}}
| {{yes|1.9.1}}[https://developer.mozilla.org/En/DOM:Storage]
| {{yes|525}}
| {{yes|2.5}}[http://my.opera.com/ODIN/blog/opera-10-5-pre-alpha-build-released-here-is-whats-new]
|-
! style="text-align: left;" | [[Indexed Database API]]<ref>{{citation |url=http://www.w3.org/TR/IndexedDB/ |title=Indexed Database API |publisher=W3C}}</ref>
| {{no}}
| Nightly[https://bugzilla.mozilla.org/show_bug.cgi?id=IndexedDB]
| Nightly
| {{no}}
|-
! style="text-align: left;" | [[Web SQL Database]]<ref>{{citation |url=http://dev.w3.org/html5/webdatabase/ |title=Web SQL Database |publisher=W3C}}</ref>
| {{no}}
| {{no}}[https://bugzilla.mozilla.org/show_bug.cgi?id=416327]
| {{yes}}[http://webkit.org/blog/126/webkit-does-html5-client-side-database-storage/]
| {{yes|2.5}}
|-
! style="text-align: left;" | File API<ref>{{citation |url=http://www.w3.org/TR/FileAPI/ |title=File API |publisher=W3C |date=2009-11-17}}</ref>
| {{no}}
| {{yes|1.9.2}}[https://developer.mozilla.org/en/Using_files_from_web_applications]
| Partial[https://bugs.webkit.org/show_bug.cgi?id=36567][https://bugs.webkit.org/show_bug.cgi?id=38157]
| {{no}}
|-
! style="text-align: left;" | Media Capture API<ref>{{citation |url=http://dev.w3.org/2009/dap/camera/ |title=Media Capture API |publisher=W3C}}</ref>
| {{no}}
| Depends/Partial[https://bugzilla.mozilla.org/show_bug.cgi?id=451674]
| {{no}}
| {{no}}
|-
! style="text-align: left;" | Server-sent Events<ref>{{citation |url=http://dev.w3.org/html5/eventsource/ |title=Server-Sent Events |publisher=W3C}}</ref>
| {{no}}
| {{no}}[https://bugzilla.mozilla.org/show_bug.cgi?id=338583]
| {{yes}}[https://bugs.webkit.org/show_bug.cgi?id=14997]
| Experimental[http://my.opera.com/WebApplications/blog/show.dml/438711]
|-
! style="text-align: left;" | [[Web Sockets]]<ref>{{citation |url=http://dev.w3.org/html5/websockets/ |title=The Web Sockets API |publisher=W3C}}</ref>
| {{no}}
| Nightly[https://bugzilla.mozilla.org/show_bug.cgi?id=472529]
| {{yes|533}}
| {{no}}
|-
! style="text-align: left;" | [[Web Workers]]<ref>{{citation |url=http://dev.w3.org/html5/workers/ |title=Web Workers |publisher=W3C}}</ref><ref>{{citation |url=http://ejohn.org/blog/web-workers/ |title=Computing with JavaScript Web Workers |last=Resig |first=John |date=2009-07-21}}</ref>
| {{no}}
| {{yes|1.9.1}}[https://bugzilla.mozilla.org/show_bug.cgi?id=437152]
| {{yes}}
| {{yes|2.6.30}}
|-
! style="text-align: left;" | Geolocation API<ref>{{citation |url=http://dev.w3.org/geo/api/spec-source.html |title=Geolocation API Specification |publisher=W3C}}</ref>
| {{no}}
| {{yes|1.9.1}}[https://developer.mozilla.org/En/Using_geolocation]
| {{yes|533}}[https://bugs.webkit.org/show_bug.cgi?id=21475]
| {{yes|2.6.30}}[http://my.opera.com/desktopteam/blog/2010/02/05/skin-fixes-unite-and-then-some][http://www.opera.com/docs/specs/presto25/]
|-
! style="text-align: left;" | Offline Web applications<ref>{{citation |url=http://dev.w3.org/html5/spec/offline.html#offline |title=5.6 Offline Web applications &#8212; HTML5 |publisher=W3C}}</ref>
| {{no}}
| {{yes|1.9.1}}[https://developer.mozilla.org/en/offline_resources_in_firefox]
| {{yes}}
| {{yes|2.6.30}}
|-class="sortbottom"
|}
|}


===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_Inc.|Apple]], with its popular [[iOS]] (which runs on the [[iPhone]] and [[iPad]]) completely eschewing [[Flash]] and [[Microsoft Silverlight|Silverlight]], which are HTML5's main competitors today.<ref name="techrepublic">{{cite web|title=How will HTML 5, Google, and the iPad play out in Apple vs. Flash?|url=http://blogs.techrepublic.com.com/mac/?p=434}}</ref> It also is supported by [[Google|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.<ref name="o'reilly" /> 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.<ref>{{cite web|title=22 Examples of Fresh Html 5 Websites |url=http://visionwidget.com/showcase/graphics/521-examples-of-fresh-html5-websites.html}}</ref> Such compilations abound, as HTML5 has begun to be incorporated into all manner of sites and designs.


==References==
==References==
<references />
<references />[[Category:Suggestion Bot Tag]]

Latest revision as of 06:00, 25 August 2024

This article is a stub and thus not approved.
Main Article
Discussion
Related Articles  [?]
Bibliography  [?]
External Links  [?]
Citable Version  [?]
 
This editable Main Article is under development and subject to a disclaimer.

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.

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

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

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

Standardization process

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.

Language Details

Brief Overview

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]

Markup and evolution from HTML4

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

Overview of New APIs

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 Video and Audio

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>

Controversy over codec used for the <video> element

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]

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

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

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.

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

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

References

  1. Mulroy, James. "Web 101: New Site-Design Tools Are Coming." PC World 28.7 (2010).
  2. 2.0 2.1 2.2 2.3 Vaughan-Nichols, Steven J. "Will HTML 5 Restandardize the Web?." Computer 43.4 (2010): 13-15.
  3. Chris Pirillo. Why You Should Dump Internet Explorer.
  4. Introduction — HTML5 (including next generation additions still in development).
  5. Pilgrim, Mark. HTML5: Up and Running. O'Reilly Media. 2010.
  6. 6.0 6.1 Wright, Alex. "Ready for a Web OS?." Communications of the ACM 52.12 (2009): 16-17.
  7. Mansfield-Devine, Steve. "Divide and conquer: the threats posed by hybrid apps and HTML 5." Network Security 2010.3 (2010): 4-6.
  8. 8.0 8.1 Google Bets Big on HTML 5: News from Google I/O.
  9. Official HTML5 Specification. 2 Aug 2010.
  10. HTML5 differences from HTML4. 2 Aug 2010.
  11. HTML5. 8 Aug 2010.
  12. HTML5 Syntax. 8 Aug 2010.
  13. Official HTML5 Specification. 7 Aug 2010.
  14. A Web Developer’s Guide to HTML 5. 7 Aug 2010.
  15. A Preview of HTML 5 by Lachlan Hunt. 7 Aug 2010.
  16. HTML5 differences from HTML4. 2 Aug 2010.
  17. HTML5 Overview. 8 Aug 2010.
  18. HTML5 differences from HTML4. 2 Aug 2010
  19. HTML5 video element. 8 Aug 2010
  20. HTML 5 <video> Tag. 8 Aug 2010
  21. HTML5 audio element. 9 Aug 2010
  22. Video codec requirements changed - Ian Hickson. 8 Aug 2010
  23. Mozilla and Wikimedia on open video codecs. 2 Aug 2010.
  24. HTML5 Web Storage Methods. 9 Aug 2010
  25. Thoughts on Flash - Steve Jobs. 4 Aug 2010
  26. Adobe flash player for Android. 4 Aug 2010
  27. Introducing Youtube HTML5 videos. 4 Aug 2010
  28. Selectors API Level 1, W3C
  29. Web Storage, W3C
  30. Indexed Database API, W3C
  31. Web SQL Database, W3C
  32. File API, W3C, 2009-11-17
  33. Media Capture API, W3C
  34. Server-Sent Events, W3C
  35. The Web Sockets API, W3C
  36. Web Workers, W3C
  37. Resig, John (2009-07-21), Computing with JavaScript Web Workers
  38. Geolocation API Specification, W3C
  39. 5.6 Offline Web applications — HTML5, W3C
  40. How will HTML 5, Google, and the iPad play out in Apple vs. Flash?.
  41. 22 Examples of Fresh Html 5 Websites.