- 1 The WHATWG
- 2 The WHATWG Process
- 2.1 How does the WHATWG work?
- 2.2 How should tool developers, screen reader developers, browser vendors, search engine vendors, and other implementors interact with the WHATWG?
- 2.3 Is there a process for removing bad ideas from a specification?
- 2.4 Is there a process for adding new features to a specification?
- 2.5 What does "Living Standard" mean?
- 2.6 “Living specification” sounds like a draft that may and will change at any moment and is probably not even complete at any moment of time...
- 2.7 Don’t browsers need a target to work their implementations towards, even if it’s a snapshot that is essentially arbitrary?
- 2.8 When will it be safe to attempt to implement the spec based solely on the formal specification statements in the spec?
- 2.9 How do we know what to use, without having some sort of snapshot that browsers can aim at and developers can evaluate?
- 2.10 Isn’t the whole point of a specification to establish fixed point of reference so that all parties implementing the standard can ensure they have a common baseline of compatibility?
- 2.11 The large Web industry with many browsers and even more producers of web pages needs to evolve in reasonably consistent steps for ubiquity and interoperability, so we need snapshots
- 2.12 How about support in browsers for previous versions of this “living” HTML standard?
- 2.13 Will future browsers have any idea what older HTML documents mean?
- 2.14 This means you will only able to add to a spec, not redefine it.
- 2.15 How can web developers know which features are safe to use?
- 2.16 Browsers can currently say they implement HTML 4.01 and most know what to expect.
- 2.17 How are developers to determine when certain parts of their pages will become invalid?
- 2.18 How will anything be deprecated and removed if there are no version numbers?
- 2.19 Will HTML become a bloated unimplementable mess as old features pile up if there are no version numbers?
- 2.20 Will HTML become an unusable mess as features are removed and old valid documents suddenly become invalid, if there are no version numbers?
- 2.21 If you do not publish snapshots every now and again, you are Orwellian in your recognition of the role the mistakes of the past play into the present and the future.
- 3 HTML5
- 3.1 What is HTML5?
- 3.2 How can I keep track of changes to the spec?
- 3.3 What are the various versions of the spec?
- 3.4 Are there versions of the specification aimed specifically at authors/implementors?
- 3.5 When will we be able to start using these new features?
- 3.6 When will HTML5 be finished?
- 3.7 What's this I hear about 2022?
- 3.8 What about Microsoft and Internet Explorer?
- 3.9 Is design rationale documented?
- 4 HTML syntax issues
- 4.1 Will HTML finally put an end to the XHTML as text/html debate?
- 4.2 What will the DOCTYPE be?
- 4.3 Under what conditions should a DOCTYPE be used in XHTML?
- 4.4 How are documents from HTML4 and earlier versions parsed?
- 4.5 If there is no DTD, how can I validate my page?
- 4.6 What is an HTML Serialization?
- 4.7 What is an XML (or XHTML) Serialization?
- 4.8 What MIME type does HTML use?
- 4.9 Should I close empty elements with /> or >?
- 4.10 If I’m careful with the syntax I use in my HTML document, can I process it with an XML parser?
- 4.11 What is the namespace declaration?
- 4.12 Will there be support for namespaces in HTML?
- 4.13 How do I specify the character encoding?
- 4.14 What are the differences between HTML and XHTML?
- 4.15 What are best practices to be compatible with HTML DOM and XHTML DOM?
- 4.16 Why does this new HTML spec legitimise tag soup?
- 5 HTML feature proposals
- 5.1 HTML should support href on any element!
- 5.2 HTML should support list headers!
- 5.3 HTML should support a way for anyone to invent new elements!
- 5.4 HTML should group <dt>s and <dd>s together in <di>s!
- 5.5 Why are some presentational elements like <b>, <i> and <small> still included?
- 5.6 The <cite> element should allow names of people to be marked up
- 5.7 The <time> element should allow vague times ("March") and times from ancient history to be marked up
- 5.8 <input type="text"> needs a minlength="" attribute
- 6 WHATWG and the W3C HTML WG
- 7 Using HTML
- 8 , it should probably not be a <section>/<article>/<aside>/<nav>.
- You can still use <div>. It's the right element if you need a styling hook because CSS can't give you enough to do what you want.
- Generally, <section>s should start with an <h1> and the section title. It's not a hard-and-fast rule, but if you find yourself in a situation where an <h1> would be inappropriate, you probably want <div> rather than <section>.
- Sections can contain Articles, and vice versa. e.g. you can have a section that is news, a section that is editorials, a section that is sports, each with many articles, and each of those can have subsections, and each section can have comments, which are marked up using <article>, and each comment could be big enough that it has separate <section>s, and so on.
What is the WHATWG?
The Web Hypertext Application Technology Working Group (WHATWG) is a growing community of people interested in evolving the Web. It focuses primarily on the development of HTML and APIs needed for Web applications.
The WHATWG was founded by individuals of Apple, the Mozilla Foundation, and Opera Software in 2004, after a W3C workshop. Apple, Mozilla and Opera were becoming increasingly concerned about the W3C’s direction with XHTML, lack of interest in HTML and apparent disregard for the needs of real-world authors. So, in response, these organisations set out with a mission to address these concerns and the Web Hypertext Application Technology Working Group was born.
What is the WHATWG working on?
The WHATWG's main focus is the HTML standard. The WHATWG also works on Web Workers, Web Storage, the Web Sockets API, and Server-Sent Events, and occasionally specifications outside WHATWG space are discussed on the WHATWG mailing list and forwarded when appropriate.
In the past it has worked on Web Forms 2.0 and Web Controls 1.0. Web Forms 2.0 has been integrated into HTML5 and Web Controls 1.0 has been abandoned for now, awaiting what XBL 2.0 will bring us.
How can I get involved?
There are lots of ways you can get involved, take a look and see What you can do!
Is participation free?
Yes, everyone can contribute. There are no memberships fees involved, it's an open process. You may easily subscribe to the WHATWG mailing lists. You may also join the the W3C's new HTMLWG by going through the slightly longer application process.
The WHATWG Process
How does the WHATWG work?
People send e-mail to the mailing list. The editor then reads that feedback and, taking it into account along with research, studies, and feedback from many other sources (blogs, forums, IRC, etc) makes language design decisions intended to address everyone's needs as well as possible while keeping the language consistent.
This continues, with people sending more feedback, until nobody is able to convince the editor to change the spec any more (e.g. because two people want opposite things, and the editor has considered all the information available and decided that one of the two proposals is the better one).
This is not a consensus-based approach -- there's no guarantee that everyone will be happy! There is also no voting.
There is a small oversight committee (known as the "WHATWG members", see the charter) who have the authority to override or replace the editor if he starts making bad decisions.
Currently the editor is Ian Hickson.
How should tool developers, screen reader developers, browser vendors, search engine vendors, and other implementors interact with the WHATWG?
Feedback on a feature should be sent to firstname.lastname@example.org (but you have to join the mailing list first), or email@example.com. All feedback will receive a reply in due course.
If you want feedback to be dealt with faster than "eventually", e.g. because you are about to work on that feature and need the spec to be updated to take into account all previous feedback, let the editor know by either e-mailing him (firstname.lastname@example.org), or contacting him on IRC (Hixie on Freenode). Requests for priority feedback handling are handled confidentially so other implementors won't know that you are working on that feature.
Questions and requests for clarifications should be asked either on the mailing list or on IRC, in the #whatwg channel on Freenode.
Is there a process for removing bad ideas from a specification?
There are several processes by which we trim weeds from the specifications.
- Occasionally, we go through every section and mark areas as being considered for removal. This happened early in 2008 with the data templates, repetition blocks, and DFN-element cross references, for example. If no feedback is received to give us strong reasons to keep such features, then they eventually are removed altogether.
- Anyone can ask for a feature to be removed; such feedback is considered like all other feedback and is based on the merits of the arguments put forward.
- If browsers don't widely implement a feature, or if authors don't use a feature, or if the uses of the feature are inconsequential or fundamentally wrong or damaging, then, after due consideration, features will be removed.
Removing features is a critical part of spec development.
Is there a process for adding new features to a specification?
The process is rather informal, but basically boils down to this:
- Research the use cases and requirements by discussing the issue with authors and implementors.
- Come up with a clear description of the problem that needs to be solved.
- Discuss your proposal with authors and implementors. Read the responses. Listen to the feedback. Consider whether your ideas are good solutions to the use cases and requirements put forward. Discussions here should be done in public, e.g. on an archived public mailing list or documented in blogs.
- Get implementors to commit to implementing the feature. If you can't get several implementors to implement the feature, then get at least one user agent to implement it experimentally. Experimental implementations should be publicly available.
- Bring the experimental implementations to the attention of the spec's editor (e.g. e-mail email@example.com). Document the experience found from any implementations, the use cases and requirements that were found in the first step, the data that the design was based on.
- Demonstrate the importance of the problem. Demonstrate that the solution is one that will be used correctly and widely enough for it to solve the stated problem.
- Participate in the subsequent design discussions, considering all the proposals carefully. Typically at this step the original design gets thrown out and a significantly better design is developed, informed by the previous research, new research, and implementation and author experience with experimental implementations. Sometimes, the idea is abandoned at this stage.
If the idea survives the above design process, the spec will be eventually updated to reflect the new design. Implementations will then be updated to reflect the new design (if they aren't, that indicates the new design is not good, and it will be reworked or removed). The spec will be updated to fix the many problems discovered by authors and implementors, over a period of several years, as more authors and implementors are exposed to the design. Eventually, a number of provably interoperable implementations are deployed. At this point development of the feature is somewhat frozen.
Writing a comprehensive test suite is also an important step, which should start a bit before implementations start being written to the spec. (Test suites usually find as many problems with implementations as they do with the spec; they aren't just for finding browser bugs.) We don't yet have a good story with respect to test suites, sadly. If you want to help us out, let the mailing list know! Be aware, though, it's a lot of work.
What does "Living Standard" mean?
The WHATWG specifications are described as Living Standards. This means that they are standards that are continuously updated as they receive feedback, either from Web designers, browser vendors, tool vendors, or indeed any other interested party. It also means that new features get added to them over time, at a rate intended to keep the specifications a little ahead of the implementations but not so far ahead that the implementations give up.
Despite the continuous maintenance, or maybe we should say as part of the continuing maintenance, a significant effort is placed on getting the specifications and the implementations to converge — the parts of the specification that are mature and stable are not changed willy nilly. Maintenance means that the days where the specifications are brought down from the mountain and remain forever locked, even if it turns out that all the browsers do something else, or even if it turns out that the specification left some detail out and the browsers all disagree on how to implement it, are gone. Instead, we now make sure to update the specifications to be detailed enough that all the implementations (not just browsers, of course) can do the same thing. Instead of ignoring what the browsers do, we fix the spec to match what the browsers do. Instead of leaving the specification ambiguous, we fix the the specification to define how things work.
“Living specification” sounds like a draft that may and will change at any moment and is probably not even complete at any moment of time...
That's exactly what it is. However, the specification does not change arbitrarily: we are extremely careful! As parts of the specification mature, and implementations ship, the spec cannot be changed in backwards-incompatible ways (because the implementors would never agree to break compat unless for security reasons). The specification is never complete, since the Web is continuously evolving. The last time HTML was described as "complete" was after HTML4, when development stopped for several years, leading to stagnation. (If the Web is replaced by something better and dies, the HTML spec will die with it.)
You can see which parts of the spec are stable and which are not from the status annotations in the left margin.
Don’t browsers need a target to work their implementations towards, even if it’s a snapshot that is essentially arbitrary?
In practice, implementations all followed the latest specs draft anyway, not the latest snapshots. The problem with following a snapshot is that you end up following something that is known to be wrong. That's obviously not the way to get interoperability! This has in fact been a real problem at the W3C, where mistakes are found and fixed in the editors' drafts of specifications, but implementors who aren't fully engaged in the process go and implement obsolete snapshots instead, including those bugs, without realising the problems, and resulting in differences between the browsers.
When will it be safe to attempt to implement the spec based solely on the formal specification statements in the spec?
It's never truly safe; for example, if you tried to implement HTML4 according to the HTML4 specification you wouldn't have an implementation compatible with HTML4-era documents. However, if you're able to deal with minor changes, like security updates, errata-level changes, etc, then you can see which parts of the spec are stable and which are not from the status annotations in the left margin.
In general, though, we would strongly recommend taking part in the development effort. There's a mailing list for implementors which can help.
How do we know what to use, without having some sort of snapshot that browsers can aim at and developers can evaluate?
The same way you do with snapshots. Browser vendors don't look at the last snapshot, they look at the ever-progressing latest text anyway.
No browser ever implemented all of HTML4, for example, even in the years after it was a formal Recommendation. Nor did they wait til they had done all of HTML3.2 before working on implementing HTML4. They all picked and chose the bits they thought were useful. With the Living Standard approach, we can also update the specification at the same time to remove the bits they all agree are useless, and to add new features that they think we should add (before they go off and invent their own solutions!).
Isn’t the whole point of a specification to establish fixed point of reference so that all parties implementing the standard can ensure they have a common baseline of compatibility?
No, the point of a specification is to provide an accurate description of what all the parties should implement. When an error is found in this description, it's better to fix it than to leave it.
HTML4 provides an example of this. HTML4 says the default value for the "media" attribute is "screen", even though it was long ago realised that this made no sense and the default should be "all". The browsers all implement it as "all". A snapshot with a known bug is not as useful as a living standard.
The large Web industry with many browsers and even more producers of web pages needs to evolve in reasonably consistent steps for ubiquity and interoperability, so we need snapshots
It's true that "the large Web industry with many browsers and even more producers of web pages needs to evolve in reasonably consistent steps for ubiquity and interoperability". However, unchanging snapshots of specifications do nothing to help with this. The implementations usually follow the drafts, not the snapshots, and in the exceptions where they don't, they end up failing to interoperate.
Consider what would happen if a Web browser vendor decided to implement HTML4 instead of the latest state of the HTML Living Standard. That vendor would have <link> elements with the wrong media="" attribute default, which would break printing of most of the Web. That vendor would misparse <p><table>, which would result in blank lines in numerous unexpected places. That vendor would find that pages that styled empty paragraphs would fail to render as expected. That vendor would find that millions of pages would be unparseable due to not assuming a default encoding. That vendor would find that 0.2% of pages were missing images due to HTML4 not requiring the <image>/<img> aliasing. That vendor would, in short, find that the spec was not an accurate description of the Web, and would either fail in the market place (due to lack of interoperability), or would go seeking the latest spec, the living standard, which would dramatically improve their interoperability with legacy content and existing browsers.
Snapshots harm interoperability, they don't help it.
How about support in browsers for previous versions of this “living” HTML standard?
Browsers only need to implement the latest spec, and they will be compatible with the bulk of legacy content. That is an underlying principle of the entire WHATWG effort.
To clarify, browsers today don't implement separate modes for HTML2, HTML3.2, and HTML4. They just implement one version of HTML, and it works with everything (we call this "backwards compatibility"). This is the same model followed by the HTML specification; that's why it defines the browser requirements for lots of old features that aren't allowed anymore. For example, the "font" element is no longer conforming (authors aren't supposed to use it in their pages), but the spec still defines how it works, so that old pages keep working.
Will future browsers have any idea what older HTML documents mean?
Browsers do not implement HTML+, HTML2, HTML3.2 HTML4, HTML4.01, etc, as separate versions. They all just have a single implementation that covers all these versions at once. That is what the WHATWG HTML specification defines: how to write a browser (or other implementation) that handles all previous versions of HTML, as well as all the latest features.
One of the main goals of the HTML specification and the WHATWG effort as a whole is to make it possible for archeologists hundreds of years from now to write a browser and view HTML content, regardless of when it was written. Making sure that we handle all documents is one of our most important goals. Not having versions does not preclude this.
This means you will only able to add to a spec, not redefine it.
Yes. That's been a guiding principle for the WHATWG since its founding. It's even in our charter.
How can web developers know which features are safe to use?
Browsers can currently say they implement HTML 4.01 and most know what to expect.
Actually, that really isn't what happens in practice. Browsers do not implement specifications atomically, one spec at a time. They pick and chose features from the specs as they see fit. For example, back in the day, browsers implemented the absolute positioning parts of CSS2, but not 'display:run-in', but they still claimed to implement CSS2, and they already had parts of CSS3 implemented too, but not any part of a complete CSS3 module. Browsers claim to implement HTML4, but didn't implement all of it. Browsers moved on to HTML4 features before they had done all of HTML 3.2. And so on.
Plus, there's the problem of bugs. Different browsers have different bugs, and nothing in the spec's version can tell you what bugs the browser has.
Thus, in practice, you really can't tell what is implemented based on what version of what spec the vendor's marketing department claims to support. So not having a version number doesn't hurt. If anything, it helps, by removing a potentially bogus point of comparison — it means you have to compare browsers on what they really do (with a test suite), not on what version they claim to support.
How are developers to determine when certain parts of their pages will become invalid?
It shouldn't matter if and when old pages become invalid.
Validity (more often referred to as document conformance in the WHATWG) is a quality assurance tool to help authors avoid mistakes. We don't make things non-conforming (invalid) for the sake of it, we use conformance as a guide for developers to help them avoid bad practices or mistakes (like typos). So there's not really any need to worry about whether old pages are conforming or not, it's only helpful when you're writing a new page, and it's always most helpful to have the latest advice. It wouldn't be useful to check for compliance against last week's rules, for instance. After all, we fixed mistakes in those rules this week!
How will anything be deprecated and removed if there are no version numbers?
Not having version numbers doesn't stop us from removing features. We do that regularly, as described above in "Is there a process for removing bad ideas from a specification?". See also the "obsolete features" section in the HTML standard: http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html
Will HTML become a bloated unimplementable mess as old features pile up if there are no version numbers?
No. We endeavour to not make HTML unimplementable — if it can't be implemented, there's not much point having a spec! Indeed, making HTML implementable is the main goal of the specification. Certainly HTML will continue to become complicated over time, but that is unrelated to whether we have version numbers or not.
Will HTML become an unusable mess as features are removed and old valid documents suddenly become invalid, if there are no version numbers?
Features being invalid doesn't make them stop working — browsers are required to support old features. Even things like "inindex", framesets, "font", and so forth are still defined in the HTML specification, even though they're not to be used by authors. Old documents become invalid all the time, for example HTML 3.2 documents that use the "font" element were not valid HTML4 Strict documents, since it made "font" invalid (for good reasons, e.g. it tends to lead to authoring practices that harm accessibility). So even if we continue to make certain features invalid, it does not make HTML an "unusable mess".
If you do not publish snapshots every now and again, you are Orwellian in your recognition of the role the mistakes of the past play into the present and the future.
No really, someone said that on our blog.
The specification text is kept in version control and not forgotten; in fact, version control archeology is often used as part of the spec's development to figure out when things changed, why they changed, and so forth. This is significantly more helpful than arbitrarily dated snapshots, which in practice aren't studied in the same way since they don't give as detailed an answer. With version control, you can narrow down changes to discussions that happened on a particular day or even hour, with snapshots you are often limited to a resolution of months or years, depending on how often you publish the snapshots.
You can see the version control repository for the WHATWG specifications at http://html5.org/tools/web-apps-tracker (Web interface) or http://svn.whatwg.org/webapps/ (SVN interface). Every revision, however minor, is checked in separately. As of the time of this writing (January 2011), the repository has over 5700 revisions already.
(Another way of looking at it is that we have a new snapshot with every change! Publish early, publish often, as they say.)
What is HTML5?
HTML is the main focus of the WHATWG community. HTML5 is a snapshot of HTML, which is being worked on by the WHATWG community and also the W3C HTML Working Group.
HTML5 is a new version of HTML4, XHTML1, and DOM Level 2 HTML addressing many of the issues of those specifications while at the same time enhancing (X)HTML to more adequately address Web applications. Besides defining a markup language that can be written in both HTML and XML (XHTML) it also defines many APIs that form the basis of the Web architecture. Some of these APIs were known as "DOM Level 0" and were never documented before. Yet they are extremely important for browser vendors to support existing Web content and for authors to be able to build Web applications.
Going forward, the WHATWG is just working on "HTML", without worrying about version numbers. When people talk about HTML5 in the context of the WHATWG, they usually mean just "the latest work on HTML", not necessarily a specific version. For more details, see the section called "Is this HTML5?" in the specification.
How can I keep track of changes to the spec?
There are a number of ways to track changes to the spec.
- The Twitter feed: http://twitter.com/WHATWG
- You may use the online HTML5 Tracker. The tool provides an online interface for selecting and comparing revisions of the spec.
- There is a commit-watchers mailing list that is notified of every edit: http://lists.whatwg.org/listinfo.cgi/commit-watchers-whatwg.org
- The specification is available in the subversion repository. You may use any SVN client to check out the latest version and use your clients diff tools in order compare revisions and see what has been changed.
- At a broader level, Anne is maintaining a document that gives a high-level overview of changes to HTML over the last decade or so, as well as occasionally listing changes between versions a few months apart: http://dev.w3.org/html5/html4-differences/
- The W3C provide a Web view of their CVS mirror of the HTML5 spec: http://dev.w3.org/cvsweb/html5/spec/Overview.html
- The W3C provide diff-marked HTML versions for each change that affect the W3C copy of the spec by e-mail: http://lists.w3.org/Archives/Public/public-html-diffs/latest
What are the various versions of the spec?
The W3C HTML5 specification is a subset of the WHATWG HTML standard, containing only some of the more stable features.
The following table lists in the individual specifications included:
(and sections therein)
|Section links for
Web Applications 1.0
|HTML5 only (excluding newer features)||n/a||n/a||Single-page, multi-page (HTML WG)|
|HTML (including newer features)||WHATWG HTML||Everything not listed below!|
|Microdata||In WHATWG HTML||Microdata||Microdata (HTML WG)|
|Canvas 2D Context||In WHATWG HTML||2D Context||2D Context (HTML WG)|
|Communications - Cross-document messaging||In WHATWG HTML||Cross-document messaging||HTML5 Web Messaging (HTML WG)|
|Communications - Channel messaging||In WHATWG HTML||Channel messaging|
|Web Workers||only in WA1||Web Workers||Web Workers (WebApps WG)|
|Web Storage||only in WA1||Web Storage||Web Storage (WebApps WG)|
|Web Sockets API||only in WA1||Web Sockets API||Web Sockets API (WebApps WG)|
|Server-Sent Events||only in WA1||Server-sent Events||Server-sent Events (WebApps WG)|
|WebVTT||In WHATWG HTML and informally as WebVTT||WebVTT|
|WebRTC||Informally as WebRTC||WebRTC|
Web SQL Database no longer exists, and the Web Socket Protocol specification is now done entirely by the IETF.
All of the above are generated from one source document.
Not yet, but check back soon, we're working on this.
In the meantime, the WHATWG HTML specification (including the multipage version) can be customized to either hide or emphasize user-agent-specific material. The mode can be selected using radio buttons at the top right of those documents.
It is also possible to toggle the mode by changing the URL, here is an example for the multipage WHATWG HTML specification:
- As a normal spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/?style=complete
- Author view (hiding the user-agent-specific material): http://www.whatwg.org/specs/web-apps/current-work/multipage/?style=author
- Implementor view (highlighting the user-agent-specific material): http://www.whatwg.org/specs/web-apps/current-work/multipage/?style=highlight
When will we be able to start using these new features?
You can use some of them now. Others might take a few more years to get widely implemented. Here are some sites to help you work out what you can use:
If you know of any more (or if you have some yourself) then add them to the list! If there are some on the list that aren't very useful compared to the rest, then remove them!
When will HTML5 be finished?
The WHATWG is no longer working specifically on HTML5, so this question is no longer really pertinent. See above, under "What is HTML5?". The real question is, when can you use new features? For an answer to 'that' question, see "When will we be able to start using these new features?".
Different parts of the specification are at different maturity levels. Some sections are already relatively stable and there are implementations that are already quite close to completion, and those features can be used today (e.g. <canvas>). But other sections are still being actively worked on and changed regularly, or not even written yet.
You can see annotations in the margins showing the estimated stability of each section.
The possible states are:
- Idea; yet to be specified -- the section is a placeholder.
- First draft -- An early stage.
- Working draft -- An early stage, but more mature than just "first draft".
- Last call for comments -- The section is nearly done, but there may be feedback still to be processed. Send feedback sooner rather than later, or it might be too late.
- Awaiting implementation feedback -- The section is basically done, but might change in response to feedback from implementors. Major changes are unlikely past this point unless it is found that the feature, as specified, really doesn't work well.
- Implemented and widely deployed -- the feature is specified and complete. Once a section is interoperably implemented, it’s quite stable and unlikely to change significantly. Any changes to such a section would most likely only be editorial in nature, particularly if the feature is already in widespread use.
There are also two special states:
- Being edited right now -- the section is in high flux and is actively being edited. Contact Hixie on IRC if you have immediate feedback. (This state is not used often.)
- Being considered for removal -- for one reason or another, the section is being considered for removal. Send feedback soon to help with the decision.
The point to all this is that you shouldn’t place too much weight on the status of the specification as a whole. You need to consider the stability and maturity level of each section individually.
What's this I hear about 2022?
Before the WHATWG transitioned to an unversioned model for HTML, when we were still working on HTML5 and still thought in terms of snapshot drafts reaching milestones as a whole rather than on a per-section basis, the editor estimated that we'd reach Last Call in October 2009, Candidate Recommendation in the year 2012, and Recommendation in the year 2022 or later. This would be approximately 18-20 years of development, since beginning in mid-2004, which is on par with the amount of work that other specs of similar size and similar maturity receive to get to the same level of quality. For instance, it's in line with the timeline of CSS2/2.1. Compared to HTML4's timetable it may seem long, but consider: work on HTML4 started in the mid 90s, and HTML4 still, more than ten years later, hasn't reached the level that we want to reach with HTML5. There is no real test suite, there are many parts of the spec that are lacking real implementations, there are big parts that aren't interoperable, and the spec has hundreds if not thousands of known errors that haven't been fixed. When HTML4 came out, REC meant something much less exciting than it does now. For a spec to become a REC today, it requires two 100% complete and fully interoperable implementations, which is proven by each successfully passing literally thousands of test cases (20,000 tests for the whole spec would probably be a conservative estimate). When you consider how long it takes to write that many test cases and how long it takes to implement each feature, you’ll begin to understand why the time frame seems so long.
Now that we've moved to a more incremental model without macro-level milestones, the 2022 date is no longer relevant.
What about Microsoft and Internet Explorer?
Microsoft has already started implementing parts of HTML5 in IE8 and is adding more to IE9.
Is design rationale documented?
Sort of. Often the documentation can be found in the mailing list or IRC channel archives. Sometimes an issue was raised formally, and resolution is recorded in the issue tracker. Sometimes, there is an explanation in the specification, but doing that everywhere would make the specification huge.
For a few cases that someone did take the time document, the information can be found at the following locations:
- Rationale — a page that documents some reasons behind decisions in the spec, originally written and maintained by Variable. If anyone wants to help him out, try to grab someone on IRC (e.g. Hixie), we're always looking for more contributors and this is a good place to start.
- Why no namespaces
- Why no script implements
- Why not reuse legend or another mini-header element.
Also see HTML feature proposals below.
HTML syntax issues
Will HTML finally put an end to the XHTML as
Yes. Unlike HTML4 and XHTML1, the choice of HTML or XHTML is solely dependent upon the choice of the media type, rather than the DOCTYPE. See HTML vs. XHTML
What will the DOCTYPE be?
In XHTML: no DOCTYPE is required and its use is generally unnecessary. However, you may use one if you want (see the following question). Note that the above is well-formed XML and so it may also appear in XHTML documents.
For compatibility with legacy producers designed for outputting HTML, but which are unable to easily output the above DOCTYPE, this alternative legacy-compat version may be used instead.
<!DOCTYPE html SYSTEM "about:legacy-compat">
Note that this is not intended for dealing with any compatibility issues with legacy browsers. It is meant for legacy authoring tools only.
Excluding the string
"about:legacy-compat", the DOCTYPE is case insensitive in HTML. In XHTML, it is case sensitive and must be either of the two variants given above. For this reason, the DOCTYPEs given above are recommended to be used over other case variants, such as
<!DOCTYPE HTML> or
These alternatives were chosen because they meet the following criteria:
- They trigger standards mode in all current and all relevant legacy browsers.
- They are well-formed in XML and can appear in XHTML documents.
- It is possible to output at least one of the alternatives, if not both, with extant markup generators.
- They intentionally contain no language version identifier so the DOCTYPE will remain usable for all future revisions of HTML.
- The first is short and memorable to encourage its use.
- The legacy-compat DOCTYPE is intentionally unattractive and self descriptive of purpose to discourage unnecessary use.
Under what conditions should a DOCTYPE be used in XHTML?
Generally, the use of a DOCTYPE in XHTML is unnecessary. However, there are cases where inclusion of a DOCTYPE is a reasonable thing to do:
- The document is intended to be a polyglot document that may be served as both HTML or XHTML.
- You wish to declare entity references for use within the document. Note that most browsers only read the internal subset and do not retrieve external entities. (This is not compatible with HTML, and thus not suitable for polyglot documents.)
- You wish to use a custom DTD for DTD-based validation. But take note of what's wrong with DTDs.
Fundamentally, this is an XML issue, and is not specific to XHTML.
How are documents from HTML4 and earlier versions parsed?
All documents with a text/html media type (that is, including those without or with an HTML 2.0, HTML 3.2, HTML4, or XHTML1 DOCTYPE) will be parsed using the same parser algorithm as defined by the HTML spec. This matches what Web browsers have done for HTML documents so far and keeps code complexity down. That in turn is good for security, maintainability, and in general keeping the amount of bugs down. The HTML syntax as now defined therefore does not require a new parser and documents with an HTML4 DOCTYPE for example will be parsed as described by the new HTML specification.
Validators are allowed to have different code paths for previous levels of HTML.
If there is no DTD, how can I validate my page?
With an HTML validator that follows the latest specification.
What is an HTML Serialization?
The HTML serialization refers to the syntax of an HTML document defined in the HTML specification. The syntax is inspired by the SGML syntax from earlier versions of HTML, bits of XML (e.g. allowing a trailing slash on void elements, xmlns attributes), and reality of deployed content on the Web.
Any document whose MIME type is determined to be
text/html is considered to be an HTML serialization and must be parsed using an HTML parser.
What is an XML (or XHTML) Serialization?
The XML Serialization refers to the syntax defined by XML 1.0 and Namespaces in XML 1.0. A resource that has an XML MIME type, such as
application/xml, is an XML document and if it uses elements in the HTML namespace, it contains XHTML. If the root element is “html” in the HTML namespace, the document is referred to as an XHTML document.
What MIME type does HTML use?
The HTML serialization must be served using the
text/html MIME type.
The XHTML serialization must be served using an XML MIME type, such as
application/xml. Unlike the situation as of XHTML1, the HTML specification says that XHTML must no longer be served as
Using the incorrect MIME type (
text/html) for XHTML will cause the document to be parsed according to parsing requirements for HTML. In other words, it will be treated as tag soup. Ensuring the use of an XML MIME type is the only way to ensure that browsers handle the document as XML.
Should I close empty elements with
Void elements in HTML (e.g. the
input elements) do not require a trailing slash. e.g. Instead of writing
<br />, you only need to write
<br>. This is the same as in HTML4. However, due to the widespread attempts to use XHTML1, there are a significant number of pages using the trailing slash. Because of this, the trailing slash syntax has been permitted on void elements in HTML in order to ease migration from XHTML1 back to HTML.
The new HTML specification also introduces the ability to embed MathML elements. On elements inside a
math element the trailing slash works just like it does in XML. I.e. it closes the element. This is only inside that context however, it does not work for normal HTML elements.
If I’m careful with the syntax I use in my HTML document, can I process it with an XML parser?
A word of warning though. You have to be really careful for this to work, and it's almost certainly not worth it. You'd be better off just using an HTML-to-XML parser. That way you can just use HTML normally while still using XML pipeline tools.
What is the namespace declaration?
In XHTML, you are required to specify the namespace.
In HTML, the
xmlns attribute is currently allowed on any HTML element, but only if it has the value “
http://www.w3.org/1999/xhtml“. It doesn’t do anything at all, it is merely allowed to ease migration from XHTML1. It is not actually a namespace declaration in HTML, because HTML doesn’t yet support namespaces. See the question will there be support for namespaces in HTML.
Will there be support for namespaces in HTML?
HTML is being defined in terms of the DOM and during parsing of a text/html all HTML elements will be automatically put in the HTML namespace,
http://www.w3.org/1999/xhtml. However, unlike the XHTML serialization, there is no real namespace syntax available in the HTML serialization (see previous question). In other words, you do not need to declare the namespace in your HTML markup, as you do in XHTML. However, you are permitted to put an
xmlns attribute on each HTML element as long as the namespace is
In addition, the HTML syntax provides for a way to embed elements from MathML and SVG. Elements placed inside the container element
svg will automatically be put in the MathML namespace or the SVG namespace, respectively, by the parser. Namespace syntax is not required, but again an
xmlns attribute is allowed if its value is the right namespace.
In conclusion, while HTML does not allow the XML namespace syntax, there is a way to embed MathML and SVG and the xmlns attribute can be used on any element under the given constraints, in a way that is reasonably compatible on the DOM level.
How do I specify the character encoding?
For HTML, it is strongly recommended that you specify the encoding using the HTTP
Content-Type header. If you are unable to configure your server to send the correct headers, then you may use the
The following restrictions apply to character encoding declarations:
- The character encoding name given must be the name of the character encoding used to serialize the file.
- The value must be a valid character encoding name, and must be the preferred name for that encoding.
- The character encoding declaration must be serialized without the use of character references or character escapes of any kind.
metaelement used for this purpose must occur within the first 512 bytes of the file. It is considered good practice for this to be the first child of the
headelement so that it is as close to the beginning of the file as possible.
Note that this
meta element is different from HTML 4, though it is compatible with many browsers because of the way encoding detection has been implemented.
For polyglot documents, which may be served as either HTML or XHTML, you may also include that in XHTML documents, but only if the encoding is "UTF-8".
To ease transition from HTML4 to the latest HTML specification, although the former is the recommended syntax, you may also use the following. (This does not apply to XHTML or polyglot documents)
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
In XHTML, XML rules for determining the character encoding apply. The meta element is never used for determining the encoding of an XHTML document (although it may appear in UTF-8 encoded XHTML documents). You should use either the HTTP
Content-Type header or the XML declaration to specify the encoding.
<?xml version="1.0" encoding="UTF-8"?>
Otherwise, you must use the default of
UTF-16. It is recommended that you use
What are the differences between HTML and XHTML?
See the list of differences between HTML and XHTML in the wiki.
What are best practices to be compatible with HTML DOM and XHTML DOM?
Though the intent is that HTML and XHTML can both produce identical DOMs, there still are some differences between working with an HTML DOM and an XHTML one.
Case sensitivity :
- Whenever possible, avoid testing Element.tagName and Node.nodeName (or do toLowerCase() before testing).
- Use the namespace-aware version for creating elements: Document.createElementNS(ns, elementName)
Why does this new HTML spec legitimise tag soup?
Actually it doesn’t. This is a misconception that comes from the confusion between conformance requirements for documents, and the requirements for user agents.
Due to the fundamental design principle of supporting existing content, the spec must define how to handle all HTML, regardless of whether documents are conforming or not. Therefore, the spec defines (or will define) precisely how to handle and recover from erroneous markup, much of which would be considered tag soup.
For example, the spec defines algorithms for dealing with syntax errors such as incorrectly nested tags, which will ensure that a well structured DOM tree can be produced.
Defining that is essential for one day achieving interoperability between browsers and reducing the dependence upon reverse engineering each other.
However, the conformance requirements for authors are defined separately from the processing requirements. Just because browsers are required to handle erroneous content, it does not make such markup conforming.
For example, user agents will be required to support the marquee element, but authors must not use the marquee element in conforming documents.
It is important to make the distinction between the rules that apply to user agents and the rules that apply to authors for producing conforming documents. They are completely orthogonal.
HTML feature proposals
HTML should support
href on any element!
The spec allows <a> to contain blocks. It doesn't support putting href="" on any element, though.
href on any element has several problems associated with it that make it difficult to support in HTML. The main reason this isn't in HTML is that browser vendors have reported that implementing it would be extremely complex. Browser vendors get to decide what they implement, and there's no point to us telling them to do something they aren't going to do. In addition:
- It isn’t backwards compatible with existing browsers.
- It adds no new functionality that can’t already be achieved using the
aelement and a little script.
- It doesn’t make sense for all elements, such as interactive elements like
button, where the use of href would interfere with their normal function.
The only advantage it seems to add is that it reduces typing for authors in some cases, but that is not a strong enough reason to support it in light of the other reasons.
Wrapping <a> elements around blocks solves most use cases. It doesn't handle making rows in tables into links, though; for those just do something like this instead:
<tr onclick="location = this.getElementsByTagName('a')"> ... </tr>
HTML should support list headers!
You can give a header to a list using the <figure> and <figcaption> elements:
<figure> <figcaption>Apples</figcaption> <ul> <li>Granny Smith</li> <li>Evil Apple of Knowledge</li> <li>Apple, Inc</li> </ul> </figure>
You can also label a group of lists using a definition list:
<dl> <dt>Dry:</dt> <dd> <ul> <li>1c flour</li> <li>1/4c sugar</li> <li>1tsp baking soda</li> </ul> </dd> <dt>Wet:</dt> <dd> <ul> <li>1 egg </li> <li>1/2c milk</li> <li>1tsp vanilla extract</li> </ul> </dd> </dl>
These techniques are preferred over adding an <lh> element as proposed in the old HTML3 draft, mostly because of thorny issues with parsing near <li> elements.
HTML should support a way for anyone to invent new elements!
There are actually quite a number of ways for people to invent their own extensions to HTML:
- Authors can use the class attribute to extend elements, effectively creating their own elements, while using the most applicable existing "real" HTML element, so that browsers and other tools that don't know of the extension can still support it somewhat well. This is the tack used by Microformats, for example.
- Authors can include data for scripts to process using the data-*="" attributes. These are guaranteed to never be touched by browsers, and allow scripts to include data on HTML elements that scripts can then look for and process.
- Authors can use the <meta name="" content=""> mechanism to include page-wide metadata. Names should be registered on the wiki's MetaExtensions page.
- Authors can use the rel="" mechanism to annotate links with specific meanings. This is also used by Microformats. Names should be registered on the wiki's RelExtensions page.
- Authors can embed raw data using the <script type=""> mechanism with a custom type, for further handling by a script.
- Authors can create plugins and invoke them using the <embed> element. This is how Flash works.
- Authors can extend APIs using the JS prototyping mechanism. This is widely used by script libraries, for instance.
- Authors can use the microdata feature (the item="" and itemprop="" attributes) to embed nested name-value pairs of data to be shared with other applications and sites.
- Authors can propose new elements and attributes to the working group and, if the wider community agrees that they are worth the effort, they are added to the language. (If an addition is urgent, please let us know when proposing it, and we will try to address it quickly.)
There is currently no mechanism for introducing new proprietary features in HTML documents (i.e. for introducing new elements and attributes) without discussing the extension with user agent vendors and the wider Web community. This is intentional; we don't want user agents inventing their own proprietary elements and attributes like in the "bad old days" without working with interested parties to make sure their feature is well designed.
We request that people not invent new elements and attributes to add to HTML without first contacting the working group and getting a proposal discussed with interested parties.
HTML should group <dt>s and <dd>s together in <di>s!
This is a styling problem and should be fixed in CSS. There's no reason to add a grouping element to HTML, as the semantics are already unambiguous.
There are multiple problems with adding something like <di>:
- It would require parsing changes. These are relatively expensive.
- It would have a poor backwards-compatibility story until the parsers were all updated.
- It would have a poor backwards-compatibility story with legacy code that handles <dl>s, since they're not expecting <di>s.
The cost just doesn't seem worth it, given that a CSS solution would also solve a bunch of other problems (like styling implied sections).
Why are some presentational elements like <b>, <i> and <small> still included?
The inclusion of these elements is a largely pragmatic decision based upon their widespread usage, and their usefulness for use cases which are not covered by more specific elements.
While there are a number of common use cases for italics which are covered by more specific elements, such as emphasis (em), citations (cite), definitions (dfn) and variables (var), there are many other use cases which are not covered well by these elements. For example, a taxonomic designation, a technical term, an idiomatic phrase from another language, a thought, or a ship name.
Similarly, although a number of common use cases for bold text are also covered by more specific elements such as strong emphasis (strong), headings (h1-h6) or table headers (th); there are others which are not, such as key words in a document abstract or product names in a review.
Some people argue that in such cases, the span element should be used with an appropriate class name and associated stylesheet. However, the b and i elements provide for a reasonable fallback styling in environments that don't support stylesheets or which do not render visually, such as screen readers, and they also provide some indication that the text is somehow distinct from its surrounding content.
In essence, they convey distinct, though non-specific, semantics, which are to be determined by the reader in the context of their use. In other words, although they don’t convey specific semantics by themselves, they indicate that that the content is somehow distinct from its surroundings and leaves the interpretation of the semantics up to the reader.
This is further explained in the article The <b> and <i> Elements
Similarly, the small element is defined for content that is commonly typographically rendered in small print, and which often referred to as fine print. This could include copyright statements, disclaimers and other legal text commonly found at the end of a document.
But they are PRESENTATIONAL!
The problem with elements like <font> isn't that they are presentational per se, it's that they are media-dependent (they apply to visual browsers but not to speech browsers). While <b>, <i> and <small> historically have been presentational, they are defined in a media-independent manner in HTML5. For example, <small> corresponds to the really quickly spoken part at the end of radio advertisements.
The <cite> element should allow names of people to be marked up
From what some have seen, <cite> is almost always used to mean "italics". More careful authors have used the element to mark up names and titles, and some people have gone out of their way to only mark up citations.
So, we can't really decide what the element should be based on past practice, like we usually do.
This leaves the question of what is the most useful use we can put the element to, if we keep it. The conclusion so far has been that the most useful use for <cite> is as an element to allow typographic control over titles, since those are often made italics, and that semantic is roughly close to what it meant in previous versions, and happens to match at least one of the common uses for the element. Generally, however, names and titles aren't typeset the same way, so making the element apply to both would lead to confusing typography.
There are already many ways of marking up names already (e.g. the hCard microformat, the microdata vCard vocabulary, <span> and class names, etc), if you really need it.
The <time> element should allow vague times ("March") and times from ancient history to be marked up
This has been discussed a number of times. For an overview of the topic, please see these e-mails:
At this stage, as discussed in the second of those e-mails, the best way forward is to demonstrate that there are communities interested in solving this problem, by using existing techniques such as microdata to address it. If such a solution achieves a high adoption rate, that will substantially increase the strength of the proposals.
(In the future, it is expected that the <time> element will be extended to support years and years+months, but this is awaiting implementation experience with what is already specified.)
<input type="text"> needs a minlength="" attribute
This has been discussed, but we are waiting for browsers to catch up with the many new form features before adding new ones like minlength="".
WHATWG and the W3C HTML WG
Are there plans to merge the groups?
No. There are people who for a number of reasons are unable to join the W3C group, and there are others who are unable to join the WHATWG group. The editor is in both groups and takes all input into account — and there are far more places where input on HTML5 is sent than just these two mailing lists (e.g. blogs, firstname.lastname@example.org, forums, direct mail, meetings, etc).
The editor takes feedback from everyone into account and does not look at the source of those arguments for technical arguments.
The W3C HTML Working Group has an escalation process that in some cases results in a decision being made that differs from the editor's original decision on a topic. So far, whenever this has happened the WHATWG has gone along with the W3C's request; nothing of especially big importance has been changed in this manner so far (it's mostly been editorial issues or mostly minor technical issues). In general the WHATWG will ensure that the normative content of the specifications (the requirements on authors and implementors) remains the same so long as the W3C group doesn't demonstrate any serious lapses in judgement.
What is the history of HTML?
Here are some documents that detail the history of HTML:
Do you have any hints on how to use <section> and <article> and so on?
Some hopefully helpful hints:
- One way to look at it is how would you draw the page outline/table-of-contents? Each entry in the table of contents should be a <section>/<article>/<aside>/<nav>, and if it's not in the table of contents and doesn't have an