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
(What does the acronym WHATWG stand for?)
(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...")
(325 intermediate revisions by 35 users not shown)
Line 1: Line 1:
== What is 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.}}
The 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 does the acronym WHATWG stand for? ==
== What is the WHATWG working on? ==
The WHATWG is working on HTML 5 (see below). In the past it has worked on Web Forms 2.0 and Web Controls 1.0 as well. Web Forms 2.0 (see below) has reached a stable stage and we're awaiting implementation experience. Web Controls 1.0 has been abandoned for now, awaiting what [http://www.w3.org/TR/xbl/ XBL 2.0] will bring us.
== What is HTML 5? ==
[http://www.whatwg.org/specs/web-apps/current-work/ HTML 5] is the main focus of the WHATWG community and also that of the (new) W3C HTML Working Group. HTML 5 is a new version of HTML 4.01 and XHTML 1.0 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. These APIs are known to some as "DOM Level 0" and have never been documented. Yet they are extremely important for browser vendors to support existing Web content and for authors to be able to build Web applications.
== What is Web Forms 2.0? ==
[http://www.whatwg.org/specs/web-forms/current-work/ Web Forms 2.0] is an update to the forms chapters of HTML 4.01 and XHTML 1.0. The specification is informally declared feature complete and the WHATWG is awaiting implementation experience. This specification will in due course be folded into the HTML 5 specification when HTML 5 reaches a more stable state.
== 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.
== Will (X)HTML 5 finally put an end the XHTML as <code>text/html</code> debate? ==
Yes. Unlike HTML 4.01 and XHTML 1.0, the choice of HTML or XHTML is solely dependent upon the choice of MIME type, rather than the DOCTYPE. See [[HTML vs. XHTML]]''
== What will the DOCTYPE be? ==
In HTML: <code>&lt;!doctype html&gt;</code>. The only reason there is one for HTML is to trigger standards mode in browsers.
In XHTML: no DOCTYPE. You may include one if you wish, though this is not recommended as they are only relevant when using a validating parser which web browsers do not have.
== If there is no DTD, how can I validate my page? ==
With an [http://validator.whatwg.org/ HTML 5 validator].
== What is an HTML Serialisation? ==
The HTML serialisation refers to the syntax of an HTML document defined in HTML5. The syntax is inspired by the SGML syntax from earlier versions of HTML, but it is defined to be more compatible with the way browsers actually handle HTML in reality.
Any document whose MIME type is determined to be <code>text/html</code> is considered to be an HTML serialisation, even if the author has tried to use XML syntax.
== What is an XML (or XHTML) Serialisation? ==
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 serialisation <em>must</em> be served using the <code>text/html</code> MIME type.
The XHTML serialisation <em>must</em> be served using an XML MIME type, such as <code>application/xhtml+xml</code> or <code>application/xml</code>. Unlike XHTML 1.0, XHTML 5 <em>must not</em> 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.
== What about Microsoft and Internet Explorer? ==
HTML 5 is being developed with IE compatibility in mind. Support for many features can be simulated using JavaScript.
== When will we be able to start using these new features? ==
As soon as browsers begin to support them. You do not need to wait till HTML5 becomes a recommendation, because that can&#8217;t happen until after the implementations are completely finished. [Need to expand on this answer]
== How can I keep track of 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 also use the online [http://html5.org/tools/web-apps-tracker (X)HTML5 Tracker Tool]. The tool provides an online interface for selecting and comparing revisions of the spec.
== When will HTML 5 be finished? ==
It is estimated 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.
For a spec to become a REC, 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&#8217;ll begin to understand why the time frame seems so long.
However, the WHATWG recognises and understands the problem with this: 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. &lt;canvas&gt;). But other sections are still being actively worked on and changed regularly, or not even written yet.
The details are still being worked out, but the plan is to indicate the maturity level on a per-section basis. Sections like the Link Types, which is relatively simple, isn&#8217;t going to take long to become interoperably implemented. In fact, Mozilla is already implementing the new autodiscovery features for Firefox 3.0, and it shouldn&#8217;t take long for places like Technorati, Bloglines, etc. to implement follow.
Once a section is interoperably implemented, it&#8217;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 (as autodiscovery already is today).
The point to all this is that you shouldn&#8217;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.
== Should I close empty elements with <code>/&gt;</code> or <code>&gt;</code>? ==
Void elements in HTML (the new name for empty 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 applies to all void elements, including <code>img</code>, <code>input</code>, etc.
However, due to the widespread attempts to use XHTML 1.0, there are a significant number of pages using the trailing slash. Because of this, the syntax has been permitted (though it is not recommended) in order to ease migration from XHTML 1.0 to HTML5.
It is important to realise that this syntax serves no purpose in HTML, it is just ignored by browsers. Despite the fact that it is based upon the XML syntax, it does not mean that HTML documents can be parsed with XML tools. HTML and XHTML are serparate serialisations and they each must be processed using tools designed to handle each format.
== 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 [#differences 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 serialisations 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 namespace. (need to find a simple explanation for what namespaces are for)
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
In HTML, the <code>xmlns</code> attribute is only allowed on the <code>html</code> element, and 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 XHTML 1.0. It is not actually a namespace declaration in HTML, because HTML doesn&#8217;t support namespaces.
== Will there be support for namespaces in HTML? ==
HTML 5 is being defined in terms of the DOM and all HTML elements will exist in the HTML namespace: <code>http://www.w3.org/1999/xhtml</code>. However, unlike the XHTML serialisation, there is no real namespace syntax available in the HTML serialisation (see previous question). In other words, you do not need to declare the namespace in your HTML markup, like you do in XHTML.
XHTML requires that the namespace to be declared appropriately using the <code>xmlns</code> attribute. The namespace declaration is unnecessary in HTML because browsers will already know it&#8217;s an HTML document based on the MIME type (<code>text/html</code>).
There have been proposals for introducing MathML markup into HTML, which would exist in the MathML namespace. However, if that proposal is accepted, it will be supported in a way that does not require explicit namespace declaration in the markup.
== 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. The <code>meta</code> element used for this purpose must occur as the first element in the head (even before the <code>title</code>), and within the first 512 bytes of the file.
&lt;meta charset="UTF-8"&gt;
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.
In XHTML, XML rules for determining the character encoding apply. You may 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.
== Does HTML5 support <code>href</code> on any element like XHTML 2.0? ==
No, supporting <code>href</code> on any element has several problems associated with it that make it difficult to support in HTML5.
* 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.
* 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.
* Browser vendors have reported that implementing it would be extremely complex.
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.
== 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 misnested 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 produce conforming documents. They are completely orthogonal.
== What are &#8220;Web Applications&#8221;? ==
The term &#8220;Web Application&#8221; in this context refers to applications  accessed over the World Wide Web by using a Web browser. This group  is not attempting to describe APIs for writing high-end  sophisticated programs such as office productivity suites,  graphics manipulation packages, or 3D games.
Some of the most famous examples of Web applications currently deployed are [http://www.ebay.com/ eBay] and [http://www.amazon.com/ Amazon].
== Aren&#8217;t &#8220;Web Applications&#8221; already possible? ==
Yes. This working group aims to make their development <em>easier</em>, and hopes to specify new technologies that make it possible to make much prettier and more usable interfaces with less dependence on complex scripts, less dependence on server-generated pages, and a more seamless user experience.
For example, currently HTML forms do not specify a way to specify that a control is a required control that must be filled in before submission: such features have to be scripted explicitly.

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.