1 <!DOCTYPE html><html lang=en-US-x-hixie><title>HTML5 (including next generation additions still in development)</title><script>
2 var loadTimer = new Date();
3 var current_revision = "r" + "$Revision: 5097 $".substr(11);
4 current_revision = current_revision.substr(0, current_revision.length - 2);
5 var last_known_revision = current_revision;
6 function getCookie(name) {
7 var params = location.search.substr(1).split("&");
8 for (var index = 0; index < params.length; index++) {
9 if (params[index] == name)
11 var data = params[index].split("=");
13 return unescape(data[1]);
15 var cookies = document.cookie.split("; ");
16 for (var index = 0; index < cookies.length; index++) {
17 var data = cookies[index].split("=");
19 return unescape(data[1]);
24 var currentAlertTimeout;
25 function showAlert(s, href) {
27 currentAlert = document.createElement('div');
28 currentAlert.id = 'alert';
29 var x = document.createElement('button');
30 x.textContent = '\u2573';
31 x.onclick = closeAlert2;
32 currentAlert.appendChild(x);
33 currentAlert.appendChild(document.createElement('span'));
34 currentAlert.onmousemove = function () {
35 clearTimeout(currentAlertTimeout);
36 currentAlert.className = '';
37 currentAlertTimeout = setTimeout(closeAlert, 10000);
39 document.body.appendChild(currentAlert);
41 clearTimeout(currentAlertTimeout);
42 currentAlert.className = '';
44 currentAlert.lastChild.textContent = s + ' ';
46 var link = document.createElement('a');
48 link.textContent = href;
49 currentAlert.lastChild.appendChild(link);
51 currentAlertTimeout = setTimeout(closeAlert, 10000);
53 function closeAlert() {
54 clearTimeout(currentAlertTimeout);
56 currentAlert.className = 'closed';
57 currentAlertTimeout = setTimeout(closeAlert2, 3000);
60 function closeAlert2() {
61 clearTimeout(currentAlertTimeout);
63 currentAlert.parentNode.removeChild(currentAlert);
67 window.addEventListener('keydown', function (event) {
68 if (event.keyCode == 27) {
75 window.addEventListener('scroll', function (event) {
78 function load(script) {
79 var e = document.createElement('script');
80 e.setAttribute('src', 'http://www.whatwg.org/specs/web-apps/current-work/' + script + '?' + encodeURIComponent(location) + '&' + encodeURIComponent(document.referrer));
81 document.body.appendChild(e);
83 </script><link href=/style/specification rel=stylesheet><link href=/images/icon rel=icon><style>
84 .proposal { border: blue solid; padding: 1em; }
85 .bad, .bad *:not(.XXX) { color: gray; border-color: gray; background: transparent; }
86 #updatesStatus { display: none; }
87 #updatesStatus.relevant { display: block; position: fixed; right: 1em; top: 1em; padding: 0.5em; font: bold small sans-serif; min-width: 25em; width: 30%; max-width: 40em; height: auto; border: ridge 4px gray; background: #EEEEEE; color: black; }
88 div.head .logo { width: 11em; margin-bottom: 20em; }
89 #configUI { position: absolute; z-index: 20; top: 10em; right: 0; width: 11em; padding: 0 0.5em 0 0.5em; font-size: small; background: gray; background: rgba(32,32,32,0.9); color: white; border-radius: 1em 0 0 1em; -moz-border-radius: 1em 0 0 1em; }
90 #configUI p { margin: 0.75em 0; padding: 0.3em; }
91 #configUI p label { display: block; }
92 #configUI #updateUI, #configUI .loginUI { text-align: center; }
93 #configUI input[type=button] { display: block; margin: auto; }
94 #configUI :link, #configUI :visited { color: white; }
95 #configUI :link:hover, #configUI :visited:hover { background: transparent; }
96 #reviewer { position: fixed; bottom: 0; right: 0; padding: 0.15em 0.25em 0em 0.5em; white-space: nowrap; overflow: hidden; z-index: 30; background: gray; background: rgba(32,32,32,0.9); color: white; border-radius: 1em 0 0 0; -moz-border-radius: 1em 0 0 0; max-width: 90%; }
97 #reviewer input { max-width: 50%; }
98 #reviewer * { font-size: small; }
99 #reviewer.off > :not(:first-child) { display: none; }
100 #alert { position: fixed; top: 20%; left: 20%; right: 20%; font-size: 2em; padding: 0.5em; z-index: 40; background: gray; background: rgba(32,32,32,0.9); color: white; border-radius: 1em; -moz-border-radius: 1em; -webkit-transition: opacity 1s linear; }
101 #alert.closed { opacity: 0; }
102 #alert button { position: absolute; top: -1em; right: 2em; border-radius: 1em 1em 0 0; border: none; line-height: 0.9; color: white; background: rgb(64,64,64); font-size: 0.6em; font-weight: 900; cursor: pointer; }
103 #alert :link, #alert :visited { color: white; }
104 #alert :link:hover, #alert :visited:hover { background: transparent; }
105 @media print { #configUI { display: none; } }
106 .rfc2119 { font-variant: small-caps; text-shadow: 0 0 0.5em yellow; position: static; }
107 .rfc2119::after { position: absolute; left: 0; width: 25px; text-align: center; color: yellow; text-shadow: 0.075em 0.075em 0.2em black; }
108 .rfc2119.m\ust::after { content: '\2605'; }
109 .rfc2119.s\hould::after { content: '\2606'; }
110 [hidden] { display: none; }
111 </style><style type=text/css>
113 .applies thead th > * { display: block; }
114 .applies thead code { display: block; }
115 .applies tbody th { whitespace: nowrap; }
116 .applies td { text-align: center; }
117 .applies .yes { background: yellow; }
119 .matrix, .matrix td { border: none; text-align: right; }
120 .matrix { margin-left: 2em; }
122 .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
123 .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
124 .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
126 #table-example-1 { border: solid thin; border-collapse: collapse; margin-left: 3em; }
127 #table-example-1 * { font-family: "Essays1743", serif; line-height: 1.01em; }
128 #table-example-1 caption { padding-bottom: 0.5em; }
129 #table-example-1 thead, #table-example-1 tbody { border: none; }
130 #table-example-1 th, #table-example-1 td { border: solid thin; }
131 #table-example-1 th { font-weight: normal; }
132 #table-example-1 td { border-style: none solid; vertical-align: top; }
133 #table-example-1 th { padding: 0.5em; vertical-align: middle; text-align: center; }
134 #table-example-1 tbody tr:first-child td { padding-top: 0.5em; }
135 #table-example-1 tbody tr:last-child td { padding-bottom: 1.5em; }
136 #table-example-1 tbody td:first-child { padding-left: 2.5em; padding-right: 0; width: 9em; }
137 #table-example-1 tbody td:first-child::after { content: leader(". "); }
138 #table-example-1 tbody td { padding-left: 2em; padding-right: 2em; }
139 #table-example-1 tbody td:first-child + td { width: 10em; }
140 #table-example-1 tbody td:first-child + td ~ td { width: 2.5em; }
141 #table-example-1 tbody td:first-child + td + td + td ~ td { width: 1.25em; }
143 .apple-table-examples { border: none; border-collapse: separate; border-spacing: 1.5em 0em; width: 40em; margin-left: 3em; }
144 .apple-table-examples * { font-family: "Times", serif; }
145 .apple-table-examples td, .apple-table-examples th { border: none; white-space: nowrap; padding-top: 0; padding-bottom: 0; }
146 .apple-table-examples tbody th:first-child { border-left: none; width: 100%; }
147 .apple-table-examples thead th:first-child ~ th { font-size: smaller; font-weight: bolder; border-bottom: solid 2px; text-align: center; }
148 .apple-table-examples tbody th::after, .apple-table-examples tfoot th::after { content: leader(". ") }
149 .apple-table-examples tbody th, .apple-table-examples tfoot th { font: inherit; text-align: left; }
150 .apple-table-examples td { text-align: right; vertical-align: top; }
151 .apple-table-examples.e1 tbody tr:last-child td { border-bottom: solid 1px; }
152 .apple-table-examples.e1 tbody + tbody tr:last-child td { border-bottom: double 3px; }
153 .apple-table-examples.e2 th[scope=row] { padding-left: 1em; }
154 .apple-table-examples sup { line-height: 0; }
156 .details-example img { vertical-align: top; }
158 #named-character-references-table {
162 -moz-column-width: 28em;
163 -moz-column-gap: 1em;
164 -webkit-column-width: 28em;
165 -webkit-column-gap: 1em;
167 #named-character-references-table > table > tbody > tr > td:last-child { text-align: center; }
168 #named-character-references-table > table > tbody > tr > td:last-child:hover > span { position: absolute; top: auto; left: auto; margin-left: 0.5em; line-height: 1.2; font-size: 5em; border: outset; padding: 0.25em 0.5em; background: white; width: 1.25em; height: auto; text-align: center; }
171 .domintro:before { display: table; margin: -1em -0.5em -0.5em auto; width: auto; content: 'This box is non-normative. Implementation requirements are given below this box.'; color: black; font-style: italic; border: solid 2px; background: white; padding: 0 0.25em; }
172 </style><link href=data:text/css, id=complete rel=stylesheet title="Complete specification"><link href=data:text/css,.impl%20{%20display:%20none;%20}%0Ahtml%20{%20border:%20solid%20yellow;%20}%20.domintro:before%20{%20display:%20none;%20} id=author rel="alternate stylesheet" title="Author documentation only"><link href=data:text/css,.impl%20{%20background:%20%23FFEEEE;%20}%20.domintro:before%20{%20background:%20%23FFEEEE;%20} id=highlight rel="alternate stylesheet" title="Highlight implementation requirements"><link href=status.css rel=stylesheet><script>
174 if (location.search == '?slow-browser')
176 var configUI = document.createElement('div');
177 configUI.id = 'configUI';
178 document.body.appendChild(configUI);
180 if (document.documentElement.className == "" || document.documentElement.className == "split index")
186 if (getCookie('profile') == '1')
187 document.getElementsByTagName('h2')[0].textContent += '; load: ' + (new Date() - loadTimer) + 'ms';
189 </script><body class=draft onload=init()>
191 <header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
192 <hgroup><h1>HTML5 (including next generation additions still in development)</h1>
193 <h2 class="no-num no-toc">Draft Standard — 18 May 2010</h2>
194 </hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
195 <p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
196 <!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
197 <dl><dt>Multiple-page version:</dt>
198 <dd><strong><a href=http://www.whatwg.org/specs/web-apps/current-work/multipage/>http://whatwg.org/html5</a></strong></dd>
199 <dt>One-page version:</dt>
200 <dd><a href=http://www.whatwg.org/specs/web-apps/current-work/>http://www.whatwg.org/specs/web-apps/current-work/</a></dd>
201 <dt>PDF print versions:</dt>
202 <dd>A4: <a href=http://www.whatwg.org/specs/web-apps/current-work/html5-a4.pdf>http://www.whatwg.org/specs/web-apps/current-work/html5-a4.pdf</a></dd>
203 <dd>Letter: <a href=http://www.whatwg.org/specs/web-apps/current-work/html5-letter.pdf>http://www.whatwg.org/specs/web-apps/current-work/html5-letter.pdf</a></dd>
204 <dt>Version history:</dt>
205 <dd>Twitter messages (non-editorial changes only): <a href=http://twitter.com/WHATWG>http://twitter.com/WHATWG</a></dd>
206 <dd>Commit-Watchers mailing list: <a href=http://lists.whatwg.org/listinfo.cgi/commit-watchers-whatwg.org>http://lists.whatwg.org/listinfo.cgi/commit-watchers-whatwg.org</a></dd>
207 <dd>Interactive Web interface: <a href=http://html5.org/tools/web-apps-tracker>http://html5.org/tools/web-apps-tracker</a></dd>
208 <dd>Subversion interface: <a href=http://svn.whatwg.org/>http://svn.whatwg.org/</a></dd>
210 <dd>To view the open bugs: <a href="http://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&product=HTML+WG&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=exact&email1=ian%40hixie.ch&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=">HTML5 bug list</a></dd>
211 <dd>To file bugs, use the "submit review comments" feature at the bottom of the window</dd>
212 <dd>To send feedback by e-mail: <a href=http://www.whatwg.org/mailing-list>whatwg@whatwg.org</a></dd>
213 <dd>To view and vote on e-mail feedback: <a href=http://www.whatwg.org/issues/>http://www.whatwg.org/issues/</a></dd>
215 <dd>Ian Hickson, Google, ian@hixie.ch</dd>
216 </dl><p class=copyright>© Copyright 2004-2010 Apple Computer, Inc.,
217 Mozilla Foundation, and Opera Software ASA.</p>
218 <p class=copyright>You are granted a license to use, reproduce
219 and create derivative works of this document.</p>
220 </header><hr><h2 class="no-num no-toc" id=abstract>Abstract</h2>
222 <p>This specification evolves HTML and its related APIs to ease the
223 authoring of Web-based applications. The most recent additions
224 include a <code><a href=#devices>device</a></code> element to enable video conferencing,
225 as well as all the features added as part of the earlier HTML5
229 <h2 class="no-num no-toc" id=status>Status of this document</h2>
231 <p><strong>This is a work in progress!</strong> This document is
232 changing on a daily if not hourly basis in response to comments and
233 as a general part of its development process. Comments are very
234 welcome, please send them to <a href=mailto:whatwg@whatwg.org>whatwg@whatwg.org</a>. Thank
237 <p><a href=http://www.whatwg.org/issues/>Outstanding feedback</a>
238 is tracked; all e-mails sent to the list above receive a reply. The
239 level of outstanding feedback is <a href=http://www.whatwg.org/issues/data.html>charted</a> to allow
240 progress to be evaluated.</p>
242 <p>Implementors should be aware that this specification is not
243 stable. <strong>Implementors who are not taking part in the
244 discussions are likely to find the specification changing out from
245 under them in incompatible ways.</strong> Vendors interested in
246 implementing this specification before it eventually reaches the
247 call for implementations should join the <a href=/mailing-list>WHATWG mailing list</a> and take part in the
250 <p>This specification is intended to replace (be the new version of)
251 what was previously the HTML5, HTML4, XHTML1, and DOM2 HTML
256 <h2 class="no-num no-toc" id=contents>Table of contents</h2>
260 <li><a href=#introduction><span class=secno>1 </span>Introduction</a>
262 <li><a href=#is-this-html5?><span class=secno>1.1 </span>Is this HTML5?</a></li>
263 <li><a href=#background><span class=secno>1.2 </span>Background</a></li>
264 <li><a href=#audience><span class=secno>1.3 </span>Audience</a></li>
265 <li><a href=#scope><span class=secno>1.4 </span>Scope</a></li>
266 <li><a href=#history-1><span class=secno>1.5 </span>History</a></li>
267 <li><a href=#design-notes><span class=secno>1.6 </span>Design notes</a>
269 <li><a href=#serializability-of-script-execution><span class=secno>1.6.1 </span>Serializability of script execution</a></li>
270 <li><a href=#compliance-with-other-specifications><span class=secno>1.6.2 </span>Compliance with other specifications</a></ol></li>
271 <li><a href=#html-vs-xhtml><span class=secno>1.7 </span>HTML vs XHTML</a></li>
272 <li><a href=#structure-of-this-specification><span class=secno>1.8 </span>Structure of this specification</a>
274 <li><a href=#how-to-read-this-specification><span class=secno>1.8.1 </span>How to read this specification</a></li>
275 <li><a href=#typographic-conventions><span class=secno>1.8.2 </span>Typographic conventions</a></ol></li>
276 <li><a href=#a-quick-introduction-to-html><span class=secno>1.9 </span>A quick introduction to HTML</a></li>
277 <li><a href=#conformance-requirements-for-authors><span class=secno>1.10 </span>Conformance requirements for authors</a>
279 <li><a href=#presentational-markup><span class=secno>1.10.1 </span>Presentational markup</a></li>
280 <li><a href=#syntax-errors><span class=secno>1.10.2 </span>Syntax errors</a></li>
281 <li><a href=#restrictions-on-content-models-and-on-attribute-values><span class=secno>1.10.3 </span>Restrictions on content models and on attribute values</a></ol></li>
282 <li><a href=#recommended-reading><span class=secno>1.11 </span>Recommended reading</a></ol></li>
283 <li><a href=#infrastructure><span class=secno>2 </span>Common infrastructure</a>
285 <li><a href=#terminology><span class=secno>2.1 </span>Terminology</a>
287 <li><a href=#resources><span class=secno>2.1.1 </span>Resources</a></li>
288 <li><a href=#xml><span class=secno>2.1.2 </span>XML</a></li>
289 <li><a href=#dom-trees><span class=secno>2.1.3 </span>DOM trees</a></li>
290 <li><a href=#scripting-0><span class=secno>2.1.4 </span>Scripting</a></li>
291 <li><a href=#plugins><span class=secno>2.1.5 </span>Plugins</a></li>
292 <li><a href=#character-encodings><span class=secno>2.1.6 </span>Character encodings</a></ol></li>
293 <li><a href=#conformance-requirements><span class=secno>2.2 </span>Conformance requirements</a>
295 <li><a href=#dependencies><span class=secno>2.2.1 </span>Dependencies</a></li>
296 <li><a href=#extensibility><span class=secno>2.2.2 </span>Extensibility</a></ol></li>
297 <li><a href=#case-sensitivity-and-string-comparison><span class=secno>2.3 </span>Case-sensitivity and string comparison</a></li>
298 <li><a href=#common-microsyntaxes><span class=secno>2.4 </span>Common microsyntaxes</a>
300 <li><a href=#common-parser-idioms><span class=secno>2.4.1 </span>Common parser idioms</a></li>
301 <li><a href=#boolean-attributes><span class=secno>2.4.2 </span>Boolean attributes</a></li>
302 <li><a href=#keywords-and-enumerated-attributes><span class=secno>2.4.3 </span>Keywords and enumerated attributes</a></li>
303 <li><a href=#numbers><span class=secno>2.4.4 </span>Numbers</a>
305 <li><a href=#non-negative-integers><span class=secno>2.4.4.1 </span>Non-negative integers</a></li>
306 <li><a href=#signed-integers><span class=secno>2.4.4.2 </span>Signed integers</a></li>
307 <li><a href=#real-numbers><span class=secno>2.4.4.3 </span>Real numbers</a></li>
308 <li><a href=#percentages-and-dimensions><span class=secno>2.4.4.4 </span>Percentages and lengths</a></li>
309 <li><a href=#lists-of-integers><span class=secno>2.4.4.5 </span>Lists of integers</a></li>
310 <li><a href=#lists-of-dimensions><span class=secno>2.4.4.6 </span>Lists of dimensions</a></ol></li>
311 <li><a href=#dates-and-times><span class=secno>2.4.5 </span>Dates and times</a>
313 <li><a href=#months><span class=secno>2.4.5.1 </span>Months</a></li>
314 <li><a href=#dates><span class=secno>2.4.5.2 </span>Dates</a></li>
315 <li><a href=#times><span class=secno>2.4.5.3 </span>Times</a></li>
316 <li><a href=#local-dates-and-times><span class=secno>2.4.5.4 </span>Local dates and times</a></li>
317 <li><a href=#global-dates-and-times><span class=secno>2.4.5.5 </span>Global dates and times</a></li>
318 <li><a href=#weeks><span class=secno>2.4.5.6 </span>Weeks</a></li>
319 <li><a href=#vaguer-moments-in-time><span class=secno>2.4.5.7 </span>Vaguer moments in time</a></ol></li>
320 <li><a href=#colors><span class=secno>2.4.6 </span>Colors</a></li>
321 <li><a href=#space-separated-tokens><span class=secno>2.4.7 </span>Space-separated tokens</a></li>
322 <li><a href=#comma-separated-tokens><span class=secno>2.4.8 </span>Comma-separated tokens</a></li>
323 <li><a href=#syntax-references><span class=secno>2.4.9 </span>References</a></li>
324 <li><a href=#mq><span class=secno>2.4.10 </span>Media queries</a></ol></li>
325 <li><a href=#urls><span class=secno>2.5 </span>URLs</a>
327 <li><a href=#terminology-0><span class=secno>2.5.1 </span>Terminology</a></li>
328 <li><a href=#dynamic-changes-to-base-urls><span class=secno>2.5.2 </span>Dynamic changes to base URLs</a></li>
329 <li><a href=#interfaces-for-url-manipulation><span class=secno>2.5.3 </span>Interfaces for URL manipulation</a></ol></li>
330 <li><a href=#fetching-resources><span class=secno>2.6 </span>Fetching resources</a>
332 <li><a href=#concept-http-equivalent><span class=secno>2.6.1 </span>Protocol concepts</a></li>
333 <li><a href=#encrypted-http-and-related-security-concerns><span class=secno>2.6.2 </span>Encrypted HTTP and related security concerns</a></li>
334 <li><a href=#content-type-sniffing><span class=secno>2.6.3 </span>Determining the type of a resource</a></ol></li>
335 <li><a href=#common-dom-interfaces><span class=secno>2.7 </span>Common DOM interfaces</a>
337 <li><a href=#reflecting-content-attributes-in-idl-attributes><span class=secno>2.7.1 </span>Reflecting content attributes in IDL attributes</a></li>
338 <li><a href=#collections-0><span class=secno>2.7.2 </span>Collections</a>
340 <li><a href=#htmlcollection-0><span class=secno>2.7.2.1 </span>HTMLCollection</a></li>
341 <li><a href=#htmlallcollection-0><span class=secno>2.7.2.2 </span>HTMLAllCollection</a></li>
342 <li><a href=#htmlformcontrolscollection-0><span class=secno>2.7.2.3 </span>HTMLFormControlsCollection</a></li>
343 <li><a href=#htmloptionscollection-0><span class=secno>2.7.2.4 </span>HTMLOptionsCollection</a></li>
344 <li><a href=#htmlpropertiescollection-0><span class=secno>2.7.2.5 </span>HTMLPropertiesCollection</a></ol></li>
345 <li><a href=#domtokenlist-0><span class=secno>2.7.3 </span>DOMTokenList</a></li>
346 <li><a href=#domsettabletokenlist-0><span class=secno>2.7.4 </span>DOMSettableTokenList</a></li>
347 <li><a href=#safe-passing-of-structured-data><span class=secno>2.7.5 </span>Safe passing of structured data</a></li>
348 <li><a href=#domstringmap-0><span class=secno>2.7.6 </span>DOMStringMap</a></li>
349 <li><a href=#dom-feature-strings><span class=secno>2.7.7 </span>DOM feature strings</a></li>
350 <li><a href=#exceptions><span class=secno>2.7.8 </span>Exceptions</a></li>
351 <li><a href=#garbage-collection><span class=secno>2.7.9 </span>Garbage collection</a></ol></li>
352 <li><a href=#namespaces><span class=secno>2.8 </span>Namespaces</a></ol></li>
353 <li><a href=#dom><span class=secno>3 </span>Semantics, structure, and APIs of HTML documents</a>
355 <li><a href=#documents><span class=secno>3.1 </span>Documents</a>
357 <li><a href=#documents-in-the-dom><span class=secno>3.1.1 </span>Documents in the DOM</a></li>
358 <li><a href=#security-document><span class=secno>3.1.2 </span>Security</a></li>
359 <li><a href=#resource-metadata-management><span class=secno>3.1.3 </span>Resource metadata management</a></li>
360 <li><a href=#dom-tree-accessors><span class=secno>3.1.4 </span>DOM tree accessors</a></li>
361 <li><a href=#creating-documents><span class=secno>3.1.5 </span>Creating documents</a></ol></li>
362 <li><a href=#elements><span class=secno>3.2 </span>Elements</a>
364 <li><a href=#semantics-0><span class=secno>3.2.1 </span>Semantics</a></li>
365 <li><a href=#elements-in-the-dom><span class=secno>3.2.2 </span>Elements in the DOM</a></li>
366 <li><a href=#global-attributes><span class=secno>3.2.3 </span>Global attributes</a>
368 <li><a href=#the-id-attribute><span class=secno>3.2.3.1 </span>The <code>id</code> attribute</a></li>
369 <li><a href=#the-title-attribute><span class=secno>3.2.3.2 </span>The <code>title</code> attribute</a></li>
370 <li><a href=#the-lang-and-xml:lang-attributes><span class=secno>3.2.3.3 </span>The <code title=attr-lang>lang</code> and <code title=attr-xml-lang>xml:lang</code> attributes</a></li>
371 <li><a href=#the-xml:base-attribute-(xml-only)><span class=secno>3.2.3.4 </span>The <code>xml:base</code>
372 attribute (XML only)</a></li>
373 <li><a href=#the-dir-attribute><span class=secno>3.2.3.5 </span>The <code>dir</code> attribute</a></li>
374 <li><a href=#classes><span class=secno>3.2.3.6 </span>The <code>class</code> attribute</a></li>
375 <li><a href=#the-style-attribute><span class=secno>3.2.3.7 </span>The <code>style</code> attribute</a></li>
376 <li><a href=#embedding-custom-non-visible-data><span class=secno>3.2.3.8 </span>Embedding custom non-visible data</a></ol></li>
377 <li><a href=#element-definitions><span class=secno>3.2.4 </span>Element definitions</a>
379 <li><a href=#attributes><span class=secno>3.2.4.1 </span>Attributes</a></ol></li>
380 <li><a href=#content-models><span class=secno>3.2.5 </span>Content models</a>
382 <li><a href=#kinds-of-content><span class=secno>3.2.5.1 </span>Kinds of content</a>
384 <li><a href=#metadata-content-0><span class=secno>3.2.5.1.1 </span>Metadata content</a></li>
385 <li><a href=#flow-content-0><span class=secno>3.2.5.1.2 </span>Flow content</a></li>
386 <li><a href=#sectioning-content-0><span class=secno>3.2.5.1.3 </span>Sectioning content</a></li>
387 <li><a href=#heading-content-0><span class=secno>3.2.5.1.4 </span>Heading content</a></li>
388 <li><a href=#phrasing-content-0><span class=secno>3.2.5.1.5 </span>Phrasing content</a></li>
389 <li><a href=#embedded-content-0><span class=secno>3.2.5.1.6 </span>Embedded content</a></li>
390 <li><a href=#interactive-content-0><span class=secno>3.2.5.1.7 </span>Interactive content</a></ol></li>
391 <li><a href=#transparent-content-models><span class=secno>3.2.5.2 </span>Transparent content models</a></li>
392 <li><a href=#paragraphs><span class=secno>3.2.5.3 </span>Paragraphs</a></ol></li>
393 <li><a href=#annotations-for-assistive-technology-products-(aria)><span class=secno>3.2.6 </span>Annotations for assistive technology products (ARIA)</a></ol></li>
394 <li><a href=#apis-in-html-documents><span class=secno>3.3 </span>APIs in HTML documents</a></li>
395 <li><a href=#interactions-with-xpath-and-xslt><span class=secno>3.4 </span>Interactions with XPath and XSLT</a></li>
396 <li><a href=#dynamic-markup-insertion><span class=secno>3.5 </span>Dynamic markup insertion</a>
398 <li><a href=#opening-the-input-stream><span class=secno>3.5.1 </span>Opening the input stream</a></li>
399 <li><a href=#closing-the-input-stream><span class=secno>3.5.2 </span>Closing the input stream</a></li>
400 <li><a href=#document.write()><span class=secno>3.5.3 </span><code title=dom-document-write>document.write()</code></a></li>
401 <li><a href=#document.writeln()><span class=secno>3.5.4 </span><code title=dom-document-writeln>document.writeln()</code></a></li>
402 <li><a href=#innerhtml><span class=secno>3.5.5 </span><code title=dom-innerHTML>innerHTML</code></a></li>
403 <li><a href=#outerhtml><span class=secno>3.5.6 </span><code title=dom-outerHTML>outerHTML</code></a></li>
404 <li><a href=#insertadjacenthtml()><span class=secno>3.5.7 </span><code title=dom-insertAdjacentHTML>insertAdjacentHTML()</code></a></ol></ol></li>
405 <li><a href=#semantics><span class=secno>4 </span>The elements of HTML</a>
407 <li><a href=#the-root-element><span class=secno>4.1 </span>The root element</a>
409 <li><a href=#the-html-element-0><span class=secno>4.1.1 </span>The <code>html</code> element</a></ol></li>
410 <li><a href=#document-metadata><span class=secno>4.2 </span>Document metadata</a>
412 <li><a href=#the-head-element-0><span class=secno>4.2.1 </span>The <code>head</code> element</a></li>
413 <li><a href=#the-title-element-0><span class=secno>4.2.2 </span>The <code>title</code> element</a></li>
414 <li><a href=#the-base-element><span class=secno>4.2.3 </span>The <code>base</code> element</a></li>
415 <li><a href=#the-link-element><span class=secno>4.2.4 </span>The <code>link</code> element</a></li>
416 <li><a href=#meta><span class=secno>4.2.5 </span>The <code>meta</code> element</a>
418 <li><a href=#standard-metadata-names><span class=secno>4.2.5.1 </span>Standard metadata names</a></li>
419 <li><a href=#other-metadata-names><span class=secno>4.2.5.2 </span>Other metadata names</a></li>
420 <li><a href=#pragma-directives><span class=secno>4.2.5.3 </span>Pragma directives</a></li>
421 <li><a href=#other-pragma-directives><span class=secno>4.2.5.4 </span>Other pragma directives</a></li>
422 <li><a href=#charset><span class=secno>4.2.5.5 </span>Specifying the document's character encoding</a></ol></li>
423 <li><a href=#the-style-element><span class=secno>4.2.6 </span>The <code>style</code> element</a></li>
424 <li><a href=#styling><span class=secno>4.2.7 </span>Styling</a></ol></li>
425 <li><a href=#scripting-1><span class=secno>4.3 </span>Scripting</a>
427 <li><a href=#script><span class=secno>4.3.1 </span>The <code>script</code> element</a>
429 <li><a href=#scriptingLanguages><span class=secno>4.3.1.1 </span>Scripting languages</a></li>
430 <li><a href=#restrictions-for-contents-of-script-elements><span class=secno>4.3.1.2 </span>Restrictions for contents of <code>script</code> elements</a></li>
431 <li><a href=#inline-documentation-for-external-scripts><span class=secno>4.3.1.3 </span>Inline documentation for external scripts</a></ol></li>
432 <li><a href=#the-noscript-element><span class=secno>4.3.2 </span>The <code>noscript</code> element</a></ol></li>
433 <li><a href=#sections><span class=secno>4.4 </span>Sections</a>
435 <li><a href=#the-body-element-0><span class=secno>4.4.1 </span>The <code>body</code> element</a></li>
436 <li><a href=#the-section-element><span class=secno>4.4.2 </span>The <code>section</code> element</a></li>
437 <li><a href=#the-nav-element><span class=secno>4.4.3 </span>The <code>nav</code> element</a></li>
438 <li><a href=#the-article-element><span class=secno>4.4.4 </span>The <code>article</code> element</a></li>
439 <li><a href=#the-aside-element><span class=secno>4.4.5 </span>The <code>aside</code> element</a></li>
440 <li><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements><span class=secno>4.4.6 </span>The <code>h1</code>, <code>h2</code>,
441 <code>h3</code>, <code>h4</code>,
442 <code>h5</code>, and <code>h6</code>
444 <li><a href=#the-hgroup-element><span class=secno>4.4.7 </span>The <code>hgroup</code> element</a></li>
445 <li><a href=#the-header-element><span class=secno>4.4.8 </span>The <code>header</code> element</a></li>
446 <li><a href=#the-footer-element><span class=secno>4.4.9 </span>The <code>footer</code> element</a></li>
447 <li><a href=#the-address-element><span class=secno>4.4.10 </span>The <code>address</code> element</a></li>
448 <li><a href=#headings-and-sections><span class=secno>4.4.11 </span>Headings and sections</a>
450 <li><a href=#outlines><span class=secno>4.4.11.1 </span>Creating an outline</a></ol></ol></li>
451 <li><a href=#grouping-content><span class=secno>4.5 </span>Grouping content</a>
453 <li><a href=#the-p-element><span class=secno>4.5.1 </span>The <code>p</code> element</a></li>
454 <li><a href=#the-hr-element><span class=secno>4.5.2 </span>The <code>hr</code> element</a></li>
455 <li><a href=#the-pre-element><span class=secno>4.5.3 </span>The <code>pre</code> element</a></li>
456 <li><a href=#the-blockquote-element><span class=secno>4.5.4 </span>The <code>blockquote</code> element</a></li>
457 <li><a href=#the-ol-element><span class=secno>4.5.5 </span>The <code>ol</code> element</a></li>
458 <li><a href=#the-ul-element><span class=secno>4.5.6 </span>The <code>ul</code> element</a></li>
459 <li><a href=#the-li-element><span class=secno>4.5.7 </span>The <code>li</code> element</a></li>
460 <li><a href=#the-dl-element><span class=secno>4.5.8 </span>The <code>dl</code> element</a></li>
461 <li><a href=#the-dt-element><span class=secno>4.5.9 </span>The <code>dt</code> element</a></li>
462 <li><a href=#the-dd-element><span class=secno>4.5.10 </span>The <code>dd</code> element</a></li>
463 <li><a href=#the-figure-element><span class=secno>4.5.11 </span>The <code>figure</code> element</a></li>
464 <li><a href=#the-figcaption-element><span class=secno>4.5.12 </span>The <code>figcaption</code> element</a></li>
465 <li><a href=#the-div-element><span class=secno>4.5.13 </span>The <code>div</code> element</a></ol></li>
466 <li><a href=#text-level-semantics><span class=secno>4.6 </span>Text-level semantics</a>
468 <li><a href=#the-a-element><span class=secno>4.6.1 </span>The <code>a</code> element</a></li>
469 <li><a href=#the-em-element><span class=secno>4.6.2 </span>The <code>em</code> element</a></li>
470 <li><a href=#the-strong-element><span class=secno>4.6.3 </span>The <code>strong</code> element</a></li>
471 <li><a href=#the-small-element><span class=secno>4.6.4 </span>The <code>small</code> element</a></li>
472 <li><a href=#the-cite-element><span class=secno>4.6.5 </span>The <code>cite</code> element</a></li>
473 <li><a href=#the-q-element><span class=secno>4.6.6 </span>The <code>q</code> element</a></li>
474 <li><a href=#the-dfn-element><span class=secno>4.6.7 </span>The <code>dfn</code> element</a></li>
475 <li><a href=#the-abbr-element><span class=secno>4.6.8 </span>The <code>abbr</code> element</a></li>
476 <li><a href=#the-time-element><span class=secno>4.6.9 </span>The <code>time</code> element</a></li>
477 <li><a href=#the-code-element><span class=secno>4.6.10 </span>The <code>code</code> element</a></li>
478 <li><a href=#the-var-element><span class=secno>4.6.11 </span>The <code>var</code> element</a></li>
479 <li><a href=#the-samp-element><span class=secno>4.6.12 </span>The <code>samp</code> element</a></li>
480 <li><a href=#the-kbd-element><span class=secno>4.6.13 </span>The <code>kbd</code> element</a></li>
481 <li><a href=#the-sub-and-sup-elements><span class=secno>4.6.14 </span>The <code>sub</code> and <code>sup</code> elements</a></li>
482 <li><a href=#the-i-element><span class=secno>4.6.15 </span>The <code>i</code> element</a></li>
483 <li><a href=#the-b-element><span class=secno>4.6.16 </span>The <code>b</code> element</a></li>
484 <li><a href=#the-mark-element><span class=secno>4.6.17 </span>The <code>mark</code> element</a></li>
485 <li><a href=#the-ruby-element><span class=secno>4.6.18 </span>The <code>ruby</code> element</a></li>
486 <li><a href=#the-rt-element><span class=secno>4.6.19 </span>The <code>rt</code> element</a></li>
487 <li><a href=#the-rp-element><span class=secno>4.6.20 </span>The <code>rp</code> element</a></li>
488 <li><a href=#the-bdo-element><span class=secno>4.6.21 </span>The <code>bdo</code> element</a></li>
489 <li><a href=#the-span-element><span class=secno>4.6.22 </span>The <code>span</code> element</a></li>
490 <li><a href=#the-br-element><span class=secno>4.6.23 </span>The <code>br</code> element</a></li>
491 <li><a href=#the-wbr-element><span class=secno>4.6.24 </span>The <code>wbr</code> element</a></li>
492 <li><a href=#usage-summary><span class=secno>4.6.25 </span>Usage summary</a></ol></li>
493 <li><a href=#edits><span class=secno>4.7 </span>Edits</a>
495 <li><a href=#the-ins-element><span class=secno>4.7.1 </span>The <code>ins</code> element</a></li>
496 <li><a href=#the-del-element><span class=secno>4.7.2 </span>The <code>del</code> element</a></li>
497 <li><a href=#attributes-common-to-ins-and-del-elements><span class=secno>4.7.3 </span>Attributes common to <code>ins</code> and <code>del</code> elements</a></li>
498 <li><a href=#edits-and-paragraphs><span class=secno>4.7.4 </span>Edits and paragraphs</a></li>
499 <li><a href=#edits-and-lists><span class=secno>4.7.5 </span>Edits and lists</a></ol></li>
500 <li><a href=#embedded-content-1><span class=secno>4.8 </span>Embedded content</a>
502 <li><a href=#the-img-element><span class=secno>4.8.1 </span>The <code>img</code> element</a>
504 <li><a href=#alt><span class=secno>4.8.1.1 </span>Requirements for providing text to act as an alternative for images</a>
506 <li><a href=#a-link-or-button-containing-nothing-but-the-image><span class=secno>4.8.1.1.1 </span>A link or button containing nothing but the image</a></li>
507 <li><a href=#a-phrase-or-paragraph-with-an-alternative-graphical-representation:-charts,-diagrams,-graphs,-maps,-illustrations><span class=secno>4.8.1.1.2 </span>A phrase or paragraph with an alternative graphical representation: charts, diagrams, graphs, maps, illustrations</a></li>
508 <li><a href=#a-short-phrase-or-label-with-an-alternative-graphical-representation:-icons,-logos><span class=secno>4.8.1.1.3 </span>A short phrase or label with an alternative graphical representation: icons, logos</a></li>
509 <li><a href=#text-that-has-been-rendered-to-a-graphic-for-typographical-effect><span class=secno>4.8.1.1.4 </span>Text that has been rendered to a graphic for typographical effect</a></li>
510 <li><a href=#a-graphical-representation-of-some-of-the-surrounding-text><span class=secno>4.8.1.1.5 </span>A graphical representation of some of the surrounding text</a></li>
511 <li><a href="#a-purely-decorative-image-that-doesn't-add-any-information"><span class=secno>4.8.1.1.6 </span>A purely decorative image that doesn't add any information</a></li>
512 <li><a href=#a-group-of-images-that-form-a-single-larger-picture-with-no-links><span class=secno>4.8.1.1.7 </span>A group of images that form a single larger picture with no links</a></li>
513 <li><a href=#a-group-of-images-that-form-a-single-larger-picture-with-links><span class=secno>4.8.1.1.8 </span>A group of images that form a single larger picture with links</a></li>
514 <li><a href=#a-key-part-of-the-content><span class=secno>4.8.1.1.9 </span>A key part of the content</a></li>
515 <li><a href=#an-image-not-intended-for-the-user><span class=secno>4.8.1.1.10 </span>An image not intended for the user</a></li>
516 <li><a href=#an-image-in-an-e-mail-or-private-document-intended-for-a-specific-person-who-is-known-to-be-able-to-view-images><span class=secno>4.8.1.1.11 </span>An image in an e-mail or private document intended for a specific person who is known to be able to view images</a></li>
517 <li><a href=#general-guidelines><span class=secno>4.8.1.1.12 </span>General guidelines</a></li>
518 <li><a href=#guidance-for-markup-generators><span class=secno>4.8.1.1.13 </span>Guidance for markup generators</a></li>
519 <li><a href=#guidance-for-conformance-checkers><span class=secno>4.8.1.1.14 </span>Guidance for conformance checkers</a></ol></ol></li>
520 <li><a href=#the-iframe-element><span class=secno>4.8.2 </span>The <code>iframe</code> element</a></li>
521 <li><a href=#the-embed-element><span class=secno>4.8.3 </span>The <code>embed</code> element</a></li>
522 <li><a href=#the-object-element><span class=secno>4.8.4 </span>The <code>object</code> element</a></li>
523 <li><a href=#the-param-element><span class=secno>4.8.5 </span>The <code>param</code> element</a></li>
524 <li><a href=#video><span class=secno>4.8.6 </span>The <code>video</code> element</a></li>
525 <li><a href=#audio><span class=secno>4.8.7 </span>The <code>audio</code> element</a></li>
526 <li><a href=#the-source-element><span class=secno>4.8.8 </span>The <code>source</code> element</a></li>
527 <li><a href=#the-track-element><span class=secno>4.8.9 </span>The <code>track</code> element</a></li>
528 <li><a href=#media-elements><span class=secno>4.8.10 </span>Media elements</a>
530 <li><a href=#error-codes><span class=secno>4.8.10.1 </span>Error codes</a></li>
531 <li><a href=#location-of-the-media-resource><span class=secno>4.8.10.2 </span>Location of the media resource</a></li>
532 <li><a href=#mime-types><span class=secno>4.8.10.3 </span>MIME types</a></li>
533 <li><a href=#network-states><span class=secno>4.8.10.4 </span>Network states</a></li>
534 <li><a href=#loading-the-media-resource><span class=secno>4.8.10.5 </span>Loading the media resource</a></li>
535 <li><a href=#offsets-into-the-media-resource><span class=secno>4.8.10.6 </span>Offsets into the media resource</a></li>
536 <li><a href=#the-ready-states><span class=secno>4.8.10.7 </span>The ready states</a></li>
537 <li><a href=#playing-the-media-resource><span class=secno>4.8.10.8 </span>Playing the media resource</a></li>
538 <li><a href=#seeking><span class=secno>4.8.10.9 </span>Seeking</a></li>
539 <li><a href=#timed-tracks><span class=secno>4.8.10.10 </span>Timed tracks</a>
541 <li><a href=#timed-track-model><span class=secno>4.8.10.10.1 </span>Timed track model</a></li>
542 <li><a href=#sourcing-in-band-timed-tracks><span class=secno>4.8.10.10.2 </span>Sourcing in-band timed tracks</a></li>
543 <li><a href=#sourcing-out-of-band-timed-tracks><span class=secno>4.8.10.10.3 </span>Sourcing out-of-band timed tracks</a></li>
544 <li><a href=#guidelines-for-exposing-cues-in-various-formats-as-timed-track-cues><span class=secno>4.8.10.10.4 </span>Guidelines for exposing cues in various formats as
545 timed track cues</a></li>
546 <li><a href=#timed-track-api><span class=secno>4.8.10.10.5 </span>Timed track API</a></li>
547 <li><a href=#cue-events><span class=secno>4.8.10.10.6 </span>Event definitions</a></ol></li>
548 <li><a href=#websrt><span class=secno>4.8.10.11 </span>WebSRT</a>
550 <li><a href=#syntax-0><span class=secno>4.8.10.11.1 </span>Syntax</a></li>
551 <li><a href=#parsing-0><span class=secno>4.8.10.11.2 </span>Parsing</a></ol></li>
552 <li><a href=#user-interface><span class=secno>4.8.10.12 </span>User interface</a></li>
553 <li><a href=#time-ranges><span class=secno>4.8.10.13 </span>Time ranges</a></li>
554 <li><a href=#mediaevents><span class=secno>4.8.10.14 </span>Event summary</a></li>
555 <li><a href=#security-and-privacy-considerations><span class=secno>4.8.10.15 </span>Security and privacy considerations</a></ol></li>
556 <li><a href=#the-canvas-element><span class=secno>4.8.11 </span>The <code>canvas</code> element</a>
558 <li><a href=#2dcontext><span class=secno>4.8.11.1 </span>The 2D context</a>
560 <li><a href=#the-canvas-state><span class=secno>4.8.11.1.1 </span>The canvas state</a></li>
561 <li><a href=#transformations><span class=secno>4.8.11.1.2 </span>Transformations</a></li>
562 <li><a href=#compositing><span class=secno>4.8.11.1.3 </span>Compositing</a></li>
563 <li><a href=#colors-and-styles><span class=secno>4.8.11.1.4 </span>Colors and styles</a></li>
564 <li><a href=#line-styles><span class=secno>4.8.11.1.5 </span>Line styles</a></li>
565 <li><a href=#shadows><span class=secno>4.8.11.1.6 </span>Shadows</a></li>
566 <li><a href=#simple-shapes-(rectangles)><span class=secno>4.8.11.1.7 </span>Simple shapes (rectangles)</a></li>
567 <li><a href=#complex-shapes-(paths)><span class=secno>4.8.11.1.8 </span>Complex shapes (paths)</a></li>
568 <li><a href=#focus-management-0><span class=secno>4.8.11.1.9 </span>Focus management</a></li>
569 <li><a href=#text-0><span class=secno>4.8.11.1.10 </span>Text</a></li>
570 <li><a href=#images><span class=secno>4.8.11.1.11 </span>Images</a></li>
571 <li><a href=#pixel-manipulation><span class=secno>4.8.11.1.12 </span>Pixel manipulation</a></li>
572 <li><a href=#drawing-model><span class=secno>4.8.11.1.13 </span>Drawing model</a></li>
573 <li><a href=#examples><span class=secno>4.8.11.1.14 </span>Examples</a></ol></li>
574 <li><a href=#color-spaces-and-color-correction><span class=secno>4.8.11.2 </span>Color spaces and color correction</a></li>
575 <li><a href=#security-with-canvas-elements><span class=secno>4.8.11.3 </span>Security with <code>canvas</code> elements</a></ol></li>
576 <li><a href=#the-map-element><span class=secno>4.8.12 </span>The <code>map</code> element</a></li>
577 <li><a href=#the-area-element><span class=secno>4.8.13 </span>The <code>area</code> element</a></li>
578 <li><a href=#image-maps><span class=secno>4.8.14 </span>Image maps</a>
580 <li><a href=#authoring><span class=secno>4.8.14.1 </span>Authoring</a></li>
581 <li><a href=#processing-model><span class=secno>4.8.14.2 </span>Processing model</a></ol></li>
582 <li><a href=#mathml><span class=secno>4.8.15 </span>MathML</a></li>
583 <li><a href=#svg-0><span class=secno>4.8.16 </span>SVG</a></li>
584 <li><a href=#dimension-attributes><span class=secno>4.8.17 </span>Dimension attributes</a></ol></li>
585 <li><a href=#tabular-data><span class=secno>4.9 </span>Tabular data</a>
587 <li><a href=#the-table-element><span class=secno>4.9.1 </span>The <code>table</code> element</a></li>
588 <li><a href=#the-caption-element><span class=secno>4.9.2 </span>The <code>caption</code> element</a></li>
589 <li><a href=#the-colgroup-element><span class=secno>4.9.3 </span>The <code>colgroup</code> element</a></li>
590 <li><a href=#the-col-element><span class=secno>4.9.4 </span>The <code>col</code> element</a></li>
591 <li><a href=#the-tbody-element><span class=secno>4.9.5 </span>The <code>tbody</code> element</a></li>
592 <li><a href=#the-thead-element><span class=secno>4.9.6 </span>The <code>thead</code> element</a></li>
593 <li><a href=#the-tfoot-element><span class=secno>4.9.7 </span>The <code>tfoot</code> element</a></li>
594 <li><a href=#the-tr-element><span class=secno>4.9.8 </span>The <code>tr</code> element</a></li>
595 <li><a href=#the-td-element><span class=secno>4.9.9 </span>The <code>td</code> element</a></li>
596 <li><a href=#the-th-element><span class=secno>4.9.10 </span>The <code>th</code> element</a></li>
597 <li><a href=#attributes-common-to-td-and-th-elements><span class=secno>4.9.11 </span>Attributes common to <code>td</code> and <code>th</code> elements</a></li>
598 <li><a href=#processing-model-0><span class=secno>4.9.12 </span>Processing model</a>
600 <li><a href=#forming-a-table><span class=secno>4.9.12.1 </span>Forming a table</a></li>
601 <li><a href=#header-and-data-cell-semantics><span class=secno>4.9.12.2 </span>Forming relationships between data cells and header cells</a></ol></li>
602 <li><a href=#examples-0><span class=secno>4.9.13 </span>Examples</a></ol></li>
603 <li><a href=#forms><span class=secno>4.10 </span>Forms</a>
605 <li><a href=#introduction-0><span class=secno>4.10.1 </span>Introduction</a>
607 <li><a href="#writing-a-form's-user-interface"><span class=secno>4.10.1.1 </span>Writing a form's user interface</a></li>
608 <li><a href=#implementing-the-server-side-processing-for-a-form><span class=secno>4.10.1.2 </span>Implementing the server-side processing for a form</a></li>
609 <li><a href=#configuring-a-form-to-communicate-with-a-server><span class=secno>4.10.1.3 </span>Configuring a form to communicate with a server</a></li>
610 <li><a href=#client-side-form-validation><span class=secno>4.10.1.4 </span>Client-side form validation</a></ol></li>
611 <li><a href=#categories><span class=secno>4.10.2 </span>Categories</a></li>
612 <li><a href=#the-form-element><span class=secno>4.10.3 </span>The <code>form</code> element</a></li>
613 <li><a href=#the-fieldset-element><span class=secno>4.10.4 </span>The <code>fieldset</code> element</a></li>
614 <li><a href=#the-legend-element><span class=secno>4.10.5 </span>The <code>legend</code> element</a></li>
615 <li><a href=#the-label-element><span class=secno>4.10.6 </span>The <code>label</code> element</a></li>
616 <li><a href=#the-input-element><span class=secno>4.10.7 </span>The <code>input</code> element</a>
618 <li><a href=#states-of-the-type-attribute><span class=secno>4.10.7.1 </span>States of the <code title=attr-input-type>type</code> attribute</a>
620 <li><a href=#hidden-state><span class=secno>4.10.7.1.1 </span>Hidden state</a></li>
621 <li><a href=#text-state-and-search-state><span class=secno>4.10.7.1.2 </span>Text state and Search state</a></li>
622 <li><a href=#telephone-state><span class=secno>4.10.7.1.3 </span>Telephone state</a></li>
623 <li><a href=#url-state><span class=secno>4.10.7.1.4 </span>URL state</a></li>
624 <li><a href=#e-mail-state><span class=secno>4.10.7.1.5 </span>E-mail state</a></li>
625 <li><a href=#password-state><span class=secno>4.10.7.1.6 </span>Password state</a></li>
626 <li><a href=#date-and-time-state><span class=secno>4.10.7.1.7 </span>Date and Time state</a></li>
627 <li><a href=#date-state><span class=secno>4.10.7.1.8 </span>Date state</a></li>
628 <li><a href=#month-state><span class=secno>4.10.7.1.9 </span>Month state</a></li>
629 <li><a href=#week-state><span class=secno>4.10.7.1.10 </span>Week state</a></li>
630 <li><a href=#time-state><span class=secno>4.10.7.1.11 </span>Time state</a></li>
631 <li><a href=#local-date-and-time-state><span class=secno>4.10.7.1.12 </span>Local Date and Time state</a></li>
632 <li><a href=#number-state><span class=secno>4.10.7.1.13 </span>Number state</a></li>
633 <li><a href=#range-state><span class=secno>4.10.7.1.14 </span>Range state</a></li>
634 <li><a href=#color-state><span class=secno>4.10.7.1.15 </span>Color state</a></li>
635 <li><a href=#checkbox-state><span class=secno>4.10.7.1.16 </span>Checkbox state</a></li>
636 <li><a href=#radio-button-state><span class=secno>4.10.7.1.17 </span>Radio Button state</a></li>
637 <li><a href=#file-upload-state><span class=secno>4.10.7.1.18 </span>File Upload state</a></li>
638 <li><a href=#submit-button-state><span class=secno>4.10.7.1.19 </span>Submit Button state</a></li>
639 <li><a href=#image-button-state><span class=secno>4.10.7.1.20 </span>Image Button state</a></li>
640 <li><a href=#reset-button-state><span class=secno>4.10.7.1.21 </span>Reset Button state</a></li>
641 <li><a href=#button-state><span class=secno>4.10.7.1.22 </span>Button state</a></ol></li>
642 <li><a href=#common-input-element-attributes><span class=secno>4.10.7.2 </span>Common <code>input</code> element attributes</a>
644 <li><a href=#the-autocomplete-attribute><span class=secno>4.10.7.2.1 </span>The <code title=attr-input-autocomplete>autocomplete</code> attribute</a></li>
645 <li><a href=#the-list-attribute><span class=secno>4.10.7.2.2 </span>The <code title=attr-input-list>list</code> attribute</a></li>
646 <li><a href=#the-readonly-attribute><span class=secno>4.10.7.2.3 </span>The <code title=attr-input-readonly>readonly</code> attribute</a></li>
647 <li><a href=#the-size-attribute><span class=secno>4.10.7.2.4 </span>The <code title=attr-input-size>size</code> attribute</a></li>
648 <li><a href=#the-required-attribute><span class=secno>4.10.7.2.5 </span>The <code title=attr-input-required>required</code> attribute</a></li>
649 <li><a href=#the-multiple-attribute><span class=secno>4.10.7.2.6 </span>The <code title=attr-input-multiple>multiple</code> attribute</a></li>
650 <li><a href=#the-maxlength-attribute><span class=secno>4.10.7.2.7 </span>The <code title=attr-input-maxlength>maxlength</code> attribute</a></li>
651 <li><a href=#the-pattern-attribute><span class=secno>4.10.7.2.8 </span>The <code title=attr-input-pattern>pattern</code> attribute</a></li>
652 <li><a href=#the-min-and-max-attributes><span class=secno>4.10.7.2.9 </span>The <code title=attr-input-min>min</code> and <code title=attr-input-max>max</code> attributes</a></li>
653 <li><a href=#the-step-attribute><span class=secno>4.10.7.2.10 </span>The <code title=attr-input-step>step</code> attribute</a></li>
654 <li><a href=#the-placeholder-attribute><span class=secno>4.10.7.2.11 </span>The <code title=attr-input-placeholder>placeholder</code> attribute</a></ol></li>
655 <li><a href=#common-input-element-apis><span class=secno>4.10.7.3 </span>Common <code>input</code> element APIs</a></li>
656 <li><a href=#common-event-behaviors><span class=secno>4.10.7.4 </span>Common event behaviors</a></ol></li>
657 <li><a href=#the-button-element><span class=secno>4.10.8 </span>The <code>button</code> element</a></li>
658 <li><a href=#the-select-element><span class=secno>4.10.9 </span>The <code>select</code> element</a></li>
659 <li><a href=#the-datalist-element><span class=secno>4.10.10 </span>The <code>datalist</code> element</a></li>
660 <li><a href=#the-optgroup-element><span class=secno>4.10.11 </span>The <code>optgroup</code> element</a></li>
661 <li><a href=#the-option-element><span class=secno>4.10.12 </span>The <code>option</code> element</a></li>
662 <li><a href=#the-textarea-element><span class=secno>4.10.13 </span>The <code>textarea</code> element</a></li>
663 <li><a href=#the-keygen-element><span class=secno>4.10.14 </span>The <code>keygen</code> element</a></li>
664 <li><a href=#the-output-element><span class=secno>4.10.15 </span>The <code>output</code> element</a></li>
665 <li><a href=#the-progress-element><span class=secno>4.10.16 </span>The <code>progress</code> element</a></li>
666 <li><a href=#the-meter-element><span class=secno>4.10.17 </span>The <code>meter</code> element</a></li>
667 <li><a href=#association-of-controls-and-forms><span class=secno>4.10.18 </span>Association of controls and forms</a></li>
668 <li><a href=#attributes-common-to-form-controls><span class=secno>4.10.19 </span>Attributes common to form controls</a>
670 <li><a href=#naming-form-controls><span class=secno>4.10.19.1 </span>Naming form controls</a></li>
671 <li><a href=#enabling-and-disabling-form-controls><span class=secno>4.10.19.2 </span>Enabling and disabling form controls</a></li>
672 <li><a href="#a-form-control's-value"><span class=secno>4.10.19.3 </span>A form control's value</a></li>
673 <li><a href=#autofocusing-a-form-control><span class=secno>4.10.19.4 </span>Autofocusing a form control</a></li>
674 <li><a href=#limiting-user-input-length><span class=secno>4.10.19.5 </span>Limiting user input length</a></li>
675 <li><a href=#form-submission-0><span class=secno>4.10.19.6 </span>Form submission</a></ol></li>
676 <li><a href=#constraints><span class=secno>4.10.20 </span>Constraints</a>
678 <li><a href=#definitions><span class=secno>4.10.20.1 </span>Definitions</a></li>
679 <li><a href=#constraint-validation><span class=secno>4.10.20.2 </span>Constraint validation</a></li>
680 <li><a href=#the-constraint-validation-api><span class=secno>4.10.20.3 </span>The constraint validation API</a></li>
681 <li><a href=#security-forms><span class=secno>4.10.20.4 </span>Security</a></ol></li>
682 <li><a href=#form-submission><span class=secno>4.10.21 </span>Form submission</a>
684 <li><a href=#introduction-1><span class=secno>4.10.21.1 </span>Introduction</a></li>
685 <li><a href=#implicit-submission><span class=secno>4.10.21.2 </span>Implicit submission</a></li>
686 <li><a href=#form-submission-algorithm><span class=secno>4.10.21.3 </span>Form submission algorithm</a></li>
687 <li><a href=#url-encoded-form-data><span class=secno>4.10.21.4 </span>URL-encoded form data</a></li>
688 <li><a href=#multipart-form-data><span class=secno>4.10.21.5 </span>Multipart form data</a></li>
689 <li><a href=#plain-text-form-data><span class=secno>4.10.21.6 </span>Plain text form data</a></ol></li>
690 <li><a href=#resetting-a-form><span class=secno>4.10.22 </span>Resetting a form</a></li>
691 <li><a href=#event-dispatch><span class=secno>4.10.23 </span>Event dispatch</a></ol></li>
692 <li><a href=#interactive-elements><span class=secno>4.11 </span>Interactive elements</a>
694 <li><a href=#the-details-element><span class=secno>4.11.1 </span>The <code>details</code> element</a></li>
695 <li><a href=#the-summary-element><span class=secno>4.11.2 </span>The <code>summary</code> element</a></li>
696 <li><a href=#the-command><span class=secno>4.11.3 </span>The <code>command</code> element</a></li>
697 <li><a href=#menus><span class=secno>4.11.4 </span>The <code>menu</code> element</a>
699 <li><a href=#menus-intro><span class=secno>4.11.4.1 </span>Introduction</a></li>
700 <li><a href=#building-menus-and-toolbars><span class=secno>4.11.4.2 </span>Building menus and toolbars</a></li>
701 <li><a href=#context-menus><span class=secno>4.11.4.3 </span>Context menus</a></li>
702 <li><a href=#toolbars><span class=secno>4.11.4.4 </span>Toolbars</a></ol></li>
703 <li><a href=#commands><span class=secno>4.11.5 </span>Commands</a>
705 <li><a href=#using-the-a-element-to-define-a-command><span class=secno>4.11.5.1 </span>Using the <code>a</code> element to define a command</a></li>
706 <li><a href=#using-the-button-element-to-define-a-command><span class=secno>4.11.5.2 </span>Using the <code>button</code> element to define a command</a></li>
707 <li><a href=#using-the-input-element-to-define-a-command><span class=secno>4.11.5.3 </span>Using the <code>input</code> element to define a command</a></li>
708 <li><a href=#using-the-option-element-to-define-a-command><span class=secno>4.11.5.4 </span>Using the <code>option</code> element to define a command</a></li>
709 <li><a href=#using-the-command-element-to-define-a-command><span class=secno>4.11.5.5 </span>Using the <code>command</code> element to define
711 <li><a href=#using-the-accesskey-attribute-on-a-label-element-to-define-a-command><span class=secno>4.11.5.6 </span>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>label</code> element to define a command</a></li>
712 <li><a href=#using-the-accesskey-attribute-on-a-legend-element-to-define-a-command><span class=secno>4.11.5.7 </span>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>legend</code> element to define a command</a></li>
713 <li><a href=#using-the-accesskey-attribute-to-define-a-command-on-other-elements><span class=secno>4.11.5.8 </span>Using the <code title=attr-accesskey>accesskey</code> attribute to define a command on other elements</a></ol></li>
714 <li><a href=#devices><span class=secno>4.11.6 </span>The <code>device</code> element</a>
716 <li><a href=#stream-api><span class=secno>4.11.6.1 </span>Stream API</a></li>
717 <li><a href=#peer-to-peer-connections><span class=secno>4.11.6.2 </span>Peer-to-peer connections</a></ol></ol></li>
718 <li><a href=#links><span class=secno>4.12 </span>Links</a>
720 <li><a href=#hyperlink-elements><span class=secno>4.12.1 </span>Hyperlink elements</a></li>
721 <li><a href=#following-hyperlinks><span class=secno>4.12.2 </span>Following hyperlinks</a>
723 <li><a href=#hyperlink-auditing><span class=secno>4.12.2.1 </span>Hyperlink auditing</a></ol></li>
724 <li><a href=#linkTypes><span class=secno>4.12.3 </span>Link types</a>
726 <li><a href=#link-type-alternate><span class=secno>4.12.3.1 </span>Link type "<code>alternate</code>"</a></li>
727 <li><a href=#link-type-archives><span class=secno>4.12.3.2 </span>Link type "<code>archives</code>"</a></li>
728 <li><a href=#link-type-author><span class=secno>4.12.3.3 </span>Link type "<code>author</code>"</a></li>
729 <li><a href=#link-type-bookmark><span class=secno>4.12.3.4 </span>Link type "<code>bookmark</code>"</a></li>
730 <li><a href=#link-type-external><span class=secno>4.12.3.5 </span>Link type "<code>external</code>"</a></li>
731 <li><a href=#link-type-help><span class=secno>4.12.3.6 </span>Link type "<code>help</code>"</a></li>
732 <li><a href=#rel-icon><span class=secno>4.12.3.7 </span>Link type "<code>icon</code>"</a></li>
733 <li><a href=#link-type-license><span class=secno>4.12.3.8 </span>Link type "<code>license</code>"</a></li>
734 <li><a href=#link-type-nofollow><span class=secno>4.12.3.9 </span>Link type "<code>nofollow</code>"</a></li>
735 <li><a href=#link-type-noreferrer><span class=secno>4.12.3.10 </span>Link type "<code>noreferrer</code>"</a></li>
736 <li><a href=#link-type-pingback><span class=secno>4.12.3.11 </span>Link type "<code>pingback</code>"</a></li>
737 <li><a href=#link-type-prefetch><span class=secno>4.12.3.12 </span>Link type "<code>prefetch</code>"</a></li>
738 <li><a href=#link-type-search><span class=secno>4.12.3.13 </span>Link type "<code>search</code>"</a></li>
739 <li><a href=#link-type-stylesheet><span class=secno>4.12.3.14 </span>Link type "<code>stylesheet</code>"</a></li>
740 <li><a href=#link-type-sidebar><span class=secno>4.12.3.15 </span>Link type "<code>sidebar</code>"</a></li>
741 <li><a href=#link-type-tag><span class=secno>4.12.3.16 </span>Link type "<code>tag</code>"</a></li>
742 <li><a href=#hierarchical-link-types><span class=secno>4.12.3.17 </span>Hierarchical link types</a>
744 <li><a href=#link-type-index><span class=secno>4.12.3.17.1 </span>Link type "<code>index</code>"</a></li>
745 <li><a href=#link-type-up><span class=secno>4.12.3.17.2 </span>Link type "<code>up</code>"</a></ol></li>
746 <li><a href=#sequential-link-types><span class=secno>4.12.3.18 </span>Sequential link types</a>
748 <li><a href=#link-type-first><span class=secno>4.12.3.18.1 </span>Link type "<code>first</code>"</a></li>
749 <li><a href=#link-type-last><span class=secno>4.12.3.18.2 </span>Link type "<code>last</code>"</a></li>
750 <li><a href=#link-type-next><span class=secno>4.12.3.18.3 </span>Link type "<code>next</code>"</a></li>
751 <li><a href=#link-type-prev><span class=secno>4.12.3.18.4 </span>Link type "<code>prev</code>"</a></ol></li>
752 <li><a href=#other-link-types><span class=secno>4.12.3.19 </span>Other link types</a></ol></ol></li>
753 <li><a href=#common-idioms-without-dedicated-elements><span class=secno>4.13 </span>Common idioms without dedicated elements</a>
755 <li><a href=#tag-clouds><span class=secno>4.13.1 </span>Tag clouds</a></li>
756 <li><a href=#conversations><span class=secno>4.13.2 </span>Conversations</a></li>
757 <li><a href=#footnotes><span class=secno>4.13.3 </span>Footnotes</a></ol></li>
758 <li><a href=#matching-html-elements-using-selectors><span class=secno>4.14 </span>Matching HTML elements using selectors</a>
760 <li><a href=#selectors><span class=secno>4.14.1 </span>Case-sensitivity</a></li>
761 <li><a href=#pseudo-classes><span class=secno>4.14.2 </span>Pseudo-classes</a></ol></ol></li>
762 <li><a href=#microdata><span class=secno>5 </span>Microdata</a>
764 <li><a href=#introduction-2><span class=secno>5.1 </span>Introduction</a>
766 <li><a href=#overview><span class=secno>5.1.1 </span>Overview</a></li>
767 <li><a href=#the-basic-syntax><span class=secno>5.1.2 </span>The basic syntax</a></li>
768 <li><a href=#typed-items><span class=secno>5.1.3 </span>Typed items</a></li>
769 <li><a href=#global-identifiers-for-items><span class=secno>5.1.4 </span>Global identifiers for items</a></li>
770 <li><a href=#selecting-names-when-defining-vocabularies><span class=secno>5.1.5 </span>Selecting names when defining vocabularies</a></li>
771 <li><a href=#using-the-microdata-dom-api><span class=secno>5.1.6 </span>Using the microdata DOM API</a></ol></li>
772 <li><a href=#encoding-microdata><span class=secno>5.2 </span>Encoding microdata</a>
774 <li><a href=#the-microdata-model><span class=secno>5.2.1 </span>The microdata model</a></li>
775 <li><a href=#items><span class=secno>5.2.2 </span>Items</a></li>
776 <li><a href=#names:-the-itemprop-attribute><span class=secno>5.2.3 </span>Names: the <code>itemprop</code> attribute</a></li>
777 <li><a href=#values><span class=secno>5.2.4 </span>Values</a></li>
778 <li><a href=#associating-names-with-items><span class=secno>5.2.5 </span>Associating names with items</a></ol></li>
779 <li><a href=#microdata-dom-api><span class=secno>5.3 </span>Microdata DOM API</a></li>
780 <li><a href=#mdvocabs><span class=secno>5.4 </span>Microdata vocabularies</a>
782 <li><a href=#vcard><span class=secno>5.4.1 </span>vCard</a>
784 <li><a href=#conversion-to-vcard><span class=secno>5.4.1.1 </span>Conversion to vCard</a></li>
785 <li><a href=#examples-1><span class=secno>5.4.1.2 </span>Examples</a></ol></li>
786 <li><a href=#vevent><span class=secno>5.4.2 </span>vEvent</a>
788 <li><a href=#conversion-to-icalendar><span class=secno>5.4.2.1 </span>Conversion to iCalendar</a></li>
789 <li><a href=#examples-2><span class=secno>5.4.2.2 </span>Examples</a></ol></li>
790 <li><a href=#licensing-works><span class=secno>5.4.3 </span>Licensing works</a>
792 <li><a href=#conversion-to-rdf><span class=secno>5.4.3.1 </span>Conversion to RDF</a></li>
793 <li><a href=#examples-3><span class=secno>5.4.3.2 </span>Examples</a></ol></ol></li>
794 <li><a href=#converting-html-to-other-formats><span class=secno>5.5 </span>Converting HTML to other formats</a>
796 <li><a href=#json><span class=secno>5.5.1 </span>JSON</a></li>
797 <li><a href=#rdf><span class=secno>5.5.2 </span>RDF</a>
799 <li><a href=#examples-4><span class=secno>5.5.2.1 </span>Examples</a></ol></li>
800 <li><a href=#atom><span class=secno>5.5.3 </span>Atom</a></ol></ol></li>
801 <li><a href=#browsers><span class=secno>6 </span>Loading Web pages</a>
803 <li><a href=#windows><span class=secno>6.1 </span>Browsing contexts</a>
805 <li><a href=#nested-browsing-contexts><span class=secno>6.1.1 </span>Nested browsing contexts</a>
807 <li><a href=#navigating-nested-browsing-contexts-in-the-dom><span class=secno>6.1.1.1 </span>Navigating nested browsing contexts in the DOM</a></ol></li>
808 <li><a href=#auxiliary-browsing-contexts><span class=secno>6.1.2 </span>Auxiliary browsing contexts</a>
810 <li><a href=#navigating-auxiliary-browsing-contexts-in-the-dom><span class=secno>6.1.2.1 </span>Navigating auxiliary browsing contexts in the DOM</a></ol></li>
811 <li><a href=#secondary-browsing-contexts><span class=secno>6.1.3 </span>Secondary browsing contexts</a></li>
812 <li><a href=#security-nav><span class=secno>6.1.4 </span>Security</a></li>
813 <li><a href=#groupings-of-browsing-contexts><span class=secno>6.1.5 </span>Groupings of browsing contexts</a></li>
814 <li><a href=#browsing-context-names><span class=secno>6.1.6 </span>Browsing context names</a></ol></li>
815 <li><a href=#the-window-object><span class=secno>6.2 </span>The <code>Window</code> object</a>
817 <li><a href=#security-window><span class=secno>6.2.1 </span>Security</a></li>
818 <li><a href=#apis-for-creating-and-navigating-browsing-contexts-by-name><span class=secno>6.2.2 </span>APIs for creating and navigating browsing contexts by name</a></li>
819 <li><a href=#accessing-other-browsing-contexts><span class=secno>6.2.3 </span>Accessing other browsing contexts</a></li>
820 <li><a href=#named-access-on-the-window-object><span class=secno>6.2.4 </span>Named access on the <code>Window</code> object</a></li>
821 <li><a href=#garbage-collection-and-browsing-contexts><span class=secno>6.2.5 </span>Garbage collection and browsing contexts</a></li>
822 <li><a href=#browser-interface-elements><span class=secno>6.2.6 </span>Browser interface elements</a></li>
823 <li><a href=#the-windowproxy-object><span class=secno>6.2.7 </span>The <code>WindowProxy</code> object</a></ol></li>
824 <li><a href=#origin-0><span class=secno>6.3 </span>Origin</a>
826 <li><a href=#relaxing-the-same-origin-restriction><span class=secno>6.3.1 </span>Relaxing the same-origin restriction</a></ol></li>
827 <li><a href=#history><span class=secno>6.4 </span>Session history and navigation</a>
829 <li><a href=#the-session-history-of-browsing-contexts><span class=secno>6.4.1 </span>The session history of browsing contexts</a></li>
830 <li><a href=#the-history-interface><span class=secno>6.4.2 </span>The <code>History</code> interface</a></li>
831 <li><a href=#the-location-interface><span class=secno>6.4.3 </span>The <code>Location</code> interface</a>
833 <li><a href=#security-location><span class=secno>6.4.3.1 </span>Security</a></ol></li>
834 <li><a href=#history-notes><span class=secno>6.4.4 </span>Implementation notes for session history</a></ol></li>
835 <li><a href=#browsing-the-web><span class=secno>6.5 </span>Browsing the Web</a>
837 <li><a href=#navigating-across-documents><span class=secno>6.5.1 </span>Navigating across documents</a></li>
838 <li><a href=#read-html><span class=secno>6.5.2 </span>Page load processing model for HTML files</a></li>
839 <li><a href=#read-xml><span class=secno>6.5.3 </span>Page load processing model for XML files</a></li>
840 <li><a href=#read-text><span class=secno>6.5.4 </span>Page load processing model for text files</a></li>
841 <li><a href=#read-image><span class=secno>6.5.5 </span>Page load processing model for images</a></li>
842 <li><a href=#read-plugin><span class=secno>6.5.6 </span>Page load processing model for content that uses plugins</a></li>
843 <li><a href=#read-ua-inline><span class=secno>6.5.7 </span>Page load processing model for inline content that doesn't have a DOM</a></li>
844 <li><a href=#scroll-to-fragid><span class=secno>6.5.8 </span>Navigating to a fragment identifier</a></li>
845 <li><a href=#history-traversal><span class=secno>6.5.9 </span>History traversal</a>
847 <li><a href=#event-definitions><span class=secno>6.5.9.1 </span>Event definitions</a></ol></li>
848 <li><a href=#unloading-documents><span class=secno>6.5.10 </span>Unloading documents</a>
850 <li><a href=#event-definition><span class=secno>6.5.10.1 </span>Event definition</a></ol></li>
851 <li><a href=#aborting-a-document-load><span class=secno>6.5.11 </span>Aborting a document load</a></ol></li>
852 <li><a href=#offline><span class=secno>6.6 </span>Offline Web applications</a>
854 <li><a href=#introduction-3><span class=secno>6.6.1 </span>Introduction</a>
856 <li><a href=#appcacheevents><span class=secno>6.6.1.1 </span>Event summary</a></ol></li>
857 <li><a href=#appcache><span class=secno>6.6.2 </span>Application caches</a></li>
858 <li><a href=#manifests><span class=secno>6.6.3 </span>The cache manifest syntax</a>
860 <li><a href=#a-sample-manifest><span class=secno>6.6.3.1 </span>A sample manifest</a></li>
861 <li><a href=#writing-cache-manifests><span class=secno>6.6.3.2 </span>Writing cache manifests</a></li>
862 <li><a href=#parsing-cache-manifests><span class=secno>6.6.3.3 </span>Parsing cache manifests</a></ol></li>
863 <li><a href=#downloading-or-updating-an-application-cache><span class=secno>6.6.4 </span>Downloading or updating an application cache</a></li>
864 <li><a href=#the-application-cache-selection-algorithm><span class=secno>6.6.5 </span>The application cache selection algorithm</a></li>
865 <li><a href=#changesToNetworkingModel><span class=secno>6.6.6 </span>Changes to the networking model</a></li>
866 <li><a href=#expiring-application-caches><span class=secno>6.6.7 </span>Expiring application caches</a></li>
867 <li><a href=#application-cache-api><span class=secno>6.6.8 </span>Application cache API</a></li>
868 <li><a href=#browser-state><span class=secno>6.6.9 </span>Browser state</a></ol></ol></li>
869 <li><a href=#webappapis><span class=secno>7 </span>Web application APIs</a>
871 <li><a href=#scripting><span class=secno>7.1 </span>Scripting</a>
873 <li><a href=#introduction-4><span class=secno>7.1.1 </span>Introduction</a></li>
874 <li><a href=#enabling-and-disabling-scripting><span class=secno>7.1.2 </span>Enabling and disabling scripting</a></li>
875 <li><a href=#processing-model-1><span class=secno>7.1.3 </span>Processing model</a>
877 <li><a href=#definitions-0><span class=secno>7.1.3.1 </span>Definitions</a></li>
878 <li><a href=#calling-scripts><span class=secno>7.1.3.2 </span>Calling scripts</a></li>
879 <li><a href=#creating-scripts><span class=secno>7.1.3.3 </span>Creating scripts</a></li>
880 <li><a href=#killing-scripts><span class=secno>7.1.3.4 </span>Killing scripts</a></ol></li>
881 <li><a href=#event-loops><span class=secno>7.1.4 </span>Event loops</a>
883 <li><a href=#definitions-1><span class=secno>7.1.4.1 </span>Definitions</a></li>
884 <li><a href=#processing-model-2><span class=secno>7.1.4.2 </span>Processing model</a></li>
885 <li><a href=#generic-task-sources><span class=secno>7.1.4.3 </span>Generic task sources</a></ol></li>
886 <li><a href=#javascript-protocol><span class=secno>7.1.5 </span>The <code title="">javascript:</code> protocol</a></li>
887 <li><a href=#events><span class=secno>7.1.6 </span>Events</a>
889 <li><a href=#event-handler-attributes><span class=secno>7.1.6.1 </span>Event handlers</a></li>
890 <li><a href=#event-handlers-on-elements,-document-objects,-and-window-objects><span class=secno>7.1.6.2 </span>Event handlers on elements, <code>Document</code> objects, and <code>Window</code> objects</a></li>
891 <li><a href=#event-firing><span class=secno>7.1.6.3 </span>Event firing</a></li>
892 <li><a href=#events-and-the-window-object><span class=secno>7.1.6.4 </span>Events and the <code>Window</code> object</a></li>
893 <li><a href=#runtime-script-errors><span class=secno>7.1.6.5 </span>Runtime script errors</a></ol></ol></li>
894 <li><a href=#timers><span class=secno>7.2 </span>Timers</a></li>
895 <li><a href=#user-prompts><span class=secno>7.3 </span>User prompts</a>
897 <li><a href=#simple-dialogs><span class=secno>7.3.1 </span>Simple dialogs</a></li>
898 <li><a href=#printing><span class=secno>7.3.2 </span>Printing</a></li>
899 <li><a href=#dialogs-implemented-using-separate-documents><span class=secno>7.3.3 </span>Dialogs implemented using separate documents</a></ol></li>
900 <li><a href=#system-state-and-capabilities><span class=secno>7.4 </span>System state and capabilities</a>
902 <li><a href=#client-identification><span class=secno>7.4.1 </span>Client identification</a></li>
903 <li><a href=#custom-handlers><span class=secno>7.4.2 </span>Custom scheme and content handlers</a>
905 <li><a href=#security-and-privacy><span class=secno>7.4.2.1 </span>Security and privacy</a></li>
906 <li><a href=#sample-handler-impl><span class=secno>7.4.2.2 </span>Sample user interface</a></ol></li>
907 <li><a href=#manually-releasing-the-storage-mutex><span class=secno>7.4.3 </span>Manually releasing the storage mutex</a></ol></ol></li>
908 <li><a href=#editing><span class=secno>8 </span>User interaction</a>
910 <li><a href=#the-hidden-attribute><span class=secno>8.1 </span>The <code>hidden</code> attribute</a></li>
911 <li><a href=#activation><span class=secno>8.2 </span>Activation</a></li>
912 <li><a href=#scrolling-elements-into-view><span class=secno>8.3 </span>Scrolling elements into view</a></li>
913 <li><a href=#focus><span class=secno>8.4 </span>Focus</a>
915 <li><a href=#sequential-focus-navigation><span class=secno>8.4.1 </span>Sequential focus navigation</a></li>
916 <li><a href=#focus-management><span class=secno>8.4.2 </span>Focus management</a></li>
917 <li><a href=#document-level-focus-apis><span class=secno>8.4.3 </span>Document-level focus APIs</a></li>
918 <li><a href=#element-level-focus-apis><span class=secno>8.4.4 </span>Element-level focus APIs</a></ol></li>
919 <li><a href=#the-accesskey-attribute><span class=secno>8.5 </span>The <code>accesskey</code> attribute</a></li>
920 <li><a href=#selection><span class=secno>8.6 </span>The text selection APIs</a>
922 <li><a href=#documentSelection><span class=secno>8.6.1 </span>APIs for the browsing context selection</a></li>
923 <li><a href=#textFieldSelection><span class=secno>8.6.2 </span>APIs for the text field selections</a></ol></li>
924 <li><a href=#contenteditable><span class=secno>8.7 </span>The <code title=attr-contenteditable>contenteditable</code> attribute</a>
926 <li><a href=#user-editing-actions><span class=secno>8.7.1 </span>User editing actions</a></li>
927 <li><a href=#making-entire-documents-editable><span class=secno>8.7.2 </span>Making entire documents editable</a></ol></li>
928 <li><a href=#spelling-and-grammar-checking><span class=secno>8.8 </span>Spelling and grammar checking</a></li>
929 <li><a href=#dnd><span class=secno>8.9 </span>Drag and drop</a>
931 <li><a href=#introduction-5><span class=secno>8.9.1 </span>Introduction</a></li>
932 <li><a href=#the-dragevent-and-datatransfer-interfaces><span class=secno>8.9.2 </span>The <code>DragEvent</code> and <code>DataTransfer</code> interfaces</a></li>
933 <li><a href=#dndevents><span class=secno>8.9.3 </span>Events fired during a drag-and-drop action</a></li>
934 <li><a href=#drag-and-drop-processing-model><span class=secno>8.9.4 </span>Drag-and-drop processing model</a>
936 <li><a href=#when-the-drag-and-drop-operation-starts-or-ends-in-another-document><span class=secno>8.9.4.1 </span>When the drag-and-drop operation starts or ends in another
938 <li><a href=#when-the-drag-and-drop-operation-starts-or-ends-in-another-application><span class=secno>8.9.4.2 </span>When the drag-and-drop operation starts or ends in another
939 application</a></ol></li>
940 <li><a href=#the-draggable-attribute><span class=secno>8.9.5 </span>The <code>draggable</code> attribute</a></li>
941 <li><a href=#security-risks-in-the-drag-and-drop-model><span class=secno>8.9.6 </span>Security risks in the drag-and-drop model</a></ol></li>
942 <li><a href=#undo><span class=secno>8.10 </span>Undo history</a>
944 <li><a href=#definitions-2><span class=secno>8.10.1 </span>Definitions</a></li>
945 <li><a href=#the-undomanager-interface><span class=secno>8.10.2 </span>The <code>UndoManager</code> interface</a></li>
946 <li><a href=#undo:-moving-back-in-the-undo-transaction-history><span class=secno>8.10.3 </span>Undo: moving back in the undo transaction history</a></li>
947 <li><a href=#redo:-moving-forward-in-the-undo-transaction-history><span class=secno>8.10.4 </span>Redo: moving forward in the undo transaction history</a></li>
948 <li><a href=#the-undomanagerevent-interface-and-the-undo-and-redo-events><span class=secno>8.10.5 </span>The <code>UndoManagerEvent</code> interface and the <code title=event-undo>undo</code> and <code title=event-redo>redo</code> events</a></li>
949 <li><a href=#implementation-notes><span class=secno>8.10.6 </span>Implementation notes</a></ol></li>
950 <li><a href=#editing-apis><span class=secno>8.11 </span>Editing APIs</a></ol></li>
951 <li><a href=#comms><span class=secno>9 </span>Communication</a>
953 <li><a href=#event-definitions-0><span class=secno>9.1 </span>Event definitions</a></li>
954 <li><a href=#web-messaging><span class=secno>9.2 </span>Cross-document messaging</a>
956 <li><a href=#introduction-6><span class=secno>9.2.1 </span>Introduction</a></li>
957 <li><a href=#security-postmsg><span class=secno>9.2.2 </span>Security</a>
959 <li><a href=#authors><span class=secno>9.2.2.1 </span>Authors</a></li>
960 <li><a href=#user-agents><span class=secno>9.2.2.2 </span>User agents</a></ol></li>
961 <li><a href=#posting-messages><span class=secno>9.2.3 </span>Posting messages</a></ol></li>
962 <li><a href=#channel-messaging><span class=secno>9.3 </span>Channel messaging</a>
964 <li><a href=#introduction-7><span class=secno>9.3.1 </span>Introduction</a></li>
965 <li><a href=#message-channels><span class=secno>9.3.2 </span>Message channels</a></li>
966 <li><a href=#message-ports><span class=secno>9.3.3 </span>Message ports</a>
968 <li><a href=#ports-and-garbage-collection><span class=secno>9.3.3.1 </span>Ports and garbage collection</a></ol></ol></ol></li>
969 <li><a href=#syntax><span class=secno>10 </span>The HTML syntax</a>
971 <li><a href=#writing><span class=secno>10.1 </span>Writing HTML documents</a>
973 <li><a href=#the-doctype><span class=secno>10.1.1 </span>The DOCTYPE</a></li>
974 <li><a href=#elements-0><span class=secno>10.1.2 </span>Elements</a>
976 <li><a href=#start-tags><span class=secno>10.1.2.1 </span>Start tags</a></li>
977 <li><a href=#end-tags><span class=secno>10.1.2.2 </span>End tags</a></li>
978 <li><a href=#attributes-0><span class=secno>10.1.2.3 </span>Attributes</a></li>
979 <li><a href=#optional-tags><span class=secno>10.1.2.4 </span>Optional tags</a></li>
980 <li><a href=#element-restrictions><span class=secno>10.1.2.5 </span>Restrictions on content models</a></li>
981 <li><a href=#cdata-rcdata-restrictions><span class=secno>10.1.2.6 </span>Restrictions on the contents of raw text and RCDATA elements</a></ol></li>
982 <li><a href=#text-1><span class=secno>10.1.3 </span>Text</a>
984 <li><a href=#newlines><span class=secno>10.1.3.1 </span>Newlines</a></ol></li>
985 <li><a href=#character-references><span class=secno>10.1.4 </span>Character references</a></li>
986 <li><a href=#cdata-sections><span class=secno>10.1.5 </span>CDATA sections</a></li>
987 <li><a href=#comments><span class=secno>10.1.6 </span>Comments</a></ol></li>
988 <li><a href=#parsing><span class=secno>10.2 </span>Parsing HTML documents</a>
990 <li><a href=#overview-of-the-parsing-model><span class=secno>10.2.1 </span>Overview of the parsing model</a></li>
991 <li><a href=#the-input-stream><span class=secno>10.2.2 </span>The input stream</a>
993 <li><a href=#determining-the-character-encoding><span class=secno>10.2.2.1 </span>Determining the character encoding</a></li>
994 <li><a href=#character-encodings-0><span class=secno>10.2.2.2 </span>Character encodings</a></li>
995 <li><a href=#preprocessing-the-input-stream><span class=secno>10.2.2.3 </span>Preprocessing the input stream</a></li>
996 <li><a href=#changing-the-encoding-while-parsing><span class=secno>10.2.2.4 </span>Changing the encoding while parsing</a></ol></li>
997 <li><a href=#parse-state><span class=secno>10.2.3 </span>Parse state</a>
999 <li><a href=#the-insertion-mode><span class=secno>10.2.3.1 </span>The insertion mode</a></li>
1000 <li><a href=#the-stack-of-open-elements><span class=secno>10.2.3.2 </span>The stack of open elements</a></li>
1001 <li><a href=#the-list-of-active-formatting-elements><span class=secno>10.2.3.3 </span>The list of active formatting elements</a></li>
1002 <li><a href=#the-element-pointers><span class=secno>10.2.3.4 </span>The element pointers</a></li>
1003 <li><a href=#other-parsing-state-flags><span class=secno>10.2.3.5 </span>Other parsing state flags</a></ol></li>
1004 <li><a href=#tokenization><span class=secno>10.2.4 </span>Tokenization</a>
1006 <li><a href=#data-state><span class=secno>10.2.4.1 </span>Data state</a></li>
1007 <li><a href=#character-reference-in-data-state><span class=secno>10.2.4.2 </span>Character reference in data state</a></li>
1008 <li><a href=#rcdata-state><span class=secno>10.2.4.3 </span>RCDATA state</a></li>
1009 <li><a href=#character-reference-in-rcdata-state><span class=secno>10.2.4.4 </span>Character reference in RCDATA state</a></li>
1010 <li><a href=#rawtext-state><span class=secno>10.2.4.5 </span>RAWTEXT state</a></li>
1011 <li><a href=#script-data-state><span class=secno>10.2.4.6 </span>Script data state</a></li>
1012 <li><a href=#plaintext-state><span class=secno>10.2.4.7 </span>PLAINTEXT state</a></li>
1013 <li><a href=#tag-open-state><span class=secno>10.2.4.8 </span>Tag open state</a></li>
1014 <li><a href=#end-tag-open-state><span class=secno>10.2.4.9 </span>End tag open state</a></li>
1015 <li><a href=#tag-name-state><span class=secno>10.2.4.10 </span>Tag name state</a></li>
1016 <li><a href=#rcdata-less-than-sign-state><span class=secno>10.2.4.11 </span>RCDATA less-than sign state</a></li>
1017 <li><a href=#rcdata-end-tag-open-state><span class=secno>10.2.4.12 </span>RCDATA end tag open state</a></li>
1018 <li><a href=#rcdata-end-tag-name-state><span class=secno>10.2.4.13 </span>RCDATA end tag name state</a></li>
1019 <li><a href=#rawtext-less-than-sign-state><span class=secno>10.2.4.14 </span>RAWTEXT less-than sign state</a></li>
1020 <li><a href=#rawtext-end-tag-open-state><span class=secno>10.2.4.15 </span>RAWTEXT end tag open state</a></li>
1021 <li><a href=#rawtext-end-tag-name-state><span class=secno>10.2.4.16 </span>RAWTEXT end tag name state</a></li>
1022 <li><a href=#script-data-less-than-sign-state><span class=secno>10.2.4.17 </span>Script data less-than sign state</a></li>
1023 <li><a href=#script-data-end-tag-open-state><span class=secno>10.2.4.18 </span>Script data end tag open state</a></li>
1024 <li><a href=#script-data-end-tag-name-state><span class=secno>10.2.4.19 </span>Script data end tag name state</a></li>
1025 <li><a href=#script-data-escape-start-state><span class=secno>10.2.4.20 </span>Script data escape start state</a></li>
1026 <li><a href=#script-data-escape-start-dash-state><span class=secno>10.2.4.21 </span>Script data escape start dash state</a></li>
1027 <li><a href=#script-data-escaped-state><span class=secno>10.2.4.22 </span>Script data escaped state</a></li>
1028 <li><a href=#script-data-escaped-dash-state><span class=secno>10.2.4.23 </span>Script data escaped dash state</a></li>
1029 <li><a href=#script-data-escaped-dash-dash-state><span class=secno>10.2.4.24 </span>Script data escaped dash dash state</a></li>
1030 <li><a href=#script-data-escaped-less-than-sign-state><span class=secno>10.2.4.25 </span>Script data escaped less-than sign state</a></li>
1031 <li><a href=#script-data-escaped-end-tag-open-state><span class=secno>10.2.4.26 </span>Script data escaped end tag open state</a></li>
1032 <li><a href=#script-data-escaped-end-tag-name-state><span class=secno>10.2.4.27 </span>Script data escaped end tag name state</a></li>
1033 <li><a href=#script-data-double-escape-start-state><span class=secno>10.2.4.28 </span>Script data double escape start state</a></li>
1034 <li><a href=#script-data-double-escaped-state><span class=secno>10.2.4.29 </span>Script data double escaped state</a></li>
1035 <li><a href=#script-data-double-escaped-dash-state><span class=secno>10.2.4.30 </span>Script data double escaped dash state</a></li>
1036 <li><a href=#script-data-double-escaped-dash-dash-state><span class=secno>10.2.4.31 </span>Script data double escaped dash dash state</a></li>
1037 <li><a href=#script-data-double-escaped-less-than-sign-state><span class=secno>10.2.4.32 </span>Script data double escaped less-than sign state</a></li>
1038 <li><a href=#script-data-double-escape-end-state><span class=secno>10.2.4.33 </span>Script data double escape end state</a></li>
1039 <li><a href=#before-attribute-name-state><span class=secno>10.2.4.34 </span>Before attribute name state</a></li>
1040 <li><a href=#attribute-name-state><span class=secno>10.2.4.35 </span>Attribute name state</a></li>
1041 <li><a href=#after-attribute-name-state><span class=secno>10.2.4.36 </span>After attribute name state</a></li>
1042 <li><a href=#before-attribute-value-state><span class=secno>10.2.4.37 </span>Before attribute value state</a></li>
1043 <li><a href=#attribute-value-(double-quoted)-state><span class=secno>10.2.4.38 </span>Attribute value (double-quoted) state</a></li>
1044 <li><a href=#attribute-value-(single-quoted)-state><span class=secno>10.2.4.39 </span>Attribute value (single-quoted) state</a></li>
1045 <li><a href=#attribute-value-(unquoted)-state><span class=secno>10.2.4.40 </span>Attribute value (unquoted) state</a></li>
1046 <li><a href=#character-reference-in-attribute-value-state><span class=secno>10.2.4.41 </span>Character reference in attribute value state</a></li>
1047 <li><a href=#after-attribute-value-(quoted)-state><span class=secno>10.2.4.42 </span>After attribute value (quoted) state</a></li>
1048 <li><a href=#self-closing-start-tag-state><span class=secno>10.2.4.43 </span>Self-closing start tag state</a></li>
1049 <li><a href=#bogus-comment-state><span class=secno>10.2.4.44 </span>Bogus comment state</a></li>
1050 <li><a href=#markup-declaration-open-state><span class=secno>10.2.4.45 </span>Markup declaration open state</a></li>
1051 <li><a href=#comment-start-state><span class=secno>10.2.4.46 </span>Comment start state</a></li>
1052 <li><a href=#comment-start-dash-state><span class=secno>10.2.4.47 </span>Comment start dash state</a></li>
1053 <li><a href=#comment-state><span class=secno>10.2.4.48 </span>Comment state</a></li>
1054 <li><a href=#comment-end-dash-state><span class=secno>10.2.4.49 </span>Comment end dash state</a></li>
1055 <li><a href=#comment-end-state><span class=secno>10.2.4.50 </span>Comment end state</a></li>
1056 <li><a href=#comment-end-bang-state><span class=secno>10.2.4.51 </span>Comment end bang state</a></li>
1057 <li><a href=#comment-end-space-state><span class=secno>10.2.4.52 </span>Comment end space state</a></li>
1058 <li><a href=#doctype-state><span class=secno>10.2.4.53 </span>DOCTYPE state</a></li>
1059 <li><a href=#before-doctype-name-state><span class=secno>10.2.4.54 </span>Before DOCTYPE name state</a></li>
1060 <li><a href=#doctype-name-state><span class=secno>10.2.4.55 </span>DOCTYPE name state</a></li>
1061 <li><a href=#after-doctype-name-state><span class=secno>10.2.4.56 </span>After DOCTYPE name state</a></li>
1062 <li><a href=#after-doctype-public-keyword-state><span class=secno>10.2.4.57 </span>After DOCTYPE public keyword state</a></li>
1063 <li><a href=#before-doctype-public-identifier-state><span class=secno>10.2.4.58 </span>Before DOCTYPE public identifier state</a></li>
1064 <li><a href=#doctype-public-identifier-(double-quoted)-state><span class=secno>10.2.4.59 </span>DOCTYPE public identifier (double-quoted) state</a></li>
1065 <li><a href=#doctype-public-identifier-(single-quoted)-state><span class=secno>10.2.4.60 </span>DOCTYPE public identifier (single-quoted) state</a></li>
1066 <li><a href=#after-doctype-public-identifier-state><span class=secno>10.2.4.61 </span>After DOCTYPE public identifier state</a></li>
1067 <li><a href=#between-doctype-public-and-system-identifiers-state><span class=secno>10.2.4.62 </span>Between DOCTYPE public and system identifiers state</a></li>
1068 <li><a href=#after-doctype-system-keyword-state><span class=secno>10.2.4.63 </span>After DOCTYPE system keyword state</a></li>
1069 <li><a href=#before-doctype-system-identifier-state><span class=secno>10.2.4.64 </span>Before DOCTYPE system identifier state</a></li>
1070 <li><a href=#doctype-system-identifier-(double-quoted)-state><span class=secno>10.2.4.65 </span>DOCTYPE system identifier (double-quoted) state</a></li>
1071 <li><a href=#doctype-system-identifier-(single-quoted)-state><span class=secno>10.2.4.66 </span>DOCTYPE system identifier (single-quoted) state</a></li>
1072 <li><a href=#after-doctype-system-identifier-state><span class=secno>10.2.4.67 </span>After DOCTYPE system identifier state</a></li>
1073 <li><a href=#bogus-doctype-state><span class=secno>10.2.4.68 </span>Bogus DOCTYPE state</a></li>
1074 <li><a href=#cdata-section-state><span class=secno>10.2.4.69 </span>CDATA section state</a></li>
1075 <li><a href=#tokenizing-character-references><span class=secno>10.2.4.70 </span>Tokenizing character references</a></ol></li>
1076 <li><a href=#tree-construction><span class=secno>10.2.5 </span>Tree construction</a>
1078 <li><a href=#creating-and-inserting-elements><span class=secno>10.2.5.1 </span>Creating and inserting elements</a></li>
1079 <li><a href=#closing-elements-that-have-implied-end-tags><span class=secno>10.2.5.2 </span>Closing elements that have implied end tags</a></li>
1080 <li><a href=#foster-parenting><span class=secno>10.2.5.3 </span>Foster parenting</a></li>
1081 <li><a href=#the-initial-insertion-mode><span class=secno>10.2.5.4 </span>The "initial" insertion mode</a></li>
1082 <li><a href=#the-before-html-insertion-mode><span class=secno>10.2.5.5 </span>The "before html" insertion mode</a></li>
1083 <li><a href=#the-before-head-insertion-mode><span class=secno>10.2.5.6 </span>The "before head" insertion mode</a></li>
1084 <li><a href=#parsing-main-inhead><span class=secno>10.2.5.7 </span>The "in head" insertion mode</a></li>
1085 <li><a href=#parsing-main-inheadnoscript><span class=secno>10.2.5.8 </span>The "in head noscript" insertion mode</a></li>
1086 <li><a href=#the-after-head-insertion-mode><span class=secno>10.2.5.9 </span>The "after head" insertion mode</a></li>
1087 <li><a href=#parsing-main-inbody><span class=secno>10.2.5.10 </span>The "in body" insertion mode</a></li>
1088 <li><a href=#parsing-main-incdata><span class=secno>10.2.5.11 </span>The "text" insertion mode</a></li>
1089 <li><a href=#parsing-main-intable><span class=secno>10.2.5.12 </span>The "in table" insertion mode</a></li>
1090 <li><a href=#parsing-main-intabletext><span class=secno>10.2.5.13 </span>The "in table text" insertion mode</a></li>
1091 <li><a href=#parsing-main-incaption><span class=secno>10.2.5.14 </span>The "in caption" insertion mode</a></li>
1092 <li><a href=#parsing-main-incolgroup><span class=secno>10.2.5.15 </span>The "in column group" insertion mode</a></li>
1093 <li><a href=#parsing-main-intbody><span class=secno>10.2.5.16 </span>The "in table body" insertion mode</a></li>
1094 <li><a href=#parsing-main-intr><span class=secno>10.2.5.17 </span>The "in row" insertion mode</a></li>
1095 <li><a href=#parsing-main-intd><span class=secno>10.2.5.18 </span>The "in cell" insertion mode</a></li>
1096 <li><a href=#parsing-main-inselect><span class=secno>10.2.5.19 </span>The "in select" insertion mode</a></li>
1097 <li><a href=#parsing-main-inselectintable><span class=secno>10.2.5.20 </span>The "in select in table" insertion mode</a></li>
1098 <li><a href=#parsing-main-inforeign><span class=secno>10.2.5.21 </span>The "in foreign content" insertion mode</a></li>
1099 <li><a href=#parsing-main-afterbody><span class=secno>10.2.5.22 </span>The "after body" insertion mode</a></li>
1100 <li><a href=#parsing-main-inframeset><span class=secno>10.2.5.23 </span>The "in frameset" insertion mode</a></li>
1101 <li><a href=#parsing-main-afterframeset><span class=secno>10.2.5.24 </span>The "after frameset" insertion mode</a></li>
1102 <li><a href=#the-after-after-body-insertion-mode><span class=secno>10.2.5.25 </span>The "after after body" insertion mode</a></li>
1103 <li><a href=#the-after-after-frameset-insertion-mode><span class=secno>10.2.5.26 </span>The "after after frameset" insertion mode</a></ol></li>
1104 <li><a href=#the-end><span class=secno>10.2.6 </span>The end</a></li>
1105 <li><a href=#coercing-an-html-dom-into-an-infoset><span class=secno>10.2.7 </span>Coercing an HTML DOM into an infoset</a></li>
1106 <li><a href=#an-introduction-to-error-handling-and-strange-cases-in-the-parser><span class=secno>10.2.8 </span>An introduction to error handling and strange cases in the parser</a>
1108 <li><a href=#misnested-tags:-b-i-/b-/i><span class=secno>10.2.8.1 </span>Misnested tags: <b><i></b></i></a></li>
1109 <li><a href=#misnested-tags:-b-p-/b-/p><span class=secno>10.2.8.2 </span>Misnested tags: <b><p></b></p></a></li>
1110 <li><a href=#unexpected-markup-in-tables><span class=secno>10.2.8.3 </span>Unexpected markup in tables</a></li>
1111 <li><a href=#scripts-that-modify-the-page-as-it-is-being-parsed><span class=secno>10.2.8.4 </span>Scripts that modify the page as it is being parsed</a></ol></ol></li>
1112 <li><a href=#serializing-html-fragments><span class=secno>10.3 </span>Serializing HTML fragments</a></li>
1113 <li><a href=#parsing-html-fragments><span class=secno>10.4 </span>Parsing HTML fragments</a></li>
1114 <li><a href=#named-character-references><span class=secno>10.5 </span>Named character references</a></ol></li>
1115 <li><a href=#the-xhtml-syntax><span class=secno>11 </span>The XHTML syntax</a>
1117 <li><a href=#writing-xhtml-documents><span class=secno>11.1 </span>Writing XHTML documents</a></li>
1118 <li><a href=#parsing-xhtml-documents><span class=secno>11.2 </span>Parsing XHTML documents</a></li>
1119 <li><a href=#serializing-xhtml-fragments><span class=secno>11.3 </span>Serializing XHTML fragments</a></li>
1120 <li><a href=#parsing-xhtml-fragments><span class=secno>11.4 </span>Parsing XHTML fragments</a></ol></li>
1121 <li><a href=#rendering><span class=secno>12 </span>Rendering</a>
1123 <li><a href=#introduction-8><span class=secno>12.1 </span>Introduction</a></li>
1124 <li><a href=#the-css-user-agent-style-sheet-and-presentational-hints><span class=secno>12.2 </span>The CSS user agent style sheet and presentational hints</a>
1126 <li><a href=#introduction-9><span class=secno>12.2.1 </span>Introduction</a></li>
1127 <li><a href=#display-types><span class=secno>12.2.2 </span>Display types</a></li>
1128 <li><a href=#margins-and-padding><span class=secno>12.2.3 </span>Margins and padding</a></li>
1129 <li><a href=#alignment><span class=secno>12.2.4 </span>Alignment</a></li>
1130 <li><a href=#fonts-and-colors><span class=secno>12.2.5 </span>Fonts and colors</a></li>
1131 <li><a href=#punctuation-and-decorations><span class=secno>12.2.6 </span>Punctuation and decorations</a></li>
1132 <li><a href=#resetting-rules-for-inherited-properties><span class=secno>12.2.7 </span>Resetting rules for inherited properties</a></li>
1133 <li><a href=#the-hr-element-0><span class=secno>12.2.8 </span>The <code>hr</code> element</a></li>
1134 <li><a href=#the-fieldset-element-0><span class=secno>12.2.9 </span>The <code>fieldset</code> element</a></ol></li>
1135 <li><a href=#replaced-elements><span class=secno>12.3 </span>Replaced elements</a>
1137 <li><a href=#embedded-content-2><span class=secno>12.3.1 </span>Embedded content</a></li>
1138 <li><a href=#timed-tracks-0><span class=secno>12.3.2 </span>Timed tracks</a></li>
1139 <li><a href=#images-0><span class=secno>12.3.3 </span>Images</a></li>
1140 <li><a href=#attributes-for-embedded-content-and-images><span class=secno>12.3.4 </span>Attributes for embedded content and images</a></li>
1141 <li><a href=#image-maps-0><span class=secno>12.3.5 </span>Image maps</a></li>
1142 <li><a href=#toolbars-0><span class=secno>12.3.6 </span>Toolbars</a></ol></li>
1143 <li><a href=#bindings><span class=secno>12.4 </span>Bindings</a>
1145 <li><a href=#introduction-10><span class=secno>12.4.1 </span>Introduction</a></li>
1146 <li><a href=#the-button-element-0><span class=secno>12.4.2 </span>The <code>button</code> element</a></li>
1147 <li><a href=#the-details-element-0><span class=secno>12.4.3 </span>The <code>details</code> element</a></li>
1148 <li><a href=#the-input-element-as-a-text-entry-widget><span class=secno>12.4.4 </span>The <code>input</code> element as a text entry widget</a></li>
1149 <li><a href=#the-input-element-as-domain-specific-widgets><span class=secno>12.4.5 </span>The <code>input</code> element as domain-specific widgets</a></li>
1150 <li><a href=#the-input-element-as-a-range-control><span class=secno>12.4.6 </span>The <code>input</code> element as a range control</a></li>
1151 <li><a href=#the-input-element-as-a-color-well><span class=secno>12.4.7 </span>The <code>input</code> element as a color well</a></li>
1152 <li><a href=#the-input-element-as-a-check-box-and-radio-button-widgets><span class=secno>12.4.8 </span>The <code>input</code> element as a check box and radio button widgets</a></li>
1153 <li><a href=#the-input-element-as-a-file-upload-control><span class=secno>12.4.9 </span>The <code>input</code> element as a file upload control</a></li>
1154 <li><a href=#the-input-element-as-a-button><span class=secno>12.4.10 </span>The <code>input</code> element as a button</a></li>
1155 <li><a href=#the-marquee-element-0><span class=secno>12.4.11 </span>The <code>marquee</code> element</a></li>
1156 <li><a href=#the-meter-element-0><span class=secno>12.4.12 </span>The <code>meter</code> element</a></li>
1157 <li><a href=#the-progress-element-0><span class=secno>12.4.13 </span>The <code>progress</code> element</a></li>
1158 <li><a href=#the-select-element-0><span class=secno>12.4.14 </span>The <code>select</code> element</a></li>
1159 <li><a href=#the-textarea-element-0><span class=secno>12.4.15 </span>The <code>textarea</code> element</a></li>
1160 <li><a href=#the-keygen-element-0><span class=secno>12.4.16 </span>The <code>keygen</code> element</a></li>
1161 <li><a href=#the-time-element-0><span class=secno>12.4.17 </span>The <code>time</code> element</a></ol></li>
1162 <li><a href=#frames-and-framesets><span class=secno>12.5 </span>Frames and framesets</a></li>
1163 <li><a href=#interactive-media><span class=secno>12.6 </span>Interactive media</a>
1165 <li><a href=#links,-forms,-and-navigation><span class=secno>12.6.1 </span>Links, forms, and navigation</a></li>
1166 <li><a href=#the-title-attribute-0><span class=secno>12.6.2 </span>The <code title=attr-title>title</code> attribute</a></li>
1167 <li><a href=#editing-hosts><span class=secno>12.6.3 </span>Editing hosts</a></ol></li>
1168 <li><a href=#print-media><span class=secno>12.7 </span>Print media</a></ol></li>
1169 <li><a href=#obsolete><span class=secno>13 </span>Obsolete features</a>
1171 <li><a href=#obsolete-but-conforming-features><span class=secno>13.1 </span>Obsolete but conforming features</a>
1173 <li><a href=#warnings-for-obsolete-but-conforming-features><span class=secno>13.1.1 </span>Warnings for obsolete but conforming features</a></ol></li>
1174 <li><a href=#non-conforming-features><span class=secno>13.2 </span>Non-conforming features</a></li>
1175 <li><a href=#requirements-for-implementations><span class=secno>13.3 </span>Requirements for implementations</a>
1177 <li><a href=#the-applet-element><span class=secno>13.3.1 </span>The <code>applet</code> element</a></li>
1178 <li><a href=#the-marquee-element><span class=secno>13.3.2 </span>The <code>marquee</code> element</a></li>
1179 <li><a href=#frames><span class=secno>13.3.3 </span>Frames</a></li>
1180 <li><a href=#other-elements,-attributes-and-apis><span class=secno>13.3.4 </span>Other elements, attributes and APIs</a></ol></ol></li>
1181 <li><a href=#iana><span class=secno>14 </span>IANA considerations</a>
1183 <li><a href=#text/html><span class=secno>14.1 </span><code>text/html</code></a></li>
1184 <li><a href=#text/html-sandboxed><span class=secno>14.2 </span><code>text/html-sandboxed</code></a></li>
1185 <li><a href=#application/xhtml+xml><span class=secno>14.3 </span><code>application/xhtml+xml</code></a></li>
1186 <li><a href=#text/cache-manifest><span class=secno>14.4 </span><code>text/cache-manifest</code></a></li>
1187 <li><a href=#text/ping><span class=secno>14.5 </span><code>text/ping</code></a></li>
1188 <li><a href=#text/srt><span class=secno>14.6 </span><code>text/srt</code></a></li>
1189 <li><a href=#application/microdata+json><span class=secno>14.7 </span><code>application/microdata+json</code></a></li>
1190 <li><a href=#ping-from><span class=secno>14.8 </span><code>Ping-From</code></a></li>
1191 <li><a href=#ping-to><span class=secno>14.9 </span><code>Ping-To</code></a></ol></li>
1192 <li><a class=no-num href=#index>Index</a>
1194 <li><a class=no-num href=#elements-1>Elements</a></li>
1195 <li><a class=no-num href=#element-content-categories>Element content categories</a></li>
1196 <li><a class=no-num href=#attributes-1>Attributes</a></li>
1197 <li><a class=no-num href=#interfaces>Interfaces</a></li>
1198 <li><a class=no-num href=#events-0>Events</a></ol></li>
1199 <li><a class=no-num href=#references>References</a></li>
1200 <li><a class=no-num href=#acknowledgements>Acknowledgements</a></ol>
1202 <hr><h2 id=introduction><span class=secno>1 </span>Introduction</h2>
1206 <h3 id=is-this-html5?><span class=secno>1.1 </span>Is this HTML5?</h3>
1208 <p><i>This section is non-normative.</i></p>
1212 <p>In short: Yes.</p>
1214 <p>In more length: "HTML5" has at various times been used to refer
1215 to a wide variety of technologies, some of which originated in this
1216 document, and some of which have only ever been tangentially
1219 <p>This specification actually now defines the next generation of
1220 HTML after HTML5. HTML5 reached Last Call at the WHATWG in October
1221 2009, and shortly after we started working on some experimental new
1222 features that are not as stable as the rest of the
1223 specification. The stability of sections is annotated in the
1226 <p>The W3C has also been working on HTML in conjunction with the
1227 WHATWG; at the W3C, this document has been split into several parts,
1228 and the occasional informative paragraph or example has been removed
1229 for technical reasons. For all intents and purposes, however, the
1230 W3C HTML specifications and this specification are equivalent (and
1231 they are in fact all generated from the same source document).</p>
1233 <p>Features that are considered part of the next generation of HTML
1234 beyond HTML5 currently consist of only:</p>
1236 <ul class=brief><li>The <code><a href=#devices>device</a></code> element.</li>
1237 <li>The <code title=attr-hyperlink-ping><a href=#ping>ping</a></code> attribute and related <a href=#hyperlink-auditing>hyperlink auditing</a> features.</li>
1238 </ul><p>Features that are part of HTML5 (and this specification) but that
1239 are either currently, or have been in the past, published as
1240 separate specifications:</p>
1242 <ul class=brief><li><a href=#2dcontext>Canvas 2D Graphics Context</a>
1243 <li><a href=#microdata>Microdata</a>
1244 <li><a href=#mdvocabs>Microdata vocabularies</a>
1245 <li><a href=#crossDocumentMessages>Cross-document messaging</a> (also known as Communications)
1246 <li><a href=#channel-messaging>Channel messaging</a> (also known as Communications)
1247 <li><a href=#forms>Forms</a> (previously known as Web Forms 2)
1248 </ul><p>Features that are not currently in this document that were in the
1249 past considered part of HTML5, or that were never part of HTML5 but
1250 have been referred to as part of HTML5 in the media, include:</p>
1252 <ul class=brief><li><a href=http://www.whatwg.org/specs/web-workers/current-work/>Web Workers</a>
1253 <li><a href=http://dev.w3.org/html5/webstorage/>Web Storage</a>
1254 <li><a href=http://dev.w3.org/html5/websockets/>WebSocket API</a>
1255 <li><a href=http://www.whatwg.org/specs/web-socket-protocol/>WebSocket protocol</a>
1257 <li><a href="http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol">WebSocket protocol</a>
1259 <li><a href=http://dev.w3.org/html5/eventsource/>Server-sent Events</a>
1260 <li><a href=http://dev.w3.org/html5/webdatabase/>Web SQL Database</a>
1261 <li><a href=http://dev.w3.org/geo/api/spec-source.html>Geolocation API</a>
1262 <li><a href=http://www.w3.org/TR/SVG/>SVG</a>
1263 <li><a href=http://www.w3.org/TR/MathML/>MathML</a>
1264 <li><a href=http://dev.w3.org/2006/webapi/XMLHttpRequest-2/>XMLHttpRequest</a>
1265 </ul><h3 id=background><span class=secno>1.2 </span>Background</h3>
1267 <p><i>This section is non-normative.</i></p>
1269 <p>The World Wide Web's markup language has always been HTML. HTML
1270 was primarily designed as a language for semantically describing
1271 scientific documents, although its general design and adaptations
1272 over the years have enabled it to be used to describe a number of
1273 other types of documents.</p>
1275 <p>The main area that has not been adequately addressed by HTML is a
1276 vague subject referred to as Web Applications. This specification
1277 attempts to rectify this, while at the same time updating the HTML
1278 specifications to address issues raised in the past few years.</p>
1281 <h3 id=audience><span class=secno>1.3 </span>Audience</h3>
1283 <p><i>This section is non-normative.</i></p>
1285 <p>This specification is intended for authors of documents and
1286 scripts that use the features defined in this specification<span class=impl>, implementors of tools that operate on pages that use
1287 the features defined in this specification, and individuals wishing
1288 to establish the correctness of documents or implementations with
1289 respect to the requirements of this specification</span>.</p>
1291 <p>This document is probably not suited to readers who do not
1292 already have at least a passing familiarity with Web technologies,
1293 as in places it sacrifices clarity for precision, and brevity for
1294 completeness. More approachable tutorials and authoring guides can
1295 provide a gentler introduction to the topic.</p>
1297 <p>In particular, familiarity with the basics of DOM Core and DOM
1298 Events is necessary for a complete understanding of some of the more
1299 technical parts of this specification. An understanding of Web IDL,
1300 HTTP, XML, Unicode, character encodings, JavaScript, and CSS will
1301 also be helpful in places but is not essential.</p>
1304 <h3 id=scope><span class=secno>1.4 </span>Scope</h3>
1306 <p><i>This section is non-normative.</i></p>
1308 <p>This specification is limited to providing a semantic-level
1309 markup language and associated semantic-level scripting APIs for
1310 authoring accessible pages on the Web ranging from static documents
1311 to dynamic applications.</p>
1313 <p>The scope of this specification does not include providing
1314 mechanisms for media-specific customization of presentation
1315 (although default rendering rules for Web browsers are included at
1316 the end of this specification, and several mechanisms for hooking
1317 into CSS are provided as part of the language).</p>
1319 <p>The scope of this specification is not to describe an entire
1320 operating system. In particular, hardware configuration software,
1321 image manipulation tools, and applications that users would be
1322 expected to use with high-end workstations on a daily basis are out
1323 of scope. In terms of applications, this specification is targeted
1324 specifically at applications that would be expected to be used by
1325 users on an occasional basis, or regularly but from disparate
1326 locations, with low CPU requirements. For instance online purchasing
1327 systems, searching systems, games (especially multiplayer online
1328 games), public telephone books or address books, communications
1329 software (e-mail clients, instant messaging clients, discussion
1330 software), document editing software, etc.</p>
1333 <h3 id=history-1><span class=secno>1.5 </span>History</h3>
1335 <p><i>This section is non-normative.</i></p>
1337 <p>For its first five years (1990-1995), HTML went through a number
1338 of revisions and experienced a number of extensions, primarily
1339 hosted first at CERN, and then at the IETF.</p>
1341 <p>With the creation of the W3C, HTML's development changed venue
1342 again. A first abortive attempt at extending HTML in 1995 known as
1343 HTML 3.0 then made way to a more pragmatic approach known as HTML
1344 3.2, which was completed in 1997. HTML4 followed, reaching
1345 completion in 1998.</p>
1347 <p>At this time, the W3C membership decided to stop evolving HTML
1348 and instead begin work on an XML-based equivalent, called
1349 XHTML. This effort started with a reformulation of HTML4 in XML,
1350 known as XHTML 1.0, which added no new features except the new
1351 serialization, and which was completed in 2000. After XHTML 1.0, the
1352 W3C's focus turned to making it easier for other working groups to
1353 extend XHTML, under the banner of XHTML Modularization. In parallel
1354 with this, the W3C also worked on a new language that was not
1355 compatible with the earlier HTML and XHTML languages, calling it
1358 <p>Around the time that HTML's evolution was stopped in 1998, parts
1359 of the API for HTML developed by browser vendors were specified and
1360 published under the name DOM Level 1 (in 1998) and DOM Level 2 Core
1361 and DOM Level 2 HTML (starting in 2000 and culminating in
1362 2003). These efforts then petered out, with some DOM Level 3
1363 specifications published in 2004 but the working group being closed
1364 before all the Level 3 drafts were completed.</p>
1366 <p>In 2003, the publication of XForms, a technology which was
1367 positioned as the next generation of Web forms, sparked a renewed
1368 interest in evolving HTML itself, rather than finding replacements
1369 for it. This interest was borne from the realization that XML's
1370 deployment as a Web technology was limited to entirely new
1371 technologies (like RSS and later Atom), rather than as a replacement
1372 for existing deployed technologies (like HTML).</p>
1374 <p>A proof of concept to show that it was possible to extend HTML4's
1375 forms to provide many of the features that XForms 1.0 introduced,
1376 without requiring browsers to implement rendering engines that were
1377 incompatible with existing HTML Web pages, was the first result of
1378 this renewed interest. At this early stage, while the draft was
1379 already publicly available, and input was already being solicited
1380 from all sources, the specification was only under Opera Software's
1383 <p>The idea that HTML's evolution should be reopened was tested at a
1384 W3C workshop in 2004, where some of the principles that underlie the
1385 HTML5 work (described below), as well as the aforementioned early
1386 draft proposal covering just forms-related features, were presented
1387 to the W3C jointly by Mozilla and Opera. The proposal was rejected
1388 on the grounds that the proposal conflicted with the previously
1389 chosen direction for the Web's evolution; the W3C staff and
1390 membership voted to continue developing XML-based replacements
1393 <p>Shortly thereafter, Apple, Mozilla, and Opera jointly announced
1394 their intent to continue working on the effort under the umbrella of
1395 a new venue called the WHATWG. A public mailing list was created,
1396 and the draft was moved to the WHATWG site. The copyright was
1397 subsequently amended to be jointly owned by all three vendors, and
1398 to allow reuse of the specification.</p>
1400 <p>The WHATWG was based on several core principles, in particular
1401 that technologies need to be backwards compatible, that
1402 specifications and implementations need to match even if this means
1403 changing the specification rather than the implementations, and that
1404 specifications need to be detailed enough that implementations can
1405 achieve complete interoperability without reverse-engineering each
1408 <p>The latter requirement in particular required that the scope of
1409 the HTML5 specification include what had previously been specified
1410 in three separate documents: HTML4, XHTML1, and DOM2 HTML. It also
1411 meant including significantly more detail than had previously been
1412 considered the norm.</p>
1414 <p>In 2006, the W3C indicated an interest to participate in the
1415 development of HTML5 after all, and in 2007 formed a working group
1416 chartered to work with the WHATWG on the development of the HTML5
1417 specification. Apple, Mozilla, and Opera allowed the W3C to publish
1418 the specification under the W3C copyright, while keeping a version
1419 with the less restrictive license on the WHATWG site.</p>
1421 <p>Since then, both groups have been working together.</p>
1423 <p>A separate document has been published by the W3C HTML working
1424 group to document the differences between this specification and the
1425 language described in the HTML4 specification. <a href=#refsHTMLDIFF>[HTMLDIFF]</a></p>
1430 <h3 id=design-notes><span class=secno>1.6 </span>Design notes</h3>
1432 <p><i>This section is non-normative.</i></p>
1434 <p>It must be admitted that many aspects of HTML appear at first
1435 glance to be nonsensical and inconsistent.</p>
1437 <p>HTML, its supporting DOM APIs, as well as many of its supporting
1438 technologies, have been developed over a period of several decades
1439 by a wide array of people with different priorities who, in many
1440 cases, did not know of each other's existence.</p>
1442 <p>Features have thus arisen from many sources, and have not always
1443 been designed in especially consistent ways. Furthermore, because of
1444 the unique characteristics of the Web, implementation bugs have
1445 often become de-facto, and now de-jure, standards, as content is
1446 often unintentionally written in ways that rely on them before they
1449 <p>Despite all this, efforts have been made to adhere to certain
1450 design goals. These are described in the next few subsections.</p>
1453 <h4 id=serializability-of-script-execution><span class=secno>1.6.1 </span>Serializability of script execution</h4>
1455 <p><i>This section is non-normative.</i></p>
1457 <p>To avoid exposing Web authors to the complexities of
1458 multithreading, the HTML and DOM APIs are designed such that no
1459 script can ever detect the simultaneous execution of other
1460 scripts. Even with <span title=Worker>workers</span>, the intent
1461 is that the behavior of implementations can be thought of as
1462 completely serializing the execution of all scripts in all <a href=#browsing-context title="browsing context">browsing contexts</a>.</p>
1464 <p class=note>The <code title=dom-navigator-yieldForStorageUpdates><a href=#dom-navigator-yieldforstorageupdates>navigator.yieldForStorageUpdates()</a></code>
1465 method, in this model, is equivalent to allowing other scripts to
1466 run while the calling script is blocked.</p>
1469 <h4 id=compliance-with-other-specifications><span class=secno>1.6.2 </span>Compliance with other specifications</h4>
1471 <p><i>This section is non-normative.</i></p>
1473 <p>This specification interacts with and relies on a wide variety of
1474 other specifications. In certain circumstances, unfortunately,
1475 conflicting needs have led to this specification violating the
1476 requirements of these other specifications. Whenever this has
1477 occurred, the transgressions have each been noted as a "<dfn id=willful-violation>willful
1478 violation</dfn>", and the reason for the violation has been
1484 <h3 id=html-vs-xhtml><span class=secno>1.7 </span>HTML vs XHTML</h3>
1486 <p><i>This section is non-normative.</i></p>
1488 <p>This specification defines an abstract language for describing
1489 documents and applications, and some APIs for interacting with
1490 in-memory representations of resources that use this language.</p>
1492 <p>The in-memory representation is known as "DOM HTML", or "the DOM"
1493 for short. This specification defines version 5 of DOM HTML, known
1496 <p>There are various concrete syntaxes that can be used to transmit
1497 resources that use this abstract language, two of which are defined
1498 in this specification.</p>
1500 <p>The first such concrete syntax is the HTML syntax. This is the
1501 format suggested for most authors. It is compatible with most legacy
1502 Web browsers. If a document is transmitted with an <a href=#html-mime-type>HTML MIME
1503 type</a>, such as <code><a href=#text/html>text/html</a></code>, then it will be
1504 processed as an HTML document by Web browsers.
1506 This specification defines the latest HTML syntax, known simply as
1512 <p>The second concrete syntax is the XHTML syntax, which is an
1513 application of XML. When a document is transmitted with an <a href=#xml-mime-type>XML
1514 MIME type</a>, such as <code><a href=#application/xhtml+xml>application/xhtml+xml</a></code>, then
1515 it is treated as an XML document by Web browsers, to be parsed by an
1516 XML processor. Authors are reminded that the processing for XML and
1517 HTML differs; in particular, even minor syntax errors will prevent a
1518 document labeled as XML from being rendered fully, whereas they
1519 would be ignored in the HTML syntax.
1521 This specification defines the latest XHTML syntax, known simply as
1527 <p>The DOM, the HTML syntax, and XML cannot all represent the same
1528 content. For example, namespaces cannot be represented using the
1529 HTML syntax, but they are supported in the DOM and in XML.
1530 Similarly, documents that use the <code><a href=#the-noscript-element>noscript</a></code> feature can
1531 be represented using the HTML syntax, but cannot be represented with
1532 the DOM or in XML. Comments that contain the string "<code title="">--></code>" can be represented in the DOM but not in the
1533 HTML syntax or in XML.</p>
1536 <h3 id=structure-of-this-specification><span class=secno>1.8 </span>Structure of this specification</h3>
1538 <p><i>This section is non-normative.</i></p>
1540 <p>This specification is divided into the following major
1543 <dl><dt><a href=#infrastructure>Common infrastructure</a></dt>
1545 <dd>The conformance classes, algorithms, definitions, and the
1546 common underpinnings of the rest of the specification.</dd>
1549 <dt><a href=#dom>Semantics, structure, and APIs of HTML documents</a></dt>
1551 <dd>Documents are built from elements. These elements form a tree
1552 using the DOM. This section defines the features of this DOM, as
1553 well as introducing the features common to all elements, and the
1554 concepts used in defining elements.</dd>
1557 <dt><a href=#semantics>The elements of HTML</a></dt>
1559 <dd>Each element has a predefined meaning, which is explained in
1560 this section. Rules for authors on how to use the element<span class=impl>, along with user agent requirements for how to handle
1561 each element,</span> are also given.</dd>
1564 <dt><a href=#microdata>Microdata</a></dt>
1566 <dd>This specification introduces a mechanism for adding
1567 machine-readable annotations to documents, so that tools can
1568 extract trees of name/value pairs from the document. This section
1569 describes this mechanism<span class=impl> and some algorithms
1570 that can be used to convert HTML documents into other
1573 This section also defines some Microdata vocabularies for contact
1574 information, calendar events, and licensing works.
1579 <dt><a href=#browsers>Loading Web pages</a></dt>
1581 <dd>HTML documents do not exist in a vacuum — this section
1582 defines many of the features that affect environments that deal
1583 with multiple pages.</dd>
1585 <dt><a href=#webappapis>Web application APIs</a></dt>
1587 <dd>This section introduces basic features for scripting of
1588 applications in HTML.</dd>
1590 <dt><a href=#editing>User interaction</a></dt>
1592 <dd>HTML documents can provide a number of mechanisms for users to
1593 interact with and modify content, which are described in this
1599 <dt><a href=#comms>The communication APIs</a></dt>
1601 <dd>This section describes some mechanisms that applications
1602 written in HTML can use to communicate with other applications from
1603 different domains running on the same client.
1608 <dt><a href=#syntax>The HTML syntax</a></dt>
1609 <dt><a href=#xhtml>The XHTML syntax</a></dt>
1611 <dd>All of these features would be for naught if they couldn't be
1612 represented in a serialized form and sent to other people, and so
1613 these sections define the syntaxes of HTML, along with rules for
1614 how to parse content using those syntaxes.</dd>
1617 </dl><p>There are also some appendices, defining <a href=#rendering>rendering rules</a> for Web browsers and listing
1618 <a href=#obsolete>obsolete features</a> and <a href=#iana>IANA
1619 considerations</a>.</p>
1623 <h4 id=how-to-read-this-specification><span class=secno>1.8.1 </span>How to read this specification</h4>
1625 <p>This specification should be read like all other specifications.
1626 First, it should be read cover-to-cover, multiple times. Then, it
1627 should be read backwards at least once. Then it should be read by
1628 picking random sections from the contents list and following all the
1629 cross-references.</p>
1633 <h4 id=typographic-conventions><span class=secno>1.8.2 </span>Typographic conventions</h4>
1635 <p>This is a definition, requirement, or explanation.</p>
1637 <p class=note>This is a note.</p>
1639 <p class=example>This is an example.</p>
1641 <p class=XXX>This is an open issue.</p>
1643 <p class=warning>This is a warning.</p>
1645 <pre class="idl extract">interface <dfn title="">Example</dfn> {
1646 // this is an IDL definition
1649 <dl class=domintro><dt><var title="">variable</var> = <var title="">object</var> . <code title="">method</code>( [ <var title="">optionalArgument</var> ] )</dt>
1653 <p>This is a note to authors describing the usage of an interface.</p>
1657 </dl><pre class=css>/* this is a CSS fragment */</pre>
1659 <p>The defining instance of a term is marked up like <dfn id=x-this title=x-this>this</dfn>. Uses of that term are marked up like
1660 <a href=#x-this title=x-this>this</a> or like <i title=x-this><a href=#x-this>this</a></i>.</p>
1662 <p>The defining instance of an element, attribute, or API is marked
1663 up like <dfn id=x-that title=x-that><code>this</code></dfn>. References to
1664 that element, attribute, or API are marked up like <code title=x-that><a href=#x-that>this</a></code>.</p>
1666 <p>Other code fragments are marked up <code title="">like
1669 <p>Variables are marked up like <var title="">this</var>.</p>
1671 <p class=impl>This is an implementation requirement.</p>
1675 <h3 id=a-quick-introduction-to-html><span class=secno>1.9 </span>A quick introduction to HTML</h3>
1677 <p><i>This section is non-normative.</i></p>
1679 <p>A basic HTML document looks like this:</p>
1681 <pre id=intro-early-example><!DOCTYPE html>
1684 <title>Sample page</title>
1687 <h1>Sample page</h1>
1688 <p>This is a <a href="demo.html">simple</a> sample.</p>
1689 <!-- this is a comment -->
1693 <p>HTML documents consist of a tree of elements and text. Each
1694 element is denoted in the source by a <a href=#syntax-start-tag title=syntax-start-tag>start tag</a>, such as "<code title=""><body></code>", and an <a href=#syntax-end-tag title=syntax-end-tag>end
1695 tag</a>, such as "<code title=""></body></code>". (Certain
1696 start tags and end tags can in certain cases be <a href=#syntax-tag-omission title=syntax-tag-omission>omitted</a> and are implied by other
1699 <p>Tags have to be nested such that elements are all completely
1700 within each other, without overlapping:</p>
1702 <pre class=bad><p>This is <em>very <strong>wrong</em>!</strong></p></pre>
1703 <pre><p>This <em>is <strong>correct</strong>.</em></p></pre>
1705 <p>This specification defines a set of elements that can be used in
1706 HTML, along with rules about the ways in which the elements can be
1709 <p>Elements can have attributes, which control how the elements
1710 work. In the example below, there is a <a href=#hyperlink>hyperlink</a>,
1711 formed using the <code><a href=#the-a-element>a</a></code> element and its <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> attribute:</p>
1713 <pre><a href="demo.html">simple</a></pre>
1715 <p><a href=#syntax-attributes title=syntax-attributes>Attributes</a> are placed
1716 inside the start tag, and consist of a <a href=#syntax-attribute-name title=syntax-attribute-name>name</a> and a <a href=#syntax-attribute-value title=syntax-attribute-value>value</a>, separated by an "<code title="">=</code>" character. The attribute value can remain <a href=#unquoted>unquoted</a> if it doesn't contain spaces or any of
1717 <code title="">"</code> <code title="">'</code> <code title="">`</code> <code title="">=</code> <code title=""><</code>
1718 or <code title="">></code>. Otherwise, it has to be quoted using
1719 either single or double quotes. The value, along with the "<code title="">=</code>" character, can be omitted altogether if the value
1720 is the empty string.</p>
1722 <pre><!-- empty attributes -->
1723 <input name=address disabled>
1724 <input name=address disabled="">
1726 <!-- attributes with a value -->
1727 <input name=address maxlength=200>
1728 <input name=address maxlength='200'>
1729 <input name=address maxlength="200"></pre>
1731 <p>HTML user agents (e.g. Web browsers) then <i>parse</i> this
1732 markup, turning it into a DOM (Document Object Model) tree. A DOM
1733 tree is an in-memory representation of a document.</p>
1735 <p>DOM trees contain several kinds of nodes, in particular a DOCTYPE
1736 node, elements, text nodes, and comment nodes.</p>
1738 <p>The <a href=#intro-early-example>markup snippet at the top of
1739 this section</a> would be turned into the following DOM tree:</p>
1741 <ul class=domTree><li class=t10>DOCTYPE: <code><a href=#the-html-element-0>html</a></code><li class=t1><code><a href=#the-html-element-0>html</a></code><ul><li class=t1><code><a href=#the-head-element-0>head</a></code><ul><li class=t3><code>#text</code>: <span title="">⏎␣␣</span><li class=t1><code><a href=#the-title-element-0>title</a></code><ul><li class=t3><code>#text</code>: <span title="">Sample page</span></ul><li class=t3><code>#text</code>: <span title="">⏎␣</span></ul><li class=t3><code>#text</code>: <span title="">⏎␣</span><li class=t1><code><a href=#the-body-element-0>body</a></code><ul><li class=t3><code>#text</code>: <span title="">⏎␣␣</span><li class=t1><code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code><ul><li class=t3><code>#text</code>: <span title="">Sample page</span></ul><li class=t3><code>#text</code>: <span title="">⏎␣␣</span><li class=t1><code><a href=#the-p-element>p</a></code><ul><li class=t3><code>#text</code>: <span title="">This is a </span><li class=t1><code><a href=#the-a-element>a</a></code> <span class=t2 title=""><code class="attribute name">href</code>="<code class="attribute value">demo.html</code>"</span><ul><li class=t3><code>#text</code>: <span title="">simple</span></ul><li class=t3><code>#text</code>: <span title=""> sample.</span></ul><li class=t3><code>#text</code>: <span title="">⏎␣␣</span><li class=t8><code>#comment</code>: <span title=""> this is a comment </span><li class=t3><code>#text</code>: <span title="">⏎␣⏎</span></ul></ul></ul><p>The <a href=#root-element>root element</a> of this tree is the
1742 <code><a href=#the-html-element-0>html</a></code> element, which is the element always found at the
1743 root of HTML documents. It contains two elements, <code><a href=#the-head-element-0>head</a></code>
1744 and <code><a href=#the-body-element-0>body</a></code>, as well as a text node between them.</p>
1746 <p>There are many more text nodes in the DOM tree than one would
1747 initially expect, because the source contains a number of spaces
1748 (represented here by "␣") and line breaks ("⏎") that
1749 all end up as text nodes in the DOM.</p>
1751 <p>The <code><a href=#the-head-element-0>head</a></code> element contains a <code><a href=#the-title-element-0>title</a></code>
1752 element, which itself contains a text node with the text "Sample
1753 page". Similarly, the <code><a href=#the-body-element-0>body</a></code> element contains an
1754 <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code> element, a <code><a href=#the-p-element>p</a></code> element, and a
1757 <hr><p>This DOM tree can be manipulated from scripts in the
1758 page. Scripts (typically in JavaScript) are small programs that can
1759 be embedded using the <code><a href=#script>script</a></code> element or using
1760 <a href=#event-handler-content-attributes>event handler content attributes</a>. For example, here is
1761 a form with a script that sets the value of the form's
1762 <code><a href=#the-output-element>output</a></code> element to say "Hello World":</p>
1764 <pre><<a href=#the-form-element>form</a> <a href=#attr-form-name title=attr-form-name>name</a>="main">
1765 Result: <<a href=#the-output-element>output</a> <a href=#attr-fe-name title=attr-fe-name>name</a>="result"></output>
1766 <<a href=#script>script</a>>
1767 <a href=#htmldocument title=HTMLDocument>document</a>.<a href=#dom-document-forms title=dom-document-forms>forms</a>.main.<a href=#dom-form-elements title=dom-form-elements>elements</a>.result.<a href=#dom-output-value title=dom-output-value>value</a> = 'Hello World';
1771 <p>Each element in the DOM tree is represented by an object, and
1772 these objects have APIs so that they can be manipulated. For
1773 instance, a link (e.g. the <code><a href=#the-a-element>a</a></code> element in the tree above)
1774 can have its "<code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code>"
1775 attribute changed in several ways:</p>
1777 <pre>var a = <a href=#htmldocument title=HTMLDocument>document</a>.<a href=#dom-document-links title=dom-document-links>links</a>[0]; // obtain the first link in the document
1778 a.<a href=#dom-a-href title=dom-a-href>href</a> = 'sample.html'; // change the destination URL of the link
1779 a.<a href=#dom-uda-protocol title=dom-uda-protocol>protocol</a> = 'https'; // change just the scheme part of the URL
1780 a.setAttribute('href', 'http://example.com/'); // change the content attribute directly</pre>
1782 <p>Since DOM trees are used as the way to represent HTML documents
1783 when they are processed and presented by implementations (especially
1784 interactive implementations like Web browsers), this specification
1785 is mostly phrased in terms of DOM trees, instead of the markup
1786 described above.</p>
1788 <hr><p>HTML documents represent a media-independent description of
1789 interactive content. HTML documents might be rendered to a screen,
1790 or through a speech synthesizer, or on a braille display. To
1791 influence exactly how such rendering takes place, authors can use a
1792 styling language such as CSS.</p>
1794 <p>In the following example, the page has been made yellow-on-blue
1797 <pre><!DOCTYPE html>
1800 <title>Sample styled page</title>
1802 body { background: navy; color: yellow; }
1806 <h1>Sample styled page</h1>
1807 <p>This page is just a demo.</p>
1811 <p>For more details on how to use HTML, authors are encouraged to
1812 consult tutorials and guides. Some of the examples included in this
1813 specification might also be of use, but the novice author is
1814 cautioned that this specification, by necessity, defines the
1815 language with a level of detail that might be difficult to
1816 understand at first.</p>
1819 <h3 id=conformance-requirements-for-authors><span class=secno>1.10 </span>Conformance requirements for authors</h3>
1821 <p><i>This section is non-normative.</i></p>
1823 <p>Unlike previous versions of the HTML specification, this
1824 specification defines in some detail the required processing for
1825 invalid documents as well as valid documents.</p> <!-- This has led
1826 to some questioning the purpose of conformance criteria: if there is
1827 no ambiguity in how something will be processed, why disallow it? -->
1829 <p>However, even though the processing of invalid content is in most
1830 cases well-defined, conformance requirements for documents are still
1831 important: in practice, interoperability (the situation in which all
1832 implementations process particular content in a reliable and
1833 identical or equivalent way) is not the only goal of document
1834 conformance requirements. This section details some of the more
1835 common reasons for still distinguishing between a conforming
1836 document and one with errors.</p>
1839 <h4 id=presentational-markup><span class=secno>1.10.1 </span>Presentational markup</h4>
1841 <p><i>This section is non-normative.</i></p>
1843 <p>The majority of presentational features from previous versions of
1844 HTML are no longer allowed. Presentational markup in general has
1845 been found to have a number of problems:</p>
1847 <dl><dt>The use of presentational elements leads to poorer accessibility</dt>
1851 <p>While it is possible to use presentational markup in a way that
1852 provides users of assistive technologies (ATs) with an acceptable
1853 experience (e.g. using ARIA), doing so is significantly more
1854 difficult than doing so when using semantically-appropriate
1855 markup. Furthermore, even using such techniques doesn't help make
1856 pages accessible for non-AT non-graphical users, such as users of
1857 text-mode browsers.</p>
1859 <p>Using media-independent markup, on the other hand, provides an
1860 easy way for documents to be authored in such a way that they work
1861 for more users (e.g. text browsers).</p>
1866 <dt>Higher cost of maintenance</dt>
1870 <p>It is significantly easier to maintain a site written in such a
1871 way that the markup is style-independent. For example, changing
1872 the color of a site that uses <code><font color=""></code>
1873 throughout requires changes across the entire site, whereas a
1874 similar change to a site based on CSS can be done by changing a
1880 <dt>Higher document sizes</dt>
1884 <p>Presentational markup tends to be much more redundant, and thus
1885 results in larger document sizes.</p>
1889 </dl><p>For those reasons, presentational markup has been removed from
1890 HTML in this version. This change should not come as a surprise;
1891 HTML4 deprecated presentational markup many years ago and provided a
1892 mode (HTML4 Transitional) to help authors move away from
1893 presentational markup; later, XHTML 1.1 went further and obsoleted
1894 those features altogether.</p>
1896 <p>The only remaining presentational markup features in HTML are the
1897 <code title=attr-style><a href=#the-style-attribute>style</a></code> attribute and the
1898 <code><a href=#the-style-element>style</a></code> element. Use of the <code title=attr-style><a href=#the-style-attribute>style</a></code> attribute is somewhat discouraged in
1899 production environments, but it can be useful for rapid prototyping
1900 (where its rules can be directly moved into a separate style sheet
1901 later) and for providing specific styles in unusual cases where a
1902 separate style sheet would be inconvenient. Similarly, the
1903 <code><a href=#the-style-element>style</a></code> element can be useful in syndication or for
1904 page-specific styles, but in general an external style sheet is
1905 likely to be more convenient when the styles apply to multiple
1908 <p>It is also worth noting that four elements that were previously
1909 presentational have been redefined in this specification to be
1910 media-independent: <code><a href=#the-b-element>b</a></code>, <code><a href=#the-i-element>i</a></code>, <code><a href=#the-hr-element>hr</a></code>,
1911 and <code><a href=#the-small-element>small</a></code>.</p>
1914 <h4 id=syntax-errors><span class=secno>1.10.2 </span>Syntax errors</h4>
1916 <p><i>This section is non-normative.</i></p>
1918 <p>The syntax of HTML is constrained to avoid a wide variety of
1921 <dl><dt>Unintuitive error-handling behavior</dt>
1925 <p>Certain invalid syntax constructs, when parsed, result in DOM
1926 trees that are highly unintuitive.</p>
1930 <p>For example, the following markup fragment results in a DOM
1931 with an <code><a href=#the-hr-element>hr</a></code> element that is an <em>earlier</em>
1932 sibling of the corresponding <code><a href=#the-table-element>table</a></code> element:</p>
1934 <pre class=bad><table><hr>...</pre>
1941 <dt>Errors with optional error recovery</dt>
1945 <p>To allow user agents to be used in controlled environments
1946 without having to implement the more bizarre and convoluted error
1947 handling rules, user agents are permitted to fail whenever
1948 encountering a <a href=#parse-error>parse error</a>.</p>
1953 <dt>Errors where the error-handling behavior is not compatible with streaming user agents</dt>
1957 <p>Some error-handling behavior, such as the behavior for the
1958 <code title=""><table><hr>...</code> example mentioned
1959 above, are incompatible with streaming user agents. To avoid
1960 interoperability problems with such user agents, any syntax
1961 resulting in such behavior is considered invalid.</p>
1966 <dt>Errors that can result in infoset coercion</dt>
1970 <p>When a user agent based on XML is connected to an HTML parser,
1971 it is possible that certain invariants that XML enforces, such as
1972 comments never containing two consecutive hyphens, will be
1973 violated by an HTML file. Handling this can require that the
1974 parser coerce the HTML DOM into an XML-compatible infoset. Most
1975 syntax constructs that require such handling are considered
1981 <dt>Errors that result in disproportionally poor performance</dt>
1985 <p>Certain syntax constructs can result in disproportionally poor
1986 performance. To discourage the use of such constructs, they are
1987 typically made non-conforming.</p>
1991 <p>For example, the following markup results in poor performance
1992 when hitting the highlighted end tag, since all the open elements
1993 are examined first to see if they match the close tag:</p>
1995 <pre class=bad><p><em><span><span><span>...<span><span><span><strong></em></strong></pre>
2002 <dt>Errors involving fragile syntax constructs</dt>
2006 <p>There are syntax constructs that, for historical reasons, are
2007 relatively fragile. To help reduce the number of users who
2008 accidentally run into such problems, they are made
2013 <p>For example, the parsing of certain named character references
2014 in attributes happens even with the closing semicolon being
2015 omitted. It is safe to include an ampersand followed by letters
2016 that do not form a named character reference, but if the letters
2017 are changed to a string that <em>does</em> form a named character
2018 reference, they will be interpreted as that character instead.</p>
2020 <p>In this fragment, the attribute's value is "<code title="">?hello=1&world=2</code>":</p>
2022 <pre class=bad><a href="?hello=1&world=2">Demo</a></pre>
2024 <p>In the following fragment, however, the attribute's value is
2025 actually "<code title="">?original=1©=2</code>",
2026 <em>not</em> the intended "<code title="">?original=1&copy=2</code>":</p>
2028 <pre class=bad><a href="?original=1&copy=2">Compare</a></pre>
2030 <p>To avoid this problem, all named character references are
2031 required to end with a semicolon, and uses of named character
2032 references without a semicolon are flagged as errors.</p>
2034 <p>Thus, the correct way to express the above cases is as
2037 <pre><a href="?hello=1&world=2">Demo</a> <!-- &world is ok, since it's not a named character reference --></pre>
2038 <pre><a href="?original=1&amp;copy=2">Compare</a> <!-- the & has to be escaped, since &copy <em>is</em> a named character reference --></pre>
2045 <dt>Errors involving known interoperability problems in legacy user agents</dt>
2049 <p>Certain syntax constructs are known to cause especially subtle
2050 or serious problems in legacy user agents, and are therefore
2051 marked as non-conforming to help authors avoid them.</p>
2055 <p>For example, this is why the U+0060 GRAVE ACCENT character (`)
2056 is not allowed in unquoted attributes. In certain legacy user
2057 agents, <!-- namely IE --> it is sometimes treated as a quote
2064 <p>Another example of this is the DOCTYPE, which is required to
2065 trigger <a href=#no-quirks-mode>no-quirks mode</a>, because the behavior of
2066 legacy user agents in <a href=#quirks-mode>quirks mode</a> is often largely
2074 <dt>Errors that risk exposing authors to security attacks</dt>
2078 <p>Certain restrictions exist purely to avoid known security
2083 <p>For example, the restriction on using UTF-7 exists purely to
2084 avoid authors falling prey to a known cross-site-scripting attack
2092 <dt>Cases where the author's intent is unclear</dt>
2096 <p>Markup where the author's intent is very unclear is often made
2097 non-conforming. Correcting these errors early makes later
2098 maintenance easier.</p>
2102 <p>For example, it is unclear whether the author intended the
2103 following to be an <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code> heading or an <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h2</a></code>
2106 <pre class=bad><h1>Contact details</h2></pre>
2113 <dt>Cases that are likely to be typos</dt>
2117 <p>When a user makes a simple typo, it is helpful if the error can
2118 be caught early, as this can save the author a lot of debugging
2119 time. This specification therefore usually considers it an error
2120 to use element names, attribute names, and so forth, that do not
2121 match the names defined in this specification.</p>
2125 <p>For example, if the author typed <code><capton></code>
2126 instead of <code><caption></code>, this would be flagged as an
2127 error and the author could correct the typo immediately.</p>
2134 <dt>Errors that could interfere with new syntax in the future</dt>
2138 <p>In order to allow the language syntax to be extended in the
2139 future, certain otherwise harmless features are disallowed.</p>
2143 <p>For example, "attributes" in end tags are ignored currently,
2144 but they are invalid, in case a future change to the language
2145 makes use of that syntax feature without conflicting with
2146 already-deployed (and valid!) content.</p>
2153 </dl><p>Some authors find it helpful to be in the practice of always
2154 quoting all attributes and always including all optional tags,
2155 preferring the consistency derived from such custom over the minor
2156 benefits of terseness afforded by making use of the flexibility of
2157 the HTML syntax. To aid such authors, conformance checkers can
2158 provide modes of operation wherein such conventions are
2163 <h4 id=restrictions-on-content-models-and-on-attribute-values><span class=secno>1.10.3 </span>Restrictions on content models and on attribute values</h4>
2165 <p><i>This section is non-normative.</i></p>
2167 <p>Beyond the syntax of the language, this specification also places
2168 restrictions on how elements and attributes can be specified. These
2169 restrictions are present for similar reasons:</p>
2171 <dl><dt>Errors involving content with dubious semantics</dt>
2175 <p>To avoid misuse of elements with defined meanings, content
2176 models are defined that restrict how elements can be nested when
2177 such nestings would be of dubious value.</p>
2179 <p class=example>For example, this specification disallows
2180 nesting a <code><a href=#the-section-element>section</a></code> element inside a <code><a href=#the-kbd-element>kbd</a></code>
2181 element, since it is highly unlikely for an author to indicate
2182 that an entire section should be keyed in.</p>
2187 <dt>Errors that involve a conflict in expressed semantics</dt>
2191 <p>Similarly, to draw the author's attention to mistakes in the
2192 use of elements, clear contradictions in the semantics expressed
2193 are also considered conformance errors.</p>
2197 <p>In the fragments below, for example, the semantics are
2198 nonsensical: a row cannot simultaneously be a cell, nor can a
2199 radio button be a progress bar.</p>
2201 <pre class=bad><tr role="cell"></pre>
2202 <pre class=bad><input type=radio role=progressbar></pre>
2206 <p class=example>Another example is the restrictions on the
2207 content models of the <code><a href=#the-ul-element>ul</a></code> element, which only allows
2208 <code><a href=#the-li-element>li</a></code> element children. Lists by definition consist just
2209 of zero or more list items, so if a <code><a href=#the-ul-element>ul</a></code> element
2210 contains something other than an <code><a href=#the-li-element>li</a></code> element, it's not
2211 clear what was meant.</p>
2216 <dt>Cases where the default styles are likely to lead to confusion</dt>
2220 <p>Certain elements have default styles or behaviors that make
2221 certain combinations likely to lead to confusion. Where these have
2222 equivalent alternatives without this problem, the confusing
2223 combinations are disallowed.</p>
2225 <p class=example>For example, <code><a href=#the-div-element>div</a></code> elements are
2226 rendered as block boxes, and <code><a href=#the-span-element>span</a></code> elements as inline
2227 boxes. Putting a block box in an inline box is unnecessarily
2228 confusing; since either nesting just <code><a href=#the-div-element>div</a></code> elements, or
2229 nesting just <code><a href=#the-span-element>span</a></code> elements, or nesting
2230 <code><a href=#the-span-element>span</a></code> elements inside <code><a href=#the-div-element>div</a></code> elements all
2231 serve the same purpose as nesting a <code><a href=#the-div-element>div</a></code> element in a
2232 <code><a href=#the-span-element>span</a></code> element, but only the latter involves a block
2233 box in an inline box, the latter combination is disallowed.</p>
2235 <p class=example>Another example would be the way
2236 <a href=#interactive-content>interactive content</a> cannot be nested. For example, a
2237 <code><a href=#the-button-element>button</a></code> element cannot contain a <code><a href=#the-textarea-element>textarea</a></code>
2238 element. This is because the default behavior of such nesting
2239 interactive elements would be highly confusing to users. Instead
2240 of nesting these elements, they can be placed side by side.</p>
2245 <dt>Errors that indicate a likely misunderstanding of the specification</dt>
2249 <p>Sometimes, something is disallowed because allowing it would
2250 likely cause author confusion.</p>
2252 <p class=example>For example, setting the <code title=attr-fe-disabled><a href=#attr-fe-disabled>disabled</a></code> attribute to the value
2253 "<code title="">false</code>" is disallowed, because despite the
2254 appearance of meaning that the element is enabled, it in fact
2255 means that the element is <em>disabled</em> (what matters for
2256 implementations is the presence of the attribute, not its
2262 <dt>Errors involving limits that have been imposed merely to simplify the language</dt>
2266 <p>Some conformance errors simplify the language that authors need
2269 <p class=example>For example, the <code><a href=#the-area-element>area</a></code> element's
2270 <code title=attr-area-shape><a href=#attr-area-shape>shape</a></code> attribute, despite
2271 accepting both <code title=attr-area-shape-keyword-circ><a href=#attr-area-shape-keyword-circ>circ</a></code> and <code title=attr-area-shape-keyword-circle><a href=#attr-area-shape-keyword-circle>circle</a></code> values in
2272 practice as synonyms, disallows the use of the <code title=attr-area-shape-keyword-circ><a href=#attr-area-shape-keyword-circ>circ</a></code> value, so as to
2273 simplify tutorials and other learning aids. There would be no
2274 benefit to allowing both, but it would cause extra confusion when
2275 teaching the language.</p>
2280 <dt>Errors that involve peculiarities of the parser</dt>
2284 <p>Certain elements are parsed in somewhat eccentric ways
2285 (typically for historical reasons), and their content model
2286 restrictions are intended to avoid exposing the author to these
2291 <p>For example, a <code><a href=#the-form-element>form</a></code> element isn't allowed inside
2292 <a href=#phrasing-content>phrasing content</a>, because when parsed as HTML, a
2293 <code><a href=#the-form-element>form</a></code> element's start tag will imply a <code><a href=#the-p-element>p</a></code>
2294 element's end tag. Thus, the following markup results in two
2295 <a href=#paragraph title=paragraph>paragraphs</a>, not one:</p>
2297 <pre><p>Welcome. <form><label>Name:</label> <input></form></pre>
2299 <p>It is parsed exactly like the following:</p>
2301 <pre><p>Welcome. </p><form><label>Name:</label> <input></form></pre>
2308 <dt>Errors that would likely result in scripts failing in hard-to-debug ways</dt>
2312 <p>Some errors are intended to help prevent script problems that
2313 would be hard to debug.</p>
2315 <p class=example>This is why, for instance, it is non-conforming
2316 to have two <code title=attr-id><a href=#the-id-attribute>id</a></code> attributes with the
2317 same value. Duplicate IDs lead to the wrong element being
2318 selected, with sometimes disastrous effects whose cause is hard to
2324 <dt>Errors that waste authoring time</dt>
2328 <p>Some constructs are disallowed because historically they have
2329 been the cause of a lot of wasted authoring time, and by
2330 encouraging authors to avoid making them, authors can save time in
2333 <p class=example>For example, a <code><a href=#script>script</a></code> element's
2334 <code title=attr-script-src><a href=#attr-script-src>src</a></code> attribute causes the
2335 element's contents to be ignored. However, this isn't obvious,
2336 especially if the element's contents appear to be executable
2337 script — which can lead to authors spending a lot of time
2338 trying to debug the inline script without realising that it is not
2339 executing. To reduce this problem, this specification makes it
2340 non-conforming to have executable script in a <code><a href=#script>script</a></code>
2341 element when the <code title=attr-script-src><a href=#attr-script-src>src</a></code>
2342 attribute is present. This means that authors who are validating
2343 their documents are less likely to waste time with this kind of
2349 <dt>Errors that involve areas that affect authors migrating to and from XHTML</dt>
2353 <p>Some authors like to write files that can be interpreted as
2354 both XML and HTML with similar results. Though this practice is
2355 discouraged in general due to the myriad of subtle complications
2356 involved (especially when involving scripting, styling, or any
2357 kind of automated serialization), this specification has a few
2358 restrictions intended to at least somewhat mitigate the
2359 difficulties. This makes it easier for authors to use this as a
2360 transitionary step when migrating between HTML and XHTML.</p>
2362 <p class=example>For example, there are somewhat complicated
2363 rules surrounding the <code title=attr-lang><a href=#attr-lang>lang</a></code> and
2364 <code title=attr-xml-lang><a href=#attr-xml-lang>xml:lang</a></code> attributes intended
2365 to keep the two synchronized.</p>
2367 <p class=example>Another example would be the restrictions on
2368 the values of <code title="">xmlns</code> attributes in the HTML
2369 serialization, which are intended to ensure that elements in
2370 conforming documents end up in the same namespaces whether
2371 processed as HTML or XML.</p>
2376 <dt>Errors that involve areas reserved for future expansion</dt>
2380 <p>As with the restrictions on the syntax intended to allow for
2381 new syntax in future revisions of the language, some restrictions
2382 on the content models of elements and values of attributes are
2383 intended to allow for future expansion of the HTML vocabulary.</p>
2385 <p class=example>For example, limiting the values of the <code title=attr-hyperlink-target><a href=#attr-hyperlink-target>target</a></code> attribute that start
2386 with an U+005F LOW LINE character (_) to only specific predefined
2387 values allows new predefined values to be introduced at a future
2388 time without conflicting with author-defined values.</p>
2393 <dt>Errors that indicate a mis-use of other specifications</dt>
2397 <p>Certain restrictions are intended to support the restrictions
2398 made by other specifications.</p>
2400 <p class=example>For example, requiring that attributes that
2401 take media queries use only <em>valid</em> media queries
2402 reinforces the importance of following the conformance rules of
2403 that specification.</p>
2407 </dl><h3 id=recommended-reading><span class=secno>1.11 </span>Recommended reading</h3>
2409 <p><i>This section is non-normative.</i></p>
2411 <p>The following documents might be of interest to readers of this
2414 <dl><dt><cite>Character Model for the World Wide Web 1.0: Fundamentals</cite> <a href=#refsCHARMOD>[CHARMOD]</a></dt>
2416 <dd><blockquote><p>This Architectural Specification provides
2417 authors of specifications, software developers, and content
2418 developers with a common reference for interoperable text
2419 manipulation on the World Wide Web, building on the Universal
2420 Character Set, defined jointly by the Unicode Standard and ISO/IEC
2421 10646. Topics addressed include use of the terms 'character',
2422 'encoding' and 'string', a reference processing model, choice and
2423 identification of character encodings, character escaping, and
2424 string indexing.</blockquote></dd>
2426 <dt><cite>Unicode Security Considerations</cite> <a href=#refsUTR36>[UTR36]</a></dt>
2428 <dd><blockquote><p>Because Unicode contains such a large number of
2429 characters and incorporates the varied writing systems of the
2430 world, incorrect usage can expose programs or systems to possible
2431 security attacks. This is especially important as more and more
2432 products are internationalized. This document describes some of the
2433 security considerations that programmers, system analysts,
2434 standards developers, and users should take into account, and
2435 provides specific recommendations to reduce the risk of
2436 problems.</blockquote></dd>
2438 <dt><cite>Web Content Accessibility Guidelines (WCAG) 2.0</cite> <a href=#refsWCAG>[WCAG]</a></dt>
2440 <dd><blockquote><p>Web Content Accessibility Guidelines (WCAG) 2.0
2441 covers a wide range of recommendations for making Web content more
2442 accessible. Following these guidelines will make content accessible
2443 to a wider range of people with disabilities, including blindness
2444 and low vision, deafness and hearing loss, learning disabilities,
2445 cognitive limitations, limited movement, speech disabilities,
2446 photosensitivity and combinations of these. Following these
2447 guidelines will also often make your Web content more usable to
2448 users in general.</blockquote></dd>
2450 <dt class=impl><cite>Authoring Tool Accessibility Guidelines (ATAG) 2.0</cite> <a href=#refsATAG>[ATAG]</a></dt>
2452 <dd class=impl><blockquote><p>This specification provides
2453 guidelines for designing Web content authoring tools that are more
2454 accessible for people with disabilities. An authoring tool that
2455 conforms to these guidelines will promote accessibility by
2456 providing an accessible user interface to authors with disabilities
2457 as well as by enabling, supporting, and promoting the production of
2458 accessible Web content by all authors.</blockquote></dd>
2460 <dt class=impl><cite>User Agent Accessibility Guidelines (UAAG) 2.0</cite> <a href=#refsUAAG>[UAAG]</a></dt>
2462 <dd class=impl><blockquote><p>This document provides guidelines
2463 for designing user agents that lower barriers to Web accessibility
2464 for people with disabilities. User agents include browsers and
2465 other types of software that retrieve and render Web content. A
2466 user agent that conforms to these guidelines will promote
2467 accessibility through its own user interface and through other
2468 internal facilities, including its ability to communicate with
2469 other technologies (especially assistive
2470 technologies). Furthermore, all users, not just users with
2471 disabilities, should find conforming user agents to be more
2472 usable.</blockquote></dd>
2474 </dl><h2 id=infrastructure><span class=secno>2 </span>Common infrastructure</h2>
2476 <h3 id=terminology><span class=secno>2.1 </span>Terminology</h3>
2478 <p>This specification refers to both HTML and XML attributes and IDL
2479 attributes, often in the same context. When it is not clear which is
2480 being referred to, they are referred to as <dfn title="">content
2481 attributes</dfn> for HTML and XML attributes, and <dfn title="">IDL
2482 attributes</dfn> for those defined on IDL interfaces. Similarly, the
2483 term "properties" is used for both JavaScript object properties and
2484 CSS properties. When these are ambiguous they are qualified as <dfn title="">object properties</dfn> and <dfn title="">CSS
2485 properties</dfn> respectively.</p>
2487 <p>Generally, when the specification states that a feature applies
2488 to <a href=#syntax>the HTML syntax</a> or <a href=#the-xhtml-syntax>the XHTML syntax</a>, it
2489 also includes the other. When a feature specifically only applies to
2490 one of the two languages, it is called out by explicitly stating
2491 that it does not apply to the other format, as in "for HTML,
2492 ... (this does not apply to XHTML)".</p>
2494 <p>This specification uses the term <dfn title="">document</dfn> to
2495 refer to any use of HTML, ranging from short static documents to
2496 long essays or reports with rich multimedia, as well as to
2497 fully-fledged interactive applications.</p>
2499 <p>For simplicity, terms such as <dfn title="">shown</dfn>, <dfn title="">displayed</dfn>, and <dfn title="">visible</dfn> might
2500 sometimes be used when referring to the way a document is rendered
2501 to the user. These terms are not meant to imply a visual medium;
2502 they must be considered to apply to other media in equivalent
2507 <p>When an algorithm B says to return to another algorithm A, it
2508 implies that A called B. Upon returning to A, the implementation
2509 must continue from where it left off in calling B.</p>
2514 <h4 id=resources><span class=secno>2.1.1 </span>Resources</h4>
2516 <p>The specification uses the term <dfn title="">supported</dfn>
2517 when referring to whether a user agent has an implementation capable
2518 of decoding the semantics of an external resource. A format or type
2519 is said to be <i>supported</i> if the implementation can process an
2520 external resource of that format or type without critical aspects of
2521 the resource being ignored. Whether a specific resource is
2522 <i>supported</i> can depend on what features of the resource's
2523 format are in use.</p>
2525 <p class=example>For example, a PNG image would be considered to
2526 be in a supported format if its pixel data could be decoded and
2527 rendered, even if, unbeknownst to the implementation, the image also
2528 contained animation data.</p>
2530 <p class=example>A MPEG4 video file would not be considered to be
2531 in a supported format if the compression format used was not
2532 supported, even if the implementation could determine the dimensions
2533 of the movie from the file's metadata.</p>
2535 <p>What some specifications, in particular the HTTP and URI
2536 specifications, refer to as a <i>representation</i> is referred to
2537 in this specification as a <dfn title="">resource</dfn>. <a href=#refsHTTP>[HTTP]</a> <a href=#refsRFC3986>[RFC3986]</a></p>
2539 <p>The term <dfn id=mime-type>MIME type</dfn> is used to refer to what is
2540 sometimes called an <i>Internet media type</i> in protocol
2541 literature. The term <i>media type</i> in this specification is used
2542 to refer to the type of media intended for presentation, as used by
2543 the CSS specifications. <a href=#refsRFC2046>[RFC2046]</a> <a href=#refsMQ>[MQ]</a></p>
2545 <p>A string is a <dfn id=valid-mime-type>valid MIME type</dfn> if it matches the <code title="">media-type</code> rule defined in section 3.7 "Media Types"
2546 of RFC 2616. In particular, a <a href=#valid-mime-type>valid MIME type</a> may
2547 include MIME type parameters. <a href=#refsHTTP>[HTTP]</a></p>
2549 <p>A string is a <dfn id=valid-mime-type-with-no-parameters>valid MIME type with no parameters</dfn> if it
2550 matches the <code title="">media-type</code> rule defined in section
2551 3.7 "Media Types" of RFC 2616, but does not contain any U+003B
2552 SEMICOLON characters (;). In other words, if it consists only of a
2553 type and subtype, with no MIME Type parameters. <a href=#refsHTTP>[HTTP]</a></p>
2555 <p>The term <dfn id=html-mime-type>HTML MIME type</dfn> is used to refer to the <a href=#mime-type title="MIME type">MIME types</a> <code><a href=#text/html>text/html</a></code> and
2556 <code><a href=#text/html-sandboxed>text/html-sandboxed</a></code>.</p>
2558 <p>A resource's <dfn id=critical-subresources>critical subresources</dfn> are those that the
2559 resource needs to have available to be correctly processed. Which
2560 resources are considered critical or not is defined by the
2561 specification that defines the resource's format. For CSS resources,
2562 only <code title="">@import</code> rules introduce <a href=#critical-subresources>critical
2563 subresources</a>; other resources, e.g. fonts or backgrounds, are
2567 <h4 id=xml><span class=secno>2.1.2 </span>XML</h4>
2569 <p id=html-namespace>To ease migration from HTML to XHTML, UAs
2570 conforming to this specification will place elements in HTML in the
2571 <code>http://www.w3.org/1999/xhtml</code> namespace, at least for
2572 the purposes of the DOM and CSS. The term "<dfn id=html-elements>HTML
2573 elements</dfn>", when used in this specification, refers to any
2574 element in that namespace, and thus refers to both HTML and XHTML
2577 <p>Except where otherwise stated, all elements defined or mentioned
2578 in this specification are in the
2579 <code>http://www.w3.org/1999/xhtml</code> namespace, and all
2580 attributes defined or mentioned in this specification have no
2583 <p>Attribute names are said to be <dfn id=xml-compatible>XML-compatible</dfn> if they
2584 match the <a href=http://www.w3.org/TR/REC-xml/#NT-Name><code title="">Name</code></a> production defined in XML, they contain no
2585 U+003A COLON characters (:), and their first three characters are
2586 not an <a href=#ascii-case-insensitive>ASCII case-insensitive</a> match for the string
2587 "<code title="">xml</code>". <a href=#refsXML>[XML]</a></p>
2589 <p>The term <dfn id=xml-mime-type>XML MIME type</dfn> is used to refer to the <a href=#mime-type title="MIME type">MIME types</a> <code title="">text/xml</code>,
2590 <code title="">application/xml</code>, and any <a href=#mime-type>MIME
2591 type</a> whose subtype ends with the four characters "<code title="">+xml</code>". <a href=#refsRFC3023>[RFC3023]</a></p>
2594 <h4 id=dom-trees><span class=secno>2.1.3 </span>DOM trees</h4>
2596 <p>The term <dfn id=root-element>root element</dfn>, when not explicitly qualified
2597 as referring to the document's root element, means the furthest
2598 ancestor element node of whatever node is being discussed, or the
2599 node itself if it has no ancestors. When the node is a part of the
2600 document, then the node's <a href=#root-element>root element</a> is indeed the
2601 document's root element; however, if the node is not currently part
2602 of the document tree, the root element will be an orphaned node.</p>
2604 <p>When an element's <a href=#root-element>root element</a> is the root element
2605 of a <code><a href=#document>Document</a></code>, it is said to be <dfn id=in-a-document>in a
2606 <code>Document</code></dfn>. An element is said to have been <dfn id=insert-an-element-into-a-document title="insert an element into a document">inserted into a
2607 document</dfn> when its <a href=#root-element>root element</a> changes and is now
2608 the document's <a href=#root-element>root element</a>. Analogously, an element is
2609 said to have been <dfn id=remove-an-element-from-a-document title="remove an element from a
2610 document">removed from a document</dfn> when its <a href=#root-element>root
2611 element</a> changes from being the document's <a href=#root-element>root
2612 element</a> to being another element.</p>
2614 <p>A node's <dfn id=home-subtree>home subtree</dfn> is the subtree rooted at that
2615 node's <a href=#root-element>root element</a>. When a node is <a href=#in-a-document>in a
2616 <code>Document</code></a>, its <a href=#home-subtree>home subtree</a> is that
2617 <code><a href=#document>Document</a></code>'s tree.</p>
2619 <p>The <code><a href=#document>Document</a></code> of a <code><a href=#node>Node</a></code> (such as an
2620 element) is the <code><a href=#document>Document</a></code> that the <code><a href=#node>Node</a></code>'s
2621 <code title="">ownerDocument</code> IDL attribute returns. When a
2622 <code><a href=#node>Node</a></code> is <a href=#in-a-document>in a <code>Document</code></a> then
2623 that <code><a href=#document>Document</a></code> is always the <code><a href=#node>Node</a></code>'s
2624 <code><a href=#document>Document</a></code>, and the <code><a href=#node>Node</a></code>'s <code title="">ownerDocument</code> IDL attribute thus always returns that
2625 <code><a href=#document>Document</a></code>.</p>
2627 <p>The term <dfn id=tree-order>tree order</dfn> means a pre-order, depth-first
2628 traversal of DOM nodes involved (through the <code title=dom-Node-parentNode><a href=#dom-node-parentnode>parentNode</a></code>/<code title=dom-Node-childNodes><a href=#dom-node-childnodes>childNodes</a></code> relationship).</p>
2630 <p>When it is stated that some element or attribute is <dfn id=ignore title=ignore>ignored</dfn>, or treated as some other value, or
2631 handled as if it was something else, this refers only to the
2632 processing of the node after it is in the DOM. <span class=impl>A
2633 user agent must not mutate the DOM in such situations.</span></p>
2635 <p>The term <dfn id=text-node>text node</dfn> refers to any <code><a href=#text>Text</a></code>
2636 node, including <code><a href=#cdatasection>CDATASection</a></code> nodes; specifically, any
2637 <code><a href=#node>Node</a></code> with node type <code title="">TEXT_NODE</code> (3)
2638 or <code title="">CDATA_SECTION_NODE</code> (4). <a href=#refsDOMCORE>[DOMCORE]</a></p>
2640 <p>A content attribute is said to <dfn title="">change</dfn> value
2641 only if its new value is different than its previous value; setting
2642 an attribute to a value it already has does not change it.</p>
2645 <h4 id=scripting-0><span class=secno>2.1.4 </span>Scripting</h4>
2647 <p>The construction "a <code>Foo</code> object", where
2648 <code>Foo</code> is actually an interface, is sometimes used instead
2649 of the more accurate "an object implementing the interface
2650 <code>Foo</code>".</p>
2652 <p>An IDL attribute is said to be <dfn title="">getting</dfn> when
2653 its value is being retrieved (e.g. by author script), and is said to
2654 be <dfn title="">setting</dfn> when a new value is assigned to
2657 <p>If a DOM object is said to be <dfn id=live>live</dfn>, then the
2658 attributes and methods on that object <span class=impl>must</span>
2659 operate on the actual underlying data, not a snapshot of the
2662 <p>The terms <dfn title="">fire</dfn> and <dfn title="">dispatch</dfn> are used interchangeably in the context of
2663 events, as in the DOM Events specifications. The term <dfn id=concept-events-trusted title=concept-events-trusted>trusted event</dfn> is used as
2664 defined by the DOM Events specification. <!--
2665 http://krijnhoetmer.nl/irc-logs/webapps/20091218 --> <a href=#refsDOMEVENTS>[DOMEVENTS]</a></p>
2668 <h4 id=plugins><span class=secno>2.1.5 </span>Plugins</h4>
2670 <p>The term <dfn id=plugin>plugin</dfn> refers to a user-agent defined set of
2671 content handlers used by the user agent that can take part in the
2672 user agent's rendering of a <code><a href=#document>Document</a></code> object, but that
2673 neither act as <a href=#child-browsing-context title="child browsing context">child browsing
2674 contexts</a> of the <code><a href=#document>Document</a></code> nor introduce any
2675 <code><a href=#node>Node</a></code> objects to the <code><a href=#document>Document</a></code>'s DOM.</p>
2677 <p>Typically such content handlers are provided by third parties,
2678 though a user agent can also designate built-in content handlers as
2681 <p>A user agent must not consider the types <code>text/plain</code>
2682 and <code>application/octet-stream</code> as having a registered
2683 <a href=#plugin>plugin</a>.</p> <!-- because of the way <object> handles
2684 those types, if nothing else (it also doesn't make any sense to have
2685 a plugin registered for those types, of course) -->
2687 <p class=example>One example of a plugin would be a PDF viewer
2688 that is instantiated in a <a href=#browsing-context>browsing context</a> when the
2689 user navigates to a PDF file. This would count as a plugin
2690 regardless of whether the party that implemented the PDF viewer
2691 component was the same as that which implemented the user agent
2692 itself. However, a PDF viewer application that launches separate
2693 from the user agent (as opposed to using the same interface) is not
2694 a plugin by this definition.</p>
2696 <p class=note>This specification does not define a mechanism for
2697 interacting with plugins, as it is expected to be user-agent- and
2698 platform-specific. Some UAs might opt to support a plugin mechanism
2699 such as the Netscape Plugin API; others might use remote content
2700 converters or have built-in support for certain types. <a href=#refsNPAPI>[NPAPI]</a></p>
2702 <p class=warning>Browsers should take extreme care when
2703 interacting with external content intended for <a href=#plugin title=plugin>plugins</a>. When third-party software is run with
2704 the same privileges as the user agent itself, vulnerabilities in the
2705 third-party software become as dangerous as those in the user
2709 <h4 id=character-encodings><span class=secno>2.1.6 </span>Character encodings</h4>
2711 <p>The <dfn id=preferred-mime-name>preferred MIME name</dfn> of a character encoding is the
2712 name or alias labeled as "preferred MIME name" in the IANA
2713 <cite>Character Sets</cite> registry, if there is one, or the
2714 encoding's name, if none of the aliases are so labeled. <a href=#refsIANACHARSET>[IANACHARSET]</a></p>
2716 <p>An <dfn id=ascii-compatible-character-encoding>ASCII-compatible character encoding</dfn> is a
2717 single-byte or variable-length encoding in which the bytes 0x09,
2718 0x0A, 0x0C, 0x0D, 0x20 - 0x22, 0x26, 0x27, 0x2C - 0x3F, 0x41 - 0x5A,
2719 and 0x61 - 0x7A<!-- is that list ok? do any character sets we want
2720 to support do things outside that range? -->, ignoring bytes that
2721 are the second and later bytes of multibyte sequences, all
2722 correspond to single-byte sequences that map to the same Unicode
2723 characters as those bytes in ANSI_X3.4-1968 (US-ASCII). <a href=#refsRFC1345>[RFC1345]</a></p>
2725 <p class=note>This includes such encodings as Shift_JIS,
2726 HZ-GB-2312, and variants of ISO-2022, even though it is possible in
2727 these encodings for bytes like 0x70 to be part of longer sequences
2728 that are unrelated to their interpretation as ASCII. It excludes
2729 such encodings as UTF-7, UTF-16, GSM03.38, and EBCDIC variants.</p>
2732 We'll have to change that if anyone comes up with a way to have a
2733 document that is valid as two different encodings at once, with
2734 different <meta charset> elements applying in each case.
2737 <p>The term <dfn title="">Unicode character</dfn> is used to mean a
2738 <i title="">Unicode scalar value</i> (i.e. any Unicode code point
2739 that is not a surrogate code point). <a href=#refsUNICODE>[UNICODE]</a></p>
2745 <!--FIXUP microdata +1-->
2746 <!--FIXUP 2dcontext +1-->
2747 <h3 id=conformance-requirements><span class=secno>2.2 </span>Conformance requirements</h3>
2748 <!--FIXUP microdata -1-->
2749 <!--FIXUP 2dcontext -1-->
2751 <p>All diagrams, examples, and notes in this specification are
2752 non-normative, as are all sections explicitly marked non-normative.
2753 Everything else in this specification is normative.</p>
2755 <p>The key words "MUST", "MUST NOT", "REQUIRED", <!--"SHALL", "SHALL
2756 NOT",--> "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
2757 "OPTIONAL" in the normative parts of this document are to be
2758 interpreted as described in RFC2119. For readability, these words do
2759 not appear in all uppercase letters in this specification. <a href=#refsRFC2119>[RFC2119]</a></p>
2761 <p class=impl>Requirements phrased in the imperative as part of
2762 algorithms (such as "strip any leading space characters" or "return
2763 false and abort these steps") are to be interpreted with the meaning
2764 of the key word ("must", "should", "may", etc) used in introducing
2767 <p>This specification describes the conformance criteria for <span class=impl>user agents (relevant to implementors) and</span>
2768 documents<span class=impl> (relevant to authors and authoring tool
2769 implementors)</span>.</p>
2771 <p><dfn id=conforming-documents>Conforming documents</dfn> are those that comply with all
2772 the conformance criteria for documents. For readability, some of
2773 these conformance requirements are phrased as conformance
2774 requirements on authors; such requirements are implicitly
2775 requirements on documents: by definition, all documents are assumed
2776 to have had an author. (In some cases, that author may itself be a
2777 user agent — such user agents are subject to additional rules,
2778 as explained below.)</p>
2780 <p class=example>For example, if a requirement states that
2781 "authors must not use the <code title="">foobar</code> element", it
2782 would imply that documents are not allowed to contain elements named
2783 <code title="">foobar</code>.</p>
2789 <p>User agents fall into several (overlapping) categories with
2790 different conformance requirements.</p>
2792 <dl><dt id=interactive>Web browsers and other interactive user agents</dt>
2796 <p>Web browsers that support <a href=#the-xhtml-syntax>the XHTML syntax</a> must
2797 process elements and attributes from the <a href=#html-namespace-0>HTML
2798 namespace</a> found in XML documents as described in this
2799 specification, so that users can interact with them, unless the
2800 semantics of those elements have been overridden by other
2803 <p class=example>A conforming XHTML processor would, upon
2804 finding an XHTML <code><a href=#script>script</a></code> element in an XML document,
2805 execute the script contained in that element. However, if the
2806 element is found within a transformation expressed in XSLT
2807 (assuming the user agent also supports XSLT), then the processor
2808 would instead treat the <code><a href=#script>script</a></code> element as an opaque
2809 element that forms part of the transform.</p>
2811 <p>Web browsers that support <a href=#syntax>the HTML syntax</a> must
2812 process documents labeled with an <a href=#html-mime-type>HTML MIME type</a> as
2813 described in this specification, so that users can interact with
2816 <p>User agents that support scripting must also be conforming
2817 implementations of the IDL fragments in this specification, as
2818 described in the Web IDL specification. <a href=#refsWEBIDL>[WEBIDL]</a></p>
2820 <p class=note>Unless explicitly stated, specifications that
2821 override the semantics of HTML elements do not override the
2822 requirements on DOM objects representing those elements. For
2823 example, the <code><a href=#script>script</a></code> element in the example above
2824 would still implement the <code><a href=#htmlscriptelement>HTMLScriptElement</a></code>
2829 <dt id=non-interactive>Non-interactive presentation user agents</dt>
2833 <p>User agents that process HTML and XHTML documents purely to
2834 render non-interactive versions of them must comply to the same
2835 conformance criteria as Web browsers, except that they are exempt
2836 from requirements regarding user interaction.</p>
2838 <p class=note>Typical examples of non-interactive presentation
2839 user agents are printers (static UAs) and overhead displays
2840 (dynamic UAs). It is expected that most static non-interactive
2841 presentation user agents will also opt to <a href=#non-scripted>lack scripting support</a>.</p>
2843 <p class=example>A non-interactive but dynamic presentation UA
2844 would still execute scripts, allowing forms to be dynamically
2845 submitted, and so forth. However, since the concept of "focus" is
2846 irrelevant when the user cannot interact with the document, the UA
2847 would not need to support any of the focus-related DOM APIs.</p>
2851 <dt><dfn id=non-scripted>User agents with no scripting support</dfn></dt>
2855 <p>Implementations that do not support scripting (or which have
2856 their scripting features disabled entirely) are exempt from
2857 supporting the events and DOM interfaces mentioned in this
2858 specification. For the parts of this specification that are
2859 defined in terms of an events model or in terms of the DOM, such
2860 user agents must still act as if events and the DOM were
2863 <p class=note>Scripting can form an integral part of an
2864 application. Web browsers that do not support scripting, or that
2865 have scripting disabled, might be unable to fully convey the
2866 author's intent.</p>
2870 <dt>Conformance checkers</dt>
2872 <dd id=conformance-checkers>
2874 <p>Conformance checkers must verify that a document conforms to
2875 the applicable conformance criteria described in this
2876 specification. Automated conformance checkers are exempt from
2877 detecting errors that require interpretation of the author's
2878 intent (for example, while a document is non-conforming if the
2879 content of a <code><a href=#the-blockquote-element>blockquote</a></code> element is not a quote,
2880 conformance checkers running without the input of human judgement
2881 do not have to check that <code><a href=#the-blockquote-element>blockquote</a></code> elements only
2882 contain quoted material).</p>
2884 <p>Conformance checkers must check that the input document
2885 conforms when parsed without a <a href=#browsing-context>browsing context</a>
2886 (meaning that no scripts are run, and that the parser's
2887 <a href=#scripting-flag>scripting flag</a> is disabled), and should also check
2888 that the input document conforms when parsed with a <a href=#browsing-context>browsing
2889 context</a> in which scripts execute, and that the scripts
2890 never cause non-conforming states to occur other than transiently
2891 during script execution itself. (This is only a "SHOULD" and not a
2892 "MUST" requirement because it has been proven to be impossible. <a href=#refsCOMPUTABLE>[COMPUTABLE]</a>)</p>
2894 <p>The term "HTML validator" can be used to refer to a
2895 conformance checker that itself conforms to the applicable
2896 requirements of this specification.</p>
2901 <p>XML DTDs cannot express all the conformance requirements of
2902 this specification. Therefore, a validating XML processor and a
2903 DTD cannot constitute a conformance checker. Also, since neither
2904 of the two authoring formats defined in this specification are
2905 applications of SGML, a validating SGML system cannot constitute
2906 a conformance checker either.</p>
2908 <p>To put it another way, there are three types of conformance
2911 <ol><li>Criteria that can be expressed in a DTD.</li>
2913 <li>Criteria that cannot be expressed by a DTD, but can still be
2914 checked by a machine.</li>
2916 <li>Criteria that can only be checked by a human.</li>
2918 </ol><p>A conformance checker must check for the first two. A simple
2919 DTD-based validator only checks for the first class of errors and
2920 is therefore not a conforming conformance checker according to
2921 this specification.</p>
2926 <dt>Data mining tools</dt>
2930 <p>Applications and tools that process HTML and XHTML documents
2931 for reasons other than to either render the documents or check
2932 them for conformance should act in accordance with the semantics
2933 of the documents that they process.</p>
2935 <p class=example>A tool that generates <a href=#outline title=outline>document outlines</a> but increases the nesting
2936 level for each paragraph and does not increase the nesting level