A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on Chat (such as one of these permanent autoconfirmed members).

FAQ: Difference between revisions

From WHATWG Wiki
Jump to navigation Jump to search
(Replaced content with "{{moved|the [https://whatwg.org/faq WHATWG FAQ], the [https://github.com/whatwg/html/blob/master/FAQ.md HTML Standard FAQ], and the [https://whatwg.org/mailing-list WHATWG...")
 
(170 intermediate revisions by 23 users not shown)
Line 1: Line 1:
== The WHATWG ==
{{moved|the [https://whatwg.org/faq WHATWG FAQ], the [https://github.com/whatwg/html/blob/master/FAQ.md HTML Standard FAQ], and the [https://whatwg.org/mailing-list WHATWG Mailing List] page.}}
 
=== 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 HTML5. The WHATWG also works on Web Workers 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 [http://www.w3.org/TR/xbl/ 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 [http://whatwg.org/mailing-list mailing lists]. You may also [http://blog.whatwg.org/w3c-restarts-html-effort 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 [http://www.whatwg.org/mailing-list#specs the mailing list]. The editor then reads that [http://www.whatwg.org/issues/ 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 [http://www.whatwg.org/charter 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 [email protected] (but you have to [http://whatwg.org/mailing-list#specs join the mailing list] first), or [email protected]. 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 ([email protected]), 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.
 
* On a regular basis, especially around explicit call-for-comments, 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 of 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. 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.
 
== HTML5 ==
 
=== What is HTML5? ===
 
[http://www.whatwg.org/specs/web-apps/current-work/ HTML5] is the main focus of the WHATWG community and also that of 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 (HTML5) and XML (XHTML5) 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.
 
=== How can I keep track of changes to the spec? ===
 
There are a number of ways to track changes to the spec.
 
* The specification is available in the [http://svn.whatwg.org/ 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.
 
* You may use the online [http://html5.org/tools/web-apps-tracker (X)HTML5 Tracking tool]. 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 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
 
* Non-editorial changes get broadcast on the WHATWG Twitter feed: http://twitter.com/WHATWG
 
* All changes that affect the W3C copy of the spec get broadcast on the HTML5 Twitter feed: http://twitter.com/HTML5
 
* The latest changes are visible in coloured diff form: http://whatwg.org/specs/web-apps/current-work/index-diff
 
 
=== What are the various versions of the spec? ===
 
The specs that the WHATWG works on are available in a variety of forms.
 
{| class="wikitable" border=1 cellpadding=3 cellspacing=0
|-
!
!WHATWG Specifications
(and sections therein)
!Web Applications 1.0
(giant one–page specification)
!W3C/IETF Specifications
|-
!Next-generation HTML (including HTML5)
|[http://www.whatwg.org/specs/web-apps/current-work/ WHATWG HTML Single-page]*
'''[http://whatwg.org/html WHATWG HTML Multi-page]'''*
 
PDF: [http://www.whatwg.org/specs/web-apps/current-work/html5-a4.pdf A4], [http://www.whatwg.org/specs/web-apps/current-work/html5-letter.pdf Letter]
|[http://www.whatwg.org/specs/web-apps/current-work/complete.html Web Applications 1.0 (complete)]
|
|-
!HTML5 only (excluding newer features)
|
|
|[http://dev.w3.org/html5/spec/Overview.html Single-page]*, [http://dev.w3.org/html5/spec/spec.html Multi-page] (HTMLWG)
|-
!Microdata
|[http://www.whatwg.org/specs/web-apps/current-work/#microdata in Single-page], [http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#microdata in Multi-page]
|[http://www.whatwg.org/specs/web-apps/current-work/complete.html#microdata in Web Apps 1.0]
|[http://dev.w3.org/html5/md/Overview.html Microdata] (HTMLWG)
|-
!2D Context
|[http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#the-2d-context in Single-page], [http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#the-2d-context in Multi-page]
|[http://www.whatwg.org/specs/web-apps/current-work/complete.html#the-2d-context in Web Apps 1.0]
|[http://dev.w3.org/html5/2dcontext/Overview.html 2D Context] (HTMLWG)
|-
!Communications - Cross-document messaging
|[http://www.whatwg.org/specs/web-apps/current-work/#crossDocumentMessages in Single-page], [http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages in Multi-page]
|[http://www.whatwg.org/specs/web-apps/current-work/complete.html#crossDocumentMessages in Web Apps 1.0]
|[http://dev.w3.org/html5/postmsg/Overview.html#crossDocumentMessages Communications] (HTMLWG)
|-
 
!Communications - Channel messaging
|[http://www.whatwg.org/specs/web-apps/current-work/#channel-messaging in Single-page], [http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#channel-messaging in Multi-page]
|[http://www.whatwg.org/specs/web-apps/current-work/complete.html#channel-messaging in Web Apps 1.0]
|[http://dev.w3.org/html5/postmsg/Overview.html#channel-messaging Communications] (HTMLWG)
|-
!Device Element
|[http://www.whatwg.org/specs/web-apps/current-work/#devices in Single-page], [http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#devices in Multi-page]
|[http://www.whatwg.org/specs/web-apps/current-work/complete.html#devices in Web Apps 1.0]
|[http://dev.w3.org/html5/html-device/ HTML Device] (HTMLWG)
|-
!Web Workers
|[http://whatwg.org/ww Web Workers specification]
|[http://www.whatwg.org/specs/web-apps/current-work/complete.html#workers in Web Apps 1.0]
|[http://dev.w3.org/html5/workers/Overview.html Web Workers] (WebApps WG)
|-
!Web Storage
|
|[http://www.whatwg.org/specs/web-apps/current-work/complete.html#webstorage in Web Apps 1.0]
|[http://dev.w3.org/html5/webstorage/ Web Storage] (WebApps WG)
|-
!Web Sockets API
|
|[http://www.whatwg.org/specs/web-apps/current-work/complete.html#network in Web Apps 1.0]
|[http://dev.w3.org/html5/websockets/ Web Sockets API] (WebApps WG)
|-
!Web Sockets Protocol
|
|[http://www.whatwg.org/specs/web-apps/current-work/complete.html#websocket-protocol in Web Apps 1.0]
|[http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol The Web Socket Protocol] (IETF)
|-
!Server-Sent Events
|
|[http://www.whatwg.org/specs/web-apps/current-work/complete.html#server-sent-events in Web Apps 1.0]
|[http://dev.w3.org/html5/eventsource/ Server-sent Events] (WebApps WG)
|-
!Web SQL Database (stalled)
|
|
|[http://dev.w3.org/html5/webdatabase/ Web SQL Database] (WebApps WG)
|-
|}
 
All of the above are generated from one [http://www.whatwg.org/specs/web-apps/current-work/source source document].
 
(*) Several of the specs above, marked with an asterisk, can further be viewed in three different ways, by toggling the radio buttons at the top right of those documents. Here are some shortcuts for viewing the multipage version of the HTML specification in these three different ways:
* As a normal spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/?style=complete
* Hiding all the user-agent-specific material ("author view"): http://www.whatwg.org/specs/web-apps/current-work/multipage/?style=author
* Highlighting all 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 that might help you work out what you can use in the meantime:
 
* http://diveintohtml5.org/
 
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, them remove them!
 
=== When will HTML5 be finished? ===
 
"Finished" is a big deal... You'll be able to use HTML5 long before then. See [[FAQ#When_will_we_be_able_to_start_using_these_new_features.3F|When will we be able to start using these new features?]]
 
It is estimated by the editor that HTML5 will reach the W3C Candidate Recommendation stage during 2012. That doesn't mean you can't start using it yet, though. 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.
* ''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.
 
It is estimated, again by the editor, that HTML5 will reach a W3C recommendation in the year 2022 or later. This will be approximately 18-20 years of development, since beginning in mid-2004. That's actually not that crazy, though. 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.
 
(In the interests of full disclosure, the W3C's [http://www.w3.org/2007/03/HTML-WG-charter.html#deliverables official line] is that the HTML5 spec will be complete, with interoperable implementations, in late 2010. However, that same timetable gave a date for First Public Working Draft that was eight months premature, and the W3C, as of the predicted date for the third milestone, Candidate Recommendation, had still not come anywhere near reaching the second milestone, Last Call. You can make your own judgements regarding the W3C timetable's credibility.)
 
=== What about Microsoft and Internet Explorer? ===
 
Microsoft has already started implementing parts of HTML5 in IE8.
 
HTML5 is being developed with compatibility with existing browsers in mind, though (including IE). Support for many features can be simulated using JavaScript.
 
=== 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:
 
* [[Why no namespaces]]
* [[Why no script implements]]
* [[Why not reuse legend]]—or another ''mini-header'' element.
 
Also see HTML5 feature proposals below.
 
== HTML5 syntax issues ==
 
=== Will HTML5 finally put an end to the XHTML as <code>text/html</code> debate? ===
 
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 HTML:
 
<code>&lt;!DOCTYPE html&gt;</code>
 
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.
 
<code>&lt;!DOCTYPE html SYSTEM "about:legacy-compat"&gt;</code>
 
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 <code>"about:legacy-compat"</code>, 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 <code>&lt;!DOCTYPE HTML&gt;</code> or <code>&lt;!doctype html&gt;</code>.
 
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 [http://about.validator.nu/#faq what's wrong with DTDs].
 
=== How are pre-HTML5 documents 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 HTML5. 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 of HTML5 therefore does not require a new parser and documents with an HTML4 DOCTYPE for example will be parsed using the HTML5 parser.
 
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 [http://validator.whatwg.org/ HTML5 validator].
 
=== What is an HTML Serialization? ===
 
The HTML serialization refers to the syntax of an HTML document defined in HTML5. 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 <code>text/html</code> 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 <code>application/xhtml+xml</code> or <code>application/xml</code>, is an XML document and if it uses elements in the HTML namespace, it contains XHTML. If the root element is &#8220;html&#8221; in the HTML namespace, the document is referred to as an XHTML document.
 
=== What MIME type does HTML5 use? ===
 
The HTML serialization ''must'' be served using the <code>text/html</code> MIME type.
 
The XHTML serialization ''must'' be served using an XML MIME type, such as <code>application/xhtml+xml</code> or <code>application/xml</code>. Unlike XHTML1, XHTML5 ''must not'' be served as <code>text/html</code>.
 
Using the incorrect MIME type (<code>text/html</code>) 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 <code>/&gt;</code> or <code>&gt;</code>? ===
 
Void elements in HTML (e.g. the <code>br</code>, <code>img</code> and <code>input</code> elements) do not require a trailing slash. e.g. Instead of writing <code>&lt;br /&gt;</code>, you only need to write <code>&lt;br&gt;</code>. 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 to HTML5.
 
HTML5 also introduces the ability to embed MathML elements. On elements inside a <code>math</code> 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&#8217;m careful with the syntax I use in my HTML document, can I process it with an XML parser? ===
 
No, HTML and XML have [[HTML_vs._XHTML#Differences_Between_HTML_and_XHTML|many significant differences]], particularly parsing requirements, and you cannot process one using tools designed for the other. However, since HTML5 is defined in terms of the DOM, in most cases there are both HTML and XHTML serializations available that can represent the same document. There are, however, a few differences explained later that make it impossible to represent some HTML documents accurately as XHTML and vice versa.
 
If you wish to process an HTML document as XHTML, it requires that you and convert it into XHTML first; and vice versa for processing XHTML as HTML.
 
=== What is the namespace declaration? ===
 
In XHTML, you are required to specify the [http://www.w3schools.com/xml/xml_namespaces.asp namespace.]
 
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
 
In HTML, the <code>xmlns</code> attribute is currently allowed on any HTML element, but only if it has the value &#8220;<code>http://www.w3.org/1999/xhtml</code>&#8220;. It doesn&#8217;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&#8217;t yet support namespaces.  See the question [[FAQ#Will_there_be_support_for_namespaces_in_HTML.3F|will there be support for namespaces in HTML]].
 
=== Will there be support for namespaces in HTML? ===
 
HTML5 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, <code>http://www.w3.org/1999/xhtml</code>. 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 <code>xmlns</code> attribute on each HTML element as long as the namespace is <code>http://www.w3.org/1999/xhtml</code>.
 
In addition, the HTML syntax provides for a way to embed elements from MathML and SVG. Elements placed inside the container element <code>math</code> or <code>svg</code> will automatically be put in the MathML namespace or the SVG namespace, respectively, by the parser. Namespace syntax is not required, but again an <code>xmlns</code> attribute is allowed if its value is the right namespace.
 
In conclusion, while HTML5 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 <code>Content-Type</code> header. If you are unable to [http://www.w3.org/International/O-HTTP-charset configure your server] to send the correct headers, then you may use the <code>meta</code> element:
 
&lt;meta charset="UTF-8"&gt;
 
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 [http://www.iana.org/assignments/character-sets 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.
* The <code>meta</code> element 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 <code>head</code> element so that it is as close to the beginning of the file as possible.
 
Note that this <code>meta</code> 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 HTML5, although the former is the recommended syntax, you may also use the following. (This does not apply to XHTML or polyglot documents)
 
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
 
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 <code>Content-Type</code> header or the XML declaration to specify the encoding.
 
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
 
Otherwise, you must use the default of <code>UTF-8</code> or <code>UTF-16</code>. It is recommended that you use <code>UTF-8</code>.
 
=== What are the differences between HTML and XHTML? ===
 
See the list of [[HTML vs. XHTML#Differences_Between_HTML_and_XHTML|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).
Namespaces:
* Use the namespace-aware version for creating elements: Document.createElementNS(ns, elementName)
 
=== Why does HTML5 legitimise tag soup? ===
 
Actually it doesn&#8217;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.
 
== HTML5 feature proposals ==
 
=== HTML5 should support <code>href</code> on any element! ===
 
The spec allows <a> to contain blocks. It doesn't support putting href="" on any element, though.
 
Supporting <code>href</code> on any element has several problems associated with it that make it difficult to support in HTML5. The main reason this isn't in HTML5 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&#8217;t backwards compatible with existing browsers.
* It adds no new functionality that can&#8217;t already be achieved using the <code>a</code> element and a little script.
* It doesn&#8217;t make sense for all elements, such as interactive elements like <code>input</code> and <code>button</code>, 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:
<pre>
<tr onclick="location = this.getElementsByTagName('a')[0]"> ... </tr>
</pre>
 
=== HTML5 should support list headers! ===
 
You can give a header to a list using the <figure> and <legend> elements:
 
<pre>
<figure>
  <legend>Apples</legend>
  <ul>
  <li>Granny Smith</li>
  <li>Evil Apple of Knowledge</li>
  <li>Apple, Inc</li>
  </ul>
</figure>
</pre>
 
You can also label a group of lists using a definition list:
 
<pre>
<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>
</pre>
 
These techniques are preferred over adding an <lh> element as proposed in the old HTML3 draft, mostly because of thorny issues with parsing near &lt;li> elements.
 
=== HTML5 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.
 
=== HTML5 should group &lt;dt>s and &lt;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.
 
=== Why are some presentational elements like &lt;b>, &lt;i> and &lt;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 <cite>[http://lachy.id.au/log/2007/05/b-and-i The &lt;b> and &lt;i> Elements]</cite>
 
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! ====
 
While &lt;b>, &lt;i> and &lt;small> historically have been presentational, they are defined in a media-independent manner in HTML5. For example, &lt;small> corresponds to the really quickly spoken part at the end of radio advertisements. The problem with elements like &lt;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).
 
=== The &lt;cite> element should allow names of people to be marked up ===
 
From what some have seen, &lt;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 &lt;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 [http://microformats.org/wiki/hcard hCard microformat], the microdata vCard vocabulary, &lt;span> and class names, etc), if you really need it.
 
<strong>Note:</strong> research and opinions are being gathered that support the use of the &lt;cite> element to markup the names of speakers (e.g. for quotations). Please contribute yours:
* [[Cite_element#examples_in_the_wild|cite element: examples in the wild of speakers marked up with cite]]
* [[Cite_element#opinions|cite element: opinions on use of cite to markup names of speakers]]
 
=== The &lt;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:
* http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-March/018888.html
* http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-August/021745.html
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.
 
== WHATWG and the W3C HTML WG ==
 
=== Are there plans to merge the groups? ===
 
Not especially. 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, [email protected], forums, direct mail, meetings, etc).
 
=== Which group has authority in the event of a dispute? ===
 
The editor takes feedback from everyone into account and does not look at the source of those arguments for technical arguments.
 
=== What is the history of HTML? ===
 
Here are some documents that detail the history of HTML:
* [http://esw.w3.org/topic/HTML/history HTML's timeline on the ESW wiki]
* [http://www.whatwg.org/specs/web-apps/current-work/multipage/introduction.html#history0 The history section in HTML5 itself]
 
== Web Workers ==
 
Besides HTML5 the WHATWG works on [http://www.whatwg.org/specs/web-workers/current-work/ Web Workers]. It does this together with the W3C WebApps Working Group.
 
== Mailing List ==
 
=== Should I top-post or reply inline? ===
 
Please reply inline or make the reply self-contained.
 
Basically, please remove anything after the last line you have written, so that people don't have to scroll down to find out what else you wrote, and make sure that your e-mail makes sense on its own, as it will probably be read out of context years later.
 
That is, you should reply like this:
 
<pre>
Ian wrote:
> What do you want?
 
I want cats!
 
> When do you want it?
 
Now!
</pre>
 
You should definitely not reply like this (because this requires people to read your e-mail backwards):
 
<pre class="error" >
No
 
Ian wrote:
> Is this a good example of how to post e-mails?
</pre>
 
You should also not reply like this (because this leaves people to wonder if there is any text lower down that you have written):
 
<pre class="error" >
This is a bad way to write e-mail.
 
Ian wrote:
> Is this a good way to write e-mail?
> Lorem ipsum foo bar baz.
> Unrelated other bits that aren't replied to.
> Yet more text
</pre>
 
You should also not reply like this (with no context at all), because the reader will not know what you are referring to:
 
<pre class="error" >
No, I think that's a bad idea. It wouldn't be good for the readers, for instance.
</pre>
 
Quote enough original text or provide an introduction yourself.
 
If you use Outlook or Outlook Express, you can use either [http://home.in.tum.de/~jain/software/outlook-quotefix/ Outlook-QuoteFix] or [http://home.in.tum.de/~jain/software/oe-quotefix/ OE-QuoteFix]. These plugins fix several of Outlook's problems with sending properly formatted emails.
H

Latest revision as of 17:34, 24 January 2018

This page has moved to the WHATWG FAQ, the HTML Standard FAQ, and the WHATWG Mailing List page.