HTML5 differences from HTML4
1 od 34
http://www.w3.org/TR/html5-diff/
HTML5 differences from HTML4 W3C Working Draft 29 March 2012 This Version: http://www.w3.org/TR/2012/WD-html5-diff-20120329/ Latest Version: http://www.w3.org/TR/html5-diff/ Latest Editor's Draft: http://dev.w3.org/html5/html4-differences/ Previous Versions: http://www.w3.org/TR/2011/WD-html5-diff-20110525/ http://www.w3.org/TR/2011/WD-html5-diff-20110405/ http://www.w3.org/TR/2011/WD-html5-diff-20110405/ http://www.w3.org/TR/2011/WD-html5-diff-20110113/ http://www.w3.org/TR/2010/WD-html5-diff-20101019/ http://www.w3.org/TR/2010/WD-html5-diff-20100624/ http://www.w3.org/TR/2010/WD-html5-diff-20100304/ http://www.w3.org/TR/2009/WD-html5-diff-20090825/ http://www.w3.org/TR/2009/WD-html5-diff-20090423/ http://www.w3.org/TR/2009/WD-html5-diff-20090212/ http://www.w3.org/TR/2008/WD-html5-diff-20080610/ http://www.w3.org/TR/2008/WD-html5-diff-20080122/ Editors: Anne van Kesteren (Opera Software ASA)
Simon Pieters (Opera Software ASA) <
[email protected]> ®
Copyright © 2012 W3C (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
Abstract HTML is the core language of the World Wide Web. The W3C publishes HTML5, which is the fifth major revision of HTML. The WHATWG publishes HTML, which is a rough superset of HTML5. "HTML5 differences from HTML4" describes the differences of these documents from HTML4, and calls out cases where HTML is different from HTML5. This document may not provide accurate information as the specifications are still actively in development. When in doubt, always check the specifications themselves. [HTML5] [HTML]
Status of this Document
20.7.2012. 22:10
HTML5 differences from HTML4
2 od 34
http://www.w3.org/TR/html5-diff/
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/. This is the 29 March 2012 W3C Working Draft produced by the HTML Working Group, part of the HTML Activity. The Working Group intends to publish this document as a Working Group Note to accompany the HTML5 specification. The appropriate forum for comments is W3C Bugzilla. (
[email protected], a mailing list with a public archive, is no longer used for tracking comments.) Publication as a Working Draft does not imply endorsement by the W3C hip. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress. This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
Table of Contents 1 Introduction 1.1 Open Issues 1.2 Backwards Compatible 1.3 Development Model 2 Syntax 2.1 Character Encoding 2.2 The Doctype 2.3 MathML and SVG 2.4 Miscellaneous 3 Language 3.1 New Elements 3.2 New Attributes 3.3 Changed Elements 3.4 Changed Attributes 3.5 Obsolete Elements 3.6 Obsolete Attributes 4 Content Model Changes 5 APIs 5.1 New APIs 5.2 Changed APIs 5.3 Extensions to Document 5.4 Extensions to HTMLElement 5.5 Extensions to Other Interfaces 5.6 Obsolete APIs 6 HTML5 Changelogs 6.1 Changes since 25 May 2011 6.2 Changes from 5 April 2011 to 25 May 2011
20.7.2012. 22:10
HTML5 differences from HTML4
3 od 34
http://www.w3.org/TR/html5-diff/
6.3 Changes from 13 January 2011 to 5 April 2011 6.4 Changes from 19 October 2010 to 13 January 2011 6.5 Changes from 24 June 2010 to 19 October 2010 6.6 Changes from 4 March 2010 to 24 June 2010 6.7 Changes from 25 August 2009 to 4 March 2010 6.8 Changes from 23 April 2009 to 25 August 2009 6.9 Changes from 12 February 2009 to 23 April 2009 6.10 Changes from 10 June 2008 to 12 February 2009 6.11 Changes from 22 January 2008 to 10 June 2008 Acknowledgments References
1 Introduction HTML has been in continuous evolution since it was introduced to the Internet in the early 1990s. Some features were introduced in specifications; others were introduced in software releases. In some respects, implementations and author practices have converged with each other and with specifications and standards, but in other ways, they have diverged. HTML4 became a W3C Recommendation in 1997. While it continues to serve as a rough guide to many of the core features of HTML, it does not provide enough information to build implementations that interoperate with each other and, more importantly, with a critical mass of deployed content. The same goes for XHTML1, which defines an XML serialization for HTML4, and DOM Level 2 HTML, which defines JavaScript APIs for both HTML and XHTML. HTML5 will replace these documents. [DOM2HTML] [HTML4] [XHTML1] The HTML5 draft reflects an effort, started in 2004, to study contemporary HTML implementations and deployed content. The draft: 1. Defines a single language called HTML which can be written in HTML syntax and in XML syntax. 2. Defines detailed processing models to foster interoperable implementations. 3. Improves markup for documents. 4. Introduces markup and APIs for emerging idioms, such as Web applications.
1.1 Open Issues HTML5 is still a draft. The contents of HTML5, as well as the contents of this document which depend on HTML5, are still being discussed on the HTML Working Group and WHATWG mailing lists. The open issues are linked from the HTML5 draft.
1.2 Backwards Compatible HTML5 is defined in a way that it is backwards compatible with the way agents handle deployed content. To keep the authoring language relatively simple for authors, several elements and attributes are not included, as outlined in the other sections of this document, such as presentational elements that are better dealt with using CSS. agents, however, will always have to these older elements and attributes and this is why the HTML5 specification clearly separates requirements for authors and agents. For instance, this means that authors cannot use the isindex or the 20.7.2012. 22:10
HTML5 differences from HTML4
4 od 34
http://www.w3.org/TR/html5-diff/
plaintext element, but agents are required to them in a way that is
compatible with how these elements need to behave for compatibility with deployed content. Since HTML5 has separate conformance requirements for authors and agents there is no longer a need for marking features "deprecated".
1.3 Development Model The HTML5 specification will not be considered finished before there are at least two complete implementations of the specification. A test suite will be used to measure completeness of the implementations. This approach differs from previous versions of HTML, where the final specification would typically be approved by a committee before being actually implemented. The goal of this change is to ensure that the specification is implementable, and usable by authors once it is finished.
2 Syntax HTML5 defines an HTML syntax that is compatible with HTML4 and XHTML1 documents published on the Web, but is not compatible with the more esoteric SGML features of HTML4, such as processing instructions and shorthand markup as these are not ed by most agents. Documents using the HTML syntax are almost always served with the text/html media type. HTML5 also defines detailed parsing rules (including "error handling") for this syntax which are largely compatible with popular implementations. agents must use these rules for resources that have the text/html media type. Here is an example document that conforms to the HTML syntax: <meta charset="UTF-8">
Example document 6d2e2u
Example paragraph