<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!-- when publishing, change bits marked ZZZ -->
<html lang="en-US">
<head>
<meta name="generator" content=
"HTML Tidy for Linux (vers 1 September 2005), see www.w3.org">
<title>HTML 5</title>
<style type="text/css">
dt, dfn { font-weight: bold; font-style: normal; }
img.extra { float: right; }
body ins, body del { display: block; }
body * ins, body * del { display: inline; }
pre, code { color: black; background: transparent; font-size: inherit; font-family: monospace; }
pre strong { color: black; font: inherit; font-weight: bold; background: yellow; }
pre em { font-weight: bolder; font-style: normal; }
pre.idl :link, pre.idl :visited { color: inherit; background: transparent; }
pre.idl { border: solid thin; background: #EEEEEE; color: black; padding: 0.5em; }
table { border-collapse: collapse; border-style: hidden hidden none hidden; }
table thead { border-bottom: solid; }
table tbody th:first-child { border-left: solid; }
table td, table th { border-left: solid; border-right: solid; border-bottom: solid thin; vertical-align: top; padding: 0.2em; }
ul.toc dfn, h1 dfn, h2 dfn, h3 dfn, h4 dfn, h5 dfn, h6 dfn { font: inherit; }
ul.toc li ul { margin-bottom: 0.75em; }
ul.toc li ul li ul { margin-bottom: 0.25em; }
var sub { vertical-align: bottom; font-size: smaller; position: relative; top: 0.1em; }
@media screen { code { color: rgb(255, 69, 0); background: transparent; } }
code :link, code :visited { color: inherit; background: transparent; }
.example { display: block; color: #222222; background: #FCFCFC; border-left: double; margin-left: 1em; padding-left: 1em; }
.issue, .big-issue { color: #E50000; background: white; border: solid red; padding: 0.5em; margin: 1em 0; }
.issue > :first-child, .big-issue > :first-child { margin-top: 0; }
p .big-issue { line-height: 3em; }
.note { color: green; background: transparent; }
.note { font-family: sans-serif; }
p.note:before { content: 'Note: '; }
.warning { color: red; background: transparent; }
.warning:before { font-style: normal; }
p.warning:before { content: '\26A0 Warning! '; }
.note, .warning { font-weight: bolder; font-style: italic; padding: 0.5em 2em; }
.copyright { margin: 0.25em 0; }
img { max-width: 100%; }
h4 + .element { margin-top: -2.5em; padding-top: 2em; }
h4 + p + .element { margin-top: -5em; padding-top: 4em; }
.element { background: #EEEEFF; color: black; margin: 0 0 1em -1em; padding: 0 1em 0.25em 0.75em; border-left: solid #9999FF 0.25em; }
table.matrix, table.matrix td { border: none; text-align: right; }
table.matrix { margin-left: 2em; }
</style>
<link href="http://www.w3.org/StyleSheets/TR/%57%33%43-WD" rel=
"stylesheet" type="text/css"><!-- ZZZ -->
</head>
<body>
<div class="head">
<p><a href="http://www.w3.org/"><img alt="W3C" height="48" src=
"http://www.w3.org/Icons/w3c_home" width="72"></a></p>
<h1 id="html-5">HTML 5</h1>
<h2 class="no-num no-toc" id="a-vocabulary">A vocabulary and
associated APIs for HTML and XHTML</h2>
<h2 class="no-num no-toc" id="w3c-working">W3C Working Draft
<del class="diff-old">22 January</del> <ins class="diff-chg">10
June</ins> 2008</h2>
<dl>
<dt>This Version:</dt>
<dd><del class=
"diff-old">http://www.w3.org/TR/2008/WD-html5-20080122/</del>
<a href="http://www.w3.org/TR/2008/WD-html5-20080610"><ins class=
"diff-chg">http://www.w3.org/TR/2008/WD-html5-20080610/</ins></a></dd>
<dt>Latest Published Version:</dt>
<dd><a href=
"http://www.w3.org/TR/html5/">http://www.w3.org/TR/html5/</a></dd>
<dt>Latest Editor's Draft:</dt>
<dd><a href=
"http://www.w3.org/html/wg/html5/">http://www.w3.org/html/wg/html5/</a></dd>
<dt><ins class="diff-new">Previous Versions:</ins></dt>
<dd><a href=
"http://www.w3.org/TR/2008/WD-html5-20080122/"><ins class=
"diff-new">http://www.w3.org/TR/2008/WD-html5-20080122/</ins></a></dd>
<dt>Editors:</dt>
<dd><a href="mailto:ian@hixie.ch">Ian Hickson</a> , Google,
Inc.</dd>
<dd>David Hyatt, Apple, Inc.</dd>
</dl>
<p><ins class="diff-new">The content of this document is also
available in the following normative format:</ins></p>
<ul>
<li><ins class="diff-new">As a</ins> <a href=
"http://www.w3.org/TR/2008/WD-html5-20080610/"><ins class=
"diff-new">multipage HTML file</ins></a></li>
</ul>
<p><ins class="diff-new">The content is also available in the
following non-normative format:</ins></p>
<ul>
<li><ins class="diff-new">As a</ins> <a href=
"http://www.w3.org/TR/2008/WD-html5-20080610/diff/"><ins class=
"diff-new">diff-marked version</ins></a> <ins class=
"diff-new">showing changes made between 22 January 2008 and 10 June
2008</ins></li>
</ul>
<p class="copyright"><a href=
"http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
© 2008 <a href="http://www.w3.org/"><abbr title=
"World Wide Web Consortium">W3C</abbr></a> <sup>®</sup> ( <a href=
"http://www.csail.mit.edu/"><abbr title=
"Massachusetts Institute of Technology">MIT</abbr></a> , <a href=
"http://www.ercim.org/"><abbr title=
"European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>
, <a href="http://www.keio.ac.jp/">Keio</a> ), All Rights Reserved.
W3C <a href=
"http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>
, <a href=
"http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
and <a href=
"http://www.w3.org/Consortium/Legal/copyright-documents">document
use</a> rules apply.</p>
</div>
<hr>
<h2 class="no-num no-toc" id="abstract">Abstract</h2>
<p>This specification defines the 5th major revision of the core
language of the World Wide <del class="diff-old">Web, HTML.</del>
<ins class="diff-chg">Web: the Hypertext Markup Language
(HTML).</ins> In this version, new features are introduced to help
Web application authors, new elements are introduced based on
research into prevailing authoring practices, and special attention
has been given to defining clear conformance criteria for user
agents in an effort to improve interoperability.</p>
<h2 class="no-num no-toc" id="status">Status of this document</h2>
<p><em>This section describes the status of this document at the
time of its publication. Other documents may supersede this
document. A list of current W3C publications and the <del class=
"diff-old">latest</del> <ins class="diff-chg">most recently
formally published</ins> revision of this technical report can be
found in the <a href="http://www.w3.org/TR/">W3C technical reports
index</a> at http://www.w3.org/TR/.</em></p>
<p>If you wish to make comments regarding this document, please
send them to <a href=
"mailto:public-html-comments@w3.org">public-html-comments@w3.org</a>
( <a href=
"mailto:public-html-comments-request@w3.org?subject=subscribe">subscribe</a>
, <a href=
"http://lists.w3.org/Archives/Public/public-html-comments/">archives</a>
). All feedback is welcome.</p>
<p>Implementors should be aware that this specification is not
stable. <strong>Implementors who are not taking part in the
discussions are likely to find the specification changing out from
under them in incompatible ways.</strong> Vendors interested in
implementing this specification before it eventually reaches the
Candidate Recommendation stage should join the aforementioned
mailing lists and take part in the discussions.</p>
<p>The publication of this document by the W3C as a W3C Working
Draft does not imply that all of the participants in the W3C HTML
working group endorse the contents of the specification. Indeed,
for any section of the specification, one can usually find many
members of the working group or of the W3C as a whole who object
strongly to the current text, the existence of the section at all,
or the idea that the working group should even spend time
discussing the concept of that section.</p>
<p>The <ins class="diff-new">changes made to this draft
specification after the 22 January 2008 First Public Working Draft
and this 10 June 2008 Working Draft are recorded in the following
documents:</ins></p>
<ul>
<li><ins class="diff-new">A non-normative</ins> <a href=
"http://www.w3.org/TR/2008/WD-html5-20080610/diff/"><ins class=
"diff-new">diff-marked version</ins></a> <ins class="diff-new">of
the specification</ins></li>
<li><ins class="diff-new">A non-normative</ins> <a href=
"http://www.w3.org/TR/2008/NOTE-html5-pubnotes-20080610/"><ins class="diff-new">
HTML 5 Publication Notes</ins></a> <ins class="diff-new">document
that provides prose descriptions of the changes.</ins></li>
</ul>
<p><ins class="diff-new">The following document is also available;
it describes the differences between HTML 5 and the previous major
version of the language, HTML 4:</ins></p>
<ul>
<li><a href=
"http://www.w3.org/TR/2008/WD-html5-diff-20080610/"><ins class=
"diff-new">HTML 5 differences from HTML 4</ins></a></li>
</ul>
<p><ins class="diff-new">The</ins> W3C <a href=
"http://www.w3.org/html/wg/">HTML Working Group</a> is the W3C
working group responsible for this specification's progress along
the W3C Recommendation track. This specification is the <del class=
"diff-old">22 January</del> <ins class="diff-chg">10 June</ins>
2008 <del class="diff-old">First Public</del> Working Draft.</p>
<p>This document was produced by a group operating under the
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5
February 2004 W3C Patent Policy</a> . W3C maintains a <a href=
"http://www.w3.org/2004/01/pp-impl/40318/status" rel=
"disclosure">public list of any patent disclosures</a> made in
connection with the deliverables of the group; that page also
includes instructions for disclosing a patent. An individual who
has actual knowledge of a patent which the individual believes
contains <a href=
"http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">
Essential Claim(s)</a> must disclose the information in accordance
with <a href=
"http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">
section 6 of the W3C Patent Policy</a> .</p>
<h3 class="no-num no-toc" id="stability0">Stability</h3>
<p>Different parts of this specification are at different levels of
maturity.</p>
<div id="stability"></div>
<p class="big-issue">Some of the more major known issues are marked
like this. There are many other issues that have been raised as
well; the issues given in this document are not the only known
issues! There are also some spec-wide issues that have not yet been
addressed: case-sensitivity is a very poorly handled topic right
now, and the firing of events needs to be unified (right now some
bubble, some don't, they all use different text to fire events,
etc). It would also be nice to unify the rules on downloading
content when attributes change (e.g. <code title="">src</code>
attributes) - should they initiate downloads when the element
immediately, is inserted in the document, when active scripts end,
etc. This matters e.g. if an attribute is set twice in a row (does
it hit the network twice).</p>
<h2 class="no-num no-toc" id="contents">Table of contents</h2>
<ul class="toc">
<li><a href="#introduction"><span class="secno">1.</span>
Introduction</a>
<ul class="toc">
<li><a href="#scope"><span class="secno"><del class=
"diff-old">1.1.</del> <ins class="diff-chg">1.1</ins></span>
Scope</a>
<ul class="toc">
<li><a href="#relationship"><span class="secno"><del class=
"diff-old">1.1.1.</del> <ins class="diff-chg">1.1.1</ins></span>
Relationship to HTML 4.01, XHTML 1.1, DOM2 HTML</a></li>
<li><a href="#relationship0"><span class="secno"><del class=
"diff-old">1.1.2.</del> <ins class="diff-chg">1.1.2</ins></span>
Relationship to XHTML2</a></li>
<li><a href="#relationship1"><span class="secno"><del class=
"diff-old">1.1.3.</del> <ins class="diff-chg">1.1.3</ins></span>
Relationship to XUL, Flash, Silverlight, and other proprietary UI
languages</a></li>
</ul>
</li>
<li><a href="#structure"><span class="secno"><del class=
"diff-old">1.2.</del> <ins class="diff-chg">1.2</ins></span>
Structure of this specification</a>
<ul class="toc">
<li><a href="#how-to"><span class="secno"><del class=
"diff-old">1.2.1.</del> <ins class="diff-chg">1.2.1</ins></span>
How to read this specification</a></li>
</ul>
</li>
<li><a href="#conformance"><span class="secno"><del class=
"diff-old">1.3.</del> <ins class="diff-chg">1.3</ins></span>
Conformance requirements</a>
<ul class="toc">
<li><a href="#common"><span class="secno"><del class=
"diff-old">1.3.1.</del> <ins class="diff-chg">1.3.1</ins></span>
Common conformance requirements for APIs exposed to
JavaScript</a></li>
<li><a href="#dependencies"><span class="secno"><del class=
"diff-old">1.3.2.</del> <ins class="diff-chg">1.3.2</ins></span>
Dependencies</a></li>
<li><a href="#features"><span class="secno"><del class=
"diff-old">1.3.3.</del> <ins class="diff-chg">1.3.3</ins></span>
Features defined in other specifications</a></li>
</ul>
</li>
<li><a href="#terminology"><span class="secno"><del class=
"diff-old">1.4.</del> <ins class="diff-chg">1.4</ins></span>
Terminology</a>
<ul class="toc">
<li><a href="#html-vs"><span class="secno"><del class=
"diff-old">1.4.1.</del> <ins class="diff-chg">1.4.1</ins></span>
HTML vs XHTML</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#dom"><span class="secno">2.</span> The Document
Object Model</a>
<ul class="toc">
<li><a href="#documents"><span class="secno"><del class=
"diff-old">2.1.</del> <ins class="diff-chg">2.1</ins></span>
Documents</a>
<ul class="toc">
<li><a href="#security"><span class="secno"><del class=
"diff-old">2.1.1.</del> <ins class="diff-chg">2.1.1</ins></span>
Security</a></li>
<li><a href="#resource"><span class="secno"><del class=
"diff-old">2.1.2.</del> <ins class="diff-chg">2.1.2</ins></span>
Resource metadata management</a></li>
</ul>
</li>
<li><a href="#elements"><span class="secno"><del class=
"diff-old">2.2.</del> <ins class="diff-chg">2.2</ins></span>
Elements</a>
<ul class="toc">
<li><a href="#reflecting"><span class="secno"><del class=
"diff-old">2.2.1.</del> <ins class="diff-chg">2.2.1</ins></span>
Reflecting content attributes in DOM attributes</a></li>
</ul>
</li>
<li><a href="#common0"><span class="secno"><del class=
"diff-old">2.3.</del> <ins class="diff-chg">2.3</ins></span> Common
DOM interfaces</a>
<ul class="toc">
<li><a href="#collections"><span class="secno"><del class=
"diff-old">2.3.1.</del> <ins class="diff-chg">2.3.1</ins></span>
Collections</a>
<ul class="toc">
<li><a href="#htmlcollection"><span class="secno">2.3.1.1.</span>
HTMLCollection</a></li>
<li><a href="#htmlformcontrolscollection"><span class=
"secno">2.3.1.2.</span> HTMLFormControlsCollection</a></li>
<li><a href="#htmloptionscollection"><span class=
"secno">2.3.1.3.</span> HTMLOptionsCollection</a></li>
</ul>
</li>
<li><a href="#domtokenlist"><span class="secno"><del class=
"diff-old">2.3.2.</del> <ins class="diff-chg">2.3.2</ins></span>
DOMTokenList</a></li>
<li><a href="#domstringmap"><span class="secno"><ins class=
"diff-new">2.3.3</ins></span> <ins class=
"diff-new">DOMStringMap</ins></a></li>
<li><a href="#dom-feature"><span class="secno"><del class=
"diff-old">2.3.3.</del> <ins class="diff-chg">2.3.4</ins></span>
DOM feature strings</a></li>
</ul>
</li>
<li><a href="#dom-tree"><span class="secno"><del class=
"diff-old">2.4.</del> <ins class="diff-chg">2.4</ins></span> DOM
tree accessors</a></li>
<li><a href="#dynamic"><span class="secno"><del class=
"diff-old">2.5.</del> <ins class="diff-chg">2.5</ins></span>
Dynamic markup insertion</a>
<ul class="toc">
<li><a href="#controlling"><span class="secno"><del class=
"diff-old">2.5.1.</del> <ins class="diff-chg">2.5.1</ins></span>
Controlling the input stream</a></li>
<li><a href="#dynamic0"><span class="secno"><del class=
"diff-old">2.5.2.</del> <ins class="diff-chg">2.5.2</ins></span>
Dynamic markup insertion in HTML</a></li>
<li><a href="#dynamic1"><span class="secno"><del class=
"diff-old">2.5.3.</del> <ins class="diff-chg">2.5.3</ins></span>
Dynamic markup insertion in XML</a></li>
</ul>
</li>
<li><a href="#apis-in"><span class="secno"><del class=
"diff-old">2.6.</del> <ins class="diff-chg">2.6</ins></span> APIs
in HTML documents</a></li>
</ul>
</li>
<li><a href="#semantics"><span class="secno">3.</span> Semantics
and structure of HTML elements</a>
<ul class="toc">
<li><a href="#semantics-intro"><span class="secno"><del class=
"diff-old">3.1.</del> <ins class="diff-chg">3.1</ins></span>
Introduction</a></li>
<li><a href="#common1"><span class="secno"><del class=
"diff-old">3.2.</del> <ins class="diff-chg">3.2</ins></span> Common
microsyntaxes</a>
<ul class="toc">
<li><a href="#common2"><span class="secno"><del class=
"diff-old">3.2.1.</del> <ins class="diff-chg">3.2.1</ins></span>
Common parser idioms</a></li>
<li><a href="#boolean"><span class="secno"><del class=
"diff-old">3.2.2.</del> <ins class="diff-chg">3.2.2</ins></span>
Boolean attributes</a></li>
<li><a href="#numbers"><span class="secno"><del class=
"diff-old">3.2.3.</del> <ins class="diff-chg">3.2.3</ins></span>
Numbers</a>
<ul class="toc">
<li><a href="#unsigned"><span class="secno">3.2.3.1.</span>
Unsigned integers</a></li>
<li><a href="#signed"><span class="secno">3.2.3.2.</span> Signed
integers</a></li>
<li><a href="#real-numbers"><span class="secno">3.2.3.3.</span>
Real numbers</a></li>
<li><a href="#ratios"><span class="secno">3.2.3.4.</span>
Ratios</a></li>
<li><a href="#percentages-and-dimensions"><span class=
"secno">3.2.3.5.</span> Percentages and dimensions</a></li>
<li><a href="#lists"><span class="secno">3.2.3.6.</span> Lists of
integers</a></li>
</ul>
</li>
<li><a href="#dates"><span class="secno"><del class=
"diff-old">3.2.4.</del> <ins class="diff-chg">3.2.4</ins></span>
Dates and times</a>
<ul class="toc">
<li><a href="#specific"><span class="secno">3.2.4.1.</span>
Specific moments in time</a></li>
<li><a href="#vaguer"><span class="secno">3.2.4.2.</span> Vaguer
moments in time</a></li>
</ul>
</li>
<li><a href="#time-offsets"><span class="secno"><del class=
"diff-old">3.2.5.</del> <ins class="diff-chg">3.2.5</ins></span>
Time offsets</a></li>
<li><a href="#tokens"><span class="secno"><del class=
"diff-old">3.2.6.</del> <ins class="diff-chg">3.2.6</ins></span>
Tokens</a></li>
<li><a href="#keywords"><span class="secno"><del class=
"diff-old">3.2.7.</del> <ins class="diff-chg">3.2.7</ins></span>
Keywords and enumerated attributes</a></li>
<li><a href="#syntax-references"><span class="secno"><del class=
"diff-old">3.2.8.</del> <ins class="diff-chg">3.2.8</ins></span>
References</a></li>
<li><a href="#urls"><span class="secno"><ins class=
"diff-new">3.2.9</ins></span> <ins class=
"diff-new">URLs</ins></a></li>
</ul>
</li>
<li><a href="#documents0"><span class="secno"><del class=
"diff-old">3.3.</del> <ins class="diff-chg">3.3</ins></span>
Documents and document fragments</a>
<ul class="toc">
<li><a href="#semantics0"><span class="secno"><del class=
"diff-old">3.3.1.</del> <ins class="diff-chg">3.3.1</ins></span>
Semantics</a></li>
<li><a href="#structure0"><span class="secno"><del class=
"diff-old">3.3.2.</del> <ins class="diff-chg">3.3.2</ins></span>
Structure</a></li>
<li><a href="#kinds"><span class="secno"><del class=
"diff-old">3.3.3.</del> <ins class="diff-chg">3.3.3</ins></span>
Kinds of content</a>
<ul class="toc">
<li><a href="#metadata"><span class="secno">3.3.3.1.</span>
Metadata content</a></li>
<li><a href="#flow-content"><span class="secno">3.3.3.2.</span>
<del class="diff-old">Prose</del> <ins class="diff-chg">Flow</ins>
content</a></li>
<li><a href="#sectioning"><span class="secno">3.3.3.3.</span>
Sectioning content</a></li>
<li><a href="#heading"><span class="secno">3.3.3.4.</span> Heading
content</a></li>
<li><a href="#phrasing"><span class="secno">3.3.3.5.</span>
Phrasing content</a></li>
<li><a href="#embedded"><span class="secno">3.3.3.6.</span>
Embedded content</a></li>
<li><a href="#interactive0"><span class="secno">3.3.3.7.</span>
Interactive content</a></li>
</ul>
</li>
<li><a href="#transparent"><span class="secno"><del class=
"diff-old">3.3.4.</del> <ins class="diff-chg">3.3.4</ins></span>
Transparent content models</a></li>
<li><a href="#paragraphs"><span class="secno"><del class=
"diff-old">3.3.5.</del> <ins class="diff-chg">3.3.5</ins></span>
Paragraphs</a></li>
</ul>
</li>
<li><a href="#global"><span class="secno"><del class=
"diff-old">3.4.</del> <ins class="diff-chg">3.4</ins></span> Global
attributes</a>
<ul class="toc">
<li><a href="#the-id"><span class="secno"><del class=
"diff-old">3.4.1.</del> <ins class="diff-chg">3.4.1</ins></span>
The <code>id</code> attribute</a></li>
<li><a href="#the-title"><span class="secno"><del class=
"diff-old">3.4.2.</del> <ins class="diff-chg">3.4.2</ins></span>
The <code>title</code> attribute</a></li>
<li><a href="#the-lang"><span class="secno"><del class=
"diff-old">3.4.3.</del> <ins class="diff-chg">3.4.3</ins></span>
The <code>lang</code> (HTML only) and <code>xml:lang</code> (XML
only) attributes</a></li>
<li><a href="#the-xmlbase"><span class="secno"><ins class=
"diff-new">3.4.4</ins></span> <ins class="diff-new">The</ins>
<code><ins class="diff-new">xml:base</ins></code> <ins class=
"diff-new">attribute (XML only)</ins></a></li>
<li><a href="#the-dir"><span class="secno"><del class=
"diff-old">3.4.4.</del> <ins class="diff-chg">3.4.5</ins></span>
The <code>dir</code> attribute</a></li>
<li><a href="#classes"><span class="secno"><del class=
"diff-old">3.4.5.</del> <ins class="diff-chg">3.4.6</ins></span>
The <code>class</code> attribute</a></li>
<li><a href="#the-irrelevant"><span class="secno"><del class=
"diff-old">3.4.6.</del> <ins class="diff-chg">3.4.7</ins></span>
The <code>irrelevant</code> attribute</a></li>
<li><a href="#the-style"><span class="secno"><ins class=
"diff-new">3.4.8</ins></span> <ins class="diff-new">The</ins>
<code><ins class="diff-new">style</ins></code> <ins class=
"diff-new">attribute</ins></a></li>
<li><a href="#embedding"><span class="secno"><ins class=
"diff-new">3.4.9</ins></span> <ins class="diff-new">Embedding
custom non-visible data</ins></a></li>
</ul>
</li>
<li><a href="#interaction"><span class="secno"><del class=
"diff-old">3.5.</del> <ins class="diff-chg">3.5</ins></span>
Interaction</a>
<ul class="toc">
<li><a href="#activation"><span class="secno"><del class=
"diff-old">3.5.1.</del> <ins class="diff-chg">3.5.1</ins></span>
Activation</a></li>
<li><a href="#focus"><span class="secno"><del class=
"diff-old">3.5.2.</del> <ins class="diff-chg">3.5.2</ins></span>
Focus</a>
<ul class="toc">
<li><a href="#focus-management"><span class="secno">3.5.2.1.</span>
Focus management</a></li>
<li><a href="#sequential"><span class="secno">3.5.2.2.</span>
Sequential focus navigation</a></li>
</ul>
</li>
<li><a href="#scrolling"><span class="secno"><del class=
"diff-old">3.5.3.</del> <ins class="diff-chg">3.5.3</ins></span>
Scrolling elements into view</a></li>
</ul>
</li>
<li><a href="#the-root"><span class="secno"><del class=
"diff-old">3.6.</del> <ins class="diff-chg">3.6</ins></span> The
root element</a>
<ul class="toc">
<li><a href="#the-html"><span class="secno"><del class=
"diff-old">3.6.1.</del> <ins class="diff-chg">3.6.1</ins></span>
The <code>html</code> element</a></li>
</ul>
</li>
<li><a href="#document"><span class="secno"><del class=
"diff-old">3.7.</del> <ins class="diff-chg">3.7</ins></span>
Document metadata</a>
<ul class="toc">
<li><a href="#the-head"><span class="secno"><del class=
"diff-old">3.7.1.</del> <ins class="diff-chg">3.7.1</ins></span>
The <code>head</code> element</a></li>
<li><a href="#the-title0"><span class="secno"><del class=
"diff-old">3.7.2.</del> <ins class="diff-chg">3.7.2</ins></span>
The <code>title</code> element</a></li>
<li><a href="#the-base"><span class="secno"><del class=
"diff-old">3.7.3.</del> <ins class="diff-chg">3.7.3</ins></span>
The <code>base</code> element</a></li>
<li><a href="#the-link"><span class="secno"><del class=
"diff-old">3.7.4.</del> <ins class="diff-chg">3.7.4</ins></span>
The <code>link</code> element</a></li>
<li><a href="#meta"><span class="secno"><del class=
"diff-old">3.7.5.</del> <ins class="diff-chg">3.7.5</ins></span>
The <code>meta</code> element</a>
<ul class="toc">
<li><a href="#standard"><span class="secno">3.7.5.1.</span>
Standard metadata names</a></li>
<li><a href="#other"><span class="secno">3.7.5.2.</span> Other
metadata names</a></li>
<li><a href="#pragma"><span class="secno">3.7.5.3.</span> Pragma
directives</a></li>
<li><a href="#charset"><span class="secno">3.7.5.4.</span>
Specifying the document's character encoding</a></li>
</ul>
</li>
<li><a href="#the-style0"><span class="secno"><del class=
"diff-old">3.7.6.</del> <ins class="diff-chg">3.7.6</ins></span>
The <code>style</code> element</a></li>
<li><a href="#styling"><span class="secno"><del class=
"diff-old">3.7.7.</del> <ins class="diff-chg">3.7.7</ins></span>
Styling</a></li>
</ul>
</li>
<li><a href="#sections"><span class="secno"><del class=
"diff-old">3.8.</del> <ins class="diff-chg">3.8</ins></span>
Sections</a>
<ul class="toc">
<li><a href="#the-body"><span class="secno"><del class=
"diff-old">3.8.1.</del> <ins class="diff-chg">3.8.1</ins></span>
The <code>body</code> element</a></li>
<li><a href="#the-section"><span class="secno"><del class=
"diff-old">3.8.2.</del> <ins class="diff-chg">3.8.2</ins></span>
The <code>section</code> element</a></li>
<li><a href="#the-nav"><span class="secno"><del class=
"diff-old">3.8.3.</del> <ins class="diff-chg">3.8.3</ins></span>
The <code>nav</code> element</a></li>
<li><a href="#the-article"><span class="secno"><del class=
"diff-old">3.8.4.</del> <ins class="diff-chg">3.8.4</ins></span>
The <code>article</code> element</a></li>
<li><del class="diff-old">3.8.5. The blockquote element</del>
<a href="#the-aside"><span class="secno"><del class=
"diff-old">3.8.6.</del> <ins class="diff-chg">3.8.5</ins></span>
The <code>aside</code> element</a></li>
<li><a href="#the-h1"><span class="secno"><del class=
"diff-old">3.8.7.</del> <ins class="diff-chg">3.8.6</ins></span>
The <code>h1</code> , <code>h2</code> , <code>h3</code> ,
<code>h4</code> , <code>h5</code> , and <code>h6</code>
elements</a></li>
<li><a href="#the-header"><span class="secno"><del class=
"diff-old">3.8.8.</del> <ins class="diff-chg">3.8.7</ins></span>
The <code>header</code> element</a></li>
<li><a href="#the-footer"><span class="secno"><del class=
"diff-old">3.8.9.</del> <ins class="diff-chg">3.8.8</ins></span>
The <code>footer</code> element</a></li>
<li><a href="#the-address"><span class="secno"><del class=
"diff-old">3.8.10.</del> <ins class="diff-chg">3.8.9</ins></span>
The <code>address</code> element</a></li>
<li><a href="#headings"><span class="secno"><del class=
"diff-old">3.8.11.</del> <ins class="diff-chg">3.8.10</ins></span>
Headings and sections</a>
<ul class="toc">
<li><a href="#outlines"><span class="secno"><del class=
"diff-old">3.8.11.1.</del> <ins class=
"diff-chg">3.8.10.1.</ins></span> Creating an outline</a></li>
<li><del class="diff-old">3.8.11.2. Determining which heading and
section applies to a particular node</del> <a href=
"#distinguishing"><span class="secno"><del class=
"diff-old">3.8.11.3.</del> <ins class=
"diff-chg">3.8.10.2.</ins></span> Distinguishing site-wide
<del class="diff-old">headers</del> <ins class=
"diff-chg">headings</ins> from page <del class=
"diff-old">headers</del> <ins class=
"diff-chg">headings</ins></a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#grouping"><span class="secno"><del class=
"diff-old">3.9.</del> <ins class="diff-chg">3.9</ins></span>
<del class="diff-old">Prose</del> <ins class="diff-chg">Grouping
content</ins></a>
<ul class="toc">
<li><a href="#the-p"><span class="secno"><del class=
"diff-old">3.9.1.</del> <ins class="diff-chg">3.9.1</ins></span>
The <code>p</code> element</a></li>
<li><a href="#the-hr"><span class="secno"><del class=
"diff-old">3.9.2.</del> <ins class="diff-chg">3.9.2</ins></span>
The <code>hr</code> element</a></li>
<li><a href="#the-br"><span class="secno"><del class=
"diff-old">3.9.3.</del> <ins class="diff-chg">3.9.3</ins></span>
The <code>br</code> element</a></li>
<li><a href="#the-pre"><span class="secno"><del class=
"diff-old">3.9.4.</del> <ins class="diff-chg">3.9.4</ins></span>
The <code><del class="diff-old">dialog</del> <ins class=
"diff-chg">pre</ins></code> element</a> <del class="diff-old">3.10.
Preformatted text</del></li>
<li><a href="#the-dialog"><span class="secno"><del class=
"diff-old">3.10.1.</del> <ins class="diff-chg">3.9.5</ins></span>
The <code><del class="diff-old">pre</del> <ins class=
"diff-chg">dialog</ins></code> element</a></li>
<li><a href="#the-blockquote"><span class="secno"><del class=
"diff-old">3.11.</del> <ins class="diff-chg">3.9.6</ins></span>
<del class="diff-old">Lists</del> <ins class="diff-chg">The</ins>
<code><ins class="diff-chg">blockquote</ins></code> <ins class=
"diff-chg">element</ins></a></li>
<li><a href="#the-ol"><span class="secno"><del class=
"diff-old">3.11.1.</del> <ins class="diff-chg">3.9.7</ins></span>
The <code>ol</code> element</a></li>
<li><a href="#the-ul"><span class="secno"><del class=
"diff-old">3.11.2.</del> <ins class="diff-chg">3.9.8</ins></span>
The <code>ul</code> element</a></li>
<li><a href="#the-li"><span class="secno"><del class=
"diff-old">3.11.3.</del> <ins class="diff-chg">3.9.9</ins></span>
The <code>li</code> element</a></li>
<li><a href="#the-dl"><span class="secno"><del class=
"diff-old">3.11.4.</del> <ins class="diff-chg">3.9.10</ins></span>
The <code>dl</code> element</a></li>
<li><a href="#the-dt"><span class="secno"><del class=
"diff-old">3.11.5.</del> <ins class="diff-chg">3.9.11</ins></span>
The <code>dt</code> element</a></li>
<li><a href="#the-dd"><span class="secno"><del class=
"diff-old">3.11.6.</del> <ins class="diff-chg">3.9.12</ins></span>
The <code>dd</code> element</a></li>
</ul>
</li>
<li><a href="#text-level"><span class="secno"><del class=
"diff-old">3.12.</del> <ins class="diff-chg">3.10</ins></span>
<del class="diff-old">Phrase elements</del> <ins class=
"diff-chg">Text-level semantics</ins></a>
<ul class="toc">
<li><a href="#the-a"><span class="secno"><del class=
"diff-old">3.12.1.</del> <ins class="diff-chg">3.10.1</ins></span>
The <code>a</code> element</a></li>
<li><a href="#the-q"><span class="secno"><del class=
"diff-old">3.12.2.</del> <ins class="diff-chg">3.10.2</ins></span>
The <code>q</code> element</a></li>
<li><a href="#the-cite"><span class="secno"><del class=
"diff-old">3.12.3.</del> <ins class="diff-chg">3.10.3</ins></span>
The <code>cite</code> element</a></li>
<li><a href="#the-em"><span class="secno"><del class=
"diff-old">3.12.4.</del> <ins class="diff-chg">3.10.4</ins></span>
The <code>em</code> element</a></li>
<li><a href="#the-strong"><span class="secno"><del class=
"diff-old">3.12.5.</del> <ins class="diff-chg">3.10.5</ins></span>
The <code>strong</code> element</a></li>
<li><a href="#the-small"><span class="secno"><del class=
"diff-old">3.12.6.</del> <ins class="diff-chg">3.10.6</ins></span>
The <code>small</code> element</a></li>
<li><a href="#the-mark"><span class="secno"><del class=
"diff-old">3.12.7.</del> <ins class="diff-chg">3.10.7</ins></span>
The <code><del class="diff-old">m</del> <ins class=
"diff-chg">mark</ins></code> element</a></li>
<li><a href="#the-dfn"><span class="secno"><del class=
"diff-old">3.12.8.</del> <ins class="diff-chg">3.10.8</ins></span>
The <code>dfn</code> element</a></li>
<li><a href="#the-abbr"><span class="secno"><del class=
"diff-old">3.12.9.</del> <ins class="diff-chg">3.10.9</ins></span>
The <code>abbr</code> element</a></li>
<li><a href="#the-time"><span class="secno"><del class=
"diff-old">3.12.10.</del> <ins class=
"diff-chg">3.10.10</ins></span> The <code>time</code>
element</a></li>
<li><a href="#the-progress"><span class="secno"><del class=
"diff-old">3.12.11.</del> <ins class=
"diff-chg">3.10.11</ins></span> The <code>progress</code>
element</a></li>
<li><a href="#the-meter"><span class="secno"><del class=
"diff-old">3.12.12.</del> <ins class=
"diff-chg">3.10.12</ins></span> The <code>meter</code>
element</a></li>
<li><a href="#the-code"><span class="secno"><del class=
"diff-old">3.12.13.</del> <ins class=
"diff-chg">3.10.13</ins></span> The <code>code</code>
element</a></li>
<li><a href="#the-var"><span class="secno"><del class=
"diff-old">3.12.14.</del> <ins class=
"diff-chg">3.10.14</ins></span> The <code>var</code>
element</a></li>
<li><a href="#the-samp"><span class="secno"><del class=
"diff-old">3.12.15.</del> <ins class=
"diff-chg">3.10.15</ins></span> The <code>samp</code>
element</a></li>
<li><a href="#the-kbd"><span class="secno"><del class=
"diff-old">3.12.16.</del> <ins class=
"diff-chg">3.10.16</ins></span> The <code>kbd</code>
element</a></li>
<li><a href="#the-sub"><span class="secno"><del class=
"diff-old">3.12.17.</del> <ins class=
"diff-chg">3.10.17</ins></span> The <code>sub</code> and
<code>sup</code> elements</a></li>
<li><a href="#the-span"><span class="secno"><del class=
"diff-old">3.12.18.</del> <ins class=
"diff-chg">3.10.18</ins></span> The <code>span</code>
element</a></li>
<li><a href="#the-i"><span class="secno"><del class=
"diff-old">3.12.19.</del> <ins class=
"diff-chg">3.10.19</ins></span> The <code>i</code> element</a></li>
<li><a href="#the-b"><span class="secno"><del class=
"diff-old">3.12.20.</del> <ins class=
"diff-chg">3.10.20</ins></span> The <code>b</code> element</a></li>
<li><a href="#the-bdo"><span class="secno"><del class=
"diff-old">3.12.21.</del> <ins class=
"diff-chg">3.10.21</ins></span> The <code>bdo</code>
element</a></li>
<li><a href="#the-ruby"><span class="secno"><ins class=
"diff-new">3.10.22</ins></span> <ins class="diff-new">The</ins>
<code><ins class="diff-new">ruby</ins></code> <ins class=
"diff-new">element</ins></a></li>
<li><a href="#the-rt"><span class="secno"><ins class=
"diff-new">3.10.23</ins></span> <ins class="diff-new">The</ins>
<code><ins class="diff-new">rt</ins></code> <ins class=
"diff-new">element</ins></a></li>
<li><a href="#the-rp"><span class="secno"><ins class=
"diff-new">3.10.24</ins></span> <ins class="diff-new">The</ins>
<code><ins class="diff-new">rp</ins></code> <ins class=
"diff-new">element</ins></a></li>
<li><a href="#usage"><span class="secno"><ins class=
"diff-new">3.10.25</ins></span> <ins class="diff-new">Usage
summary</ins></a></li>
<li><a href="#footnotes"><span class="secno"><ins class=
"diff-new">3.10.26</ins></span> <ins class=
"diff-new">Footnotes</ins></a></li>
</ul>
</li>
<li><a href="#edits"><span class="secno"><del class=
"diff-old">3.13.</del> <ins class="diff-chg">3.11</ins></span>
Edits</a>
<ul class="toc">
<li><a href="#the-ins"><span class="secno"><del class=
"diff-old">3.13.1.</del> <ins class="diff-chg">3.11.1</ins></span>
The <code>ins</code> element</a></li>
<li><a href="#the-del"><span class="secno"><del class=
"diff-old">3.13.2.</del> <ins class="diff-chg">3.11.2</ins></span>
The <code>del</code> element</a></li>
<li><a href="#attributes"><span class="secno"><del class=
"diff-old">3.13.3.</del> <ins class="diff-chg">3.11.3</ins></span>
Attributes common to <code>ins</code> and <code>del</code>
elements</a></li>
<li><a href="#edits0"><span class="secno"><ins class=
"diff-new">3.11.4</ins></span> <ins class="diff-new">Edits and
paragraphs</ins></a></li>
<li><a href="#edits1"><span class="secno"><ins class=
"diff-new">3.11.5</ins></span> <ins class="diff-new">Edits and
lists</ins></a></li>
</ul>
</li>
<li><a href="#embedded0"><span class="secno"><del class=
"diff-old">3.14.</del> <ins class="diff-chg">3.12</ins></span>
Embedded content</a>
<ul class="toc">
<li><a href="#the-figure"><span class="secno"><del class=
"diff-old">3.14.1.</del> <ins class="diff-chg">3.12.1</ins></span>
The <code>figure</code> element</a></li>
<li><a href="#the-img"><span class="secno"><del class=
"diff-old">3.14.2.</del> <ins class="diff-chg">3.12.2</ins></span>
The <code>img</code> element</a></li>
<li><a href="#the-iframe"><span class="secno"><del class=
"diff-old">3.14.3.</del> <ins class="diff-chg">3.12.3</ins></span>
The <code>iframe</code> element</a></li>
<li><a href="#the-embed"><span class="secno"><del class=
"diff-old">3.14.4.</del> <ins class="diff-chg">3.12.4</ins></span>
The <code>embed</code> element</a></li>
<li><a href="#the-object"><span class="secno"><del class=
"diff-old">3.14.5.</del> <ins class="diff-chg">3.12.5</ins></span>
The <code>object</code> element</a></li>
<li><a href="#the-param"><span class="secno"><del class=
"diff-old">3.14.6.</del> <ins class="diff-chg">3.12.6</ins></span>
The <code>param</code> element</a></li>
<li><a href="#video"><span class="secno"><del class=
"diff-old">3.14.7.</del> <ins class="diff-chg">3.12.7</ins></span>
The <code>video</code> element</a>
<ul class="toc">
<li><a href="#video0"><span class="secno"><del class=
"diff-old">3.14.7.1.</del> <ins class=
"diff-chg">3.12.7.1.</ins></span> Video and audio codecs for
<code>video</code> elements</a></li>
</ul>
</li>
<li><a href="#audio"><span class="secno"><del class=
"diff-old">3.14.8.</del> <ins class="diff-chg">3.12.8</ins></span>
The <code>audio</code> element</a>
<ul class="toc">
<li><a href="#audio0"><span class="secno"><del class=
"diff-old">3.14.8.1.</del> <ins class=
"diff-chg">3.12.8.1.</ins></span> Audio codecs for
<code>audio</code> elements</a></li>
</ul>
</li>
<li><a href="#the-source"><span class="secno"><ins class=
"diff-new">3.12.9</ins></span> <ins class="diff-new">The</ins>
<code><ins class="diff-new">source</ins></code> <ins class=
"diff-new">element</ins></a></li>
<li><a href="#media"><span class="secno"><del class=
"diff-old">3.14.9.</del> <ins class="diff-chg">3.12.10</ins></span>
Media elements</a>
<ul class="toc">
<li><a href="#error"><span class="secno"><del class=
"diff-old">3.14.9.1.</del> <ins class=
"diff-chg">3.12.10.1.</ins></span> Error codes</a></li>
<li><a href="#location"><span class="secno"><del class=
"diff-old">3.14.9.2.</del> <ins class=
"diff-chg">3.12.10.2.</ins></span> Location of the media
resource</a></li>
<li><a href="#network0"><span class="secno"><del class=
"diff-old">3.14.9.3.</del> <ins class=
"diff-chg">3.12.10.3.</ins></span> Network states</a></li>
<li><a href="#loading"><span class="secno"><del class=
"diff-old">3.14.9.4.</del> <ins class=
"diff-chg">3.12.10.4.</ins></span> Loading the media
resource</a></li>
<li><a href="#offsets"><span class="secno"><del class=
"diff-old">3.14.9.5.</del> <ins class=
"diff-chg">3.12.10.5.</ins></span> Offsets into the media
resource</a></li>
<li><a href="#the-ready"><span class="secno"><del class=
"diff-old">3.14.9.6.</del> <ins class=
"diff-chg">3.12.10.6.</ins></span> The ready states</a></li>
<li><a href="#playing"><span class="secno"><del class=
"diff-old">3.14.9.7.</del> <ins class=
"diff-chg">3.12.10.7.</ins></span> Playing the media
resource</a></li>
<li><a href="#seeking"><span class="secno"><del class=
"diff-old">3.14.9.8.</del> <ins class=
"diff-chg">3.12.10.8.</ins></span> Seeking</a></li>
<li><a href="#cue-ranges"><span class="secno"><del class=
"diff-old">3.14.9.9.</del> <ins class=
"diff-chg">3.12.10.9.</ins></span> Cue ranges</a></li>
<li><a href="#user-interface"><span class="secno"><del class=
"diff-old">3.14.9.10.</del> <ins class=
"diff-chg">3.12.10.10.</ins></span> User interface</a></li>
<li><a href="#time-ranges"><span class="secno"><del class=
"diff-old">3.14.9.11.</del> <ins class=
"diff-chg">3.12.10.11.</ins></span> Time <del class=
"diff-old">range</del> <ins class="diff-chg">ranges</ins></a></li>
<li><a href="#byte-ranges"><span class="secno"><ins class=
"diff-chg">3.12.10.12.</ins></span> <ins class="diff-chg">Byte
ranges</ins></a></li>
<li><a href="#mediaevents"><span class="secno"><del class=
"diff-old">3.14.9.12.</del> <ins class=
"diff-chg">3.12.10.13.</ins></span> Event summary</a></li>
<li><a href="#security0"><span class="secno"><del class=
"diff-old">3.14.9.13.</del> <ins class=
"diff-chg">3.12.10.14.</ins></span> Security and privacy
considerations</a></li>
</ul>
</li>
<li><del class="diff-old">3.14.10. The source element</del>
<a href="#the-canvas"><span class="secno"><del class=
"diff-old">3.14.11.</del> <ins class=
"diff-chg">3.12.11</ins></span> The <code>canvas</code> element</a>
<ul class="toc">
<li><a href="#the-2d"><span class="secno"><del class=
"diff-old">3.14.11.1.</del> <ins class=
"diff-chg">3.12.11.1.</ins></span> The 2D context</a>
<ul class="toc">
<li><a href="#the-canvas0"><span class="secno"><del class=
"diff-old">3.14.11.1.1.</del> <ins class=
"diff-chg">3.12.11.1.1.</ins></span> The canvas state</a></li>
<li><a href="#transformations"><span class="secno"><del class=
"diff-old">3.14.11.1.2.</del> <ins class=
"diff-chg">3.12.11.1.2.</ins></span> Transformations</a></li>
<li><a href="#compositing"><span class="secno"><del class=
"diff-old">3.14.11.1.3.</del> <ins class=
"diff-chg">3.12.11.1.3.</ins></span> Compositing</a></li>
<li><a href="#colors"><span class="secno"><del class=
"diff-old">3.14.11.1.4.</del> <ins class=
"diff-chg">3.12.11.1.4.</ins></span> Colors and styles</a></li>
<li><a href="#line-styles"><span class="secno"><del class=
"diff-old">3.14.11.1.5.</del> <ins class=
"diff-chg">3.12.11.1.5.</ins></span> Line styles</a></li>
<li><a href="#shadows"><span class="secno"><del class=
"diff-old">3.14.11.1.6.</del> <ins class=
"diff-chg">3.12.11.1.6.</ins></span> Shadows</a></li>
<li><a href="#simple"><span class="secno"><del class=
"diff-old">3.14.11.1.7.</del> <ins class=
"diff-chg">3.12.11.1.7.</ins></span> Simple shapes
(rectangles)</a></li>
<li><a href="#complex"><span class="secno"><del class=
"diff-old">3.14.11.1.8.</del> <ins class=
"diff-chg">3.12.11.1.8.</ins></span> Complex shapes
(paths)</a></li>
<li><a href="#text"><span class="secno"><ins class=
"diff-new">3.12.11.1.9.</ins></span> <ins class=
"diff-new">Text</ins></a></li>
<li><a href="#images"><span class="secno"><del class=
"diff-old">3.14.11.1.9.</del> <ins class=
"diff-chg">3.12.11.1.10.</ins></span> Images</a></li>
<li><a href="#pixel"><span class="secno"><del class=
"diff-old">3.14.11.1.10.</del> <ins class=
"diff-chg">3.12.11.1.11.</ins></span> Pixel manipulation</a></li>
<li><a href="#drawing"><span class="secno"><del class=
"diff-old">3.14.11.1.11.</del> <ins class=
"diff-chg">3.12.11.1.12.</ins></span> Drawing model</a></li>
</ul>
</li>
<li><a href="#color"><span class="secno"><del class=
"diff-old">3.14.11.2.</del> <ins class=
"diff-chg">3.12.11.2.</ins></span> Color spaces and color
correction</a></li>
<li><a href="#security1"><span class="secno"><ins class=
"diff-new">3.12.11.3.</ins></span> <ins class="diff-new">Security
with</ins> <code><ins class="diff-new">canvas</ins></code>
<ins class="diff-new">elements</ins></a></li>
</ul>
</li>
<li><a href="#the-map"><span class="secno"><del class=
"diff-old">3.14.12.</del> <ins class=
"diff-chg">3.12.12</ins></span> The <code>map</code>
element</a></li>
<li><a href="#the-area"><span class="secno"><del class=
"diff-old">3.14.13.</del> <ins class=
"diff-chg">3.12.13</ins></span> The <code>area</code>
element</a></li>
<li><a href="#image-maps"><span class="secno"><del class=
"diff-old">3.14.14.</del> <ins class=
"diff-chg">3.12.14</ins></span> Image maps</a></li>
<li><a href="#mathml"><span class="secno"><ins class=
"diff-new">3.12.15</ins></span> <ins class=
"diff-new">MathML</ins></a></li>
<li><a href="#svg"><span class="secno"><ins class=
"diff-new">3.12.16</ins></span> <ins class=
"diff-new">SVG</ins></a></li>
<li><a href="#dimension"><span class="secno"><del class=
"diff-old">3.14.15.</del> <ins class=
"diff-chg">3.12.17</ins></span> Dimension attributes</a></li>
</ul>
</li>
<li><a href="#tabular"><span class="secno"><del class=
"diff-old">3.15.</del> <ins class="diff-chg">3.13</ins></span>
Tabular data</a>
<ul class="toc">
<li><a href="#table-intro"><span class="secno"><ins class=
"diff-new">3.13.1</ins></span> <ins class=
"diff-new">Introduction</ins></a></li>
<li><a href="#the-table"><span class="secno"><del class=
"diff-old">3.15.1.</del> <ins class="diff-chg">3.13.2</ins></span>
The <code>table</code> element</a></li>
<li><a href="#the-caption"><span class="secno"><del class=
"diff-old">3.15.2.</del> <ins class="diff-chg">3.13.3</ins></span>
The <code>caption</code> element</a></li>
<li><a href="#the-colgroup"><span class="secno"><del class=
"diff-old">3.15.3.</del> <ins class="diff-chg">3.13.4</ins></span>
The <code>colgroup</code> element</a></li>
<li><a href="#the-col"><span class="secno"><del class=
"diff-old">3.15.4.</del> <ins class="diff-chg">3.13.5</ins></span>
The <code>col</code> element</a></li>
<li><a href="#the-tbody"><span class="secno"><del class=
"diff-old">3.15.5.</del> <ins class="diff-chg">3.13.6</ins></span>
The <code>tbody</code> element</a></li>
<li><a href="#the-thead"><span class="secno"><del class=
"diff-old">3.15.6.</del> <ins class="diff-chg">3.13.7</ins></span>
The <code>thead</code> element</a></li>
<li><a href="#the-tfoot"><span class="secno"><del class=
"diff-old">3.15.7.</del> <ins class="diff-chg">3.13.8</ins></span>
The <code>tfoot</code> element</a></li>
<li><a href="#the-tr"><span class="secno"><del class=
"diff-old">3.15.8.</del> <ins class="diff-chg">3.13.9</ins></span>
The <code>tr</code> element</a></li>
<li><a href="#the-td"><span class="secno"><del class=
"diff-old">3.15.9.</del> <ins class="diff-chg">3.13.10</ins></span>
The <code>td</code> element</a></li>
<li><a href="#the-th"><span class="secno"><del class=
"diff-old">3.15.10.</del> <ins class=
"diff-chg">3.13.11</ins></span> The <code>th</code>
element</a></li>
<li><a href="#attributes0"><span class="secno"><ins class=
"diff-new">3.13.12</ins></span> <ins class="diff-new">Attributes
common to</ins> <code><ins class="diff-new">td</ins></code>
<ins class="diff-new">and</ins> <code><ins class=
"diff-new">th</ins></code> <ins class=
"diff-new">elements</ins></a></li>
<li><a href="#processing"><span class="secno"><del class=
"diff-old">3.15.11.</del> <ins class=
"diff-chg">3.13.13</ins></span> Processing model</a>
<ul class="toc">
<li><a href="#forming"><span class="secno"><del class=
"diff-old">3.15.11.1.</del> <ins class=
"diff-chg">3.13.13.1.</ins></span> Forming a table</a></li>
<li><a href="#header-and-data-cell-semantics"><span class=
"secno"><del class="diff-old">3.15.11.2.</del> <ins class=
"diff-chg">3.13.13.2.</ins></span> Forming relationships between
data cells and header cells</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#forms"><span class="secno"><del class=
"diff-old">3.16.</del> <ins class="diff-chg">3.14</ins></span>
Forms</a>
<ul class="toc">
<li><a href="#the-form"><span class="secno"><del class=
"diff-old">3.16.1.</del> <ins class="diff-chg">3.14.1</ins></span>
The <code>form</code> element</a></li>
<li><a href="#the-fieldset"><span class="secno"><del class=
"diff-old">3.16.2.</del> <ins class="diff-chg">3.14.2</ins></span>
The <code>fieldset</code> element</a></li>
<li><a href="#the-input"><span class="secno"><del class=
"diff-old">3.16.3.</del> <ins class="diff-chg">3.14.3</ins></span>
The <code>input</code> element</a></li>
<li><a href="#the-button"><span class="secno"><del class=
"diff-old">3.16.4.</del> <ins class="diff-chg">3.14.4</ins></span>
The <code>button</code> element</a></li>
<li><a href="#the-label"><span class="secno"><del class=
"diff-old">3.16.5.</del> <ins class="diff-chg">3.14.5</ins></span>
The <code>label</code> element</a></li>
<li><a href="#the-select"><span class="secno"><del class=
"diff-old">3.16.6.</del> <ins class="diff-chg">3.14.6</ins></span>
The <code>select</code> element</a></li>
<li><a href="#the-datalist"><span class="secno"><del class=
"diff-old">3.16.7.</del> <ins class="diff-chg">3.14.7</ins></span>
The <code>datalist</code> element</a></li>
<li><a href="#the-optgroup"><span class="secno"><del class=
"diff-old">3.16.8.</del> <ins class="diff-chg">3.14.8</ins></span>
The <code>optgroup</code> element</a></li>
<li><a href="#the-option"><span class="secno"><del class=
"diff-old">3.16.9.</del> <ins class="diff-chg">3.14.9</ins></span>
The <code>option</code> element</a></li>
<li><a href="#the-textarea"><span class="secno"><del class=
"diff-old">3.16.10.</del> <ins class=
"diff-chg">3.14.10</ins></span> The <code>textarea</code>
element</a></li>
<li><a href="#the-output"><span class="secno"><del class=
"diff-old">3.16.11.</del> <ins class=
"diff-chg">3.14.11</ins></span> The <code>output</code>
element</a></li>
<li><a href="#processing0"><span class="secno"><del class=
"diff-old">3.16.12.</del> <ins class=
"diff-chg">3.14.12</ins></span> Processing model</a>
<ul class="toc">
<li><a href="#form-submission"><span class="secno"><del class=
"diff-old">3.16.12.1.</del> <ins class=
"diff-chg">3.14.12.1.</ins></span> Form submission</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#scripting0"><span class="secno"><del class=
"diff-old">3.17.</del> <ins class="diff-chg">3.15</ins></span>
Scripting</a>
<ul class="toc">
<li><a href="#script"><span class="secno"><del class=
"diff-old">3.17.1.</del> <ins class="diff-chg">3.15.1</ins></span>
The <code>script</code> element</a>
<ul class="toc">
<li><a href="#scriptingLanguages"><span class="secno"><del class=
"diff-old">3.17.1.1.</del> <ins class=
"diff-chg">3.15.1.1.</ins></span> Scripting languages</a></li>
</ul>
</li>
<li><a href="#the-noscript"><span class="secno"><del class=
"diff-old">3.17.2.</del> <ins class="diff-chg">3.15.2</ins></span>
The <code>noscript</code> element</a></li>
<li><a href="#the-event-source"><span class="secno"><del class=
"diff-old">3.17.3.</del> <ins class="diff-chg">3.15.3</ins></span>
The <code>event-source</code> element</a></li>
</ul>
</li>
<li><a href="#interactive-elements"><span class="secno"><del class=
"diff-old">3.18.</del> <ins class="diff-chg">3.16</ins></span>
Interactive elements</a>
<ul class="toc">
<li><a href="#the-details"><span class="secno"><del class=
"diff-old">3.18.1.</del> <ins class="diff-chg">3.16.1</ins></span>
The <code>details</code> element</a></li>
<li><a href="#datagrid"><span class="secno"><del class=
"diff-old">3.18.2.</del> <ins class="diff-chg">3.16.2</ins></span>
The <code>datagrid</code> element</a>
<ul class="toc">
<li><a href="#the-datagrid"><span class="secno"><del class=
"diff-old">3.18.2.1.</del> <ins class=
"diff-chg">3.16.2.1.</ins></span> The <code>datagrid</code> data
model</a></li>
<li><a href="#how-rows"><span class="secno"><del class=
"diff-old">3.18.2.2.</del> <ins class=
"diff-chg">3.16.2.2.</ins></span> How rows are identified</a></li>
<li><a href="#the-data"><span class="secno"><del class=
"diff-old">3.18.2.3.</del> <ins class=
"diff-chg">3.16.2.3.</ins></span> The data provider
interface</a></li>
<li><a href="#the-default"><span class="secno"><del class=
"diff-old">3.18.2.4.</del> <ins class=
"diff-chg">3.16.2.4.</ins></span> The default data provider</a>
<ul class="toc">
<li><a href="#commonDefaultDataGridMethodDefinitions"><span class=
"secno"><del class="diff-old">3.18.2.4.1.</del> <ins class=
"diff-chg">3.16.2.4.1.</ins></span> Common default data provider
method definitions for cells</a></li>
</ul>
</li>
<li><a href="#populating"><span class="secno"><del class=
"diff-old">3.18.2.5.</del> <ins class=
"diff-chg">3.16.2.5.</ins></span> Populating the
<code>datagrid</code> element</a></li>
<li><a href="#updating"><span class="secno"><del class=
"diff-old">3.18.2.6.</del> <ins class=
"diff-chg">3.16.2.6.</ins></span> Updating the
<code>datagrid</code></a></li>
<li><a href="#requirements"><span class="secno"><del class=
"diff-old">3.18.2.7.</del> <ins class=
"diff-chg">3.16.2.7.</ins></span> Requirements for interactive user
agents</a></li>
<li><a href="#the-selection"><span class="secno"><del class=
"diff-old">3.18.2.8.</del> <ins class=
"diff-chg">3.16.2.8.</ins></span> The selection</a></li>
<li><a href="#columns"><span class="secno"><del class=
"diff-old">3.18.2.9.</del> <ins class=
"diff-chg">3.16.2.9.</ins></span> Columns and captions</a></li>
</ul>
</li>
<li><a href="#the-command"><span class="secno"><del class=
"diff-old">3.18.3.</del> <ins class="diff-chg">3.16.3</ins></span>
The <code>command</code> element</a></li>
<li><a href="#menus"><span class="secno"><del class=
"diff-old">3.18.4.</del> <ins class="diff-chg">3.16.4</ins></span>
The <code>menu</code> element</a>
<ul class="toc">
<li><a href="#menus-intro"><span class="secno"><del class=
"diff-old">3.18.4.1.</del> <ins class=
"diff-chg">3.16.4.1.</ins></span> Introduction</a></li>
<li><a href="#building"><span class="secno"><del class=
"diff-old">3.18.4.2.</del> <ins class=
"diff-chg">3.16.4.2.</ins></span> Building menus and tool
bars</a></li>
<li><a href="#context"><span class="secno"><del class=
"diff-old">3.18.4.3.</del> <ins class=
"diff-chg">3.16.4.3.</ins></span> Context menus</a></li>
<li><a href="#toolbars"><span class="secno"><del class=
"diff-old">3.18.4.4.</del> <ins class=
"diff-chg">3.16.4.4.</ins></span> Toolbars</a></li>
</ul>
</li>
<li><a href="#commands"><span class="secno"><del class=
"diff-old">3.18.5.</del> <ins class="diff-chg">3.16.5</ins></span>
Commands</a>
<ul class="toc">
<li><a href="#using"><span class="secno"><del class=
"diff-old">3.18.5.1.</del> <ins class=
"diff-chg">3.16.5.1.</ins></span> Using the <code>a</code> element
to define a command</a></li>
<li><a href="#using0"><span class="secno"><del class=
"diff-old">3.18.5.2.</del> <ins class=
"diff-chg">3.16.5.2.</ins></span> Using the <code>button</code>
element to define a command</a></li>
<li><a href="#using1"><span class="secno"><del class=
"diff-old">3.18.5.3.</del> <ins class=
"diff-chg">3.16.5.3.</ins></span> Using the <code>input</code>
element to define a command</a></li>
<li><a href="#using2"><span class="secno"><del class=
"diff-old">3.18.5.4.</del> <ins class=
"diff-chg">3.16.5.4.</ins></span> Using the <code>option</code>
element to define a command</a></li>
<li><a href="#using3"><span class="secno"><del class=
"diff-old">3.18.5.5.</del> <ins class=
"diff-chg">3.16.5.5.</ins></span> Using the <code>command</code>
element to define a command</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#datatemplate"><span class="secno"><del class=
"diff-old">3.19.</del> <ins class="diff-chg">3.17</ins></span> Data
Templates</a>
<ul class="toc">
<li><a href="#introduction0"><span class="secno"><del class=
"diff-old">3.19.1.</del> <ins class="diff-chg">3.17.1</ins></span>
Introduction</a></li>
<li><a href="#the-datatemplate"><span class="secno"><del class=
"diff-old">3.19.2.</del> <ins class="diff-chg">3.17.2</ins></span>
The <code>datatemplate</code> element</a></li>
<li><a href="#the-rule"><span class="secno"><del class=
"diff-old">3.19.3.</del> <ins class="diff-chg">3.17.3</ins></span>
The <code>rule</code> element</a></li>
<li><a href="#the-nest"><span class="secno"><del class=
"diff-old">3.19.4.</del> <ins class="diff-chg">3.17.4</ins></span>
The <code>nest</code> element</a></li>
<li><a href="#global0"><span class="secno"><del class=
"diff-old">3.19.5.</del> <ins class="diff-chg">3.17.5</ins></span>
Global attributes for data templates</a></li>
<li><a href="#processing1"><span class="secno"><del class=
"diff-old">3.19.6.</del> <ins class="diff-chg">3.17.6</ins></span>
Processing model</a>
<ul class="toc">
<li><a href="#the-originalcontent"><span class="secno"><del class=
"diff-old">3.19.6.1.</del> <ins class=
"diff-chg">3.17.6.1.</ins></span> The <code title=
"dom-originalContent">originalContent</code> DOM attribute</a></li>
<li><a href="#the-template"><span class="secno"><del class=
"diff-old">3.19.6.2.</del> <ins class=
"diff-chg">3.17.6.2.</ins></span> The <code title=
"attr-template">template</code> attribute</a></li>
<li><a href="#the-ref"><span class="secno"><del class=
"diff-old">3.19.6.3.</del> <ins class=
"diff-chg">3.17.6.3.</ins></span> The <code title=
"attr-ref">ref</code> attribute</a></li>
<li><a href="#the-nodedatatemplate"><span class="secno"><del class=
"diff-old">3.19.6.4.</del> <ins class=
"diff-chg">3.17.6.4.</ins></span> The <code>NodeDataTemplate</code>
interface</a></li>
<li><a href="#mutations"><span class="secno"><del class=
"diff-old">3.19.6.5.</del> <ins class=
"diff-chg">3.17.6.5.</ins></span> Mutations</a></li>
<li><a href="#updating0"><span class="secno"><del class=
"diff-old">3.19.6.6.</del> <ins class=
"diff-chg">3.17.6.6.</ins></span> Updating the generated
content</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#miscellaneous"><span class="secno"><del class=
"diff-old">3.20.</del> <ins class="diff-chg">3.18</ins></span>
Miscellaneous elements</a>
<ul class="toc">
<li><a href="#the-legend"><span class="secno"><del class=
"diff-old">3.20.1.</del> <ins class="diff-chg">3.18.1</ins></span>
The <code>legend</code> element</a></li>
<li><a href="#the-div"><span class="secno"><del class=
"diff-old">3.20.2.</del> <ins class="diff-chg">3.18.2</ins></span>
The <code>div</code> element</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#web-browsers"><span class="secno">4.</span> Web
browsers</a>
<ul class="toc">
<li><a href="#windows"><span class="secno"><del class=
"diff-old">4.1.</del> <ins class="diff-chg">4.1</ins></span>
Browsing contexts</a>
<ul class="toc">
<li><a href="#nested"><span class="secno"><del class=
"diff-old">4.1.1.</del> <ins class="diff-chg">4.1.1</ins></span>
Nested browsing contexts</a></li>
<li><a href="#auxiliary"><span class="secno"><del class=
"diff-old">4.1.2.</del> <ins class="diff-chg">4.1.2</ins></span>
Auxiliary browsing contexts</a></li>
<li><a href="#secondary"><span class="secno"><del class=
"diff-old">4.1.3.</del> <ins class="diff-chg">4.1.3</ins></span>
Secondary browsing contexts</a></li>
<li><a href="#security2"><span class="secno"><ins class=
"diff-new">4.1.4</ins></span> <ins class=
"diff-new">Security</ins></a></li>
<li><a href="#threads"><span class="secno"><del class=
"diff-old">4.1.4.</del> <ins class="diff-chg">4.1.5</ins></span>
Threads</a></li>
<li><a href="#browsing"><span class="secno"><del class=
"diff-old">4.1.5.</del> <ins class="diff-chg">4.1.6</ins></span>
Browsing context names</a></li>
</ul>
</li>
<li><a href="#the-default0"><span class="secno"><del class=
"diff-old">4.2.</del> <ins class="diff-chg">4.2</ins></span> The
default view</a>
<ul class="toc">
<li><a href="#security3"><span class="secno"><del class=
"diff-old">4.2.1.</del> <ins class="diff-chg">4.2.1</ins></span>
Security</a></li>
<li><a href="#constructors"><span class="secno"><del class=
"diff-old">4.2.2.</del> <ins class="diff-chg">4.2.2</ins></span>
Constructors</a></li>
<li><a href="#apis-for"><span class="secno"><del class=
"diff-old">4.2.3.</del> <ins class="diff-chg">4.2.3</ins></span>
APIs for creating and navigating browsing contexts by name</a></li>
<li><a href="#accessing"><span class="secno"><del class=
"diff-old">4.2.4.</del> <ins class="diff-chg">4.2.4</ins></span>
Accessing other browsing contexts</a></li>
</ul>
</li>
<li><a href="#origin"><span class="secno"><del class=
"diff-old">4.3.</del> <ins class="diff-chg">4.3</ins></span>
<del class="diff-old">Scripting</del> <ins class=
"diff-chg">Origin</ins></a>
<ul class="toc">
<li><a href="#relaxing"><span class="secno"><del class=
"diff-old">4.3.1.</del> <ins class="diff-chg">4.3.1</ins></span>
<del class="diff-old">Running executable code</del> <ins class=
"diff-chg">Relaxing the same-origin restriction</ins></a></li>
<li><a href="#the-string"><span class="secno"><del class=
"diff-old">4.3.2.</del> <ins class="diff-chg">4.3.2</ins></span>
<del class="diff-old">Origin</del> <ins class="diff-chg">The string
representing the script's domain in IDNA format</ins></a></li>
</ul>
</li>
<li><a href="#scripting"><span class="secno"><del class=
"diff-old">4.3.3.</del> <ins class="diff-chg">4.4</ins></span>
<del class="diff-old">Unscripted same-origin checks</del>
<ins class="diff-chg">Scripting</ins></a>
<ul class="toc">
<li><a href="#script0"><span class="secno"><del class=
"diff-old">4.3.4.</del> <ins class="diff-chg">4.4.1</ins></span>
<ins class="diff-chg">Script execution contexts</ins></a></li>
<li><a href="#security4"><span class="secno"><ins class=
"diff-chg">4.4.2</ins></span> Security exceptions</a></li>
<li><a href="#javascript-protocol"><span class="secno"><del class=
"diff-old">4.3.5.</del> <ins class="diff-chg">4.4.3</ins></span>
The <code title="">javascript:</code> protocol</a></li>
<li><a href="#events"><span class="secno"><del class=
"diff-old">4.3.6.</del> <ins class="diff-chg">4.4.4</ins></span>
Events</a>
<ul class="toc">
<li><a href="#event-handler-attributes"><span class=
"secno"><del class="diff-old">4.3.6.1.</del> <ins class=
"diff-chg">4.4.4.1.</ins></span> Event handler attributes</a></li>
<li><a href="#event"><span class="secno"><del class=
"diff-old">4.3.6.2.</del> <ins class=
"diff-chg">4.4.4.2.</ins></span> Event firing</a></li>
<li><a href="#events0"><span class="secno"><del class=
"diff-old">4.3.6.3.</del> <ins class=
"diff-chg">4.4.4.3.</ins></span> Events and the <code>Window</code>
object</a></li>
<li><a href="#runtime-script-errors"><span class=
"secno"><del class="diff-old">4.3.6.4.</del> <ins class=
"diff-chg">4.4.4.4.</ins></span> Runtime script errors</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#user-prompts"><span class="secno"><del class=
"diff-old">4.4.</del> <ins class="diff-chg">4.5</ins></span> User
prompts</a>
<ul class="toc">
<li><a href="#simple0"><span class="secno"><ins class=
"diff-new">4.5.1</ins></span> <ins class="diff-new">Simple
dialogs</ins></a></li>
<li><a href="#printing"><span class="secno"><ins class=
"diff-new">4.5.2</ins></span> <ins class=
"diff-new">Printing</ins></a></li>
<li><a href="#dialogs"><span class="secno"><ins class=
"diff-new">4.5.3</ins></span> <ins class="diff-new">Dialogs
implemented using separate documents</ins></a></li>
<li><a href="#notifications"><span class="secno"><ins class=
"diff-new">4.5.4</ins></span> <ins class=
"diff-new">Notifications</ins></a></li>
</ul>
</li>
<li><a href="#browser"><span class="secno"><del class=
"diff-old">4.5.</del> <ins class="diff-chg">4.6</ins></span>
Browser state</a>
<ul class="toc">
<li><a href="#custom-handlers"><span class="secno"><del class=
"diff-old">4.5.1.</del> <ins class="diff-chg">4.6.1</ins></span>
Custom protocol and content handlers</a>
<ul class="toc">
<li><a href="#security5"><span class="secno"><del class=
"diff-old">4.5.1.1.</del> <ins class=
"diff-chg">4.6.1.1.</ins></span> Security and privacy</a></li>
<li><a href="#sample-handler-impl"><span class="secno"><del class=
"diff-old">4.5.1.2.</del> <ins class=
"diff-chg">4.6.1.2.</ins></span> Sample user interface</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#offline"><span class="secno"><del class=
"diff-old">4.6.</del> <ins class="diff-chg">4.7</ins></span>
Offline Web applications</a>
<ul class="toc">
<li><a href="#introduction1"><span class="secno"><del class=
"diff-old">4.6.1.</del> <ins class="diff-chg">4.7.1</ins></span>
Introduction</a></li>
<li><a href="#appcache"><span class="secno"><del class=
"diff-old">4.6.2.</del> <ins class="diff-chg">4.7.2</ins></span>
Application caches</a></li>
<li><a href="#manifests"><span class="secno"><del class=
"diff-old">4.6.3.</del> <ins class="diff-chg">4.7.3</ins></span>
The cache manifest syntax</a>
<ul class="toc">
<li><a href="#writing"><span class="secno"><del class=
"diff-old">4.6.3.1.</del> <ins class=
"diff-chg">4.7.3.1.</ins></span> Writing cache manifests</a></li>
<li><a href="#parsing0"><span class="secno"><del class=
"diff-old">4.6.3.2.</del> <ins class=
"diff-chg">4.7.3.2.</ins></span> Parsing cache manifests</a></li>
</ul>
</li>
<li><a href="#updating1"><span class="secno"><del class=
"diff-old">4.6.4.</del> <ins class="diff-chg">4.7.4</ins></span>
Updating an application cache</a></li>
<li><a href="#processing2"><span class="secno"><del class=
"diff-old">4.6.5.</del> <ins class="diff-chg">4.7.5</ins></span>
Processing model</a>
<ul class="toc">
<li><a href="#changes"><span class="secno"><del class=
"diff-old">4.6.5.1.</del> <ins class=
"diff-chg">4.7.5.1.</ins></span> Changes to the networking
model</a></li>
</ul>
</li>
<li><a href="#application"><span class="secno"><del class=
"diff-old">4.6.6.</del> <ins class="diff-chg">4.7.6</ins></span>
Application cache API</a></li>
<li><a href="#browser0"><span class="secno"><del class=
"diff-old">4.6.7.</del> <ins class="diff-chg">4.7.7</ins></span>
Browser state</a></li>
</ul>
</li>
<li><a href="#history"><span class="secno"><del class=
"diff-old">4.7.</del> <ins class="diff-chg">4.8</ins></span>
Session history and navigation</a>
<ul class="toc">
<li><a href="#the-session"><span class="secno"><del class=
"diff-old">4.7.1.</del> <ins class="diff-chg">4.8.1</ins></span>
The session history of browsing contexts</a></li>
<li><a href="#the-history"><span class="secno"><del class=
"diff-old">4.7.2.</del> <ins class="diff-chg">4.8.2</ins></span>
The <code>History</code> interface</a></li>
<li><a href="#activating"><span class="secno"><del class=
"diff-old">4.7.3.</del> <ins class="diff-chg">4.8.3</ins></span>
Activating state <del class="diff-old">objects</del> <ins class=
"diff-chg">object entries</ins></a></li>
<li><a href="#the-location"><span class="secno"><del class=
"diff-old">4.7.4.</del> <ins class="diff-chg">4.8.4</ins></span>
The <code>Location</code> interface</a>
<ul class="toc">
<li><a href="#security6"><span class="secno"><del class=
"diff-old">4.7.4.1.</del> <ins class=
"diff-chg">4.8.4.1.</ins></span> Security</a></li>
</ul>
</li>
<li><a href="#history-notes"><span class="secno"><del class=
"diff-old">4.7.5.</del> <ins class="diff-chg">4.8.5</ins></span>
Implementation notes for session history</a></li>
</ul>
</li>
<li><a href="#browsing0"><span class="secno"><ins class=
"diff-new">4.9</ins></span> <ins class="diff-new">Browsing the
Web</ins></a>
<ul class="toc">
<li><a href="#navigating"><span class="secno"><del class=
"diff-old">4.8.</del> <ins class="diff-chg">4.9.1</ins></span>
Navigating across documents</a></li>
<li><a href="#read-html"><span class="secno"><del class=
"diff-old">4.8.1.</del> <ins class="diff-chg">4.9.2</ins></span>
Page load processing model for HTML files</a></li>
<li><a href="#read-xml"><span class="secno"><del class=
"diff-old">4.8.2.</del> <ins class="diff-chg">4.9.3</ins></span>
Page load processing model for XML files</a></li>
<li><a href="#read-text"><span class="secno"><del class=
"diff-old">4.8.3.</del> <ins class="diff-chg">4.9.4</ins></span>
Page load processing model for text files</a></li>
<li><a href="#read-image"><span class="secno"><del class=
"diff-old">4.8.4.</del> <ins class="diff-chg">4.9.5</ins></span>
Page load processing model for images</a></li>
<li><a href="#read-plugin"><span class="secno"><del class=
"diff-old">4.8.5.</del> <ins class="diff-chg">4.9.6</ins></span>
Page load processing model for content that uses plugins</a></li>
<li><a href="#read-ua-inline"><span class="secno"><del class=
"diff-old">4.8.6.</del> <ins class="diff-chg">4.9.7</ins></span>
Page load processing model for inline content that doesn't have a
DOM</a></li>
<li><a href="#scroll-to-fragid"><span class="secno"><del class=
"diff-old">4.8.7.</del> <ins class="diff-chg">4.9.8</ins></span>
Navigating to a fragment identifier</a></li>
<li><a href="#history0"><span class="secno"><ins class=
"diff-new">4.9.9</ins></span> <ins class="diff-new">History
traversal</ins></a></li>
</ul>
</li>
<li><a href="#content-type-sniffing"><span class=
"secno"><del class="diff-old">4.9.</del> <ins class=
"diff-chg">4.10</ins></span> Determining the type of a new resource
in a browsing context</a>
<ul class="toc">
<li><a href="#content-type0"><span class="secno"><del class=
"diff-old">4.9.1.</del> <ins class="diff-chg">4.10.1</ins></span>
Content-Type sniffing: text or binary</a></li>
<li><a href="#content-type1"><span class="secno"><del class=
"diff-old">4.9.2.</del> <ins class="diff-chg">4.10.2</ins></span>
Content-Type sniffing: unknown type</a></li>
<li><a href="#content-type2"><span class="secno"><del class=
"diff-old">4.9.3.</del> <ins class="diff-chg">4.10.3</ins></span>
Content-Type sniffing: image</a></li>
<li><a href="#content-type3"><span class="secno"><del class=
"diff-old">4.9.4.</del> <ins class="diff-chg">4.10.4</ins></span>
Content-Type sniffing: feed or HTML</a></li>
<li><a href="#content-type"><span class="secno"><del class=
"diff-old">4.9.5.</del> <ins class="diff-chg">4.10.5</ins></span>
Content-Type metadata</a></li>
</ul>
</li>
<li><a href="#structured"><span class="secno"><del class=
"diff-old">4.10.</del> <ins class="diff-chg">4.11</ins></span>
<del class="diff-old">Client-side session and persistent</del>
<ins class="diff-chg">Structured client-side</ins> storage
<del class="diff-old">of</del></a>
<ul class="toc">
<li><a href="#storage"><span class="secno"><ins class=
"diff-chg">4.11.1</ins></span> <ins class="diff-chg">Storing</ins>
name/value pairs</a>
<ul class="toc">
<li><a href="#introduction2"><span class="secno"><del class=
"diff-old">4.10.1.</del> <ins class=
"diff-chg">4.11.1.1.</ins></span> Introduction</a></li>
<li><a href="#the-storage"><span class="secno"><del class=
"diff-old">4.10.2.</del> <ins class=
"diff-chg">4.11.1.2.</ins></span> The <code>Storage</code>
interface</a></li>
<li><a href="#the-sessionstorage"><span class="secno"><del class=
"diff-old">4.10.3.</del> <ins class=
"diff-chg">4.11.1.3.</ins></span> The <code title=
"dom-sessionStorage">sessionStorage</code> attribute</a></li>
<li><a href="#the-localstorage"><span class="secno"><del class=
"diff-old">4.10.4.</del> <ins class=
"diff-chg">4.11.1.4.</ins></span> The <del class=
"diff-old">globalStorage</del> <code title=
"dom-localStorage"><ins class="diff-chg">localStorage</ins></code>
attribute</a></li>
<li><a href="#the-storage0"><span class="secno"><del class=
"diff-old">4.10.5.</del> <ins class=
"diff-chg">4.11.1.5.</ins></span> The <code title=
"event-storage">storage</code> event</a> <del class=
"diff-old">4.10.6. Miscellaneous implementation requirements for
storage areas</del>
<ul class="toc">
<li><a href="#event0"><span class="secno"><del class=
"diff-old">4.10.6.1.</del> <ins class=
"diff-chg">4.11.1.5.1.</ins></span> <del class="diff-old">Disk
space</del> <ins class="diff-chg">Event definition</ins></a></li>
</ul>
</li>
<li><a href="#threads0"><span class="secno"><del class=
"diff-old">4.10.6.2.</del> <ins class=
"diff-chg">4.11.1.6.</ins></span> Threads</a></li>
</ul>
</li>
<li><a href="#sql"><span class="secno"><del class=
"diff-old">4.10.7.</del> <ins class="diff-chg">4.11.2</ins></span>
<del class="diff-old">Security and privacy</del> <ins class=
"diff-chg">Database storage</ins></a>
<ul class="toc">
<li><a href="#introduction3"><span class="secno"><del class=
"diff-old">4.10.7.1.</del> <ins class=
"diff-chg">4.11.2.1.</ins></span> <del class="diff-old">User
tracking</del> <ins class="diff-chg">Introduction</ins></a></li>
<li><a href="#databases"><span class="secno"><del class=
"diff-old">4.10.7.2.</del> <ins class=
"diff-chg">4.11.2.2.</ins></span> <del class="diff-old">Cookie
resurrection</del> <ins class="diff-chg">Databases</ins></a></li>
<li><a href="#executing"><span class="secno"><del class=
"diff-old">4.10.7.3.</del> <ins class=
"diff-chg">4.11.2.3.</ins></span> <del class="diff-old">DNS
spoofing attacks</del> <ins class="diff-chg">Executing SQL
statements</ins></a></li>
<li><a href="#database"><span class="secno"><del class=
"diff-old">4.10.7.4.</del> <ins class=
"diff-chg">4.11.2.4.</ins></span> <del class=
"diff-old">Cross-directory attacks</del> <ins class=
"diff-chg">Database query results</ins></a></li>
<li><a href="#errors"><span class="secno"><del class=
"diff-old">4.10.7.5.</del> <ins class=
"diff-chg">4.11.2.5.</ins></span> <del class=
"diff-old">Implementation risks</del> <ins class=
"diff-chg">Errors</ins></a></li>
<li><a href="#processing3"><span class="secno"><del class=
"diff-old">4.11.</del> <ins class="diff-chg">4.11.2.6.</ins></span>
<del class="diff-old">Client-side database storage</del>
<ins class="diff-chg">Processing model</ins></a></li>
</ul>
</li>
<li><a href="#disk-space"><span class="secno"><del class=
"diff-old">4.11.1.</del> <ins class="diff-chg">4.11.3</ins></span>
<del class="diff-old">Introduction</del> <ins class="diff-chg">Disk
space</ins></a></li>
<li><a href="#privacy"><span class="secno"><del class=
"diff-old">4.11.2.</del> <ins class="diff-chg">4.11.4</ins></span>
<del class="diff-old">Databases</del> <ins class=
"diff-chg">Privacy</ins></a>
<ul class="toc">
<li><a href="#user-tracking"><span class="secno"><del class=
"diff-old">4.11.3.</del> <ins class=
"diff-chg">4.11.4.1.</ins></span> <del class="diff-old">Executing
SQL statements</del> <ins class="diff-chg">User
tracking</ins></a></li>
<li><a href="#cookie"><span class="secno"><del class=
"diff-old">4.11.4.</del> <ins class=
"diff-chg">4.11.4.2.</ins></span> <del class="diff-old">Database
query results</del> <ins class="diff-chg">Cookie
resurrection</ins></a></li>
</ul>
</li>
<li><a href="#security7"><span class="secno"><del class=
"diff-old">4.11.5.</del> <ins class="diff-chg">4.11.5</ins></span>
<del class="diff-old">Errors</del> <ins class=
"diff-chg">Security</ins></a>
<ul class="toc">
<li><a href="#dns-spoofing"><span class="secno"><del class=
"diff-old">4.11.6.</del> <ins class=
"diff-chg">4.11.5.1.</ins></span> <del class="diff-old">Processing
model</del> <ins class="diff-chg">DNS spoofing
attacks</ins></a></li>
<li><a href="#cross-directory"><span class="secno"><del class=
"diff-old">4.11.7.</del> <ins class=
"diff-chg">4.11.5.2.</ins></span> <del class=
"diff-old">Privacy</del> <ins class="diff-chg">Cross-directory
attacks</ins></a></li>
<li><a href="#implementation"><span class="secno"><del class=
"diff-old">4.11.8.</del> <ins class=
"diff-chg">4.11.5.3.</ins></span> <del class=
"diff-old">Security</del> <ins class="diff-chg">Implementation
risks</ins></a></li>
<li><a href="#sql-and"><span class="secno"><del class=
"diff-old">4.11.8.1.</del> <ins class=
"diff-chg">4.11.5.4.</ins></span> <del class="diff-old">User</del>
<ins class="diff-chg">SQL and user</ins> agents</a></li>
<li><a href="#sql-injection"><span class="secno"><del class=
"diff-old">4.11.8.2.</del> <ins class=
"diff-chg">4.11.5.5.</ins></span> SQL injection</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#links"><span class="secno"><del class=
"diff-old">4.12.</del> <ins class="diff-chg">4.12</ins></span>
Links</a>
<ul class="toc">
<li><a href="#hyperlink"><span class="secno"><del class=
"diff-old">4.12.1.</del> <ins class="diff-chg">4.12.1</ins></span>
Hyperlink elements</a></li>
<li><a href="#following"><span class="secno"><del class=
"diff-old">4.12.2.</del> <ins class="diff-chg">4.12.2</ins></span>
Following hyperlinks</a>
<ul class="toc">
<li><a href="#hyperlink0"><span class="secno">4.12.2.1.</span>
Hyperlink auditing</a></li>
</ul>
</li>
<li><a href="#linkTypes"><span class="secno"><del class=
"diff-old">4.12.3.</del> <ins class="diff-chg">4.12.3</ins></span>
Link types</a>
<ul class="toc">
<li><a href="#link-type"><span class="secno">4.12.3.1.</span> Link
type " <code>alternate</code> "</a></li>
<li><a href="#link-type0"><span class="secno">4.12.3.2.</span> Link
type " <code>archives</code> "</a></li>
<li><a href="#link-type1"><span class="secno">4.12.3.3.</span> Link
type " <code>author</code> "</a></li>
<li><a href="#link-type2"><span class="secno">4.12.3.4.</span> Link
type " <code>bookmark</code> "</a></li>
<li><a href="#link-type3"><span class="secno">4.12.3.5.</span> Link
type " <code><del class="diff-old">contact</del> <ins class=
"diff-chg">external</ins></code> "</a></li>
<li><a href="#link-type4"><span class="secno">4.12.3.6.</span> Link
type " <code><del class="diff-old">external</del> <ins class=
"diff-chg">feed</ins></code> "</a></li>
<li><a href="#link-type5"><span class="secno">4.12.3.7.</span> Link
type " <code><del class="diff-old">feed " 4.12.3.8. Link type
"</del> help</code> "</a></li>
<li><a href="#rel-icon"><span class="secno"><del class=
"diff-old">4.12.3.9.</del> <ins class=
"diff-chg">4.12.3.8.</ins></span> Link type " <code>icon</code>
"</a></li>
<li><a href="#link-type6"><span class="secno"><del class=
"diff-old">4.12.3.10.</del> <ins class=
"diff-chg">4.12.3.9.</ins></span> Link type " <code>license</code>
"</a></li>
<li><a href="#link-type7"><span class="secno"><del class=
"diff-old">4.12.3.11.</del> <ins class=
"diff-chg">4.12.3.10.</ins></span> Link type "
<code>nofollow</code> "</a></li>
<li><a href="#link-type8"><span class="secno"><del class=
"diff-old">4.12.3.12.</del> <ins class=
"diff-chg">4.12.3.11.</ins></span> Link type "
<code>noreferrer</code> "</a></li>
<li><a href="#link-type9"><span class="secno"><del class=
"diff-old">4.12.3.13.</del> <ins class=
"diff-chg">4.12.3.12.</ins></span> Link type "
<code>pingback</code> "</a></li>
<li><a href="#link-type10"><span class="secno"><del class=
"diff-old">4.12.3.14.</del> <ins class=
"diff-chg">4.12.3.13.</ins></span> Link type "
<code>prefetch</code> "</a></li>
<li><a href="#link-type11"><span class="secno"><del class=
"diff-old">4.12.3.15.</del> <ins class=
"diff-chg">4.12.3.14.</ins></span> Link type " <code>search</code>
"</a></li>
<li><a href="#link-type12"><span class="secno"><del class=
"diff-old">4.12.3.16.</del> <ins class=
"diff-chg">4.12.3.15.</ins></span> Link type "
<code>stylesheet</code> "</a></li>
<li><a href="#link-type13"><span class="secno"><del class=
"diff-old">4.12.3.17.</del> <ins class=
"diff-chg">4.12.3.16.</ins></span> Link type " <code>sidebar</code>
"</a></li>
<li><a href="#link-type14"><span class="secno"><del class=
"diff-old">4.12.3.18.</del> <ins class=
"diff-chg">4.12.3.17.</ins></span> Link type " <code>tag</code>
"</a></li>
<li><a href="#hierarchical"><span class="secno"><del class=
"diff-old">4.12.3.19.</del> <ins class=
"diff-chg">4.12.3.18.</ins></span> Hierarchical link types</a>
<ul class="toc">
<li><a href="#link-type15"><span class="secno"><del class=
"diff-old">4.12.3.19.1.</del> <ins class=
"diff-chg">4.12.3.18.1.</ins></span> Link type " <code>index</code>
"</a></li>
<li><a href="#link-type16"><span class="secno"><del class=
"diff-old">4.12.3.19.2.</del> <ins class=
"diff-chg">4.12.3.18.2.</ins></span> Link type " <code>up</code>
"</a></li>
</ul>
</li>
<li><a href="#sequential0"><span class="secno"><del class=
"diff-old">4.12.3.20.</del> <ins class=
"diff-chg">4.12.3.19.</ins></span> Sequential link types</a>
<ul class="toc">
<li><a href="#link-type17"><span class="secno"><del class=
"diff-old">4.12.3.20.1.</del> <ins class=
"diff-chg">4.12.3.19.1.</ins></span> Link type " <code>first</code>
"</a></li>
<li><a href="#link-type18"><span class="secno"><del class=
"diff-old">4.12.3.20.2.</del> <ins class=
"diff-chg">4.12.3.19.2.</ins></span> Link type " <code>last</code>
"</a></li>
<li><a href="#link-type19"><span class="secno"><del class=
"diff-old">4.12.3.20.3.</del> <ins class=
"diff-chg">4.12.3.19.3.</ins></span> Link type " <code>next</code>
"</a></li>
<li><a href="#link-type20"><span class="secno"><del class=
"diff-old">4.12.3.20.4.</del> <ins class=
"diff-chg">4.12.3.19.4.</ins></span> Link type " <code>prev</code>
"</a></li>
</ul>
</li>
<li><a href="#other0"><span class="secno"><del class=
"diff-old">4.12.3.21.</del> <ins class=
"diff-chg">4.12.3.20.</ins></span> Other link types</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#interfaces"><span class="secno"><del class=
"diff-old">4.13.</del> <ins class="diff-chg">4.13</ins></span>
Interfaces for URI manipulation</a></li>
</ul>
</li>
<li><a href="#editing"><span class="secno">5.</span> Editing</a>
<ul class="toc">
<li><a href="#editing-intro"><span class="secno"><del class=
"diff-old">5.1.</del> <ins class="diff-chg">5.1</ins></span>
Introduction</a></li>
<li><a href="#contenteditable"><span class="secno"><del class=
"diff-old">5.2.</del> <ins class="diff-chg">5.2</ins></span> The
<code title="attr-contenteditable">contenteditable</code>
attribute</a>
<ul class="toc">
<li><a href="#user-editing"><span class="secno"><del class=
"diff-old">5.2.1.</del> <ins class="diff-chg">5.2.1</ins></span>
User editing actions</a></li>
<li><a href="#making"><span class="secno"><del class=
"diff-old">5.2.2.</del> <ins class="diff-chg">5.2.2</ins></span>
Making entire documents editable</a></li>
</ul>
</li>
<li><a href="#dnd"><span class="secno"><del class=
"diff-old">5.3.</del> <ins class="diff-chg">5.3</ins></span> Drag
and drop</a>
<ul class="toc">
<li><a href="#introduction4"><span class="secno"><ins class=
"diff-new">5.3.1</ins></span> <ins class=
"diff-new">Introduction</ins></a></li>
<li><a href="#the-dragevent"><span class="secno"><del class=
"diff-old">5.3.1.</del> <ins class="diff-chg">5.3.2</ins></span>
The <code>DragEvent</code> and <code>DataTransfer</code>
interfaces</a></li>
<li><a href="#events1"><span class="secno"><del class=
"diff-old">5.3.2.</del> <ins class="diff-chg">5.3.3</ins></span>
Events fired during a drag-and-drop action</a></li>
<li><a href="#drag-and-drop"><span class="secno"><del class=
"diff-old">5.3.3.</del> <ins class="diff-chg">5.3.4</ins></span>
Drag-and-drop processing model</a>
<ul class="toc">
<li><a href="#when-the"><span class="secno"><del class=
"diff-old">5.3.3.1.</del> <ins class=
"diff-chg">5.3.4.1.</ins></span> When the drag-and-drop operation
starts or ends in another document</a></li>
<li><a href="#when-the0"><span class="secno"><del class=
"diff-old">5.3.3.2.</del> <ins class=
"diff-chg">5.3.4.2.</ins></span> When the drag-and-drop operation
starts or ends in another application</a></li>
</ul>
</li>
<li><a href="#the-draggable"><span class="secno"><del class=
"diff-old">5.3.4.</del> <ins class="diff-chg">5.3.5</ins></span>
The <code>draggable</code> attribute</a></li>
<li><a href="#copy-and"><span class="secno"><del class=
"diff-old">5.3.5.</del> <ins class="diff-chg">5.3.6</ins></span>
Copy and paste</a>
<ul class="toc">
<li><a href="#copy-to"><span class="secno"><del class=
"diff-old">5.3.5.1.</del> <ins class=
"diff-chg">5.3.6.1.</ins></span> Copy to clipboard</a></li>
<li><a href="#cut-to"><span class="secno"><del class=
"diff-old">5.3.5.2.</del> <ins class=
"diff-chg">5.3.6.2.</ins></span> Cut to clipboard</a></li>
<li><a href="#paste"><span class="secno"><del class=
"diff-old">5.3.5.3.</del> <ins class=
"diff-chg">5.3.6.3.</ins></span> Paste from clipboard</a></li>
<li><a href="#paste0"><span class="secno"><del class=
"diff-old">5.3.5.4.</del> <ins class=
"diff-chg">5.3.6.4.</ins></span> Paste from selection</a></li>
</ul>
</li>
<li><a href="#security8"><span class="secno"><del class=
"diff-old">5.3.6.</del> <ins class="diff-chg">5.3.7</ins></span>
Security risks in the drag-and-drop model</a></li>
</ul>
</li>
<li><a href="#undo"><span class="secno"><del class=
"diff-old">5.4.</del> <ins class="diff-chg">5.4</ins></span> Undo
history</a>
<ul class="toc">
<li><a href="#the-undomanager"><span class="secno"><del class=
"diff-old">5.4.1.</del> <ins class="diff-chg">5.4.1</ins></span>
The <code>UndoManager</code> interface</a></li>
<li><a href="#undo-moving"><span class="secno"><del class=
"diff-old">5.4.2.</del> <ins class="diff-chg">5.4.2</ins></span>
Undo: moving back in the undo transaction history</a></li>
<li><a href="#redo-moving"><span class="secno"><del class=
"diff-old">5.4.3.</del> <ins class="diff-chg">5.4.3</ins></span>
Redo: moving forward in the undo transaction history</a></li>
<li><a href="#the-undomanagerevent"><span class="secno"><del class=
"diff-old">5.4.4.</del> <ins class="diff-chg">5.4.4</ins></span>
The <code>UndoManagerEvent</code> interface and the <code title=
"event-undo">undo</code> and <code title="event-redo">redo</code>
events</a></li>
<li><a href="#implementation0"><span class="secno"><del class=
"diff-old">5.4.5.</del> <ins class="diff-chg">5.4.5</ins></span>
Implementation notes</a></li>
</ul>
</li>
<li><del class="diff-old">5.5. Command APIs</del> <a href=
"#selection"><span class="secno"><del class="diff-old">5.6.</del>
<ins class="diff-chg">5.5</ins></span> The text selection APIs</a>
<ul class="toc">
<li><a href="#documentSelection"><span class="secno"><del class=
"diff-old">5.6.1.</del> <ins class="diff-chg">5.5.1</ins></span>
APIs for the browsing context selection</a></li>
<li><a href="#textFieldSelection"><span class="secno"><del class=
"diff-old">5.6.2.</del> <ins class="diff-chg">5.5.2</ins></span>
APIs for the text field selections</a></li>
</ul>
</li>
<li><a href="#command"><span class="secno"><ins class=
"diff-new">5.6</ins></span> <ins class="diff-new">Command
APIs</ins></a></li>
</ul>
</li>
<li><a href="#comms"><span class="secno">6.</span>
Communication</a>
<ul class="toc">
<li><a href="#event1"><span class="secno"><del class=
"diff-old">6.1.</del> <ins class="diff-chg">6.1</ins></span> Event
definitions</a></li>
<li><a href="#server-sent-events"><span class="secno"><del class=
"diff-old">6.2.</del> <ins class="diff-chg">6.2</ins></span>
Server-sent DOM events</a>
<ul class="toc">
<li><a href="#the-remoteeventtarget"><span class=
"secno"><del class="diff-old">6.2.1.</del> <ins class=
"diff-chg">6.2.1</ins></span> The <code>RemoteEventTarget</code>
interface</a></li>
<li><a href="#connecting"><span class="secno"><del class=
"diff-old">6.2.2.</del> <ins class="diff-chg">6.2.2</ins></span>
Connecting to an event stream</a></li>
<li><a href="#parsing1"><span class="secno"><del class=
"diff-old">6.2.3.</del> <ins class="diff-chg">6.2.3</ins></span>
Parsing an event stream</a></li>
<li><a href="#event-stream-interpretation"><span class=
"secno"><del class="diff-old">6.2.4.</del> <ins class=
"diff-chg">6.2.4</ins></span> Interpreting an event stream</a></li>
<li><a href="#notes"><span class="secno"><del class=
"diff-old">6.2.5.</del> <ins class="diff-chg">6.2.5</ins></span>
Notes</a></li>
</ul>
</li>
<li><a href="#network"><span class="secno"><del class=
"diff-old">6.3.</del> <ins class="diff-chg">6.3</ins></span>
Network connections</a>
<ul class="toc">
<li><a href="#network-intro"><span class="secno"><del class=
"diff-old">6.3.1.</del> <ins class="diff-chg">6.3.1</ins></span>
Introduction</a></li>
<li><a href="#the-connection"><span class="secno"><del class=
"diff-old">6.3.2.</del> <ins class="diff-chg">6.3.2</ins></span>
The <code>Connection</code> interface</a></li>
<li><a href="#connection"><span class="secno"><del class=
"diff-old">6.3.3.</del> <ins class="diff-chg">6.3.3</ins></span>
Connection Events</a></li>
<li><a href="#tcp-connections"><span class="secno"><del class=
"diff-old">6.3.4.</del> <ins class="diff-chg">6.3.4</ins></span>
TCP connections</a></li>
<li><a href="#broadcast"><span class="secno"><del class=
"diff-old">6.3.5.</del> <ins class="diff-chg">6.3.5</ins></span>
Broadcast connections</a>
<ul class="toc">
<li><a href="#broadcasting"><span class="secno">6.3.5.1.</span>
Broadcasting over TCP/IP</a></li>
<li><a href="#bluetooth-broadcast"><span class=
"secno">6.3.5.2.</span> Broadcasting over Bluetooth</a></li>
<li><a href="#irda-broadcast"><span class="secno">6.3.5.3.</span>
Broadcasting over IrDA</a></li>
</ul>
</li>
<li><a href="#peer-to-peer"><span class="secno"><del class=
"diff-old">6.3.6.</del> <ins class="diff-chg">6.3.6</ins></span>
Peer-to-peer connections</a>
<ul class="toc">
<li><a href="#peer-to-peer0"><span class="secno">6.3.6.1.</span>
Peer-to-peer connections over TCP/IP</a></li>
<li><a href="#bluetooth-peer"><span class="secno">6.3.6.2.</span>
Peer-to-peer connections over Bluetooth</a></li>
<li><a href="#irda-peer"><span class="secno">6.3.6.3.</span>
Peer-to-peer connections over IrDA</a></li>
</ul>
</li>
<li><a href="#the-common"><span class="secno"><del class=
"diff-old">6.3.7.</del> <ins class="diff-chg">6.3.7</ins></span>
The common protocol for TCP-based connections</a>
<ul class="toc">
<li><a href="#clients"><span class="secno">6.3.7.1.</span> Clients
connecting over TCP</a></li>
<li><a href="#servers"><span class="secno">6.3.7.2.</span> Servers
accepting connections over TCP</a></li>
<li><a href="#sending"><span class="secno">6.3.7.3.</span> Sending
and receiving data over TCP</a></li>
</ul>
</li>
<li><a href="#network-security"><span class="secno"><del class=
"diff-old">6.3.8.</del> <ins class="diff-chg">6.3.8</ins></span>
Security</a></li>
<li><a href="#network-other-specs"><span class="secno"><del class=
"diff-old">6.3.9.</del> <ins class="diff-chg">6.3.9</ins></span>
Relationship to other standards</a></li>
</ul>
</li>
<li><a href="#crossDocumentMessages"><span class=
"secno"><del class="diff-old">6.4.</del> <ins class=
"diff-chg">6.4</ins></span> Cross-document messaging</a>
<ul class="toc">
<li><a href="#processing4"><span class="secno"><del class=
"diff-old">6.4.1.</del> <ins class="diff-chg">6.4.1</ins></span>
Processing model</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#repetition"><span class="secno">7.</span> Repetition
templates</a></li>
<li><a href="#syntax"><span class="secno">8.</span> The HTML
syntax</a>
<ul class="toc">
<li><a href="#writing0"><span class="secno"><del class=
"diff-old">8.1.</del> <ins class="diff-chg">8.1</ins></span>
Writing HTML documents</a>
<ul class="toc">
<li><a href="#the-doctype"><span class="secno"><del class=
"diff-old">8.1.1.</del> <ins class="diff-chg">8.1.1</ins></span>
The DOCTYPE</a></li>
<li><a href="#elements0"><span class="secno"><del class=
"diff-old">8.1.2.</del> <ins class="diff-chg">8.1.2</ins></span>
Elements</a>
<ul class="toc">
<li><a href="#start"><span class="secno">8.1.2.1.</span> Start
tags</a></li>
<li><a href="#end-tags"><span class="secno">8.1.2.2.</span> End
tags</a></li>
<li><a href="#attributes1"><span class="secno">8.1.2.3.</span>
Attributes</a></li>
<li><a href="#optional"><span class="secno">8.1.2.4.</span>
Optional tags</a></li>
<li><a href="#element-restrictions"><span class=
"secno">8.1.2.5.</span> Restrictions on content models</a></li>
<li><a href="#cdata-rcdata-restrictions"><span class=
"secno">8.1.2.6.</span> Restrictions on the contents of CDATA and
RCDATA elements</a></li>
</ul>
</li>
<li><a href="#text0"><span class="secno"><del class=
"diff-old">8.1.3.</del> <ins class="diff-chg">8.1.3</ins></span>
Text</a>
<ul class="toc">
<li><a href="#newlines"><span class="secno">8.1.3.1.</span>
Newlines</a></li>
</ul>
</li>
<li><a href="#character"><span class="secno"><del class=
"diff-old">8.1.4.</del> <ins class="diff-chg">8.1.4</ins></span>
Character <del class="diff-old">entity</del> references</a></li>
<li><a href="#cdata"><span class="secno"><ins class=
"diff-new">8.1.5</ins></span> <ins class="diff-new">CDATA
blocks</ins></a></li>
<li><a href="#comments"><span class="secno"><del class=
"diff-old">8.1.5.</del> <ins class="diff-chg">8.1.6</ins></span>
Comments</a></li>
</ul>
</li>
<li><a href="#parsing"><span class="secno"><del class=
"diff-old">8.2.</del> <ins class="diff-chg">8.2</ins></span>
Parsing HTML documents</a>
<ul class="toc">
<li><a href="#overview"><span class="secno"><del class=
"diff-old">8.2.1.</del> <ins class="diff-chg">8.2.1</ins></span>
Overview of the parsing model</a></li>
<li><a href="#the-input0"><span class="secno"><del class=
"diff-old">8.2.2.</del> <ins class="diff-chg">8.2.2</ins></span>
The input stream</a>
<ul class="toc">
<li><a href="#determining"><span class="secno">8.2.2.1.</span>
Determining the character encoding</a></li>
<li><a href="#character0"><span class="secno">8.2.2.2.</span>
Character encoding requirements</a></li>
<li><a href="#preprocessing"><span class="secno">8.2.2.3.</span>
Preprocessing the input stream</a></li>
<li><a href="#changing"><span class="secno">8.2.2.4.</span>
Changing the encoding while parsing</a></li>
</ul>
</li>
<li><a href="#parse"><span class="secno"><del class=
"diff-old">8.2.3.</del> <ins class="diff-chg">8.2.3</ins></span>
<del class="diff-old">Tokenisation</del> <ins class=
"diff-chg">Parse state</ins></a>
<ul class="toc">
<li><a href="#the-insertion"><span class="secno">8.2.3.1.</span>
<del class="diff-old">Tokenising entities</del> <ins class=
"diff-chg">The insertion mode</ins></a></li>
<li><a href="#the-stack"><span class="secno"><del class=
"diff-old">8.2.4.</del> <ins class="diff-chg">8.2.3.2.</ins></span>
<del class="diff-old">Tree construction</del> <ins class=
"diff-chg">The stack of open elements</ins></a></li>
<li><a href="#the-list"><span class="secno"><del class=
"diff-old">8.2.4.1.</del> <ins class=
"diff-chg">8.2.3.3.</ins></span> The <del class="diff-old">initial
phase</del> <ins class="diff-chg">list of active formatting
elements</ins></a></li>
<li><a href="#the-element"><span class="secno"><del class=
"diff-old">8.2.4.2.</del> <ins class=
"diff-chg">8.2.3.4.</ins></span> The <del class=
"diff-old">root</del> element <del class="diff-old">phase</del>
<ins class="diff-chg">pointers</ins></a></li>
<li><a href="#the-scripting"><span class="secno"><del class=
"diff-old">8.2.4.3.</del> <ins class=
"diff-chg">8.2.3.5.</ins></span> The <del class="diff-old">main
phase</del> <ins class="diff-chg">scripting state</ins></a></li>
</ul>
</li>
<li><a href="#tokenisation"><span class="secno"><ins class=
"diff-chg">8.2.4</ins></span> <ins class=
"diff-chg">Tokenisation</ins></a>
<ul class="toc">
<li><a href="#tokenising"><span class="secno"><del class=
"diff-old">8.2.4.3.1.</del> <ins class=
"diff-chg">8.2.4.1.</ins></span> <del class="diff-old">The stack of
open elements</del> <ins class="diff-chg">Tokenising character
references</ins></a></li>
</ul>
</li>
<li><a href="#tree-construction"><span class="secno"><del class=
"diff-old">8.2.4.3.2.</del> <ins class=
"diff-chg">8.2.5</ins></span> <del class="diff-old">The list of
active formatting elements</del> <ins class="diff-chg">Tree
construction</ins></a>
<ul class="toc">
<li><a href="#creating"><span class="secno"><del class=
"diff-old">8.2.4.3.3.</del> <ins class=
"diff-chg">8.2.5.1.</ins></span> Creating and inserting <del class=
"diff-old">HTML</del> elements</a></li>
<li><a href="#closing"><span class="secno"><del class=
"diff-old">8.2.4.3.4.</del> <ins class=
"diff-chg">8.2.5.2.</ins></span> Closing elements that have implied
end tags</a></li>
<li><a href="#foster"><span class="secno"><del class=
"diff-old">8.2.4.3.5.</del> <ins class=
"diff-chg">8.2.5.3.</ins></span> <ins class="diff-chg">Foster
parenting</ins></a></li>
<li><a href="#the-initial"><span class="secno"><ins class=
"diff-chg">8.2.5.4.</ins></span> The <del class="diff-old">element
pointers</del> <ins class="diff-chg">"initial" insertion
mode</ins></a></li>
<li><a href="#the-before"><span class="secno"><del class=
"diff-old">8.2.4.3.6.</del> <ins class=
"diff-chg">8.2.5.5.</ins></span> The <ins class="diff-new">"before
html"</ins> insertion mode</a></li>
<li><a href="#the-before0"><span class="secno"><del class=
"diff-old">8.2.4.3.7.</del> <ins class=
"diff-chg">8.2.5.6.</ins></span> <del class="diff-old">How to
handle tokens in the main phase</del> <ins class="diff-chg">The
"before head" insertion mode</ins></a></li>
<li><a href="#parsing-main-inhead"><span class="secno"><del class=
"diff-old">8.2.4.4.</del> <ins class=
"diff-chg">8.2.5.7.</ins></span> The <del class="diff-old">trailing
end phase</del> <ins class="diff-chg">"in head" insertion
mode</ins></a></li>
<li><a href="#parsing-main-inheadnoscript"><span class=
"secno"><del class="diff-old">8.2.5.</del> <ins class=
"diff-chg">8.2.5.8.</ins></span> The <del class=
"diff-old">End</del> <ins class="diff-chg">"in head noscript"
insertion mode</ins></a></li>
<li><a href="#the-after"><span class="secno"><del class=
"diff-old">8.3.</del> <ins class="diff-chg">8.2.5.9.</ins></span>
<del class="diff-old">Namespaces</del> <ins class="diff-chg">The
"after head" insertion mode</ins></a></li>
<li><a href="#parsing-main-inbody"><span class="secno"><del class=
"diff-old">8.4.</del> <ins class="diff-chg">8.2.5.10.</ins></span>
<del class="diff-old">Serialising HTML fragments</del> <ins class=
"diff-chg">The "in body" insertion mode</ins></a></li>
<li><a href="#parsing-main-intable"><span class="secno"><del class=
"diff-old">8.5.</del> <ins class="diff-chg">8.2.5.11.</ins></span>
<del class="diff-old">Parsing HTML fragments</del> <ins class=
"diff-chg">The "in table" insertion mode</ins></a></li>
<li><a href="#parsing-main-incaption"><span class=
"secno"><del class="diff-old">8.6.</del> <ins class=
"diff-chg">8.2.5.12.</ins></span> <del class=
"diff-old">Entities</del> <ins class="diff-chg">The "in caption"
insertion mode</ins></a></li>
<li><a href="#parsing-main-incolgroup"><span class=
"secno"><del class="diff-old">9.</del> <ins class=
"diff-chg">8.2.5.13.</ins></span> <del class="diff-old">WYSIWYG
editors</del> <ins class="diff-chg">The "in column group" insertion
mode</ins></a></li>
<li><a href="#parsing-main-intbody"><span class="secno"><del class=
"diff-old">9.1.</del> <ins class="diff-chg">8.2.5.14.</ins></span>
<del class="diff-old">Presentational markup</del> <ins class=
"diff-chg">The "in table body" insertion mode</ins></a></li>
<li><a href="#parsing-main-intr"><span class="secno"><del class=
"diff-old">9.1.1.</del> <ins class=
"diff-chg">8.2.5.15.</ins></span> <del class="diff-old">WYSIWYG
signature</del> <ins class="diff-chg">The "in row" insertion
mode</ins></a></li>
<li><a href="#parsing-main-intd"><span class="secno"><del class=
"diff-old">9.1.2.</del> <ins class=
"diff-chg">8.2.5.16.</ins></span> The <del class="diff-old">font
element</del> <ins class="diff-chg">"in cell" insertion
mode</ins></a></li>
<li><a href="#parsing-main-inselect"><span class=
"secno"><ins class="diff-chg">8.2.5.17.</ins></span> <ins class=
"diff-chg">The "in select" insertion mode</ins></a></li>
<li><a href="#parsing-main-inselectintable"><span class=
"secno"><ins class="diff-chg">8.2.5.18.</ins></span> <ins class=
"diff-chg">The "in select in table" insertion mode</ins></a></li>
<li><a href="#parsing-main-inforeign"><span class=
"secno"><ins class="diff-chg">8.2.5.19.</ins></span> <ins class=
"diff-chg">The "in foreign content" insertion mode</ins></a></li>
<li><a href="#parsing-main-afterbody"><span class=
"secno"><ins class="diff-chg">8.2.5.20.</ins></span> <ins class=
"diff-chg">The "after body" insertion mode</ins></a></li>
<li><a href="#parsing-main-inframeset"><span class=
"secno"><ins class="diff-chg">8.2.5.21.</ins></span> <ins class=
"diff-chg">The "in frameset" insertion mode</ins></a></li>
<li><a href="#parsing-main-afterframeset"><span class=
"secno"><ins class="diff-chg">8.2.5.22.</ins></span> <ins class=
"diff-chg">The "after frameset" insertion mode</ins></a></li>
<li><a href="#the-after0"><span class="secno"><ins class=
"diff-chg">8.2.5.23.</ins></span> <ins class="diff-chg">The "after
after body" insertion mode</ins></a></li>
<li><a href="#the-after1"><span class="secno"><ins class=
"diff-chg">8.2.5.24.</ins></span> <ins class="diff-chg">The "after
after frameset" insertion mode</ins></a></li>
</ul>
</li>
<li><a href="#the-end"><span class="secno"><ins class=
"diff-chg">8.2.6</ins></span> <ins class="diff-chg">The
end</ins></a></li>
</ul>
</li>
<li><a href="#namespaces"><span class="secno"><ins class=
"diff-new">8.3</ins></span> <ins class=
"diff-new">Namespaces</ins></a></li>
<li><a href="#serializing"><span class="secno"><ins class=
"diff-new">8.4</ins></span> <ins class="diff-new">Serializing HTML
fragments</ins></a></li>
<li><a href="#parsing2"><span class="secno"><ins class=
"diff-new">8.5</ins></span> <ins class="diff-new">Parsing HTML
fragments</ins></a></li>
<li><a href="#named"><span class="secno"><ins class=
"diff-new">8.6</ins></span> <ins class="diff-new">Named character
references</ins></a></li>
</ul>
</li>
<li><a href="#rendering"><span class="secno"><del class=
"diff-old">10.</del> <ins class="diff-chg">9.</ins></span>
Rendering <ins class="diff-new">and user-agent behavior</ins></a>
<ul class="toc">
<li><a href="#rendering0"><span class="secno"><del class=
"diff-old">10.1.</del> <ins class="diff-chg">9.1</ins></span>
Rendering and the DOM</a></li>
<li><a href="#rendering1"><span class="secno"><del class=
"diff-old">10.2.</del> <ins class="diff-chg">9.2</ins></span>
Rendering and menus/toolbars</a>
<ul class="toc">
<li><a href="#the-icon"><span class="secno"><del class=
"diff-old">10.2.1.</del> <ins class="diff-chg">9.2.1</ins></span>
The 'icon' property</a></li>
</ul>
</li>
<li><a href="#obsolete"><span class="secno"><ins class=
"diff-new">9.3</ins></span> <ins class="diff-new">Obsolete
elements, attributes, and APIs</ins></a>
<ul class="toc">
<li><a href="#the-body0"><span class="secno"><ins class=
"diff-new">9.3.1</ins></span> <ins class="diff-new">The</ins>
<code><ins class="diff-new">body</ins></code> <ins class=
"diff-new">element</ins></a></li>
<li><a href="#the-applet"><span class="secno"><ins class=
"diff-new">9.3.2</ins></span> <ins class="diff-new">The</ins>
<code><ins class="diff-new">applet</ins></code> <ins class=
"diff-new">element</ins></a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#no"><span class="secno"><del class=
"diff-old">11.</del> <ins class="diff-chg">10.</ins></span> Things
that you can't do with this specification because they are better
handled using other technologies that are further described
herein</a>
<ul class="toc">
<li><a href="#localization"><span class="secno"><del class=
"diff-old">11.1.</del> <ins class="diff-chg">10.1</ins></span>
<del class="diff-old">Localisation</del> <ins class=
"diff-chg">Localization</ins></a></li>
<li><a href="#declarative"><span class="secno"><del class=
"diff-old">11.2.</del> <ins class="diff-chg">10.2</ins></span>
Declarative 2D vector graphics and animation</a></li>
<li><a href="#declarative0"><span class="secno"><del class=
"diff-old">11.3.</del> <ins class="diff-chg">10.3</ins></span>
Declarative 3D scenes</a></li>
<li><a href="#timers"><span class="secno"><del class=
"diff-old">11.4.</del> <ins class="diff-chg">10.4</ins></span>
Timers</a></li>
</ul>
</li>
<li class="no-num"><del class="diff-old">11.5. Events</del>
<a href="#index"><ins class="diff-chg">Index</ins></a></li>
<li class="no-num"><a href="#references">References</a></li>
<li class="no-num"><a href=
"#acknowledgements">Acknowledgements</a></li>
</ul>
<hr>
<h2 id="introduction"><span class="secno">1.</span>
Introduction</h2>
<p><em>This section is non-normative.</em></p>
<p>The World Wide Web's markup language has always been HTML. HTML
was primarily designed as a language for semantically describing
scientific documents, although its general design and adaptations
over the years has enabled it to be used to describe a number of
other types of documents.</p>
<p>The main area that has not been adequately addressed by HTML is
a vague subject referred to as Web Applications. This specification
attempts to rectify this, while at the same time updating the HTML
specifications to address issues raised in the past few years.</p>
<h3 id="scope"><span class="secno"><del class="diff-old">1.1.</del>
<ins class="diff-chg">1.1</ins></span> Scope</h3>
<p><em>This section is non-normative.</em></p>
<p>This specification is limited to providing a semantic-level
markup language and associated semantic-level scripting APIs for
authoring accessible pages on the Web ranging from static documents
to dynamic applications.</p>
<p>The scope of this specification does not include <del class=
"diff-old">addressing</del> <ins class="diff-chg">providing
mechanisms for media-specific customization of</ins> presentation
<del class="diff-old">concerns</del> (although default rendering
rules for Web browsers are included at the end of this <del class=
"diff-old">specification).</del> <ins class=
"diff-chg">specification, and several mechanisms for hooking into
CSS are provided as part of the language).</ins></p>
<p>The scope of this specification does not include documenting
every HTML or DOM feature supported by Web browsers. Browsers
support many features that are considered to be very bad for
accessibility or that are otherwise inappropriate. For example, the
<code>blink</code> element is clearly presentational and authors
wishing to cause text to blink should instead use CSS.</p>
<p>The scope of this specification is not to describe an entire
operating system. In particular, hardware configuration software,
image manipulation tools, and applications that users would be
expected to use with high-end workstations on a daily basis are out
of scope. In terms of applications, this specification is targeted
specifically at applications that would be expected to be used by
users on an occasional basis, or regularly but from disparate
locations, with low CPU requirements. For instance online
purchasing systems, searching systems, games (especially
multiplayer online games), public telephone books or address books,
communications software (e-mail clients, instant messaging clients,
discussion software), document editing software, etc.</p>
<p>For sophisticated cross-platform applications, there already
exist several proprietary solutions (such as Mozilla's XUL, Adobe's
Flash, or Microsoft's Silverlight). These solutions are evolving
faster than any standards process could follow, and the
requirements are evolving even faster. These systems are also
significantly more complicated to specify, and are orders of
magnitude more difficult to achieve interoperability with, than the
solutions described in this document. Platform-specific solutions
for such sophisticated applications (for example the MacOS X Core
APIs) are even further ahead.</p>
<h4 id="relationship"><span class="secno"><del class=
"diff-old">1.1.1.</del> <ins class="diff-chg">1.1.1</ins></span>
Relationship to HTML 4.01, XHTML 1.1, DOM2 HTML</h4>
<p><em>This section is non-normative.</em></p>
<p>This specification represents a new version of <del class=
"diff-old">HTML4 and XHTML1,</del> <ins class="diff-chg">the HTML
language,</ins> along with a new version of the associated DOM2
HTML API. Migration from HTML4 or XHTML1 to the format and APIs
described in this specification should in most cases be
straightforward, as care has been taken to ensure that
backwards-compatibility is retained.</p>
<p>This specification will eventually supplant Web Forms 2.0 as
well. <a href="#references">[WF2]</a></p>
<h4 id="relationship0"><span class="secno"><del class=
"diff-old">1.1.2.</del> <ins class="diff-chg">1.1.2</ins></span>
Relationship to XHTML2</h4>
<p><em>This section is non-normative.</em></p>
<p>XHTML2 <a href="#references">[XHTML2]</a> defines a new HTML
vocabulary with better features for hyperlinks, multimedia content,
annotating document edits, rich metadata, declarative interactive
forms, and describing the semantics of human literary works such as
poems and scientific papers.</p>
<p>However, it lacks elements to express the semantics of many of
the non-document types of content often seen on the Web. For
instance, forum sites, auction sites, search engines, online shops,
and the like, do not fit the document metaphor well, and are not
covered by XHTML2.</p>
<p><em>This</em> specification aims to extend HTML so that it is
also suitable in these contexts.</p>
<p>XHTML2 and this specification use different namespaces and
therefore can both be implemented in the same XML processor.</p>
<h4 id="relationship1"><span class="secno"><del class=
"diff-old">1.1.3.</del> <ins class="diff-chg">1.1.3</ins></span>
Relationship to XUL, Flash, Silverlight, and other proprietary UI
languages</h4>
<p><em>This section is non-normative.</em></p>
<p>This specification is independent of the various proprietary UI
languages that various vendors provide. As an open, <del class=
"diff-old">vender-neutral</del> <ins class=
"diff-chg">vendor-neutral</ins> language, HTML provides for a
solution to the same problems without the risk of vendor
lock-in.</p>
<h3 id="structure"><span class="secno"><del class=
"diff-old">1.2.</del> <ins class="diff-chg">1.2</ins></span>
Structure of this specification</h3>
<p><em>This section is non-normative.</em></p>
<p>This specification is divided into the following important
sections:</p>
<dl>
<dt><a href="#dom">The DOM</a></dt>
<dd>The DOM, or Document Object Model, provides a base for the rest
of the specification.</dd>
<dt><a href="#semantics">The Semantics</a></dt>
<dd>Documents are built from elements. These elements form a tree
using the DOM. Each element also has a predefined meaning, which is
explained in this section. User agent requirements for how to
handle each element are also given, along with rules for authors on
how to use the element.</dd>
<dt><a href="#windows">Browsing Contexts</a></dt>
<dd>HTML documents do not exist in a vacuum — this section defines
many of the features that affect environments that deal with
multiple pages, links between pages, and running scripts.</dd>
<dt>APIs</dt>
<dd><a href="#editing">The Editing APIs</a> : HTML documents can
provide a number of mechanisms for users to modify content, which
are described in this section.</dd>
<dd><a href="#comms">The Communication APIs</a> : Applications
written in HTML often require mechanisms to communicate with remote
servers, as well as communicating with other applications from
different domains running on the same client.</dd>
<dd><a href="#repetition">Repetition Templates</a> : A mechanism to
support repeating sections in forms.</dd>
<dt><a href="#syntax">The Language Syntax</a></dt>
<dd>All of these features would be for naught if they couldn't be
represented in a <del class="diff-old">serialised</del> <ins class=
"diff-chg">serialized</ins> form and sent to other people, and so
this section defines the syntax of HTML, along with rules for how
to parse HTML.</dd>
</dl>
<p>There are also a couple of appendices, defining <del class=
"diff-old">shims for WYSIWYG editors ,</del> <a href=
"#rendering">rendering rules</a> for Web <del class=
"diff-old">browsers,</del> <ins class="diff-chg">browsers</ins> and
listing <a href="#no">areas that are out of scope</a> for this
specification.</p>
<h4 id="how-to"><span class="secno"><del class=
"diff-old">1.2.1.</del> <ins class="diff-chg">1.2.1</ins></span>
How to read this specification</h4>
<p>This specification should be read like all other specifications.
First, it should be read cover-to-cover, multiple times. Then, it
should be read backwards at least once. Then it should be read by
picking random sections from the contents list and following all
the cross-references.</p>
<h3 id="conformance"><span class="secno"><del class=
"diff-old">1.3.</del> <ins class="diff-chg">1.3</ins></span>
Conformance requirements</h3>
<p>All diagrams, examples, and notes in this specification are
non-normative, as are all sections explicitly marked non-normative.
Everything else in this specification is normative.</p>
<p>The key words "MUST", "MUST NOT", "REQUIRED", <del class=
"diff-old">"SHALL", "SHALL NOT",</del> "SHOULD", "SHOULD NOT",
"RECOMMENDED", "MAY", and "OPTIONAL" in the normative parts of this
document are to be interpreted as described in RFC2119. For
readability, these words do not appear in all uppercase letters in
this specification. <a href="#references">[RFC2119]</a></p>
<p>Requirements phrased in the imperative as part of algorithms
(such as "strip any leading space characters" or "return false and
abort these steps") are to be interpreted with the meaning of the
key word ("must", "should", "may", etc) used in introducing the
algorithm.</p>
<p>This specification describes the conformance criteria for user
agents (relevant to implementors) and documents (relevant to
authors and authoring tool implementors).</p>
<p class="note">There is no implied relationship between document
conformance requirements and implementation conformance
requirements. User agents are not free to handle non-conformant
documents as they please; the processing model described in this
specification applies to implementations regardless of the
conformity of the input documents.</p>
<p>User agents fall into several (overlapping) categories with
different conformance requirements.</p>
<dl>
<dt id="interactive">Web browsers and other interactive user
agents</dt>
<dd>
<p>Web browsers that support <a href="#xhtml5">XHTML</a> must
process elements and attributes from the <a href=
"#html-namespace0">HTML namespace</a> found in <a href=
"#xml-documents">XML documents</a> as described in this
specification, so that users can interact with them, unless the
semantics of those elements have been overridden by other
specifications.</p>
<p class="example">A conforming XHTML processor would, upon finding
an XHTML <code><a href="#script1">script</a></code> element in an
XML document, execute the script contained in that element.
However, if the element is found within an XSLT transformation
sheet (assuming the UA also supports XSLT), then the processor
would instead treat the <code><a href="#script1">script</a></code>
element as an opaque element that forms part of the transform.</p>
<p>Web browsers that support <a href="#html5" title=
"HTML5">HTML</a> must process documents <del class=
"diff-old">labelled</del> <ins class="diff-chg">labeled</ins> as
<code>text/html</code> as described in this specification, so that
users can interact with them.</p>
</dd>
<dt id="non-interactive">Non-interactive presentation user
agents</dt>
<dd>
<p>User agents that process HTML and XHTML documents purely to
render non-interactive versions of them must comply to the same
conformance criteria as Web browsers, except that they are exempt
from requirements regarding user interaction.</p>
<p class="note">Typical examples of non-interactive presentation
user agents are printers (static UAs) and overhead displays
(dynamic UAs). It is expected that most static non-interactive
presentation user agents will also opt to <a href=
"#non-scripted">lack scripting support</a> .</p>
<p class="example">A non-interactive but dynamic presentation UA
would still execute scripts, allowing forms to be dynamically
submitted, and so forth. However, since the concept of "focus" is
irrelevant when the user cannot interact with the document, the UA
would not need to support any of the focus-related DOM APIs.</p>
</dd>
<dt><dfn id="non-scripted">User agents with no scripting
support</dfn></dt>
<dd>
<p>Implementations that do not support scripting (or which have
their scripting features disabled <del class="diff-old">)</del>
<ins class="diff-chg">entirely)</ins> are exempt from supporting
the events and DOM interfaces mentioned in this specification. For
the parts of this specification that are defined in terms of an
events model or in terms of the DOM, such user agents must still
act as if events and the DOM were supported.</p>
<p class="note">Scripting can form an integral part of an
application. Web browsers that do not support scripting, or that
have scripting disabled, might be unable to fully convey the
author's intent.</p>
</dd>
<dt>Conformance checkers</dt>
<dd id="conformance-checkers">
<p>Conformance checkers must verify that a document conforms to the
applicable conformance criteria described in this specification.
<del class="diff-old">Conformance</del> <ins class=
"diff-chg">Automated conformance</ins> checkers are exempt from
detecting errors that require interpretation of the author's intent
(for example, while a document is non-conforming if the content of
a <code><a href="#blockquote">blockquote</a></code> element is not
a quote, conformance checkers <ins class="diff-new">running without
the input of human judgement</ins> do not have to check that
<code><a href="#blockquote">blockquote</a></code> elements only
contain quoted material).</p>
<p>Conformance checkers must check that the input document conforms
when <ins class="diff-chg">parsed without a</ins> <a href=
"#browsing1"><ins class="diff-chg">browsing context</ins></a>
<ins class="diff-chg">(meaning that no scripts are run, and that
the parser's</ins> <a href="#scripting2">scripting <ins class=
"diff-new">flag</ins></a> is <del class="diff-old">disabled ,</del>
<ins class="diff-chg">disabled),</ins> and should also check that
the input document conforms when <del class="diff-old">scripting is
enabled .</del> <ins class="diff-chg">parsed with a</ins> <a href=
"#browsing1"><ins class="diff-chg">browsing context</ins></a>
<ins class="diff-chg">in which scripts execute, and that the
scripts never cause non-conforming states to occur other than
transiently during script execution itself.</ins> (This is only a
"SHOULD" and not a "MUST" requirement because it has been proven to
be impossible. <a href="#references">[HALTINGPROBLEM]</a> )</p>
<p>The term "HTML5 validator" can be used to refer to a conformance
checker that itself conforms to the applicable requirements of this
specification.</p>
<div class="note">
<p>XML DTDs cannot express all the conformance requirements of this
specification. Therefore, a validating XML processor and a DTD
cannot constitute a conformance checker. Also, since neither of the
two authoring formats defined in this specification are
applications of SGML, a validating SGML system cannot constitute a
conformance checker either.</p>
<p>To put it another way, there are three types of conformance
criteria:</p>
<ol>
<li>Criteria that can be expressed in a DTD.</li>
<li>Criteria that cannot be expressed by a DTD, but can still be
checked by a machine.</li>
<li>Criteria that can only be checked by a human.</li>
</ol>
<p>A conformance checker must check for the first two. A simple
DTD-based validator only checks for the first class of errors and
is therefore not a conforming conformance checker according to this
specification.</p>
</div>
</dd>
<dt>Data mining tools</dt>
<dd id="data-mining">
<p>Applications and tools that process HTML and XHTML documents for
reasons other than to either render the documents or check them for
conformance should act in accordance to the semantics of the
documents that they process.</p>
<p class="example">A tool that generates <a href="#outline" title=
"outline">document outlines</a> but increases the nesting level for
each paragraph and does not increase the nesting level for each
section would not be conforming.</p>
</dd>
<dt id="editors">Authoring tools and markup generators</dt>
<dd>
<p>Authoring tools and markup generators must generate conforming
documents. Conformance criteria that apply to authors also apply to
authoring tools, where appropriate.</p>
<p>Authoring tools are exempt from the strict requirements of using
elements only for their specified purpose, but only to the extent
that authoring tools are not yet able to determine author
intent.</p>
<p class="example">For example, it is not conforming to use an
<code><a href="#address">address</a></code> element for arbitrary
contact information; that element can only be used for marking up
contact information for the author of the document or section.
However, since an authoring <del class="diff-old">tools</del>
<ins class="diff-chg">tool</ins> is likely unable to determine the
difference, an authoring tool is exempt from that requirement.</p>
<p class="note">In terms of conformance checking, an editor is
therefore required to output documents that conform to the same
extent that a conformance checker will verify.</p>
<p>When an authoring tool is used to edit a non-conforming
document, it may preserve the conformance errors in sections of the
document that were not edited during the editing session (i.e. an
editing tool is allowed to round-trip <del class=
"diff-old">errorneous</del> <ins class="diff-chg">erroneous</ins>
content). However, an authoring tool must not claim that the output
is conformant if errors have been so preserved.</p>
<p>Authoring tools are expected to come in two broad varieties:
tools that work from structure or semantic data, and tools that
work on a What-You-See-Is-What-You-Get media-specific editing basis
(WYSIWYG).</p>
<p>The former is the preferred mechanism for tools that author
HTML, since the structure in the source information can be used to
make informed choices regarding which HTML elements and attributes
are most appropriate.</p>
<p>However, WYSIWYG tools are <del class=
"diff-old">legitimate,</del> <ins class="diff-chg">legitimate.
WYSIWYG tools should use elements they know are appropriate,</ins>
and <del class="diff-old">this specification makes</del>
<ins class="diff-chg">should not use elements that they do not know
to be appropriate. This might in</ins> certain <del class=
"diff-old">concessions</del> <ins class="diff-chg">extreme cases
mean limiting the use of flow elements</ins> to <del class=
"diff-old">WYSIWYG editors .</del> <ins class="diff-chg">just a few
elements, like</ins> <code><a href="#div"><ins class=
"diff-chg">div</ins></a></code> ,<code><a href="#b"><ins class=
"diff-chg">b</ins></a></code> ,<code><a href="#i"><ins class=
"diff-chg">i</ins></a></code> ,<ins class="diff-chg">and</ins>
<code><a href="#span"><ins class="diff-chg">span</ins></a></code>
<ins class="diff-chg">and making liberal use of the</ins>
<code title="attr-style"><a href="#style"><ins class=
"diff-chg">style</ins></a></code> <ins class=
"diff-chg">attribute.</ins></p>
<p>All authoring tools, whether WYSIWYG or not, should make a best
effort attempt at enabling users to create well-structured,
semantically rich, media-independent content.</p>
</dd>
</dl>
<p>Some conformance requirements are phrased as requirements on
elements, attributes, methods or objects. Such requirements fall
into two <del class="diff-old">categories;</del> <ins class=
"diff-chg">categories:</ins> those describing content model
restrictions, and those describing implementation <del class=
"diff-old">behaviour.</del> <ins class="diff-chg">behavior.</ins>
The former category of requirements are requirements on documents
and authoring tools. The second category are requirements on user
agents.</p>
<p>Conformance requirements phrased as algorithms or specific steps
may be implemented in any manner, so long as the end result is
equivalent. (In particular, the algorithms defined in this
specification are intended to be easy to follow, and not intended
to be performant.)</p>
<p id="hardwareLimitations">User agents may impose
implementation-specific limits on otherwise unconstrained inputs,
e.g. to prevent denial of service attacks, to guard against running
out of memory, or to work around platform-specific limitations.</p>
<p>For compatibility with existing content and prior
specifications, this specification describes two authoring formats:
one based on XML (referred to as <dfn id="xhtml5" title=
"XHTML">XHTML5</dfn> ), and one using a <a href="#parsing">custom
format</a> inspired by SGML (referred to as <dfn id=
"html5">HTML5</dfn> ). Implementations may support only one of
these two formats, although supporting both is encouraged.</p>
<p id="authors-using-xhtml"><a href="#xhtml5">XHTML</a> documents (
<a href="#xml-documents">XML documents</a> using elements from the
<a href="#html-namespace0">HTML namespace</a> ) that use the new
features described in this specification and that are served over
the wire (e.g. by HTTP) must be sent using an XML MIME type such as
<code>application/xml</code> or <code>application/xhtml+xml</code>
and must not be served as <code>text/html</code> . <a href=
"#references">[RFC3023]</a></p>
<p>Such XML documents may contain a <code>DOCTYPE</code> if
desired, but this is not required to conform to this
specification.</p>
<p class="note">According to the XML specification, XML processors
are not guaranteed to process the external DTD subset referenced in
the DOCTYPE. This means, for example, that using <del class=
"diff-old">entities</del> <ins class="diff-chg">entity
references</ins> for characters in XHTML documents is unsafe
(except for <del class="diff-old">&lt;, &gt;,
&amp;,</del> <code title=""><ins class=
"diff-chg">&lt;</ins></code> ,<code title=""><ins class=
"diff-chg">&gt;</ins></code> ,<code title=""><ins class=
"diff-chg">&amp;</ins></code> ,<code title="">&quot;</code>
and <del class="diff-old">&apos;). For interoperability,
authors are advised to avoid optional features of XML.</del>
<code title=""><ins class="diff-chg">&apos;</ins></code>
<ins class="diff-chg">).</ins></p>
<p id="authors-using-html"><a href="#html5" title="HTML5">HTML
documents</a> , if they are served over the wire (e.g. by HTTP)
must be <del class="diff-old">labelled</del> <ins class=
"diff-chg">labeled</ins> with the <code>text/html</code> MIME
type.</p>
<p id="entity-references">The language in this specification
assumes that the user agent expands all entity references, and
therefore does not include entity reference nodes in the DOM. If
user agents do include entity reference nodes in the DOM, then user
agents must handle them as if they were fully expanded when
implementing this specification. For example, if a requirement
talks about an element's child text nodes, then any text nodes that
are children of an entity reference that is a child of that element
would be used as well. <ins class="diff-chg">Entity references to
unknown entities must be treated as if they contained just an empty
text node for the purposes of the algorithms defined in this
specification.</ins></p>
<h4 id="common"><span class="secno"><del class=
"diff-old">1.3.1.</del> <ins class="diff-chg">1.3.1</ins></span>
Common conformance requirements for APIs exposed to JavaScript</h4>
<p class="big-issue">A lot of arrays/lists/ <a href="#collections0"
title="collections">collection</a> s in this spec assume zero-based
indexes but use the term " <var title="">index</var> th" liberally.
We should define those to be zero-based and be clearer about
this.</p>
<p>Unless <del class="diff-old">other</del> <ins class=
"diff-chg">otherwise</ins> specified, if a DOM attribute that is a
floating point number type ( <code title="">float</code> ) is
assigned an Infinity or Not-a-Number value, a <code title=
"big-issue">NOT_SUPPORTED_ERR</code> exception must be raised.</p>
<p>Unless <del class="diff-old">other specified, if a DOM attribute
that is a signed numeric type is assigned a negative value, a
NOT_SUPPORTED_ERR exception must be raised. Unless other</del>
<ins class="diff-chg">otherwise</ins> specified, if a method with
an argument that is a floating point number type ( <code title=
"">float</code> ) is passed an Infinity or Not-a-Number value, a
<code title="big-issue">NOT_SUPPORTED_ERR</code> exception must be
raised.</p>
<p>Unless <del class="diff-old">other</del> <ins class=
"diff-chg">otherwise</ins> specified, if a method is passed fewer
arguments than is defined for that method in its IDL definition, a
<code title="big-issue">NOT_SUPPORTED_ERR</code> exception must be
raised.</p>
<p>Unless <del class="diff-old">other</del> <ins class=
"diff-chg">otherwise</ins> specified, if a method is passed more
arguments than is defined for that method in its IDL definition,
the excess arguments must be ignored. <del class="diff-old">Unless
other specified, if a method is expecting, as one of its arguments,
as defined by its IDL definition, an object implementing a
particular interface X , and the argument passed is an object whose
[[Class]] property is neither that interface X , nor the name of an
interface Y where this specification requires that all objects
implementing interface Y also implement interface X , nor the name
of an interface that inherits from the expected interface X , then
a TYPE_MISMATCH_ERR exception must be raised. Anything else?
Passing the wrong type of object, maybe? Implied conversions to
int/float?</del></p>
<h4 id="dependencies"><span class="secno"><del class=
"diff-old">1.3.2.</del> <ins class="diff-chg">1.3.2</ins></span>
Dependencies</h4>
<p>This specification relies on several other underlying
specifications.</p>
<dl>
<dt>XML</dt>
<dd>
<p>Implementations that support XHTML5 must support some version of
XML, as well as its corresponding namespaces specification, because
XHTML5 uses an XML <del class="diff-old">serialisation</del>
<ins class="diff-chg">serialization</ins> with namespaces. <a href=
"#references">[XML]</a> <a href="#references">[XMLNAMES]</a></p>
</dd>
<dt>XML Base</dt>
<dd>
<p id="xmlBase">User agents must follow the rules given by XML Base
to resolve relative URIs in HTML and XHTML fragments. That is the
mechanism used in this specification for resolving relative URIs in
DOM trees. <a href="#references">[XMLBASE]</a></p>
<p class="note">It is possible for <code title=
"attr-xml-base"><a href="#xmlbase">xml:base</a></code> attributes
to be present even in HTML fragments, as such attributes can be
added dynamically using script. <ins class="diff-new">(Such scripts
would not be conforming, however, as</ins> <code title=
"attr-xml-base"><a href="#xmlbase"><ins class=
"diff-new">xml:base</ins></a></code> <ins class=
"diff-new">attributes as not allowed in</ins> <a href=
"#html-"><ins class="diff-new">HTML documents</ins></a> .)</p>
</dd>
<dt>DOM</dt>
<dd>
<p>Implementations must support some version of DOM Core and DOM
Events, because this specification is defined in terms of the DOM,
and some of the features are defined as extensions to the DOM Core
interfaces. <a href="#references">[DOM3CORE]</a> <a href=
"#references">[DOM3EVENTS]</a></p>
</dd>
<dt>ECMAScript</dt>
<dd>
<p>Implementations that use ECMAScript to implement the APIs
defined in this specification must implement them in a manner
consistent with the ECMAScript Bindings <del class="diff-old">for
DOM Specifications</del> <ins class="diff-chg">defined in the Web
IDL</ins> specification, as this specification uses that
specification's terminology. <a href="#references"><del class=
"diff-old">[EBFD]</del> <ins class=
"diff-chg">[WebIDL]</ins></a></p>
</dd>
<dt id="mq"><ins class="diff-chg">Media Queries</ins></dt>
<dd>
<p><ins class="diff-chg">Implementations must support some version
of the Media Queries language. However, when applying the rules of
the Media Queries specification to media queries found in content
attributes of</ins> <a href="#html-elements"><ins class=
"diff-chg">HTML elements</ins></a> ,<ins class="diff-chg">user
agents must act as if all U+000B LINE TABULATION characters in the
attribute were in fact U+0020 SPACE characters. This is required to
provide a consistent processing of</ins> <a href="#space" title=
"space character"><ins class="diff-chg">space characters</ins></a>
<ins class="diff-chg">in HTML.</ins> <a href=
"#references"><ins class="diff-chg">[MQ]</ins></a></p>
</dd>
</dl>
<p>This specification does not require support of any particular
network transport protocols, style sheet language, scripting
language, or any of the DOM and WebAPI specifications beyond those
described above. However, the language described by this
specification is biased towards CSS as the styling language,
ECMAScript as the scripting language, and HTTP as the network
protocol, and several features assume that those languages and
protocols are in use.</p>
<p class="note">This specification might have certain additional
requirements on character encodings, image formats, audio formats,
and video formats in the respective sections.</p>
<h4 id="features"><span class="secno"><del class=
"diff-old">1.3.3.</del> <ins class="diff-chg">1.3.3</ins></span>
Features defined in other specifications</h4>
<p>Some elements are defined in terms of their DOM <dfn id=
"textcontent"><code>textContent</code></dfn> attribute. This is an
attribute defined on the <code>Node</code> interface in DOM3 Core.
<a href="#references">[DOM3CORE]</a></p>
<p class="big-issue">Should textContent be defined differently for
dir="" and <bdo> ? Should we come up with an alternative to
textContent that handles those and other things, like alt=""?</p>
<p>The interface <dfn id=
"domtimestamp"><code>DOMTimeStamp</code></dfn> is defined in DOM3
Core. <a href="#references">[DOM3CORE]</a></p>
<p>The term <dfn id="activation0">activation behavior</dfn> is used
as defined in the DOM3 Events specification. <a href=
"#references">[DOM3EVENTS]</a> <span class="big-issue">At the time
of writing, DOM3 Events hadn't yet been updated to define that
phrase.</span></p>
<p id="alternate-style-sheets">The rules for handling alternative
style sheets are defined in the CSS object model specification.
<a href="#references">[CSSOM]</a></p>
<p class="big-issue">See <del class=
"diff-old">http://dev.w3.org/cvsweb/~checkout~/csswg/cssom/Overview.html?rev=1.35&content-type=text/html;%20charset=utf-8</del>
<a href=
"http://dev.w3.org/cvsweb/~checkout~/csswg/cssom/Overview.html?content-type=text/html;%20charset=utf-8">
<ins class=
"diff-chg">http://dev.w3.org/cvsweb/~checkout~/csswg/cssom/Overview.html?content-type=text/html;%20charset=utf-8</ins></a></p>
<p>Certain features are defined in terms of CSS <color>
values. When the CSS value <code title="">currentColor</code> is
specified in this context, the "computed value of the 'color'
property" for the purposes of determining the computed value of the
<code title="">currentColor</code> keyword is the computed value of
the 'color' property on the element in question. <a href=
"#references">[CSS3COLOR]</a></p>
<p class="example">If a canvas gradient's <code title=
"dom-canvasgradient-addColorStop"><a href=
"#addcolorstop">addColorStop()</a></code> method is called with the
<code title="">currentColor</code> keyword as the color, then the
computed value of the 'color' property on the <code><a href=
"#canvas">canvas</a></code> element is the one that is used.</p>
<h3 id="terminology"><span class="secno"><del class=
"diff-old">1.4.</del> <ins class="diff-chg">1.4</ins></span>
Terminology</h3>
<p>This specification refers to both HTML and XML attributes and
DOM attributes, often in the same context. When it is not clear
which is being referred to, they are referred to as <dfn id=
"content">content attributes</dfn> for HTML and XML attributes, and
<dfn id="dom-attributes">DOM attributes</dfn> for those from the
DOM. Similarly, the term "properties" is used for both ECMAScript
object properties and CSS properties. When these are ambiguous they
are qualified as object properties and CSS properties
respectively.</p>
<p id="html-namespace">To ease migration from HTML to XHTML, UAs
conforming to this specification will place elements in HTML in the
<code>http://www.w3.org/1999/xhtml</code> namespace, at least for
the purposes of the DOM and CSS. The term " <dfn id=
"elements1">elements in the HTML namespace</dfn> ", or " <dfn id=
"html-elements">HTML elements</dfn> " for short, when used in this
specification, thus refers to both HTML and XHTML elements.</p>
<p>Unless otherwise stated, all elements defined or mentioned in
this specification are in the
<code>http://www.w3.org/1999/xhtml</code> namespace, and all
attributes defined or mentioned in this specification have no
namespace (they are in the per-element partition).</p>
<p>The term <a href="#html-">HTML documents</a> is sometimes used
in contrast with <a href="#xml-documents">XML documents</a> to
<del class="diff-old">mean</del> specifically <ins class=
"diff-new">mean</ins> documents that were parsed using an <a href=
"#html-0">HTML parser</a> (as opposed to using an XML parser or
created purely through the DOM).</p>
<p>Generally, when the specification states that a feature applies
to HTML or XHTML, it also includes the other. When a feature
specifically only applies to one of the two languages, it is called
out by explicitly stating that it does not apply to the other
format, as in "for HTML, ... (this does not apply to XHTML)".</p>
<p>This specification uses the term <em>document</em> to refer to
any use of HTML, ranging from short static documents to long essays
or reports with rich multimedia, as well as to fully-fledged
interactive applications.</p>
<p>For readability, the term URI is used to refer to both ASCII
URIs and Unicode IRIs, as those terms are defined by RFC 3986 and
RFC 3987 respectively. On the rare occasions where IRIs are not
allowed but ASCII URIs are, this is called out explicitly. <a href=
"#references">[RFC3986]</a> <a href="#references">[RFC3987]</a></p>
<p>The term <dfn id="root-element">root element</dfn> , when not
<del class="diff-old">qualified to</del> explicitly <del class=
"diff-old">refer</del> <ins class="diff-chg">qualified as
referring</ins> to the document's root element, means the furthest
ancestor element node of whatever node is being discussed, or the
node itself <del class="diff-old">is there is none.</del>
<ins class="diff-chg">if it has no ancestors.</ins> When the node
is a part of the document, then that is indeed the document's root
<del class="diff-old">element. However,</del> <ins class=
"diff-chg">element; however,</ins> if the node is not currently
part of the document tree, the root element will be an orphaned
node.</p>
<p>An element is said to have been <dfn id="inserted" title=
"insert an element into a document">inserted into a document</dfn>
when its <a href="#root-element">root element</a> changes and is
now the document's <a href="#root-element">root element</a> .</p>
<p>The term <dfn id="tree-order">tree order</dfn> means a
pre-order, depth-first traversal of DOM nodes involved (through the
<code title="">parentNode</code> / <code title="">childNodes</code>
relationship).</p>
<p>When it is stated that some element or attribute is <dfn id=
"ignored" title="ignore">ignored</dfn> , or treated as some other
value, or handled as if it was something else, this refers only to
the processing of the node after it is in the DOM. A user agent
must not mutate the DOM in such situations.</p>
<p>When an XML name, such as an attribute or element name, is
referred to in the form <code><var title="">prefix</var> :
<var title="">localName</var></code> , as in <code>xml:id</code> or
<code>svg:rect</code> , it refers to a name with the local name
<var title="">localName</var> and the namespace given by the
prefix, as defined by the following table:</p>
<dl>
<dt><code title="">xml</code></dt>
<dd><code>http://www.w3.org/XML/1998/namespace</code></dd>
<dt><code title="">html</code></dt>
<dd><code>http://www.w3.org/1999/xhtml</code></dd>
<dt><code title="">svg</code></dt>
<dd><code>http://www.w3.org/2000/svg</code></dd>
</dl>
<p>For simplicity, terms such as <em>shown</em> ,
<em>displayed</em> , and <em>visible</em> might sometimes be used
when referring to the way a document is rendered to the user. These
terms are not meant to imply a visual medium; they must be
considered to apply to other media in equivalent ways.</p>
<p><del class="diff-old">Various</del> DOM interfaces <del class=
"diff-old">are</del> defined in this specification <del class=
"diff-old">using pseudo-IDL. This looks like OMG IDL but isn't. For
instance, method overloading is used, and types from the W3C DOM
specifications are used without qualification. Language-specific
bindings for these abstract interface definitions</del> <ins class=
"diff-chg">use Web IDL. User agents</ins> must <del class=
"diff-old">be derived in the way consistent with W3C DOM
specifications. Some interface-specific binding information for
ECMAScript is included in this specification. The current situation
with IDL blocks is pitiful. IDL is totally inadequate to properly
represent what objects have to look like in JS; IDL can't say if a
member is enumerable, what the indexing behaviour is, what the
stringification behaviour is, what behaviour setting a member whose
type is a particular interface should be (e.g. setting of
document.location or element.className), what constructor an object
implementing an interface should claim to have, how overloads work,
etc. I think we should make</del> <ins class="diff-chg">implement
these interfaces as defined by</ins> the <ins class=
"diff-new">Web</ins> IDL <del class="diff-old">blocks
non-normative, and/or replace them with something else that is
better for JS while still being clear on how it applies to other
languages. However, we do need to have something that says what
types the methods take as arguments, since we have to raise
exceptions if they are wrong.</del> <ins class=
"diff-chg">specification.</ins> <a href="#references"><ins class=
"diff-chg">[WEBIDL]</ins></a></p>
<p>The construction "a <code>Foo</code> object", where
<code>Foo</code> is actually an interface, is sometimes used
instead of the more accurate "an object implementing the interface
<code>Foo</code> ".</p>
<p>A DOM attribute is said to be <em>getting</em> when its value is
being retrieved (e.g. by author script), and is said to be
<em>setting</em> when a new value is assigned to it.</p>
<p>If a DOM object is said to be <dfn id="live">live</dfn> , then
that means that any attributes returning that object must always
return the same object (not a new object each time), and the
attributes and methods on that object must operate on the actual
underlying data, not a snapshot of the data.</p>
<p>The terms <em>fire</em> and <em>dispatch</em> are used
interchangeably in the context of events, as in the DOM Events
specifications. <a href="#references">[DOM3EVENTS]</a></p>
<p>The term <dfn id="text-node">text node</dfn> refers to any
<code>Text</code> node, including <code>CDATASection</code>
<del class="diff-old">nodes (any</del> <ins class="diff-chg">nodes;
specifically, any</ins> <code>Node</code> with node type
<del class="diff-old">3</del> <code title=""><ins class=
"diff-chg">TEXT_NODE</ins></code> <ins class="diff-chg">(3)</ins>
or <del class="diff-old">4).</del> <code title=""><ins class=
"diff-chg">CDATA_SECTION_NODE</ins></code> <ins class=
"diff-chg">(4).</ins> <a href="#references"><ins class=
"diff-chg">[DOM3CORE]</ins></a></p>
<p><ins class="diff-chg">The term</ins> <dfn id=
"plugin"><ins class="diff-chg">plugin</ins></dfn> <ins class=
"diff-chg">is used to mean any content handler, typically a
third-party content handler, for Web content types that are not
supported by the user agent natively, or for content types that do
not expose a DOM, that supports rendering the content as part of
the user agent's interface.</ins></p>
<p class="example"><ins class="diff-chg">One example of a plugin
would be a PDF viewer that is instantiated in a</ins> <a href=
"#browsing1"><ins class="diff-chg">browsing context</ins></a>
<ins class="diff-chg">when the user navigates to a PDF file. This
would count as a plugin regardless of whether the party that
implemented the PDF viewer component was the same as that which
implemented the user agent itself. However, a PDF viewer
application that launches separate from the user agent (as opposed
to using the same interface) is not a plugin by this
definition.</ins></p>
<p class="note"><ins class="diff-chg">This specification does not
define a mechanism for interacting with plugins, as it is expected
to be user-agent- and platform-specific. Some UAs might opt to
support a plugin mechanism such as the Netscape Plugin API; others
might use remote content converters or have built-in support for
certain types.</ins> <a href="#references"><ins class=
"diff-chg">[NPAPI]</ins></a></p>
<p class="warning"><ins class="diff-chg">Browsers should take
extreme care when interacting with external content intended
for</ins> <a href="#plugin" title="plugin"><ins class=
"diff-chg">plugins</ins></a> .<ins class="diff-chg">When
third-party software is run with the same privileges as the user
agent itself, vulnerabilities in the third-party software become as
dangerous as those in the user agent.</ins></p>
<p>Some of the algorithms in this specification, for historical
reasons, require the user agent to <dfn id="pause">pause</dfn>
until some condition has been met. While a user agent is paused, it
must ensure that no scripts execute (e.g. no event handlers, no
timers, etc). User agents should remain responsive to user input
while paused, <del class="diff-old">however.</del> <ins class=
"diff-chg">however, albeit without letting the user interact with
Web pages where that would involve invoking any script.</ins></p>
<h4 id="html-vs"><span class="secno"><del class=
"diff-old">1.4.1.</del> <ins class="diff-chg">1.4.1</ins></span>
HTML vs XHTML</h4>
<p><em>This section is non-normative.</em></p>
<p>This specification defines an abstract language for describing
documents and applications, and some APIs for interacting with
in-memory representations of resources that use this language.</p>
<p>The in-memory representation is known as "DOM5 HTML", or "the
DOM" for short.</p>
<p>There are various concrete syntaxes that can be used to transmit
resources that use this abstract language, two of which are defined
in this specification.</p>
<p>The first such concrete syntax is "HTML5". This is the format
recommended for most authors. It is compatible with all legacy Web
browsers. If a document is transmitted with the MIME type
<code title="">text/html</code> , then it will be processed as an
"HTML5" document by Web browsers.</p>
<p>The second concrete syntax uses XML, and is known as "XHTML5".
When a document is transmitted with an XML MIME type, such as
<code title="">application/xhtml+xml</code> , then it is processed
by an XML processor by Web browsers, and treated as an "XHTML5"
document. Authors are reminded that the processing for XML and HTML
differs; in particular, even minor syntax errors will prevent an
XML document from being rendered fully, whereas they would be
ignored in the "HTML5" syntax.</p>
<p>The "DOM5 HTML", "HTML5", and "XHTML5" representations cannot
all represent the same content. For example, namespaces cannot be
represented using "HTML5", but they are supported in "DOM5 HTML"
and "XHTML5". Similarly, documents that use the <code><a href=
"#noscript">noscript</a></code> feature can be represented using
"HTML5", but cannot be represented with "XHTML5" and "DOM5 HTML".
Comments that contain the string " <code title="">--></code> "
can be represented in "DOM5 HTML" but not in "HTML5" and "XHTML5".
And so forth.</p>
<h2 id="dom"><span class="secno">2.</span> The Document Object
Model</h2>
<p>The Document Object Model (DOM) is a representation — a model —
of a document and its content. <a href="#references">[DOM3CORE]</a>
The DOM is not just an API; the conformance criteria of HTML
implementations are defined, in this specification, in terms of
operations on the DOM.</p>
<p>This specification defines the language represented in the DOM
by features together called DOM5 HTML. DOM5 HTML consists of DOM
Core <code>Document</code> nodes and DOM Core <code>Element</code>
nodes, along with text nodes and other content.</p>
<p>Elements in the DOM represent things; that is, they have
intrinsic <em>meaning</em> , also known as semantics.</p>
<p class="example">For example, an <code><a href=
"#ol">ol</a></code> element represents an ordered list.</p>
<p>In addition, documents and elements in the DOM host APIs that
extend the DOM Core APIs, providing new features to application
developers using DOM5 HTML.</p>
<h3 id="documents"><span class="secno"><del class=
"diff-old">2.1.</del> <ins class="diff-chg">2.1</ins></span>
Documents</h3>
<p>Every XML and HTML document in an HTML UA is represented by a
<code>Document</code> object. <a href=
"#references">[DOM3CORE]</a></p>
<p><code>Document</code> objects are assumed to be <dfn id=
"xml-documents">XML documents</dfn> unless they are flagged as
being <dfn id="html-">HTML documents</dfn> when they are created.
Whether a document is an <a href="#html-" title=
"HTML documents">HTML document</a> or an <a href="#xml-documents"
title="XML documents">XML document</a> affects the <del class=
"diff-old">behaviour</del> <ins class="diff-chg">behavior</ins> of
certain APIs, as well as a few CSS rendering rules. <a href=
"#references">[CSS21]</a></p>
<p class="note">A <code>Document</code> object created by the
<code title="">createDocument()</code> API on the
<code>DOMImplementation</code> object is initially an <a href=
"#xml-documents" title="XML documents">XML document</a> , but can
be made into an <a href="#html-" title="HTML documents">HTML
document</a> by calling <code title="dom-document-open"><a href=
"#open">document.open()</a></code> on it.</p>
<p>All <code>Document</code> objects (in user agents implementing
this specification) must also implement the <code><a href=
"#htmldocument">HTMLDocument</a></code> interface, available using
binding-specific methods. (This is the case whether or not the
document in question is an <a href="#html-" title=
"HTML documents">HTML document</a> or indeed whether it contains
any <a href="#html-elements">HTML elements</a> at all.)
<code>Document</code> objects must also implement the
document-level interface of any other namespaces found in the
document that the UA supports. For example, if an HTML
implementation also supports SVG, then the <code>Document</code>
object must implement <code><a href=
"#htmldocument">HTMLDocument</a></code> and
<code>SVGDocument</code> .</p>
<p class="note">Because the <code><a href=
"#htmldocument">HTMLDocument</a></code> interface is now obtained
using binding-specific casting methods instead of simply being the
primary interface of the document object, it is no longer defined
as inheriting from <code>Document</code> .</p>
<pre class="idl">
interface <dfn id="htmldocument">HTMLDocument</dfn> {
// <a href="#resource0">Resource metadata management</a>
<del class="diff-old"> readonly attribute ;
</del>
<ins class=
"diff-chg"> [PutForwards=href] readonly attribute <a href=
"#location2">Location</a> <a href="#location0" title=
"dom-document-location">location</a>;
</ins>
readonly attribute DOMString <a href="#url" title=
"dom-document-URL">URL</a>;
attribute DOMString <a href="#domain" title=
"dom-document-domain">domain</a>;
readonly attribute DOMString <a href="#referrer" title=
"dom-document-referrer">referrer</a>;
attribute DOMString <a href="#cookie0" title=
"dom-document-cookie">cookie</a>;
readonly attribute DOMString <a href="#lastmodified" title=
"dom-document-lastModified">lastModified</a>;
readonly attribute DOMString <a href="#compatmode" title=
"dom-document-compatMode">compatMode</a>;
<ins class="diff-new"> attribute DOMString <a href=
"#charset0" title="dom-document-charset">charset</a>;
readonly attribute DOMString <a href="#characterset" title=
"dom-document-characterSet">characterSet</a>;
readonly attribute DOMString <a href="#defaultcharset" title=
"dom-document-defaultCharset">defaultCharset</a>;
readonly attribute DOMString <a href="#readystate" title=
"dom-document-readyState">readyState</a>;
</ins>
// <a href="#dom-tree0">DOM tree accessors</a>
attribute DOMString <a href="#document.title" title=
"dom-document-title">title</a>;
attribute DOMString <a href="#dir1" title=
"dom-document-dir">dir</a>;
attribute <a href=
"#htmlelement">HTMLElement</a> <a href="#body" title=
"dom-document-body">body</a>;
readonly attribute <a href=
"#htmlcollection0">HTMLCollection</a> <a href="#images0" title=
"dom-document-images">images</a>;
<ins class="diff-chg"> readonly attribute <a href=
"#htmlcollection0">HTMLCollection</a> <a href="#embeds" title=
"dom-document-embeds">embeds</a>;
readonly attribute <a href=
"#htmlcollection0">HTMLCollection</a> <a href="#plugins" title=
"dom-document-plugins">plugins</a>;
</ins>
readonly attribute <a href=
"#htmlcollection0">HTMLCollection</a> <a href="#links0" title=
"dom-document-links">links</a>;
readonly attribute <a href=
"#htmlcollection0">HTMLCollection</a> <a href="#forms0" title=
"dom-document-forms">forms</a>;
readonly attribute <a href=
"#htmlcollection0">HTMLCollection</a> <a href="#anchors" title=
"dom-document-anchors">anchors</a>;
<ins class="diff-new"> readonly attribute <a href=
"#htmlcollection0">HTMLCollection</a> <a href="#scripts" title=
"dom-document-scripts">scripts</a>;
</ins>
NodeList <a href="#getelementsbyname" title=
"dom-document-getElementsByName">getElementsByName</a>(in DOMString elementName);
NodeList <a href="#getelementsbyclassname" title=
"dom-document-getElementsByClassName">getElementsByClassName</a>(in DOMString classNames);
// <a href="#dynamic2">Dynamic markup insertion</a>
attribute DOMString <a href="#innerhtml" title=
"dom-innerHTML">innerHTML</a>;
<a href="#htmldocument">HTMLDocument</a> <a href="#open" title=
"dom-document-open">open</a>();
<a href="#htmldocument">HTMLDocument</a> <a href="#open" title=
"dom-document-open">open</a>(in DOMString type);
<a href="#htmldocument">HTMLDocument</a> <a href="#open" title=
"dom-document-open">open</a>(in DOMString type, in DOMString replace);
<a href="#window">Window</a> <a href="#open" title=
"dom-document-open">open</a>(in DOMString url, in DOMString name, in DOMString features);
<a href="#window">Window</a> <a href="#open" title=
"dom-document-open">open</a>(in DOMString url, in DOMString name, in DOMString features, in boolean replace);
void <a href="#close" title="dom-document-close">close</a>();
void <a href="#document.write" title=
"dom-document-write">write</a>(in DOMString text);
void <a href="#document.writeln..." title=
"dom-document-writeln">writeln</a>(in DOMString text);
// <a href="#interaction0">Interaction</a>
readonly attribute <span>Element</span> <a href="#activeelement"
title="dom-document-activeElement">activeElement</a>;
<del class="diff-old"> readonly attribute boolean ;
</del>
<ins class="diff-chg"> boolean <a href="#hasfocus" title=
"dom-document-hasFocus">hasFocus</a>();
</ins>
// <a href="#command1" title="concept-command">Commands</a>
readonly attribute <a href=
"#htmlcollection0">HTMLCollection</a> <a href="#commands0" title=
"dom-document-commands">commands</a>;
// <a href="#editing0">Editing</a>
attribute boolean <a href="#designMode" title=
"dom-document-designMode">designMode</a>;
boolean <a href="#execCommand" title=
"dom-document-execCommand">execCommand</a>(in DOMString commandId);
<del class=
"diff-old"> boolean (in DOMString commandId, in boolean doShowUI);
boolean (in DOMString commandId, in boolean doShowUI, in DOMString value);
</del>
<ins class="diff-chg"> boolean <a href="#execCommand" title=
"dom-document-execCommand">execCommand</a>(in DOMString commandId, in boolean showUI);
boolean <a href="#execCommand" title=
"dom-document-execCommand">execCommand</a>(in DOMString commandId, in boolean showUI, in DOMString value);
boolean <a href="#querycommandenabled" title=
"dom-document-queryCommandEnabled">queryCommandEnabled</a>(in DOMString commandId);
boolean <a href="#querycommandindeterm" title=
"dom-document-queryCommandIndeterm">queryCommandIndeterm</a>(in DOMString commandId);
boolean <a href="#querycommandstate" title=
"dom-document-queryCommandState">queryCommandState</a>(in DOMString commandId);
boolean <a href="#querycommandsupported" title=
"dom-document-queryCommandSupported">queryCommandSupported</a>(in DOMString commandId);
DOMString <a href="#querycommandvalue" title=
"dom-document-queryCommandValue">queryCommandValue</a>(in DOMString commandId);
</ins>
<a href="#selection1">Selection</a> <a href="#getselection0"
title="dom-document-getSelection">getSelection</a>();
};
</pre>
<p>Since the <code><a href="#htmldocument">HTMLDocument</a></code>
interface holds methods and attributes related to a number of
disparate features, the members of this interface are described in
various different sections.</p>
<h4 id="security"><span class="secno"><del class=
"diff-old">2.1.1.</del> <ins class="diff-chg">2.1.1</ins></span>
Security</h4>
<p>User agents must raise a <a href="#security9">security
exception</a> whenever any of the members of an <code><a href=
"#htmldocument">HTMLDocument</a></code> object are accessed by
scripts whose <a href="#effective3"><ins class="diff-chg">effective
script</ins> origin</a> is not the <a href="#same-origin" title=
"same origin">same</a> as the <code>Document</code> 's <del class=
"diff-old">origin.</del> <a href="#effective3"><ins class=
"diff-chg">effective script origin</ins></a> .</p>
<h4 id="resource"><span class="secno"><del class=
"diff-old">2.1.2.</del> <ins class="diff-chg">2.1.2</ins></span>
<dfn id="resource0">Resource metadata management</dfn></h4>
<p>The <dfn id="url" title=
"dom-document-URL"><code>URL</code></dfn> attribute must return
<span>the document's address</span> .</p>
<p>The <dfn id="referrer" title=
"dom-document-referrer"><code><del class="diff-old">domain</del>
<ins class="diff-chg">referrer</ins></code></dfn> attribute must
<del class="diff-old">be initialised to the document's domain , if
it has one, and null otherwise. On getting, the attribute
must</del> return <del class="diff-old">its current value. On
setting, if the new value is an allowed value (as defined below),
the attribute's value must be changed to the new value. If</del>
<ins class="diff-chg">either</ins> the <del class="diff-old">new
value is not an allowed value, then a security exception must be
raised instead. A new value is an allowed value for</del>
<ins class="diff-chg">URI of</ins> the <del class=
"diff-old">document.domain</del> <a href="#active"><ins class=
"diff-chg">active document</ins></a> <del class=
"diff-old">attribute if it is equal to the attribute's current
value, or if the new value, prefixed by a U+002E FULL STOP ("."),
exactly matches the end</del> of the <del class="diff-old">current
value. If the current value is null, new values other than null
will never be allowed. If the Document object's address is
hierarchical and uses a server-based naming authority, then its
domain is the <host>/<ihost> part of that address.
Otherwise, it has no domain. The domain</del> <a href=
"#source0"><ins class="diff-chg">source browsing context</ins></a>
<del class="diff-old">attribute is used to enable pages on
different hosts of a domain to access each others' DOMs , though
this is not yet defined by this specification . we should handle IP
addresses here The referrer attribute must return either</del>
<ins class="diff-chg">at</ins> the <del class="diff-old">URI
of</del> <ins class="diff-chg">time the navigation was started
(that is,</ins> the page which <a href="#navigate" title=
"navigate">navigated</a> the <a href="#browsing1">browsing
context</a> to the current <del class="diff-old">document (if
any),</del> <ins class="diff-chg">document),</ins> or the empty
string if there is no such originating page, or if the UA has been
configured not to report <del class="diff-old">referrers,</del>
<ins class="diff-chg">referrers in this case,</ins> or if the
navigation was initiated for a <a href="#hyperlinks">hyperlink</a>
with a <code title="rel-noreferrer"><a href=
"#noreferrer">noreferrer</a></code> keyword.</p>
<p class="note">In the case of HTTP, the <code title=
"dom-document-referrer"><a href="#referrer">referrer</a></code> DOM
attribute will match the <code title="">Referer</code> (sic) header
that was sent when fetching the current page.</p>
<p class="note"><ins class="diff-new">Typically user agents are
configured to not report referrers in the case where the referrer
uses an encrypted protocol and the current page does not (e.g. when
navigating from an</ins> <code title=""><ins class=
"diff-new">https:</ins></code> <ins class="diff-new">page to
an</ins> <code title=""><ins class="diff-new">http:</ins></code>
<ins class="diff-new">page).</ins></p>
<p>The <dfn id="cookie0" title=
"dom-document-cookie"><code>cookie</code></dfn> attribute
<del class="diff-old">must, on</del> <ins class=
"diff-chg">represents the cookies of the resource.</ins></p>
<p id="sandboxCookies"><ins class="diff-chg">On</ins> getting,
<ins class="diff-new">if the</ins> <a href=
"#sandboxed2"><ins class="diff-new">sandboxed origin browsing
context flag</ins></a> <ins class="diff-new">is set on the</ins>
<a href="#browsing1"><ins class="diff-new">browsing
context</ins></a> <ins class="diff-new">of the document, the user
agent must raise a</ins> <a href="#security9"><ins class=
"diff-new">security exception</ins></a> .<ins class=
"diff-new">Otherwise, it must</ins> return the same string as the
value of the <code title="">Cookie</code> HTTP header it would
include if fetching the resource indicated by <span>the document's
address</span> over HTTP, as per RFC 2109 section 4.3.4. <a href=
"#references">[RFC2109]</a></p>
<p>On setting, <ins class="diff-new">if</ins> the <del class=
"diff-old">cookie</del> <a href="#sandboxed2"><ins class=
"diff-chg">sandboxed origin browsing context flag</ins></a>
<del class="diff-old">attribute</del> <ins class="diff-chg">is set
on the</ins> <a href="#browsing1"><ins class="diff-chg">browsing
context</ins></a> <ins class="diff-chg">of the document, the user
agent</ins> must <del class="diff-old">cause</del> <ins class=
"diff-chg">raise a</ins> <a href="#security9"><ins class=
"diff-chg">security exception</ins></a> .<ins class=
"diff-chg">Otherwise,</ins> the user agent <del class=
"diff-old">to</del> <ins class="diff-chg">must</ins> act as it
would when processing cookies if it had just attempted to fetch
<span>the document's address</span> over HTTP, and had received a
response with a <code>Set-Cookie</code> header whose value was the
specified value, as per RFC 2109 sections 4.3.1, 4.3.2, and 4.3.3.
<a href="#references">[RFC2109]</a></p>
<p class="note">Since the <code title=
"dom-document-cookie"><a href="#cookie0">cookie</a></code>
attribute is accessible across frames, the path restrictions on
cookies are only a tool to help manage which cookies are sent to
which parts of the site, and are not in any way a security
feature.</p>
<p>The <dfn id="lastmodified" title=
"dom-document-lastModified"><code>lastModified</code></dfn>
attribute, on getting, must return the date and time of the
<code>Document</code> 's source file's last modification, in the
user's local timezone, in the following format:</p>
<ol>
<li>The month component of the date.</li>
<li>A U+002F SOLIDUS character ('/').</li>
<li>The day component of the date.</li>
<li>A U+002F SOLIDUS character ('/').</li>
<li>The year component of the date.</li>
<li>A U+0020 SPACE character.</li>
<li>The hours component of the time.</li>
<li>A U+003A COLON character (':').</li>
<li>The minutes component of the time.</li>
<li>A U+003A COLON character (':').</li>
<li>The seconds component of the time.</li>
</ol>
<p>All the numeric components above, other than the year, must be
given as two digits in the range U+0030 DIGIT ZERO to U+0039 DIGIT
NINE representing the number in base ten, zero-padded if
necessary.</p>
<p>The <code>Document</code> 's source file's last modification
date and time must be derived from relevant features of the
networking protocols used, e.g. from the value of the HTTP
<code title="">Last-Modified</code> header of the document, or from
metadata in the <del class="diff-old">filesystem</del> <ins class=
"diff-chg">file system</ins> for local files. If the last
modification date and time are not known, the attribute must return
the string <code title="">01/01/1970 00:00:00</code> .</p>
<p><ins class="diff-new">A</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">is always
set to one of three modes:</ins> <dfn id="no-quirks"><ins class=
"diff-new">no quirks mode</ins></dfn> ,<ins class="diff-new">the
default;</ins> <dfn id="quirks"><ins class="diff-new">quirks
mode</ins></dfn> ,<ins class="diff-new">used typically for legacy
documents; and</ins> <dfn id="limited"><ins class=
"diff-new">limited quirks mode</ins></dfn> ,<ins class=
"diff-new">also known as "almost standards" mode. The mode is only
ever changed from the default by the</ins> <a href=
"#html-0"><ins class="diff-new">HTML parser</ins></a> ,<ins class=
"diff-new">based on the presence, absence, or value of the DOCTYPE
string.</ins></p>
<p>The <dfn id="compatmode" title=
"dom-document-compatMode"><code>compatMode</code></dfn> DOM
attribute must return the literal string " <code title=
"">CSS1Compat</code> " unless the document has been set to <a href=
"#quirks">quirks mode</a> by the <a href="#html-0">HTML parser</a>
, in which case it must instead return the literal string "
<code title="">BackCompat</code> ". <del class="diff-old">The
document can also be set to limited quirks mode (also known as
"almost standards" mode). By default, the document is set to no
quirks mode (also known as "standards mode").</del></p>
<div class="big-issue">
<p>As far as parsing goes, the quirks I know of are:</p>
<ul>
<li>Comment parsing is different.</li>
<li><code><a href="#p">p</a></code> can contain <code><a href=
"#table">table</a></code></li>
<li>Safari and IE have special parsing rules for <% ... %>
(even in standards mode, though clearly this should be
quirks-only).</li>
</ul>
</div>
<p><ins class="diff-new">Documents have an associated</ins>
<dfn id="character1" title=
"document's character encoding"><ins class="diff-new">character
encoding</ins></dfn> .<ins class="diff-new">When a</ins>
<code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">object is created, the</ins> <a href=
"#character1"><ins class="diff-new">document's character
encoding</ins></a> <ins class="diff-new">must be initialized to
UTF-16. Various algorithms during page loading affect this value,
as does the</ins> <code title="dom-document-charset"><a href=
"#charset0"><ins class="diff-new">charset</ins></a></code>
<ins class="diff-new">setter.</ins> <a href=
"#references"><ins class="diff-new">[IANACHARSET]</ins></a></p>
<p><ins class="diff-new">The</ins> <dfn id="charset0" title=
"dom-document-charset"><code><ins class=
"diff-new">charset</ins></code></dfn> <ins class="diff-new">DOM
attribute must, on getting, return the preferred MIME name of
the</ins> <a href="#character1"><ins class="diff-new">document's
character encoding</ins></a> .<ins class="diff-new">On setting, if
the new value is an IANA-registered alias for a character encoding,
the</ins> <a href="#character1"><ins class="diff-new">document's
character encoding</ins></a> <ins class="diff-new">must be set to
that character encoding. (Otherwise, nothing happens.)</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="characterset" title=
"dom-document-characterSet"><code><ins class=
"diff-new">characterSet</ins></code></dfn> <ins class=
"diff-new">DOM attribute must, on getting, return the preferred
MIME name of the</ins> <a href="#character1"><ins class=
"diff-new">document's character encoding</ins></a> .</p>
<p><ins class="diff-new">The</ins> <dfn id="defaultcharset" title=
"dom-document-defaultCharset"><code><ins class=
"diff-new">defaultCharset</ins></code></dfn> <ins class=
"diff-new">DOM attribute must, on getting, return the preferred
MIME name of a character encoding, possibly the user's default
encoding, or an encoding associated with the user's current
geographical location, or any arbitrary encoding name.</ins></p>
<p><ins class="diff-new">Each document has a</ins> <dfn id=
"current"><ins class="diff-new">current document
readiness</ins></dfn> .<ins class="diff-new">When a</ins>
<code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">object is created, it must have its</ins> <a href=
"#current"><ins class="diff-new">current document
readiness</ins></a> <ins class="diff-new">set to the string
"loading". Various algorithms during page loading affect this
value. When the value is set, the user agent must</ins> <a href=
"#firing2"><ins class="diff-new">fire a simple event</ins></a>
<ins class="diff-new">called</ins> <code title=
"event-readystatechanged"><ins class=
"diff-new">readystatechanged</ins></code> <ins class="diff-new">at
the</ins> <code><ins class="diff-new">Document</ins></code>
<ins class="diff-new">object.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="readystate" title=
"dom-document-readyState"><code><ins class=
"diff-new">readyState</ins></code></dfn> <ins class="diff-new">DOM
attribute must, on getting, return the</ins> <a href=
"#current"><ins class="diff-new">current document
readiness</ins></a> .</p>
<h3 id="elements"><span class="secno"><del class=
"diff-old">2.2.</del> <ins class="diff-chg">2.2</ins></span>
Elements</h3>
<p>The nodes representing <a href="#html-elements">HTML
elements</a> in the DOM must implement, and expose to scripts, the
interfaces listed for them in the relevant sections of this
specification. This includes <a href="#xhtml5">XHTML</a> elements
in <a href="#xml-documents">XML documents</a> , even when those
documents are in another context (e.g. inside an XSLT
transform).</p>
<p>The basic interface, from which all the <a href=
"#html-elements">HTML elements</a> ' interfaces inherit, and which
must be used by elements that have no additional requirements, is
the <code><a href="#htmlelement">HTMLElement</a></code>
interface.</p>
<pre class="idl">
interface <dfn id=
"htmlelement">HTMLElement</dfn> : <span>Element</span> {
// <a href="#dom-tree0">DOM tree accessors</a>
NodeList <a href="#getelementsbyclassname0" title=
"dom-getElementsByClassName">getElementsByClassName</a>(in DOMString classNames);
// <a href="#dynamic2">dynamic markup insertion</a>
attribute DOMString <a href="#innerhtml" title=
"dom-innerHTML">innerHTML</a>;
// <span>metadata attributes</span>
attribute DOMString <a href="#id0" title=
"dom-id">id</a>;
attribute DOMString <a href="#title0" title=
"dom-title">title</a>;
attribute DOMString <a href="#lang0" title=
"dom-lang">lang</a>;
attribute DOMString <a href="#dir0" title=
"dom-dir">dir</a>;
attribute <span>DOMString</span> <a href="#classname"
title="dom-className">className</a>;
readonly attribute <a href=
"#domtokenlist0">DOMTokenList</a> <a href="#classlist" title=
"dom-classList">classList</a>;
<ins class="diff-new"> readonly attribute <a href=
"#domstringmap0">DOMStringMap</a> <a href="#dataset" title=
"dom-dataset">dataset</a>;
</ins>
// <a href="#interaction0">interaction</a>
attribute boolean <a href="#irrelevant0" title=
"dom-irrelevant">irrelevant</a>;
attribute long <a href="#tabindex0" title=
"dom-tabindex">tabIndex</a>;
void <a href="#click" title="dom-click">click</a>();
void <a href="#focus0" title="dom-focus">focus</a>();
void <a href="#blur" title="dom-blur">blur</a>();
void <a href="#scrollintoview" title=
"dom-scrollIntoView">scrollIntoView</a>();
void <a href="#scrollintoview" title=
"dom-scrollIntoView">scrollIntoView</a>(in boolean top);
// <a href="#command1" title="concept-command">commands</a>
attribute <a href=
"#htmlmenuelement">HTMLMenuElement</a> <a href="#contextmenu0"
title="dom-contextMenu">contextMenu</a>;
// <a href="#editing0">editing</a>
attribute boolean <a href="#draggable0" title=
"dom-draggable">draggable</a>;
attribute DOMString <a href="#contenteditable1" title=
"dom-contentEditable">contentEditable</a>;
<ins class="diff-new"> readonly attribute DOMString <a href=
"#iscontenteditable" title=
"dom-isContentEditable">isContentEditable</a>;
// <span>styling</span>
readonly attribute <span>CSSStyleDeclaration</span> <a href=
"#style0" title="dom-style">style</a>;
</ins>
// <span>data templates</span>
attribute DOMString <a href="#template0" title=
"dom-template">template</a>;
readonly attribute HTMLDataTemplateElement <a href=
"#templateelement" title="dom-templateElement">templateElement</a>;
attribute DOMString <a href="#ref0" title=
"dom-ref">ref</a>;
readonly attribute Node <a href="#refnode" title=
"dom-refNode">refNode</a>;
attribute DOMString <a href="#registrationmark0" title=
"dom-registrationMark">registrationMark</a>;
readonly attribute DocumentFragment <a href="#originalcontent"
title="dom-originalContent">originalContent</a>;
<del class="diff-old"> //
</del>
<ins class="diff-chg"> // <a href=
"#event4">event handler DOM attributes</a>
</ins>
attribute <span>EventListener</span> <a href="#onabort"
title="handler-onabort">onabort</a>;
attribute <span>EventListener</span> <a href=
"#onbeforeunload" title=
"handler-onbeforeunload">onbeforeunload</a>;
attribute <span>EventListener</span> <a href="#onblur"
title="handler-onblur">onblur</a>;
attribute <span>EventListener</span> <a href="#onchange"
title="handler-onchange">onchange</a>;
attribute <span>EventListener</span> <a href="#onclick"
title="handler-onclick">onclick</a>;
attribute <span>EventListener</span> <a href=
"#oncontextmenu" title="handler-oncontextmenu">oncontextmenu</a>;
attribute <span>EventListener</span> <a href=
"#ondblclick" title="handler-ondblclick">ondblclick</a>;
attribute <span>EventListener</span> <a href="#ondrag"
title="handler-ondrag">ondrag</a>;
attribute <span>EventListener</span> <a href=
"#ondragend" title="handler-ondragend">ondragend</a>;
attribute <span>EventListener</span> <a href=
"#ondragenter" title="handler-ondragenter">ondragenter</a>;
attribute <span>EventListener</span> <a href=
"#ondragleave" title="handler-ondragleave">ondragleave</a>;
attribute <span>EventListener</span> <a href=
"#ondragover" title="handler-ondragover">ondragover</a>;
attribute <span>EventListener</span> <a href=
"#ondragstart" title="handler-ondragstart">ondragstart</a>;
attribute <span>EventListener</span> <a href="#ondrop"
title="handler-ondrop">ondrop</a>;
attribute <span>EventListener</span> <a href="#onerror"
title="handler-onerror">onerror</a>;
attribute <span>EventListener</span> <a href="#onfocus"
title="handler-onfocus">onfocus</a>;
attribute <span>EventListener</span> <a href=
"#onkeydown" title="handler-onkeydown">onkeydown</a>;
attribute <span>EventListener</span> <a href=
"#onkeypress" title="handler-onkeypress">onkeypress</a>;
attribute <span>EventListener</span> <a href="#onkeyup"
title="handler-onkeyup">onkeyup</a>;
attribute <span>EventListener</span> <a href="#onload"
title="handler-onload">onload</a>;
attribute <span>EventListener</span> <a href=
"#onmessage" title="handler-onmessage">onmessage</a>;
attribute <span>EventListener</span> <a href=
"#onmousedown" title="handler-onmousedown">onmousedown</a>;
attribute <span>EventListener</span> <a href=
"#onmousemove" title="handler-onmousemove">onmousemove</a>;
attribute <span>EventListener</span> <a href=
"#onmouseout" title="handler-onmouseout">onmouseout</a>;
attribute <span>EventListener</span> <a href=
"#onmouseover" title="handler-onmouseover">onmouseover</a>;
attribute <span>EventListener</span> <a href=
"#onmouseup" title="handler-onmouseup">onmouseup</a>;
attribute <span>EventListener</span> <a href=
"#onmousewheel" title="handler-onmousewheel">onmousewheel</a>;
attribute <span>EventListener</span> <a href="#onresize"
title="handler-onresize">onresize</a>;
attribute <span>EventListener</span> <a href="#onscroll"
title="handler-onscroll">onscroll</a>;
attribute <span>EventListener</span> <a href="#onselect"
title="handler-onselect">onselect</a>;
<ins class=
"diff-new"> attribute <span>EventListener</span> <a href=
"#onstorage" title="handler-onstorage">onstorage</a>;
</ins>
attribute <span>EventListener</span> <a href="#onsubmit"
title="handler-onsubmit">onsubmit</a>;
attribute <span>EventListener</span> <a href="#onunload"
title="handler-onunload">onunload</a>;
};
</pre>
<p>As with the <code><a href=
"#htmldocument">HTMLDocument</a></code> interface, the
<code><a href="#htmlelement">HTMLElement</a></code> interface holds
methods and attributes related to a number of disparate features,
and the members of this interface are therefore described in
various different sections of this specification.</p>
<h4 id="reflecting"><span class="secno"><del class=
"diff-old">2.2.1.</del> <ins class="diff-chg">2.2.1</ins></span>
Reflecting content attributes in DOM attributes</h4>
<p>Some <span title="DOM attribute">DOM attributes</span> are
defined to <dfn id="reflect">reflect</dfn> a particular
<span>content attribute</span> . This means that on getting, the
DOM attribute returns the current value of the content attribute,
and on setting, the DOM attribute changes the value of the content
attribute to the given value.</p>
<p>If a reflecting DOM attribute is a <code>DOMString</code>
attribute whose content attribute is defined to contain a URI, then
on getting, the DOM attribute must return the value of the content
attribute, resolved to an absolute URI, and on setting, must set
the content attribute to the specified literal value. If the
content attribute is absent, the DOM attribute must return the
default value, if the content attribute has one, or else the empty
string.</p>
<p>If a reflecting DOM attribute is a <code>DOMString</code>
attribute whose content attribute is defined to contain one or more
URIs, then on getting, the DOM attribute must <span title=
"split the string on spaces">split the content attribute on
spaces</span> and return the concatenation of each token URI,
resolved to an absolute URI, with a single U+0020 SPACE character
between each URI; <del class="diff-old">and on setting, must set
the content attribute to the specified literal value. If</del>
<ins class="diff-chg">if</ins> the content attribute is absent, the
DOM attribute must return the default value, if the content
attribute has one, or else the empty string. <ins class=
"diff-new">On setting, the DOM attribute must set the content
attribute to the specified literal value.</ins></p>
<p>If a reflecting DOM attribute is a <code>DOMString</code> whose
content attribute is an <a href="#enumerated">enumerated
attribute</a> , and the DOM attribute is <dfn id="limited0">limited
to only known values</dfn> , then, on getting, the DOM attribute
must return the <ins class="diff-new">conforming</ins> value
associated with the state the attribute is in (in its canonical
case), or the empty string if the attribute is in a state that has
no associated keyword value; and on setting, if the new value
case-insensitively matches one of the keywords given for that
attribute, then the content attribute must be set to <ins class=
"diff-new">the conforming value associated with the state</ins>
that <ins class="diff-new">the attribute would be in if set to the
given new</ins> value, otherwise, if the new value is the empty
string, then the content attribute must be removed, otherwise, the
setter must raise a <code>SYNTAX_ERR</code> exception.</p>
<p>If a reflecting DOM attribute is a <code>DOMString</code> but
doesn't fall into any of the above categories, then the getting and
setting must be done in a transparent, case-preserving manner.</p>
<p>If a reflecting DOM attribute is a boolean attribute, then
<ins class="diff-new">on getting</ins> the DOM attribute must
return true if the attribute is set, and false if it is absent. On
setting, the content attribute must be removed if the DOM attribute
is set to false, and must be set to have the same value as its name
if the DOM attribute is set to true. (This corresponds to the rules
for <a href="#boolean0" title="boolean attribute">boolean content
attributes</a> .)</p>
<p>If a reflecting DOM attribute is a signed integer type (
<code>long</code> ) <del class="diff-old">then</del> <ins class=
"diff-chg">then, on getting,</ins> the content attribute must be
parsed according to <a href="#rules0" title=
"rules for parsing integers">the rules for parsing signed integers
<del class="diff-old">first. If</del></a> , <ins class=
"diff-chg">and if</ins> that <ins class="diff-new">is successful,
the resulting value must be returned. If, on the other hand,
it</ins> fails, or if the attribute is absent, <ins class=
"diff-new">then</ins> the default value must be returned instead,
or 0 if there is no default value. On setting, the given value must
be converted to <del class="diff-old">a</del> <ins class=
"diff-chg">the shortest possible</ins> string representing the
number as a <a href="#valid0">valid integer</a> in base ten and
then that string must be used as the new content attribute
value.</p>
<p>If a reflecting DOM attribute is an <em>unsigned</em> integer
type ( <code>unsigned long</code> ) <del class=
"diff-old">then</del> <ins class="diff-chg">then, on getting,</ins>
the content attribute must be parsed according to <a href="#rules"
title="rules for parsing non-negative integers">the rules for
parsing unsigned integers <del class="diff-old">first. If</del></a>
, <ins class="diff-chg">and if</ins> that <ins class="diff-new">is
successful, the resulting value must be returned. If, on the other
hand, it</ins> fails, or if the attribute is absent, the default
value must be returned instead, or 0 if there is no default value.
On setting, the given value must be converted to <del class=
"diff-old">a</del> <ins class="diff-chg">the shortest
possible</ins> string representing the number as a <a href=
"#valid">valid non-negative integer</a> in base ten and then that
string must be used as the new content attribute value.</p>
<p>If a reflecting DOM attribute is an unsigned integer type (
<code>unsigned long</code> ) that is <dfn id="limited1">limited to
only positive non-zero numbers</dfn> , then the behavior is similar
to the previous case, but zero is not allowed. On getting, the
content attribute must first be parsed according to <a href=
"#rules" title="rules for parsing non-negative integers">the rules
for parsing unsigned integers</a> , and if that <ins class=
"diff-new">is successful, the resulting value must be returned. If,
on the other hand, it</ins> fails, or if the attribute is absent,
the default value must be returned instead, or 1 if there is no
default value. On setting, if the value is zero, the user agent
must fire an <code>INDEX_SIZE_ERR</code> exception. Otherwise, the
given value must be converted to <del class="diff-old">a</del>
<ins class="diff-chg">the shortest possible</ins> string
representing the number as a <a href="#valid">valid non-negative
integer</a> in base ten and then that string must be used as the
new content attribute value.</p>
<p>If a reflecting DOM attribute is a floating point number type (
<code>float</code> ) and the content attribute is defined to
contain a time offset, <del class="diff-old">then</del> <ins class=
"diff-chg">then, on getting,</ins> the content attribute must be
parsed according to <a href="#rules4" title=
"rules for parsing time offsets">the rules for parsing time
<del class="diff-old">ofsets first.</del> <ins class=
"diff-chg">offsets</ins></a> ,<ins class="diff-chg">and if that is
successful, the resulting value, in seconds, must be
returned.</ins> If that fails, or if the attribute is absent, the
default value must be <del class="diff-old">returned instead,</del>
<ins class="diff-chg">returned,</ins> or the not-a-number value
(NaN) if there is no default value. On setting, the given
<del class="diff-old">value</del> <ins class="diff-chg">value,
interpreted as a time offset in seconds,</ins> must be converted to
a string using the <a href="#time-offset">time offset <del class=
"diff-old">serialisation</del> <ins class="diff-chg">serialization
rules</ins></a> ,<ins class="diff-chg">and that string must be used
as the new content attribute value.</ins></p>
<p><ins class="diff-chg">If a reflecting DOM attribute is a
floating point number type (</ins> <code><ins class=
"diff-chg">float</ins></code> <ins class="diff-chg">) and it
doesn't fall into one of the earlier categories, then, on getting,
the content attribute must be parsed according to</ins> <a href=
"#rules1" title=
"rules for parsing floating point number values"><ins class=
"diff-chg">the</ins> rules <ins class="diff-new">for parsing
floating point number values</ins></a> , and <ins class=
"diff-new">if that is successful, the resulting value must be
returned. If, on the other hand, it fails, or if the attribute is
absent, the default value must be returned instead, or 0.0 if there
is no default value. On setting, the given value must be converted
to the shortest possible string representing the number as a</ins>
<a href="#valid1"><ins class="diff-new">valid floating point
number</ins></a> <ins class="diff-new">in base ten and then</ins>
that string must be used as the new content attribute value.</p>
<p>If a reflecting DOM attribute is of the type <code><a href=
"#domtokenlist0">DOMTokenList</a></code> , then on getting it must
return a <code><a href="#domtokenlist0">DOMTokenList</a></code>
object whose underlying string is the element's corresponding
content attribute. When the <code><a href=
"#domtokenlist0">DOMTokenList</a></code> object mutates its
underlying string, the <ins class="diff-new">content</ins>
attribute must itself be immediately mutated. When the attribute is
absent, then the string represented by the <code><a href=
"#domtokenlist0">DOMTokenList</a></code> object is the empty
string; when the object mutates this empty string, the user agent
must first add the corresponding content attribute, and then mutate
that attribute instead. <code><a href=
"#domtokenlist0">DOMTokenList</a></code> attributes are always
read-only. The same <code><a href=
"#domtokenlist0">DOMTokenList</a></code> object must be returned
every time for each attribute.</p>
<p>If a reflecting DOM attribute has the type <code><a href=
"#htmlelement">HTMLElement</a></code> , or an interface that
descends from <code><a href="#htmlelement">HTMLElement</a></code> ,
then, on getting, it must run the following algorithm (stopping at
the first point where a value is returned):</p>
<ol>
<li>If the corresponding content attribute is absent, then the DOM
attribute must return null.</li>
<li>Let <var title="">candidate</var> be the element that the
<code title="">document.getElementById()</code> method would find
if it was passed as its argument the current value of the
corresponding content attribute.</li>
<li>If <var title="">candidate</var> is null, or if it is not
type-compatible with the DOM attribute, then the DOM attribute must
return null.</li>
<li>Otherwise, it must return <var title="">candidate</var> .</li>
</ol>
<p>On setting, if the given element has an <code title=
"attr-id"><a href="#id">id</a></code> attribute, then the content
attribute must be set to the value of that <code title=
"attr-id"><a href="#id">id</a></code> attribute. Otherwise, the DOM
attribute must be set to the empty string.</p>
<h3 id="common0"><span class="secno"><del class=
"diff-old">2.3.</del> <ins class="diff-chg">2.3</ins></span> Common
DOM interfaces</h3>
<h4 id="collections"><span class="secno"><del class=
"diff-old">2.3.1.</del> <ins class="diff-chg">2.3.1</ins></span>
Collections</h4>
<p>The <code><a href="#htmlcollection0">HTMLCollection</a></code> ,
<code><a href=
"#htmlformcontrolscollection0">HTMLFormControlsCollection</a></code>
, and <code><a href=
"#htmloptionscollection0">HTMLOptionsCollection</a></code>
interfaces represent various lists of DOM nodes. Collectively,
objects implementing these interfaces are called <dfn id=
"collections0">collections</dfn> .</p>
<p>When a <a href="#collections0" title=
"collections">collection</a> is created, a filter and a root are
associated with the collection.</p>
<p class="example">For example, when the <code><a href=
"#htmlcollection0">HTMLCollection</a></code> object for the
<code title="dom-document-images"><a href=
"#images0">document.images</a></code> attribute is created, it is
associated with a filter that selects only <code><a href=
"#img">img</a></code> elements, and rooted at the root of the
document.</p>
<p>The <a href="#collections0" title="collections">collection</a>
then <dfn id="represents" title=
"represented by the collection">represents</dfn> a <a href=
"#live">live</a> view of the subtree rooted at the collection's
root, containing only nodes that match the given filter. The view
is linear. In the absence of specific requirements to the contrary,
the nodes within the collection must be sorted in <a href=
"#tree-order">tree order</a> .</p>
<p class="note">The <code title="dom-table-rows"><a href=
"#rows">rows</a></code> list is not in tree order.</p>
<p>An attribute that returns a collection must return the same
object every time it is retrieved.</p>
<h5 id="htmlcollection"><span class="secno">2.3.1.1.</span>
HTMLCollection</h5>
<p>The <code><a href="#htmlcollection0">HTMLCollection</a></code>
interface represents a generic <a href="#collections0" title=
"collections">collection</a> of elements.</p>
<pre class="idl">
interface <dfn id="htmlcollection0">HTMLCollection</dfn> {
readonly attribute unsigned long <a href="#length" title=
"dom-HTMLCollection-length">length</a>;
<del class="diff-old"> Element (in unsigned long index);
Element (in DOMString name);
</del>
<ins class="diff-chg"> [IndexGetter] Element <a href="#itemindex"
title="dom-HTMLCollection-item">item</a>(in unsigned long index);
[NameGetter] Element <a href="#nameditem" title=
"dom-HTMLCollection-namedItem">namedItem</a>(in DOMString name);
</ins>
};
</pre>
<p>The <dfn id="length" title=
"dom-HTMLCollection-length"><code>length</code></dfn> attribute
must return the number of nodes <a href="#represents">represented
by the collection <del class="diff-old">.</del></a> .</p>
<p>The <dfn id="itemindex" title=
"dom-HTMLCollection-item"><code>item( <var title="">index</var>
)</code></dfn> method must return the <var title="">index</var> th
node in the collection. If there is no <var title="">index</var> th
node in the collection, then the method must return null.</p>
<p>The <dfn id="nameditem" title=
"dom-HTMLCollection-namedItem"><code>namedItem( <var title=
"">key</var> )</code></dfn> method must return the first node in
the collection that matches the following requirements:</p>
<ul>
<li>It is an <code><a href="#a">a</a></code> , <code><a href=
"#applet">applet</a></code> , <code><a href="#area">area</a></code>
, <code>form</code> , <code><a href="#img">img</a></code> , or
<code><a href="#object">object</a></code> element with a
<code title="attr-name">name</code> attribute equal to <var title=
"">key</var> , or,</li>
<li>It is an <a href="#html-elements" title="HTML elements">HTML
element</a> of any kind with an <code title="attr-id"><a href=
"#id">id</a></code> attribute equal to <var title="">key</var> .
(Non-HTML elements, even if they have IDs, are not searched for the
purposes of <code title="dom-HTMLCollection-namedItem"><a href=
"#nameditem">namedItem()</a></code> .)</li>
</ul>
<p>If no such elements are found, then the method must return null.
<del class="diff-old">In ECMAScript implementations, objects that
implement the HTMLCollection interface must also have a [[Get]]
method that, when invoked with a property name that is a number,
acts like the item() method would when invoked with that argument,
and when invoked with a property name that is a string, acts like
the namedItem() method would when invoked with that
argument.</del></p>
<h5 id="htmlformcontrolscollection"><span class=
"secno">2.3.1.2.</span> HTMLFormControlsCollection</h5>
<p>The <code><a href=
"#htmlformcontrolscollection0">HTMLFormControlsCollection</a></code>
interface represents a <a href="#collections0" title=
"collections">collection</a> of form controls.</p>
<pre class="idl">
interface <dfn id=
"htmlformcontrolscollection0">HTMLFormControlsCollection</dfn> {
readonly attribute unsigned long <a href="#length0" title=
"dom-HTMLFormControlsCollection-length">length</a>;
<del class="diff-old"> (in unsigned long index);
Object (in DOMString name);
</del>
<ins class="diff-chg"> [IndexGetter] <a href=
"#htmlelement">HTMLElement</a> <a href="#itemindex0" title=
"dom-HTMLFormControlsCollection-item">item</a>(in unsigned long index);
[NameGetter] Object <a href="#nameditem0" title=
"dom-HTMLFormControlsCollection-namedItem">namedItem</a>(in DOMString name);
</ins>
};
</pre>
<p>The <dfn id="length0" title=
"dom-HTMLFormControlsCollection-length"><code>length</code></dfn>
attribute must return the number of nodes <a href=
"#represents">represented by the collection <del class=
"diff-old">.</del></a> .</p>
<p>The <dfn id="itemindex0" title=
"dom-HTMLFormControlsCollection-item"><code>item( <var title=
"">index</var> )</code></dfn> method must return the <var title=
"">index</var> th node in the collection. If there is no
<var title="">index</var> th node in the collection, then the
method must return null.</p>
<p>The <dfn id="nameditem0" title=
"dom-HTMLFormControlsCollection-namedItem"><code>namedItem(
<var title="">key</var> )</code></dfn> method must act according to
the following algorithm:</p>
<ol>
<li>If, at the time the method is called, there is exactly one node
in the collection that has either an <code title="attr-id"><a href=
"#id">id</a></code> attribute or a <code title=
"attr-name">name</code> attribute equal to <var title="">key</var>
, then return that node and stop the algorithm.</li>
<li>Otherwise, if there are no nodes in the collection that have
either an <code title="attr-id"><a href="#id">id</a></code>
attribute or a <code title="attr-name">name</code> attribute equal
to <var title="">key</var> , then return null and stop the
algorithm.</li>
<li>Otherwise, create a <code>NodeList</code> object representing a
live view of the <code><a href=
"#htmlformcontrolscollection0">HTMLFormControlsCollection</a></code>
object, further filtered so that the only nodes in the
<code>NodeList</code> object are those that have either an
<code title="attr-id"><a href="#id">id</a></code> attribute or a
<code title="attr-name">name</code> attribute equal to <var title=
"">key</var> . The nodes in the <code>NodeList</code> object must
be sorted in <a href="#tree-order">tree order</a> .</li>
<li>Return that <code>NodeList</code> object.</li>
</ol>
<del class="diff-old">In the ECMAScript DOM binding, objects
implementing the HTMLFormControlsCollection interface must support
being dereferenced using the square bracket notation, such that
dereferencing with an integer index is equivalent to invoking the
item() method with that index, and such that dereferencing with a
string index is equivalent to invoking the namedItem() method with
that index.</del>
<h5 id="htmloptionscollection"><span class="secno">2.3.1.3.</span>
HTMLOptionsCollection</h5>
<p>The <code><a href=
"#htmloptionscollection0">HTMLOptionsCollection</a></code>
interface represents a list of <code>option</code> elements.</p>
<pre class="idl">
interface <dfn id=
"htmloptionscollection0">HTMLOptionsCollection</dfn> {
attribute unsigned long <a href="#length1" title=
"dom-HTMLOptionsCollection-length">length</a>;
<del class="diff-old"> HTMLOptionElement (in unsigned long index);
Object (in DOMString name);
</del>
<ins class="diff-chg"> [IndexGetter] HTMLOptionElement <a href=
"#itemindex1" title=
"dom-HTMLOptionsCollection-item">item</a>(in unsigned long index);
[NameGetter] Object <a href="#nameditem1" title=
"dom-HTMLOptionsCollection-namedItem">namedItem</a>(in DOMString name);
</ins>
};
</pre>
<p>On getting, the <dfn id="length1" title=
"dom-HTMLOptionsCollection-length"><code>length</code></dfn>
attribute must return the number of nodes <a href=
"#represents">represented by the collection <del class=
"diff-old">.</del></a> .</p>
<p>On setting, the <del class="diff-old">behaviour</del>
<ins class="diff-chg">behavior</ins> depends on whether the new
value is equal to, greater than, or less than the number of nodes
<a href="#represents">represented by the collection</a> at that
time. If the number is the same, then setting the attribute must do
nothing. If the new value is greater, then <var title="">n</var>
new <code>option</code> elements with no attributes and no child
nodes must be appended to the <code>select</code> element on which
the <code><a href=
"#htmloptionscollection0">HTMLOptionsCollection</a></code> is
rooted, where <var title="">n</var> is the difference between the
two numbers (new value minus old value). If the new value is lower,
then the last <var title="">n</var> nodes in the collection must be
removed from their parent nodes, where <var title="">n</var> is the
difference between the two numbers (old value minus new value).</p>
<p class="note">Setting <code title=
"dom-HTMLOptionsCollection-length"><a href=
"#length1">length</a></code> never removes or adds any
<code>optgroup</code> elements, and never adds new children to
existing <code>optgroup</code> elements (though it can remove
children from them).</p>
<p>The <dfn id="itemindex1" title=
"dom-HTMLOptionsCollection-item"><code>item( <var title=
"">index</var> )</code></dfn> method must return the <var title=
"">index</var> th node in the collection. If there is no
<var title="">index</var> th node in the collection, then the
method must return null.</p>
<p>The <dfn id="nameditem1" title=
"dom-HTMLOptionsCollection-namedItem"><code>namedItem( <var title=
"">key</var> )</code></dfn> method must act according to the
following algorithm:</p>
<ol>
<li>If, at the time the method is called, there is exactly one node
in the collection that has either an <code title="attr-id"><a href=
"#id">id</a></code> attribute or a <code title=
"attr-name">name</code> attribute equal to <var title="">key</var>
, then return that node and stop the algorithm.</li>
<li>Otherwise, if there are no nodes in the collection that have
either an <code title="attr-id"><a href="#id">id</a></code>
attribute or a <code title="attr-name">name</code> attribute equal
to <var title="">key</var> , then return null and stop the
algorithm.</li>
<li>Otherwise, create a <code>NodeList</code> object representing a
live view of the <code><a href=
"#htmloptionscollection0">HTMLOptionsCollection</a></code> object,
further filtered so that the only nodes in the
<code>NodeList</code> object are those that have either an
<code title="attr-id"><a href="#id">id</a></code> attribute or a
<code title="attr-option-name">name</code> attribute equal to
<var title="">key</var> . The nodes in the <code>NodeList</code>
object must be sorted in <a href="#tree-order">tree order</a>
.</li>
<li>Return that <code>NodeList</code> object.</li>
</ol>
<del class="diff-old">In the ECMAScript DOM binding, objects
implementing the HTMLOptionsCollection interface must support being
dereferenced using the square bracket notation, such that
dereferencing with an integer index is equivalent to invoking the
item() method with that index, and such that dereferencing with a
string index is equivalent to invoking the namedItem() method with
that index.</del>
<p class="big-issue">We may want to add <code>add()</code> and
<code>remove()</code> methods here too because IE implements
HTMLSelectElement and HTMLOptionsCollection on the same object, and
so people use them almost interchangeably in the wild.</p>
<h4 id="domtokenlist"><span class="secno"><del class=
"diff-old">2.3.2.</del> <ins class="diff-chg">2.3.2</ins></span>
DOMTokenList</h4>
<p>The <code><a href="#domtokenlist0">DOMTokenList</a></code>
interface represents an interface to an underlying string that
consists of an <a href="#unordered">unordered set of unique
space-separated tokens</a> .</p>
<p>Which string underlies a particular <code><a href=
"#domtokenlist0">DOMTokenList</a></code> object is defined when the
object is created. It might be a content attribute (e.g. the string
that underlies the <code title="dom-classList"><a href=
"#classlist">classList</a></code> object is the <code title=
"attr-class"><a href="#class">class</a></code> attribute), or it
might be an anonymous string (e.g. when a <code><a href=
"#domtokenlist0">DOMTokenList</a></code> object is passed to an
author-implemented callback in the <code><a href=
"#datagrid0">datagrid</a></code> APIs). <del class=
"diff-old">{</del></p>
<pre>
<ins class="diff-chg"> class=idl>[<a href="#stringify" title=
"dom-tokenlist-toString">Stringifies</a>] interface <dfn id=
"domtokenlist0">DOMTokenList</dfn> {
</ins>
readonly attribute unsigned long <a href="#length2" title=
"dom-tokenlist-length">length</a>;
<del class="diff-old"> DOMString (in unsigned long index);
</del>
<ins class="diff-chg"> [IndexGetter] DOMString <a href=
"#itemindex2" title=
"dom-tokenlist-item">item</a>(in unsigned long index);
</ins>
boolean <a href="#hastoken" title=
"dom-tokenlist-has">has</a>(in DOMString token);
void <a href="#addtoken" title=
"dom-tokenlist-add">add</a>(in DOMString token);
void <a href="#remove" title=
"dom-tokenlist-remove">remove</a>(in DOMString token);
boolean <a href="#toggle" title=
"dom-tokenlist-toggle">toggle</a>(in DOMString token);
};
</pre>
<p>The <dfn id="length2" title=
"dom-tokenlist-length"><code>length</code></dfn> attribute must
return the number of <em>unique</em> tokens that result from
<a href="#split" title="split a string on spaces">splitting the
underlying string on spaces</a> .</p>
<p>The <dfn id="itemindex2" title="dom-tokenlist-item"><code>item(
<var title="">index</var> )</code></dfn> method must <a href=
"#split" title="split a string on spaces">split the underlying
string on spaces</a> , sort the resulting list of tokens by Unicode
codepoint , remove exact duplicates, and then return the
<var title="">index</var> th item in this list. If <var title=
"">index</var> is equal to or greater than the number of tokens,
then the method must return null.</p>
<p><del class="diff-old">In ECMAScript implementations, objects
that implement the DOMTokenList interface must also have a [[Get]]
method that, when invoked with a property name that is a number,
acts like the item() method would when invoked with that
argument.</del> The <dfn id="hastoken" title=
"dom-tokenlist-has"><code>has( <var title="">token</var>
)</code></dfn> method must run the following algorithm:</p>
<ol>
<li>If the <var title="">token</var> argument contains any spaces,
then raise an <code>INVALID_CHARACTER_ERR</code> exception and stop
the algorithm.</li>
<li>Otherwise, <a href="#split" title=
"split a string on spaces">split the underlying string on
spaces</a> to get the list of tokens in the object's underlying
string.</li>
<li>If the token indicated by <var title="">token</var> is one of
the tokens in the object's underlying string then return true and
stop this algorithm.</li>
<li>Otherwise, return false.</li>
</ol>
<p>The <dfn id="addtoken" title="dom-tokenlist-add"><code>add(
<var title="">token</var> )</code></dfn> method must run the
following algorithm:</p>
<ol>
<li>If the <var title="">token</var> argument contains any spaces,
then raise an <code>INVALID_CHARACTER_ERR</code> exception and stop
the algorithm.</li>
<li>Otherwise, <a href="#split" title=
"split a string on spaces">split the underlying string on
spaces</a> to get the list of tokens in the object's underlying
string.</li>
<li>If the given <var title="">token</var> is already one of the
tokens in the <code><a href=
"#domtokenlist0">DOMTokenList</a></code> object's underlying string
then stop the algorithm.</li>
<li>Otherwise, if the <del class="diff-old">last character of
the</del> <code><a href="#domtokenlist0">DOMTokenList</a></code>
object's underlying string is not <ins class="diff-new">the empty
string and the last character of that string is not</ins> a
<a href="#space">space character</a> , then append a U+0020 SPACE
character to the end of that string.</li>
<li>Append the value of <var title="">token</var> to the end of the
<code><a href="#domtokenlist0">DOMTokenList</a></code> object's
underlying string.</li>
</ol>
<p>The <dfn id="remove" title="dom-tokenlist-remove"><code>remove(
<var title="">token</var> )</code></dfn> method must run the
following algorithm:</p>
<ol>
<li>If the <var title="">token</var> argument contains any <a href=
"#space" title="space character">spaces</a> , then raise an
<code>INVALID_CHARACTER_ERR</code> exception and stop the
algorithm.</li>
<li>Otherwise, <a href="#remove0" title=
"remove a token from a string">remove the given <var title=
"">token</var> from the underlying string</a> .</li>
</ol>
<p>The <dfn id="toggle" title="dom-tokenlist-toggle"><code>toggle(
<var title="">token</var> )</code></dfn> method must run the
following algorithm:</p>
<ol>
<li>If the <var title="">token</var> argument contains any spaces,
then raise an <code>INVALID_CHARACTER_ERR</code> exception and stop
the algorithm.</li>
<li>Otherwise, <a href="#split" title=
"split a string on spaces">split the underlying string on
spaces</a> to get the list of tokens in the object's underlying
string.</li>
<li>If the given <var title="">token</var> is already one of the
tokens in the <code><a href=
"#domtokenlist0">DOMTokenList</a></code> object's underlying string
then <a href="#remove0" title="remove a token from a string">remove
the given <var title="">token</var> from the underlying string</a>
, and stop the algorithm, returning false.</li>
<li>Otherwise, if the <del class="diff-old">last character of
the</del> <code><a href="#domtokenlist0">DOMTokenList</a></code>
object's underlying string is not <ins class="diff-new">the empty
string and the last character of that string is not</ins> a
<a href="#space">space character</a> , then append a U+0020 SPACE
character to the end of that string.</li>
<li>Append the value of <var title="">token</var> to the end of the
<code><a href="#domtokenlist0">DOMTokenList</a></code> object's
underlying string.</li>
<li>Return true.</li>
</ol>
<p><del class="diff-old">In the ECMAScript DOM binding,
objects</del> <ins class="diff-chg">Objects</ins> implementing the
<code><a href="#domtokenlist0">DOMTokenList</a></code> interface
must <dfn id="stringify" title=
"dom-tokenlist-toString">stringify</dfn> to the object's underlying
string representation.</p>
<h4 id="domstringmap"><span class="secno"><ins class=
"diff-new">2.3.3</ins></span> <ins class=
"diff-new">DOMStringMap</ins></h4>
<p><ins class="diff-new">The</ins> <code><a href=
"#domstringmap0"><ins class=
"diff-new">DOMStringMap</ins></a></code> <ins class=
"diff-new">interface represents a set of name-value pairs. When
a</ins> <code><a href="#domstringmap0"><ins class=
"diff-new">DOMStringMap</ins></a></code> <ins class=
"diff-new">object is instanced, it is associated with three
algorithms, one for getting values from names, one for setting
names to certain values, and one for deleting names.</ins></p>
<p class="big-issue"><ins class="diff-new">The names of the methods
on this interface are temporary and will be fixed when the Web IDL
/ "Language Bindings for DOM Specifications" spec is ready to
handle this case.</ins></p>
<pre class="idl">
interface <dfn id="domstringmap0">DOMStringMap</dfn> {<ins class=
"diff-new">
[NameGetter] DOMString <a href="#xxx1name" title=
"dom-stringmap-XXX1">XXX1</a>(in DOMString name);
[NameSetter] void <a href="#xxx2name" title=
"dom-stringmap-XXX2">XXX2</a>(in DOMString name, in DOMString value);
[XXX] boolean <a href="#xxx3name" title=
"dom-stringmap-XXX3">XXX3</a>(in DOMString name);
};
</ins>
</pre>
<p><ins class="diff-new">The</ins> <dfn id="xxx1name" title=
"dom-stringmap-XXX1"><code><ins class="diff-new">XXX1(</ins>
<var title=""><ins class="diff-new">name</ins></var> <ins class=
"diff-new">)</ins></code></dfn> <ins class="diff-new">method must
call the algorithm for getting values from names, passing</ins>
<var title=""><ins class="diff-new">name</ins></var> <ins class=
"diff-new">as the name, and must return the corresponding value, or
null if</ins> <var title=""><ins class="diff-new">name</ins></var>
<ins class="diff-new">has no corresponding value.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="xxx2name" title=
"dom-stringmap-XXX2"><code><ins class="diff-new">XXX2(</ins>
<var title=""><ins class="diff-new">name</ins></var> ,<var title=
""><ins class="diff-new">value</ins></var> <ins class=
"diff-new">)</ins></code></dfn> <ins class="diff-new">method must
call the algorithm for setting names to certain values,
passing</ins> <var title=""><ins class="diff-new">name</ins></var>
<ins class="diff-new">as the name and</ins> <var title=
""><ins class="diff-new">value</ins></var> <ins class="diff-new">as
the value.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="xxx3name" title=
"dom-stringmap-XXX3"><code><ins class="diff-new">XXX3(</ins>
<var title=""><ins class="diff-new">name</ins></var> <ins class=
"diff-new">)</ins></code></dfn> <ins class="diff-new">method must
call the algorithm for deleting names, passing</ins> <var title=
""><ins class="diff-new">name</ins></var> <ins class="diff-new">as
the name, and must return true.</ins></p>
<h4 id="dom-feature"><span class="secno"><del class=
"diff-old">2.3.3.</del> <ins class="diff-chg">2.3.4</ins></span>
DOM feature strings</h4>
<p>DOM3 Core defines mechanisms for checking for interface support,
and for obtaining implementations of interfaces, using <a href=
"http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMFeatures">feature
strings</a> . <a href="#references">[DOM3CORE]</a></p>
<p>A DOM application can use the <dfn id="hasfeature" title=
"hasFeature"><code>hasFeature( <var title="">feature</var> ,
<var title="">version</var> )</code></dfn> method of the
<code>DOMImplementation</code> interface with parameter values "
<code title="">HTML</code> " and " <code>5.0</code> "
(respectively) to determine whether or not this module is supported
by the implementation. In addition to the feature string "
<code title="">HTML</code> ", the feature string " <code title=
"">XHTML</code> " (with version string " <code>5.0</code> ") can be
used to check if the implementation supports XHTML. User agents
should respond with a true value when the <code><a href=
"#hasfeature">hasFeature</a></code> method is queried with these
values. Authors are cautioned, however, that UAs returning true
might not be perfectly compliant, and that UAs returning false
might well have support for features in this specification; in
general, therefore, use of this method is discouraged.</p>
<p>The values " <code title="">HTML</code> " and " <code title=
"">XHTML</code> " (both with version " <code>5.0</code> ") should
also be supported in the context of the <code>getFeature()</code>
and <code>isSupported()</code> methods, as defined by DOM3
Core.</p>
<p class="note">The interfaces defined in this specification are
not always supersets of the interfaces defined in DOM2 HTML; some
features that were formerly deprecated, poorly supported, rarely
used or considered unnecessary have been removed. Therefore it is
not <del class="diff-old">guarenteed</del> <ins class=
"diff-chg">guaranteed</ins> that an implementation that supports "
<code title="">HTML</code> " " <code>5.0</code> " also supports "
<code title="">HTML</code> " " <code>2.0</code> ".</p>
<h3 id="dom-tree"><span class="secno"><del class=
"diff-old">2.4.</del> <ins class="diff-chg">2.4</ins></span>
<dfn id="dom-tree0">DOM tree accessors</dfn></h3>
<p><dfn id="the-html0">The <code>html</code> element</dfn> of a
document is the document's root element, if there is one and it's
an <code><a href="#html">html</a></code> element, or null
otherwise.</p>
<p><dfn id="the-head0">The <code>head</code> element</dfn> of a
document is the first <code><a href="#head">head</a></code> element
that is a child of <a href="#the-html0">the <code>html</code>
element</a> , if there is one, or null otherwise.</p>
<p><dfn id="the-title1">The <code>title</code> element</dfn> of a
document is the first <code><a href="#title1">title</a></code>
element <del class="diff-old">that is a child of</del> <ins class=
"diff-chg">in</ins> the <del class="diff-old">head element ,</del>
<ins class="diff-chg">document (in tree order),</ins> if there is
one, or null otherwise.</p>
<p>The <dfn id="document.title" title=
"dom-document-title"><code>title</code></dfn> attribute must, on
getting, run the following algorithm:</p>
<ol>
<li>
<p>If the <a href="#root-element">root element</a> is an
<code>svg</code> element in the " <code title=
"">http://www.w3.org/2000/svg</code> " namespace, and the user
agent supports SVG, then the getter must return the value that
would have been returned by the DOM attribute of the same name on
the <code>SVGDocument</code> interface.</p>
</li>
<li>
<p>Otherwise, it must return a concatenation of the data of all the
child <a href="#text-node" title="text node">text nodes</a> of
<a href="#the-title1">the <code>title</code> element</a> , in tree
order, or the empty string if <a href="#the-title1">the
<code>title</code> element</a> is null.</p>
</li>
</ol>
<p>On setting, the following algorithm must be run:</p>
<ol>
<li>
<p>If the <a href="#root-element">root element</a> is an
<code>svg</code> element in the " <code title=
"">http://www.w3.org/2000/svg</code> " namespace, and the user
agent supports SVG, then the setter must defer to the setter for
the DOM attribute of the same name on the <code>SVGDocument</code>
interface. Stop the algorithm here.</p>
</li>
<li>If <a href="#the-title1"><ins class="diff-new">the</ins>
<code><ins class="diff-new">title</ins></code> <ins class=
"diff-new">element</ins></a> <ins class="diff-new">is null
and</ins> <a href="#the-head0">the <code>head</code> element</a> is
null, then the attribute must do nothing. Stop the algorithm
here.</li>
<li>If <a href="#the-title1">the <code>title</code> element</a> is
null, then a new <code><a href="#title1">title</a></code> element
must be created and appended to <a href="#the-head0">the
<code>head</code> element</a> .</li>
<li>The children of <a href="#the-title1">the <code>title</code>
element</a> (if any) must all be removed.</li>
<li>A single <code>Text</code> node whose data is the new value
being assigned must be appended to <a href="#the-title1">the
<code>title</code> element</a> .</li>
</ol>
<p>The <code title="dom-document-title"><a href=
"#document.title">title</a></code> attribute on the <code><a href=
"#htmldocument">HTMLDocument</a></code> interface should shadow the
attribute of the same name on the <code>SVGDocument</code>
interface when the user agent supports both HTML and SVG.</p>
<p><dfn id="the-body1">The body element</dfn> of a document is the
first child of <a href="#the-html0">the <code>html</code>
element</a> that is either a <code><a href="#body0">body</a></code>
element or a <code>frameset</code> element. If there is no such
element, it is null. If the body element is null, then when the
specification requires that events be fired at "the body element",
they must instead be fired at the <code>Document</code> object.</p>
<p>The <dfn id="body" title=
"dom-document-body"><code>body</code></dfn> attribute, on getting,
must return <a href="#the-body1">the body element</a> of the
document (either a <code><a href="#body0">body</a></code> element,
a <code>frameset</code> element, or null). On setting, the
following algorithm must be run:</p>
<ol>
<li>If the new value is not a <code><a href=
"#body0">body</a></code> or <code>frameset</code> element, then
raise a <code>HIERARCHY_REQUEST_ERR</code> exception and abort
these steps.</li>
<li>Otherwise, if the new value is the same as <a href=
"#the-body1">the body element</a> , do nothing. Abort these
steps.</li>
<li>Otherwise, if <a href="#the-body1">the body element</a> is not
null, then replace that element with the new value in the DOM, as
if the root element's <code title="">replaceChild()</code> method
had been called with the new value and <a href="#the-body1" title=
"the body element">the incumbent body element</a> as its two
arguments respectively, then abort these steps.</li>
<li>Otherwise, the <a href="#the-body1">the body element</a> is
null. Append the new value to the root element.</li>
</ol>
<p>The <dfn id="images0" title=
"dom-document-images"><code>images</code></dfn> attribute must
return an <code><a href=
"#htmlcollection0">HTMLCollection</a></code> rooted at the
<code>Document</code> node, whose filter matches only
<code><a href="#img">img</a></code> elements.</p>
<p>The <dfn id="embeds" title=
"dom-document-embeds"><code><ins class=
"diff-new">embeds</ins></code></dfn> <ins class=
"diff-new">attribute must return an</ins> <code><a href=
"#htmlcollection0"><ins class=
"diff-new">HTMLCollection</ins></a></code> <ins class=
"diff-new">rooted at the</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">node, whose
filter matches only</ins> <code><a href="#embed"><ins class=
"diff-new">embed</ins></a></code> <ins class=
"diff-new">elements.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="plugins" title=
"dom-document-plugins"><code><ins class=
"diff-new">plugins</ins></code></dfn> <ins class=
"diff-new">attribute must return the same object as that returned
by the</ins> <code title="dom-document-embeds"><a href=
"#embeds"><ins class="diff-new">embeds</ins></a></code> <ins class=
"diff-new">attribute.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="links0" title=
"dom-document-links"><code>links</code></dfn> attribute must return
an <code><a href="#htmlcollection0">HTMLCollection</a></code>
rooted at the <code>Document</code> node, whose filter matches only
<code><a href="#a">a</a></code> elements with <code title=
"attr-hyperlink-href"><a href="#href6">href</a></code> attributes
and <code><a href="#area">area</a></code> elements with
<code title="attr-hyperlink-href"><a href="#href6">href</a></code>
attributes.</p>
<p>The <dfn id="forms0" title=
"dom-document-forms"><code>forms</code></dfn> attribute must return
an <code><a href="#htmlcollection0">HTMLCollection</a></code>
rooted at the <code>Document</code> node, whose filter matches only
<code>form</code> elements.</p>
<p>The <dfn id="anchors" title=
"dom-document-anchors"><code>anchors</code></dfn> attribute must
return an <code><a href=
"#htmlcollection0">HTMLCollection</a></code> rooted at the
<code>Document</code> node, whose filter matches only
<code><a href="#a">a</a></code> elements with <code title=
"attr-a-name">name</code> attributes.</p>
<p>The <dfn id="scripts" title=
"dom-document-scripts"><code><ins class=
"diff-new">scripts</ins></code></dfn> <ins class=
"diff-new">attribute must return an</ins> <code><a href=
"#htmlcollection0"><ins class=
"diff-new">HTMLCollection</ins></a></code> <ins class=
"diff-new">rooted at the</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">node, whose
filter matches only</ins> <code><a href="#script1"><ins class=
"diff-new">script</ins></a></code> <ins class=
"diff-new">elements.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="getelementsbyname"
title="dom-document-getElementsByName"><code>getElementsByName(
<var title="">name</var> )</code></dfn> method a string <var title=
"">name</var> , and must return a live <code>NodeList</code>
containing all the <code><a href="#a">a</a></code> , <code><a href=
"#applet">applet</a></code> , <code>button</code> ,
<code>form</code> , <code><a href="#iframe">iframe</a></code> ,
<code><a href="#img">img</a></code> , <code>input</code> ,
<code><a href="#map">map</a></code> , <code><a href=
"#meta0">meta</a></code> , <code><a href=
"#object">object</a></code> , <code>select</code> , and
<code>textarea</code> elements in that document that have a
<code title="">name</code> attribute whose value is equal to the
<var title="">name</var> argument.</p>
<p>The <dfn id="getelementsbyclassname" title=
"dom-document-getElementsByClassName"><code>getElementsByClassName(
<var title="">classNames</var> )</code></dfn> method takes a string
that contains an <a href="#unordered">unordered set of unique
space-separated tokens</a> representing classes. When called, the
method must return a live <code>NodeList</code> object containing
all the elements in the document that have all the classes
specified in that argument, having obtained the classes by <a href=
"#split" title="split a string on spaces">splitting a string on
spaces</a> . If there are no tokens specified in the argument, then
the method must return an empty <code>NodeList</code> .</p>
<p>The <dfn id="getelementsbyclassname0" title=
"dom-getElementsByClassName"><code>getElementsByClassName()</code></dfn>
method on the <code><a href="#htmlelement">HTMLElement</a></code>
interface must return a live <code>NodeList</code> with the nodes
that the <code><a href="#htmldocument">HTMLDocument</a></code>
<code title="dom-document-getElementsByClassName"><a href=
"#getelementsbyclassname">getElementsByClassName()</a></code>
method would return when passed the same argument(s), excluding any
elements that are not descendants of the <code><a href=
"#htmlelement">HTMLElement</a></code> object on which the method
was invoked.</p>
<p>HTML, SVG, and MathML elements define which classes they are in
by having an attribute in the per-element partition with the name
<code title="">class</code> containing a space-separated list of
classes to which the element belongs. Other specifications may also
allow elements in their namespaces to be <del class=
"diff-old">labelled</del> <ins class="diff-chg">labeled</ins> as
being in specific classes. UAs must not assume that all attributes
of the name <code title="">class</code> for elements in any
namespace work in this way, however, and must not assume that such
attributes, when used as global attributes, label other elements as
being in specific classes.</p>
<div class="example">
<p>Given the following XHTML fragment:</p>
<pre>
<div id="example">
<p id="p1" class="aaa bbb"/>
<p id="p2" class="aaa ccc"/>
<p id="p3" class="bbb ccc"/>
</div>
</pre>
<p>A call to
<code>document.getElementById('example').getElementsByClassName('aaa')</code>
would return a <code>NodeList</code> with the two paragraphs
<code>p1</code> and <code>p2</code> in it.</p>
<p>A call to <code>getElementsByClassName('ccc bbb')</code>
would only return one node, however, namely <code>p3</code> . A
call to
<code>document.getElementById('example').getElementsByClassName('bbb ccc ')</code>
would return the same thing.</p>
<p>A call to <code>getElementsByClassName('aaa,bbb')</code> would
return no nodes; none of the elements above are in the "aaa,bbb"
class.</p>
</div>
<p class="note">The <code title="dom-document-dir"><a href=
"#dir1">dir</a></code> attribute on the <code><a href=
"#htmldocument">HTMLDocument</a></code> interface is defined along
with the <code title="attr-dir"><a href="#dir">dir</a></code>
content attribute.</p>
<h3 id="dynamic"><span class="secno"><del class=
"diff-old">2.5.</del> <ins class="diff-chg">2.5</ins></span>
<dfn id="dynamic2">Dynamic markup insertion</dfn></h3>
<p>The <code title="dom-document-write"><a href=
"#document.write">document.write()</a></code> family of methods and
the <code title="dom-innerHTML"><a href=
"#innerhtml">innerHTML</a></code> family of DOM attributes enable
script authors to dynamically insert markup into the document.</p>
<p class="issue">bz argues that innerHTML should be called
something else on XML documents and XML elements. Is the sanity
worth the migration pain?</p>
<p>Because these APIs interact with the parser, their <del class=
"diff-old">behaviour</del> <ins class="diff-chg">behavior</ins>
varies depending on whether they are used with <a href=
"#html-">HTML documents</a> (and the <a href="#html-0">HTML
parser</a> ) or XHTML in <a href="#xml-documents">XML documents</a>
(and the <span>XML parser</span> ). The following table
cross-references the various versions of these APIs.</p>
<table>
<thead>
<tr>
<td></td>
<th><dfn id="document.write" title=
"dom-document-write"><code>document.write()</code></dfn></th>
<th><dfn id="innerhtml" title=
"dom-innerHTML"><code>innerHTML</code></dfn></th>
</tr>
</thead>
<tbody>
<tr>
<th>For documents that are <a href="#html-">HTML documents</a></th>
<td><a href="#document.write..." title=
"dom-document-write-HTML"><code>document.write()</code> in
HTML</a></td>
<td><a href="#innerhtml0" title=
"dom-innerHTML-HTML"><code>innerHTML</code> in HTML</a></td>
</tr>
<tr>
<th>For documents that are <a href="#xml-documents">XML
documents</a></th>
<td><a href="#document.write0" title=
"dom-document-write-XML"><code>document.write()</code> in
XML</a></td>
<td><a href="#innerhtml1" title=
"dom-innerHTML-XML"><code>innerHTML</code> in XML</a></td>
</tr>
</tbody>
</table>
<p>Regardless of the parsing mode, the <dfn id=
"document.writeln..." title=
"dom-document-writeln"><code>document.writeln(...)</code></dfn>
method must call the <code title="dom-document-write"><a href=
"#document.write">document.write()</a></code> method with the same
argument(s), and then call the <code title=
"dom-document-write"><a href=
"#document.write">document.write()</a></code> method with, as its
argument, a string consisting of a single line feed character
(U+000A).</p>
<h4 id="controlling"><span class="secno"><del class=
"diff-old">2.5.1.</del> <ins class="diff-chg">2.5.1</ins></span>
Controlling the input stream</h4>
<p>The <dfn id="open" title=
"dom-document-open"><code>open()</code></dfn> method comes in
several variants with different numbers of arguments.</p>
<p>When called with two or fewer arguments, the method must act as
follows:</p>
<ol>
<li>
<p>Let <var title="">type</var> be the value of the first argument,
if there is one, or " <code>text/html</code> " otherwise.</p>
</li>
<li>
<p>Let <var title="">replace</var> be true if there is a second
argument and it has the value "replace" , and false otherwise.</p>
</li>
<li>
<p>If the document has an <span>active parser</span> that isn't a
<a href="#script-created">script-created parser</a> , and the
<a href="#insertion">insertion point</a> associated with that
parser's <a href="#input0">input stream</a> is not undefined (that
is, it <em>does</em> point to somewhere in the input stream), then
the method does nothing. Abort these steps and return the
<code>Document</code> object on which the method was invoked.</p>
<p class="note">This basically causes <code title=
"dom-document-open"><a href="#open">document.open()</a></code> to
be ignored when it's called in an inline script found during the
parsing of data sent over the network, while still letting it have
an effect when called asynchronously or on a document that is
itself being spoon-fed using these APIs.</p>
</li>
<li>
<p class="big-issue">onbeforeunload, <del class=
"diff-old">onunload</del> <ins class="diff-chg">onunload, reset
timers, empty event queue, kill any pending transactions,
XMLHttpRequests, etc</ins></p>
</li>
<li>
<p>If the document has an <span>active parser</span> , then stop
that parser, and throw away any pending content in the input
stream. <span class="big-issue">what about if it doesn't, because
it's either like a text/plain, or Atom, or PDF, or XHTML, or image
document, or something?</span></p>
</li>
<li>
<p>Remove all child nodes of the document.</p>
</li>
<li>
<p><ins class="diff-new">Change the</ins> <a href=
"#character1"><ins class="diff-new">document's character
encoding</ins></a> <ins class="diff-new">to UTF-16.</ins></p>
</li>
<li>
<p>Create a new <a href="#html-0">HTML parser</a> and associate it
with the document. This is a <dfn id=
"script-created">script-created parser</dfn> (meaning that it can
be closed by the <code title="dom-document-open"><a href=
"#open">document.open()</a></code> and <code title=
"dom-document-close"><a href="#close">document.close()</a></code>
methods, and that the tokeniser will wait for an explicit call to
<code title="dom-document-close"><a href=
"#close">document.close()</a></code> before emitting an end-of-file
token).</p>
</li>
<li>Mark the document as being an <a href="#html-" title=
"HTML documents">HTML document</a> (it might already be
so-marked).</li>
<li>
<p>If <var title="">type</var> does not have the value "
<code>text/html</code> " , then act as if the tokeniser had emitted
a <code><a href="#pre">pre</a></code> element start tag, then set
the <a href="#html-0">HTML parser</a> 's <a href=
"#tokenisation0">tokenisation</a> stage's <a href=
"#content2">content model flag</a> to <em>PLAINTEXT</em> .</p>
</li>
<li>
<p>If <var title="">replace</var> is false, then:</p>
<ol>
<li>Remove all the entries in the <a href="#browsing1">browsing
context</a> 's <a href="#session">session history</a> after the
<a href="#current1">current entry</a> in its <code>Document</code>
's <code><a href="#history2">History</a></code> object</li>
<li>Remove any earlier entries that share the same
<code>Document</code></li>
<li>Add a new entry just before the last entry that is associated
with the text that was parsed by the previous parser associated
with the <code>Document</code> object, as well as the state of the
document at the start of these steps. (This allows the user to step
backwards in the session history to see the page before it was
blown away by the <code title="dom-document-open"><a href=
"#open">document.open()</a></code> call.)</li>
</ol>
</li>
<li>
<p>Finally, set the <a href="#insertion">insertion point</a> to
point at just before the end of the <a href="#input0">input
stream</a> (which at this point will be empty).</p>
</li>
<li>
<p>Return the <code>Document</code> on which the method was
invoked.</p>
</li>
</ol>
<p class="big-issue">We shouldn't hard-code <code>text/plain</code>
there. We should do it some other way, e.g. hand off to the section
on content-sniffing and handling of incoming data streams, the part
that defines how this all works when stuff comes over the
network.</p>
<p>When called with three or more arguments, the <code title=
"dom-document-open"><a href="#open">open()</a></code> method on the
<code><a href="#htmldocument">HTMLDocument</a></code> object must
call the <code title="dom-open"><a href="#open2">open()</a></code>
method on the <code><a href="#window">Window</a></code> interface
of the object returned by the <code title=
"dom-document-defaultView">defaultView</code> attribute of the
<code>DocumentView</code> interface of the <code><a href=
"#htmldocument">HTMLDocument</a></code> object, with the same
arguments as the original call to the <code title=
"dom-document-open"><a href="#open">open()</a></code> method, and
return whatever that method returned. If the <code title=
"dom-document-defaultView">defaultView</code> attribute of the
<code>DocumentView</code> interface of the <code><a href=
"#htmldocument">HTMLDocument</a></code> object is null, then the
method must raise an <code>INVALID_ACCESS_ERR</code> exception.</p>
<p>The <dfn id="close" title=
"dom-document-close"><code>close()</code></dfn> method must do
nothing if there is no <a href="#script-created">script-created
parser</a> associated with the document. If there is such a parser,
then, when the method is called, the user agent must insert an
<a href="#explicit0">explicit "EOF" character</a> at the <a href=
"#insertion">insertion point</a> of the parser's <a href=
"#input0">input stream</a> .</p>
<h4 id="dynamic0"><span class="secno"><del class=
"diff-old">2.5.2.</del> <ins class="diff-chg">2.5.2</ins></span>
Dynamic markup insertion in HTML</h4>
<p>In HTML, the <dfn id="document.write..." title=
"dom-document-write-HTML"><code>document.write(...)</code></dfn>
method must act as follows:</p>
<ol>
<li>
<p>If the <a href="#insertion">insertion point</a> is undefined,
the <code title="dom-document-open"><a href=
"#open">open()</a></code> method must be called (with no arguments)
on the <code title="Document">document</code> object. The <a href=
"#insertion">insertion point</a> will point at just before the end
of the (empty) <a href="#input0">input stream</a> .</p>
</li>
<li>
<p>The string consisting of the concatenation of all the arguments
to the method must be inserted into the <a href="#input0">input
stream</a> just before the <a href="#insertion">insertion point</a>
.</p>
</li>
<li>
<p>If there is <a href="#the-script" title=
"the script that will execute as soon as the parser resumes">a
script that will execute as soon as the parser resumes</a> , then
the method must now return without further processing of the
<a href="#input0">input stream</a> .</p>
</li>
<li>
<p>Otherwise, the tokeniser must process the characters that were
inserted, one at a time, processing resulting tokens as they are
emitted, and stopping when the tokeniser reaches the insertion
point or when the processing of the tokeniser is aborted by the
tree construction stage (this can happen if a <code><a href=
"#script1">script</a></code> start tag token is emitted by the
tokeniser).</p>
<p class="note">If the <code title=
"dom-document-write-HTML"><a href=
"#document.write...">document.write()</a></code> method was called
from script executing inline (i.e. executing because the parser
parsed a set of <code><a href="#script1">script</a></code> tags),
then this is a <a href="#nestedParsing">reentrant invocation of the
parser</a> .</p>
</li>
<li>
<p>Finally, the method must return.</p>
</li>
</ol>
<p>In HTML, the <dfn id="innerhtml0" title=
"dom-innerHTML-HTML"><code>innerHTML</code></dfn> DOM attribute of
all <code><a href="#htmlelement">HTMLElement</a></code> and
<code><a href="#htmldocument">HTMLDocument</a></code> nodes returns
a <del class="diff-old">serialisation</del> <ins class=
"diff-chg">serialization</ins> of the node's children using the
<span>HTML syntax</span> . On setting, it replaces the node's
children with new nodes that result from parsing the given value.
The formal definitions follow.</p>
<p>On getting, the <code title="dom-innerHTML-HTML"><a href=
"#innerhtml0">innerHTML</a></code> DOM attribute must return the
result of running the <a href="#html-fragment">HTML fragment
<del class="diff-old">serialisation</del> <ins class=
"diff-chg">serialization</ins> algorithm</a> on the node.</p>
<p>On setting, if the node is a document, the <code title=
"dom-innerHTML-HTML"><a href="#innerhtml0">innerHTML</a></code> DOM
attribute must run the following algorithm:</p>
<ol>
<li>
<p>If the document has an <span>active parser</span> , then stop
that parser, and throw away any pending content in the input
stream. <span class="big-issue">what about if it doesn't, because
it's either like a text/plain, or Atom, or PDF, or XHTML, or image
document, or something?</span></p>
</li>
<li>
<p>Remove the children nodes of the <code>Document</code> whose
<code title="dom-innerHTML-HTML"><a href=
"#innerhtml0">innerHTML</a></code> attribute is being set.</p>
</li>
<li>
<p>Create a new <a href="#html-0">HTML parser</a> , in its initial
state, and associate it with the <code>Document</code> node.</p>
</li>
<li>
<p>Place into the <a href="#input0">input stream</a> for the
<a href="#html-0">HTML parser</a> just created the string being
assigned into the <code title="dom-innerHTML-HTML"><a href=
"#innerhtml0">innerHTML</a></code> attribute.</p>
</li>
<li>
<p>Start the parser and let it run until it has consumed all the
characters just inserted into the input stream. (The
<code>Document</code> node will have been populated with elements
and a <code title="event-load"><a href="#load0">load</a></code>
event will have fired on <a href="#the-body1" title=
"the body element">its body element</a> .)</p>
</li>
</ol>
<p>Otherwise, if the node is an element, then setting the
<code title="dom-innerHTML-HTML"><a href=
"#innerhtml0">innerHTML</a></code> DOM attribute must cause the
following algorithm to run instead:</p>
<ol>
<li>
<p>Invoke the <a href="#html-fragment0">HTML fragment parsing
algorithm</a> , with the element whose <code title=
"dom-innerHTML-HTML"><a href="#innerhtml0">innerHTML</a></code>
attribute is being set as the <var title="">context</var>
<ins class="diff-new">element,</ins> and the string being assigned
into the <code title="dom-innerHTML-HTML"><a href=
"#innerhtml0">innerHTML</a></code> attribute as the <var title=
"">input</var> . Let <var title="">new children</var> be the result
of this algorithm.</p>
</li>
<li>
<p>Remove the children of the element whose <code title=
"dom-innerHTML-HTML"><a href="#innerhtml0">innerHTML</a></code>
attribute is being set.</p>
</li>
<li>
<p>Let <var title="">target document</var> be the <code title=
"">ownerDocument</code> of the <code>Element</code> node whose
<code title="dom-innerHTML-HTML"><a href=
"#innerhtml0">innerHTML</a></code> attribute is being set.</p>
</li>
<li>
<p>Set the <code title="">ownerDocument</code> of all the nodes in
<var title="">new children</var> to the <var title="">target
document</var> .</p>
</li>
<li>
<p>Append all the <var title="">new children</var> nodes to the
node whose <code title="dom-innerHTML-HTML"><a href=
"#innerhtml0">innerHTML</a></code> attribute is being set,
preserving their order.</p>
</li>
</ol>
<p class="note"><code><a href="#script1">script</a></code> elements
inserted using <code title="dom-innerHTML-HTML"><a href=
"#innerhtml0">innerHTML</a></code> do not execute when they are
inserted.</p>
<h4 id="dynamic1"><span class="secno"><del class=
"diff-old">2.5.3.</del> <ins class="diff-chg">2.5.3</ins></span>
Dynamic markup insertion in XML</h4>
<p>In an XML context, the <dfn id="document.write0" title=
"dom-document-write-XML"><code>document.write()</code></dfn> method
must raise an <code>INVALID_ACCESS_ERR</code> exception.</p>
<p>On the other hand, however, the <dfn id="innerhtml1" title=
"dom-innerHTML-XML"><code>innerHTML</code></dfn> attribute is
indeed usable in an XML context.</p>
<p>In an XML context, the <code title="dom-innerHTML-XML"><a href=
"#innerhtml1">innerHTML</a></code> DOM attribute on <code><a href=
"#htmlelement">HTMLElement</a></code> s <ins class="diff-new">must
return a string in the form of an</ins> <a href=
"http://www.w3.org/TR/xml/#wf-entities"><ins class=
"diff-new">internal general parsed entity</ins></a> , and
<ins class="diff-new">on</ins> <code><a href=
"#htmldocument">HTMLDocument</a></code> <del class="diff-old">s, on
getting,</del> <ins class="diff-chg">s</ins> must return a string
in the form of <del class="diff-old">an internal general
parsed</del> <ins class="diff-chg">a</ins> <a href=
"http://www.w3.org/TR/xml/#sec-well-formed"><ins class=
"diff-chg">document</ins> entity <del class="diff-old">that is XML
namespace-well-formed, the</del></a> . <ins class=
"diff-chg">The</ins> string <del class="diff-old">being</del>
<ins class="diff-chg">returned must be XML namespace-well-formed
and must be</ins> an isomorphic <del class=
"diff-old">serialisation</del> <ins class=
"diff-chg">serialization</ins> of all of that node's child nodes,
in document order. User agents may adjust prefixes and namespace
declarations in the <del class="diff-old">serialisation</del>
<ins class="diff-chg">serialization</ins> (and indeed might be
forced to do so in some cases to obtain namespace-well-formed XML).
<ins class="diff-new">If any of the elements in the serialization
are in no namespace, the default namespace in scope for those
elements must be explicitly declared as the empty string.</ins>
<a href="#references">[XML]</a> <a href=
"#references">[XMLNS]</a></p>
<p>If any of the following cases are found in the DOM being
<del class="diff-old">serialised,</del> <ins class=
"diff-chg">serialized,</ins> the user agent must raise an
<code>INVALID_STATE_ERR</code> exception:</p>
<ul>
<li>A <code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">node with no child element nodes.</ins></li>
<li><ins class="diff-new">A</ins> <code>DocumentType</code> node
that has an external subset public identifier or an external subset
system identifier that contains both a U+0022 QUOTATION MARK ('"')
and a U+0027 APOSTROPHE ("'").</li>
<li>A node with a prefix or local name containing a U+003A COLON
(":").</li>
<li><del class="diff-old">A</del> <ins class="diff-chg">An</ins>
<code><ins class="diff-chg">Attr</ins></code> <ins class=
"diff-chg">node,</ins> <code>Text</code> <ins class=
"diff-new">node,</ins> <code><ins class=
"diff-new">CDATASection</ins></code> <ins class=
"diff-new">node,</ins> <code><ins class=
"diff-new">Comment</ins></code> <ins class="diff-new">node,
or</ins> <code><ins class=
"diff-new">ProcessingInstruction</ins></code> node whose data
contains characters that are not matched by the XML <code title=
"">Char</code> production. <a href="#references">[XML]</a></li>
<li>A <code>CDATASection</code> node whose data contains the string
" <code title="">]]></code> ".</li>
<li>A <code>Comment</code> node whose data contains two adjacent
U+002D HYPHEN-MINUS (-) characters or ends with such a
character.</li>
<li>A <code>ProcessingInstruction</code> node whose target name is
the string " <code title="">xml</code> " (case insensitively)
.</li>
<li>A <code>ProcessingInstruction</code> node whose target name
contains a U+003A COLON (":").</li>
<li>A <code>ProcessingInstruction</code> node whose data contains
the string " <code title="">?></code> ".</li>
</ul>
<p class="note">These are the only ways to make a DOM <del class=
"diff-old">unserialisable.</del> <ins class=
"diff-chg">unserializable.</ins> The DOM enforces all the other XML
constraints; for example, trying to set an attribute with a name
that contains an equals sign (=) will raised an
<code>INVALID_CHARACTER_ERR</code> exception.</p>
<p>On setting, in an XML context, the <code title=
"dom-innerHTML-XML"><a href="#innerhtml1">innerHTML</a></code> DOM
attribute on <code><a href="#htmlelement">HTMLElement</a></code> s
and <code><a href="#htmldocument">HTMLDocument</a></code> s must
run the following algorithm:</p>
<ol>
<li>
<p>The user agent must create a new <span>XML parser</span> .</p>
</li>
<li>
<p>If the <code title="dom-innerHTML-XML"><a href=
"#innerhtml1">innerHTML</a></code> attribute is being set on an
element, the user agent must <span>feed the parser</span> just
created the string corresponding to the start tag of that element,
declaring all the namespace prefixes that are in scope on that
element in the DOM, as well as declaring the default namespace (if
any) that is in scope on that element in the DOM.</p>
</li>
<li>
<p>The user agent must <span>feed the parser</span> just created
the string being assigned into the <code title=
"dom-innerHTML-XML"><a href="#innerhtml1">innerHTML</a></code>
attribute.</p>
</li>
<li>
<p>If the <code title="dom-innerHTML-XML"><a href=
"#innerhtml1">innerHTML</a></code> attribute is being set on an
element, the user agent must <span>feed the parser</span> the
string corresponding to the end tag of that element.</p>
</li>
<li>
<p>If the parser found a well-formedness error, the attribute's
setter must raise a <code>SYNTAX_ERR</code> exception and abort
these steps.</p>
</li>
<li>
<p>The user agent must remove the children nodes of the node whose
<code title="dom-innerHTML-XML"><a href=
"#innerhtml1">innerHTML</a></code> attribute is being set.</p>
</li>
<li>
<p>If the attribute is being set on a <code>Document</code> node,
let <var title="">new children</var> be the children of the
document, preserving their order. Otherwise, the attribute is being
set on an <code>Element</code> node; let <var title="">new
children</var> be the children of the <del class=
"diff-old">the</del> document's root element, preserving their
order.</p>
</li>
<li>
<p>If the attribute is being set on a <code>Document</code> node,
let <var title="">target document</var> be that
<code>Document</code> node. Otherwise, the attribute is being set
on an <code>Element</code> node; let <var title="">target
document</var> be the <code title="">ownerDocument</code> of that
<code>Element</code> .</p>
</li>
<li>
<p>Set the <code title="">ownerDocument</code> of all the nodes in
<var title="">new children</var> to the <var title="">target
document</var> .</p>
</li>
<li>
<p>Append all the <var title="">new children</var> nodes to the
node whose <code title="dom-innerHTML-XML"><a href=
"#innerhtml1">innerHTML</a></code> attribute is being set,
preserving their order.</p>
</li>
</ol>
<p class="note"><code><a href="#script1">script</a></code> elements
inserted using <code title="dom-innerHTML-XML"><a href=
"#innerhtml1">innerHTML</a></code> do not execute when they are
inserted.</p>
<h3 id="apis-in"><span class="secno"><del class=
"diff-old">2.6.</del> <ins class="diff-chg">2.6</ins></span> APIs
in HTML documents</h3>
<p>For <a href="#html-">HTML documents</a> , and for <a href=
"#html-elements">HTML elements</a> in <a href="#html-">HTML
documents</a> , certain APIs defined in DOM3 Core become
case-insensitive or case-changing, as sometimes defined in DOM3
Core, and as <del class="diff-old">summarised</del> <ins class=
"diff-chg">summarized</ins> or required below. <a href=
"#references">[DOM3CORE]</a> .</p>
<p>This does not apply to <a href="#xml-documents">XML
documents</a> or to elements that are not in the <a href=
"#html-namespace0">HTML namespace</a> despite being in <a href=
"#html-">HTML documents</a> .</p>
<dl>
<dt><code title="">Element.tagName</code> , <code title=
"">Node.nodeName</code> , and <code title=
"">Node.localName</code></dt>
<dd>
<p>These attributes return tag names in all uppercase and attribute
names in all lowercase, regardless of the case with which they were
created.</p>
</dd>
<dt><code title="">Document.createElement()</code></dt>
<dd>
<p>The canonical form of HTML markup is all-lowercase; thus, this
method will lowercase the argument before creating the requisite
element. Also, the element created must be in the <a href=
"#html-namespace0">HTML namespace</a> .</p>
<p class="note">This doesn't apply to <code title=
"">Document.createElementNS()</code> . Thus, it is possible, by
passing this last method a tag name in the wrong case, to create an
element that claims to have the tag name of an element defined in
this specification, but doesn't support its interfaces, because it
really has another tag name not accessible from the DOM APIs.</p>
</dd>
<dt><code title="">Element.setAttributeNode()</code></dt>
<dd>
<p>When an <code>Attr</code> node is set on an <a href=
"#html-elements" title="HTML elements">HTML element</a> , it must
have its name lowercased before the element is affected.</p>
<p class="note">This doesn't apply to <code title=
"">Document.setAttributeNodeNS()</code> .</p>
</dd>
<dt><code title="">Element.setAttribute()</code></dt>
<dd>
<p>When an attribute is set on an <a href="#html-elements" title=
"HTML elements">HTML element</a> , the name argument must be
lowercased before the element is affected.</p>
<p class="note">This doesn't apply to <code title=
"">Document.setAttributeNS()</code> .</p>
</dd>
<dt><code title="">Document.getElementsByTagName()</code> and
<code title="">Element.getElementsByTagName()</code></dt>
<dd>
<p>These methods (but not their namespaced counterparts) must
compare the given argument case-insensitively when looking at
<a href="#html-elements" title="HTML elements">HTML elements</a> ,
and case-sensitively otherwise.</p>
<p class="note">Thus, in an <a href="#html-" title=
"HTML documents">HTML document</a> with nodes in multiple
namespaces, these methods will be both case-sensitive and
case-insensitive at the same time.</p>
</dd>
<dt><code title="">Document.renameNode()</code></dt>
<dd>
<p>If the new namespace is the <a href="#html-namespace0">HTML
namespace</a> , then the new qualified name must be lowercased
before the rename takes place.</p>
</dd>
</dl>
<h2 id="semantics"><span class="secno">3.</span> Semantics and
structure of HTML elements</h2>
<h3 id="semantics-intro"><span class="secno"><del class=
"diff-old">3.1.</del> <ins class="diff-chg">3.1</ins></span>
Introduction</h3>
<p><em>This section is non-normative.</em></p>
<p class="big-issue">An introduction to marking up a document.</p>
<h3 id="common1"><span class="secno"><del class=
"diff-old">3.2.</del> <ins class="diff-chg">3.2</ins></span> Common
microsyntaxes</h3>
<p>There are various places in HTML that accept particular data
types, such as dates or numbers. This section describes what the
conformance criteria for content in those formats is, and how to
parse them.</p>
<p class="big-issue">Need to go through the whole spec and make
sure all the attribute values are clearly defined either in terms
of microsyntaxes or in terms of other specs, or as "Text" or some
such.</p>
<h4 id="common2"><span class="secno"><del class=
"diff-old">3.2.1.</del> <ins class="diff-chg">3.2.1</ins></span>
Common parser idioms</h4>
<p>The <dfn id="space" title="space character">space
characters</dfn> , for the purposes of this specification, are
U+0020 SPACE, U+0009 CHARACTER TABULATION (tab), U+000A LINE FEED
(LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), and U+000D
CARRIAGE RETURN (CR).</p>
<p>Some of the micro-parsers described below follow the pattern of
having an <var title="">input</var> variable that holds the string
being parsed, and having a <var title="">position</var> variable
pointing at the next character to parse in <var title=
"">input</var> .</p>
<p>For parsers based on this pattern, a step that requires the user
agent to <dfn id="collect">collect a sequence of characters</dfn>
means that the following algorithm must be run, with <var title=
"">characters</var> being the set of characters that can be
collected:</p>
<ol>
<li>
<p>Let <var title="">input</var> and <var title="">position</var>
be the same variables as those of the same name in the algorithm
that invoked these steps.</p>
</li>
<li>
<p>Let <var title="">result</var> be the empty string.</p>
</li>
<li>
<p>While <var title="">position</var> doesn't point past the end of
<var title="">input</var> and the character at <var title=
"">position</var> is one of the <var title="">characters</var> ,
append that character to the end of <var title="">result</var> and
advance <var title="">position</var> to the next character in
<var title="">input</var> .</p>
</li>
<li>
<p>Return <var title="">result</var> .</p>
</li>
</ol>
<p>The step <dfn id="skip-whitespace">skip whitespace</dfn> means
that the user agent must <a href="#collect">collect a sequence of
characters</a> that are <a href="#space" title=
"space character">space characters</a> . The step <dfn id=
"skip-">skip Zs characters</dfn> means that the user agent must
<a href="#collect">collect a sequence of characters</a> that are in
the Unicode character class Zs. In both cases, the collected
characters are not used. <a href="#references">[UNICODE]</a></p>
<h4 id="boolean"><span class="secno"><del class=
"diff-old">3.2.2.</del> <ins class="diff-chg">3.2.2</ins></span>
Boolean attributes</h4>
<p>A number of attributes in HTML5 are <dfn id="boolean0" title=
"boolean attribute">boolean attributes</dfn> . The presence of a
boolean attribute on an element represents the true value, and the
absence of the attribute represents the false value.</p>
<p>If the attribute is present, its value must either be the empty
string or <ins class="diff-new">a value that is a case-insensitive
match for</ins> the attribute's canonical name, <del class=
"diff-old">exactly,</del> with no leading or trailing <del class=
"diff-old">whitespace, and in lowercase.</del> <ins class=
"diff-chg">whitespace.</ins></p>
<h4 id="numbers"><span class="secno"><del class=
"diff-old">3.2.3.</del> <ins class="diff-chg">3.2.3</ins></span>
Numbers</h4>
<h5 id="unsigned"><span class="secno">3.2.3.1.</span> Unsigned
integers</h5>
<p>A string is a <dfn id="valid">valid non-negative integer</dfn>
if it consists of one of more characters in the range U+0030 DIGIT
ZERO (0) to U+0039 DIGIT NINE (9).</p>
<p>The <dfn id="rules">rules for parsing non-negative
integers</dfn> are as given in the following algorithm. When
invoked, the steps must be followed in the order given, aborting at
the first step that returns a value. This algorithm will either
return zero, a positive integer, or an error. Leading spaces are
ignored. Trailing spaces and indeed any trailing garbage characters
are ignored.</p>
<ol>
<li>
<p>Let <var title="">input</var> be the string being parsed.</p>
</li>
<li>
<p>Let <var title="">position</var> be a pointer into <var title=
"">input</var> , initially pointing at the start of the string.</p>
</li>
<li>
<p>Let <var title="">value</var> have the value 0.</p>
</li>
<li>
<p><a href="#skip-whitespace">Skip whitespace.</a></p>
</li>
<li>
<p>If <var title="">position</var> is past the end of <var title=
"">input</var> , return an error.</p>
</li>
<li>
<p>If the next character is not one of U+0030 DIGIT ZERO (0) ..
U+0039 DIGIT NINE (9), then return an error.</p>
</li>
<li>
<p>If the next character is one of U+0030 DIGIT ZERO (0) .. U+0039
DIGIT NINE (9):</p>
<ol>
<li>Multiply <var title="">value</var> by ten.</li>
<li>Add the value of the current character (0..9) to <var title=
"">value</var> .</li>
<li>Advance <var title="">position</var> to the next
character.</li>
<li>If <var title="">position</var> is not past the end of
<var title="">input</var> , return to the top of step 7 in the
overall algorithm (that's the step within which these substeps find
themselves).</li>
</ol>
</li>
<li>
<p>Return <var title="">value</var> .</p>
</li>
</ol>
<h5 id="signed"><span class="secno">3.2.3.2.</span> Signed
integers</h5>
<p>A string is a <dfn id="valid0">valid integer</dfn> if it
consists of one of more characters in the range U+0030 DIGIT ZERO
(0) to U+0039 DIGIT NINE (9), optionally prefixed with a U+002D
HYPHEN-MINUS ("-") character.</p>
<p>The <dfn id="rules0">rules for parsing integers</dfn> are
similar to the rules for non-negative integers, and are as given in
the following algorithm. When invoked, the steps must be followed
in the order given, aborting at the first step that returns a
value. This algorithm will either return an integer or an error.
Leading spaces are ignored. Trailing spaces and trailing garbage
characters are ignored.</p>
<ol>
<li>
<p>Let <var title="">input</var> be the string being parsed.</p>
</li>
<li>
<p>Let <var title="">position</var> be a pointer into <var title=
"">input</var> , initially pointing at the start of the string.</p>
</li>
<li>
<p>Let <var title="">value</var> have the value 0.</p>
</li>
<li>
<p>Let <var title="">sign</var> have the value "positive".</p>
</li>
<li>
<p><a href="#skip-whitespace">Skip whitespace.</a></p>
</li>
<li>
<p>If <var title="">position</var> is past the end of <var title=
"">input</var> , return an error.</p>
</li>
<li>
<p>If the character indicated by <var title="">position</var> (the
first character) is a U+002D HYPHEN-MINUS ("-") character:</p>
<ol>
<li>Let <var title="">sign</var> be "negative".</li>
<li>Advance <var title="">position</var> to the next
character.</li>
<li>If <var title="">position</var> is past the end of <var title=
"">input</var> , return an error.</li>
</ol>
</li>
<li>
<p>If the next character is not one of U+0030 DIGIT ZERO (0) ..
U+0039 DIGIT NINE (9), then return an error.</p>
</li>
<li>
<p>If the next character is one of U+0030 DIGIT ZERO (0) .. U+0039
DIGIT NINE (9):</p>
<ol>
<li>Multiply <var title="">value</var> by ten.</li>
<li>Add the value of the current character (0..9) to <var title=
"">value</var> .</li>
<li>Advance <var title="">position</var> to the next
character.</li>
<li>If <var title="">position</var> is not past the end of
<var title="">input</var> , return to the top of step 9 in the
overall algorithm (that's the step within which these substeps find
themselves).</li>
</ol>
</li>
<li>
<p>If <var title="">sign</var> is "positive", return <var title=
"">value</var> , otherwise return 0- <var title="">value</var>
.</p>
</li>
</ol>
<h5 id="real-numbers"><span class="secno">3.2.3.3.</span> Real
numbers</h5>
<p>A string is a <dfn id="valid1">valid floating point number</dfn>
if it consists of one of more characters in the range U+0030 DIGIT
ZERO (0) to U+0039 DIGIT NINE (9), optionally with a single U+002E
FULL STOP (".") character somewhere (either before these numbers,
in between two numbers, or after the numbers), all optionally
prefixed with a U+002D HYPHEN-MINUS ("-") character.</p>
<p>The <dfn id="rules1">rules for parsing floating point number
values</dfn> are as given in the following algorithm. As with the
previous algorithms, when this one is invoked, the steps must be
followed in the order given, aborting at the first step that
returns a value. This algorithm will either return a number or an
error. Leading spaces are ignored. Trailing spaces and garbage
characters are ignored.</p>
<ol>
<li>
<p>Let <var title="">input</var> be the string being parsed.</p>
</li>
<li>
<p>Let <var title="">position</var> be a pointer into <var title=
"">input</var> , initially pointing at the start of the string.</p>
</li>
<li>
<p>Let <var title="">value</var> have the value 0.</p>
</li>
<li>
<p>Let <var title="">sign</var> have the value "positive".</p>
</li>
<li>
<p><a href="#skip-whitespace">Skip whitespace.</a></p>
</li>
<li>
<p>If <var title="">position</var> is past the end of <var title=
"">input</var> , return an error.</p>
</li>
<li>
<p>If the character indicated by <var title="">position</var> (the
first character) is a U+002D HYPHEN-MINUS ("-") character:</p>
<ol>
<li>Let <var title="">sign</var> be "negative".</li>
<li>Advance <var title="">position</var> to the next
character.</li>
<li>If <var title="">position</var> is past the end of <var title=
"">input</var> , return an error.</li>
</ol>
</li>
<li>
<p>If the next character is not one of U+0030 DIGIT ZERO (0) ..
U+0039 DIGIT NINE (9) or U+002E FULL STOP ("."), then return an
error.</p>
</li>
<li>
<p>If the next character is U+002E FULL STOP ("."), but either that
is the last character or the character after that one is not one of
U+0030 DIGIT ZERO (0) .. U+0039 DIGIT NINE (9), then return an
error.</p>
</li>
<li>
<p>If the next character is one of U+0030 DIGIT ZERO (0) .. U+0039
DIGIT NINE (9):</p>
<ol>
<li>Multiply <var title="">value</var> by ten.</li>
<li>Add the value of the current character (0..9) to <var title=
"">value</var> .</li>
<li>Advance <var title="">position</var> to the next
character.</li>
<li>If <var title="">position</var> is past the end of <var title=
"">input</var> , then if <var title="">sign</var> is "positive",
return <var title="">value</var> , otherwise return 0- <var title=
"">value</var> .</li>
<li>Otherwise return to the top of step 10 in the overall algorithm
(that's the step within which these substeps find themselves).</li>
</ol>
</li>
<li>
<p>Otherwise, if the next character is not a U+002E FULL STOP
("."), then if <var title="">sign</var> is "positive", return
<var title="">value</var> , otherwise return 0- <var title=
"">value</var> .</p>
</li>
<li>
<p>The next character is a U+002E FULL STOP ("."). Advance
<var title="">position</var> to the character after that.</p>
</li>
<li>
<p>Let <var title="">divisor</var> be 1.</p>
</li>
<li>
<p>If the next character is one of U+0030 DIGIT ZERO (0) .. U+0039
DIGIT NINE (9):</p>
<ol>
<li>Multiply <var title="">divisor</var> by ten.</li>
<li>Add the value of the current character (0..9) divided by
<var title="">divisor</var> , to <var title="">value</var> .</li>
<li>Advance <var title="">position</var> to the next
character.</li>
<li>If <var title="">position</var> is past the end of <var title=
"">input</var> , then if <var title="">sign</var> is "positive",
return <var title="">value</var> , otherwise return 0- <var title=
"">value</var> .</li>
<li>Otherwise return to the top of step 14 in the overall algorithm
(that's the step within which these substeps find themselves).</li>
</ol>
</li>
<li>
<p>Otherwise, if <var title="">sign</var> is "positive", return
<var title="">value</var> , otherwise return 0- <var title=
"">value</var> .</p>
</li>
</ol>
<h5 id="ratios"><span class="secno">3.2.3.4.</span> Ratios</h5>
<p class="note">The algorithms described in this section are used
by the <code><a href="#progress">progress</a></code> and
<code><a href="#meter">meter</a></code> elements.</p>
<p>A <dfn id="valid2">valid denominator punctuation character</dfn>
is one of the characters from the table below. There is <dfn id=
"a-value" title=
"values associated with denominator punctuation characters">a value
associated with each denominator punctuation character</dfn> , as
shown in the table below.</p>
<table>
<thead>
<tr>
<th colspan="2">Denominator Punctuation Character</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>U+0025 PERCENT SIGN</td>
<td>%</td>
<td>100</td>
</tr>
<tr>
<td>U+066A ARABIC PERCENT SIGN</td>
<td>٪</td>
<td>100</td>
</tr>
<tr>
<td>U+FE6A SMALL PERCENT SIGN</td>
<td>﹪</td>
<td>100</td>
</tr>
<tr>
<td>U+FF05 FULLWIDTH PERCENT SIGN</td>
<td>%</td>
<td>100</td>
</tr>
<tr>
<td>U+2030 PER MILLE SIGN</td>
<td>‰</td>
<td>1000</td>
</tr>
<tr>
<td>U+2031 PER TEN THOUSAND SIGN</td>
<td>‱</td>
<td>10000</td>
</tr>
</tbody>
</table>
<p>The <dfn id="steps">steps for finding one or two numbers of a
ratio in a string</dfn> are as follows:</p>
<ol>
<li>If the string is empty, then return nothing and abort these
steps.</li>
<li><a href="#find-a">Find a number</a> in the string according to
the algorithm below, starting at the start of the string.</li>
<li>If the sub-algorithm in step 2 returned nothing or returned an
error condition, return nothing and abort these steps.</li>
<li>Set <var title="">number1</var> to the number returned by the
sub-algorithm in step 2.</li>
<li>Starting with the character immediately after the last one
examined by the sub-algorithm in step 2, skip any characters in the
string that are in the Unicode character class Zs (this might match
zero characters). <a href="#references">[UNICODE]</a></li>
<li>If there are still further characters in the string, and the
next character in the string is a <a href="#valid2">valid
denominator punctuation character</a> , set <var title=
"">denominator</var> to that character.</li>
<li>If the string contains any other characters in the range U+0030
DIGIT ZERO to U+0039 DIGIT NINE, but <var title=
"">denominator</var> was given a value in the step 6, return
nothing and abort these steps.</li>
<li>Otherwise, if <var title="">denominator</var> was given a value
in step 6, return <var title="">number1</var> and <var title=
"">denominator</var> and abort these steps.</li>
<li><a href="#find-a">Find a number</a> in the string again,
starting immediately after the last character that was examined by
the sub-algorithm in step 2.</li>
<li>If the sub-algorithm in step 9 returned nothing or an error
condition, return nothing and abort these steps.</li>
<li>Set <var title="">number2</var> to the number returned by the
sub-algorithm in step 9.</li>
<li>If there are still further characters in the string, and the
next character in the string is a <a href="#valid2">valid
denominator punctuation character</a> , return nothing and abort
these steps.</li>
<li>If the string contains any other characters in the range U+0030
DIGIT ZERO to U+0039 DIGIT NINE, return nothing and abort these
steps.</li>
<li>Otherwise, return <var title="">number1</var> and <var title=
"">number2</var> .</li>
</ol>
<p>The algorithm to <dfn id="find-a">find a number</dfn> is as
follows. It is given a string and a starting position, and returns
either nothing, a number, or an error condition.</p>
<ol>
<li>Starting at the given starting position, ignore all characters
in the given string until the first character that is either a
U+002E FULL STOP or one of the ten characters in the range U+0030
DIGIT ZERO to U+0039 DIGIT NINE.</li>
<li>If there are no such characters, return nothing and abort these
steps.</li>
<li>Starting with the character matched in step 1, collect all the
consecutive characters that are either a U+002E FULL STOP or one of
the ten characters in the range U+0030 DIGIT ZERO to U+0039 DIGIT
NINE, and assign this string of one or more characters to
<var title="">string</var> .</li>
<li>If <var title="">string</var> contains more than one U+002E
FULL STOP character then return an error condition and abort these
steps.</li>
<li>Parse <var title="">string</var> according to the <a href=
"#rules1">rules for parsing floating point number values</a> , to
obtain <var title="">number</var> . This step cannot fail (
<var title="">string</var> is <del class=
"diff-old">guarenteed</del> <ins class="diff-chg">guaranteed</ins>
to be a <a href="#valid1">valid floating point number</a> ).</li>
<li>Return <var title="">number</var> .</li>
</ol>
<h5 id="percentages-and-dimensions"><span class=
"secno">3.2.3.5.</span> Percentages and dimensions</h5>
<p class="big-issue"><dfn id="valid3">valid positive non-zero
integers</dfn> <dfn id="rules2">rules for parsing dimension
values</dfn> (only used by height/width on img, embed, object —
lengths in css pixels or percentages)</p>
<h5 id="lists"><span class="secno">3.2.3.6.</span> Lists of
integers</h5>
<p>A <dfn id="valid4">valid list of integers</dfn> is a number of
<a href="#valid0" title="valid integer">valid integers</a>
separated by U+002C COMMA characters, with no other characters
(e.g. no <a href="#space" title="space character">space
characters</a> ). In addition, there might be restrictions on the
number of integers that can be given, or on the range of values
allowed.</p>
<p>The <dfn id="rules3">rules for parsing a list of integers</dfn>
are as follows:</p>
<ol>
<li>
<p>Let <var title="">input</var> be the string being parsed.</p>
</li>
<li>
<p>Let <var title="">position</var> be a pointer into <var title=
"">input</var> , initially pointing at the start of the string.</p>
</li>
<li>
<p>Let <var title="">numbers</var> be an initially empty list of
integers. This list will be the result of this algorithm.</p>
</li>
<li>
<p>If there is a character in the string <var title="">input</var>
at position <var title="">position</var> , and it is either
<del class="diff-old">U+002C COMMA character or</del> a U+0020
<del class="diff-old">SPACE</del> <ins class="diff-chg">SPACE,
U+002C COMMA, or U+003B SEMICOLON</ins> character, then advance
<var title="">position</var> to the next character in <var title=
"">input</var> , or to beyond the end of the string if there are no
more characters.</p>
</li>
<li>
<p>If <var title="">position</var> points to beyond the end of
<var title="">input</var> , return <var title="">numbers</var> and
abort.</p>
</li>
<li>
<p>If the character in the string <var title="">input</var> at
position <var title="">position</var> is a <ins class=
"diff-new">U+0020 SPACE,</ins> U+002C <del class="diff-old">COMMA
character</del> <ins class="diff-chg">COMMA,</ins> or <del class=
"diff-old">a U+0020 SPACE</del> <ins class="diff-chg">U+003B
SEMICOLON</ins> character, <ins class="diff-new">then</ins> return
to step 4.</p>
</li>
<li>
<p>Let <var title="">negated</var> be false.</p>
</li>
<li>
<p>Let <var title="">value</var> be 0.</p>
</li>
<li>
<p>Let <var title=""><del class="diff-old">multiple</del>
<ins class="diff-chg">started</ins></var> be <del class=
"diff-old">1.</del> <ins class="diff-chg">false. This variable is
set to true when the parser sees a number or a "</ins> <code title=
""><ins class="diff-chg">-</ins></code> <ins class="diff-chg">"
character.</ins></p>
</li>
<li>
<p>Let <var title=""><del class="diff-old">started</del>
<ins class="diff-chg">got number</ins></var> be false. <ins class=
"diff-new">This variable is set to true when the parser sees a
number.</ins></p>
</li>
<li>
<p>Let <var title="">finished</var> be false. <ins class=
"diff-new">This variable is set to true to switch parser into a
mode where it ignores characters until the next
separator.</ins></p>
</li>
<li>
<p>Let <var title="">bogus</var> be false.</p>
</li>
<li>
<p><em>Parser:</em> If the character in the string <var title=
"">input</var> at position <var title="">position</var> is:</p>
<dl class="switch">
<dt>A U+002D HYPHEN-MINUS character</dt>
<dd>
<p>Follow these substeps:</p>
<ol>
<li>If <var title=""><ins class="diff-new">got number</ins></var>
<ins class="diff-new">is true, let</ins> <var title=""><ins class=
"diff-new">finished</ins></var> <ins class="diff-new">be
true.</ins></li>
<li><ins class="diff-new">If</ins> <var title="">finished</var> is
true, skip to the next step in the overall set of steps.</li>
<li>If <var title="">started</var> is <del class="diff-old">true or
if bogus is</del> true, let <var title="">negated</var> be
false.</li>
<li>Otherwise, if <var title="">started</var> is false and if
<var title="">bogus</var> is false, let <var title="">negated</var>
be true.</li>
<li>Let <var title="">started</var> be true.</li>
</ol>
</dd>
<dt>A character in the range U+0030 DIGIT ZERO .. U+0039 DIGIT
NINE</dt>
<dd>
<p>Follow these substeps:</p>
<ol>
<li>If <var title="">finished</var> is true, skip to the next step
in the overall set of steps.</li>
<li><del class="diff-old">Let</del> <ins class=
"diff-chg">Multiply</ins> <var title=""><del class=
"diff-old">n</del> <ins class="diff-chg">value</ins></var>
<del class="diff-old">be</del> <ins class="diff-chg">by
ten.</ins></li>
<li><ins class="diff-chg">Add</ins> the value of the digit,
interpreted in base ten, <del class="diff-old">multiplied by
multiple . Add n</del> to <var title="">value</var> .</li>
<li><del class="diff-old">If value is greater than zero,
multiply</del> <ins class="diff-chg">Let</ins> <var title=
""><del class="diff-old">multiple</del> <ins class=
"diff-chg">started</ins></var> <del class="diff-old">by ten.</del>
<ins class="diff-chg">be true.</ins></li>
<li>Let <var title=""><del class="diff-old">started</del>
<ins class="diff-chg">got number</ins></var> be true.</li>
</ol>
</dd>
<dt>A <ins class="diff-new">U+0020 SPACE character</ins></dt>
<dt><ins class="diff-new">A</ins> U+002C COMMA character</dt>
<dt>A <del class="diff-old">U+0020 SPACE</del> <ins class=
"diff-chg">U+003B SEMICOLON</ins> character</dt>
<dd>
<p>Follow these substeps:</p>
<ol>
<li>If <var title=""><del class="diff-old">started</del>
<ins class="diff-chg">got number</ins></var> is false, return the
<var title="">numbers</var> list and abort. <ins class=
"diff-new">This happens if an entry in the list has no digits, as
in "</ins> <code title=""><ins class=
"diff-new">1,2,x,4</ins></code> <ins class="diff-new">".</ins></li>
<li>If <var title="">negated</var> is true, then negate <var title=
"">value</var> .</li>
<li>Append <var title="">value</var> to the <var title=
"">numbers</var> list.</li>
<li>Jump to step 4 in the overall set of steps.</li>
</ol>
</dd>
<dt>A U+002E FULL STOP character</dt>
<dd>
<p>Follow these substeps:</p>
<ol>
<li><del class="diff-old">Let</del> <ins class="diff-chg">If</ins>
<var title=""><ins class="diff-chg">got number</ins></var>
<ins class="diff-chg">is true, let</ins> <var title=
"">finished</var> be true.</li>
<li><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">finished</ins></var> <ins class="diff-new">is true, skip
to the next step in the overall set of steps.</ins></li>
<li><ins class="diff-new">Let</ins> <var title=""><ins class=
"diff-new">negated</ins></var> <ins class="diff-new">be
false.</ins></li>
</ol>
</dd>
<dt>Any other character</dt>
<dd>
<p>Follow these substeps:</p>
<ol>
<li>If <var title="">finished</var> is true, skip to the next step
in the overall set of steps.</li>
<li>Let <var title="">negated</var> be false.</li>
<li>Let <var title="">bogus</var> be true.</li>
<li>If <var title="">started</var> is true, then return the
<var title="">numbers</var> list, and abort. (The value in
<var title="">value</var> is not appended to the list first; it is
dropped.)</li>
</ol>
</dd>
</dl>
</li>
<li>
<p>Advance <var title="">position</var> to the next character in
<var title="">input</var> , or to beyond the end of the string if
there are no more characters.</p>
</li>
<li>
<p>If <var title="">position</var> points to a character (and not
to beyond the end of <var title="">input</var> ), jump to the big
<em>Parser</em> step above.</p>
</li>
<li>
<p>If <var title="">negated</var> is true, then negate <var title=
"">value</var> .</p>
</li>
<li>
<p>If <var title=""><del class="diff-old">started</del> <ins class=
"diff-chg">got number</ins></var> is true, then append <var title=
"">value</var> to the <var title="">numbers</var> <del class=
"diff-old">list, return that list, and abort.</del> <ins class=
"diff-chg">list.</ins></p>
</li>
<li>
<p>Return the <var title="">numbers</var> list and abort.</p>
</li>
</ol>
<h4 id="dates"><span class="secno"><del class=
"diff-old">3.2.4.</del> <ins class="diff-chg">3.2.4</ins></span>
Dates and times</h4>
<p>In the algorithms below, the <dfn id="number">number of days in
month <var title="">month</var> of year <var title=
"">year</var></dfn> is: <em>31</em> if <var title="">month</var> is
1, 3, 5, 7, 8, 10, or 12; <em>30</em> if <var title="">month</var>
is 4, 6, 9, or 11; <em>29</em> if <var title="">month</var> is 2
and <var title="">year</var> is a number divisible by 400, or if
<var title="">year</var> is a number divisible by 4 but not by 100;
and <em>28</em> otherwise. This takes into account leap years in
the Gregorian calendar. <a href="#references">[GREGORIAN]</a></p>
<h5 id="specific"><span class="secno">3.2.4.1.</span> Specific
moments in time</h5>
<p>A string is a <dfn id="valid5">valid datetime</dfn> if it has
four digits (representing the year), a literal hyphen, two digits
(representing the month), a literal hyphen, two digits
(representing the day), optionally some spaces, either a literal T
or a space, optionally some more spaces, two digits (for the hour),
a colon, two digits (the minutes), optionally the seconds (which,
if included, must consist of another colon, two digits (the integer
part of the seconds), and optionally a decimal point followed by
one or more digits (for the fractional part of the seconds)),
optionally some spaces, and finally either a literal Z (indicating
the time zone is UTC), or, a plus sign or a minus sign followed by
two digits, a colon, and two digits (for the sign, the hours and
minutes of the timezone offset respectively); with the month-day
combination being a valid date in the given year according to the
Gregorian calendar, the hour values ( <var title="">h</var> ) being
in the range 0 ≤ <var title="">h</var> ≤ 23,
the minute values ( <var title="">m</var> ) in the range
0 ≤ <var title="">m</var> ≤ 59, and the
second value ( <var title="">s</var> ) being in the range
0 ≤ <var title="">h</var> < 60. <a href=
"#references">[GREGORIAN]</a></p>
<p>The digits must be characters in the range U+0030 DIGIT ZERO (0)
to U+0039 DIGIT NINE (9), the hyphens must be a U+002D HYPHEN-MINUS
characters, the T must be a U+0054 LATIN CAPITAL LETTER T, the
colons must be U+003A COLON characters, the decimal point must be a
U+002E FULL STOP, the Z must be a U+005A LATIN CAPITAL LETTER Z,
the plus sign must be a U+002B PLUS SIGN, and the minus U+002D
(same as the hyphen).</p>
<div class="example">
<p>The following are some examples of dates written as <a href=
"#valid5" title="valid datetime">valid datetimes</a> .</p>
<dl>
<dt>" <code>0037-12-13 00:00 Z</code> "</dt>
<dd>Midnight UTC on the birthday of Nero (the Roman Emperor).</dd>
<dt>" <code>1979-10-14T12:00:00.001-04:00</code> "</dt>
<dd>One millisecond after noon on October 14th 1979, in the time
zone in use on the east coast of North America during daylight
saving time.</dd>
<dt>" <code>8592-01-01 T 02:09 +02:09</code> "</dt>
<dd>Midnight UTC on the 1st of January, 8592. The time zone
associated with that time is two hours and nine minutes ahead of
UTC.</dd>
</dl>
<p>Several things are notable about these dates:</p>
<ul>
<li>Years with fewer than four digits have to be zero-padded. The
date "37-12-13" would not be a valid date.</li>
<li>To unambiguously identify a moment in time prior to the
introduction of the Gregorian calendar, the date has to be first
converted to the Gregorian calendar from the calendar in use at the
time (e.g. from the Julian calendar). The date of Nero's birth is
the 15th of December 37, in the Julian Calendar, which is the 13th
of December 37 in the Gregorian Calendar.</li>
<li>The time and timezone components are not optional.</li>
<li>Dates before the year 0 or after the year 9999 can't be
represented as a datetime in this version of HTML.</li>
<li>Time zones differ based on daylight savings time.</li>
</ul>
</div>
<p class="note">Conformance checkers can use the algorithm below to
determine if a datetime is a valid datetime or not.</p>
<p>To <dfn id="datetime-parser">parse a string as a datetime
value</dfn> , a user agent must apply the following algorithm to
the string. This will either return a time in UTC, with associated
timezone information for round tripping or display purposes, or
nothing, indicating the value is not a <a href="#valid5">valid
datetime</a> . If at any point the algorithm says that it "fails",
this means that it returns nothing.</p>
<ol>
<li>
<p>Let <var title="">input</var> be the string being parsed.</p>
</li>
<li>
<p>Let <var title="">position</var> be a pointer into <var title=
"">input</var> , initially pointing at the start of the string.</p>
</li>
<li>
<p><a href="#collect">Collect a sequence of characters</a> in the
range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the
collected sequence is not exactly four characters long, then fail.
Otherwise, interpret the resulting sequence as a <del class=
"diff-old">base ten</del> <ins class="diff-chg">base-ten</ins>
integer. Let that number be the <var title="">year</var> .</p>
</li>
<li>
<p>If <var title="">position</var> is beyond the end of <var title=
"">input</var> or if the character at <var title="">position</var>
is not a U+002D HYPHEN-MINUS character, then fail. Otherwise, move
<var title="">position</var> forwards one character.</p>
</li>
<li>
<p><a href="#collect">Collect a sequence of characters</a> in the
range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the
collected sequence is not exactly two characters long, then fail.
Otherwise, interpret the resulting sequence as a <del class=
"diff-old">base ten</del> <ins class="diff-chg">base-ten</ins>
integer. Let that number be the <var title="">month</var> .</p>
</li>
<li>If <var title="">month</var> is not a number in the range
1 ≤ <var title="">month</var> ≤ 12, then
fail.</li>
<li>
<p>Let <var title="">maxday</var> be the <a href="#number">number
of days in month <var title="">month</var> of year <var title=
"">year</var></a> .</p>
</li>
<li>
<p>If <var title="">position</var> is beyond the end of <var title=
"">input</var> or if the character at <var title="">position</var>
is not a U+002D HYPHEN-MINUS character, then fail. Otherwise, move
<var title="">position</var> forwards one character.</p>
</li>
<li>
<p><a href="#collect">Collect a sequence of characters</a> in the
range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the
collected sequence is not exactly two characters long, then fail.
Otherwise, interpret the resulting sequence as a <del class=
"diff-old">base ten</del> <ins class="diff-chg">base-ten</ins>
integer. Let that number be the <var title="">day</var> .</p>
</li>
<li>
<p>If <var title="">day</var> is not a number in the range
1 ≤ <var title="">month</var> ≤ <var title=
"">maxday</var> , then fail.</p>
</li>
<li>
<p><a href="#collect">Collect a sequence of characters</a> that are
either U+0054 LATIN CAPITAL LETTER T characters or <a href="#space"
title="space character">space characters</a> . If the collected
sequence is zero characters long, or if it contains more than one
U+0054 LATIN CAPITAL LETTER T character, then fail.</p>
</li>
<li>
<p><a href="#collect">Collect a sequence of characters</a> in the
range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the
collected sequence is not exactly two characters long, then fail.
Otherwise, interpret the resulting sequence as a <del class=
"diff-old">base ten</del> <ins class="diff-chg">base-ten</ins>
integer. Let that number be the <var title="">hour</var> .</p>
</li>
<li>If <var title="">hour</var> is not a number in the range
0 ≤ <var title="">hour</var> ≤ 23, then
fail.</li>
<li>
<p>If <var title="">position</var> is beyond the end of <var title=
"">input</var> or if the character at <var title="">position</var>
is not a U+003A COLON character, then fail. Otherwise, move
<var title="">position</var> forwards one character.</p>
</li>
<li>
<p><a href="#collect">Collect a sequence of characters</a> in the
range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the
collected sequence is not exactly two characters long, then fail.
Otherwise, interpret the resulting sequence as a <del class=
"diff-old">base ten</del> <ins class="diff-chg">base-ten</ins>
integer. Let that number be the <var title="">minute</var> .</p>
</li>
<li>If <var title="">minute</var> is not a number in the range
0 ≤ <var title="">minute</var> ≤ 59, then
fail.</li>
<li>
<p>Let <var title="">second</var> be a string with the value
"0".</p>
</li>
<li>
<p>If <var title="">position</var> is beyond the end of <var title=
"">input</var> , then fail.</p>
</li>
<li>
<p>If the character at <var title="">position</var> is a U+003A
COLON, then:</p>
<ol>
<li>
<p>Advance <var title="">position</var> to the next character in
<var title="">input</var> .</p>
</li>
<li>
<p>If <var title="">position</var> is beyond the end of <var title=
"">input</var> , or at the last character in <var title=
"">input</var> , or if the next <em>two</em> characters in
<var title="">input</var> starting at <var title="">position</var>
are not two characters both in the range U+0030 DIGIT ZERO (0) to
U+0039 DIGIT NINE (9), then fail.</p>
</li>
<li>
<p><a href="#collect">Collect a sequence of characters</a> that are
either characters in the range U+0030 DIGIT ZERO (0) to U+0039
DIGIT NINE (9) or U+002E FULL STOP characters. If the collected
sequence has more than one U+002E FULL STOP characters, or if the
last character in the sequence is a U+002E FULL STOP character,
then fail. Otherwise, let the collected string be <var title=
"">second</var> instead of its previous value.</p>
</li>
</ol>
</li>
<li>
<p>Interpret <var title="">second</var> as a <del class=
"diff-old">base ten</del> <ins class="diff-chg">base-ten</ins>
number (possibly with a fractional part). Let that number be
<var title="">second</var> instead of the string version.</p>
</li>
<li>If <var title="">second</var> is not a number in the range
0 ≤ <var title="">hour</var> < 60, then
fail. (The values 60 and 61 are not allowed: leap seconds cannot be
represented by datetime values.)</li>
<li>
<p>If <var title="">position</var> is beyond the end of <var title=
"">input</var> , then fail.</p>
</li>
<li>
<p><a href="#skip-whitespace">Skip whitespace.</a></p>
</li>
<li>
<p>If the character at <var title="">position</var> is a U+005A
LATIN CAPITAL LETTER Z, then:</p>
<ol>
<li>
<p>Let <var title="">timezone <sub title="">hours</sub></var> be
0.</p>
</li>
<li>
<p>Let <var title="">timezone <sub title="">minutes</sub></var> be
0.</p>
</li>
<li>
<p>Advance <var title="">position</var> to the next character in
<var title="">input</var> .</p>
</li>
</ol>
</li>
<li>
<p>Otherwise, if the character at <var title="">position</var> is
either a U+002B PLUS SIGN ("+") or a U+002D HYPHEN-MINUS ("-"),
then:</p>
<ol>
<li>
<p>If the character at <var title="">position</var> is a U+002B
PLUS SIGN ("+"), let <var title="">sign</var> be "positive".
Otherwise, it's a U+002D HYPHEN-MINUS ("-"); let <var title=
"">sign</var> be "negative".</p>
</li>
<li>
<p>Advance <var title="">position</var> to the next character in
<var title="">input</var> .</p>
</li>
<li>
<p><a href="#collect">Collect a sequence of characters</a> in the
range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the
collected sequence is not exactly two characters long, then fail.
Otherwise, interpret the resulting sequence as a <del class=
"diff-old">base ten</del> <ins class="diff-chg">base-ten</ins>
integer. Let that number be the <var title="">timezone <sub title=
"">hours</sub></var> .</p>
</li>
<li>If <var title="">timezone <sub title="">hours</sub></var> is
not a number in the range 0 ≤ <var title="">timezone
<sub title="">hours</sub></var> ≤ 23, then fail.</li>
<li>If <var title="">sign</var> is "negative", then negate
<var title="">timezone <sub title="">hours</sub></var> .</li>
<li>
<p>If <var title="">position</var> is beyond the end of <var title=
"">input</var> or if the character at <var title="">position</var>
is not a U+003A COLON character, then fail. Otherwise, move
<var title="">position</var> forwards one character.</p>
</li>
<li>
<p><a href="#collect">Collect a sequence of characters</a> in the
range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the
collected sequence is not exactly two characters long, then fail.
Otherwise, interpret the resulting sequence as a <del class=
"diff-old">base ten</del> <ins class="diff-chg">base-ten</ins>
integer. Let that number be the <var title="">timezone <sub title=
"">minutes</sub></var> .</p>
</li>
<li>If <var title="">timezone <sub title="">minutes</sub></var> is
not a number in the range 0 ≤ <var title="">timezone
<sub title="">minutes</sub></var> ≤ 59, then fail.</li>
<li>If <var title="">sign</var> is "negative", then negate
<var title="">timezone <sub title="">minutes</sub></var> .</li>
</ol>
</li>
<li>
<p>If <var title="">position</var> is <em>not</em> beyond the end
of <var title="">input</var> , then fail.</p>
</li>
<li>
<p>Let <var title="">time</var> be the moment in time at year
<var title="">year</var> , month <var title="">month</var> , day
<var title="">day</var> , hours <var title="">hour</var> , minute
<var title="">minute</var> , second <var title="">second</var> ,
subtracting <var title="">timezone <sub title="">hours</sub></var>
hours and <var title="">timezone <sub title="">minutes</sub></var>
minutes. That moment in time is a moment in the UTC timezone.</p>
</li>
<li>
<p>Let <var title="">timezone</var> be <var title="">timezone
<sub title="">hours</sub></var> hours and <var title="">timezone
<sub title="">minutes</sub></var> minutes from UTC.</p>
</li>
<li>
<p>Return <var title="">time</var> and <var title="">timezone</var>
.</p>
</li>
</ol>
<h5 id="vaguer"><span class="secno">3.2.4.2.</span> Vaguer moments
in time</h5>
<p>This section defines <dfn id="date-or" title=
"date or time string">date or time strings</dfn> . There are two
kinds, <dfn id="date-or0" title=
"date or time string in content">date or time strings in
content</dfn> , and <dfn id="date-or1" title=
"date or time string in attributes">date or time strings in
attributes</dfn> . The only difference is in the handling of
whitespace characters.</p>
<p>To parse a <a href="#date-or">date or time string</a> , user
agents must use the following algorithm. A <a href="#date-or">date
or time string</a> is a <em>valid</em> date or time string if the
following algorithm, when run on the string, doesn't say the string
is invalid.</p>
<p>The algorithm may return nothing (in which case the string will
be invalid), or it may return a date, a time, a date and a time, or
a date and a time and <del class="diff-old">and</del> a timezone.
Even if the algorithm returns one or more values, the string can
still be invalid.</p>
<ol>
<li>
<p>Let <var title="">input</var> be the string being parsed.</p>
</li>
<li>
<p>Let <var title="">position</var> be a pointer into <var title=
"">input</var> , initially pointing at the start of the string.</p>
</li>
<li>
<p>Let <var title="">results</var> be the collection of results
that are to be returned (one or more of a date, a time, and a
timezone), initially empty. If the algorithm aborts at any point,
then whatever is currently in <var title="">results</var> must be
returned as the result of the algorithm.</p>
</li>
<li>
<p>For the "in content" variant: <a href="#skip-">skip Zs
characters</a> ; for the "in attributes" variant: <a href=
"#skip-whitespace">skip whitespace</a> .</p>
</li>
<li>
<p><a href="#collect">Collect a sequence of characters</a> in the
range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the
collected sequence is empty, then the string is invalid; abort
these steps.</p>
</li>
<li>
<p>Let the sequence of characters collected in the last step be
<var title="">s</var> .</p>
</li>
<li>
<p>If <var title="">position</var> is past the end of <var title=
"">input</var> , the string is invalid; abort these steps.</p>
</li>
<li>
<p>If the character at <var title="">position</var> is <em>not</em>
a U+003A COLON character, then:</p>
<ol>
<li>
<p>If the character at <var title="">position</var> is not a U+002D
HYPHEN-MINUS ("-") character either, then the string is invalid,
abort these steps.</p>
</li>
<li>
<p>If the sequence <var title="">s</var> is not exactly four digits
long, then the string is invalid. (This does not stop the
algorithm, however.)</p>
</li>
<li>
<p>Interpret the sequence of characters collected in step 5 as a
<del class="diff-old">base ten</del> <ins class=
"diff-chg">base-ten</ins> integer, and let that number be
<var title="">year</var> .</p>
</li>
<li>
<p>Advance <var title="">position</var> past the U+002D
HYPHEN-MINUS ("-") character.</p>
</li>
<li>
<p><a href="#collect">Collect a sequence of characters</a> in the
range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the
collected sequence is empty, then the string is invalid; abort
these steps.</p>
</li>
<li>
<p>If the sequence collected in the last step is not exactly two
digits long, then the string is invalid.</p>
</li>
<li>
<p>Interpret the sequence of characters collected two steps ago as
a <del class="diff-old">base ten</del> <ins class=
"diff-chg">base-ten</ins> integer, and let that number be
<var title="">month</var> .</p>
</li>
<li>If <var title="">month</var> is not a number in the range
1 ≤ <var title="">month</var> ≤ 12, then the
string is invalid, abort these steps.</li>
<li>
<p>Let <var title="">maxday</var> be the <a href="#number">number
of days in month <var title="">month</var> of year <var title=
"">year</var></a> .</p>
</li>
<li>
<p>If <var title="">position</var> is past the end of <var title=
"">input</var> , or if the character at <var title=
"">position</var> is <em>not</em> a U+002D HYPHEN-MINUS ("-")
character, then the string is invalid, abort these steps.
Otherwise, advance <var title="">position</var> to the next
character.</p>
</li>
<li>
<p><a href="#collect">Collect a sequence of characters</a> in the
range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the
collected sequence is empty, then the string is invalid; abort
these steps.</p>
</li>
<li>
<p>If the sequence collected in the last step is not exactly two
digits long, then the string is invalid.</p>
</li>
<li>
<p>Interpret the sequence of characters collected two steps ago as
a <del class="diff-old">base ten</del> <ins class=
"diff-chg">base-ten</ins> integer, and let that number be
<var title="">day</var> .</p>
</li>
<li>
<p>If <var title="">day</var> is not a number in the range
1 ≤ <var title="">day</var> ≤ <var title=
"">maxday</var> , then the string is invalid, abort these
steps.</p>
</li>
<li>
<p>Add the date represented by <var title="">year</var> ,
<var title="">month</var> , and <var title="">day</var> to the
<var title="">results</var> .</p>
</li>
<li>
<p>For the "in content" variant: <a href="#skip-">skip Zs
characters</a> ; for the "in attributes" variant: <a href=
"#skip-whitespace">skip whitespace</a> .</p>
</li>
<li>
<p>If the character at <var title="">position</var> is a U+0054
LATIN CAPITAL LETTER T, then move <var title="">position</var>
forwards one character.</p>
</li>
<li>
<p>For the "in content" variant: <a href="#skip-">skip Zs
characters</a> ; for the "in attributes" variant: <a href=
"#skip-whitespace">skip whitespace</a> .</p>
</li>
<li>
<p><a href="#collect">Collect a sequence of characters</a> in the
range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the
collected sequence is empty, then the string is invalid; abort
these steps.</p>
</li>
<li>
<p>Let <var title="">s</var> be the sequence of characters
collected in the last step.</p>
</li>
</ol>
</li>
<li>
<p>If <var title="">s</var> is not exactly two digits long, then
the string is invalid.</p>
</li>
<li>
<p>Interpret the sequence of characters collected two steps ago as
a <del class="diff-old">base ten</del> <ins class=
"diff-chg">base-ten</ins> integer, and let that number be
<var title="">hour</var> .</p>
</li>
<li>
<p>If <var title="">hour</var> is not a number in the range
0 ≤ <var title="">hour</var> ≤ 23, then the
string is invalid, abort these steps.</p>
</li>
<li>
<p>If <var title="">position</var> is past the end of <var title=
"">input</var> , or if the character at <var title=
"">position</var> is <em>not</em> a U+003A COLON character, then
the string is invalid, abort these steps. Otherwise, advance
<var title="">position</var> to the next character.</p>
</li>
<li>
<p><a href="#collect">Collect a sequence of characters</a> in the
range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the
collected sequence is empty, then the string is invalid; abort
these steps.</p>
</li>
<li>
<p>If the sequence collected in the last step is not exactly two
digits long, then the string is invalid.</p>
</li>
<li>
<p>Interpret the sequence of characters collected two steps ago as
a <del class="diff-old">base ten</del> <ins class=
"diff-chg">base-ten</ins> integer, and let that number be
<var title="">minute</var> .</p>
</li>
<li>
<p>If <var title="">minute</var> is not a number in the range
0 ≤ <var title="">minute</var> ≤ 59, then the
string is invalid, abort these steps.</p>
</li>
<li>
<p>Let <var title="">second</var> be 0. It may be changed to
another value in the next step.</p>
</li>
<li>
<p>If <var title="">position</var> is not past the end of
<var title="">input</var> and the character at <var title=
"">position</var> is a U+003A COLON character, then:</p>
<ol>
<li>
<p><a href="#collect">Collect a sequence of characters</a> that are
either characters in the range U+0030 DIGIT ZERO (0) to U+0039
DIGIT NINE (9) or are U+002E FULL STOP. If the collected sequence
is empty, or contains more than one U+002E FULL STOP character,
then the string is invalid; abort these steps.</p>
</li>
<li>
<p>If the first character in the sequence collected in the last
step is not in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE
(9), then the string is invalid.</p>
</li>
<li>
<p>Interpret the sequence of characters collected two steps ago as
a <del class="diff-old">base ten</del> <ins class=
"diff-chg">base-ten</ins> number (possibly with a fractional part),
and let that number be <var title="">second</var> .</p>
</li>
<li>
<p>If <var title="">second</var> is not a number in the range
0 ≤ <var title="">minute</var> < 60, then
the string is invalid, abort these steps.</p>
</li>
</ol>
</li>
<li>
<p>Add the time represented by <var title="">hour</var> ,
<var title="">minute</var> , and <var title="">second</var> to the
<var title="">results</var> .</p>
</li>
<li>
<p>If <var title="">results</var> has both a date and a time,
then:</p>
<ol>
<li>
<p>For the "in content" variant: <a href="#skip-">skip Zs
characters</a> ; for the "in attributes" variant: <a href=
"#skip-whitespace">skip whitespace</a> .</p>
</li>
<li>
<p>If <var title="">position</var> is past the end of <var title=
"">input</var> , then skip to the next step in the overall set of
steps.</p>
</li>
<li>
<p>Otherwise, if the character at <var title="">position</var> is a
U+005A LATIN CAPITAL LETTER Z, then:</p>
<ol>
<li>
<p>Add the timezone corresponding to UTC (zero offset) to the
<var title="">results</var> .</p>
</li>
<li>
<p>Advance <var title="">position</var> to the next character in
<var title="">input</var> .</p>
</li>
<li>
<p>Skip to the next step in the overall set of steps.</p>
</li>
</ol>
</li>
<li>
<p>Otherwise, if the character at <var title="">position</var> is
either a U+002B PLUS SIGN ("+") or a U+002D HYPHEN-MINUS ("-"),
then:</p>
<ol>
<li>
<p>If the character at <var title="">position</var> is a U+002B
PLUS SIGN ("+"), let <var title="">sign</var> be "positive".
Otherwise, it's a U+002D HYPHEN-MINUS ("-"); let <var title=
"">sign</var> be "negative".</p>
</li>
<li>
<p>Advance <var title="">position</var> to the next character in
<var title="">input</var> .</p>
</li>
<li>
<p><a href="#collect">Collect a sequence of characters</a> in the
range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the
collected sequence is not exactly two characters long, then the
string is invalid.</p>
</li>
<li>
<p>Interpret the sequence collected in the last step as a
<del class="diff-old">base ten</del> <ins class=
"diff-chg">base-ten</ins> number, and let that number be
<var title="">timezone <sub title="">hours</sub></var> .</p>
</li>
<li>If <var title="">timezone <sub title="">hours</sub></var> is
not a number in the range 0 ≤ <var title="">timezone
<sub title="">hours</sub></var> ≤ 23, then the string is
invalid; abort these steps.</li>
<li>If <var title="">sign</var> is "negative", then negate
<var title="">timezone <sub title="">hours</sub></var> .</li>
<li>
<p>If <var title="">position</var> is beyond the end of <var title=
"">input</var> or if the character at <var title="">position</var>
is not a U+003A COLON character, then the string is invalid; abort
these steps. Otherwise, move <var title="">position</var> forwards
one character.</p>
</li>
<li>
<p><a href="#collect">Collect a sequence of characters</a> in the
range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the
collected sequence is not exactly two characters long, then the
string is invalid.</p>
</li>
<li>
<p>Interpret the sequence collected in the last step as a
<del class="diff-old">base ten</del> <ins class=
"diff-chg">base-ten</ins> number, and let that number be
<var title="">timezone <sub title="">minutes</sub></var> .</p>
</li>
<li>If <var title="">timezone <sub title="">minutes</sub></var> is
not a number in the range 0 ≤ <var title="">timezone
<sub title="">minutes</sub></var> ≤ 59, then the string
is invalid; abort these steps.</li>
<li>
<p>Add the timezone corresponding to an offset of <var title=
"">timezone <sub title="">hours</sub></var> hours and <var title=
"">timezone <sub title="">minutes</sub></var> minutes to the
<var title="">results</var> .</p>
</li>
<li>
<p>Skip to the next step in the overall set of steps.</p>
</li>
</ol>
</li>
<li>
<p>Otherwise, the string is invalid; abort these steps.</p>
</li>
</ol>
</li>
<li>
<p>For the "in content" variant: <a href="#skip-">skip Zs
characters</a> ; for the "in attributes" variant: <a href=
"#skip-whitespace">skip whitespace</a> .</p>
</li>
<li>
<p>If <var title="">position</var> is <em>not</em> past the end of
<var title="">input</var> , then the string is invalid.</p>
</li>
<li>
<p>Abort these steps (the string is parsed).</p>
</li>
</ol>
<h4 id="time-offsets"><span class="secno"><del class=
"diff-old">3.2.5.</del> <ins class="diff-chg">3.2.5</ins></span>
Time offsets</h4>
<p class="big-issue"><dfn id="valid6">valid time offset</dfn> ,
<dfn id="rules4">rules for parsing time offsets</dfn> , <dfn id=
"time-offset">time offset <del class="diff-old">serialisation</del>
<ins class="diff-chg">serialization</ins> rules</dfn> ; in the
format "5d4h3m2s1ms" or "3m 9.2s" or "00:00:00.00" or similar.</p>
<h4 id="tokens"><span class="secno"><del class=
"diff-old">3.2.6.</del> <ins class="diff-chg">3.2.6</ins></span>
Tokens</h4>
<p>A <dfn id="set-of">set of space-separated tokens</dfn> is a set
of zero or more words separated by one or more <a href="#space"
title="space character">space characters</a> , where words consist
of any string of one or more characters, none of which are <a href=
"#space" title="space character">space characters</a> .</p>
<p>A string containing a <a href="#set-of">set of space-separated
tokens</a> may have leading or trailing <a href="#space" title=
"space character">space characters</a> .</p>
<p>An <dfn id="unordered">unordered set of unique space-separated
tokens</dfn> is a <a href="#set-of">set of space-separated
tokens</a> where none of the words are duplicated.</p>
<p>An <dfn id="ordered">ordered set of unique space-separated
tokens</dfn> is a <a href="#set-of">set of space-separated
tokens</a> where none of the words are duplicated but where the
order of the tokens is meaningful.</p>
<p><a href="#set-of" title=
"set of space-separated tokens"><ins class="diff-new">Sets of
space-separated tokens</ins></a> <ins class="diff-new">sometimes
have a defined set of allowed values. When a set of allowed values
is defined, the tokens must all be from that list of allowed
values; other values are non-conforming. If no such set of allowed
values is provided, then all values are conforming.</ins></p>
<p>When a user agent has to <dfn id="split">split a string on
spaces</dfn> , it must use the following algorithm:</p>
<ol>
<li>
<p>Let <var title="">input</var> be the string being parsed.</p>
</li>
<li>
<p>Let <var title="">position</var> be a pointer into <var title=
"">input</var> , initially pointing at the start of the string.</p>
</li>
<li>
<p>Let <var title="">tokens</var> be a list of tokens, initially
empty.</p>
</li>
<li>
<p><a href="#skip-whitespace">Skip whitespace</a></p>
</li>
<li>
<p>While <var title="">position</var> is not past the end of
<var title="">input</var> :</p>
<ol>
<li>
<p><a href="#collect">Collect a sequence of characters</a> that are
not <a href="#space" title="space character">space characters</a>
.</p>
</li>
<li>
<p>Add the string collected in the previous step to <var title=
"">tokens</var> .</p>
</li>
<li>
<p><a href="#skip-whitespace">Skip whitespace</a></p>
</li>
</ol>
</li>
<li>
<p>Return <var title="">tokens</var> .</p>
</li>
</ol>
<p>When a user agent has to <dfn id="remove0">remove a token from a
string</dfn> , it must use the following algorithm:</p>
<ol>
<li>
<p>Let <var title="">input</var> be the string being modified.</p>
</li>
<li>
<p>Let <var title="">token</var> be the token being removed. It
will not contain any <a href="#space" title="space character">space
characters</a> .</p>
</li>
<li>
<p>Let <var title="">output</var> be the output string, initially
empty.</p>
</li>
<li>
<p>Let <var title="">position</var> be a pointer into <var title=
"">input</var> , initially pointing at the start of the string.</p>
</li>
<li>
<p>If <var title="">position</var> is beyond the end of <var title=
"">input</var> , set the string being modified to <var title=
"">output</var> , and abort these steps.</p>
</li>
<li>
<p>If the character at <var title="">position</var> is a <a href=
"#space">space character</a> :</p>
<ol>
<li>
<p>Append the character at <var title="">position</var> to the end
of <var title="">output</var> .</p>
</li>
<li>
<p>Increment <var title="">position</var> so it points at the next
character in <var title="">input</var> .</p>
</li>
<li>
<p>Return to step 5 in the overall set of steps.</p>
</li>
</ol>
</li>
<li>
<p>Otherwise, the character at <var title="">position</var> is the
first character of a token. <a href="#collect">Collect a sequence
of characters</a> that are not <a href="#space" title=
"space character">space characters</a> , and let that be
<var title="">s</var> .</p>
</li>
<li>
<p>If <var title="">s</var> is exactly equal to <var title=
"">token</var> , then:</p>
<ol>
<li>
<p><a href="#skip-whitespace">Skip whitespace</a> (in <var title=
"">input</var> ).</p>
</li>
<li>
<p>Remove any <a href="#space" title="space character">space
characters</a> currently at the end of <var title="">output</var>
.</p>
</li>
<li>
<p>If <var title="">position</var> is not past the end of
<var title="">input</var> , and <var title="">output</var> is not
the empty string, append a single U+0020 SPACE character at the end
of <var title="">output</var> .</p>
</li>
</ol>
</li>
<li>
<p>Otherwise, append <var title="">s</var> to the end of
<var title="">output</var> .</p>
</li>
<li>
<p>Return to step 6 in the overall set of steps.</p>
</li>
</ol>
<p class="note">This causes any occurrences of the token to be
removed from the string, and any spaces that were surrounding the
token to be collapsed to a single space, except at the start and
end of the string, where such spaces are removed.</p>
<h4 id="keywords"><span class="secno"><del class=
"diff-old">3.2.7.</del> <ins class="diff-chg">3.2.7</ins></span>
Keywords and enumerated attributes</h4>
<p>Some attributes are defined as taking one of a finite set of
keywords. Such attributes are called <dfn id="enumerated" title=
"enumerated attribute">enumerated attributes</dfn> . The keywords
are each defined to map to a particular <em>state</em> (several
keywords might map to the same state, in which case some of the
keywords are synonyms of each other; additionally, some of the
keywords can be said to be non-conforming, and are only in the
specification for historical reasons). In addition, two default
states can be given. The first is the <em>invalid value
default</em> , the second is the <em>missing value default</em>
.</p>
<p>If an enumerated attribute is specified, the attribute's value
must be one of the given keywords that are not said to be
non-conforming, with no leading or trailing whitespace. The keyword
may use any mix of uppercase and lowercase letters.</p>
<p>When the attribute is specified, if its value
<span>case-insensitively</span> matches one of the given keywords
then that keyword's state is the state that the attribute
represents. If the attribute value matches none of the given
keywords, but the attribute has an <em>invalid value default</em> ,
then the attribute represents that state. Otherwise, if the
attribute value matches none of the keywords but there is a
<em>missing value default</em> state defined, then <em>that</em> is
the state represented by the attribute. Otherwise, there is no
default, and invalid values must <del class="diff-old">simply</del>
be ignored.</p>
<p>When the attribute is <em>not</em> specified, if there is a
<em>missing value default</em> state defined, then that is the
state represented by the (missing) attribute. Otherwise, the
absence of the attribute means that there is no state
represented.</p>
<p class="note">The empty string can be one of the keywords in some
cases. For example the <code title="attr-contenteditable"><a href=
"#contenteditable0">contenteditable</a></code> attribute has two
states: <em>true</em> , matching the <code title="">true</code>
keyword and the empty string, <em>false</em> , matching
<code title="">false</code> and all other keywords (it's the
<em>invalid value default</em> ). It could further be thought of as
having a third state <em>inherit</em> , which would be the default
when the attribute is not specified at all (the <em>missing value
default</em> ), but for various reasons that isn't the way this
specification actually defines it.</p>
<h4 id="syntax-references"><span class="secno"><del class=
"diff-old">3.2.8.</del> <ins class="diff-chg">3.2.8</ins></span>
References</h4>
<p>A <dfn id="valid7">valid <del class="diff-old">hashed ID</del>
<ins class="diff-chg">hash-name</ins> reference</dfn> to an element
of type <var title="">type</var> is a string consisting of a U+0023
NUMBER SIGN ( <code title="">#</code> ) character followed by a
string which exactly matches the value of the <del class=
"diff-old">id</del> <code title=""><ins class=
"diff-chg">name</ins></code> attribute of an element in the
document with type <var title="">type</var> .</p>
<p>The <dfn id="rules5">rules for parsing a <del class=
"diff-old">hashed ID</del> <ins class="diff-chg">hash-name</ins>
reference</dfn> to an element of type <var title="">type</var> are
as follows:</p>
<ol>
<li>
<p>If the string being parsed does not contain a U+0023 NUMBER SIGN
character, or if the first such character in the string is the last
character in the string, then return null and abort these
steps.</p>
</li>
<li>
<p>Let <var title="">s</var> be the string from the character
immediately after the first U+0023 NUMBER SIGN character in the
string being parsed up to the end of that string.</p>
</li>
<li>
<p>Return the first element of type <var title="">type</var> that
has an <code title="attr-id"><a href="#id">id</a></code> or
<code title="">name</code> attribute whose value case-insensitively
matches <var title="">s</var> .</p>
</li>
</ol>
<h4 id="urls"><span class="secno"><ins class=
"diff-new">3.2.9</ins></span> <ins class="diff-new">URLs</ins></h4>
<div class="big-issue">
<p><ins class="diff-new">This section will do the
following:</ins></p>
<ul>
<li><ins class="diff-new">define how to resolve relative URLs in
markup attributes (using XMLBase as defined elsewhere right
now)</ins></li>
<li><ins class="diff-new">define how to resolve relative URLs in
APIs, using the</ins> <dfn id="scripts0"><ins class=
"diff-new">script's base URI</ins></dfn> <ins class=
"diff-new">maybe</ins></li>
<li><ins class="diff-new">define what it means to resolve a
relative URL when the base URL doesn't have a path hierarchy (e.g.
data:, javascript:, about:blank URLs)</ins></li>
<li><ins class="diff-new">define how to handle URIs that contain
non-ascii characters (and it's not the same as handling as IRIs,
especially if the character encoding of the document isn't
UTF-8)</ins></li>
<li><ins class="diff-new">define URL as IRI and replace all uses of
URIs and IRIs in the rest of the spec with URL</ins></li>
<li><ins class="diff-new">define "valid URL" in terms of valid URIs
and IRIs and replace that concept through the spec to a pointer
here, getting rid of references to</ins> <a href=
"#references"><ins class="diff-new">[RFC3986]</ins></a> <a href=
"#references"><ins class="diff-new">[RFC3987]</ins></a></li>
<li><ins class="diff-new">define "valid URL reference" in terms of
valid URI references and IRI references and replace that concept
through the spec to a pointer here, getting rid of references
to</ins> <a href="#references"><ins class=
"diff-new">[RFC3986]</ins></a> <a href="#references"><ins class=
"diff-new">[RFC3987]</ins></a></li>
<li><ins class="diff-new">define how to parse URLs (maybe by
deferring to RFCs)</ins></li>
<li><ins class="diff-new">define "an</ins> <dfn id=
"elements2"><ins class="diff-new">element's base URI</ins></dfn>
<ins class="diff-new">" and make the various places that talk about
a base URI in the context of an element use that
definition</ins></li>
<li><ins class="diff-new">make the language used to refer to
resolving a base URI consistent throughout, maybe make it hyperlink
to a definition each time</ins></li>
<li><ins class="diff-new">define a cheap, interoperable mechanism
for URL attributes and anything else that relies on xml:base and
the base element to handle dynamic changes to those attributes and
elements, possibly by defining some mechanism which causes changes
to be ignored in some reliable way.</ins></li>
</ul>
</div>
<h3 id="documents0"><span class="secno"><del class=
"diff-old">3.3.</del> <ins class="diff-chg">3.3</ins></span>
Documents and document fragments</h3>
<h4 id="semantics0"><span class="secno"><del class=
"diff-old">3.3.1.</del> <ins class="diff-chg">3.3.1</ins></span>
Semantics</h4>
<p>Elements, attributes, and attribute values in HTML are defined
(by this specification) to have certain meanings (semantics). For
example, the <code><a href="#ol">ol</a></code> element represents
an ordered list, and the <code title="lang">lang</code> attribute
represents the language of the content.</p>
<p>Authors must <del class="diff-old">only</del> <ins class=
"diff-chg">not</ins> use elements, attributes, and attribute values
for <ins class="diff-new">purposes other than</ins> their
appropriate <ins class="diff-new">intended</ins> semantic
<del class="diff-old">purposes.</del> <ins class=
"diff-chg">purpose.</ins></p>
<div class="example">
<p>For example, the following document is non-conforming, despite
being syntactically correct:</p>
<pre>
<!DOCTYPE html>
<html lang="en-GB">
<head> <title> Demonstration </title> </head>
<body>
<table>
<tr> <td> My favourite animal is the cat. </td> </tr>
<tr>
<td>
—<a href="http://example.org/~ernest/"><cite>Ernest</cite></a>,
in an essay from 1992
</td>
</tr>
</table>
</body>
</html>
</pre>
<p>...because the data placed in the cells is clearly not tabular
<del class="diff-old">data.</del> <ins class="diff-chg">data (and
the</ins> <code><a href="#cite2"><ins class=
"diff-chg">cite</ins></a></code> <ins class="diff-chg">element
mis-used).</ins> A corrected version of this document might be:</p>
<pre>
<!DOCTYPE html>
<html lang="en-GB">
<head> <title> Demonstration </title> </head>
<body>
<blockquote>
<p> My favourite animal is the cat. </p>
</blockquote>
<p>
<del class=
"diff-old"> —<a href="http://example.org/~ernest/"><cite>Ernest</cite></a>,
</del>
<ins class=
"diff-chg"> —<a href="http://example.org/~ernest/">Ernest</a>,
</ins>
in an essay from 1992
</p>
</body>
</html>
</pre>
<p>This next document fragment, intended to represent the heading
of a corporate site, is similarly non-conforming because the second
line is not intended to be a heading of a subsection, but merely a
subheading or subtitle (a subordinate heading for the same
section).</p>
<pre>
<body>
<h1>ABC Company</h1>
<h2>Leading the way in widget design since 1432</h2>
...
</pre>
<p>The <code><a href="#header">header</a></code> element should be
used in these kinds of situations:</p>
<pre>
<body>
<header>
<h1>ABC Company</h1>
<h2>Leading the way in widget design since 1432</h2>
</header>
...
</pre></div>
<p>Through scripting and using other mechanisms, the values of
attributes, text, and indeed the entire structure of the document
may change dynamically while a user agent is processing it. The
semantics of a document at an instant in time are those represented
by the state of the document at that instant in time, and the
semantics of a document can therefore change over time. User agents
must update their presentation of the document as this occurs.</p>
<p class="example">HTML has a <code><a href=
"#progress">progress</a></code> element that describes a progress
bar. If its "value" attribute is dynamically updated by a script,
the UA would update the rendering to show the progress
changing.</p>
<h4 id="structure0"><span class="secno"><del class=
"diff-old">3.3.2.</del> <ins class="diff-chg">3.3.2</ins></span>
Structure</h4>
<p>All the elements in this specification have a defined content
model, which describes what nodes are allowed inside the elements,
and thus what the structure of an HTML document or fragment must
look like. <del class="diff-old">Authors must only put elements
inside an element if that element allows them to be there according
to its content model.</del></p>
<p class="note">As noted in the conformance and terminology
sections, for the purposes of determining if an element matches its
content model or not, <a href="#text-node" title=
"text node"><code>CDATASection</code> nodes in the DOM are treated
as equivalent to <code>Text</code> nodes</a> , and <a href=
"#entity-references">entity reference nodes are treated as if they
were expanded in place</a> .</p>
<p>The <a href="#space" title="space character">space
characters</a> are always allowed between elements. User agents
represent these characters between elements in the source markup as
text nodes in the DOM. Empty <a href="#text-node" title=
"text node">text nodes</a> and <a href="#text-node" title=
"text node">text nodes</a> consisting of just sequences of those
characters are considered <dfn id="inter-element">inter-element
whitespace</dfn> .</p>
<p><a href="#inter-element">Inter-element whitespace</a> , comment
nodes, and processing instruction nodes must be ignored when
establishing whether an element matches its content model or not,
and must be ignored when following algorithms that define document
and element semantics.</p>
<p>An element <var title="">A</var> is said to be <dfn id=
"preceded">preceded or followed</dfn> by a second element
<var title="">B</var> if <var title="">A</var> and <var title=
"">B</var> have the same parent node and there are no other element
nodes or text nodes (other than <a href=
"#inter-element">inter-element whitespace</a> ) between them.</p>
<p>Authors must <del class="diff-old">only</del> <ins class=
"diff-chg">not</ins> use <a href="#elements1">elements in the HTML
namespace</a> <del class="diff-old">in the contexts</del>
<ins class="diff-chg">anywhere except</ins> where they are
<ins class="diff-new">explicitly</ins> allowed, as defined for each
<del class="diff-old">element.</del> <ins class="diff-chg">element,
or as explicitly required by other specifications.</ins> For XML
compound documents, these contexts could be inside elements from
other namespaces, if those elements are defined as providing the
relevant contexts.</p>
<div class="example">
<p>The SVG specification defines the SVG <code>foreignObject</code>
element as allowing foreign namespaces to be included, thus
allowing compound documents to be created by inserting subdocument
content under that element. <em>This</em> specification defines the
XHTML <code><a href="#html">html</a></code> element as being
allowed where subdocument fragments are allowed in a compound
document. Together, these two definitions mean that placing an
XHTML <code><a href="#html">html</a></code> element as a child of
an SVG <code>foreignObject</code> element is conforming. <a href=
"#references"><ins class="diff-new">[SVG]</ins></a></p>
</div>
<div class="example">
<p><ins class="diff-new">The Atom specification defines the
Atom</ins> <code title=""><ins class=
"diff-new">content</ins></code> <ins class="diff-new">element, when
its</ins> <code title=""><ins class="diff-new">type</ins></code>
<ins class="diff-new">attribute has the value</ins> <code title=
""><ins class="diff-new">xhtml</ins></code> ,<ins class=
"diff-new">as requiring that it contains a single HTML</ins>
<code><a href="#div"><ins class="diff-new">div</ins></a></code>
<ins class="diff-new">element. Thus, a</ins> <code><a href=
"#div"><ins class="diff-new">div</ins></a></code> <ins class=
"diff-new">element is allowed in that context, even though this is
not explicitly normatively stated by this specification.</ins>
<a href="#references"><ins class="diff-new">[ATOM]</ins></a></p>
</div>
<p><ins class="diff-new">In addition,</ins> <a href=
"#elements1"><ins class="diff-new">elements in the HTML
namespace</ins></a> <ins class="diff-new">may be orphan nodes (i.e.
without a parent node).</ins></p>
<div class="example">
<p><ins class="diff-new">For example, creating a</ins>
<code><a href="#td"><ins class="diff-new">td</ins></a></code>
<ins class="diff-new">element and storing it in a global variable
in a script is conforming, even though</ins> <code><a href=
"#td"><ins class="diff-new">td</ins></a></code> <ins class=
"diff-new">elements are otherwise only supposed to be used
inside</ins> <code><a href="#tr"><ins class=
"diff-new">tr</ins></a></code> <ins class=
"diff-new">elements.</ins></p>
<pre>
var data = {<ins class="diff-new">
name: "Banana",
cell: document.createElement('td'),
};
</ins>
</pre></div>
<h4 id="kinds"><span class="secno"><del class=
"diff-old">3.3.3.</del> <ins class="diff-chg">3.3.3</ins></span>
Kinds of content</h4>
<p>Each element in HTML falls into zero or more categories that
group elements with similar characteristics together. The following
categories are used in this specification:</p>
<ul class="brief">
<li><a href="#metadata0">Metadata content</a></li>
<li><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a></li>
<li><a href="#sectioning0">Sectioning content</a></li>
<li><a href="#heading0">Heading content</a></li>
<li><a href="#phrasing0">Phrasing content</a></li>
<li><a href="#embedded1">Embedded content</a></li>
<li><span>Form control content</span></li>
<li><a href="#interactive1">Interactive content</a></li>
</ul>
<p>Some elements have unique requirements and do not fit into any
particular category.</p>
<h5 id="metadata"><span class="secno">3.3.3.1.</span> Metadata
content</h5>
<p><dfn id="metadata0">Metadata content</dfn> is content that sets
up the presentation or <del class="diff-old">behaviour</del>
<ins class="diff-chg">behavior</ins> of the rest of the content, or
that sets up the relationship of the document with other documents,
or that conveys other "out of band" information.</p>
<p>Elements from other namespaces whose semantics are primarily
metadata-related (e.g. RDF) are also <a href="#metadata0">metadata
content</a> .</p>
<h5 id="flow-content"><span class="secno">3.3.3.2.</span>
<del class="diff-old">Prose</del> <ins class="diff-chg">Flow</ins>
content</h5>
<p>Most elements that are used in the body of documents and
applications are <del class="diff-old">categorised</del>
<ins class="diff-chg">categorized</ins> as <del class=
"diff-old">prose</del> <dfn id="flow-content0"><ins class=
"diff-chg">flow</ins> content</dfn> .</p>
<p>As a general rule, elements whose content model allows any
<del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a>
should have either at least one descendant text node that is not
<a href="#inter-element">inter-element whitespace</a> , or at least
one descendant element node that is <a href="#embedded1">embedded
content</a> . For the purposes of this requirement, <code><a href=
"#del">del</a></code> elements and their descendants must not be
counted as contributing to the ancestors of the <code><a href=
"#del">del</a></code> element.</p>
<p>This requirement is not a hard requirement, however, as there
are many cases where an element can be empty legitimately, for
example when it is used as a placeholder which will later be filled
in by a script, or when the element is part of a template and would
on most pages be filled in but on some pages is not relevant.</p>
<h5 id="sectioning"><span class="secno">3.3.3.3.</span> Sectioning
content</h5>
<p><dfn id="sectioning0">Sectioning content</dfn> is content that
defines the scope of <a href="#heading0" title=
"heading content">headers</a> , <a href="#footer" title=
"footer">footers</a> , and <a href="#address" title=
"address">contact information</a> .</p>
<p>Each <a href="#sectioning0">sectioning content</a> element
potentially has a heading. See the section on <a href=
"#headings0">headings and sections</a> for further details.</p>
<h5 id="heading"><span class="secno">3.3.3.4.</span> Heading
content</h5>
<p><dfn id="heading0">Heading content</dfn> defines the header of a
section (whether explicitly marked up using <a href=
"#sectioning0">sectioning content</a> elements, or implied by the
heading content itself).</p>
<h5 id="phrasing"><span class="secno">3.3.3.5.</span> Phrasing
content</h5>
<p><dfn id="phrasing0">Phrasing content</dfn> is the text of the
document, as well as elements that mark up that text at the
intra-paragraph level. Runs of <a href="#phrasing0">phrasing
content</a> form <a href="#paragraph" title=
"paragraph">paragraphs</a> .</p>
<p>All <a href="#phrasing0">phrasing content</a> is also
<del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> . Any
content model that expects <del class="diff-old">prose</del>
<a href="#flow-content0"><ins class="diff-chg">flow</ins>
content</a> also expects <a href="#phrasing0">phrasing content</a>
.</p>
<p>As a general rule, elements whose content model allows any
<a href="#phrasing0">phrasing content</a> should have either at
least one descendant text node that is not <a href=
"#inter-element">inter-element whitespace</a> , or at least one
descendant element node that is <a href="#embedded1">embedded
content</a> . For the purposes of this requirement, nodes that are
descendants of <code><a href="#del">del</a></code> elements must
not be counted as contributing to the ancestors of the
<code><a href="#del">del</a></code> element.</p>
<p class="note">Most elements that are <del class=
"diff-old">categorised</del> <ins class=
"diff-chg">categorized</ins> as phrasing content can only contain
elements that are themselves <del class=
"diff-old">categorised</del> <ins class=
"diff-chg">categorized</ins> as phrasing content, not any
<del class="diff-old">prose</del> <ins class="diff-chg">flow</ins>
content.</p>
<p>Text nodes that are not <a href="#inter-element">inter-element
whitespace</a> are <a href="#phrasing0">phrasing content</a> .</p>
<h5 id="embedded"><span class="secno">3.3.3.6.</span> Embedded
content</h5>
<p><dfn id="embedded1">Embedded content</dfn> is content that
imports another resource into the document, or content from another
vocabulary that is inserted into the document.</p>
<p>All <a href="#embedded1">embedded content</a> is also <a href=
"#phrasing0">phrasing content</a> (and <del class=
"diff-old">prose</del> <a href="#flow-content0"><ins class=
"diff-chg">flow</ins> content</a> ). Any content model that expects
<a href="#phrasing0">phrasing content</a> (or <del class=
"diff-old">prose</del> <a href="#flow-content0"><ins class=
"diff-chg">flow</ins> content</a> ) also expects <a href=
"#embedded1">embedded content</a> .</p>
<p>Elements that are from namespaces other than the <a href=
"#html-namespace0">HTML namespace</a> and that convey content but
not metadata, are <a href="#embedded1">embedded content</a> for the
purposes of the content models defined in this specification. (For
example, MathML, or SVG.)</p>
<p>Some embedded content elements can have <dfn id=
"fallback">fallback content</dfn> : content that is to be used when
the external resource cannot be used (e.g. because it is of an
unsupported format). The element definitions state what the
fallback is, if any.</p>
<h5 id="interactive0"><span class="secno">3.3.3.7.</span>
Interactive content</h5>
<p class="big-issue">Parts of this section should eventually be
moved to DOM3 Events.</p>
<p><dfn id="interactive1">Interactive content</dfn> is content that
is specifically intended for user interaction.</p>
<p>Certain elements in HTML can be activated, for instance
<code><a href="#a">a</a></code> elements, <code>button</code>
elements, or <code>input</code> elements when their
<code>type</code> attribute is set to <code>radio</code> .
Activation of those elements can happen in various (UA-defined)
ways, for instance via the mouse or keyboard.</p>
<p>When activation is performed via some method other than clicking
the pointing device, the default action of the event that triggers
the activation must, instead of being activating the element
directly, be to <a href="#firing">fire a <code title=
"">click</code> event</a> on the same element.</p>
<p>The default action of this <code title=
"event-click">click</code> event, or of the real <code title=
"event-click">click</code> event if the element was activated by
clicking a pointing device, must be to <span title=
"fire a DOMActivate event">fire a further <code title=
"event-DOMActivate">DOMActivate</code> event</span> at the same
element, whose own default action is to go through all the elements
the <code title="event-DOMActivate">DOMActivate</code> event
bubbled through (starting at the target node and going towards the
<code>Document</code> node), looking for an element with an
<a href="#activation0">activation behavior</a> ; the first element,
in reverse tree order, to have one, must have its activation
behavior executed.</p>
<p class="note">The above doesn't happen for arbitrary synthetic
events dispatched by author script. However, the <code title=
"dom-click"><a href="#click">click()</a></code> method can be used
to make it happen programmatically.</p>
<p>For certain form controls, this process is complicated further
by <a href=
"http://www.whatwg.org/specs/web-forms/current-work/#the-click">changes
that must happen around the click event</a> . <a href=
"#references">[WF2]</a></p>
<p class="note">Most interactive elements have content models that
disallow nesting interactive elements.</p>
<h4 id="transparent"><span class="secno"><del class=
"diff-old">3.3.4.</del> <ins class="diff-chg">3.3.4</ins></span>
Transparent content models</h4>
<p>Some elements are described as <dfn id=
"transparent0">transparent</dfn> ; they have "transparent" as their
content model. Some elements are described as <dfn id=
"semi-transparent">semi-transparent</dfn> ; this means that part of
their content model is "transparent" but that is not the only part
of the content model that must be satisfied.</p>
<p>When a content model includes a part that is "transparent",
those parts must <del class="diff-old">only</del> <ins class=
"diff-chg">not</ins> contain content that would <del class=
"diff-old">still</del> <ins class="diff-chg">not</ins> be
conformant if all transparent and semi-transparent elements in the
tree were replaced, in their parent element, by the children in the
"transparent" part of their content model, retaining order.</p>
<p>When a transparent or semi-transparent element has no parent,
then the part of its content model that is "transparent" must
instead be treated as accepting any <del class=
"diff-old">prose</del> <a href="#flow-content0"><ins class=
"diff-chg">flow</ins> content</a> .</p>
<h4 id="paragraphs"><span class="secno"><del class=
"diff-old">3.3.5.</del> <ins class="diff-chg">3.3.5</ins></span>
Paragraphs</h4>
<p>A <dfn id="paragraph">paragraph</dfn> is typically a block of
text with one or more sentences that discuss a particular topic, as
in typography, but can also be used for more general thematic
grouping. For instance, an address is also a paragraph, as is a
part of a form, a byline, or a stanza in a poem.</p>
<p>Paragraphs in <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> are
defined relative to what the document looks like without the
<code><a href="#ins">ins</a></code> and <code><a href=
"#del">del</a></code> elements complicating matters. Let
<var title="">view</var> be a view of the DOM that replaces all
<code><a href="#ins">ins</a></code> and <code><a href=
"#del">del</a></code> elements in the document with their contents.
Then, in <var title="">view</var> , for each run of <a href=
"#phrasing0">phrasing content</a> uninterrupted by other types of
content, in an element that accepts content other than <a href=
"#phrasing0">phrasing content</a> , let <var title="">first</var>
be the first node of the run, and let <var title="">last</var> be
the last node of the run. For each run, a paragraph exists in the
original DOM from immediately before <var title="">first</var> to
immediately after <var title="">last</var> . (Paragraphs can thus
span across <code><a href="#ins">ins</a></code> and <code><a href=
"#del">del</a></code> elements.)</p>
<p>A <a href="#paragraph">paragraph</a> is also formed by
<code><a href="#p">p</a></code> elements.</p>
<p class="note">The <code><a href="#p">p</a></code> element can be
used to wrap individual paragraphs when there would otherwise not
be any content other than phrasing content to separate the
paragraphs from each other.</p>
<div class="example">
<p>In the following example, there are two paragraphs in a section.
There is also a header, which contains phrasing content that is not
a paragraph. Note how the comments and <span>intra-element
whitespace</span> do not form paragraphs.</p>
<pre>
<section>
<h1>Example of paragraphs</h1>
This is the <em>first</em> paragraph in this example.
<p>This is the second.</p>
<!-- This is not a paragraph. -->
</section>
</pre>
<p>The following example takes that markup and puts <code><a href=
"#ins">ins</a></code> and <code><a href="#del">del</a></code>
elements around some of the markup to show that the text was
changed (though in this case, the changes don't really make much
sense, admittedly). Notice how this example has exactly the same
paragraphs as the previous one, despite the <code><a href=
"#ins">ins</a></code> and <code><a href="#del">del</a></code>
elements.</p>
<pre>
<section>
<ins><h1>Example of paragraphs</h1>
This is the <em>first</em> paragraph in</ins> this example<del>.
<p>This is the second.</p></del>
<!-- This is not a paragraph. -->
</section>
</pre></div>
<h3 id="global"><span class="secno"><del class=
"diff-old">3.4.</del> <ins class="diff-chg">3.4</ins></span> Global
attributes</h3>
<p>The following attributes are common to and may be specified on
all <a href="#html-elements">HTML elements</a> (even those not
defined in this specification):</p>
<dl class="element">
<dt>Global attributes:</dt>
<dd><code title="attr-class"><a href="#class">class</a></code></dd>
<dd><code title="attr-contenteditable"><a href=
"#contenteditable0">contenteditable</a></code></dd>
<dd><code title="attr-contextmenu"><a href=
"#contextmenu">contextmenu</a></code></dd>
<dd><code title="attr-dir"><a href="#dir">dir</a></code></dd>
<dd><code title="attr-draggable"><a href=
"#draggable">draggable</a></code></dd>
<dd><code title="attr-id"><a href="#id">id</a></code></dd>
<dd><code title="attr-irrelevant"><a href=
"#irrelevant">irrelevant</a></code></dd>
<dd><code title="attr-lang"><a href="#lang">lang</a></code></dd>
<dd><code title="attr-ref"><a href="#ref">ref</a></code></dd>
<dd><code title="attr-registrationmark"><a href=
"#registrationmark">registrationmark</a></code></dd>
<dd><code title="attr-style"><a href="#style"><ins class=
"diff-new">style</ins></a></code></dd>
<dd><code title="attr-tabindex"><a href=
"#tabindex">tabindex</a></code></dd>
<dd><code title="attr-template"><a href=
"#template">template</a></code></dd>
<dd><code title="attr-title"><a href="#title">title</a></code></dd>
</dl>
<p>In addition, the following <a href="#event3">event handler
content attributes</a> may be specified on any <span>HTML
element</span> :</p>
<dl class="element">
<dt>Event handler content attributes:</dt>
<dd><code title="handler-onabort"><a href=
"#onabort">onabort</a></code></dd>
<dd><code title="handler-onbeforeunload"><a href=
"#onbeforeunload">onbeforeunload</a></code></dd>
<dd><code title="handler-onblur"><a href=
"#onblur">onblur</a></code></dd>
<dd><code title="handler-onchange"><a href=
"#onchange">onchange</a></code></dd>
<dd><code title="handler-onclick"><a href=
"#onclick">onclick</a></code></dd>
<dd><code title="handler-oncontextmenu"><a href=
"#oncontextmenu">oncontextmenu</a></code></dd>
<dd><code title="handler-ondblclick"><a href=
"#ondblclick">ondblclick</a></code></dd>
<dd><code title="handler-ondrag"><a href=
"#ondrag">ondrag</a></code></dd>
<dd><code title="handler-ondragend"><a href=
"#ondragend">ondragend</a></code></dd>
<dd><code title="handler-ondragenter"><a href=
"#ondragenter">ondragenter</a></code></dd>
<dd><code title="handler-ondragleave"><a href=
"#ondragleave">ondragleave</a></code></dd>
<dd><code title="handler-ondragover"><a href=
"#ondragover">ondragover</a></code></dd>
<dd><code title="handler-ondragstart"><a href=
"#ondragstart">ondragstart</a></code></dd>
<dd><code title="handler-ondrop"><a href=
"#ondrop">ondrop</a></code></dd>
<dd><code title="handler-onerror"><a href=
"#onerror">onerror</a></code></dd>
<dd><code title="handler-onfocus"><a href=
"#onfocus">onfocus</a></code></dd>
<dd><code title="handler-onkeydown"><a href=
"#onkeydown">onkeydown</a></code></dd>
<dd><code title="handler-onkeypress"><a href=
"#onkeypress">onkeypress</a></code></dd>
<dd><code title="handler-onkeyup"><a href=
"#onkeyup">onkeyup</a></code></dd>
<dd><code title="handler-onload"><a href=
"#onload">onload</a></code></dd>
<dd><code title="handler-onmessage"><a href=
"#onmessage">onmessage</a></code></dd>
<dd><code title="handler-onmousedown"><a href=
"#onmousedown">onmousedown</a></code></dd>
<dd><code title="handler-onmousemove"><a href=
"#onmousemove">onmousemove</a></code></dd>
<dd><code title="handler-onmouseout"><a href=
"#onmouseout">onmouseout</a></code></dd>
<dd><code title="handler-onmouseover"><a href=
"#onmouseover">onmouseover</a></code></dd>
<dd><code title="handler-onmouseup"><a href=
"#onmouseup">onmouseup</a></code></dd>
<dd><code title="handler-onmousewheel"><a href=
"#onmousewheel">onmousewheel</a></code></dd>
<dd><code title="handler-onresize"><a href=
"#onresize">onresize</a></code></dd>
<dd><code title="handler-onscroll"><a href=
"#onscroll">onscroll</a></code></dd>
<dd><code title="handler-onselect"><a href=
"#onselect">onselect</a></code></dd>
<dd><code title="handler-onstorage"><a href=
"#onstorage"><ins class="diff-new">onstorage</ins></a></code></dd>
<dd><code title="handler-onsubmit"><a href=
"#onsubmit">onsubmit</a></code></dd>
<dd><code title="handler-onunload"><a href=
"#onunload">onunload</a></code></dd>
</dl>
<p><ins class="diff-new">Also,</ins> <a href="#custom" title=
"custom data attribute"><ins class="diff-new">custom data
attributes</ins></a> <ins class="diff-new">(e.g.</ins> <code title=
""><ins class="diff-new">data-foldername</ins></code> <ins class=
"diff-new">or</ins> <code title=""><ins class=
"diff-new">data-msgid</ins></code> <ins class="diff-new">) can be
specified on any</ins> <span><ins class="diff-new">HTML
element</ins></span> ,<ins class="diff-new">to store custom data
specific to the page.</ins></p>
<p><ins class="diff-new">In</ins> <a href="#html-"><ins class=
"diff-new">HTML documents</ins></a> ,<ins class=
"diff-new">the</ins> <code><a href="#html"><ins class=
"diff-new">html</ins></a></code> <ins class="diff-new">element, and
any other elements in the</ins> <a href=
"#html-namespace0"><ins class="diff-new">HTML namespace</ins></a>
<ins class="diff-new">whose parent element is not in the</ins>
<a href="#html-namespace0"><ins class="diff-new">HTML
namespace</ins></a> ,<ins class="diff-new">may have an</ins>
<code title=""><ins class="diff-new">xmlns</ins></code> <ins class=
"diff-new">attribute specified, if, and only if, it has the exact
value "</ins> <code><ins class=
"diff-new">http://www.w3.org/1999/xhtml</ins></code> <ins class=
"diff-new">". This does not apply to</ins> <a href=
"#xml-documents"><ins class="diff-new">XML documents</ins></a>
.</p>
<p class="note"><ins class="diff-new">In HTML, the</ins>
<code title=""><ins class="diff-new">xmlns</ins></code> <ins class=
"diff-new">attribute has absolutely no effect. It is basically a
talisman. It is allowed merely to make migration to and from XHTML
mildly easier. When parsed by an</ins> <a href=
"#html-0"><ins class="diff-new">HTML parser</ins></a> ,<ins class=
"diff-new">the attribute ends up in no namespace, not the "</ins>
<code><ins class=
"diff-new">http://www.w3.org/2000/xmlns/</ins></code> <ins class=
"diff-new">" namespace like namespace declaration attributes in XML
do.</ins></p>
<p class="note"><ins class="diff-new">In XML, an</ins> <code title=
""><ins class="diff-new">xmlns</ins></code> <ins class=
"diff-new">attribute is part of the namespace declaration
mechanism, and an element cannot actually have an</ins>
<code title=""><ins class="diff-new">xmlns</ins></code> <ins class=
"diff-new">attribute in no namespace specified.</ins></p>
<h4 id="the-id"><span class="secno"><del class=
"diff-old">3.4.1.</del> <ins class="diff-chg">3.4.1</ins></span>
The <dfn id="id" title="attr-id"><code>id</code></dfn>
attribute</h4>
<p>The <code title="attr-id"><a href="#id">id</a></code> attribute
represents its element's unique identifier. The value must be
unique in the subtree within which the element finds itself and
must contain at least one character. The value must not contain any
<a href="#space" title="space character">space characters</a> .</p>
<p>If the value is not the empty string, user agents must associate
the element with the given value (exactly, including any space
characters) for the purposes of ID matching within the subtree the
element finds itself (e.g. for selectors in CSS or for the
<code>getElementById()</code> method in the DOM).</p>
<p>Identifiers are opaque strings. Particular meanings should not
be derived from the value of the <code title="attr-id"><a href=
"#id">id</a></code> attribute.</p>
<p>This specification doesn't preclude an element having multiple
IDs, if other mechanisms (e.g. DOM Core methods) can set an
element's ID in a way that doesn't conflict with the <code title=
"attr-id"><a href="#id">id</a></code> attribute.</p>
<p>The <dfn id="id0" title="dom-id"><code>id</code></dfn> DOM
attribute must <a href="#reflect">reflect</a> the <code title=
"attr-id"><a href="#id">id</a></code> content attribute.</p>
<h4 id="the-title"><span class="secno"><del class=
"diff-old">3.4.2.</del> <ins class="diff-chg">3.4.2</ins></span>
The <dfn id="title" title="attr-title"><code>title</code></dfn>
attribute</h4>
<p>The <code title="attr-title"><a href="#title">title</a></code>
attribute represents advisory information for the element, such as
would be appropriate for a tooltip. On a link, this could be the
title or a description of the target resource; on an image, it
could be the image credit or a description of the image; on a
paragraph, it could be a footnote or commentary on the text; on a
citation, it could be further information about the source; and so
forth. The value is text.</p>
<p>If this attribute is omitted from an element, then it implies
that the <code title="attr-title"><a href="#title">title</a></code>
attribute of the nearest ancestor <a href="#html-elements" title=
"HTML elements">HTML element</a> with a <code title=
"attr-title"><a href="#title">title</a></code> attribute set is
also relevant to this element. Setting the attribute overrides
this, explicitly stating that the advisory information of any
ancestors is not relevant to this element. Setting the attribute to
the empty string indicates that the element has no advisory
information.</p>
<p>If the <code title="attr-title"><a href=
"#title">title</a></code> attribute's value contains U+000A LINE
FEED (LF) characters, the content is split into multiple lines.
Each U+000A LINE FEED (LF) character represents a line break.</p>
<p>Some elements, such as <code><a href="#link">link</a></code> and
<code><del class="diff-old">dfn</del> <a href="#abbr"><ins class=
"diff-chg">abbr</ins></a></code> , define additional semantics for
the <code title="attr-title"><a href="#title">title</a></code>
attribute beyond the semantics described above.</p>
<p>The <dfn id="title0" title="dom-title"><code>title</code></dfn>
DOM attribute must <a href="#reflect">reflect</a> the <code title=
"attr-title"><a href="#title">title</a></code> content
attribute.</p>
<h4 id="the-lang"><span class="secno"><del class=
"diff-old">3.4.3.</del> <ins class="diff-chg">3.4.3</ins></span>
The <dfn id="lang" title="attr-lang"><code>lang</code></dfn> (HTML
only) and <dfn id="xmllang" title=
"attr-xml-lang"><code>xml:lang</code></dfn> (XML only)
attributes</h4>
<p>The <code title="attr-lang"><a href="#lang">lang</a></code>
attribute specifies the primary <dfn id="language">language</dfn>
for the element's contents and for any of the element's attributes
that contain text. Its value must be a valid RFC 3066 language
code, or the empty string. <a href="#references">[RFC3066]</a></p>
<p>The <code title="attr-xml-lang"><a href=
"#xmllang">xml:lang</a></code> attribute is defined in XML.
<a href="#references">[XML]</a></p>
<p>If these attributes are omitted from an element, then it implies
that the language of this element is the same as the language of
the parent element. Setting the attribute to the empty string
indicates that the primary language is unknown.</p>
<p>The <code title="attr-lang"><a href="#lang">lang</a></code>
attribute may <del class="diff-old">only</del> be used on elements
of <a href="#html-">HTML documents</a> . Authors must not use the
<code title="attr-lang"><a href="#lang">lang</a></code> attribute
in <a href="#xml-documents">XML documents</a> .</p>
<p>The <code title="attr-xml-lang"><a href=
"#xmllang">xml:lang</a></code> attribute may <del class=
"diff-old">only</del> be used on elements of <a href=
"#xml-documents">XML documents</a> . Authors must not use the
<code title="attr-xml-lang"><a href="#xmllang">xml:lang</a></code>
attribute in <a href="#html-">HTML documents</a> .</p>
<p>To determine the language of a node, user agents must look at
the nearest ancestor element (including the element itself if the
node is an element) that has an <code title=
"attr-xml-lang"><a href="#xmllang">xml:lang</a></code> attribute
set or is an <a href="#html-elements" title="HTML elements">HTML
element</a> and has a <code title="attr-lang"><a href=
"#lang">lang</a></code> attribute set. That attribute specifies the
language of the node.</p>
<p>If both the <code title="attr-xml-lang"><a href=
"#xmllang">xml:lang</a></code> attribute and the <code title=
"attr-lang"><a href="#lang">lang</a></code> attribute are set on an
element, user agents must use the <code title=
"attr-xml-lang"><a href="#xmllang">xml:lang</a></code> attribute,
and the <code title="attr-lang"><a href="#lang">lang</a></code>
attribute must be <a href="#ignored" title="ignore">ignored</a> for
the purposes of determining the element's language.</p>
<p>If no explicit language is given for the <a href=
"#root-element">root element</a> , then language information from a
higher-level protocol (such as HTTP), if any, must be used as the
final fallback language. In the absence of any language
information, the default value is unknown (the empty string).</p>
<p>User agents may use the element's language to determine proper
processing or rendering (e.g. in the selection of appropriate fonts
or <del class="diff-old">pronounciations,</del> <ins class=
"diff-chg">pronunciations,</ins> or for dictionary selection).</p>
<p>The <dfn id="lang0" title="dom-lang"><code>lang</code></dfn> DOM
attribute must <a href="#reflect">reflect</a> the <code title=
"attr-lang"><a href="#lang">lang</a></code> content attribute.</p>
<h4 id="the-xmlbase"><span class="secno"><ins class=
"diff-new">3.4.4</ins></span> <ins class="diff-new">The</ins>
<dfn id="xmlbase" title="attr-xml-base"><code><ins class=
"diff-new">xml:base</ins></code></dfn> <ins class=
"diff-new">attribute (XML only)</ins></h4>
<p><ins class="diff-new">The</ins> <code title=
"attr-xml-base"><a href="#xmlbase"><ins class=
"diff-new">xml:base</ins></a></code> <ins class=
"diff-new">attribute is defined in XML Base.</ins> <a href=
"#references"><ins class="diff-new">[XMLBASE]</ins></a></p>
<p><ins class="diff-new">The</ins> <code title=
"attr-xml-base"><a href="#xmlbase"><ins class=
"diff-new">xml:base</ins></a></code> <ins class=
"diff-new">attribute may be used on elements of</ins> <a href=
"#xml-documents"><ins class="diff-new">XML documents</ins></a>
.<ins class="diff-new">Authors must not use the</ins> <code title=
"attr-xml-base"><a href="#xmlbase"><ins class=
"diff-new">xml:base</ins></a></code> <ins class=
"diff-new">attribute in</ins> <a href="#html-"><ins class=
"diff-new">HTML documents</ins></a> .</p>
<h4 id="the-dir"><span class="secno"><del class=
"diff-old">3.4.4.</del> <ins class="diff-chg">3.4.5</ins></span>
The <dfn id="dir" title="attr-dir"><code>dir</code></dfn>
attribute</h4>
<p>The <code title="attr-dir"><a href="#dir">dir</a></code>
attribute specifies the element's text directionality. The
attribute is an <a href="#enumerated">enumerated attribute</a> with
the keyword <code title="">ltr</code> mapping to the state
<em>ltr</em> , and the keyword <code title="">rtl</code> mapping to
the state <em>rtl</em> . The attribute has no defaults.</p>
<p>If the attribute has the state <em>ltr</em> , the element's
directionality is left-to-right. If the attribute has the state
<em>rtl</em> , the element's directionality is right-to-left.
Otherwise, the element's directionality is the same as its
<del class="diff-old">parent.</del> <ins class="diff-chg">parent
element, or</ins> <em><ins class="diff-chg">ltr</ins></em>
<ins class="diff-chg">if there is no parent element.</ins></p>
<p>The processing of this attribute depends on the presentation
layer. For example, CSS 2.1 defines a mapping from this attribute
to the CSS 'direction' and 'unicode-bidi' properties, and defines
rendering in terms of those properties.</p>
<p>The <dfn id="dir0" title="dom-dir"><code>dir</code></dfn> DOM
attribute on an element must <a href="#reflect">reflect</a> the
<code title="attr-dir"><a href="#dir">dir</a></code> content
attribute of that element, <a href="#limited0">limited to only
known values</a> .</p>
<p>The <dfn id="dir1" title=
"dom-document-dir"><code>dir</code></dfn> DOM attribute on
<code><a href="#htmldocument">HTMLDocument</a></code> objects must
<a href="#reflect">reflect</a> the <code title="attr-dir"><a href=
"#dir">dir</a></code> content attribute of <a href="#the-html0">the
<code>html</code> element</a> , if any, <a href="#limited0">limited
to only known values</a> . If there is no such element, then the
attribute must return the empty string and do nothing on
setting.</p>
<h4 id="classes"><span class="secno"><del class=
"diff-old">3.4.5.</del> <ins class="diff-chg">3.4.6</ins></span>
The <dfn id="class" title="attr-class"><code>class</code></dfn>
attribute</h4>
<p>Every <a href="#html-elements" title="HTML elements">HTML
element</a> may have a <code title="attr-class"><a href=
"#class">class</a></code> attribute specified.</p>
<p>The attribute, if specified, must have a value that is an
<a href="#unordered">unordered set of unique space-separated
tokens</a> representing the various classes that the element
belongs to.</p>
<p>The classes that an <a href="#html-elements" title=
"HTML elements">HTML element</a> has assigned to it consists of all
the classes returned when the value of the <code title=
"attr-class"><a href="#class">class</a></code> attribute is
<a href="#split" title="split a string on spaces">split on
spaces</a> .</p>
<p class="note">Assigning classes to an element affects class
matching in selectors in CSS, the <code title=
"dom-document-getElementsByClassName"><a href=
"#getelementsbyclassname">getElementsByClassName()</a></code>
method in the DOM, and other such features.</p>
<p>Authors may use any value in the <code title=
"attr-class"><a href="#class">class</a></code> attribute, but are
encouraged to use the values that describe the nature of the
content, rather than values that describe the desired presentation
of the content.</p>
<p>The <dfn id="classname" title=
"dom-className"><code>className</code></dfn> and <dfn id=
"classlist" title="dom-classList"><code>classList</code></dfn> DOM
attributes must both <a href="#reflect">reflect</a> the
<code title="attr-class"><a href="#class">class</a></code> content
attribute.</p>
<h4 id="the-irrelevant"><span class="secno"><del class=
"diff-old">3.4.6.</del> <ins class="diff-chg">3.4.7</ins></span>
The <dfn id="irrelevant" title=
"attr-irrelevant"><code>irrelevant</code></dfn> attribute</h4>
<p>All elements may have the <code title="attr-irrelevant"><a href=
"#irrelevant">irrelevant</a></code> content attribute set. The
<code title="attr-irrelevant"><a href=
"#irrelevant">irrelevant</a></code> attribute is a <a href=
"#boolean0">boolean attribute</a> . When specified on an element,
it indicates that the element is not yet, or is no longer,
relevant. User agents should not render elements that have the
<code title="attr-irrelevant"><a href=
"#irrelevant">irrelevant</a></code> attribute specified.</p>
<div class="example">
<p>In the following skeletal example, the attribute is used to hide
the Web game's main screen until the user logs in:</p>
<pre>
<h1>The Example Game</h1>
<section id="login">
<h2>Login</h2>
<form>
...
<!-- calls login() once the user's credentials have been checked -->
</form>
<script>
function login() {
// switch screens
document.getElementById('login').irrelevant = true;
document.getElementById('game').irrelevant = false;
}
</script>
</section>
<section id="game" irrelevant>
...
</section>
</pre></div>
<p>The <code title="attr-irrelevant"><a href=
"#irrelevant">irrelevant</a></code> attribute must not be used to
hide content that could legitimately be shown in another
presentation. For example, it is incorrect to use <code title=
"attr-irrelevant"><a href="#irrelevant">irrelevant</a></code> to
hide panels in a tabbed dialog, because the tabbed interface is
merely a kind of overflow presentation — showing all the form
controls in one big page with a scrollbar would be equivalent, and
no less correct.</p>
<p>Elements in a section hidden by the <code title=
"attr-irrelevant"><a href="#irrelevant">irrelevant</a></code>
attribute are still active, e.g. scripts and form controls in such
sections still render execute and submit respectively. Only their
presentation to the user changes.</p>
<p>The <dfn id="irrelevant0" title=
"dom-irrelevant"><code>irrelevant</code></dfn> DOM attribute must
<a href="#reflect">reflect</a> the content attribute of the same
name.</p>
<h4 id="the-style"><span class="secno"><ins class=
"diff-new">3.4.8</ins></span> <ins class="diff-new">The</ins>
<dfn id="style" title="attr-style"><code><ins class=
"diff-new">style</ins></code></dfn> <ins class=
"diff-new">attribute</ins></h4>
<p><ins class="diff-new">All elements may have the</ins>
<code title="attr-style"><a href="#style"><ins class=
"diff-new">style</ins></a></code> <ins class="diff-new">content
attribute set. If specified, the attribute must contain only a list
of zero or more semicolon-separated (;) CSS declarations.</ins>
<a href="#references"><ins class="diff-new">[CSS21]</ins></a></p>
<p><ins class="diff-new">The attribute, if specified, must be
parsed and treated as the body (the part inside the curly brackets)
of a declaration block in a rule whose selector matches just the
element on which the attribute is set. For the purposes of the CSS
cascade, the attribute must be considered to be a 'style' attribute
at the author level.</ins></p>
<p><ins class="diff-new">Documents that use</ins> <code title=
"attr-style"><a href="#style"><ins class=
"diff-new">style</ins></a></code> <ins class="diff-new">attributes
on any of their elements must still be comprehensible and usable if
those attributes were removed.</ins></p>
<p class="note"><ins class="diff-new">In particular, using
the</ins> <code title="attr-style"><a href="#style"><ins class=
"diff-new">style</ins></a></code> <ins class="diff-new">attribute
to hide and show content, or to convey meaning that is otherwise
not included in the document, is non-conforming.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="style0" title=
"dom-style"><code><ins class="diff-new">style</ins></code></dfn>
<ins class="diff-new">DOM attribute must return a</ins>
<code><ins class="diff-new">CSSStyleDeclaration</ins></code>
<ins class="diff-new">whose value represents the declarations
specified in the attribute, if present. Mutating the</ins>
<code><ins class="diff-new">CSSStyleDeclaration</ins></code>
<ins class="diff-new">object must create a</ins> <code title=
"attr-font-style"><ins class="diff-new">style</ins></code>
<ins class="diff-new">attribute on the element (if there isn't one
already) and then change its value to be a value representing the
serialized form of the</ins> <code><ins class=
"diff-new">CSSStyleDeclaration</ins></code> <ins class=
"diff-new">object.</ins> <a href="#references"><ins class=
"diff-new">[CSSOM]</ins></a></p>
<div class="example">
<p><ins class="diff-new">In the following example, the words that
refer to colors are marked up using the</ins> <code><a href=
"#span"><ins class="diff-new">span</ins></a></code> <ins class=
"diff-new">element and the</ins> <code title="attr-style"><a href=
"#style"><ins class="diff-new">style</ins></a></code> <ins class=
"diff-new">attribute to make those words show up in the relevant
colors in visual media.</ins></p>
<pre>
<p>My sweat suit is <span style="color: green; background:<ins class="diff-new">
transparent">green</span> and my eyes are <span style="color: blue;
background:
transparent">
blue</span>.</p>
</ins>
</pre></div>
<h4 id="embedding"><span class="secno"><ins class=
"diff-new">3.4.9</ins></span> <dfn id="embedding0"><ins class=
"diff-new">Embedding custom non-visible data</ins></dfn></h4>
<p><ins class="diff-new">A</ins> <dfn id="custom"><ins class=
"diff-new">custom data attribute</ins></dfn> <ins class=
"diff-new">is an attribute whose name starts with the string
"</ins> <dfn id="data-" title="attr-data-*"><code><ins class=
"diff-new">data-</ins></code></dfn> <ins class="diff-new">" and has
at least one character after the hyphen.</ins></p>
<p><a href="#custom" title="custom data attribute"><ins class=
"diff-new">Custom data attributes</ins></a> <ins class=
"diff-new">are intended to store custom data private to the page or
application, for which there are no more appropriate attributes or
elements.</ins></p>
<p><ins class="diff-new">Every</ins> <a href="#html-elements"
title="HTML elements"><ins class="diff-new">HTML element</ins></a>
<ins class="diff-new">may have any number of</ins> <a href=
"#custom" title="custom data attribute"><ins class=
"diff-new">custom data attributes</ins></a> <ins class=
"diff-new">specified, with any value.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="dataset" title=
"dom-dataset"><code><ins class=
"diff-new">dataset</ins></code></dfn> <ins class="diff-new">DOM
attribute provides convenient accessors for all the</ins>
<code title="attr-data-*"><a href="#data-"><ins class=
"diff-new">data-*</ins></a></code> <ins class="diff-new">attributes
on an element. On getting, the</ins> <code title=
"dom-dataset"><a href="#dataset"><ins class=
"diff-new">dataset</ins></a></code> <ins class="diff-new">DOM
attribute must return a</ins> <code><a href=
"#domstringmap0"><ins class=
"diff-new">DOMStringMap</ins></a></code> <ins class=
"diff-new">object, associated with the following three algorithms,
which expose these attributes on their element:</ins></p>
<dl>
<dt><ins class="diff-new">The algorithm for getting values from
names</ins></dt>
<dd>
<ol>
<li><ins class="diff-new">Let</ins> <var title=""><ins class=
"diff-new">name</ins></var> <ins class="diff-new">be the
concatenation of the string</ins> <code title=""><ins class=
"diff-new">data-</ins></code> <ins class="diff-new">and the name
passed to the algorithm.</ins></li>
<li><ins class="diff-new">If the element does not have an attribute
with the name</ins> <var title=""><ins class=
"diff-new">name</ins></var> ,<ins class="diff-new">then the name
has no corresponding value, abort.</ins></li>
<li><ins class="diff-new">Otherwise, return the value of the
attribute with the name</ins> <var title=""><ins class=
"diff-new">name</ins></var> .</li>
</ol>
</dd>
<dt><ins class="diff-new">The algorithm for setting names to
certain values</ins></dt>
<dd>
<ol>
<li><ins class="diff-new">Let</ins> <var title=""><ins class=
"diff-new">name</ins></var> <ins class="diff-new">be the
concatenation of the string</ins> <code title=""><ins class=
"diff-new">data-</ins></code> <ins class="diff-new">and the name
passed to the algorithm.</ins></li>
<li><ins class="diff-new">Let</ins> <var title=""><ins class=
"diff-new">value</ins></var> <ins class="diff-new">be the value
passed to the algorithm.</ins></li>
<li><ins class="diff-new">Set the value of the attribute with the
name</ins> <var title=""><ins class="diff-new">name</ins></var>
,<ins class="diff-new">to the value</ins> <var title=""><ins class=
"diff-new">value</ins></var> ,<ins class="diff-new">replacing any
previous value if the attribute already existed. If</ins>
<code title=""><ins class="diff-new">setAttribute()</ins></code>
<ins class="diff-new">would have raised an exception when setting
an attribute with the name</ins> <var title=""><ins class=
"diff-new">name</ins></var> ,<ins class="diff-new">then this must
raise the same exception.</ins></li>
</ol>
</dd>
<dt><ins class="diff-new">The algorithm for deleting
names</ins></dt>
<dd>
<ol>
<li><ins class="diff-new">Let</ins> <var title=""><ins class=
"diff-new">name</ins></var> <ins class="diff-new">be the
concatenation of the string</ins> <code title=""><ins class=
"diff-new">data-</ins></code> <ins class="diff-new">and the name
passed to the algorithm.</ins></li>
<li><ins class="diff-new">Remove the attribute with the name</ins>
<var title=""><ins class="diff-new">name</ins></var> ,<ins class=
"diff-new">if such an attribute exists. Do nothing
otherwise.</ins></li>
</ol>
</dd>
</dl>
<div class="example">
<p><ins class="diff-new">If a Web page wanted an element to
represent a space ship, e.g. as part of a game, it would have to
use the</ins> <code class="attr-class"><ins class=
"diff-new">class</ins></code> <ins class="diff-new">attribute along
with</ins> <code title="attr-data-*"><a href="#data-"><ins class=
"diff-new">data-*</ins></a></code> <ins class=
"diff-new">attributes:</ins></p>
<pre>
<ins class="diff-new">
<div class="spaceship" data-id="92432"
data-weapons="laser 2" data-shields="50%"
data-x="30" data-y="10" data-z="90">
<button class="fire"
onclick="spaceships[this.parentNode.dataset.id].fire()">
Fire
</button>
</div>
</ins>
</pre></div>
<p><ins class="diff-new">Authors should carefully design such
extensions so that when the attributes are ignored and any
associated CSS dropped, the page is still usable.</ins></p>
<p><ins class="diff-new">User agents must not derive any
implementation behavior from these attributes or values.
Specifications intended for user agents must not define these
attributes to have any meaningful values.</ins></p>
<h3 id="interaction"><span class="secno"><del class=
"diff-old">3.5.</del> <ins class="diff-chg">3.5</ins></span>
<dfn id="interaction0">Interaction</dfn></h3>
<h4 id="activation"><span class="secno"><del class=
"diff-old">3.5.1.</del> <ins class="diff-chg">3.5.1</ins></span>
Activation</h4>
<p>The <dfn id="click" title="dom-click">click()</dfn> method must
<a href="#firing">fire a <code>click</code> event</a> at the
element, whose default action is the <span title=
"fire a DOMActivate event">firing of a further <code title=
"event-DOMActivate">DOMActivate</code> event</span> at the same
element, whose own default action is to go through all the elements
the <code title="event-DOMActivate">DOMActivate</code> event
bubbled through (starting at the target node and going towards the
<code>Document</code> node), looking for an element with an
<a href="#activation0">activation behavior</a> ; the first element,
in reverse tree order, to have one, must have its activation
behavior executed.</p>
<h4 id="focus"><span class="secno"><del class=
"diff-old">3.5.2.</del> <ins class="diff-chg">3.5.2</ins></span>
Focus</h4>
<p>When an element is <em>focused</em> , key events received by the
document must be targeted at that element. There <del class=
"diff-old">is always an</del> <ins class="diff-chg">may be no</ins>
element focused; <del class="diff-old">in the absence of other
elements being</del> <ins class="diff-chg">when no element is</ins>
focused, <ins class="diff-new">key events received by</ins> the
<del class="diff-old">document's root</del> <ins class=
"diff-chg">document must be targetted at</ins> <a href=
"#the-body1"><ins class="diff-chg">the</ins> <code><ins class=
"diff-chg">body</ins></code> element <del class="diff-old">is
it.</del></a> .</p>
<p><ins class="diff-chg">User agents may track focus for each</ins>
<a href="#browsing1"><ins class="diff-chg">browsing
context</ins></a> <ins class="diff-chg">or</ins> <code><ins class=
"diff-chg">Document</ins></code> <ins class=
"diff-chg">individually, or may support only one focused elment
per</ins> <a href="#top-level"><ins class="diff-chg">top-level
browsing context</ins></a> <ins class="diff-chg">— user agents
should follow platform conventions in this regard.</ins></p>
<p>Which <del class="diff-old">element</del> <ins class=
"diff-chg">element(s)</ins> within a <del class=
"diff-old">document</del> <a href="#top-level"><ins class=
"diff-chg">top-level browsing context</ins></a> currently has focus
<del class="diff-old">is</del> <ins class="diff-chg">must be</ins>
independent of whether or not the <del class=
"diff-old">document</del> <a href="#top-level"><ins class=
"diff-chg">top-level browsing context</ins></a> itself has the
<em>system focus</em> . <del class="diff-old">Some focusable
elements might take part in sequential focus navigation .</del></p>
<h5 id="focus-management"><span class="secno">3.5.2.1.</span> Focus
management</h5>
<p>The <del class="diff-old">focus() and blur()</del> <dfn id=
"focusing"><ins class="diff-chg">focusing steps</ins></dfn>
<del class="diff-old">methods must</del> <ins class="diff-chg">are
as follows:</ins></p>
<ol>
<li>
<p><ins class="diff-chg">If focusing the element will remove
the</ins> focus <del class="diff-old">and unfocus</del> <ins class=
"diff-chg">from another element, then run the</ins> <a href=
"#unfocusing"><ins class="diff-chg">unfocusing steps</ins></a>
<ins class="diff-chg">for that element.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Make</ins> the element <del class=
"diff-old">respectively, if</del> the <ins class=
"diff-new">currently focused</ins> element <del class="diff-old">is
focusable.</del> <ins class="diff-chg">in its</ins> <a href=
"#top-level"><ins class="diff-chg">top-level browsing
context</ins></a> .</p>
<p>Some elements, most notably <code><a href=
"#area">area</a></code> , can correspond to more than one distinct
focusable area. <del class="diff-old">When such an</del>
<ins class="diff-chg">If a particular area was indicated when
the</ins> element <ins class="diff-new">was focused, then
that</ins> is <del class="diff-old">focused</del> <ins class=
"diff-chg">the area that must get focus; otherwise, e.g. when</ins>
using the <code title="dom-focus"><a href=
"#focus0">focus()</a></code> method, the first such region in tree
order is the one that must be focused. <del class=
"diff-old">Well</del></p>
</li>
<li>
<p><a href="#firing2"><ins class="diff-chg">Fire a simple
event</ins></a> that <del class="diff-old">clearly needs
more.</del> <ins class="diff-chg">doesn't bubble called</ins>
<code title="event-focus"><ins class="diff-chg">focus</ins></code>
<ins class="diff-chg">at the element.</ins></p>
</li>
</ol>
<p><ins class="diff-chg">User agents must run the</ins> <a href=
"#focusing"><ins class="diff-chg">focusing steps</ins></a>
<ins class="diff-chg">for an element whenever the user moves the
focus to a</ins> <a href="#focusable"><ins class=
"diff-chg">focusable</ins></a> <ins class=
"diff-chg">element.</ins></p>
<p><ins class="diff-chg">The</ins> <dfn id="unfocusing"><ins class=
"diff-chg">unfocusing steps</ins></dfn> <ins class="diff-chg">are
as follows:</ins></p>
<ol>
<li>
<p><ins class="diff-chg">Unfocus the element.</ins></p>
</li>
<li>
<p><a href="#firing2"><ins class="diff-chg">Fire a simple
event</ins></a> <ins class="diff-chg">that doesn't bubble
called</ins> <code title="event-blur"><ins class=
"diff-chg">blur</ins></code> <ins class="diff-chg">at the
element.</ins></p>
</li>
</ol>
<p><ins class="diff-chg">User agents should run the</ins> <a href=
"#unfocusing"><ins class="diff-chg">unfocusing steps</ins></a>
<ins class="diff-chg">for an element whenever the user moves the
focus away from any</ins> <a href="#focusable"><ins class=
"diff-chg">focusable</ins></a> <ins class=
"diff-chg">element.</ins></p>
<hr>
<p><ins class="diff-chg">The</ins> <dfn id="focus0" title=
"dom-focus"><code><ins class="diff-chg">focus()</ins></code></dfn>
<ins class="diff-chg">method, when invoked, must run the following
algorithm:</ins></p>
<ol>
<li>
<p><ins class="diff-chg">If the element is marked as</ins>
<i><a href="#locked"><ins class="diff-chg">locked for
focus</ins></a></i> ,<ins class="diff-chg">then abort these
steps.</ins></p>
</li>
<li>
<p><ins class="diff-chg">If the element is not</ins> <a href=
"#focusable"><ins class="diff-chg">focusable</ins></a> ,<ins class=
"diff-chg">then abort these steps.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Mark the element as</ins> <dfn id=
"locked"><ins class="diff-chg">locked for focus</ins></dfn> .</p>
</li>
<li>
<p><ins class="diff-chg">If the element is not already focused, run
the</ins> <a href="#focusing"><ins class="diff-chg">focusing
steps</ins></a> <ins class="diff-chg">for the element.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Unmark the element as</ins> <i><a href=
"#locked"><ins class="diff-chg">locked for focus</ins></a></i>
.</p>
</li>
</ol>
<p><ins class="diff-chg">The</ins> <dfn id="blur" title=
"dom-blur"><code><ins class="diff-chg">blur()</ins></code></dfn>
<ins class="diff-chg">method, when invoked, should run the</ins>
<a href="#unfocusing"><ins class="diff-chg">unfocusing
steps</ins></a> <ins class="diff-chg">for the element. User agents
may selectively or uniformly ignore calls to this method for
usability reasons.</ins></p>
<hr>
<p>The <dfn id="activeelement" title=
"dom-document-activeElement"><code>activeElement</code></dfn>
attribute must return the element in the document that <del class=
"diff-old">has focus.</del> <ins class="diff-chg">is focused.</ins>
If no element <del class="diff-old">specifically has focus,</del>
<ins class="diff-chg">in the</ins> <code><ins class=
"diff-chg">Document</ins></code> <ins class="diff-chg">is
focused,</ins> this must return <a href="#the-body1">the
<code>body</code> element</a> .</p>
<p>The <dfn id="hasfocus" title=
"dom-document-hasFocus"><code><del class="diff-old">hasFocus</del>
<ins class="diff-chg">hasFocus()</ins></code></dfn> <del class=
"diff-old">attribute</del> <ins class="diff-chg">method</ins> must
return true if the document, one of its nested <a href="#browsing1"
title="browsing context">browsing contexts</a> , or any element in
the document or its browsing contexts currently has the system
focus.</p>
<h5 id="sequential"><span class="secno">3.5.2.2.</span> Sequential
focus navigation</h5>
<del class="diff-old">This section on the tabindex attribute needs
to be checked for backwards-compatibility.</del>
<p>The <dfn id="tabindex" title=
"attr-tabindex"><code>tabindex</code></dfn> <ins class=
"diff-new">content</ins> attribute specifies <ins class=
"diff-new">whether the element is focusable, whether it can be
reached using sequential focus navigation, and</ins> the relative
order of <del class="diff-old">elements</del> <ins class=
"diff-chg">the element</ins> for the purposes of sequential focus
navigation. The name "tab index" comes from the common use of the
"tab" key to navigate through the focusable elements. The term
"tabbing" refers to moving forward through the focusable
<del class="diff-old">elements.</del> <ins class=
"diff-chg">elements that can be reached using sequential focus
navigation.</ins></p>
<p>The <code title="attr-tabindex"><a href=
"#tabindex">tabindex</a></code> attribute, if specified, must have
a value that is a <a href="#valid0">valid integer</a> .</p>
<p>If the attribute is specified, it must be parsed using the
<a href="#rules0">rules for parsing integers</a> . <ins class=
"diff-new">The attribute's values have the following
meanings:</ins></p>
<dl>
<dt>If <ins class="diff-new">the attribute is omitted or</ins>
parsing the value returns an <del class="diff-old">error,</del>
<ins class="diff-chg">error</ins></dt>
<dd>
<p><ins class="diff-chg">The user agent should follow platform
conventions to determine if</ins> the <del class=
"diff-old">attribute</del> <ins class="diff-chg">element</ins> is
<del class="diff-old">ignored for the purposes of focus management
(as</del> <ins class="diff-chg">to be focusable and,</ins> if
<del class="diff-old">it wasn't specified). A positive integer or
zero specifies the index of</del> <ins class="diff-chg">so,
whether</ins> the element <del class="diff-old">in the current
scope's tab order. Elements with the same index are sorted in
tree</del> <ins class="diff-chg">can be reached using sequential
focus navigation, and if so, what its relative</ins> order
<del class="diff-old">for</del> <ins class="diff-chg">should
be.</ins></p>
</dd>
<dt id="negative-tabindex"><ins class="diff-chg">If</ins> the
<del class="diff-old">purposes of tabbing. A</del> <ins class=
"diff-chg">value is a</ins> negative integer <del class=
"diff-old">specifies that</del></dt>
<dd>
<p><ins class="diff-chg">The user agent must allow</ins> the
element <del class="diff-old">should</del> <ins class=
"diff-chg">to</ins> be <del class="diff-old">removed from the tab
order. If</del> <ins class="diff-chg">focused, but should not
allow</ins> the element <del class="diff-old">does normally take
focus, it may still</del> <ins class="diff-chg">to</ins> be
<del class="diff-old">focused</del> <ins class=
"diff-chg">reached</ins> using <del class="diff-old">other means
(e.g. it could be focused by a click).</del> <ins class=
"diff-chg">sequential focus navigation.</ins></p>
</dd>
<dt>If the <del class="diff-old">attribute</del> <ins class=
"diff-chg">value</ins> is <del class="diff-old">absent (or
invalid), then the</del> <ins class="diff-chg">a zero</ins></dt>
<dd>
<p><ins class="diff-chg">The</ins> user agent must <del class=
"diff-old">treat</del> <ins class="diff-chg">allow</ins> the
element <del class="diff-old">as if it had</del> <ins class=
"diff-chg">to be focused, should allow</ins> the <del class=
"diff-old">value 0 or</del> <ins class="diff-chg">element to be
reached using sequential focus navigation, and should follow
platform conventions to determine the element's relative
order.</ins></p>
</dd>
<dt><ins class="diff-chg">If</ins> the value <del class=
"diff-old">-1, based on platform conventions. For example, a</del>
<ins class="diff-chg">is greater than zero</ins></dt>
<dd>
<p><ins class="diff-chg">The</ins> user agent <del class=
"diff-old">might default textarea elements</del> <ins class=
"diff-chg">must allow the element</ins> to <del class=
"diff-old">0,</del> <ins class="diff-chg">be focused, should allow
the element to be reached using sequential focus navigation,</ins>
and <del class="diff-old">button</del> <ins class="diff-chg">should
place the element in the sequential focus navigation order so that
it is:</ins></p>
<ul>
<li><ins class="diff-chg">before any focusable element whose</ins>
<code title="attr-tabindex"><a href="#tabindex"><ins class=
"diff-chg">tabindex</ins></a></code> <del class=
"diff-old">elements</del> <ins class="diff-chg">attribute has been
omitted or whose value, when parsed, returns an error,</ins></li>
<li><ins class="diff-chg">before any focusable element whose</ins>
<code title="attr-tabindex"><a href="#tabindex"><ins class=
"diff-chg">tabindex</ins></a></code> <ins class=
"diff-chg">attribute has a value equal</ins> to <del class=
"diff-old">-1, making text fields part</del> <ins class=
"diff-chg">or less than zero,</ins></li>
<li><ins class="diff-chg">after any element whose</ins>
<code title="attr-tabindex"><a href="#tabindex"><ins class=
"diff-chg">tabindex</ins></a></code> <ins class=
"diff-chg">attribute has a value greater than zero but less than
the value</ins> of the <del class="diff-old">tabbing cycle but
buttons not. When an</del> <code title="attr-tabindex"><a href=
"#tabindex"><ins class="diff-chg">tabindex</ins></a></code>
<ins class="diff-chg">attribute on the element,</ins></li>
<li><ins class="diff-chg">after any</ins> element <del class=
"diff-old">that does not normally take focus (i.e.</del> whose
<del class="diff-old">default value would be -1)</del> <code title=
"attr-tabindex"><a href="#tabindex"><ins class=
"diff-chg">tabindex</ins></a></code> <ins class=
"diff-chg">attribute</ins> has <ins class="diff-new">a value equal
to the value of</ins> the <code title="attr-tabindex"><a href=
"#tabindex">tabindex</a></code> attribute <del class=
"diff-old">specified with</del> <ins class="diff-chg">on the
element but that is earlier in the document in</ins> <a href=
"#tree-order"><ins class="diff-chg">tree order</ins></a>
<ins class="diff-chg">than the element,</ins></li>
<li><ins class="diff-chg">before any element whose</ins>
<code title="attr-tabindex"><a href="#tabindex"><ins class=
"diff-chg">tabindex</ins></a></code> <ins class=
"diff-chg">attribute has</ins> a <del class="diff-old">positive
value, then it should be added</del> <ins class="diff-chg">value
equal</ins> to the <del class="diff-old">tab</del> <ins class=
"diff-chg">value of the</ins> <code title="attr-tabindex"><a href=
"#tabindex"><ins class="diff-chg">tabindex</ins></a></code>
<ins class="diff-chg">attribute on the element but that is later in
the document in</ins> <a href="#tree-order"><ins class=
"diff-chg">tree</ins> order</a> <ins class="diff-new">than the
element,</ins> and <del class="diff-old">should</del></li>
<li><ins class="diff-chg">before any element whose</ins>
<code title="attr-tabindex"><a href="#tabindex"><ins class=
"diff-chg">tabindex</ins></a></code> <ins class=
"diff-chg">attribute has a value greater than the value of
the</ins> <code title="attr-tabindex"><a href=
"#tabindex"><ins class="diff-chg">tabindex</ins></a></code>
<ins class="diff-chg">attribute on the element.</ins></li>
</ul>
</dd>
</dl>
<p><ins class="diff-chg">An element is</ins> <dfn id=
"focusable"><ins class="diff-chg">focusable</ins></dfn> <ins class=
"diff-chg">if the</ins> <code title="attr-tabindex"><a href=
"#tabindex"><ins class="diff-chg">tabindex</ins></a></code>
<ins class="diff-chg">attribute's definition above defines the
element to</ins> be <del class="diff-old">made focusable.</del>
<ins class="diff-chg">focusable</ins> <em><ins class=
"diff-chg">and</ins></em> <ins class="diff-chg">the element
is</ins> <span><ins class="diff-chg">being rendered</ins></span>
<ins class="diff-chg">.</ins></p>
<p>When <ins class="diff-new">an element is</ins> focused, the
element matches the CSS <code>:focus</code> pseudo-class and key
events are dispatched on that element in response to keyboard
input.</p>
<p>The <dfn id="tabindex0" title=
"dom-tabIndex"><code>tabIndex</code></dfn> DOM attribute
<del class="diff-old">reflects</del> <ins class=
"diff-chg">must</ins> <a href="#reflect"><ins class=
"diff-chg">reflect</ins></a> the value of the <code title=
"attr-tabIndex"><a href="#tabindex">tabIndex</a></code> content
attribute. If the attribute is not <del class="diff-old">present
(or has</del> <ins class="diff-chg">present, or parsing its value
returns</ins> an <del class="diff-old">invalid value)</del>
<ins class="diff-chg">error,</ins> then the DOM attribute must
return <del class="diff-old">the UA's default value for that
element, which will be either</del> 0 <del class=
"diff-old">(for</del> <ins class="diff-chg">for</ins> elements
<del class="diff-old">in the tab order) or -1 (for</del>
<ins class="diff-chg">that are focusable and −1 for</ins> elements
<ins class="diff-new">that are</ins> not <del class="diff-old">in
the tab order).</del> <ins class="diff-chg">focusable.</ins></p>
<h4 id="scrolling"><span class="secno"><del class=
"diff-old">3.5.3.</del> <ins class="diff-chg">3.5.3</ins></span>
Scrolling elements into view</h4>
<p>The <dfn id="scrollintoview" title=
"dom-scrollIntoView"><code>scrollIntoView([ <var title="">top</var>
])</code></dfn> method, when called, must cause the element on
which the method was called to have the attention of the user
called to it.</p>
<p class="note">In a speech browser, this could happen by having
the current playback position move to the start of the given
element.</p>
<p>In visual user agents, if the argument is present and has the
value false, the user agent should scroll the element into view
such that both the bottom and the top of the element are in the
viewport, with the bottom of the element aligned with the bottom of
the viewport. If it isn't possible to show the entire element in
that way, or if the argument is omitted or is true, then the user
agent <del class="diff-old">must</del> <ins class=
"diff-chg">should</ins> instead <del class="diff-old">simply</del>
align the top of the element with the top of the viewport.
<ins class="diff-new">Visual user agents should further scroll
horizontally as necessary to bring the element to the attention of
the user.</ins></p>
<p>Non-visual user agents may ignore the argument, or may treat it
in some media-specific manner most useful to the user.</p>
<h3 id="the-root"><span class="secno"><del class=
"diff-old">3.6.</del> <ins class="diff-chg">3.6</ins></span> The
root element</h3>
<h4 id="the-html"><span class="secno"><del class=
"diff-old">3.6.1.</del> <ins class="diff-chg">3.6.1</ins></span>
The <dfn id="html"><code>html</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>As the root element of a document.</dd>
<dd>Wherever a subdocument fragment is allowed in a compound
document.</dd>
<dt>Content model:</dt>
<dd>A <code><a href="#head">head</a></code> element followed by a
<code><a href="#body0">body</a></code> element.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-html-manifest"><a href=
"#manifest">manifest</a></code></dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#html">html</a></code> element represents the
root of an HTML document.</p>
<p>The <dfn id="manifest" title=
"attr-html-manifest"><code>manifest</code></dfn> attribute gives
the address of the document's <a href="#application0">application
cache</a> <a href="#the-manifest" title=
"concept-appcache-manifest">manifest</a> , if there is one. If the
attribute is present, the attribute's value must be a valid URI (or
IRI).</p>
<p>The <code title="attr-html-manifest"><a href=
"#manifest">manifest</a></code> attribute only <a href=
"#application2" title="concept-appcache-init-with-attribute">has an
effect</a> during the early stages of document load. Changing the
attribute dynamically thus has no effect (and thus, no DOM API is
provided for this attribute). <del class="diff-old">Furthermore, as
it is processed before any</del></p>
<p class="note"><ins class="diff-chg">Later</ins> <code><a href=
"#base">base</a></code> elements <del class="diff-old">are seen,
its value is not subject to being made relative to any base URI.
Though it has absolutely no effect and no meaning,</del>
<ins class="diff-chg">can't affect</ins> the <ins class=
"diff-chg">resolving of relative URIs in</ins> <code title=
"attr-html-manifest"><del class="diff-old">html</del> <a href=
"#manifest"><ins class="diff-chg">manifest</ins></a></code>
<del class="diff-old">element, in HTML documents , may have an
xmlns attribute specified, if, and only if, it has the exact value
" http://www.w3.org/1999/xhtml ". This does not apply to XML
documents . In HTML, the xmlns attribute has absolutely no effect.
It is basically a talisman. It is allowed merely to make migration
to and from XHTML mildly easier. When parsed by an HTML parser ,
the attribute ends up in the null namespace, not</del> <ins class=
"diff-chg">attributes, as</ins> the <del class="diff-old">"
http://www.w3.org/2000/xmlns/ " namespace like namespace
declaration</del> attributes <del class="diff-old">in XML do. In
XML, an xmlns attribute is part of the namespace declaration
mechanism, and an element cannot actually have an xmlns attribute
in the null namespace specified.</del> <ins class="diff-chg">are
processed before those elements are seen.</ins></p>
<h3 id="document"><span class="secno"><del class=
"diff-old">3.7.</del> <ins class="diff-chg">3.7</ins></span>
Document metadata</h3>
<h4 id="the-head"><span class="secno"><del class=
"diff-old">3.7.1.</del> <ins class="diff-chg">3.7.1</ins></span>
The <dfn id="head"><code>head</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>As the first element in an <code><a href=
"#html">html</a></code> element.</dd>
<dt>Content model:</dt>
<dd>One or more elements of <a href="#metadata0">metadata
content</a> , of which exactly one is a <code><a href=
"#title1">title</a></code> element.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#head">head</a></code> element collects the
document's metadata.</p>
<h4 id="the-title0"><span class="secno"><del class=
"diff-old">3.7.2.</del> <ins class="diff-chg">3.7.2</ins></span>
The <dfn id="title1"><code>title</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#metadata0">Metadata content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>In a <code><a href="#head">head</a></code> element containing
no other <code><a href="#title1">title</a></code> elements.</dd>
<dt>Content model:</dt>
<dd>Text.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#title1">title</a></code> element represents
the document's title or name. Authors should use titles that
identify their documents even when they are used out of context,
for example in a user's history or bookmarks, or in search results.
The document's title is often different from its first header,
since the first header does not have to stand alone when taken out
of context.</p>
<p>There must be no more than one <code><a href=
"#title1">title</a></code> element per document.</p>
<p>The <code><a href="#title1">title</a></code> element must not
contain any elements.</p>
<div class="example">
<p>Here are some examples of appropriate titles, contrasted with
the top-level headers that might be used on those same pages.</p>
<pre>
<title>Introduction to The Mating Rituals of Bees</title>
...
<h1>Introduction</h1>
<p>This companion guide to the highly successful
<cite>Introduction to Medieval Bee-Keeping</cite> book is...
</pre>
<p>The next page might be a part of the same site. Note how the
title describes the subject matter unambiguously, while the first
header assumes the reader knowns what the context is and therefore
won't wonder if the dances are Salsa or Waltz:</p>
<pre>
<title>Dances used during bee mating rituals</title>
...
<h1>
The
Dances</h1>
</pre></div>
<p>The string to use as the document's title is given by the
<code title="dom-document-title"><a href=
"#document.title">document.title</a></code> DOM attribute. User
agents should use the document's title when referring to the
document in their user interface.</p>
<h4 id="the-base"><span class="secno"><del class=
"diff-old">3.7.3.</del> <ins class="diff-chg">3.7.3</ins></span>
The <dfn id="base"><code>base</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#metadata0">Metadata content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>In a <code><a href="#head">head</a></code> element containing
no other <code><a href="#base">base</a></code> elements.</dd>
<dt>Content model:</dt>
<dd>Empty.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-base-href"><a href=
"#href">href</a></code></dd>
<dd><code title="attr-base-target"><a href=
"#target">target</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlbaseelement">HTMLBaseElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#href0" title=
"dom-base-href">href</a>;
attribute DOMString <a href="#target0" title=
"dom-base-target">target</a>;
};
</pre></dd>
</dl>
<p>The <code><a href="#base">base</a></code> element allows authors
to specify the document's base URI for the purposes of resolving
relative URIs, and the name of the default <a href=
"#browsing1">browsing context</a> for the purposes of <a href=
"#following0">following hyperlinks</a> .</p>
<p>There must be no more than one <code><a href=
"#base">base</a></code> element per document.</p>
<p>A <code><a href="#base">base</a></code> element must have either
an <code title="attr-base-href"><a href="#href">href</a></code>
attribute, a <code title="attr-base-target"><a href=
"#target">target</a></code> attribute, or both.</p>
<p>The <dfn id="href" title=
"attr-base-href"><code>href</code></dfn> content attribute, if
specified, must contain a URI (or IRI).</p>
<p>A <code><a href="#base">base</a></code> element, if it has an
<code title="attr-base-href"><a href="#href">href</a></code>
attribute, must come before any other elements in the tree that
have attributes with URIs (except the <code><a href=
"#html">html</a></code> element and its <code title=
"attr-html-manifest"><a href="#manifest">manifest</a></code>
attribute).</p>
<p>User agents must use the value of the <code title=
"att-base-href">href</code> attribute of the first <code><a href=
"#base">base</a></code> element that is both a child of <a href=
"#the-head0">the <code>head</code> element</a> and has an
<code title="att-base-href">href</code> attribute, if there is such
an element, as the document entity's base URI for the purposes of
section 5.1.1 of RFC 3986 ("Establishing a Base URI": "Base URI
Embedded in Content"). This base URI from RFC 3986 is referred to
by the algorithm given in XML Base, which <a href="#xmlBase">is a
normative part of this specification</a> . <a href=
"#references">[RFC3986]</a></p>
<p>If the base URI given by this attribute is a relative URI, it
must be resolved relative to the higher-level base URIs (i.e. the
base URI from the encapsulating entity or the URI used to retrieve
the entity) to obtain an absolute base URI. All <code title=
"attr-xml-base"><a href="#xmlbase">xml:base</a></code> attributes
must be ignored when resolving relative URIs in this <code title=
"attr-base-href"><a href="#href">href</a></code> attribute.</p>
<p class="note">If there are multiple <code><a href=
"#base">base</a></code> elements with <code title=
"att-base-href">href</code> attributes, all but the first are
ignored.</p>
<p>The <dfn id="target" title=
"attr-base-target"><code>target</code></dfn> attribute, if
specified, must contain a <a href="#valid9">valid browsing context
name <ins class="diff-new">or keyword</ins></a> . User agents use
this name when <a href="#following0">following hyperlinks</a> .</p>
<p>A <code><a href="#base">base</a></code> element, if it has a
<code title="attr-base-target"><a href="#target">target</a></code>
attribute, must come before any elements in the tree that represent
<a href="#hyperlinks" title="hyperlink">hyperlinks</a> .</p>
<p>The <dfn id="href0" title=
"dom-base-href"><code>href</code></dfn> and <dfn id="target0"
title="dom-base-target"><code>target</code></dfn> DOM attributes
must <a href="#reflect">reflect</a> the content attributes of the
same name.</p>
<h4 id="the-link"><span class="secno"><del class=
"diff-old">3.7.4.</del> <ins class="diff-chg">3.7.4</ins></span>
The <dfn id="link"><code>link</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#metadata0">Metadata content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#metadata0">metadata content</a> is
expected.</dd>
<dd>In a <code><a href="#noscript">noscript</a></code> element that
is a child of a <code><a href="#head">head</a></code> element.</dd>
<dt>Content model:</dt>
<dd>Empty.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-link-href"><a href=
"#href1">href</a></code></dd>
<dd><code title="attr-link-rel"><a href="#rel">rel</a></code></dd>
<dd><code title="attr-link-media"><a href=
"#media0">media</a></code></dd>
<dd><code title="attr-link-hreflang"><a href=
"#hreflang">hreflang</a></code></dd>
<dd><code title="attr-link-type"><a href=
"#type">type</a></code></dd>
<dd><code title="attr-link-sizes"><a href="#sizes0"><ins class=
"diff-new">sizes</ins></a></code></dd>
<dd>Also, the <code title="attr-link-title"><a href=
"#title2">title</a></code> attribute has special semantics on this
element.</dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmllinkelement">HTMLLinkElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
attribute boolean <a href="#disabled" title=
"dom-link-disabled">disabled</a>;
attribute DOMString <a href="#href2" title=
"dom-link-href">href</a>;
attribute DOMString <a href="#rel0" title=
"dom-link-rel">rel</a>;
readonly attribute DOMTokenList <a href="#rellist" title=
"dom-link-relList">relList</a>;
attribute DOMString <a href="#media1" title=
"dom-link-media">media</a>;
attribute DOMString <a href="#hreflang0" title=
"dom-link-hreflang">hreflang</a>;
attribute DOMString <a href="#type0" title=
"dom-link-type">type</a>;
<ins class="diff-new"> attribute DOMString <a href=
"#sizes" title="dom-link-sizes">sizes</a>;
</ins>
};
</pre>
<p>The <code>LinkStyle</code> interface must also be implemented by
this element, the <a href="#styling0">styling processing model</a>
defines how. <a href="#references">[CSSOM]</a></p>
</dd>
</dl>
<p>The <code><a href="#link">link</a></code> element allows authors
to link their document to other resources.</p>
<p>The destination of the link is given by the <dfn id="href1"
title="attr-link-href"><code>href</code></dfn> attribute, which
must be present and must contain a URI (or IRI). If the
<code title="attr-link-href"><a href="#href1">href</a></code>
attribute is absent, then the element does not define a link.</p>
<p>The type of link indicated (the relationship) is given by the
value of the <dfn id="rel" title=
"attr-link-rel"><code>rel</code></dfn> attribute, which must be
present, and must have a value that is a <a href="#set-of">set of
space-separated tokens</a> . The <a href="#linkTypes">allowed
values and their meanings</a> are defined in a later section. If
the <code title="attr-link-rel"><a href="#rel">rel</a></code>
attribute is absent, or if the value used is not allowed according
to the definitions in this specification, then the element does not
define a link.</p>
<p>Two categories of links can be created using the <code><a href=
"#link">link</a></code> element. <dfn id="links1" title=
"external resource link">Links to external resources</dfn> are
links to resources that are to be used to augment the current
document, and <dfn id="hyperlink1" title="hyperlink link">hyperlink
links</dfn> are <a href="#hyperlinks" title="hyperlink">links to
other documents</a> . The <a href="#linkTypes">link types
section</a> defines whether a particular link type is an external
resource or a hyperlink. One element can create multiple links (of
which some might be external resource links and some might be
<del class="diff-old">hyperlinks).</del> <ins class=
"diff-chg">hyperlinks); exactly which and how many links are
created depends on the keywords given in the</ins> <code title=
"attr-link-rel"><a href="#rel"><ins class=
"diff-chg">rel</ins></a></code> <ins class=
"diff-chg">attribute.</ins> User agents <del class=
"diff-old">should</del> <ins class="diff-chg">must</ins> process
the links on a per-link basis, not a per-element basis.</p>
<p>The exact <del class="diff-old">behaviour</del> <ins class=
"diff-chg">behavior</ins> for links to external resources depends
on the exact relationship, as defined for the relevant link type.
Some of the attributes control whether or not the external resource
is to be applied (as defined below). For external resources that
are represented in the DOM (for example, style sheets), the DOM
representation must be made available even if the resource is not
applied. (However, user agents may opt to only fetch such resources
when they are needed, instead of pro-actively downloading all the
external resources that are not applied.)</p>
<p><ins class="diff-new">HTTP semantics must be followed when
fetching external resources. (For example, redirects must be
followed and 404 responses must cause the external resource to not
be applied.)</ins></p>
<p>Interactive user agents should provide users with a means to
<a href="#following0" title="following hyperlinks">follow the
hyperlinks</a> created using the <code><a href=
"#link">link</a></code> element, somewhere within their user
interface. The exact interface is not defined by this
specification, but it should include the following information
(obtained from the element's attributes, again as defined below),
in some form or another (possibly simplified), for each hyperlink
created with each <code><a href="#link">link</a></code> element in
the document:</p>
<ul>
<li>The relationship between this document and the resource (given
by the <code title="attr-link-rel"><a href="#rel">rel</a></code>
attribute)</li>
<li>The title of the resource (given by the <code title=
"attr-link-title"><a href="#title2">title</a></code>
attribute).</li>
<li>The URI of the resource (given by the <code title=
"attr-link-href"><a href="#href1">href</a></code> attribute).</li>
<li>The language of the resource (given by the <code title=
"attr-link-hreflang"><a href="#hreflang">hreflang</a></code>
attribute).</li>
<li>The optimum media for the resource (given by the <code title=
"attr-link-media"><a href="#media0">media</a></code>
attribute).</li>
</ul>
<p>User agents may also include other information, such as the type
of the resource (as given by the <code title=
"attr-link-type"><a href="#type">type</a></code> attribute).</p>
<p class="note"><ins class="diff-new">Hyperlinks created with
the</ins> <code><a href="#link"><ins class=
"diff-new">link</ins></a></code> <ins class="diff-new">element and
its</ins> <code title="attr-link-rel"><a href="#rel"><ins class=
"diff-new">rel</ins></a></code> <ins class="diff-new">attribute
apply to the whole page. This contrasts with the</ins> <code title=
"attr-hyperlink-rel"><a href="#rel3"><ins class=
"diff-new">rel</ins></a></code> <ins class="diff-new">attribute
of</ins> <code><a href="#a"><ins class=
"diff-new">a</ins></a></code> <ins class="diff-new">and</ins>
<code><a href="#area"><ins class="diff-new">area</ins></a></code>
<ins class="diff-new">elements, which indicates the type of a link
whose context is given by the link's location within the
document.</ins></p>
<p>The <dfn id="media0" title=
"attr-link-media"><code>media</code></dfn> attribute says which
media the resource applies to. The value must be a valid <a href=
"#mq">media <del class="diff-old">query.</del> <ins class=
"diff-chg">query</ins></a> . <a href="#references">[MQ]</a></p>
<p>If the link is a <a href="#hyperlink1" title=
"hyperlink link">hyperlink</a> then the <code title=
"attr-link-media"><a href="#media0">media</a></code> attribute is
purely advisory, and describes for which media the document in
question was designed.</p>
<p>However, if the link is an <a href="#links1">external resource
link</a> , then the <code title="attr-link-media"><a href=
"#media0">media</a></code> attribute is prescriptive. The user
agent must <del class="diff-old">only</del> apply the external
resource to <span>views</span> while their state match the listed
<del class="diff-old">media.</del> <ins class="diff-chg">media, and
must not apply them otherwise.</ins></p>
<p id="default-media">The default, if the <code title=
"attr-link-media"><a href="#media0">media</a></code> attribute is
omitted, is <code>all</code> , meaning that by default links apply
to all media.</p>
<p>The <dfn id="hreflang" title=
"attr-link-hreflang"><code>hreflang</code></dfn> attribute on the
<code><a href="#link">link</a></code> element has the same
semantics as the <a href="#hreflang3" title=
"attr-hyperlink-hreflang"><code>hreflang</code> attribute on
hyperlink elements</a> .</p>
<p>The <dfn id="type" title=
"attr-link-type"><code>type</code></dfn> attribute gives the MIME
type of the linked resource. It is purely advisory. The value must
be a valid MIME type, optionally with parameters. <a href=
"#references">[RFC2046]</a></p>
<p>For <a href="#links1" title="external resource link">external
resource links</a> , user agents may use the type given in this
attribute to decide whether or not to consider using the resource
at all. If the UA does not support the given MIME type for the
given link relationship, then the UA may opt not to download and
apply the resource.</p>
<p>User agents must not consider the <code title=
"attr-link-type"><a href="#type">type</a></code> attribute
authoritative — upon fetching the resource, user agents must not
use metadata included in the link to the resource to determine its
type.</p>
<p>If the attribute is omitted, <ins class="diff-new">but the user
agent would fetch the resource if the type was known and
supported,</ins> then the <del class="diff-old">UA</del>
<ins class="diff-chg">user agent</ins> must fetch the resource
<del class="diff-old">to</del> <ins class="diff-chg">and</ins>
determine its type <del class="diff-old">and thus</del> <a href=
"#content-type8" title="Content-Type"><ins class="diff-chg">from
its Content-Type metadata</ins></a> <ins class="diff-chg">to</ins>
determine if it supports (and can apply) that external resource.
<ins class="diff-new">If no type metadata is specified, but the
external resource link type has a default type defined, then the
user agent must assume that the resource is of that type.</ins></p>
<div class="example">
<p>If a document contains <del class="diff-old">three</del>
<ins class="diff-chg">four</ins> style sheet links <del class=
"diff-old">labelled</del> <ins class="diff-chg">labeled</ins> as
follows:</p>
<del class="diff-old"><link rel="stylesheet" href="A"
type="text/css"> <link rel="stylesheet" href="B"
type="text/plain"></del>
<pre>
<link rel="stylesheet" href="A" type="text/plain">
<ins class=
"diff-chg"><link rel="stylesheet" href="B" type="text/css">
</ins>
<link
rel="stylesheet"
href="C">
</pre>
<p>...then a compliant UA that supported only CSS style sheets
would fetch the <del class="diff-old">A</del> <ins class=
"diff-chg">B</ins> and C files, and skip the <del class=
"diff-old">B</del> <ins class="diff-chg">A</ins> file (since
<code>text/plain</code> is not the MIME type for CSS style
sheets).</p>
<p>For <del class="diff-old">these two files,</del> <ins class=
"diff-chg">files B and C,</ins> it would then check the actual
types returned by the <del class="diff-old">UA.</del> <ins class=
"diff-chg">server.</ins> For those that are sent as
<code>text/css</code> , it would apply the styles, but for those
<del class="diff-old">labelled</del> <ins class=
"diff-chg">labeled</ins> as <code>text/plain</code> , or any other
type, it would not.</p>
<p><ins class="diff-new">If one the two files was returned without
a</ins> <a href="#content-type8"><ins class=
"diff-new">Content-Type</ins></a> <ins class="diff-new">metadata,
or with a syntactically incorrect type like</ins> <code title=
""><ins class="diff-new">Content-Type: "null"</ins></code>
,<ins class="diff-new">then the default type for</ins> <code title=
"rel-stylesheet"><a href="#stylesheet"><ins class=
"diff-new">stylesheet</ins></a></code> <ins class="diff-new">links
would kick in. Since that default type is</ins> <code title=
""><ins class="diff-new">text/css</ins></code> ,<ins class=
"diff-new">the style sheet</ins> <em><ins class=
"diff-new">would</ins></em> <ins class="diff-new">nonetheless be
applied.</ins></p>
</div>
<p>The <dfn id="title2" title=
"attr-link-title"><code>title</code></dfn> attribute gives the
title of the link. With one exception, it is purely advisory. The
value is text. The exception is for style sheet links, where the
<code title="attr-link-title"><a href="#title2">title</a></code>
attribute defines <a href="#alternative">alternative style sheet
sets</a> .</p>
<p class="note">The <code title="attr-link-title"><a href=
"#title2">title</a></code> attribute on <code><a href=
"#link">link</a></code> elements differs from the global
<code title="attr-title"><a href="#title">title</a></code>
attribute of most other elements in that a link without a title
does not inherit the title of the parent element: it merely has no
title.</p>
<p><ins class="diff-new">The</ins> <code title=
"attr-link-sizes"><a href="#sizes0"><ins class=
"diff-new">sizes</ins></a></code> <ins class="diff-new">attribute
is used with the</ins> <code title="rel-icon"><a href=
"#icon3"><ins class="diff-new">icon</ins></a></code> <ins class=
"diff-new">link type. The attribute must not be specified on</ins>
<code><a href="#link"><ins class="diff-new">link</ins></a></code>
<ins class="diff-new">elements that do not have a</ins>
<code title="attr-link-rel"><a href="#rel"><ins class=
"diff-new">rel</ins></a></code> <ins class="diff-new">attribute
that specifies the</ins> <code title="rel-icon"><a href=
"#icon3"><ins class="diff-new">icon</ins></a></code> <ins class=
"diff-new">keyword.</ins></p>
<p>Some versions of HTTP defined a <code title="">Link:</code>
header, to be processed like a series of <code><a href=
"#link">link</a></code> elements. <del class="diff-old">When
processing links, those must be taken into consideration as well.
For</del> <ins class="diff-chg">If supported, for</ins> the
purposes of <del class="diff-old">ordering,</del> <ins class=
"diff-chg">ordering</ins> links defined by HTTP headers must be
assumed to come before any links in the document, in the order that
they were given in the HTTP entity header. Relative URIs in these
headers <del class="diff-old">must be</del> <ins class=
"diff-chg">are</ins> resolved according to the rules given in HTTP,
not relative to base URIs set by the document (e.g. using a
<code><a href="#base">base</a></code> element or <code title=
"attr-xml-base"><a href="#xmlbase">xml:base</a></code> attributes).
<a href="#references">[RFC2616]</a> <a href=
"#references">[RFC2068]</a></p>
<p>The DOM attributes <dfn id="href2" title=
"dom-link-href"><code>href</code></dfn> , <dfn id="rel0" title=
"dom-link-rel"><code>rel</code></dfn> , <dfn id="media1" title=
"dom-link-media"><code>media</code></dfn> , <dfn id="hreflang0"
title="dom-link-hreflang"><code>hreflang</code></dfn> , and
<dfn id="type0" title="dom-link-type"><code>type</code></dfn> ,
<ins class="diff-new">and</ins> <dfn id="sizes" title=
"dom-link-sizes"><code><ins class=
"diff-new">sizes</ins></code></dfn> each must <a href=
"#reflect">reflect</a> the respective content attributes of the
same name.</p>
<p>The DOM attribute <dfn id="rellist" title=
"dom-link-rellist"><code>relList</code></dfn> must <a href=
"#reflect">reflect</a> the <code title="attr-link-rel"><a href=
"#rel">rel</a></code> content attribute.</p>
<p>The DOM attribute <dfn id="disabled" title=
"dom-link-disabled"><code>disabled</code></dfn> only applies to
style sheet links. When the <code><a href="#link">link</a></code>
element defines a style sheet link, then the <code title=
"dom-link-disabled"><a href="#disabled">disabled</a></code>
attribute behaves as defined <a href="#disabled1" title=
"dom-linkstyle-disabled">for the alternative style sheets DOM</a> .
For all other <code><a href="#link">link</a></code> elements it
always return false and does nothing on setting.</p>
<h4 id="meta"><span class="secno"><del class=
"diff-old">3.7.5.</del> <ins class="diff-chg">3.7.5</ins></span>
The <dfn id="meta0"><code>meta</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#metadata0">Metadata content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>If the <code title="attr-meta-charset"><a href=
"#charset1">charset</a></code> attribute is <del class=
"diff-old">present:</del> <ins class="diff-chg">present, or if the
element is in the</ins> <a href="#encoding" title=
"attr-meta-http-equiv-content-type"><ins class="diff-chg">Encoding
declaration state</ins></a> : as the first element in a
<code><a href="#head">head</a></code> element.</dd>
<dd>If the <code title="attr-meta-http-equiv"><a href=
"#http-equiv0">http-equiv</a></code> attribute is <del class=
"diff-old">present:</del> <ins class="diff-chg">present, and the
element is not in the</ins> <a href="#encoding" title=
"attr-meta-http-equiv-content-type"><ins class="diff-chg">Encoding
declaration state</ins></a> : in a <code><a href=
"#head">head</a></code> element.</dd>
<dd>If the <code title="attr-meta-http-equiv"><a href=
"#http-equiv0">http-equiv</a></code> attribute is <del class=
"diff-old">present:</del> <ins class="diff-chg">present, and the
element is not in the</ins> <a href="#encoding" title=
"attr-meta-http-equiv-content-type"><ins class="diff-chg">Encoding
declaration state</ins></a> : in a <code><a href=
"#noscript">noscript</a></code> element that is a child of a
<code><a href="#head">head</a></code> element.</dd>
<dd>If the <code title="attr-meta-name"><a href=
"#name">name</a></code> attribute is present: where <a href=
"#metadata0">metadata content</a> is expected.</dd>
<dt>Content model:</dt>
<dd>Empty.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-meta-name"><a href=
"#name">name</a></code></dd>
<dd><code title="attr-meta-http-equiv"><a href=
"#http-equiv0">http-equiv</a></code></dd>
<dd><code title="attr-meta-content"><a href=
"#content0">content</a></code></dd>
<dd><code title="attr-meta-charset"><a href=
"#charset1">charset</a></code> ( <a href="#html-" title=
"HTML documents">HTML</a> only)</dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlmetaelement">HTMLMetaElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#content1" title=
"dom-meta-content">content</a>;
attribute DOMString <a href="#name0" title=
"dom-meta-name">name</a>;
attribute DOMString <a href="#httpequiv" title=
"dom-meta-httpEquiv">httpEquiv</a>;
};
</pre></dd>
</dl>
<p>The <code><a href="#meta0">meta</a></code> element represents
various kinds of metadata that cannot be expressed using the
<code><a href="#title1">title</a></code> , <code><a href=
"#base">base</a></code> , <code><a href="#link">link</a></code> ,
<code><a href="#style1">style</a></code> , and <code><a href=
"#script1">script</a></code> elements.</p>
<p>The <code><a href="#meta0">meta</a></code> element can represent
document-level metadata with the <code title=
"attr-meta-name"><a href="#name">name</a></code> attribute, pragma
directives with the <code title="attr-meta-http-equiv"><a href=
"#http-equiv0">http-equiv</a></code> attribute, and the file's
<a href="#character2">character encoding declaration</a> when an
HTML document is <del class="diff-old">serialised</del> <ins class=
"diff-chg">serialized</ins> to string form (e.g. for transmission
over the network or for disk storage) with the <code title=
"attr-meta-charset"><a href="#charset1">charset</a></code>
attribute.</p>
<p>Exactly one of the <code title="attr-meta-name"><a href=
"#name">name</a></code> , <code title=
"attr-meta-http-equiv"><a href="#http-equiv0">http-equiv</a></code>
, and <code title="attr-meta-charset"><a href=
"#charset1">charset</a></code> attributes must be specified.</p>
<p>If either <code title="attr-meta-name"><a href=
"#name">name</a></code> or <code title=
"attr-meta-http-equiv"><a href="#http-equiv0">http-equiv</a></code>
is specified, then the <code title="attr-meta-content"><a href=
"#content0">content</a></code> attribute must also be specified.
Otherwise, it must be omitted.</p>
<p>The <dfn id="charset1" title=
"attr-meta-charset"><code><ins class=
"diff-new">charset</ins></code></dfn> <ins class=
"diff-new">attribute specifies the character encoding used by the
document. This is called a</ins> <a href="#character2"><ins class=
"diff-new">character encoding declaration</ins></a> .</p>
<p><ins class="diff-new">The</ins> <code title=
"attr-meta-charset"><a href="#charset1">charset</a></code>
attribute may <del class="diff-old">only</del> be specified in
<a href="#html5" title="HTML5">HTML documents <del class=
"diff-old">,</del></a> <ins class="diff-chg">only,</ins> it must
not be used in <a href="#xhtml5" title="XHTML">XML documents</a> .
If the <code title="attr-meta-charset"><a href=
"#charset1">charset</a></code> attribute is specified, the element
must be the first element in <a href="#the-head0">the
<code>head</code> element</a> of the file.</p>
<p>The <dfn id="content0" title=
"attr-meta-content"><code>content</code></dfn> attribute gives the
value of the document metadata or pragma directive when the element
is used for those purposes. The allowed values depend on the exact
context, as described in subsequent sections of this
specification.</p>
<p>If a <code><a href="#meta0">meta</a></code> element has a
<dfn id="name" title="attr-meta-name"><code>name</code></dfn>
attribute, it sets document metadata. Document metadata is
expressed in terms of name/value pairs, the <code title=
"attr-meta-name"><a href="#name">name</a></code> attribute on the
<code><a href="#meta0">meta</a></code> element giving the name, and
the <code title="attr-meta-content"><a href=
"#content0">content</a></code> attribute on the same element giving
the value. The name specifies what aspect of metadata is being set;
valid names and the meaning of their values are described in the
following sections. If a <code><a href="#meta0">meta</a></code>
element has no <code title="attr-meta-content"><a href=
"#content0">content</a></code> attribute, then the value part of
the metadata name/value pair is the empty string.</p>
<p>If a <code><a href="#meta0">meta</a></code> element has the
<code title="attr-meta-http-equiv"><a href=
"#http-equiv0">http-equiv</a></code> attribute specified, it must
be either in a <code><a href="#head">head</a></code> element or in
a <code><a href="#noscript">noscript</a></code> element that itself
is in a <code><a href="#head">head</a></code> element. If a
<code><a href="#meta0">meta</a></code> element does not have the
<code title="attr-meta-http-equiv"><a href=
"#http-equiv0">http-equiv</a></code> attribute specified, it must
be in a <code><a href="#head">head</a></code> element.</p>
<p>The DOM attributes <dfn id="name0" title=
"dom-meta-name"><code>name</code></dfn> and <dfn id="content1"
title="dom-meta-content"><code>content</code></dfn> must <a href=
"#reflect">reflect</a> the respective content attributes of the
same name. The DOM attribute <dfn id="httpequiv" title=
"dom-meta-httpEquiv"><code>httpEquiv</code></dfn> must <a href=
"#reflect">reflect</a> the content attribute <code title=
"attr-meta-http-equiv"><a href="#http-equiv0">http-equiv</a></code>
.</p>
<h5 id="standard"><span class="secno">3.7.5.1.</span> Standard
metadata names</h5>
<p>This specification defines a few names for the <code title=
"attr-meta-name"><a href="#name">name</a></code> attribute of the
<code><a href="#meta0">meta</a></code> element.</p>
<dl>
<dt><del class="diff-old">generator</del> <dfn id=
"application-name" title="meta-application-name"><ins class=
"diff-chg">application-name</ins></dfn></dt>
<dd>
<p>The value must be a <ins class="diff-new">short</ins> free-form
string that <del class="diff-old">identifies</del> <ins class=
"diff-chg">giving</ins> the <del class="diff-old">software used to
generate</del> <ins class="diff-chg">name of</ins> the <del class=
"diff-old">document. This value</del> <ins class="diff-chg">Web
application that the page represents. If the page is not a Web
application, the</ins> <code title="meta-application-name"><a href=
"#application-name"><ins class=
"diff-chg">application-name</ins></a></code> <ins class=
"diff-chg">metadata name</ins> must not be <del class=
"diff-old">used on hand-authored pages. WYSIWYG editors have
additional constraints</del> <ins class="diff-chg">used. User
agents may use the application name in UI in preference to the
page's</ins> <code><a href="#title1"><ins class=
"diff-chg">title</ins></a> <del class="diff-old">on</del></code> ,
<ins class="diff-chg">since</ins> the <del class="diff-old">value
used with this metadata name.</del> <ins class="diff-chg">title
might include status messages and the like relevant to the status
of the page at a particular moment in time instead of just being
the name of the application.</ins></p>
</dd>
<dt><del class="diff-old">dns</del> <dfn id="description" title=
"meta-description"><ins class=
"diff-chg">description</ins></dfn></dt>
<dd>
<p>The value must be <del class="diff-old">an ordered set of unique
space-separated tokens , each word of which is</del> a <del class=
"diff-old">host name. The list allows authors to provide a list of
host names</del> <ins class="diff-chg">free-form string</ins> that
<ins class="diff-new">describes</ins> the <del class=
"diff-old">user is expected to subsequently need. User agents may,
according to user preferences and prevailing network conditions,
pre-emptively resolve the given DNS names (extracting the names
from the</del> <ins class="diff-chg">page. The</ins> value
<del class="diff-old">using the rules</del> <ins class=
"diff-chg">must be appropriate</ins> for <del class=
"diff-old">splitting</del> <ins class="diff-chg">use in</ins> a
<ins class="diff-new">directory of pages, e.g. in a search
engine.</ins></p>
</dd>
<dt><dfn id="generator" title="meta-generator"><ins class=
"diff-new">generator</ins></dfn></dt>
<dd>
<p><ins class="diff-new">The value must be a free-form</ins> string
<del class="diff-old">on spaces ), thus precaching the DNS
information for those hosts and potentially reducing</del>
<ins class="diff-chg">that identifies</ins> the <del class=
"diff-old">time between page loads for subsequent user
interactions. Higher priority should be given</del> <ins class=
"diff-chg">software used</ins> to <del class="diff-old">host names
given earlier in</del> <ins class="diff-chg">generate</ins> the
<del class="diff-old">list.</del> <ins class="diff-chg">document.
This value must not be used on hand-authored pages.</ins></p>
</dd>
</dl>
<h5 id="other"><span class="secno">3.7.5.2.</span> Other metadata
names</h5>
<p><dfn id="extensions" title="concept-meta-extensions">Extensions
to the predefined set of metadata names</dfn> may be registered in
the <a href="http://wiki.whatwg.org/wiki/MetaExtensions">WHATWG
Wiki MetaExtensions page</a> .</p>
<p>Anyone is free to edit the WHATWG Wiki MetaExtensions page at
any time to add a type. These new names must be specified with the
following information:</p>
<dl>
<dt>Keyword</dt>
<dd>
<p>The actual name being defined. The name should not be
confusingly similar to any other defined name (e.g. differing only
in case).</p>
</dd>
<dt>Brief description</dt>
<dd>
<p>A short description of what the metadata name's meaning is,
including the format the value is required to be in.</p>
</dd>
<dt>Link to more details</dt>
<dd>A link to a more detailed description of the metadata name's
semantics and requirements. It could be another page on the Wiki,
or a link to an external page.</dd>
<dt>Synonyms</dt>
<dd>
<p>A list of other names that have exactly the same processing
requirements. Authors should not use the names defined to be
synonyms, they are only intended to allow user agents to support
legacy content.</p>
</dd>
<dt>Status</dt>
<dd>
<p>One of the following:</p>
<dl>
<dt>Proposal</dt>
<dd>The name has not received wide peer review and approval.
Someone has proposed it and is using it.</dd>
<dt>Accepted</dt>
<dd>The name has received wide peer review and approval. It has a
specification that unambiguously defines how to handle pages that
use the name, including when they use it in incorrect ways.</dd>
<dt>Unendorsed</dt>
<dd>The metadata name has received wide peer review and it has been
found wanting. Existing pages are using this keyword, but new pages
should avoid it. The "brief description" and "link to more details"
entries will give details of what authors should use instead, if
anything.</dd>
</dl>
<p>If a metadata name is added with the "proposal" status and found
to be redundant with existing values, it should be removed and
listed as a synonym for the existing value.</p>
</dd>
</dl>
<p>Conformance checkers must use the information given on the
WHATWG Wiki MetaExtensions page to establish if a value not
explicitly defined in this specification is allowed or not. When an
author uses a new type not defined by either this specification or
the Wiki page, conformance checkers should offer to add the value
to the Wiki, with the details described above, with the "proposal"
status.</p>
<p>This specification does not define how new values will get
approved. It is expected that the Wiki will have a community that
addresses this.</p>
<p>Metadata names whose values are to be URIs must not be proposed
or accepted. Links must be represented using the <code><a href=
"#link">link</a></code> element, not the <code><a href=
"#meta0">meta</a></code> element.</p>
<h5 id="pragma"><span class="secno">3.7.5.3.</span> Pragma
directives</h5>
<p>When the <dfn id="http-equiv" title=
"attr-meta-http-equiv"><code>http-equiv</code></dfn> attribute is
specified on a <code><a href="#meta0">meta</a></code> element, the
element is a pragma directive.</p>
<p>The <dfn id="http-equiv0" title=
"attr-meta-http-equiv"><code>http-equiv</code></dfn> attribute is
an <a href="#enumerated">enumerated attribute</a> . The following
table lists the keywords defined for this attribute. The states
given in the first cell of the <del class="diff-old">the</del> rows
with keywords give the states to which those keywords map.</p>
<table>
<thead>
<tr>
<th>State</th>
<th>Keywords</th>
</tr>
</thead>
<tbody>
<tr>
<td><del class="diff-old">Refresh</del> <a href="#encoding" title=
"attr-meta-http-equiv-content-type"><ins class="diff-chg">Encoding
declaration</ins></a></td>
<td><code title=""><del class="diff-old">refresh</del> <ins class=
"diff-chg">Content-Type</ins></code></td>
</tr>
<tr>
<td><a href="#default" title=
"attr-meta-http-equiv-default-style">Default style</a></td>
<td><code title="">default-style</code></td>
</tr>
<tr>
<td><a href="#refresh" title=
"attr-meta-http-equiv-refresh"><ins class=
"diff-new">Refresh</ins></a></td>
<td><code title=""><ins class="diff-new">refresh</ins></code></td>
</tr>
</tbody>
</table>
<p>When a <code><a href="#meta0">meta</a></code> element is
inserted into the document, if its <code title=
"attr-meta-http-equiv"><a href="#http-equiv0">http-equiv</a></code>
attribute is present and represents one of the above states, then
the user agent must run the algorithm appropriate for that state,
as described in the following list:</p>
<dl>
<dt><dfn id="encoding" title=
"attr-meta-http-equiv-content-type"><ins class="diff-new">Encoding
declaration state</ins></dfn></dt>
<dd>
<p><ins class="diff-new">The</ins> <a href="#encoding" title=
"attr-meta-http-equiv-content-type"><ins class="diff-new">Encoding
declaration state's</ins></a> <ins class="diff-new">user agent
requirements are all handled by the parsing section of the
specification. The state is just an alternative form of setting
the</ins> <code title="meta-charset"><ins class=
"diff-new">charset</ins></code> <ins class="diff-new">attribute: it
is a</ins> <a href="#character2"><ins class="diff-new">character
encoding declaration</ins></a> .</p>
<p><ins class="diff-new">For</ins> <code><a href=
"#meta0"><ins class="diff-new">meta</ins></a></code> <ins class=
"diff-new">elements in the</ins> <a href="#encoding" title=
"attr-meta-http-equiv-content-type"><ins class="diff-new">Encoding
declaration state</ins></a> ,<ins class="diff-new">the</ins>
<code title="attr-meta-content"><a href="#content0"><ins class=
"diff-new">content</ins></a></code> <ins class="diff-new">attribute
must have a value that is a case-insensitive match of a string that
consists of the literal string "</ins> <code title=""><ins class=
"diff-new">text/html;</ins></code> <ins class="diff-new">",
optionally followed by any number of</ins> <a href="#space" title=
"space character"><ins class="diff-new">space characters</ins></a>
,<ins class="diff-new">followed by the literal string "</ins>
<code title=""><ins class="diff-new">charset=</ins></code>
<ins class="diff-new">", followed by the character encoding name
of</ins> <a href="#charset"><ins class="diff-new">the character
encoding declaration</ins></a> .</p>
<p><ins class="diff-new">If the document contains a</ins>
<code><a href="#meta0"><ins class="diff-new">meta</ins></a></code>
<ins class="diff-new">element in the</ins> <a href="#encoding"
title="attr-meta-http-equiv-content-type"><ins class=
"diff-new">Encoding declaration state</ins></a> <ins class=
"diff-new">then that element must be the first element in the
document's</ins> <code><a href="#head"><ins class=
"diff-new">head</ins></a></code> <ins class="diff-new">element, and
the document must not contain a</ins> <code><a href=
"#meta0"><ins class="diff-new">meta</ins></a></code> <ins class=
"diff-new">element with the</ins> <code title=
"attr-meta-charset"><a href="#charset1"><ins class=
"diff-new">charset</ins></a></code> <ins class="diff-new">attribute
present.</ins></p>
<p><ins class="diff-new">The</ins> <a href="#encoding" title=
"attr-meta-http-equiv-content-type"><ins class="diff-new">Encoding
declaration state</ins></a> <ins class="diff-new">may be used
in</ins> <a href="#html5" title="HTML5"><ins class="diff-new">HTML
documents</ins></a> <ins class="diff-new">only, elements in that
state must not be used in</ins> <a href="#xhtml5" title=
"XHTML"><ins class="diff-new">XML documents</ins></a> .</p>
</dd>
<dt><dfn id="default" title=
"attr-meta-http-equiv-default-style"><ins class="diff-new">Default
style state</ins></dfn></dt>
<dd>
<ol>
<li class="big-issue">...</li>
</ol>
</dd>
<dt><dfn id="refresh" title="attr-meta-http-equiv-refresh">Refresh
state</dfn></dt>
<dd>
<ol>
<li>
<p>If another <code><a href="#meta0">meta</a></code> element in the
<a href="#refresh" title="attr-meta-http-equiv-refresh">Refresh
state</a> has already been successfully processed (i.e. when it was
inserted the user agent processed it and reached the last step of
this list of steps), then abort these steps.</p>
</li>
<li>
<p>If the <code><a href="#meta0">meta</a></code> element has no
<code title="attr-meta-content"><a href=
"#content0">content</a></code> attribute, or if that attribute's
value is the empty string, then abort these steps.</p>
</li>
<li>
<p>Let <var title="">input</var> be the value of the element's
<code title="attr-meta-content"><a href=
"#content0">content</a></code> attribute.</p>
</li>
<li>
<p>Let <var title="">position</var> point at the first character of
<var title="">input</var> .</p>
</li>
<li>
<p><a href="#skip-whitespace">Skip whitespace</a> .</p>
</li>
<li>
<p><a href="#collect" title=
"collect a sequence of characters">Collect a sequence of
characters</a> in the range U+0030 DIGIT ZERO to U+0039 DIGIT NINE,
and parse the resulting string using the <a href="#rules">rules for
parsing non-negative integers</a> . If the sequence of characters
collected is the empty string, then no number will have been
parsed; abort these steps. Otherwise, let <var title="">time</var>
be the parsed number.</p>
</li>
<li>
<p><a href="#collect" title=
"collect a sequence of characters">Collect a sequence of
characters</a> in the range U+0030 DIGIT ZERO to U+0039 DIGIT NINE
and U+002E FULL STOP (" <code title="">.</code> "). Ignore any
collected characters.</p>
</li>
<li>
<p><a href="#skip-whitespace">Skip whitespace</a> .</p>
</li>
<li>
<p>Let <var title="">url</var> be the address of the current
page.</p>
</li>
<li>
<p>If the character in <var title="">input</var> pointed to by
<var title="">position</var> is a U+003B SEMICOLON (" <code title=
"">;</code> "), then advance <var title="">position</var> to the
next character. Otherwise, jump to the last step.</p>
</li>
<li>
<p><a href="#skip-whitespace">Skip whitespace</a> .</p>
</li>
<li>
<p>If the character in <var title="">input</var> pointed to by
<var title="">position</var> is one of U+0055 LATIN CAPITAL LETTER
U or U+0075 LATIN SMALL LETTER U, then advance <var title=
"">position</var> to the next character. Otherwise, jump to the
last step.</p>
</li>
<li>
<p>If the character in <var title="">input</var> pointed to by
<var title="">position</var> is one of U+0052 LATIN CAPITAL LETTER
R or U+0072 LATIN SMALL LETTER R, then advance <var title=
"">position</var> to the next character. Otherwise, jump to the
last step.</p>
</li>
<li>
<p>If the character in <var title="">input</var> pointed to by
<var title="">position</var> is one of U+004C LATIN CAPITAL LETTER
L or U+006C LATIN SMALL LETTER L, then advance <var title=
"">position</var> to the next character. Otherwise, jump to the
last step.</p>
</li>
<li>
<p><a href="#skip-whitespace">Skip whitespace</a> .</p>
</li>
<li>
<p>If the character in <var title="">input</var> pointed to by
<var title="">position</var> is a U+003D EQUALS SIGN ("
<code title="">=</code> "), then advance <var title=
"">position</var> to the next character. Otherwise, jump to the
last step.</p>
</li>
<li>
<p><a href="#skip-whitespace">Skip whitespace</a> .</p>
</li>
<li>
<p>Let <var title="">url</var> be equal to the substring of
<var title="">input</var> from the character at <var title=
"">position</var> to the end of the string.</p>
</li>
<li>
<p>Strip any trailing <a href="#space" title=
"space character">space characters</a> from the end of <var title=
"">url</var> .</p>
</li>
<li>
<p>Strip any U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF),
and U+000D CARRIAGE RETURN (CR) characters from <var title=
"">url</var> .</p>
</li>
<li>
<p>Resolve the <var title="">url</var> value to an absolute URI
using <a href="#elements2" title="element's base URI">the base
URI</a> of the <code><a href="#meta0">meta</a></code> element.</p>
</li>
<li>
<p><ins class="diff-new">Perform one or more of the following
steps:</ins></p>
<ul>
<li>
<p>Set a timer so that in <var title="">time</var> seconds,
<ins class="diff-new">adjusted to take into account user or user
agent preferences,</ins> if the user has not canceled the redirect,
the user agent <a href="#navigate" title="navigate">navigates</a>
<ins class="diff-new">the document's browsing context</ins> to
<var title="">url</var> , with <a href="#replacement">replacement
enabled</a> , <ins class="diff-new">and with the document's
browsing context as the</ins> <a href="#source0"><ins class=
"diff-new">source browsing context</ins></a> .</p>
</li>
<li>
<p><ins class="diff-new">Provide the user with an interface that,
when selected,</ins> <span><ins class=
"diff-new">navigates</ins></span> <ins class="diff-new">a</ins>
<a href="#browsing1"><ins class="diff-new">browsing
context</ins></a> <ins class="diff-new">to</ins> <var title=
""><ins class="diff-new">url</ins></var> ,<ins class=
"diff-new">with the document's browsing context as the</ins>
<a href="#source0"><ins class="diff-new">source browsing
context</ins></a> .</p>
</li>
<li>
<p><ins class="diff-new">Do nothing.</ins></p>
</li>
</ul>
<p><ins class="diff-new">In addition, the user agent may, as with
anything, inform the user of any and all aspects of its operation,
including the state of any timers, the destinations of any timed
redirects, and so forth.</ins></p>
</li>
</ol>
<p>For <code><a href="#meta0">meta</a></code> elements in the
<a href="#refresh" title="attr-meta-http-equiv-refresh">Refresh
state</a> , the <code title="attr-meta-content"><a href=
"#content0">content</a></code> attribute must have a value
consisting either of:</p>
<ul>
<li>just a <a href="#valid">valid non-negative integer</a> ,
or</li>
<li>a <a href="#valid">valid non-negative integer</a> , followed by
a U+003B SEMICOLON ( <code title="">;</code> ), followed by one or
more <a href="#space" title="space character">space characters</a>
, followed by either a U+0055 LATIN CAPITAL LETTER U or a U+0075
LATIN SMALL LETTER U, a U+0052 LATIN CAPITAL LETTER R or a U+0072
LATIN SMALL LETTER R, a U+004C LATIN CAPITAL LETTER L or a U+006C
LATIN SMALL LETTER L, a U+003D EQUALS SIGN ( <code title=
"">=</code> ), and then a valid URI (or IRI).</li>
</ul>
<p>In the former case, the integer represents a number of seconds
before the page is to be reloaded; in the latter case the integer
represents a number of seconds before the page is to be replaced by
the page at the given URI.</p>
</dd>
</dl>
<p><ins class="diff-chg">There must not be more than one</ins>
<code><del class="diff-old">Default style</del> <a href=
"#meta0"><ins class="diff-chg">meta</ins></a></code> <ins class=
"diff-chg">element with any particular</ins> state <del class=
"diff-old">...</del> <ins class="diff-chg">in the document at a
time.</ins></p>
<h5 id="charset"><span class="secno">3.7.5.4.</span> Specifying the
document's character encoding</h5>
<p><del class="diff-old">The meta element may also be used to
provide UAs with</del> <ins class="diff-chg">A</ins> <dfn id=
"character2">character encoding <del class="diff-old">information
for HTML files, by setting the charset</del> <ins class=
"diff-chg">declaration</ins></dfn> <del class="diff-old">attribute
to the name of a character encoding. This</del> is <del class=
"diff-old">called</del> a <ins class="diff-new">mechanism by which
the</ins> character encoding <del class=
"diff-old">declaration.</del> <ins class="diff-chg">used to store
or transmit a document is specified.</ins></p>
<p>The following restrictions apply to character encoding
declarations:</p>
<ul>
<li>The character encoding name given must be the name of the
character encoding used to <del class="diff-old">serialise</del>
<ins class="diff-chg">serialize</ins> the file.</li>
<li>The value must be a valid character encoding name, and must be
the preferred name for that encoding. <a href=
"#references">[IANACHARSET]</a></li>
<li>The <del class="diff-old">attribute value</del> <ins class=
"diff-chg">character encoding declaration</ins> must be <del class=
"diff-old">serialised</del> <ins class="diff-chg">serialized</ins>
without the use of <a href="#character3" title=
"syntax-charref">character <del class="diff-old">entity</del>
references</a> <ins class="diff-new">or character escapes</ins> of
any kind.</li>
</ul>
<p>If the document does not start with a BOM, and if its encoding
is not explicitly given by <a href="#content-type8" title=
"Content-Type">Content-Type metadata</a> , then the character
encoding used must be <del class="diff-old">a superset of US-ASCII
(specifically, ANSI_X3.4-1968) for bytes in the range 0x09 - 0x0D,
0x20, 0x21, 0x22, 0x26, 0x27, 0x2C - 0x3F, 0x41 - 0x5A, and 0x61 -
0x7A ,</del> <ins class="diff-chg">an</ins> <a href=
"#ascii-compatible"><ins class="diff-chg">ASCII-compatible
character encoding</ins></a> , and, in addition, if that encoding
isn't US-ASCII itself, then the encoding must be specified using a
<code><a href="#meta0">meta</a></code> element with a <code title=
"attr-meta-charset"><a href="#charset1">charset</a></code>
<del class="diff-old">attribute.</del> <ins class=
"diff-chg">attribute or a</ins> <code><a href="#meta0"><ins class=
"diff-chg">meta</ins></a></code> <ins class="diff-chg">element in
the</ins> <a href="#encoding" title=
"attr-meta-http-equiv-content-type"><ins class="diff-chg">Encoding
declaration state</ins></a> .</p>
<p><ins class="diff-chg">If the document contains a</ins>
<code><a href="#meta0"><ins class="diff-chg">meta</ins></a></code>
<ins class="diff-chg">element with a</ins> <code title=
"attr-meta-charset"><a href="#charset1"><ins class=
"diff-chg">charset</ins></a></code> <ins class="diff-chg">attribute
or a</ins> <code><a href="#meta0"><ins class=
"diff-chg">meta</ins></a></code> <ins class="diff-chg">element in
the</ins> <a href="#encoding" title=
"attr-meta-http-equiv-content-type"><ins class="diff-chg">Encoding
declaration state</ins></a> ,<ins class="diff-chg">then the
character encoding used must be an</ins> <a href=
"#ascii-compatible"><ins class="diff-chg">ASCII-compatible
character encoding</ins></a> .</p>
<p><ins class="diff-chg">An</ins> <dfn id=
"ascii-compatible"><ins class="diff-chg">ASCII-compatible character
encoding</ins></dfn> <ins class="diff-chg">is one that is a
superset of US-ASCII (specifically, ANSI_X3.4-1968) for bytes in
the range 0x09 - 0x0D, 0x20, 0x21, 0x22, 0x26, 0x27, 0x2C - 0x3F,
0x41 - 0x5A, and 0x61 - 0x7A .</ins></p>
<p>Authors should not use JIS_X0212-1990, x-JIS0208, and encodings
based on EBCDIC. Authors should not use UTF-32. Authors must not
use the CESU-8, UTF-7, BOCU-1 and SCSU encodings. <a href=
"#references">[CESU8]</a> <a href="#references">[UTF7]</a> <a href=
"#references">[BOCU1]</a> <a href="#references">[SCSU]</a></p>
<p>Authors are encouraged to use UTF-8. Conformance checkers may
advise against authors using legacy encodings.</p>
<p>In XHTML, the XML declaration should be used for inline
character encoding information, if necessary.</p>
<h4 id="the-style0"><span class="secno"><del class=
"diff-old">3.7.6.</del> <ins class="diff-chg">3.7.6</ins></span>
The <dfn id="style1"><code>style</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#metadata0">Metadata content</a> .</dd>
<dd>If the <code title="attr-style-scoped"><a href=
"#scoped">scoped</a></code> attribute is present: <del class=
"diff-old">prose</del> <a href="#flow-content0"><ins class=
"diff-chg">flow</ins> content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>If the <code title="attr-style-scoped"><a href=
"#scoped">scoped</a></code> attribute is absent: where <a href=
"#metadata0">metadata content</a> is expected.</dd>
<dd>If the <code title="attr-style-scoped"><a href=
"#scoped">scoped</a></code> attribute is absent: in a
<code><a href="#noscript">noscript</a></code> element that is a
child of a <code><a href="#head">head</a></code> element.</dd>
<dd>If the <code title="attr-style-scoped"><a href=
"#scoped">scoped</a></code> attribute is present: where <del class=
"diff-old">prose</del> <a href="#flow-content0"><ins class=
"diff-chg">flow</ins> content</a> is expected, but before any
sibling elements other than <code><a href=
"#style1">style</a></code> elements and before any text nodes other
than <a href="#inter-element">inter-element whitespace</a> .</dd>
<dt>Content model:</dt>
<dd>Depends on the value of the <code title=
"attr-style-type"><a href="#type1">type</a></code> attribute.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-style-media"><a href=
"#media2">media</a></code></dd>
<dd><code title="attr-style-type"><a href=
"#type1">type</a></code></dd>
<dd><code title="attr-style-scoped"><a href=
"#scoped">scoped</a></code></dd>
<dd>Also, the <code title="attr-style-title"><a href=
"#title3">title</a></code> attribute has special semantics on this
element.</dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlstyleelement">HTMLStyleElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
attribute boolean <code title=
"dom-style-disabled"><a href="#disabled0">disabled</a></code>;
attribute DOMString <code title=
"dom-style-media"><a href="#media3">media</a></code>;
attribute DOMString <code title=
"dom-style-type"><a href="#type2">type</a></code>;
attribute boolean <code title=
"dom-style-scoped"><a href="#scoped0">scoped</a></code>;
};
</pre>
<p>The <code>LinkStyle</code> interface must also be implemented by
this element, the <a href="#styling0">styling processing model</a>
defines how. <a href="#references">[CSSOM]</a></p>
</dd>
</dl>
<p>The <code><a href="#style1">style</a></code> element allows
authors to embed style information in their documents. The
<code><a href="#style1">style</a></code> element is one of several
inputs to the <a href="#styling0">styling processing model</a>
.</p>
<p>If the <dfn id="type1" title=
"attr-style-type"><code>type</code></dfn> attribute is given, it
must contain a valid MIME type, optionally with parameters, that
designates a styling language. <a href="#references">[RFC2046]</a>
If the attribute is absent, the type defaults to
<code>text/css</code> . <a href="#references">[RFC2138]</a></p>
<p>When examining types to determine if they support the language,
user agents must not ignore unknown MIME parameters — types with
unknown parameters must be assumed to be unsupported.</p>
<p>The <dfn id="media2" title=
"attr-style-media"><code>media</code></dfn> attribute says which
media the styles apply to. The value must be a valid <a href=
"#mq">media <del class="diff-old">query.</del> <ins class=
"diff-chg">query</ins></a> . <a href="#references">[MQ]</a> User
agents must <del class="diff-old">only</del> apply the styles to
<span>views</span> while their state match the listed <del class=
"diff-old">media.</del> <ins class="diff-chg">media, and must not
apply them otherwise.</ins> <a href=
"#references">[DOM3VIEWS]</a></p>
<p id="style-default-media">The default, if the <code title=
"attr-style-media"><a href="#media2">media</a></code> attribute is
omitted, is <code>all</code> , meaning that by default styles apply
to all media.</p>
<p>The <dfn id="scoped" title=
"attr-style-scoped"><code>scoped</code></dfn> attribute is a
<a href="#boolean0">boolean attribute</a> . If the attribute is
present, then the user agent must <del class="diff-old">only</del>
apply the specified style information <ins class=
"diff-new">only</ins> to the <code><a href=
"#style1">style</a></code> element's parent element (if any), and
that element's child nodes. Otherwise, the specified styles must,
if applied, be applied to the entire document. <del class=
"diff-old">If the scoped attribute is not specified, the style
element must be the child of a head element or of a noscript
element that is a child of a head element. If the scoped attribute
is specified, then the style element must be the child of a prose
content element, before any text nodes other than inter-element
whitespace , and before any elements other than other style
elements.</del></p>
<p id="title-on-style">The <dfn id="title3" title=
"attr-style-title"><code>title</code></dfn> attribute on
<code><a href="#style1">style</a></code> elements defines <a href=
"#alternative">alternative style sheet sets</a> . If the
<code><a href="#style1">style</a></code> element has no
<code title="attr-style-title"><a href="#title3">title</a></code>
attribute, then it has no title; the <code title=
"attr-title"><a href="#title">title</a></code> attribute of
ancestors does not apply to the <code><a href=
"#style1">style</a></code> element.</p>
<p class="note">The <code title="attr-style-title"><a href=
"#title3">title</a></code> attribute on <code><a href=
"#style1">style</a></code> elements, like the <code title=
"attr-link-title"><a href="#title2">title</a></code> attribute on
<code><a href="#link">link</a></code> elements, differs from the
global <code title="attr-title"><a href="#title">title</a></code>
attribute in that a <code><a href="#style1">style</a></code> block
without a title does not inherit the title of the parent element:
it merely has no title.</p>
<p>All descendant elements must be processed, according to their
semantics, before the <code><a href="#style1">style</a></code>
element itself is evaluated. For styling languages that consist of
pure text, user agents must evaluate <code><a href=
"#style1">style</a></code> elements by passing the concatenation of
the contents of all the <a href="#text-node" title="text node">text
nodes</a> that are direct children of the <code><a href=
"#style1">style</a></code> element (not any other nodes such as
comments or elements), in <a href="#tree-order">tree order</a> , to
the style system. For XML-based styling languages, user agents must
pass all the children nodes of the <code><a href=
"#style1">style</a></code> element to the style system.</p>
<p class="note">This specification does not specify a style system,
but CSS is expected to be supported by most Web browsers. <a href=
"#references">[CSS21]</a></p>
<p>The <dfn id="media3" title=
"dom-style-media"><code>media</code></dfn> , <dfn id="type2" title=
"dom-style-type"><code>type</code></dfn> and <dfn id="scoped0"
title="dom-style-scoped"><code>scoped</code></dfn> DOM attributes
must <a href="#reflect">reflect</a> the respective content
attributes of the same name.</p>
<p>The DOM <dfn id="disabled0" title=
"dom-style-disabled"><code>disabled</code></dfn> attribute behaves
as defined <a href="#disabled1" title="dom-linkstyle-disabled">for
the alternative style sheets DOM</a> .</p>
<h4 id="styling"><span class="secno"><del class=
"diff-old">3.7.7.</del> <ins class="diff-chg">3.7.7</ins></span>
<dfn id="styling0" title=
"styling processing model">Styling</dfn></h4>
<p>The <code><a href="#link">link</a></code> and <code><a href=
"#style1">style</a></code> elements can provide styling information
for the user agent to use when rendering the document. The DOM
Styling specification specifies what styling information is to be
used by the user agent and how it is to be used. <a href=
"#references">[CSSOM]</a></p>
<p>The <code><a href="#style1">style</a></code> and <code><a href=
"#link">link</a></code> elements implement the
<code>LinkStyle</code> interface. <a href=
"#references">[CSSOM]</a></p>
<p>For <code><a href="#style1">style</a></code> elements, if the
user agent does not support the specified styling language, then
the <code title="dom-LinkStyle-sheet">sheet</code> attribute of the
element's <code>LinkStyle</code> interface must return null.
Similarly, <code><a href="#link">link</a></code> elements that do
not represent <a href="#stylesheet" title="rel-stylesheet">external
resource links that contribute to the styling processing model</a>
(i.e. that do not have a <code title="rel-stylesheet"><a href=
"#stylesheet">stylesheet</a></code> keyword in their <code title=
"attr-link-rel"><a href="#rel">rel</a></code> attribute), and
<code><a href="#link">link</a></code> elements whose specified
resource has not yet been downloaded, or is not in a supported
styling language, must have their <code>LinkStyle</code>
interface's <code title="dom-LinkStyle-sheet">sheet</code>
attribute return null.</p>
<p>Otherwise, the <code>LinkStyle</code> interface's <code title=
"dom-LinkStyle-sheet">sheet</code> attribute must return a
<code>StyleSheet</code> object with the attributes implemented as
follows: <a href="#references">[CSSOM]</a></p>
<dl>
<dt>The content type ( <code title=
"dom-stylesheet-type">type</code> DOM attribute)</dt>
<dd>
<p>The content type must be the same as the style's specified type.
For <code><a href="#style1">style</a></code> elements, this is the
same as the <code title="attr-style-type"><a href=
"#type1">type</a></code> content attribute's value, or <code title=
"">text/css</code> if that is omitted. For <code><a href=
"#link">link</a></code> elements, this is the <a href=
"#content-type8" title="Content-Type">Content-Type metadata of the
specified resource</a> .</p>
</dd>
<dt>The location ( <code title="dom-stylesheet-href">href</code>
DOM attribute)</dt>
<dd>
<p>For <code><a href="#link">link</a></code> elements, the location
must be the URI given by the element's <code title=
"attr-link-href"><a href="#href1">href</a></code> content
attribute. For <code><a href="#style1">style</a></code> elements,
there is no location.</p>
</dd>
<dt>The intended destination media for style information (
<code title="dom-stylesheet-media">media</code> DOM attribute)</dt>
<dd>
<p>The media must be the same as the value of the element's
<code title="">media</code> content attribute.</p>
</dd>
<dt>The style sheet title ( <code title=
"dom-stylesheet-title">title</code> DOM attribute)</dt>
<dd>
<p>The title must be the same as the value of the element's
<code title="">title</code> content attribute. If the attribute is
absent, then the style sheet does not have a title. The title is
used for defining <dfn id="alternative">alternative style sheet
sets</dfn> .</p>
</dd>
</dl>
<p>The <dfn id="disabled1" title=
"dom-LinkStyle-disabled"><code>disabled</code></dfn> DOM attribute
on <code><a href="#link">link</a></code> and <code><a href=
"#style1">style</a></code> elements must return false and do
nothing on setting, if the <code title=
"dom-linkstyle-sheet">sheet</code> attribute of their
<code>LinkStyle</code> interface is null. Otherwise, it must return
the value of the <code>StyleSheet</code> interface's <code title=
"dom-stylesheet-disabled">disabled</code> attribute on getting, and
forward the new value to that same attribute on setting.</p>
<h3 id="sections"><span class="secno"><del class=
"diff-old">3.8.</del> <ins class="diff-chg">3.8</ins></span>
Sections</h3>
<p id="applyToSection">Some elements, for example <code><a href=
"#address">address</a></code> elements, are scoped to their nearest
ancestor <a href="#sectioning0">sectioning <del class=
"diff-old">content.</del> <ins class="diff-chg">content</ins></a> .
For such elements <var title="">x</var> , the elements that apply
to a <a href="#sectioning0">sectioning content</a> element
<var title="">e</var> are all the <var title="">x</var> elements
whose nearest <a href="#sectioning0">sectioning content</a>
ancestor is <var title="">e</var> .</p>
<h4 id="the-body"><span class="secno"><del class=
"diff-old">3.8.1.</del> <ins class="diff-chg">3.8.1</ins></span>
The <dfn id="body0"><code>body</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#sectioning0">Sectioning content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>As the second element in an <code><a href=
"#html">html</a></code> element.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del>
<pre>
<ins class="diff-chg">class=idl>
interface
</ins><dfn id="htmlbodyelement"><ins class="diff-chg">
HTMLBodyElement
</ins></dfn><ins class="diff-chg">
:
</ins>
<a href="#htmlelement">
HTMLElement
</a>
<del class="diff-old">.
</del>
<ins class="diff-chg">{};
</ins>
</pre></dd>
</dl>
<p>The <code><a href="#body0">body</a></code> element represents
the main content of the document.</p>
<p>In conforming documents, there is only one <code><a href=
"#body0">body</a></code> element. The <code title=
"dom-document-body"><a href="#body">document.body</a></code> DOM
attribute provides scripts with easy access to a document's
<code><a href="#body0">body</a></code> element.</p>
<p class="note">Some DOM operations (for example, parts of the
<a href="#drag-and">drag and drop</a> model) are defined in terms
of " <a href="#the-body1">the body element</a> ". This refers to a
particular element in the DOM, as per the definition of the term,
and not any arbitrary <code><a href="#body0">body</a></code>
element.</p>
<h4 id="the-section"><span class="secno"><del class=
"diff-old">3.8.2.</del> <ins class="diff-chg">3.8.2</ins></span>
The <dfn id="section"><code>section</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dd><a href="#sectioning0">Sectioning content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#section">section</a></code> element
represents a generic document or application section. A section, in
this context, is a thematic grouping of content, typically with a
header, possibly with a footer.</p>
<p class="example">Examples of sections would be chapters, the
various tabbed pages in a tabbed dialog box, or the numbered
sections of a thesis. A Web site's home page could be split into
sections for an introduction, news items, contact information.</p>
<h4 id="the-nav"><span class="secno"><del class=
"diff-old">3.8.3.</del> <ins class="diff-chg">3.8.3</ins></span>
The <dfn id="nav"><code>nav</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dd><a href="#sectioning0">Sectioning content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#nav">nav</a></code> element represents a
section of a page that links to other pages or to parts within the
page: a section with navigation links. <ins class="diff-new">Not
all groups of links on a page need to be in a</ins> <code><a href=
"#nav"><ins class="diff-new">nav</ins></a></code> <ins class=
"diff-new">element — only sections that consist of primary
navigation blocks are appropriate for the</ins> <code><a href=
"#nav"><ins class="diff-new">nav</ins></a></code> <ins class=
"diff-new">element. In particular, it is common for footers to have
a list of links to various key parts of a site, but the</ins>
<code><a href="#footer"><ins class=
"diff-new">footer</ins></a></code> <ins class="diff-new">element is
more appropriate in such cases.</ins></p>
<div class="example">
<p><ins class="diff-new">In the following example, the page has
several places where links are present, but only one of those
places is considered a navigation section.</ins></p>
<pre>
<body><ins class="diff-new">
<header>
<h1>Wake up sheeple!</h1>
<p><a href="news.html">News</a> -
<a href="blog.html">Blog</a> -
<a href="forums.html">Forums</a></p>
</header>
<nav>
<h1>Navigation</h1>
<ul>
<li><a href="articles.html">Index of all articles</a><li>
<li><a href="today.html">Things sheeple need to wake up for today</a><li>
<li><a href="successes.html">Sheeple we have managed to wake</a><li>
</ul>
</nav>
<article>
<p>...<em>page content would be here</em>...</p>
</article>
<footer>
<p>Copyright © 2006 The Example Company</p>
<p><a href="about.html">About</a> -
<a href="policy.html">Privacy Policy</a> -
<a href="contact.html">Contact Us</a></p>
</footer>
</body>
</ins>
</pre></div>
<h4 id="the-article"><span class="secno"><del class=
"diff-old">3.8.4.</del> <ins class="diff-chg">3.8.4</ins></span>
The <dfn id="article"><code>article</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dd><a href="#sectioning0">Sectioning content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#article">article</a></code> element
represents a section of a page that consists of a composition that
forms an independent part of a document, page, or site. This could
be a forum post, a magazine or newspaper article, a Web log entry,
a user-submitted comment, or any other independent item of
content.</p>
<p class="note">An <code><a href="#article">article</a></code>
element is "independent" in that its contents could stand alone,
for example in syndication. However, the element is still
associated with its ancestors; for instance, contact information
that <a href="#applyToSection">applies</a> to a parent
<code><a href="#body0">body</a></code> element still covers the
<code><a href="#article">article</a></code> as well.</p>
<p>When <code><a href="#article">article</a></code> elements are
nested, the inner <code><a href="#article">article</a></code>
elements represent articles that are in principle related to the
contents of the outer article. For instance, a Web log entry on a
site that accepts user-submitted comments could represent the
comments as <code><a href="#article">article</a></code> elements
nested within the <code><a href="#article">article</a></code>
element for the Web log entry.</p>
<p>Author information associated with an <code><a href=
"#article">article</a></code> element (q.v. the <code><a href=
"#address">address</a></code> element) does not apply to nested
<code><a href="#article">article</a></code> elements. <del class=
"diff-old">3.8.5. The blockquote element Categories Prose content .
Sectioning content . Contexts in which this element may be used:
Where prose content is expected. Content model: Prose content .
Element-specific attributes: cite DOM interface: <pre
class=idl>interface { attribute DOMString ; }; The
HTMLQuoteElement interface is also used by the q element. The
blockquote element represents a section that is quoted from another
source. Content inside a blockquote must be quoted from another
source, whose URI, if it has one, should be cited in the cite
attribute. If the cite attribute is present, it must be a URI (or
IRI). User agents should allow users to follow such citation links.
If a blockquote element is preceded or followed by a paragraph that
contains a single cite element and is itself not preceded or
followed by another blockquote element and does not itself have a q
element descendant, then, the citation given by that cite element
gives the source of the quotation contained in the blockquote
element. The cite DOM attribute reflects the element's cite content
attribte. The best way to represent a conversation is not with the
cite and blockquote elements, but with the dialog
element.</del></p>
<h4 id="the-aside"><span class="secno"><del class=
"diff-old">3.8.6.</del> <ins class="diff-chg">3.8.5</ins></span>
The <dfn id="aside"><code>aside</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dd><a href="#sectioning0">Sectioning content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#aside">aside</a></code> element represents a
section of a page that consists of content that is tangentially
related to the content around the <code><a href=
"#aside">aside</a></code> element, and which could be considered
separate from that content. Such sections are often represented as
sidebars in printed typography.</p>
<div class="example">
<p><ins class="diff-new">The following example shows how an aside
is used to mark up background material on Switzerland in a much
longer news story on Europe.</ins></p>
<pre>
<aside><ins class="diff-new">
<h1>Switzerland</h1>
<p>Switzerland, a land-locked country in the middle of geographic
Europe, has not joined the geopolitical European Union, though it is
a signatory to a number of European treaties.</p>
</aside>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-new">The following example shows how an aside
is used to mark up a pull quote in a longer article.</ins></p>
<pre>
...<ins class="diff-new">
<p>He later joined a large company, continuing on the same work.
<q>I love my job. People ask me what I do for fun when I'm not at
work. But I'm paid to do my hobby, so I never know what to
answer. Some people wonder what they would do if they didn't have to
work... but I know what I would do, because I was unemployed for a
year, and I filled that time doing exactly what I do
now.</q></p>
<aside>
<q> People ask me what I do for fun when I'm not at work. But I'm
paid to do my hobby, so I never know what to answer. </q>
</aside>
<p>Of course his work — or should that be hobby? —
isn't his only passion. He also enjoys other pleasures.</p>
...
</ins>
</pre></div>
<h4 id="the-h1"><span class="secno"><del class=
"diff-old">3.8.7.</del> <ins class="diff-chg">3.8.6</ins></span>
The <dfn id="h1"><code>h1</code></dfn> , <dfn id=
"h2"><code>h2</code></dfn> , <dfn id="h3"><code>h3</code></dfn> ,
<dfn id="h4"><code>h4</code></dfn> , <dfn id=
"h5"><code>h5</code></dfn> , and <dfn id="h6"><code>h6</code></dfn>
elements</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dd><a href="#heading0">Heading content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>These elements define headers for their sections.</p>
<p>The semantics and meaning of these elements are defined in the
section on <a href="#headings0">headings and sections</a> .</p>
<p>These elements have a <dfn id="rank">rank</dfn> given by the
number in their name. The <code><a href="#h1">h1</a></code> element
is said to have the highest rank, the <code><a href=
"#h6">h6</a></code> element has the lowest rank, and two elements
with the same name have equal rank.</p>
<h4 id="the-header"><span class="secno"><del class=
"diff-old">3.8.8.</del> <ins class="diff-chg">3.8.7</ins></span>
The <dfn id="header"><code>header</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dd><a href="#heading0">Heading content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a> ,
including at least one descendant that is <a href=
"#heading0">heading content</a> , but no <a href=
"#sectioning0">sectioning content</a> descendants, no
<code><a href="#header">header</a></code> element descendants, and
no <code><a href="#footer">footer</a></code> element
descendants.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#header">header</a></code> element represents
the header of a section. <del class="diff-old">Headers</del>
<ins class="diff-chg">The element is typically used to group a set
of</ins> <code><a href="#h1"><ins class=
"diff-chg">h1</ins></a></code> <ins class="diff-chg">–</ins>
<code><a href="#h6"><ins class="diff-chg">h6</ins></a></code>
<ins class="diff-chg">elements to mark up a page's title with its
subtitle or tagline. However,</ins> <code><a href=
"#header"><ins class="diff-chg">header</ins></a></code> <ins class=
"diff-chg">elements</ins> may contain more than just the section's
<del class="diff-old">heading</del> <ins class="diff-chg">headings
and subheadings</ins> — for example it would be reasonable for the
header to include version history information.</p>
<p>For the purposes of document summaries, outlines, and the like,
<code><a href="#header">header</a></code> elements are equivalent
to the highest <a href="#rank" title="rank">ranked</a>
<code><a href="#h1">h1</a></code> <del class="diff-old">-</del>
<ins class="diff-chg">–</ins> <code><a href="#h6">h6</a></code>
element descendant of the <code><a href="#header">header</a></code>
element (the first such element if there are multiple elements with
that <a href="#rank">rank</a> ).</p>
<p>Other heading elements in the <code><a href=
"#header">header</a></code> element indicate subheadings or
subtitles.</p>
<p><ins class="diff-new">The</ins> <a href="#rank"><ins class=
"diff-new">rank</ins></a> <ins class="diff-new">of a</ins>
<code><a href="#header"><ins class=
"diff-new">header</ins></a></code> <ins class="diff-new">element is
the same as for an</ins> <code><a href="#h1"><ins class=
"diff-new">h1</ins></a></code> <ins class="diff-new">element (the
highest rank).</ins></p>
<p><ins class="diff-new">The section on</ins> <a href=
"#headings0"><ins class="diff-new">headings and sections</ins></a>
<ins class="diff-new">defines how</ins> <code><a href=
"#header"><ins class="diff-new">header</ins></a></code> <ins class=
"diff-new">elements are assigned to individual sections.</ins></p>
<div class="example">
<p>Here are some examples of valid headers. In each case, the
emphasised text represents the text that would be used as the
header in an application extracting header data and ignoring
subheadings.</p>
<pre>
<header>
<h1><strong>The reality dysfunction</strong></h1>
<h2>Space is not the only void</h2>
</header>
</pre>
<pre>
<header>
<ins class=
"diff-new"> <h1><strong>Dr. Strangelove</strong></h1>
<h2>Or: How I Learned to Stop Worrying and Love the Bomb</h2>
</header>
</ins>
</pre>
<pre>
<header>
<p>Welcome to...</p>
<h1><strong>Voidwars!</strong></h1>
</header>
</pre>
<pre>
<header>
<h1><strong>Scalable Vector Graphics (SVG) 1.2</strong></h1>
<h2>W3C Working Draft 27 October 2004</h2>
<dl>
<dt>This version:</dt>
<dd><a href="http://www.w3.org/TR/2004/WD-SVG12-20041027/">http://www.w3.org/TR/2004/WD-SVG12-20041027/</a></dd>
<dt>Previous version:</dt>
<dd><a href="http://www.w3.org/TR/2004/WD-SVG12-20040510/">http://www.w3.org/TR/2004/WD-SVG12-20040510/</a></dd>
<dt>Latest version of SVG 1.2:</dt>
<dd><a href="http://www.w3.org/TR/SVG12/">http://www.w3.org/TR/SVG12/</a></dd>
<dt>Latest SVG Recommendation:</dt>
<dd><a href="http://www.w3.org/TR/SVG/">http://www.w3.org/TR/SVG/</a></dd>
<dt>Editor:</dt>
<dd>Dean Jackson, W3C, <a href="mailto:dean@w3.org">dean@w3.org</a></dd>
<dt>Authors:</dt>
<dd>See <a href="#authors">Author List</a></dd>
</dl>
<p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notic <em>...</em>
</header>
</pre></div>
<del class="diff-old">The section on headings and sections defines
how header elements are assigned to individual sections. The rank
of a header element is the same as for an h1 element (the highest
rank).</del>
<h4 id="the-footer"><span class="secno"><del class=
"diff-old">3.8.9.</del> <ins class="diff-chg">3.8.8</ins></span>
The <dfn id="footer"><code>footer</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a> , but
with no <a href="#heading0">heading content</a> descendants, no
<a href="#sectioning0">sectioning content</a> descendants, and no
<code><a href="#footer">footer</a></code> element descendants.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#footer">footer</a></code> element represents
the footer for the section it <a href="#applyToSection">applies</a>
to. A footer typically contains information about its section such
as who wrote it, links to related documents, copyright data, and
the like.</p>
<p>Contact information for the section given in a <code><a href=
"#footer">footer</a></code> should be marked up using the
<code><a href="#address">address</a></code> element.</p>
<p><ins class="diff-new">Footers don't necessarily have to appear
at the end of a section, though they usually do.</ins></p>
<div class="example">
<p><ins class="diff-new">Here is a page with two footers, one at
the top and one at the bottom, with the same content:</ins></p>
<pre>
<body>
<ins class=
"diff-new"> <footer><a href="../">Back to index...</a></footer>
<h1>Lorem ipsum</h1>
<p>A dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.</p>
<footer><a href="../">Back to index...</a></footer>
</body>
</ins>
</pre></div>
<h4 id="the-address"><span class="secno"><del class=
"diff-old">3.8.10.</del> <ins class="diff-chg">3.8.9</ins></span>
The <dfn id="address"><code>address</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a> , but
with no <a href="#heading0">heading content</a> descendants, no
<a href="#sectioning0">sectioning content</a> descendants, no
<code><a href="#footer">footer</a></code> element descendants, and
no <code><a href="#address">address</a></code> element
descendants.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#address">address</a></code> element
represents the contact information for the section it <a href=
"#applyToSection">applies</a> to. <ins class="diff-new">If it
applies to</ins> <a href="#the-body1"><ins class=
"diff-new">the</ins> <code><ins class="diff-new">body</ins></code>
<ins class="diff-new">element</ins></a> ,<ins class="diff-new">then
it instead applies to the document as a whole.</ins></p>
<div class="example">
<p>For example, a page at the W3C Web site related to HTML might
include the following contact information:</p>
<pre>
<ADDRESS>
<A href="../People/Raggett/">Dave Raggett</A>,
<A href="../People/Arnaud/">Arnaud Le Hors</A>,
contact persons for the <A href="Activity">W3C HTML Activity</A>
</ADDRESS>
</pre></div>
<p>The <code><a href="#address">address</a></code> element must not
be used to represent arbitrary addresses (e.g. postal addresses),
unless those addresses are contact information for the section.
(The <code><a href="#p">p</a></code> element is the appropriate
element for marking up such addresses.)</p>
<p>The <code><a href="#address">address</a></code> element must not
contain information other than contact information.</p>
<div class="example">
<p>For example, the following is non-conforming use of the
<code><a href="#address">address</a></code> element:</p>
<pre>
<ADDRESS>
Last
Modified:
1999/12/24
23:37:50</ADDRESS>
</pre></div>
<p>Typically, the <code><a href="#address">address</a></code>
element would be included with other information in a
<code><a href="#footer">footer</a></code> element.</p>
<p>To determine the contact information for a <a href=
"#sectioning0">sectioning <ins class="diff-new">content</ins></a>
element (such as a document's <code><a href=
"#body0">body</a></code> element, which would give the contact
information for the page), UAs must collect all the <code><a href=
"#address">address</a></code> elements that <a href=
"#applyToSection">apply</a> to that <a href=
"#sectioning0">sectioning <ins class="diff-new">content</ins></a>
element and its ancestor <a href="#sectioning0">sectioning
<ins class="diff-new">content</ins></a> elements. The contact
information is the collection of all the information given by those
elements.</p>
<p class="note">Contact information for one <a href=
"#sectioning0">sectioning <ins class="diff-new">content</ins></a>
element, e.g. an <code><a href="#aside">aside</a></code> element,
does not apply to its ancestor elements, e.g. the page's
<code><a href="#body0">body</a></code> .</p>
<h4 id="headings"><span class="secno"><del class=
"diff-old">3.8.11.</del> <ins class="diff-chg">3.8.10</ins></span>
<dfn id="headings0">Headings and sections</dfn></h4>
<p>The <code><a href="#h1">h1</a></code> <del class=
"diff-old">-</del> <ins class="diff-chg">–</ins> <code><a href=
"#h6">h6</a></code> elements and the <code><a href=
"#header">header</a></code> element are headings.</p>
<p>The first element of <a href="#heading0">heading content</a> in
an element of <a href="#sectioning0">sectioning content</a> gives
the header for that section. Subsequent headers of equal or higher
<a href="#rank">rank</a> start new (implied) sections, headers of
lower <a href="#rank">rank</a> start subsections that are part of
the previous one.</p>
<p><del class="diff-old">Sectioning elements other than</del>
<del class="diff-old">blockquote</del> <a href=
"#sectioning0"><ins class="diff-chg">Sectioning content</ins></a>
<ins class="diff-chg">elements</ins> are always considered
subsections of their nearest ancestor element of <a href=
"#sectioning0">sectioning <del class="diff-old">content,</del>
<ins class="diff-chg">content</ins></a> , regardless of what
implied sections other headings may have created. <del class=
"diff-old">However,</del></p>
<p><ins class="diff-chg">Certain elements are said to be</ins>
<dfn id="sectioning1" title="sectioning root"><ins class=
"diff-chg">sectioning roots</ins></dfn> ,<ins class=
"diff-chg">including</ins> <code><a href=
"#blockquote">blockquote</a></code> <del class="diff-old">elements
are associated with implied sections. Effectively,</del>
<ins class="diff-chg">and</ins> <code><del class=
"diff-old">blockquote</del> <a href="#td"><ins class=
"diff-chg">td</ins></a></code> <ins class="diff-new">elements.
These</ins> elements <del class="diff-old">act like sections
on</del> <ins class="diff-chg">can have their own outlines,
but</ins> the <del class="diff-old">inside,</del> <ins class=
"diff-chg">sections</ins> and <del class="diff-old">act opaquely
on</del> <ins class="diff-chg">headers inside these elements do not
contribute to</ins> the <del class="diff-old">outside.</del>
<ins class="diff-chg">outlines of their ancestors.</ins></p>
<div class="example">
<p>For the following fragment:</p>
<pre>
<body>
<h1>Foo</h1>
<h2>Bar</h2>
<blockquote>
<h3>Bla</h3>
</blockquote>
<p>Baz</p>
<h2>Quux</h2>
<section>
<h3>Thud</h3>
</section>
<p>Grunt</p>
</body>
</pre>
<p>...the structure would be:</p>
<ol>
<li>Foo (heading of explicit <code><a href="#body0">body</a></code>
<del class="diff-old">section)</del> <ins class="diff-chg">section,
containing the "Grunt" paragraph)</ins>
<ol>
<li>Bar (heading starting implied <del class="diff-old">section)
Bla (heading of explicit blockquote section) Baz (paragraph)</del>
<ins class="diff-chg">section, containing a block quote and the
"Baz" paragraph)</ins></li>
<li>Quux (heading starting implied section)</li>
<li>Thud (heading of explicit <code><a href=
"#section">section</a></code> section)</li>
</ol>
<del class="diff-old">Grunt (paragraph)</del></li>
</ol>
<p>Notice how the <code><del class="diff-old">blockquote nests
inside an implicit section while the</del> <a href=
"#section">section</a></code> <del class="diff-old">does not (and
in fact,</del> ends the earlier implicit section so that a later
paragraph <ins class="diff-new">("Grunt")</ins> is back at the top
<del class="diff-old">level).</del> <ins class=
"diff-chg">level.</ins></p>
</div>
<p>Sections may contain headers of any <a href="#rank">rank</a> ,
but authors are strongly encouraged to either use only
<code><a href="#h1">h1</a></code> elements, or to use elements of
the appropriate <a href="#rank">rank</a> for the section's nesting
level.</p>
<p>Authors are also encouraged to <del class=
"diff-old">explictly</del> <ins class="diff-chg">explicitly</ins>
wrap sections in elements of <a href="#sectioning0">sectioning
content</a> , instead of relying on the implicit sections generated
by having multiple heading in one element of <a href=
"#sectioning0">sectioning content</a> .</p>
<div class="example">
<p>For example, the following is correct:</p>
<pre>
<body>
<h4>Apples</h4>
<p>Apples are fruit.</p>
<section>
<h2>Taste</h2>
<p>They taste lovely.</p>
<h6>Sweet</h6>
<p>Red apples are sweeter than green ones.</p>
<h1>Color</h1>
<p>Apples come in various colors.</p>
</section>
</body>
</pre>
<p>However, the same document would be more clearly expressed
as:</p>
<pre>
<body>
<h1>Apples</h1>
<p>Apples are fruit.</p>
<section>
<h2>Taste</h2>
<p>They taste lovely.</p>
<section>
<h3>Sweet</h3>
<p>Red apples are sweeter than green ones.</p>
</section>
</section>
<section>
<h2>Color</h2>
<p>Apples come in various colors.</p>
</section>
</body>
</pre>
<p>Both of the documents above are semantically identical and would
produce the same outline in compliant user agents.</p>
</div>
<h5 id="outlines"><span class="secno"><del class=
"diff-old">3.8.11.1.</del> <ins class=
"diff-chg">3.8.10.1.</ins></span> Creating an outline</h5>
<p>This section <del class="diff-old">will be rewritten at some
point. The</del> <ins class="diff-chg">defines an</ins> algorithm
<del class="diff-old">likely won't change, but its description will
be dramatically simplified. Documents can be viewed as</del>
<ins class="diff-chg">for creating an</ins> <dfn id=
"outline"><ins class="diff-chg">outline</ins></dfn> <ins class=
"diff-chg">for</ins> a <del class="diff-old">tree of sections,
which defines how each</del> <a href="#sectioning0"><ins class=
"diff-chg">sectioning content</ins></a> element <del class=
"diff-old">in the tree</del> <ins class="diff-chg">or a</ins>
<a href="#sectioning1"><ins class="diff-chg">sectioning
root</ins></a> <ins class="diff-chg">element. It</ins> is
<del class="diff-old">semantically related to the others,</del>
<ins class="diff-chg">defined</ins> in terms of <del class=
"diff-old">the overall section structure. This tree is related to
the document tree, but there is not</del> a <del class=
"diff-old">one-to-one relationship between elements in</del>
<ins class="diff-chg">walk over</ins> the <ins class=
"diff-new">nodes of a</ins> DOM <ins class="diff-new">tree, in tree
order, with each node being visited when it is</ins> <i><ins class=
"diff-new">entered</ins></i> and <ins class="diff-new">when it
is</ins> <i><ins class="diff-new">exited</ins></i> <ins class=
"diff-new">during</ins> the <del class="diff-old">document's
sections.</del> <ins class="diff-chg">walk.</ins></p>
<p>The <del class="diff-old">tree of sections should be used when
generating document outlines,</del> <ins class=
"diff-chg">outline</ins> for <del class="diff-old">example when
generating tables of contents. To derive the tree of sections from
the document tree,</del> a <del class="diff-old">hypothetical tree
is used, consisting of a view of the document tree containing only
the elements of heading content and the elements of</del> <a href=
"#sectioning0">sectioning content</a> <del class="diff-old">other
than blockquote</del> <ins class="diff-chg">element or a</ins>
<a href="#sectioning1"><ins class="diff-chg">sectioning
root</ins></a> <del class="diff-old">. Descendants</del>
<ins class="diff-chg">element consists</ins> of <del class=
"diff-old">h1 - h6 , header ,</del> <ins class="diff-chg">a list of
one or more potentially nested sections. Each section can have one
heading associated with it. The algorithm for the outline also
associates each node in the DOM tree with a particular
section</ins> and <ins class="diff-new">potentially a heading. (The
sections in the outline aren't</ins> <code><del class=
"diff-old">blockquote</del> <a href="#section"><ins class=
"diff-chg">section</ins></a></code> <ins class="diff-new">elements,
though some may correspond to such</ins> elements <del class=
"diff-old">must be removed from this view.</del> <ins class=
"diff-chg">— they are merely conceptual sections.)</ins></p>
<p>The <del class="diff-old">hypothetical tree</del> <ins class=
"diff-chg">algorithm that</ins> must be <ins class=
"diff-new">followed during a walk of a DOM subtree</ins> rooted at
<del class="diff-old">the root element or at an element of</del>
<ins class="diff-chg">a</ins> <a href="#sectioning0">sectioning
content <del class="diff-old">. In particular, while the sections
inside blockquote</del></a> <del class="diff-old">s do not
contribute</del> <ins class="diff-chg">element or a</ins> <a href=
"#sectioning1"><ins class="diff-chg">sectioning root</ins></a>
<ins class="diff-chg">element</ins> to <ins class=
"diff-new">determine that element's outline is as
follows:</ins></p>
<ol>
<li>
<p><ins class="diff-new">Let</ins> <var title=""><ins class=
"diff-new">current outlinee</ins></var> <ins class="diff-new">be
null. (It holds</ins> the <del class="diff-old">document's tree of
sections, blockquote s</del> <ins class="diff-chg">element whose
outline is being created.)</ins></p>
</li>
<li>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">current section</ins></var> <ins class="diff-chg">be
null. (It holds a pointer to a section, so that elements in the
DOM</ins> can <del class="diff-old">have outlines of their
own.</del> <ins class="diff-chg">all be associated with a
section.)</ins></p>
</li>
<li>
<p><del class="diff-old">UAs must take</del> <ins class=
"diff-chg">Create a stack to hold elements, which is used to handle
nesting. Initialize</ins> this <del class="diff-old">hypothetical
tree (which will become</del> <ins class="diff-chg">stack to
empty.</ins></p>
</li>
<li>
<p><ins class="diff-chg">As you walk over</ins> the <del class=
"diff-old">outline) and mutate it by walking it depth first</del>
<ins class="diff-chg">DOM</ins> in <a href="#tree-order">tree order
<del class="diff-old">and, for each element of heading content that
is not</del></a> , <ins class="diff-chg">trigger</ins> the first
<ins class="diff-new">relevant step below for each</ins> element
<del class="diff-old">of its parent sectioning content element,
inserting a new element of sectioning content ,</del> as
<del class="diff-old">follows:</del> <ins class="diff-chg">you
enter and exit it.</ins></p>
<dl class="switch">
<dt>If the <del class="diff-old">element is a header element, or if
it is an h1 - h6 node of rank equal to or higher than the first
element in the parent element of sectioning content (assuming that
is also an h1 - h6 node), or if the first element</del> <ins class=
"diff-chg">top</ins> of the <del class="diff-old">parent element of
sectioning content</del> <ins class="diff-chg">stack</ins> is an
<ins class="diff-new">element, and you are exiting that</ins>
element <del class="diff-old">of sectioning content :</del></dt>
<dd><del class="diff-old">Insert the new</del>
<p class="note"><ins class="diff-chg">The</ins> element <del class=
"diff-old">of sectioning</del> <ins class="diff-chg">being exited
is a</ins> <a href="#heading0"><ins class="diff-chg">heading</ins>
content</a> <del class="diff-old">as the immediately following
sibling of the parent</del> <ins class=
"diff-chg">element.</ins></p>
<p><ins class="diff-chg">Pop that</ins> element <del class=
"diff-old">of sectioning content , and move all the elements</del>
from the <del class="diff-old">current element</del> <ins class=
"diff-chg">stack.</ins></p>
</dd>
<dt><ins class="diff-chg">If the top</ins> of <ins class=
"diff-new">the stack is a</ins> <a href="#heading0">heading
content</a> <del class="diff-old">up to the end of the parent</del>
element <del class="diff-old">of</del></dt>
<dd>
<p><ins class="diff-chg">Do nothing.</ins></p>
</dd>
<dt><ins class="diff-chg">When entering a</ins> <a href=
"#sectioning0">sectioning content</a> <del class="diff-old">into
the new</del> element <del class="diff-old">of</del> <ins class=
"diff-chg">or a</ins> <a href="#sectioning1">sectioning <del class=
"diff-old">content . Otherwise:</del> <ins class=
"diff-chg">root</ins></a> <ins class="diff-chg">element</ins></dt>
<dd><del class="diff-old">Move</del>
<p><ins class="diff-chg">If</ins> <var title=""><ins class=
"diff-chg">current outlinee</ins></var> <ins class="diff-chg">is
not null, push</ins> <var title=""><ins class="diff-chg">current
outlinee</ins></var> <ins class="diff-chg">onto</ins> the
<ins class="diff-new">stack.</ins></p>
<p><ins class="diff-new">Let</ins> <var title="">current
<del class="diff-old">heading element, and all subsequent siblings
up to but excluding</del> <ins class=
"diff-chg">outlinee</ins></var> <ins class="diff-chg">be</ins> the
<del class="diff-old">next</del> element <del class="diff-old">of
sectioning content , header element, or h1 - h6 of equal or higher
rank , whichever comes first, into</del> <ins class="diff-chg">that
is being entered.</ins></p>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">current section</ins></var> <ins class="diff-chg">be a
newly created section for</ins> the <var title=""><ins class=
"diff-new">current outlinee</ins></var> <ins class=
"diff-new">element.</ins></p>
<p><ins class="diff-new">Let there be a</ins> new <del class=
"diff-old">element of sectioning content , then insert</del>
<ins class="diff-chg">outline for</ins> the new <del class=
"diff-old">element of sectioning content where</del> <var title=
""><ins class="diff-chg">current outlinee</ins></var> ,<ins class=
"diff-chg">initialized with just</ins> the <ins class=
"diff-new">new</ins> <var title="">current <del class=
"diff-old">header was. The outline is then</del> <ins class=
"diff-chg">section</ins></var> <ins class="diff-chg">as</ins> the
<del class="diff-old">resulting hypothetical tree. The ranks
of</del> <ins class="diff-chg">only section in</ins> the
<del class="diff-old">headers become irrelevant at this point: each
element of</del> <ins class="diff-chg">outline.</ins></p>
</dd>
<dt><ins class="diff-chg">When exiting a</ins> <a href=
"#sectioning0">sectioning content</a> <del class=
"diff-old">in</del> <ins class="diff-chg">element, if</ins> the
<del class="diff-old">hypothetical tree contains either no or one
heading element child. If there</del> <ins class=
"diff-chg">stack</ins> is <del class="diff-old">one, then it gives
the section's heading, of there isn't, the section has no
heading.</del> <ins class="diff-chg">not empty</ins></dt>
<dd>
<p><del class="diff-old">Sections are nested as in</del>
<ins class="diff-chg">Pop</ins> the <del class=
"diff-old">hypothetical tree. If a sectioning</del> <ins class=
"diff-chg">top</ins> element <del class="diff-old">is a child of
another, that means it is a subsection of</del> <ins class=
"diff-chg">from the stack, and let the</ins> <var title=
""><ins class="diff-chg">current outlinee</ins></var> <ins class=
"diff-chg">be</ins> that <del class="diff-old">other section.</del>
<ins class="diff-chg">element.</ins></p>
<p><del class="diff-old">When creating an interactive table of
contents, entries should jump the user to</del> <ins class=
"diff-chg">Let</ins> <var title=""><ins class="diff-chg">current
section</ins></var> <ins class="diff-chg">be</ins> the <del class=
"diff-old">relevant</del> <ins class="diff-chg">last</ins> section
<del class="diff-old">element, if it was a real element</del> in
the <del class="diff-old">original document, or to the heading, if
the section element was one</del> <ins class=
"diff-chg">outline</ins> of <del class="diff-old">those created
during</del> the <del class="diff-old">above process.
Selecting</del> <var title=""><ins class="diff-chg">current
outlinee</ins></var> <ins class="diff-chg">element.</ins></p>
<p><ins class="diff-chg">Append</ins> the <del class=
"diff-old">first section</del> <ins class="diff-chg">outline</ins>
of the <del class="diff-old">document therefore always takes the
user</del> <a href="#sectioning0"><ins class="diff-chg">sectioning
content</ins></a> <ins class="diff-chg">element being exited</ins>
to the <del class="diff-old">top of the document, regardless of
where</del> <var title=""><ins class="diff-chg">current
section</ins></var> .<ins class="diff-chg">(This does not change
which section is</ins> the <del class="diff-old">first header</del>
<ins class="diff-chg">last section</ins> in the <del class=
"diff-old">body is to be found.</del> <ins class=
"diff-chg">outline.)</ins></p>
<del class="diff-old">The hypothetical tree (before mutations)
could be generated by creating</del></dd>
<dt><ins class="diff-chg">When exiting</ins> a <del class=
"diff-old">TreeWalker with the following NodeFilter (described here
as an anonymous ECMAScript function). [DOMTR] [ECMA262]</del>
<a href="#sectioning1"><ins class="diff-chg">sectioning
root</ins></a> <ins class="diff-chg">element, if the stack is not
empty</ins></dt>
<dd>
<p><ins class="diff-chg">Run these steps:</ins></p>
<del class="diff-old">function (n) { // This implementation only
knows about HTML elements. // An implementation that supports other
languages might be // different. // Reject anything that isn't an
element. if (n.nodeType != Node.ELEMENT_NODE) return
NodeFilter.FILTER_REJECT; // Skip any descendants of headings. if
((n.parentNode && n.parentNode.namespaceURI ==
'http://www.w3.org/1999/xhtml') && (n.parentNode.localName
== 'h1' || n.parentNode.localName == 'h2' || n.parentNode.localName
== 'h3' || n.parentNode.localName == 'h4' || n.parentNode.localName
== 'h5' || n.parentNode.localName == 'h6' || n.parentNode.localName
== 'header')) return NodeFilter.FILTER_REJECT; // Skip any
blockquotes. if ((n.namespaceURI == 'http://www.w3.org/1999/xhtml')
&& (n.localName == 'blockquote')) return
NodeFilter.FILTER_REJECT; // Accept HTML elements in the list given
in the prose above. if ((n.namespaceURI ==
'http://www.w3.org/1999/xhtml') && (n.localName == 'body'
|| /*n.localName == 'blockquote' ||*/ n.localName == 'section' ||
n.localName == 'nav' || n.localName == 'article' || n.localName ==
'aside' || n.localName == 'h1' || n.localName == 'h2' ||
n.localName == 'h3' || n.localName == 'h4' || n.localName == 'h5'
|| n.localName == 'h6' || n.localName == 'header')) return
NodeFilter.FILTER_ACCEPT; // Skip the rest. return
NodeFilter.FILTER_SKIP; } 3.8.11.2. Determining which heading and
section applies to a particular node This section will be rewritten
at some point. The algorithm likely won't change, but its
description will be dramatically simplified.</del>
<ol>
<li>
<p><del class="diff-old">Given a particular node, user agents must
use</del> <ins class="diff-chg">Pop</ins> the <del class=
"diff-old">following algorithm, in</del> <ins class="diff-chg">top
element from</ins> the <del class="diff-old">given order , to
determine which heading</del> <ins class="diff-chg">stack,</ins>
and <del class="diff-old">section the node is most closely
associated with. The processing of this algorithm must stop as soon
as</del> <ins class="diff-chg">let</ins> the <del class=
"diff-old">associated section and heading are established (even if
they are established to</del> <var title=""><ins class=
"diff-chg">current outlinee</ins></var> be <del class=
"diff-old">nothing).</del> <ins class="diff-chg">that
element.</ins></p>
</li>
<li><del class="diff-old">If</del>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">current section</ins></var> <ins class=
"diff-chg">be</ins> the <del class="diff-old">node has an ancestor
that is a header element, then</del> <ins class="diff-chg">last
section in</ins> the <del class="diff-old">associated heading
is</del> <ins class="diff-chg">outline of</ins> the <del class=
"diff-old">most distant such ancestor. The associated section is
that header 's associated section (i.e. repeat this algorithm for
that header ).</del> <var title=""><ins class="diff-chg">current
outlinee</ins></var> <ins class="diff-chg">element.</ins></p>
</li>
<li>
<p><i><ins class="diff-new">Loop:</ins></i> If <del class=
"diff-old">the node</del> <var title=""><ins class=
"diff-chg">current section</ins></var> has <del class="diff-old">an
ancestor that is an h1 - h6 element, then the associated heading
is</del> <ins class="diff-chg">no child sections, stop these
steps.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">current section</ins></var> <ins class=
"diff-chg">be</ins> the <del class="diff-old">most distant such
ancestor. The associated</del> <ins class="diff-chg">last
child</ins> section <del class="diff-old">is that heading's</del>
<ins class="diff-chg">of the current</ins> <var title=
""><ins class="diff-chg">current</ins> section <del class=
"diff-old">(i.e. repeat this algorithm for that heading
element).</del></var> .</p>
</li>
<li><del class="diff-old">If</del>
<p><ins class="diff-chg">Go back to</ins> the <del class=
"diff-old">node is an h1 - h6</del> <ins class="diff-chg">substep
labeled</ins> <i><ins class="diff-chg">Loop</ins></i> .</p>
</li>
</ol>
</dd>
<dt><ins class="diff-chg">When exiting a</ins> <a href=
"#sectioning0"><ins class="diff-chg">sectioning content</ins></a>
element or a <del class="diff-old">header</del> <a href=
"#sectioning1"><ins class="diff-chg">sectioning root</ins></a>
<del class="diff-old">element, then the associated heading is
the</del> element <del class="diff-old">itself.</del></dt>
<dd>
<p class="note">The <del class="diff-old">UA must then
generate</del> <var title=""><ins class="diff-chg">current
outlinee</ins></var> <ins class="diff-chg">is</ins> the <del class=
"diff-old">hypothetical</del> <ins class="diff-chg">element being
exited.</ins></p>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">current</ins> section <del class="diff-old">tree
described in the previous section, rooted at</del></var>
<ins class="diff-chg">be</ins> the <del class=
"diff-old">nearest</del> <ins class="diff-chg">first</ins> section
<del class="diff-old">ancestor (or the root element if there is no
such ancestor). If</del> <ins class="diff-chg">in</ins> the
<del class="diff-old">parent</del> <ins class=
"diff-chg">outline</ins> of the <del class="diff-old">heading in
that hypothetical tree is an element in</del> <var title=
""><ins class="diff-chg">current outlinee</ins></var> <ins class=
"diff-chg">element.</ins></p>
<p><ins class="diff-chg">Skip to</ins> the <del class=
"diff-old">real document tree, then that element is</del>
<ins class="diff-chg">next step in</ins> the <del class=
"diff-old">associated section. Otherwise, there</del> <ins class=
"diff-chg">overall set of steps. (The walk</ins> is <del class=
"diff-old">no associated section element.</del> <ins class=
"diff-chg">over.)</ins></p>
</dd>
<dt>If the <del class="diff-old">node</del> <var title=
""><ins class="diff-chg">current outlinee</ins></var> is
<del class="diff-old">an element of sectioning</del> <ins class=
"diff-chg">null.</ins></dt>
<dd>
<p><ins class="diff-chg">Do nothing.</ins></p>
</dd>
<dt><ins class="diff-chg">When entering a</ins> <a href=
"#heading0"><ins class="diff-chg">heading</ins> content <del class=
"diff-old">, then</del></a> <ins class=
"diff-chg">element</ins></dt>
<dd>
<p><ins class="diff-chg">If</ins> the <del class=
"diff-old">associated</del> <var title=""><ins class=
"diff-chg">current</ins> section <del class="diff-old">is itself.
The UA must then generate</del></var> <ins class="diff-chg">has no
heading, let</ins> the <del class="diff-old">hypothetical section
tree described in</del> <ins class="diff-chg">element being entered
be</ins> the <del class="diff-old">previous section, rooted
at</del> <ins class="diff-chg">heading for</ins> the <var title=
""><ins class="diff-new">current</ins> section <del class=
"diff-old">itself. If</del></var> .</p>
<p><ins class="diff-chg">Otherwise, if</ins> the <del class=
"diff-old">section element, in that hypothetical tree,</del>
<ins class="diff-chg">element being entered</ins> has a <del class=
"diff-old">child element that is an h1 - h6 element</del>
<ins class="diff-chg">rank equal to</ins> or <del class=
"diff-old">a header element, then that element is</del> <ins class=
"diff-chg">greater than</ins> the <del class="diff-old">associated
heading. Otherwise, there is no associated</del> heading
<del class="diff-old">element. If</del> <ins class=
"diff-chg">of</ins> the <del class="diff-old">node is a footer or
address element,</del> <var title=""><ins class="diff-chg">current
section</ins></var> , then <del class="diff-old">the
associated</del> <ins class="diff-chg">create a new</ins> section
<del class="diff-old">is</del> <ins class="diff-chg">and append it
to</ins> the <del class="diff-old">nearest ancestor element</del>
<ins class="diff-chg">outline</ins> of <del class=
"diff-old">sectioning content , if there is one. The node's
associated heading is</del> the <del class="diff-old">same as</del>
<var title=""><ins class="diff-chg">current outlinee</ins></var>
<ins class="diff-chg">element, so</ins> that <del class=
"diff-old">element of sectioning content 's associated heading
(i.e. repeat</del> this <del class="diff-old">algorithm for that
element of sectioning content ). If there</del> <ins class=
"diff-chg">new section</ins> is <del class="diff-old">no ancestor
element</del> <ins class="diff-chg">the new last section</ins> of
<del class="diff-old">sectioning content ,</del> <ins class=
"diff-chg">that outline. Let</ins> <var title=""><ins class=
"diff-chg">current section</ins></var> <ins class="diff-chg">be
that new section. Let</ins> the element <del class="diff-old">has
no associated section nor an associated heading. Otherwise,</del>
<ins class="diff-chg">being entered be</ins> the <del class=
"diff-old">node is just a normal node, and</del> <ins class=
"diff-chg">new heading for</ins> the <del class="diff-old">document
has to</del> <var title=""><ins class="diff-chg">current
section</ins></var> .</p>
<p><ins class="diff-chg">Otherwise, run these substeps:</ins></p>
<ol>
<li>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">candidate section</ins></var> be <del class=
"diff-old">examined more closely to determine its</del> <var title=
""><ins class="diff-chg">current</ins> section <del class=
"diff-old">and heading. Create a view rooted at the nearest
ancestor element of sectioning content (or</del></var> .</p>
</li>
<li>
<p><ins class="diff-chg">If</ins> the <del class=
"diff-old">root</del> element <del class="diff-old">if there is
none) that</del> <ins class="diff-chg">being entered</ins> has
<del class="diff-old">just h1 - h6 elements, header elements, the
node itself, and elements of sectioning content other</del>
<ins class="diff-chg">a rank lower</ins> than <del class=
"diff-old">blockquote elements. (Descendants of any</del>
<ins class="diff-chg">the rank</ins> of the <del class=
"diff-old">nodes in this view can be ignored, as can any node later
in</del> <ins class="diff-chg">heading of</ins> the <del class=
"diff-old">tree than</del> <var title=""><ins class=
"diff-chg">candidate section</ins></var> ,<ins class=
"diff-chg">then create a new section, and append it to</ins>
<var title=""><ins class="diff-chg">candidate section</ins></var>
.<ins class="diff-chg">(This does not change which section is</ins>
the <del class="diff-old">node</del> <ins class="diff-chg">last
section</ins> in <del class="diff-old">question, as</del> the
<del class="diff-old">algorithm below merely walks backwards up
this view.)</del> <ins class="diff-chg">outline.)</ins> Let
<var title=""><del class="diff-old">n</del> <ins class=
"diff-chg">current section</ins></var> be <del class="diff-old">an
iterator for</del> this <del class="diff-old">view, initialised at
the node in question.</del> <ins class="diff-chg">new
section.</ins> Let <del class="diff-old">c</del> <ins class=
"diff-chg">the element being entered</ins> be the <del class=
"diff-old">current best candidate heading, initially null, and
initially not used. It is used when top-level</del> <ins class=
"diff-chg">new</ins> heading <del class="diff-old">candidates are
to be searched</del> for <del class="diff-old">(see below). Repeat
these steps (which effectively goes backwards through</del> the
<del class="diff-old">node's previous siblings) until an answer is
found:</del> <var title=""><ins class="diff-chg">current
section</ins></var> .<ins class="diff-chg">Abort these
substeps.</ins></p>
</li>
<li><del class="diff-old">If</del>
<p><ins class="diff-chg">Let</ins> <var title=""><del class=
"diff-old">n</del> <ins class="diff-chg">candidate
section</ins></var> <del class="diff-old">points to a node with
no</del> <ins class="diff-chg">be the section that contains
the</ins> previous <del class="diff-old">sibling, and</del>
<var title=""><del class="diff-old">c</del> <ins class=
"diff-chg">candidate section</ins></var> <del class="diff-old">is
null, then return</del> <ins class="diff-chg">in</ins> the
<del class="diff-old">node's parent node as</del> <ins class=
"diff-chg">outline of</ins> <var title=""><ins class=
"diff-chg">current outlinee</ins></var> .</p>
</li>
<li>
<p><ins class="diff-chg">Return to step 2.</ins></p>
</li>
</ol>
<p><ins class="diff-chg">Push</ins> the <del class=
"diff-old">answer. If</del> <ins class="diff-chg">element being
entered onto</ins> the <del class="diff-old">node has no
parent</del> <ins class="diff-chg">stack. (This causes the
algorithm to skip any descendants of the element.)</ins></p>
</dd>
<dt><ins class="diff-chg">Otherwise</ins></dt>
<dd>
<p><ins class="diff-chg">Do nothing.</ins></p>
</dd>
</dl>
<p id="associatedSection"><ins class="diff-chg">In addition,
whenever you exit a</ins> node, <del class="diff-old">return null
as</del> <ins class="diff-chg">after doing</ins> the <del class=
"diff-old">answer. Otherwise,</del> <ins class="diff-chg">steps
above,</ins> if <var title=""><del class="diff-old">n</del>
<ins class="diff-chg">current section</ins></var> <del class=
"diff-old">points to a</del> <ins class="diff-chg">is not null,
associate the</ins> node with <del class="diff-old">no previous
sibling, return c as</del> the <del class="diff-old">answer.
Adjust</del> <ins class="diff-chg">section</ins> <var title=
""><del class="diff-old">n so that it points to the previous
sibling of the</del> current <del class="diff-old">position.</del>
<ins class="diff-chg">section</ins></var> .</p>
</li>
<li>
<p>If <ins class="diff-new">the</ins> <var title=""><del class=
"diff-old">n</del> <ins class="diff-chg">current
outlinee</ins></var> is <del class="diff-old">pointing at an
h1</del> <ins class="diff-chg">null, then there was no</ins>
<a href="#sectioning0"><ins class="diff-chg">sectioning
content</ins></a> <ins class="diff-chg">element</ins> or
<del class="diff-old">header</del> <a href=
"#sectioning1"><ins class="diff-chg">sectioning root</ins></a>
<del class="diff-old">element, then return that</del> element
<del class="diff-old">as</del> <ins class="diff-chg">in</ins> the
<del class="diff-old">answer. If n</del> <ins class="diff-chg">DOM.
There</ins> is <del class="diff-old">pointing at an h2 - h6
element, and heading candidates are not being searched for, then
return</del> <ins class="diff-chg">no outline. Abort these
steps.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Associate any nodes</ins> that <del class=
"diff-old">element as</del> <ins class="diff-chg">were not
associated a section in</ins> the <del class="diff-old">answer.
Otherwise, if n is pointing at an h2 - h6 element, and either c is
still null, or</del> <ins class="diff-chg">steps above with</ins>
<var title=""><del class="diff-old">c</del> <ins class=
"diff-chg">current outlinee</ins></var> <del class="diff-old">is
a</del> <ins class="diff-chg">as their section.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Associate all nodes with the</ins> heading
of <del class="diff-old">lower rank than this one, then set c to be
this element, and continue going backwards through</del> the
<del class="diff-old">previous siblings.</del> <ins class=
"diff-chg">section which which they are associated, if
any.</ins></p>
</li>
<li>
<p>If <var title=""><del class="diff-old">n</del> <ins class=
"diff-chg">current outlinee</ins></var> is <del class=
"diff-old">pointing at an</del> <a href="#the-body1"><ins class=
"diff-chg">the</ins> <code><ins class="diff-chg">body</ins></code>
element <del class="diff-old">of sectioning content</del></a> ,
then <del class="diff-old">from this point on top-level heading
candidates are being searched for. (Specifically, we are looking
for</del> the <del class="diff-old">nearest top-level header</del>
<ins class="diff-chg">outline created</ins> for <ins class=
"diff-new">that element is</ins> the <del class="diff-old">current
section.) Continue going backwards through</del> <ins class=
"diff-chg">outline of</ins> the <del class="diff-old">previous
siblings.</del> <ins class="diff-chg">entire document.</ins></p>
</li>
</ol>
<del class="diff-old">If the answer from the previous step (the
loop) is null, which can only happen if</del>
<p><ins class="diff-chg">The tree of sections created by</ins> the
<del class="diff-old">node has no preceeding headings and is not
contained in</del> <ins class="diff-chg">algorithm above, or a
proper subset thereof, must be used when generating document
outlines, for example when generating tables of contents.</ins></p>
<p><ins class="diff-chg">When creating</ins> an <del class=
"diff-old">element</del> <ins class="diff-chg">interactive
table</ins> of <del class="diff-old">sectioning content , then
there is no associated heading and no associated section.
Otherwise, if</del> <ins class="diff-chg">contents, entries should
jump</ins> the <del class="diff-old">answer from</del> <ins class=
"diff-chg">user to</ins> the <del class="diff-old">earlier loop
step is an element of</del> <ins class="diff-chg">relevant</ins>
<a href="#sectioning0">sectioning content <del class="diff-old">,
then</del></a> <ins class="diff-chg">element, if</ins> the
<del class="diff-old">associated</del> section <del class=
"diff-old">is that</del> <ins class="diff-chg">was created for a
real</ins> element <del class="diff-old">and</del> <ins class=
"diff-chg">in</ins> the <del class="diff-old">associated</del>
<ins class="diff-chg">original document, or to the relevant</ins>
<a href="#heading0">heading <del class="diff-old">is that element
of sectioning</del> content</a> <del class="diff-old">'s associated
heading (i.e. repeat this algorithm for that section).
Otherwise,</del> <ins class="diff-chg">element,</ins> if the
<del class="diff-old">answer from that same earlier step is an h1 -
h6 element or</del> <ins class="diff-chg">section in the tree was
generated for</ins> a <ins class="diff-new">heading in the above
process.</ins></p>
<p class="note"><ins class="diff-new">Selecting the first section
of the document therefore always takes the user to the top of the
document, regardless of where the first header in the</ins>
<code><del class="diff-old">header</del> <a href=
"#body0"><ins class="diff-chg">body</ins></a></code> <del class=
"diff-old">element, then the associated heading</del> is
<del class="diff-old">that element and</del> <ins class=
"diff-chg">to be found.</ins></p>
<div class="note">
<p><ins class="diff-chg">The following JavaScript function shows
how</ins> the <del class="diff-old">associated section is that
heading element's associated section (i.e. repeat this algorithm
for that heading). Not all nodes have an associated header or
section. For example, if a section</del> <ins class="diff-chg">tree
walk could be implemented. The</ins> <var title=""><ins class=
"diff-chg">root</ins></var> <ins class="diff-chg">argument</ins> is
<del class="diff-old">implied, as when multiple headers are found
in one element</del> <ins class="diff-chg">the root</ins> of
<del class="diff-old">sectioning content , then a node in that
section has an anonymous associated section (its section is not
represented by a real element),</del> <ins class="diff-chg">the
tree to walk,</ins> and the <del class="diff-old">algorithm above
does not associate</del> <var title=""><ins class=
"diff-chg">enter</ins></var> <ins class="diff-chg">and</ins>
<var title=""><ins class="diff-chg">exit</ins></var> <ins class=
"diff-chg">arguments are callbacks</ins> that <del class=
"diff-old">node</del> <ins class="diff-chg">are called</ins> with
<del class="diff-old">any particular element of sectioning content
. For</del> the <del class="diff-old">following fragment:
<body> <h1>X</h1> <h2>X</h2>
<blockquote> <h3>X</h3> </blockquote> <p
id="a">X</p> <h4>Text Node A</h4>
<section> <h5>X</h5> </section>
<p>Text Node B</p> </body> The associations
are</del> <ins class="diff-chg">nodes</ins> as <del class=
"diff-old">follows (not all associations</del> <ins class=
"diff-chg">they</ins> are <del class="diff-old">shown): Node
Associated heading Associated section <body> <h1>
<body> <h1> <h1> <body> <h2>
<h2> None. <blockquote> <h2> None. <h3>
<h3> <blockquote> <p id="a"> <h2> None.
Text Node A <h4> None. Text Node B <h1></del>
<ins class="diff-chg">entered and exited.</ins> <a href=
"#references"><ins class="diff-chg">[ECMA262]</ins></a> <del class=
"diff-old"><body></del></p>
<pre>
function (root, enter, exit) {
<ins class="diff-chg"> var node = root;
start: do while (node) {
enter(node);
if (node.firstChild) {
node = node.firstChild;
continue start;
}
while (node) {
exit(node);
if (node.nextSibling) {
node = node.nextSibling;
continue start;
}
if (node == root)
node = null;
else
node = node.parentNode;
}
}
}
</ins>
</pre></div>
<h5 id="distinguishing"><span class="secno"><del class=
"diff-old">3.8.11.3.</del> <ins class=
"diff-chg">3.8.10.2.</ins></span> Distinguishing site-wide
<del class="diff-old">headers</del> <ins class=
"diff-chg">headings</ins> from page <del class=
"diff-old">headers</del> <ins class="diff-chg">headings</ins></h5>
<p>Given the <del class="diff-old">hypothetical section tree
,</del> <a href="#outline"><ins class="diff-chg">outline</ins></a>
<ins class="diff-chg">of a document,</ins> but ignoring any
sections created for <code><a href="#nav">nav</a></code> and
<code><a href="#aside">aside</a></code> elements, and any of their
descendants, if the <ins class="diff-new">only</ins> root of the
tree is <a href="#the-body1">the <code>body</code> element</a> 's
section, and it has only a single subsection which is created by an
<code><a href="#article">article</a></code> element, then the
<del class="diff-old">header</del> <ins class=
"diff-chg">heading</ins> of <a href="#the-body1">the
<code>body</code> element</a> should be assumed to be a site-wide
<del class="diff-old">header,</del> <ins class=
"diff-chg">heading,</ins> and the <del class=
"diff-old">header</del> <ins class="diff-chg">heading</ins> of the
<code><a href="#article">article</a></code> element should be
assumed to be the page's <del class="diff-old">header.</del>
<ins class="diff-chg">heading.</ins></p>
<p>If a page starts with a heading that is common to the whole
site, the document must be authored such that, in the document's
<del class="diff-old">hypothetical section tree</del> <a href=
"#outline"><ins class="diff-chg">outline</ins></a> , ignoring any
sections created for <code><a href="#nav">nav</a></code> and
<code><a href="#aside">aside</a></code> elements and any of their
descendants, the <del class="diff-old">root of the</del> tree
<del class="diff-old">is</del> <ins class="diff-chg">has only one
root section,</ins> <a href="#the-body1">the <code>body</code>
element</a> 's section, its heading is the site-wide heading,
<a href="#the-body1">the <code>body</code> element</a> has just one
subsection, that subsection is created by an <code><a href=
"#article">article</a></code> element, and that <code><a href=
"#article">article</a></code> 's <del class="diff-old">header</del>
<ins class="diff-chg">heading</ins> is the page heading.</p>
<p>If a page does not contain a site-wide heading, then the page
must be authored such that, in the document's <del class=
"diff-old">hypothetical section tree</del> <a href=
"#outline"><ins class="diff-chg">outline</ins></a> , ignoring any
sections created for <code><a href="#nav">nav</a></code> and
<code><a href="#aside">aside</a></code> elements and any of their
descendants, either <a href="#the-body1">the <code>body</code>
element</a> has no subsections, or it has more than one subsection,
or it has a single subsection but that subsection is not created by
an <code><a href="#article">article</a></code> <del class=
"diff-old">element.</del> <ins class="diff-chg">element, or there
is more than one section at the root of the outline.</ins></p>
<p class="note">Conceptually, a site is thus a document with many
articles — when those articles are split into many pages, the
heading of the original single page becomes the heading of the
site, repeated on every page.</p>
<h3 id="grouping"><span class="secno"><del class=
"diff-old">3.9.</del> <ins class="diff-chg">3.9</ins></span>
<del class="diff-old">Prose</del> <ins class="diff-chg">Grouping
content</ins></h3>
<h4 id="the-p"><span class="secno"><del class=
"diff-old">3.9.1.</del> <ins class="diff-chg">3.9.1</ins></span>
The <dfn id="p"><code>p</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#p">p</a></code> element represents a
<a href="#paragraph">paragraph</a> .</p>
<div class="example">
<p>The following examples are conforming HTML fragments:</p>
<pre>
<p>The little kitten gently seated himself on a piece of
carpet. Later in his life, this would be referred to as the time the
cat
sat
on
the
mat.</p>
</pre>
<pre>
<fieldset>
<legend>Personal information</legend>
<p>
<label>Name: <input name="n"></label>
<label><input name="anon" type="checkbox"> Hide from other users</label>
</p>
<p><label>Address: <textarea name="a"></textarea></label></p>
</fieldset>
</pre>
<pre>
<p>There was once an example from Femley,<br>
Whose markup was of dubious quality.<br>
The validator complained,<br>
So the author was pained,<br>
To
move
the
error
from
the
markup
to
the
rhyming.</p>
</pre></div>
<p>The <code><a href="#p">p</a></code> element should not be used
when a more specific element is more appropriate.</p>
<div class="example">
<p>The following example is technically correct:</p>
<pre>
<section>
<!-- ... -->
<p>Last modified: 2001-04-23</p>
<p>Author: fred@example.com</p>
</section>
</pre>
<p>However, it would be better marked-up as:</p>
<pre>
<section>
<!-- ... -->
<footer>Last modified: 2001-04-23</footer>
<address>Author: fred@example.com</address>
</section>
</pre>
<p>Or:</p>
<pre>
<section>
<!-- ... -->
<footer>
<p>Last modified: 2001-04-23</p>
<address>Author: fred@example.com</address>
</footer>
</section>
</pre></div>
<h4 id="the-hr"><span class="secno"><del class=
"diff-old">3.9.2.</del> <ins class="diff-chg">3.9.2</ins></span>
The <dfn id="hr"><code>hr</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>Empty.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#hr">hr</a></code> element represents a
<a href="#paragraph">paragraph</a> -level thematic break, e.g. a
scene change in a story, or a transition to another topic within a
section of a reference book.</p>
<h4 id="the-br"><span class="secno"><del class=
"diff-old">3.9.3.</del> <ins class="diff-chg">3.9.3</ins></span>
The <dfn id="br"><code>br</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>Empty.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#br">br</a></code> element represents a line
break.</p>
<p><code><a href="#br">br</a></code> elements must be empty. Any
content inside <code><a href="#br">br</a></code> elements must not
be considered part of the surrounding text.</p>
<p><code><a href="#br">br</a></code> elements must <del class=
"diff-old">only</del> be used <ins class="diff-new">only</ins> for
line breaks that are actually part of the content, as in poems or
addresses.</p>
<div class="example">
<p>The following example is correct usage of the <code><a href=
"#br">br</a></code> element:</p>
<pre>
<p>P. Sherman<br>
42 Wallaby Way<br>
Sydney</p>
</pre></div>
<p><code><a href="#br">br</a></code> elements must not be used for
separating thematic groups in a paragraph.</p>
<div class="example">
<p>The following examples are non-conforming, as they abuse the
<code><a href="#br">br</a></code> element:</p>
<pre>
<p><a ...>34 comments.</a><br>
<a
...>Add
a
comment.<a></p>
</pre>
<pre>
<p>Name: <input name="name"><br>
Address:
<input
name="address"></p>
</pre>
<p>Here are alternatives to the above, which are correct:</p>
<pre>
<p><a ...>34 comments.</a></p>
<p><a
...>Add
a
comment.<a></p>
</pre>
<pre>
<p>Name: <input name="name"></p>
<p>Address:
<input
name="address"></p>
</pre></div>
<p>If a <a href="#paragraph">paragraph</a> consists of nothing but
a single <code><a href="#br">br</a></code> element, it represents a
placeholder blank line (e.g. as in a template). Such blank lines
must not be used for presentation purposes.</p>
<h4 id="the-pre"><span class="secno"><ins class=
"diff-new">3.9.4</ins></span> <ins class="diff-new">The</ins>
<dfn id="pre"><code><ins class="diff-new">pre</ins></code></dfn>
<ins class="diff-new">element</ins></h4>
<dl class="element">
<dt><ins class="diff-new">Categories</ins></dt>
<dd><a href="#flow-content0"><ins class="diff-new">Flow
content</ins></a> .</dd>
<dt><ins class="diff-new">Contexts in which this element may be
used:</ins></dt>
<dd><ins class="diff-new">Where</ins> <a href=
"#flow-content0"><ins class="diff-new">flow content</ins></a>
<ins class="diff-new">is expected.</ins></dd>
<dt><ins class="diff-new">Content model:</ins></dt>
<dd><a href="#phrasing0"><ins class="diff-new">Phrasing
content</ins></a> .</dd>
<dt><ins class="diff-new">Element-specific attributes:</ins></dt>
<dd><ins class="diff-new">None.</ins></dd>
<dt><ins class="diff-new">DOM interface:</ins></dt>
<dd><ins class="diff-new">Uses</ins> <code><a href=
"#htmlelement"><ins class="diff-new">HTMLElement</ins></a></code>
.</dd>
</dl>
<p><ins class="diff-new">The</ins> <code><a href="#pre"><ins class=
"diff-new">pre</ins></a></code> <ins class="diff-new">element
represents a block of preformatted text, in which structure is
represented by typographic conventions rather than by
elements.</ins></p>
<p class="note"><strong><ins class="diff-new">In the</ins>
<span title=""><ins class="diff-new">HTML
serialization</ins></span> ,<ins class="diff-new">a leading newline
character immediately following the</ins> <code><a href=
"#pre"><ins class="diff-new">pre</ins></a></code> <ins class=
"diff-new">element start tag is stripped.</ins></strong></p>
<p><ins class="diff-new">Some examples of cases where the</ins>
<code><a href="#pre"><ins class="diff-new">pre</ins></a></code>
<ins class="diff-new">element could be used:</ins></p>
<ul>
<li><ins class="diff-new">Including an e-mail, with paragraphs
indicated by blank lines, lists indicated by lines prefixed with a
bullet, and so on.</ins></li>
<li><ins class="diff-new">Including fragments of computer code,
with structure indicated according to the conventions of that
language.</ins></li>
<li><ins class="diff-new">Displaying ASCII art.</ins></li>
</ul>
<p><ins class="diff-new">To represent a block of computer code,
the</ins> <code><a href="#pre"><ins class=
"diff-new">pre</ins></a></code> <ins class="diff-new">element can
be used with a</ins> <code><a href="#code"><ins class=
"diff-new">code</ins></a></code> <ins class="diff-new">element; to
represent a block of computer output the</ins> <code><a href=
"#pre"><ins class="diff-new">pre</ins></a></code> <ins class=
"diff-new">element can be used with a</ins> <code><a href=
"#samp"><ins class="diff-new">samp</ins></a></code> <ins class=
"diff-new">element. Similarly, the</ins> <code><a href=
"#kbd"><ins class="diff-new">kbd</ins></a></code> <ins class=
"diff-new">element can be used within a</ins> <code><a href=
"#pre"><ins class="diff-new">pre</ins></a></code> <ins class=
"diff-new">element to indicate text that the user is to
enter.</ins></p>
<div class="example">
<p><ins class="diff-new">In the following snippet, a sample of
computer code is presented.</ins></p>
<pre>
<p>This is the <code>Panel</code> constructor:</p><ins class="diff-new">
<pre><code>function Panel(element, canClose, closeHandler) {
this.element = element;
this.canClose = canClose;
this.closeHandler = function () { if (closeHandler) closeHandler() };
}</code>
</pre>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-new">In the following snippet,</ins>
<code><a href="#samp"><ins class="diff-new">samp</ins></a></code>
<ins class="diff-new">and</ins> <code><a href="#kbd"><ins class=
"diff-new">kbd</ins></a></code> <ins class="diff-new">elements are
mixed in the contents of a</ins> <code><a href="#pre"><ins class=
"diff-new">pre</ins></a></code> <ins class="diff-new">element to
show a session of Zork I.</ins></p>
<pre>
<pre><samp>You are in an open field west of a big white house with a boarded<ins class="diff-new">
front door.
There is a small mailbox here.
></samp> <kbd>open mailbox</kbd>
<samp>Opening the mailbox reveals:
A leaflet.
>
</samp>
</pre>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-new">The following shows a contemporary poem
that uses the</ins> <code><a href="#pre"><ins class=
"diff-new">pre</ins></a></code> <ins class="diff-new">element to
preserve its unusual formatting, which forms an intrinsic part of
the poem itself.</ins></p>
<pre>
<pre> maxling<ins class="diff-new">
it is with a heart
heavy
that i admit loss of a feline
so loved
a friend lost to the
unknown
(night)
~cdr
11dec07</pre>
</ins>
</pre></div>
<h4 id="the-dialog"><span class="secno"><del class=
"diff-old">3.9.4.</del> <ins class="diff-chg">3.9.5</ins></span>
The <dfn id="dialog"><code>dialog</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>Zero or more pairs of <ins class="diff-new">one</ins>
<code><a href="#dt">dt</a></code> <del class="diff-old">and</del>
<ins class="diff-chg">element followed by one</ins> <code><a href=
"#dd">dd</a></code> <del class="diff-old">elements.</del>
<ins class="diff-chg">element.</ins></dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#dialog">dialog</a></code> element represents
a conversation.</p>
<p>Each part of the conversation must have an explicit talker (or
speaker) given by a <code><a href="#dt">dt</a></code> element, and
a discourse (or quote) given by a <code><a href="#dd">dd</a></code>
element.</p>
<div class="example">
<p>This example demonstrates this using an extract from Abbot and
Costello's famous sketch, <cite>Who's on first</cite> :</p>
<pre>
<dialog>
<dt> Costello
<dd> Look, you gotta first baseman?
<dt> Abbott
<dd> Certainly.
<dt> Costello
<dd> Who's playing first?
<dt> Abbott
<dd> That's right.
<dt> Costello
<dd> When you pay off the first baseman every month, who gets the money?
<dt> Abbott
<dd> Every dollar of it.
</dialog>
</pre></div>
<p class="note">Text in a <code><a href="#dt">dt</a></code> element
in a <code><a href="#dialog">dialog</a></code> element is
implicitly the source of the text given in the following
<code><a href="#dd">dd</a></code> element, and the contents of the
<code><a href="#dd">dd</a></code> element are implicitly a quote
from that speaker. There is thus no need to include <code><a href=
"#cite2">cite</a></code> , <code><a href="#q">q</a></code> , or
<code><a href="#blockquote">blockquote</a></code> elements in this
markup. Indeed, a <code><a href="#q">q</a></code> element inside a
<code><a href="#dd">dd</a></code> element in a conversation would
actually imply the people talking were themselves quoting
<del class="diff-old">someone else.</del> <ins class=
"diff-chg">another work.</ins> See the <code><a href=
"#cite2">cite</a></code> , <code><a href="#q">q</a></code> , and
<code><a href="#blockquote">blockquote</a></code> elements for
other ways to cite or quote. <del class="diff-old">3.10.
Preformatted text</del></p>
<h4 id="the-blockquote"><span class="secno"><del class=
"diff-old">3.10.1.</del> <ins class="diff-chg">3.9.6</ins></span>
The <dfn id="blockquote"><code><del class="diff-old">pre</del>
<ins class="diff-chg">blockquote</ins></code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dd><a href="#sectioning1"><ins class="diff-new">Sectioning
root</ins></a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">Phrasing</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Element-specific attributes:</dt>
<dd><del class="diff-old">None.</del> <code title=
"attr-blockquote-cite"><a href="#cite"><ins class=
"diff-chg">cite</ins></a></code></dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del>
<pre>
<ins class="diff-chg"> class=idl>interface <dfn id=
"htmlquoteelement">HTMLQuoteElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#cite0" title=
"dom-quote-cite">cite</a>;
};
</ins>
</pre>
<p class="note"><ins class="diff-chg">The</ins> <code><del class=
"diff-old">HTMLElement</del> <a href=
"#htmlquoteelement"><ins class="diff-chg">HTMLQuoteElement</ins></a>
<del class="diff-old">.</del></code> <ins class=
"diff-chg">interface is also used by the</ins> <code><a href=
"#q"><ins class="diff-chg">q</ins></a></code> <ins class=
"diff-chg">element.</ins></p>
</dd>
</dl>
<p>The <code><del class="diff-old">pre</del> <a href=
"#blockquote"><ins class="diff-chg">blockquote</ins></a></code>
element represents a <del class="diff-old">block of preformatted
text, in which structure</del> <ins class="diff-chg">section
that</ins> is <del class="diff-old">represented by typographic
conventions rather than by elements.</del> <ins class=
"diff-chg">quoted from another source.</ins></p>
<p><del class="diff-old">Some examples of cases where the</del>
<ins class="diff-chg">Content inside a</ins> <code><del class=
"diff-old">pre</del> <a href="#blockquote"><ins class=
"diff-chg">blockquote</ins></a></code> <del class=
"diff-old">element could</del> <ins class="diff-chg">must</ins> be
<del class="diff-old">used: Including an e-mail, with paragraphs
indicated by blank lines, lists indicated by lines prefixed with a
bullet, and so on. Including fragments of computer code, with
structure indicated according to</del> <ins class="diff-chg">quoted
from another source, whose URI, if it has one, should be cited
in</ins> the <del class="diff-old">conventions of that language.
Displaying ASCII art.</del> <dfn id="cite" title=
"attr-blockquote-cite"><code><ins class=
"diff-chg">cite</ins></code></dfn> <ins class=
"diff-chg">attribute.</ins></p>
<p><del class="diff-old">To represent a block of computer
code,</del> <ins class="diff-chg">If</ins> the <code title=
"attr-blockquote-cite"><del class="diff-old">pre</del> <a href=
"#cite"><ins class="diff-chg">cite</ins></a></code> <del class=
"diff-old">element can</del> <ins class="diff-chg">attribute is
present, it must</ins> be <del class="diff-old">used with</del> a
<del class="diff-old">code element;</del> <ins class="diff-chg">URI
(or IRI). User agents should allow users</ins> to <del class=
"diff-old">represent</del> <ins class="diff-chg">follow such
citation links.</ins></p>
<p><ins class="diff-chg">If</ins> a <del class="diff-old">block of
computer output the</del> <code><del class="diff-old">pre</del>
<a href="#blockquote"><ins class=
"diff-chg">blockquote</ins></a></code> element <del class=
"diff-old">can be used with</del> <ins class="diff-chg">is</ins>
<a href="#preceded"><ins class="diff-chg">preceded or
followed</ins></a> <ins class="diff-chg">by a single</ins> <a href=
"#paragraph"><ins class="diff-chg">paragraph</ins></a> <ins class=
"diff-chg">that contains</ins> a <ins class="diff-new">single</ins>
<code><del class="diff-old">samp</del> <a href="#cite2"><ins class=
"diff-chg">cite</ins></a></code> <del class="diff-old">element.
Similarly, the</del> <ins class="diff-chg">element and that is
itself not</ins> <a href="#preceded"><ins class="diff-chg">preceded
or followed</ins></a> <ins class="diff-chg">by another</ins>
<code><del class="diff-old">kbd</del> <a href=
"#blockquote"><ins class="diff-chg">blockquote</ins></a></code>
element <del class="diff-old">can be used within</del> <ins class=
"diff-chg">and does not itself have</ins> a <code><del class=
"diff-old">pre</del> <a href="#q"><ins class=
"diff-chg">q</ins></a></code> element <del class="diff-old">to
indicate text that the user is to enter. In</del> <ins class=
"diff-chg">descendant, then,</ins> the <del class=
"diff-old">following snippet, a sample</del> <ins class=
"diff-chg">title</ins> of <del class="diff-old">computer code is
presented. <pre><code>function Panel(element, canClose,
closeHandler) { this.element = element; this.canClose = canClose;
this.closeHandler = function () { if (closeHandler) closeHandler()
}; }</code> </pre> In</del> the <del class=
"diff-old">following snippet, samp and</del> <ins class=
"diff-chg">work given by that</ins> <code><del class=
"diff-old">kbd</del> <a href="#cite2"><ins class=
"diff-chg">cite</ins></a></code> <del class="diff-old">elements are
mixed in</del> <ins class="diff-chg">element gives</ins> the
<del class="diff-old">contents</del> <ins class=
"diff-chg">source</ins> of <del class="diff-old">a</del>
<ins class="diff-chg">the quotation contained in the</ins>
<code><del class="diff-old">pre</del> <a href=
"#blockquote"><ins class="diff-chg">blockquote</ins></a></code>
<del class="diff-old">element to show a session of Zork I. You are
in an open field west of a big white house with a boarded front
door. There is a small mailbox here. ></samp>
<kbd>open mailbox</kbd> <samp>Opening the mailbox
reveals: A leaflet. > </samp> </pre></del>
<ins class="diff-chg">element.</ins></p>
<p>The <del class="diff-old">following shows a contemporary poem
that uses the</del> <dfn id="cite0" title=
"dom-quote-cite"><code><ins class="diff-new">cite</ins></code>
<del class="diff-old">pre</del></dfn> <ins class="diff-chg">DOM
attribute must</ins> <a href="#reflect"><ins class=
"diff-chg">reflect</ins></a> <ins class="diff-chg">the
element's</ins> <code title=""><ins class=
"diff-chg">cite</ins></code> <del class="diff-old">element</del>
<ins class="diff-chg">content attribute.</ins></p>
<p class="note"><ins class="diff-chg">The best way</ins> to
<del class="diff-old">preserve its unusual formatting, which forms
an intrinsic part of</del> <ins class="diff-chg">represent a
conversation is not with</ins> the <del class="diff-old">poem
itself. maxling</del> <code><del class="diff-old">it is with a
heart heavy</del> <a href="#cite2"><ins class=
"diff-chg">cite</ins></a> <del class="diff-old">that i admit loss
of a feline so loved</del></code> <ins class="diff-chg">and</ins>
<code><del class="diff-old">a friend lost to the unknown
(night)</del> <a href="#blockquote"><ins class=
"diff-chg">blockquote</ins></a> <del class="diff-old">~cdr
11dec07</pre></del></code> <ins class="diff-chg">elements,
but with the</ins> <code><a href="#dialog"><ins class=
"diff-chg">dialog</ins></a> <del class="diff-old">3.11.
Lists</del></code> <ins class="diff-chg">element.</ins></p>
<h4 id="the-ol"><span class="secno"><del class=
"diff-old">3.11.1.</del> <ins class="diff-chg">3.9.7</ins></span>
The <dfn id="ol"><code>ol</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>Zero or more <code><a href="#li">li</a></code> elements.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-ol-reversed"><a href="#reversed"><ins class=
"diff-new">reversed</ins></a></code></dd>
<dd><code title="attr-ol-start"><a href=
"#start0">start</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlolistelement">HTMLOListElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
<ins class="diff-new"> attribute boolean <a href=
"#reversed0" title="dom-ol-reversed">reversed</a>;
</ins>
attribute long <a href="#start1" title=
"dom-ol-start">start</a>;
};
</pre></dd>
</dl>
<p>The <code><a href="#ol">ol</a></code> element represents
<del class="diff-old">an ordered</del> <ins class=
"diff-chg">a</ins> list of <ins class="diff-new">items, where
the</ins> items <del class="diff-old">(which</del> <ins class=
"diff-chg">have been intentionally ordered, such that changing the
order would change the meaning of the document.</ins></p>
<p><ins class="diff-chg">The items of the list</ins> are
<del class="diff-old">represented by</del> <ins class=
"diff-chg">the</ins> <code><a href="#li">li</a></code> <del class=
"diff-old">elements).</del> <ins class="diff-chg">element child
nodes of the</ins> <code><a href="#ol"><ins class=
"diff-chg">ol</ins></a></code> <ins class="diff-chg">element,
in</ins> <a href="#tree-order"><ins class="diff-chg">tree
order</ins></a> .</p>
<p><ins class="diff-chg">The</ins> <dfn id="reversed" title=
"attr-ol-reversed"><code><ins class=
"diff-chg">reversed</ins></code></dfn> <ins class=
"diff-chg">attribute is a</ins> <a href="#boolean0"><ins class=
"diff-chg">boolean attribute</ins></a> .<ins class="diff-chg">If
present, it indicates that the list is a descending list (..., 3,
2, 1). If the attribute is omitted, the list is an ascending list
(1, 2, 3, ...).</ins></p>
<p>The <dfn id="start0" title=
"attr-ol-start"><code>start</code></dfn> attribute, if present,
must be a <a href="#valid0">valid integer</a> giving the ordinal
value of the first list item.</p>
<p>If the <code title="attr-ol-start"><a href=
"#start0">start</a></code> attribute is present, user agents must
<a href="#rules0" title="rules for parsing integers">parse it as an
integer</a> , in order to determine the attribute's value. The
default value, used if the attribute is missing or if the value
cannot be converted to a number according to the referenced
algorithm, is <del class="diff-old">1. The items of the list
are</del> <ins class="diff-chg">1 if</ins> the <ins class=
"diff-chg">element has no</ins> <code title=
"attr-ol-reversed"><del class="diff-old">li</del> <a href=
"#reversed"><ins class="diff-chg">reversed</ins></a></code>
<del class="diff-old">element child nodes of</del> <ins class=
"diff-chg">attribute, and is</ins> the <ins class="diff-new">number
of child</ins> <code><del class="diff-old">ol</del> <a href=
"#li"><ins class="diff-chg">li</ins></a></code> <del class=
"diff-old">element, in tree order .</del> <ins class=
"diff-chg">elements otherwise.</ins></p>
<p>The first item in the list has the ordinal value given by the
<code><a href="#ol">ol</a></code> element's <code title=
"attr-ol-start"><a href="#start0">start</a></code> attribute,
unless that <code><a href="#li">li</a></code> element has a
<code title="attr-li-value"><a href="#value">value</a></code>
attribute with a value that can be successfully parsed, in which
case it has the ordinal value given by that <code title=
"attr-li-value"><a href="#value">value</a></code> attribute.</p>
<p>Each subsequent item in the list has the ordinal value given by
its <code title="attr-li-value"><a href="#value">value</a></code>
attribute, if it has one, or, if it doesn't, the ordinal value of
the previous item, plus <del class="diff-old">one.</del>
<ins class="diff-chg">one if the</ins> <code title=
"attr-ol-reversed"><a href="#reversed"><ins class=
"diff-chg">reversed</ins></a></code> <ins class="diff-chg">is
absent, or minus one if it is present.</ins></p>
<p><ins class="diff-chg">The</ins> <dfn id="reversed0" title=
"dom-ol-reversed"><code><ins class=
"diff-chg">reversed</ins></code></dfn> <ins class="diff-chg">DOM
attribute must</ins> <a href="#reflect"><ins class=
"diff-chg">reflect</ins></a> <ins class="diff-chg">the value of
the</ins> <code title="attr-ol-reversed"><a href=
"#reversed"><ins class="diff-chg">reversed</ins></a></code>
<ins class="diff-chg">content attribute.</ins></p>
<p>The <dfn id="start1" title=
"dom-ol-start"><code>start</code></dfn> DOM attribute must <a href=
"#reflect">reflect</a> the value of the <code title=
"attr-ol-start"><a href="#start0">start</a></code> content
attribute.</p>
<div class="example">
<p><ins class="diff-new">The following markup shows a list where
the order matters, and where the</ins> <code><a href=
"#ol"><ins class="diff-new">ol</ins></a></code> <ins class=
"diff-new">element is therefore appropriate. Compare this list to
the equivalent list in the</ins> <code><a href="#ul"><ins class=
"diff-new">ul</ins></a></code> <ins class="diff-new">section to see
an example of the same items using the</ins> <code><a href=
"#ul"><ins class="diff-new">ul</ins></a></code> <ins class=
"diff-new">element.</ins></p>
<pre>
<p>I have lived in the following countries (given in the order of when<ins class="diff-new">
I first lived there):</p>
<ol>
<li>Switzerland
<li>United Kingdom
<li>United States
<li>Norway
</ol>
</ins>
</pre>
<p><ins class="diff-new">Note how changing the order of the list
changes the meaning of the document. In the following example,
changing the relative order of the first two items has changed the
birthplace of the author:</ins></p>
<pre>
<p>I have lived in the following countries (given in the order of when<ins class="diff-new">
I first lived there):</p>
<ol>
<li>United Kingdom
<li>Switzerland
<li>United States
<li>Norway
</ol>
</ins>
</pre></div>
<h4 id="the-ul"><span class="secno"><del class=
"diff-old">3.11.2.</del> <ins class="diff-chg">3.9.8</ins></span>
The <dfn id="ul"><code>ul</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>Zero or more <code><a href="#li">li</a></code> elements.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#ul">ul</a></code> element represents
<del class="diff-old">an unordered</del> <ins class=
"diff-chg">a</ins> list of <ins class="diff-new">items, where the
order of the</ins> items <del class="diff-old">(which are
represented by li elements).</del> <ins class="diff-chg">is not
important — that is, where changing the order would not materially
change the meaning of the document.</ins></p>
<p>The items of the list are the <code><a href="#li">li</a></code>
element child nodes of the <code><a href="#ul">ul</a></code>
element.</p>
<div class="example">
<p><ins class="diff-new">The following markup shows a list where
the order does not matter, and where the</ins> <code><a href=
"#ul"><ins class="diff-new">ul</ins></a></code> <ins class=
"diff-new">element is therefore appropriate. Compare this list to
the equivalent list in the</ins> <code><a href="#ol"><ins class=
"diff-new">ol</ins></a></code> <ins class="diff-new">section to see
an example of the same items using the</ins> <code><a href=
"#ol"><ins class="diff-new">ol</ins></a></code> <ins class=
"diff-new">element.</ins></p>
<pre>
<p>I have lived in the following countries:</p><ins class="diff-new">
<ul>
<li>Norway
<li>Switzerland
<li>United Kingdom
<li>United States
</ul>
</ins>
</pre>
<p><ins class="diff-new">Note that changing the order of the list
does not change the meaning of the document. The items in the
snippet above are given in alphabetical order, but in the snippet
below they are given in order of the size of their current account
balance in 2007, without changing the meaning of the document
whatsoever:</ins></p>
<pre>
<p>I have lived in the following countries:</p><ins class="diff-new">
<ul>
<li>Switzerland
<li>Norway
<li>United Kingdom
<li>United States
</ul>
</ins>
</pre></div>
<h4 id="the-li"><span class="secno"><del class=
"diff-old">3.11.3.</del> <ins class="diff-chg">3.9.9</ins></span>
The <dfn id="li"><code>li</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Inside <code><a href="#ol">ol</a></code> elements.</dd>
<dd>Inside <code><a href="#ul">ul</a></code> elements.</dd>
<dd>Inside <code><a href="#menu">menu</a></code> elements.</dd>
<dt>Content model:</dt>
<dd>When the element is a child of a <code><a href=
"#menu">menu</a></code> element: <a href="#phrasing0">phrasing
content</a> .</dd>
<dd>Otherwise: <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a>
.</dd>
<dt>Element-specific attributes:</dt>
<dd>If the element is a child of an <code><a href=
"#ol">ol</a></code> element: <code title="attr-li-value"><a href=
"#value">value</a></code></dd>
<dd>If the element is not the child of an <code><a href=
"#ol">ol</a></code> element: None.</dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id="htmllielement">HTMLLIElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
attribute long <a href="#value0" title=
"dom-li-value">value</a>;
};
</pre></dd>
</dl>
<p>The <code><a href="#li">li</a></code> element represents a list
item. If its parent element is an <code><a href="#ol">ol</a></code>
, <code><a href="#ul">ul</a></code> , or <code><a href=
"#menu">menu</a></code> element, then the element is an item of the
parent element's list, as defined for those elements. Otherwise,
the list item has no defined list-related relationship to any other
<code><a href="#li">li</a></code> element.</p>
<p>The <dfn id="value" title=
"attr-li-value"><code>value</code></dfn> attribute, if present,
must be a <a href="#valid0">valid integer</a> giving the ordinal
value of the <del class="diff-old">first</del> list item.</p>
<p>If the <code title="attr-li-value"><a href=
"#value">value</a></code> attribute is present, user agents must
<a href="#rules0" title="rules for parsing integers">parse it as an
integer</a> , in order to determine the attribute's value. If the
attribute's value cannot be converted to a number, the attribute
must be treated as if it was absent. The attribute has no default
value.</p>
<p>The <code title="attr-li-value"><a href=
"#value">value</a></code> attribute is processed relative to the
element's parent <code><a href="#ol">ol</a></code> element (q.v.),
if there is one. If there is not, the attribute has no effect.</p>
<p>The <dfn id="value0" title=
"dom-li-value"><code>value</code></dfn> DOM attribute must <a href=
"#reflect">reflect</a> the value of the <code title=
"dom-li-value"><a href="#value0">value</a></code> content
attribute.</p>
<div class="example">
<p><ins class="diff-new">The following example, the top ten movies
are listed (in reverse order). Note the way the list is given a
title by using a</ins> <code><a href="#figure"><ins class=
"diff-new">figure</ins></a></code> <ins class="diff-new">element
and its</ins> <code><a href="#legend"><ins class=
"diff-new">legend</ins></a></code> .</p>
<pre>
<figure><ins class="diff-new">
<legend>The top 10 movies of all time</legend>
<ol>
<li value="10"><cite>Josie and the Pussycats</cite>, 2001</li>
<li value="9"><cite lang="sh">Црна мачка, бели мачор</cite>, 1998</li>
<li value="8"><cite>A Bugs Life</cite>, 1998</li>
<li value="7"><cite>Toy Story</cite>, 1995</li>
<li value="6"><cite>Monsters, Inc</cite>, 2001</li>
<li value="5"><cite>Cars</cite>, 2006</li>
<li value="4"><cite>Toy Story 2</cite>, 1999</li>
<li value="3"><cite>Finding Nemo</cite>, 2003</li>
<li value="2"><cite>The Incredibles</cite>, 2004</li>
<li value="1"><cite>Ratatouille</cite>, 2007</li>
</ol>
</figure>
</ins>
</pre>
<p><ins class="diff-new">The markup could also be written as
follows, using the</ins> <code title="attr-ol-reversed"><a href=
"#reversed"><ins class="diff-new">reversed</ins></a></code>
<ins class="diff-new">attribute on the</ins> <code><a href=
"#ol"><ins class="diff-new">ol</ins></a></code> <ins class=
"diff-new">element:</ins></p>
<pre>
<figure><ins class="diff-new">
<legend>The top 10 movies of all time</legend>
<ol reversed>
<li><cite>Josie and the Pussycats</cite>, 2001</li>
<li><cite lang="sh">Црна мачка, бели мачор</cite>, 1998</li>
<li><cite>A Bugs Life</cite>, 1998</li>
<li><cite>Toy Story</cite>, 1995</li>
<li><cite>Monsters, Inc</cite>, 2001</li>
<li><cite>Cars</cite>, 2006</li>
<li><cite>Toy Story 2</cite>, 1999</li>
<li><cite>Finding Nemo</cite>, 2003</li>
<li><cite>The Incredibles</cite>, 2004</li>
<li><cite>Ratatouille</cite>, 2007</li>
</ol>
</figure>
</ins>
</pre></div>
<h4 id="the-dl"><span class="secno"><del class=
"diff-old">3.11.4.</del> <ins class="diff-chg">3.9.10</ins></span>
The <dfn id="dl"><code>dl</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>Zero or more groups each consisting of one or more
<code><a href="#dt">dt</a></code> elements followed by one or mode
<code><a href="#dd">dd</a></code> elements.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#dl">dl</a></code> element introduces an
<del class="diff-old">unordered</del> association list consisting
of zero or more name-value groups (a description list). Each group
must consist of one or more names ( <code><a href=
"#dt">dt</a></code> elements) followed by one or more values (
<code><a href="#dd">dd</a></code> elements).</p>
<p>Name-value groups may be terms and definitions, metadata topics
and values, or any other groups of name-value data.</p>
<p>The <del class="diff-old">following are all conforming HTML
fragments. In the following example, one entry ("Authors") is
linked to two</del> values <del class="diff-old">("John" and
"Luke"). <dl> <dt> Authors <dd> John <dd>
Luke <dt> Editor <dd> Frank </dl> In the
following example, one definition is linked to two terms.
<dl> <dt lang="en-US"> <dfn>color</dfn>
</dt> <dt lang="en-GB"> <dfn>colour</dfn>
</dt> <dd> A sensation which (in humans) derives from
the ability of the fine structure of the eye to distinguish three
differently filtered analyses of a view. </dd> </dl>
The following example illustrates the use</del> <ins class=
"diff-chg">within a group are alternatives; multiple paragraphs
forming part</ins> of the <ins class="diff-new">same value must all
be given within the same</ins> <code><del class="diff-old">dl</del>
<a href="#dd"><ins class="diff-chg">dd</ins></a></code> <del class=
"diff-old">element to mark up metadata</del> <ins class=
"diff-chg">element.</ins></p>
<p><ins class="diff-chg">The order</ins> of <del class=
"diff-old">sorts. At</del> the <del class="diff-old">end</del>
<ins class="diff-chg">list</ins> of <del class="diff-old">the
example, one group has two metadata labels ("Authors"</del>
<ins class="diff-chg">groups,</ins> and <del class=
"diff-old">"Editors")</del> <ins class="diff-chg">of the
names</ins> and <del class="diff-old">two</del> values <del class=
"diff-old">("Robert Rothman" and "Daniel Jackson"). <dl>
<dt> Last modified time </dt> <dd>
2004-12-23T23:33Z </dd> <dt> Recommended update
interval </dt> <dd> 60s </dd> <dt> Authors
</dt> <dt> Editors </dt> <dd> Robert
Rothman </dd> <dd> Daniel Jackson </dd>
</dl></del> <ins class="diff-chg">within each group, may be
significant.</ins></p>
<p>If a <code><a href="#dl">dl</a></code> element is empty, it
contains no groups.</p>
<p>If a <code><a href="#dl">dl</a></code> element contains non-
<a href="#inter-element" title=
"inter-element whitespace">whitespace</a> <a href="#text-node"
title="text node">text nodes</a> , or elements other than
<code><a href="#dt">dt</a></code> and <code><a href=
"#dd">dd</a></code> , then those elements or <a href="#text-node"
title="text node">text nodes</a> do not form part of any groups in
that <code><a href="#dl">dl</a> <del class="diff-old">, and the
document is non-conforming.</del></code> .</p>
<p>If a <code><a href="#dl">dl</a></code> element contains only
<code><a href="#dt">dt</a></code> elements, then it consists of one
group with names but no <del class="diff-old">values, and the
document is non-conforming.</del> <ins class=
"diff-chg">values.</ins></p>
<p>If a <code><a href="#dl">dl</a></code> element contains only
<code><a href="#dd">dd</a></code> elements, then it consists of one
group with values but no <del class="diff-old">names,</del>
<ins class="diff-chg">names.</ins></p>
<p><ins class="diff-chg">If a</ins> <code><a href="#dl"><ins class=
"diff-chg">dl</ins></a></code> <ins class="diff-chg">element starts
with one or more</ins> <code><a href="#dd"><ins class=
"diff-chg">dd</ins></a></code> <ins class="diff-chg">elements, then
the first group has no associated name.</ins></p>
<p><ins class="diff-chg">If a</ins> <code><a href="#dl"><ins class=
"diff-chg">dl</ins></a></code> <ins class="diff-chg">element ends
with one or more</ins> <code><a href="#dt"><ins class=
"diff-chg">dt</ins></a></code> <ins class="diff-chg">elements, then
the last group has no associated value.</ins></p>
<p class="note"><ins class="diff-chg">When a</ins> <code><a href=
"#dl"><ins class="diff-chg">dl</ins></a></code> <ins class=
"diff-chg">element doesn't match its content model, it is often due
to accidentally using</ins> <code><a href="#dd"><ins class=
"diff-chg">dd</ins></a></code> <ins class="diff-chg">elements in
the place of</ins> <code><a href="#dt"><ins class=
"diff-chg">dt</ins></a></code> <ins class="diff-chg">elements and
vice versa. Conformance checkers can spot such mistakes</ins> and
<ins class="diff-new">might be able to advise authors how to
correctly use</ins> the <del class="diff-old">document</del>
<ins class="diff-chg">markup.</ins></p>
<div class="example">
<p><ins class="diff-chg">In the following example, one entry
("Authors")</ins> is <del class="diff-old">non-conforming.</del>
<ins class="diff-chg">linked to two values ("John" and
"Luke").</ins></p>
<pre>
<dl><ins class="diff-chg">
<dt> Authors
<dd> John
<dd> Luke
<dt> Editor
<dd> Frank
</dl>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-chg">In the following example, one definition
is linked to two terms.</ins></p>
<pre>
<dl><ins class="diff-chg">
<dt lang="en-US"> <dfn>color</dfn> </dt>
<dt lang="en-GB"> <dfn>colour</dfn> </dt>
<dd> A sensation which (in humans) derives from the ability of
the fine structure of the eye to distinguish three differently
filtered analyses of a view. </dd>
</dl>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-chg">The following example illustrates the use
of the</ins> <code><a href="#dl"><ins class=
"diff-chg">dl</ins></a></code> <ins class="diff-chg">element to
mark up metadata of sorts. At the end of the example, one group has
two metadata labels ("Authors" and "Editors") and two values
("Robert Rothman" and "Daniel Jackson").</ins></p>
<pre>
<dl><ins class="diff-chg">
<dt> Last modified time </dt>
<dd> 2004-12-23T23:33Z </dd>
<dt> Recommended update interval </dt>
<dd> 60s </dd>
<dt> Authors </dt>
<dt> Editors </dt>
<dd> Robert Rothman </dd>
<dd> Daniel Jackson </dd>
</dl>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-chg">The following example shows the</ins>
<code><a href="#dl"><ins class="diff-chg">dl</ins></a></code>
<ins class="diff-chg">element used to give a set of instructions.
The order of the instructions here is important (in the other
examples, the order of the blocks was not important).</ins></p>
<pre>
<p>Determine the victory points as follows (use the<ins class="diff-chg">
first matching case):</p>
<dl>
<dt> If you have exactly five gold coins </dt>
<dd> You get five victory points </dd>
<dt> If you have one or more gold coins, and you have one or more silver coins </dt>
<dd> You get two victory points </dd>
<dt> If you have one or more silver coins </dt>
<dd> You get one victory point </dd>
<dt> Otherwise </dt>
<dd> You get no victory points </dd>
</dl>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-chg">The following snippet shows a</ins>
<code><a href="#dl"><ins class="diff-chg">dl</ins></a></code>
<ins class="diff-chg">element being used as a glossary. Note the
use of</ins> <code><a href="#dfn"><ins class=
"diff-chg">dfn</ins></a></code> <ins class="diff-chg">to indicate
the word being defined.</ins></p>
<pre>
<dl><ins class="diff-chg">
<dt><dfn>Apartment</dfn>, n.</dt>
<dd>An execution context grouping one or more threads with one or
more COM objects.</dd>
<dt><dfn>Flat</dfn>, n.</dt>
<dd>A deflated tire.</dd>
<dt><dfn>Home</dfn>, n.</dt>
<dd>The user's login directory.</dd>
</dl>
</ins>
</pre></div>
<p class="note">The <code><a href="#dl">dl</a></code> element is
inappropriate for marking up dialogue, since dialogue is ordered
(each speaker/line pair comes after the next). For an example of
how to mark up dialogue, see the <code><a href=
"#dialog">dialog</a></code> element.</p>
<h4 id="the-dt"><span class="secno"><del class=
"diff-old">3.11.5.</del> <ins class="diff-chg">3.9.11</ins></span>
The <dfn id="dt"><code>dt</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Before <code><a href="#dd">dd</a></code> or <code><a href=
"#dt">dt</a></code> elements inside <code><a href=
"#dl">dl</a></code> elements.</dd>
<dd>Before a <code><a href="#dd">dd</a></code> element inside a
<code><a href="#dialog">dialog</a></code> element.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#dt">dt</a></code> element represents the
term, or name, part of a term-description group in a description
list ( <code><a href="#dl">dl</a></code> element), and the talker,
or speaker, part of a talker-discourse pair in a conversation (
<code><a href="#dialog">dialog</a></code> element).</p>
<p class="note">The <code><a href="#dt">dt</a></code> element
itself, when used in a <code><a href="#dl">dl</a></code> element,
does not indicate that its contents are a term being defined, but
this can be indicated using the <code><a href="#dfn">dfn</a></code>
element.</p>
<p><ins class="diff-new">If the</ins> <code><a href=
"#dt"><ins class="diff-new">dt</ins></a></code> <ins class=
"diff-new">element is the child of a</ins> <code><a href=
"#dialog"><ins class="diff-new">dialog</ins></a></code> <ins class=
"diff-new">element, and it further contains a</ins> <code><a href=
"#time"><ins class="diff-new">time</ins></a></code> <ins class=
"diff-new">element, then that</ins> <code><a href=
"#time"><ins class="diff-new">time</ins></a></code> <ins class=
"diff-new">element represents a timestamp for when the associated
discourse (</ins> <code><a href="#dd"><ins class=
"diff-new">dd</ins></a></code> <ins class="diff-new">element) was
said, and is not part of the name of the talker.</ins></p>
<div class="example">
<p><ins class="diff-new">The following extract shows how an IM
conversation log could be marked up.</ins></p>
<pre>
<dialog><ins class="diff-new">
<dt> <time>14:22</time> egof
<dd> I'm not that nerdy, I've only seen 30% of the star trek episodes
<dt> <time>14:23</time> kaj
<dd> if you know what percentage of the star trek episodes you have seen, you are inarguably nerdy
<dt> <time>14:23</time> egof
<dd> it's unarguably
<dt> <time>14:24</time> kaj
<dd> you are not helping your case
</dialog>
</ins>
</pre></div>
<h4 id="the-dd"><span class="secno"><del class=
"diff-old">3.11.6.</del> <ins class="diff-chg">3.9.12</ins></span>
The <dfn id="dd"><code>dd</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>After <code><a href="#dt">dt</a></code> or <code><a href=
"#dd">dd</a></code> elements inside <code><a href=
"#dl">dl</a></code> elements.</dd>
<dd>After a <code><a href="#dt">dt</a></code> element inside a
<code><a href="#dialog">dialog</a></code> element.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#dd">dd</a></code> element represents the
description, definition, or value, part of a term-description group
in a description list ( <code><a href="#dl">dl</a></code> element),
and the discourse, or quote, part in a conversation (
<code><a href="#dialog">dialog</a></code> element).</p>
<h3 id="text-level"><span class="secno"><del class=
"diff-old">3.12.</del> <ins class="diff-chg">3.10</ins></span>
<del class="diff-old">Phrase elements</del> <ins class=
"diff-chg">Text-level semantics</ins></h3>
<h4 id="the-a"><span class="secno"><del class=
"diff-old">3.12.1.</del> <ins class="diff-chg">3.10.1</ins></span>
The <dfn id="a"><code>a</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dd><a href="#interactive1">Interactive content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> , but there must be
no <a href="#interactive1">interactive content</a> descendant.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-hyperlink-href"><a href=
"#href6">href</a></code></dd>
<dd><code title="attr-hyperlink-target"><a href=
"#target3">target</a></code></dd>
<dd><code title="attr-hyperlink-ping"><a href=
"#ping">ping</a></code></dd>
<dd><code title="attr-hyperlink-rel"><a href=
"#rel3">rel</a></code></dd>
<dd><code title="attr-hyperlink-media"><a href=
"#media12">media</a></code></dd>
<dd><code title="attr-hyperlink-hreflang"><a href=
"#hreflang3">hreflang</a></code></dd>
<dd><code title="attr-hyperlink-type"><a href=
"#type17">type</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre>
<del class="diff-old"> class=idl>interface {
</del>
<ins class=
"diff-chg"> class=idl>[Stringifies=href] interface <dfn id=
"htmlanchorelement">HTMLAnchorElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
</ins>
attribute DOMString <a href="#href3" title=
"dom-a-href">href</a>;
attribute DOMString <a href="#target1" title=
"dom-a-target">target</a>;
attribute DOMString <a href="#ping0" title=
"dom-a-ping">ping</a>;
attribute DOMString <a href="#rel1" title=
"dom-a-rel">rel</a>;
readonly attribute DOMTokenList <a href="#rellist0" title=
"dom-a-relList">relList</a>;
attribute DOMString <a href="#media4" title=
"dom-a-media">media</a>;
attribute DOMString <a href="#hreflang1" title=
"dom-a-hreflang">hreflang</a>;
attribute DOMString <a href="#type3" title=
"dom-a-type">type</a>;
};
</pre>
<p>The <code title="command-ro"><a href=
"#command2">Command</a></code> interface must also be implemented
by this element.</p>
</dd>
</dl>
<p>If the <code><a href="#a">a</a></code> element has an
<code title="attr-hyperlink-href"><a href="#href6">href</a></code>
attribute, then it represents a <a href="#hyperlinks">hyperlink</a>
.</p>
<p>If the <code><a href="#a">a</a></code> element has no
<code title="attr-hyperlink-href"><a href="#href6">href</a></code>
attribute, then the element is a placeholder for where a link might
otherwise have been placed, if it had been relevant.</p>
<p>The <code title="attr-hyperlink-target"><a href=
"#target3">target</a></code> , <code title=
"attr-hyperlink-ping"><a href="#ping">ping</a></code> ,
<code title="attr-hyperlink-rel"><a href="#rel3">rel</a></code> ,
<code title="attr-hyperlink-media"><a href=
"#media12">media</a></code> , <code title=
"attr-hyperlink-hreflang"><a href="#hreflang3">hreflang</a></code>
, and <code title="attr-hyperlink-type"><a href=
"#type17">type</a></code> attributes must be omitted if the
<code title="attr-hyperlink-href"><a href="#href6">href</a></code>
attribute is not present.</p>
<div class="example">
<p>If a site uses a consistent navigation toolbar on every page,
then the link that would normally link to the page itself could be
marked up using an <code><a href="#a">a</a></code> element:</p>
<pre>
<nav>
<ul>
<li> <a href="/">Home</a> </li>
<li> <a href="/news">News</a> </li>
<li> <a>Examples</a> </li>
<li> <a href="/legal">Legal</a> </li>
</ul>
</nav>
</pre></div>
<p>Interactive user agents should allow users to <a href=
"#following0" title="following hyperlinks">follow hyperlinks</a>
created using the <code><a href="#a">a</a></code> element. The
<code title="attr-hyperlink-href"><a href="#href6">href</a></code>
, <code title="attr-hyperlink-target"><a href=
"#target3">target</a></code> and <code title=
"attr-hyperlink-ping"><a href="#ping">ping</a></code> attributes
decide how the link is followed. The <code title=
"attr-hyperlink-rel"><a href="#rel3">rel</a></code> , <code title=
"attr-hyperlink-media"><a href="#media12">media</a></code> ,
<code title="attr-hyperlink-hreflang"><a href=
"#hreflang3">hreflang</a></code> , and <code title=
"attr-hyperlink-type"><a href="#type17">type</a></code> attributes
may be used to indicate to the user the likely nature of the target
resource before the user follows the link.</p>
<p>The <a href="#activation0">activation behavior</a> of
<code><a href="#a">a</a></code> elements that represent
<span>hyperlinks</span> is to run the following steps:</p>
<ol>
<li>
<p>If the <code title="event-DOMActivate">DOMActivate</code> event
in question is not <span title=
"concept-events-trusted">trusted</span> (i.e. a <code title=
"dom-click"><a href="#click">click()</a></code> method call was the
reason for the event being dispatched), and the <code><a href=
"#a">a</a></code> element's <code title=
"attr-hyperlink-target"><a href="#target3">target</a></code>
attribute is <span class="big-issue">...</span> then raise an
<code>INVALID_ACCESS_ERR</code> exception and abort these
steps.</p>
</li>
<li>
<p>If the target of the <code title=
"event-DOMActivate">DOMActivate</code> event is an <code><a href=
"#img">img</a></code> element with an <code title=
"attr-img-ismap"><a href="#ismap">ismap</a></code> attribute
specified, then server-side image map processing must be performed,
as follows:</p>
<ol>
<li>If the <code title="event-DOMActivate">DOMActivate</code> event
was dispatched as the result of a real pointing-device-triggered
<code title="event-click">click</code> event on the <code><a href=
"#img">img</a></code> element, then let <var title="">x</var> be
the distance in CSS pixels from the left edge of the image to the
location of the click, and let <var title="">y</var> be the
distance in CSS pixels from the top edge of the image to the
location of the click. Otherwise, let <var title="">x</var> and
<var title="">y</var> be zero.</li>
<li>Let the <dfn id="hyperlink2"><var>hyperlink suffix</var></dfn>
be a U+003F QUESTION MARK character, the value of <var title=
"">x</var> expressed as a base-ten integer using ASCII digits
(U+0030 DIGIT ZERO to U+0039 DIGIT NINE), a U+002C COMMA character,
and the value of <var title="">y</var> expressed as a base-ten
integer using ASCII digits.</li>
</ol>
</li>
<li>
<p>Finally, the user agent must <a href="#following0" title=
"following hyperlinks">follow the hyperlink</a> defined by the
<code><a href="#a">a</a></code> element. If the steps above defined
a <var><a href="#hyperlink2">hyperlink suffix</a></var> , then take
that into account when following the hyperlink.</p>
</li>
</ol>
<p class="note">One way that a user agent can enable users to
follow hyperlinks is by allowing <code><a href="#a">a</a></code>
elements to be clicked, or focussed and activated by the keyboard.
This <span title="interactive elements">will cause</span> the
aforementioned <a href="#activation0">activation behavior</a> to be
invoked.</p>
<p>The DOM attributes <dfn id="href3" title=
"dom-a-href"><code>href</code></dfn> , <dfn id="ping0" title=
"dom-a-ping"><code>ping</code></dfn> , <dfn id="target1" title=
"dom-a-target"><code>target</code></dfn> , <dfn id="rel1" title=
"dom-a-rel"><code>rel</code></dfn> , <dfn id="media4" title=
"dom-a-media"><code>media</code></dfn> , <dfn id="hreflang1" title=
"dom-a-hreflang"><code>hreflang</code></dfn> , and <dfn id="type3"
title="dom-a-type"><code>type</code></dfn> , must each <a href=
"#reflect">reflect</a> the respective content attributes of the
same name.</p>
<p>The DOM attribute <dfn id="rellist0" title=
"dom-a-rellist"><code>relList</code></dfn> must <a href=
"#reflect">reflect</a> the <code title=
"attr-hyperlink-rel"><a href="#rel3">rel</a></code> content
attribute.</p>
<h4 id="the-q"><span class="secno"><del class=
"diff-old">3.12.2.</del> <ins class="diff-chg">3.10.2</ins></span>
The <dfn id="q"><code>q</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-q-cite"><a href="#cite1">cite</a></code></dd>
<dt>DOM interface:</dt>
<dd>The <code><a href="#q">q</a></code> element uses the
<code><a href="#htmlquoteelement">HTMLQuoteElement</a></code>
interface.</dd>
</dl>
<p>The <code><a href="#q">q</a></code> element represents
<del class="diff-old">a part of a paragraph</del> <ins class=
"diff-chg">some</ins> <a href="#phrasing0" title=
"phrasing content"><ins class="diff-chg">phrasing content</ins></a>
quoted from another source.</p>
<p><ins class="diff-new">Quotation punctuation (such as quotation
marks), if any, must be placed inside the</ins> <code><a href=
"#q"><ins class="diff-new">q</ins></a></code> <ins class=
"diff-new">element.</ins></p>
<p>Content inside a <code><a href="#q">q</a></code> element must be
quoted from another source, whose URI, if it has one, should be
cited in the <dfn id="cite1" title=
"attr-q-cite"><code>cite</code></dfn> attribute.</p>
<p>If the <code title="attr-q-cite"><a href=
"#cite1">cite</a></code> attribute is present, it must be a URI (or
IRI). User agents should allow users to follow such citation
links.</p>
<p>If a <code><a href="#q">q</a></code> element is contained
(directly or indirectly) in a <a href="#paragraph">paragraph</a>
that contains a single <code><a href="#cite2">cite</a></code>
element and has no other <code><a href="#q">q</a></code> element
descendants, then, the <del class="diff-old">citation</del>
<ins class="diff-chg">title of the work</ins> given by that
<code><a href="#cite2">cite</a></code> element gives the source of
the quotation contained in the <code><a href="#q">q</a></code>
element.</p>
<div class="example">
<p><ins class="diff-new">Here is a simple example of the use of
the</ins> <code><a href="#q"><ins class=
"diff-new">q</ins></a></code> <ins class=
"diff-new">element:</ins></p>
<pre>
<p>The man said <q>"Things that are impossible just take
<ins class="diff-new">longer"</q>.
I
disagreed
with
him.</p>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-new">Here is an example with both an explicit
citation link in the</ins> <code><a href="#q"><ins class=
"diff-new">q</ins></a></code> <ins class="diff-new">element, and an
explicit citation outside:</ins></p>
<pre>
<p>The W3C page <cite>About W3C</cite> says the W3C's<ins class="diff-new">
mission is <q cite="http://www.w3.org/Consortium/">"To lead the
World Wide Web to its full potential by developing protocols and
guidelines that ensure long-term growth for the Web"</q>. I
disagree
with
this
mission.</p>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-new">In the following example, the quotation
itself contains a quotation:</ins></p>
<pre>
<p>In <cite>Example One</cite>, he writes <q>"The man<ins class="diff-new">
said <q>'Things that are impossible just take longer'</q>. I
disagreed
with
him"</q>.
Well,
I
disagree
even
more!</p>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-new">In the following example, there are no
quotation marks:</ins></p>
<pre>
<ins class="diff-new">
<p>
His
best
argument:
<q>
I
disagree!</q>
</p>
</ins>
</pre></div>
<h4 id="the-cite"><span class="secno"><del class=
"diff-old">3.12.3.</del> <ins class="diff-chg">3.10.3</ins></span>
The <dfn id="cite2"><code>cite</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#cite2">cite</a></code> element represents
<del class="diff-old">a citation:</del> the <del class=
"diff-old">source,</del> <ins class="diff-chg">title of a work
(e.g. a book, a paper, an essay, a poem, a score, a song, a script,
a film, a TV show, a game, a sculpture, a painting, a theatre
production, a play, an opera, a musical, an exhibition, etc). This
can be a work that is being quoted</ins> or <del class=
"diff-old">reference, for</del> <ins class="diff-chg">referenced in
detail (i.e.</ins> a <del class="diff-old">quote</del> <ins class=
"diff-chg">citation),</ins> or <del class="diff-old">statement
made</del> <ins class="diff-chg">it can just be a work that is
mentioned</ins> in <ins class="diff-new">passing.</ins></p>
<p><ins class="diff-new">A person's name is not</ins> the
<del class="diff-old">document.</del> <ins class="diff-chg">title
of a work — even if people call that person a piece of work — and
the element must therefore not be used to mark up people's names.
(In some cases, the</ins> <code><a href="#b"><ins class=
"diff-chg">b</ins></a></code> <ins class="diff-chg">element might
be appropriate for names; e.g. in a gossip article where the names
of famous people are keywords rendered with a different style to
draw attention to them. In other cases, if an element is</ins>
<em><ins class="diff-chg">really</ins></em> <ins class=
"diff-chg">needed, the</ins> <code><a href="#span"><ins class=
"diff-chg">span</ins></a></code> <ins class="diff-chg">element can
be used.)</ins></p>
<p><ins class="diff-chg">A ship is similarly not a work, and the
element must not be used to mark up ship names (the</ins>
<code><a href="#i"><ins class="diff-chg">i</ins></a></code>
<ins class="diff-chg">element can be used for that
purpose).</ins></p>
<div class="example">
<p><ins class="diff-chg">This next example shows a typical use of
the</ins> <code><a href="#cite2"><ins class=
"diff-chg">cite</ins></a></code> <ins class=
"diff-chg">element:</ins></p>
<pre>
<p>My favourite book is <cite>The Reality Dysfunction</cite> by<ins class="diff-chg">
Peter F. Hamilton. My favourite comic is <cite>Pearls Before
Swine</cite> by Stephan Pastis. My favourite track is <cite>Jive
Samba</cite>
by
the
Cannonball
Adderley
Sextet.</p>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-chg">This is correct usage:</ins></p>
<pre>
<p>According to the Wikipedia article <cite>HTML</cite>, as it<ins class="diff-chg">
stood in mid-February 2008, leaving attribute values unquoted is
unsafe.
This
is
obviously
an
over-simplification.</p>
</ins>
</pre>
<p><ins class="diff-chg">The following, however, is incorrect
usage, as the</ins> <code><a href="#cite2"><ins class=
"diff-chg">cite</ins></a></code> <ins class="diff-chg">element here
is containing far more than the title of the work:</ins></p>
<pre ins="" class="diff-chg">
class=bad><!-- do not copy this example, it is an example of bad usage! -->
<p>According to <cite>the Wikipedia article on HTML</cite>, as it
stood in mid-February 2008, leaving attribute values unquoted is
unsafe.
This
is
obviously
an
over-simplification.</p>
</pre></div>
<div class="example">
<p><ins class="diff-chg">The</ins> <code><a href=
"#cite2"><ins class="diff-chg">cite</ins></a></code> <ins class=
"diff-chg">element is obviously a key part of any citation in a
bibliography, but it is only used to mark the title:</ins></p>
<pre>
<p><cite>Universal Declaration of Human Rights</cite>, United Nations,<ins class="diff-chg">
December
1948.
Adopted
by
General
Assembly
resolution
217
A
(III).</p>
</ins>
</pre></div>
<p class="note">A <em>citation</em> is not a <em>quote</em> (for
which the <code><a href="#q">q</a></code> element is
appropriate).</p>
<div class="example">
<p>This is incorrect <del class="diff-old">usage:</del> <ins class=
"diff-chg">usage, because</ins> <code><a href="#cite2"><ins class=
"diff-chg">cite</ins></a></code> <ins class="diff-chg">is not for
quotes:</ins></p>
<pre>
<p>
<cite>
This
is
wrong!</cite>,
said
Ian.</p>
</pre>
<p>This is <del class="diff-old">the correct way to do it:</del>
<ins class="diff-chg">also incorrect usage, because a person is not
a work:</ins></p>
<pre>
<p>
<q>
This
is
<del class="diff-old">correct!</q>,
</del>
<ins class="diff-chg">still
wrong!</q>,
</ins>
said
<cite>
Ian</cite>.</p>
</pre>
<p><del class="diff-old">This is also wrong, because the title and
the name are</del> <ins class="diff-chg">The correct usage
does</ins> not <del class="diff-old">references or citations:</del>
<ins class="diff-chg">use a</ins> <code><a href=
"#cite2"><ins class="diff-chg">cite</ins></a></code> <ins class=
"diff-chg">element:</ins></p>
<del class="diff-old">by <cite> Peter F.
Hamilton</cite>.</p></del>
<pre>
<ins class="diff-chg"><p>
<q>
This
is
correct</q>,
said
Ian.</p>
</ins>
</pre>
<p><del class="diff-old">This is correct, because even though</del>
<ins class="diff-chg">As mentioned above,</ins> the <del class=
"diff-old">source is not quoted, it is cited:</del> <code><a href=
"#b"><ins class="diff-chg">b</ins></a></code> <ins class=
"diff-chg">element might be relevant for marking names as being
keywords in certain kinds of documents:</ins></p>
<del class="diff-old">the Wikipedia article on HTML</cite>,
HTML is defined in formal specifications that were developed and
published throughout the 1990s.</p></del>
<pre>
<p>And then <b>Ian</b> said <q>this might be right, in a
<ins class="diff-chg">gossip
column,
maybe!</q>.</p>
</ins>
</pre></div>
<p class="note">The <code><a href="#cite2">cite</a></code> element
can apply to <code><a href="#blockquote">blockquote</a></code> and
<code><a href="#q">q</a></code> elements in certain cases described
in the definitions of those elements.</p>
<div class="example">
<p><ins class="diff-new">This next example shows the use of</ins>
<code><a href="#cite2"><ins class="diff-new">cite</ins></a></code>
<ins class="diff-new">alongside</ins> <code><a href=
"#blockquote"><ins class="diff-new">blockquote</ins></a></code>
:</p>
<pre>
<p>His next piece was the aptly named <cite>Sonnet 130</cite>:</p><ins class="diff-new">
<blockquote>
<p>My mistress' eyes are nothing like the sun,<br>
Coral is far more red, than her lips red,
...
</ins>
</pre></div>
<h4 id="the-em"><span class="secno"><del class=
"diff-old">3.12.4.</del> <ins class="diff-chg">3.10.4</ins></span>
The <dfn id="em"><code>em</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#em">em</a></code> element represents stress
emphasis of its contents.</p>
<p>The level of emphasis that a <del class=
"diff-old">particlar</del> <ins class="diff-chg">particular</ins>
piece of content has is given by its number of ancestor
<code><a href="#em">em</a></code> elements.</p>
<p>The placement of emphasis changes the meaning of the sentence.
The element thus forms an integral part of the content. The precise
way in which emphasis is used in this way depends on the
language.</p>
<div class="example">
<p>These examples show how changing the emphasis changes the
meaning. First, a general statement of fact, with no emphasis:</p>
<pre>
<p>
Cats
are
cute
animals.</p>
</pre>
<p>By <del class="diff-old">emphasising</del> <ins class=
"diff-chg">emphasizing</ins> the first word, the statement implies
that the kind of animal under discussion is in question (maybe
someone is asserting that dogs are cute):</p>
<pre>
<p>
<em>
Cats</em>
are
cute
animals.</p>
</pre>
<p>Moving the emphasis to the verb, one highlights that the truth
of the entire sentence is in question (maybe someone is saying cats
are not cute):</p>
<pre>
<p>
Cats
<em>
are</em>
cute
animals.</p>
</pre>
<p>By moving it to the adjective, the exact nature of the cats is
reasserted (maybe someone suggested cats were <em>mean</em>
animals):</p>
<pre>
<p>
Cats
are
<em>
cute</em>
animals.</p>
</pre>
<p>Similarly, if someone asserted that cats were vegetables,
someone correcting this might <del class="diff-old">emphasise</del>
<ins class="diff-chg">emphasize</ins> the last word:</p>
<pre>
<p>
Cats
are
cute
<em>
animals</em>.</p>
</pre>
<p>By <del class="diff-old">emphasising</del> <ins class=
"diff-chg">emphasizing</ins> the entire sentence, it becomes clear
that the speaker is fighting hard to get the point across. This
kind of emphasis also typically affects the punctuation, hence the
exclamation mark here.</p>
<pre>
<p>
<em>
Cats
are
cute
animals!</em>
</p>
</pre>
<p>Anger mixed with <del class="diff-old">emphasising</del>
<ins class="diff-chg">emphasizing</ins> the cuteness could lead to
markup such as:</p>
<pre>
<p>
<em>
Cats
are
<em>
cute</em>
animals!</em>
</p>
</pre></div>
<h4 id="the-strong"><span class="secno"><del class=
"diff-old">3.12.5.</del> <ins class="diff-chg">3.10.5</ins></span>
The <dfn id="strong"><code>strong</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#strong">strong</a></code> element represents
strong importance for its contents.</p>
<p>The relative level of importance of a piece of content is given
by its number of ancestor <code><a href="#strong">strong</a></code>
elements; each <code><a href="#strong">strong</a></code> element
increases the importance of its contents.</p>
<p>Changing the importance of a piece of text with the
<code><a href="#strong">strong</a></code> element does not change
the meaning of the sentence.</p>
<div class="example">
<p>Here is an example of a warning notice in a game, with the
various parts marked up according to how important they are:</p>
<pre>
<p><strong>Warning.</strong> This dungeon is dangerous.
<strong>Avoid the ducks.</strong> Take any gold you find.
<strong><strong>Do not take any of the diamonds</strong>,
they are explosive and <strong>will destroy anything within
ten
meters.</strong>
</strong>
You
have
been
warned.</p>
</pre></div>
<h4 id="the-small"><span class="secno"><del class=
"diff-old">3.12.6.</del> <ins class="diff-chg">3.10.6</ins></span>
The <dfn id="small"><code>small</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#small">small</a></code> element represents
small print (part of a document often describing legal
restrictions, such as copyrights or other disadvantages), or other
side comments.</p>
<p class="note">The <code><a href="#small">small</a></code> element
does not <del class="diff-old">"de-emphasise"</del> <ins class=
"diff-chg">"de-emphasize"</ins> or lower the importance of text
emphasised by the <code><a href="#em">em</a></code> element or
marked as important with the <code><a href=
"#strong">strong</a></code> element.</p>
<div class="example">
<p>In this example the footer contains contact information and a
copyright.</p>
<pre>
<footer>
<address>
For more details, contact
<a href="mailto:js@example.com">John Smith</a>.
</address>
<p><small>© copyright 2038 Example Corp.</small></p>
</footer>
</pre>
<p>In this second example, the <code><a href=
"#small">small</a></code> element is used for a side comment.</p>
<pre>
<p>Example Corp today announced record profits for the
second quarter <small>(Full Disclosure: Foo News is a subsidiary of
Example Corp)</small>, leading to speculation about a third quarter
merger
with
Demo
Group.</p>
</pre>
<p>In this last example, the <code><a href=
"#small">small</a></code> element is marked as being
<em>important</em> small print.</p>
<pre>
<p>
<strong>
<small>
Continued
use
of
this
service
will
result
in
a
kiss.</small>
</strong>
</p>
</pre></div>
<h4 id="the-mark"><span class="secno"><del class=
"diff-old">3.12.7.</del> <ins class="diff-chg">3.10.7</ins></span>
The <dfn id="mark"><code><del class="diff-old">m</del> <ins class=
"diff-chg">mark</ins></code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<del class="diff-old">This section has a large number of
outstanding comments and will likely be rewritten or removed from
the spec.</del>
<p>The <code><del class="diff-old">m</del> <a href=
"#mark"><ins class="diff-chg">mark</ins></a></code> element
represents a run of text <ins class="diff-new">in one
document</ins> marked or <del class="diff-old">highlighted.
In</del> <ins class="diff-chg">highlighted for reference purposes,
due to its relevance in another context. When used in a quotation
or other block of text referred to from</ins> the <del class=
"diff-old">following snippet,</del> <ins class="diff-chg">prose, it
indicates</ins> a <del class="diff-old">paragraph</del> <ins class=
"diff-chg">highlight that was not originally present but which has
been added to bring the reader's attention to a part</ins> of
<ins class="diff-new">the</ins> text <del class=
"diff-old">refers</del> <ins class="diff-chg">that might not have
been considered important by the original author when the block was
originally written, but which is now under previously unexpected
scrutiny. When used in the main prose of a document, it indicates a
part of the document that has been highlighted due to its likely
relevance</ins> to <ins class="diff-new">the user's current
activity.</ins></p>
<p class="big-issue"><ins class="diff-new">The rendering section
will eventually suggest that user agents provide</ins> a
<del class="diff-old">specific</del> <ins class="diff-chg">way to
let users jump between</ins> <code><a href="#mark"><ins class=
"diff-chg">mark</ins></a></code> <ins class="diff-chg">elements.
Suggested rendering is a neon yellow background highlight, though
UAs maybe should allow this to be toggled.</ins></p>
<div class="example">
<p><ins class="diff-chg">This example shows how the</ins>
<code><a href="#mark"><ins class="diff-chg">mark</ins></a></code>
<ins class="diff-chg">example can be used to bring attention to a
particular</ins> part of a <del class="diff-old">code
fragment.</del> <ins class="diff-chg">quotation:</ins></p>
<del class="diff-old"><pre><code>var i: Integer; begin
i := <m>1.1</m>; end.</code> </pre></del>
<pre>
<p lang="en-US">Consider the following quote:</p>
<ins class="diff-chg"><blockquote lang="en-GB">
<p>Look around and you will find, no-one's really
<mark>colour</mark> blind.</p>
</blockquote>
<p lang="en-US">As we can tell from the <em>spelling</em> of the word,
the
person
writing
this
quote
is
clearly
not
American.</p>
</ins>
</pre></div>
<div class="example">
<p>Another example of the <code><del class="diff-old">m</del>
<a href="#mark"><ins class="diff-chg">mark</ins></a></code> element
is highlighting parts of a document that are matching some search
string. If someone looked at a document, and the server knew that
the user was searching for the word "kitten", then the server might
return the document with one paragraph modified as follows:</p>
<del class="diff-old">s who are visiting me these days. They're
really cute. I think</del>
<pre>
<p>I also have some <mark>kitten</mark>s who are visiting me
<ins class=
"diff-chg">these days. They're really cute. I think they like my garden! Maybe I
should
adopt
a
<mark>
kitten</mark>.</p>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-chg">In the following snippet, a paragraph of
text refers to a specific part of a code fragment.</ins></p>
<pre>
<p>The highlighted part below is where the error lies:</p><ins class="diff-chg">
<pre><code>var i: Integer;
begin
i := <mark>1.1</mark>;
end.</code>
</pre>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-chg">This is another example showing the use
of</ins> <code><a href="#mark"><ins class=
"diff-chg">mark</ins></a></code> <ins class="diff-chg">to highlight
a part of quoted text that was originally not emphasised. In this
example, common typographic conventions have led the author to
explicitly style</ins> <code><a href="#mark"><ins class=
"diff-chg">mark</ins></a></code> <ins class="diff-chg">elements in
quotes to render in italics.</ins></p>
<pre>
<article><ins class="diff-chg">
<style>
blockquote mark, q mark {
font: inherit; font-style: italic;
text-decoration: none;
background: transparent; color: inherit;
}
.bubble em {
font: inherit; font-size: larger;
text-decoration: underline;
}
</style>
<h1>She knew</h1>
<p>Did you notice the subtle joke in the joke on panel 4?</p>
<blockquote>
<p class="bubble">I didn't <em>want</em> to believe. <mark>Of course
on some level I realized it was a known-plaintext attack.</mark> But I
couldn't admit it until I saw for myself.</p>
</blockquote>
<p>(Emphasis mine.) I thought that was great. It's so pedantic, yet it
explains everything neatly.</p>
</article>
</ins>
</pre>
<p><ins class="diff-chg">Note, incidentally, the distinction
between the</ins> <code><a href="#em"><ins class=
"diff-chg">em</ins></a></code> <ins class="diff-chg">element in
this example, which is part of the original text being quoted, and
the</ins> <code><a href="#mark"><ins class=
"diff-chg">mark</ins></a></code> <ins class="diff-chg">element,
which is highlighting a part for comment.</ins></p>
</div>
<div class="example">
<p><ins class="diff-chg">The following example shows the difference
between denoting the</ins> <em><ins class=
"diff-chg">importance</ins></em> <ins class="diff-chg">of a span of
text (</ins> <code><a href="#strong"><ins class=
"diff-chg">strong</ins></a></code> <ins class="diff-chg">) as
opposed to denoting the</ins> <em><ins class=
"diff-chg">relevance</ins></em> <ins class="diff-chg">of a span of
text (</ins> <code><a href="#mark"><ins class=
"diff-chg">mark</ins></a></code> <ins class="diff-chg">). It is an
extract from a textbook, where the extract has had the parts
relevant to the exam highlighted. The safety warnings, important
though</ins> they <del class="diff-old">like my
garden!</p></del> <ins class="diff-chg">may be, are
apparently not relevant to the exam.</ins></p>
<pre>
<h3>Wormhole Physics Introduction</h3><ins class=
"diff-chg">
<p><mark>A wormhole in normal conditions can be held open for a
maximum of just under 39 minutes.</mark> Conditions that can increase
the time include a powerful energy source coupled to one or both of
the gates connecting the wormhole, and a large gravity well (such as a
black hole).</p>
<p><mark>Momentum is preserved across the wormhole. Electromagnetic
radiation can travel in both directions through a wormhole,
but matter cannot.</mark></p>
<p>When a wormhole is created, a vortex normally forms.
<strong>Warning: The vortex caused by the wormhole opening will
annihilate anything in its path.</strong> Vortexes can be avoided when
using sufficiently advanced dialing technology.</p>
<p><mark>An obstruction in a gate will prevent it from accepting a
wormhole
connection.</mark>
</p>
</ins>
</pre></div>
<h4 id="the-dfn"><span class="secno"><del class=
"diff-old">3.12.8.</del> <ins class="diff-chg">3.10.8</ins></span>
The <dfn id="dfn"><code>dfn</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> , but there must be
no descendant <code><a href="#dfn">dfn</a></code> elements.</dd>
<dt>Element-specific attributes:</dt>
<dd>None, but the <code title="attr-dfn-title"><a href=
"#title4">title</a></code> attribute has special semantics on this
element.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#dfn">dfn</a></code> element represents the
defining instance of a term. The <a href="#paragraph" title=
"paragraph">paragraph</a> , <a href="#dl" title="dl">description
list group</a> , or <a href="#sectioning0" title=
"sectioning content">section</a> that <del class=
"diff-old">contains</del> <ins class="diff-chg">is the nearest
ancestor of</ins> the <code><a href="#dfn">dfn</a></code> element
<del class="diff-old">contains</del> <ins class="diff-chg">must
also contain</ins> the <del class="diff-old">definition</del>
<ins class="diff-chg">definition(s)</ins> for the <a href=
"#defining" title="defining term">term</a> given by the <del class=
"diff-old">contents of the</del> <code><a href=
"#dfn">dfn</a></code> element.</p>
<p><dfn id="defining">Defining term</dfn> : If the <code><a href=
"#dfn">dfn</a></code> element has a <dfn id="title4" title=
"attr-dfn-title"><code>title</code></dfn> attribute, then the exact
value of that attribute is the term being defined. Otherwise, if it
contains exactly one element child node and no child <a href=
"#text-node" title="text node">text nodes</a> , and that child
element is an <code><a href="#abbr">abbr</a></code> element with a
<code title="attr-abbr-title"><a href="#title5">title</a></code>
attribute, then the exact value of <em>that</em> attribute is the
term being defined. Otherwise, it is the exact <code><a href=
"#textcontent">textContent</a></code> of the <code><a href=
"#dfn">dfn</a></code> element that gives the term being
defined.</p>
<p>If the <code title="attr-dfn-title"><a href=
"#title4">title</a></code> attribute of the <code><a href=
"#dfn">dfn</a></code> element is present, then it must <del class=
"diff-old">only</del> contain <ins class="diff-new">only</ins> the
term being defined. <del class="diff-old">There must only be one
dfn element per document for each term defined (i.e. there must not
be any duplicate terms ).</del></p>
<p class="note">The <code title="attr-title"><a href=
"#title">title</a></code> attribute of ancestor elements does not
affect <code><a href="#dfn">dfn</a></code> elements. <del class=
"diff-old">The dfn element enables automatic cross-references.
Specifically, any span , abbr , code , var , samp , or</del></p>
<p><ins class="diff-chg">An</ins> <code><del class=
"diff-old">i</del> <a href="#a"><ins class=
"diff-chg">a</ins></a></code> element that <del class=
"diff-old">has a non-empty title attribute whose value exactly
equals the term of</del> <ins class="diff-chg">links to</ins> a
<code><a href="#dfn">dfn</a></code> element <del class=
"diff-old">in the same document, or which has no title attribute
but whose textContent exactly equals the term</del> <ins class=
"diff-chg">represents an instance</ins> of <del class="diff-old">a
dfn element in</del> the <del class="diff-old">document, and that
has no interactive elements or dfn elements either as ancestors or
descendants, and has no other elements as ancestors that are
themselves matching these conditions, should be presented in such a
way that the user can jump from the element to</del> <ins class=
"diff-chg">term defined by</ins> the <del class=
"diff-old">first</del> <code><a href="#dfn">dfn</a></code>
<del class="diff-old">element giving the defining instance of that
term.</del> <ins class="diff-chg">element.</ins></p>
<div class="example">
<p>In the following fragment, the term "GDO" is first defined in
the first paragraph, then used in the second. <del class=
"diff-old">A compliant UA could provide a link from the abbr
element in</del></p>
<pre>
<p>The <dfn><abbr title="Garage Door Opener">GDO</abbr></dfn>
<ins class=
"diff-chg">is a device that allows off-world teams to open the iris.</p>
<!-- ... later in the document: -->
<p>Teal'c activated his <abbr title="Garage Door Opener">GDO</abbr>
and
so
Hammond
ordered
</ins>
the
<del class="diff-old">second
paragraph
</del>
<ins class="diff-chg">iris
</ins>
to
<ins class="diff-new">be
opened.</p>
</ins>
</pre>
<p><ins class="diff-new">With</ins> the <ins class=
"diff-new">addition of an</ins> <code><del class=
"diff-old">dfn</del> <a href="#a"><ins class=
"diff-chg">a</ins></a></code> <del class="diff-old">element
in</del> <ins class="diff-chg">element,</ins> the <del class=
"diff-old">first.</del> <ins class="diff-chg">reference can be made
explicit:</ins></p>
<del class="diff-old"></del>
<pre>
<p>The <dfn id=gdo><abbr title="Garage Door Opener">GDO</abbr></dfn>
is a device that allows off-world teams to open the iris.</p>
<!-- ... later in the document: -->
<del class=
"diff-old"><p>Teal'c activated his <abbr title="Garage Door Opener">GDO</abbr>
</del>
<ins class=
"diff-chg"><p>Teal'c activated his <a href=#gdo><abbr title="Garage Door Opener">GDO</abbr></a>
</ins>
and
so
Hammond
ordered
the
iris
to
be
opened.</p>
</pre></div>
<h4 id="the-abbr"><span class="secno"><del class=
"diff-old">3.12.9.</del> <ins class="diff-chg">3.10.9</ins></span>
The <dfn id="abbr"><code>abbr</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd>None, but the <code title="attr-abbr-title"><a href=
"#title5">title</a></code> attribute has special semantics on this
element.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#abbr">abbr</a></code> element represents an
abbreviation or <del class="diff-old">acronym.</del> <ins class=
"diff-chg">acronym, optionally with its expansion.</ins> The
<dfn id="title5" title="attr-abbr-title"><code>title</code></dfn>
attribute <del class="diff-old">should</del> <ins class=
"diff-chg">may</ins> be used to provide an expansion of the
abbreviation. <del class="diff-old">If present, the attribute</del>
<ins class="diff-chg">The attribute, if specified,</ins> must
<del class="diff-old">only</del> contain an expansion of the
<del class="diff-old">abbreviation.</del> <ins class=
"diff-chg">abbreviation, and nothing else.</ins></p>
<div class="example">
<p>The paragraph below contains an abbreviation marked up with the
<code><a href="#abbr">abbr</a></code> element. <ins class=
"diff-new">This paragraph</ins> <a href="#defining" title=
"defining term"><ins class="diff-new">defines the term</ins></a>
<ins class="diff-new">"Web Hypertext Application Technology Working
Group".</ins></p>
<del class="diff-old">The <abbr title="Web Hypertext Application
Technology Working Group">WHATWG</abbr> is a loose
unofficial collaboration of Web browser manufacturers and
interested parties who wish to develop new technologies designed to
allow authors to write and deploy</del>
<pre>
<p>The <dfn id=whatwg><abbr title="Web Hypertext Application
<ins class=
"diff-chg">Technology Working Group">WHATWG</abbr></dfn> is a loose
unofficial collaboration of Web browser manufacturers and interested
parties who wish to develop new technologies designed to allow authors
to
write
and
deploy
</ins>
Applications
over
the
World
Wide
Web.</p>
</pre></div>
<div class="example">
<p><del class="diff-old">The title attribute may be omitted if
there is a dfn element in the document whose defining term</del>
<ins class="diff-chg">This paragraph has two abbreviations. Notice
how only one</ins> is <ins class="diff-new">defined;</ins> the
<del class="diff-old">abbreviation (the textContent of</del>
<ins class="diff-chg">other, with no expansion associated with it,
does not use</ins> the <code><a href="#abbr">abbr</a></code>
<del class="diff-old">element).</del> <ins class=
"diff-chg">element.</ins></p>
<pre>
<p>The <abbr title="Web Hypertext Application Technology Working<ins class="diff-chg">
Group">
WHATWG</abbr>
started
working
on
HTML5
in
2004.</p>
</ins>
</pre></div>
<div class="example">
<p><del class="diff-old">In the example below, the word "Zat" is
used as</del> <ins class="diff-chg">This paragraph links</ins> an
abbreviation <del class="diff-old">in</del> <ins class=
"diff-chg">to its definition.</ins></p>
<pre>
<p>The <a href="#whatwg"><abbr title="Web Hypertext Application<ins class="diff-chg">
Technology Working Group">WHATWG</abbr></a> community does not
have
much
representation
from
Asia.</p>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-chg">This paragraph marks up an abbreviation
without giving an expansion, possibly as a hook to apply styles for
abbreviations (e.g. smallcaps).</ins></p>
<pre>
<p>Philip` and Dashiva both denied that they were going to<ins class="diff-chg">
get the issue counts from past revisions of the specification to
backfill
</ins>
the
<del class="diff-old">second
paragraph.
The
</del>
<ins class="diff-chg"><abbr>
WHATWG</abbr>
issue
graph.</p>
</ins>
</pre></div>
<p><ins class="diff-chg">If an</ins> abbreviation is <del class=
"diff-old">defined in</del> <ins class="diff-chg">pluralized,</ins>
the <del class="diff-old">first, so</del> <ins class=
"diff-chg">expansion's grammatical number (plural vs singular) must
match</ins> the <del class="diff-old">explanatory title attribute
has been omitted. Because</del> <ins class="diff-chg">grammatical
number</ins> of the <del class="diff-old">way dfn elements are
defined,</del> <ins class="diff-chg">contents of</ins> the
<del class="diff-old">second abbr element</del> <ins class=
"diff-chg">element.</ins></p>
<div class="example">
<p><ins class="diff-chg">Here the plural is outside the element, so
the expansion is</ins> in <del class="diff-old">this example would
be connected (in some UA-specific way) to</del> the <del class=
"diff-old">first.</del> <ins class="diff-chg">singular:</ins></p>
<del class="diff-old"><p> Jack used a</del>
<pre>
<p>Two <abbr title="Working Group">WG</abbr>s worked on
<ins class=
"diff-chg">this specification: the <abbr>WHATWG</abbr> and the
</ins>
<abbr>
<del class="diff-old">Zat</abbr>
to
make
</del>
<ins class="diff-chg">HTMLWG</abbr>.</p>
</ins>
</pre>
<p><ins class="diff-chg">Here</ins> the <del class="diff-old">boxes
of evidence disappear.</p></del> <ins class="diff-chg">plural
is inside the element, so the expansion is in the plural:</ins></p>
<pre>
<p>Two <abbr title="Working Groups">WGs</abbr> worked on<ins class="diff-chg">
this specification: the <abbr>WHATWG</abbr> and the
<abbr>
HTMLWG</abbr>.</p>
</ins>
</pre></div>
<h4 id="the-time"><span class="secno"><del class=
"diff-old">3.12.10.</del> <ins class=
"diff-chg">3.10.10</ins></span> The <dfn id=
"time"><code>time</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-time-datetime"><a href=
"#datetime">datetime</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmltimeelement">HTMLTimeElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#datetime0" title=
"dom-time-datetime">dateTime</a>;
readonly attribute <a href=
"#domtimestamp">DOMTimeStamp</a> <a href="#date0" title=
"dom-time-date">date</a>;
readonly attribute <a href=
"#domtimestamp">DOMTimeStamp</a> <a href="#time1" title=
"dom-time-time">time</a>;
readonly attribute <a href=
"#domtimestamp">DOMTimeStamp</a> <a href="#timezone0" title=
"dom-time-timezone">timezone</a>;
};
</pre></dd>
</dl>
<p>The <code><a href="#time">time</a></code> element represents a
date and/or a time.</p>
<p>The <dfn id="datetime" title=
"attr-time-datetime"><code>datetime</code></dfn> attribute, if
present, must contain a <a href="#date-or">date or time string</a>
that identifies the date or time being specified.</p>
<p>If the <code title="attr-time-datetime"><a href=
"#datetime">datetime</a></code> attribute is not present, then the
date or time must be specified in the content of the element, such
that parsing the element's <code><a href=
"#textcontent">textContent</a></code> according to the rules for
parsing <a href="#date-or0" title=
"date or time string in content">date or time strings in
content</a> successfully extracts a date or time.</p>
<p>The <dfn id="datetime0" title=
"dom-time-datetime"><code>dateTime</code></dfn> DOM attribute must
<a href="#reflect">reflect</a> the <code title=
"attr-time-datetime"><a href="#datetime">datetime</a></code>
content attribute.</p>
<p>User agents, to obtain the <dfn id="date" title=
"concept-time-date">date</dfn> , <dfn id="time0" title=
"concept-time-time">time</dfn> , and <dfn id="timezone" title=
"concept-time-timezone">timezone</dfn> represented by a
<code><a href="#time">time</a></code> element, must follow these
steps:</p>
<ol>
<li>If the <code title="attr-time-datetime"><a href=
"#datetime">datetime</a></code> attribute is present, then parse it
according to the rules for parsing <a href="#date-or1" title=
"date or time string in attributes">date or time strings in
attributes</a> , and let the result be <var title="">result</var>
.</li>
<li>Otherwise, parse the element's <code><a href=
"#textcontent">textContent</a></code> according to the rules for
parsing <a href="#date-or1" title=
"date or time string in attributes">date or time strings in
content</a> , and let the result be <var title="">result</var>
.</li>
<li>If <var title="">result</var> is empty (because the parsing
failed), then the <a href="#date" title=
"concept-time-date">date</a> is unknown, the <a href="#time0"
title="concept-time-time">time</a> is unknown, and the <a href=
"#timezone" title="concept-time-timezone">timezone</a> is
unknown.</li>
<li>Otherwise: if <var title="">result</var> contains a date, then
that is the <a href="#date" title="concept-time-date">date</a> ; if
<var title="">result</var> contains a time, then that is the
<a href="#time0" title="concept-time-time">time</a> ; and if
<var title="">result</var> contains a timezone, then the timezone
is the element's <a href="#timezone" title=
"concept-time-timezone">timezone</a> . (A timezone can only be
present if both a date and a time are also present.)</li>
</ol>
<p>The <dfn id="date0" title=
"dom-time-date"><code>date</code></dfn> DOM attribute must return
null if the <a href="#date" title="concept-time-date">date</a> is
unknown, and otherwise must return the time corresponding to
midnight UTC (i.e. the first second) of the given <a href="#date"
title="concept-time-date">date</a> .</p>
<p>The <dfn id="time1" title=
"dom-time-time"><code>time</code></dfn> DOM attribute must return
null if the <a href="#time0" title="concept-time-time">time</a> is
unknown, and otherwise must return the time corresponding to the
given <a href="#time0" title="concept-time-time">time</a> of
1970-01-01, with the timezone UTC.</p>
<p>The <dfn id="timezone0" title=
"dom-time-timezone"><code>timezone</code></dfn> DOM attribute must
return null if the <a href="#timezone" title=
"concept-time-timezone">timezone</a> is unknown, and otherwise must
return the time corresponding to 1970-01-01 00:00 UTC in the given
<a href="#timezone" title="concept-time-timezone">timezone</a> ,
with the timezone set to UTC (i.e. the time corresponding to
1970-01-01 at 00:00 UTC plus the offset corresponding to the
timezone).</p>
<div class="example">
<p>In the following snippet:</p>
<pre>
<p>
Our
first
date
was
<time
datetime="2006-09-23">
a
<del class="diff-old">saturday</time>.</p>
</del>
<ins class="diff-chg">Saturday</time>.</p>
</ins>
</pre>
<p>...the <code><a href="#time">time</a></code> element's
<code title="dom-time-date"><a href="#date0">date</a></code>
attribute would have the value 1,158,969,600,000ms, and the
<code title="dom-time-time"><a href="#time1">time</a></code> and
<code title="dom-time-timezone"><a href=
"#timezone0">timezone</a></code> attributes would return null.</p>
<p>In the following snippet:</p>
<pre>
<p>
We
stopped
talking
at
<time
datetime="2006-09-24
05:00
-7">
5am
the
next
morning</time>.</p>
</pre>
<p>...the <code><a href="#time">time</a></code> element's
<code title="dom-time-date"><a href="#date0">date</a></code>
attribute would have the value 1,159,056,000,000ms, the
<code title="dom-time-time"><a href="#time1">time</a></code>
attribute would have the value 18,000,000ms, and the <code title=
"dom-time-timezone"><a href="#timezone0">timezone</a></code>
attribute would return <del class="diff-old">-25,200,000ms.</del>
<ins class="diff-chg">−25,200,000ms.</ins> To obtain the actual
time, the three attributes can be added together, obtaining
1,159,048,800,000, which is the specified date and time in UTC.</p>
<p>Finally, in the following snippet:</p>
<pre>
<p>
Many
people
get
up
at
<time>
08:00</time>.</p>
</pre>
<p>...the <code><a href="#time">time</a></code> element's
<code title="dom-time-date"><a href="#date0">date</a></code>
attribute would have the value null, the <code title=
"dom-time-time"><a href="#time1">time</a></code> attribute would
have the value 28,800,000ms, and the <code title=
"dom-time-timezone"><a href="#timezone0">timezone</a></code>
attribute would return null.</p>
</div>
<p class="big-issue">These APIs may be suboptimal. Comments on
making them more useful to JS authors are welcome. The primary use
cases for these elements are for marking up publication dates e.g.
in blog entries, and for marking event dates in hCalendar markup.
Thus the DOM APIs are likely to be used as ways to generate
interactive calendar widgets or some such.</p>
<h4 id="the-progress"><span class="secno"><del class=
"diff-old">3.12.11.</del> <ins class=
"diff-chg">3.10.11</ins></span> The <dfn id=
"progress"><code>progress</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-progress-value"><a href=
"#value1">value</a></code></dd>
<dd><code title="attr-progress-max"><a href=
"#max">max</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlprogresselement">HTMLProgressElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
attribute float <a href="#value2" title=
"dom-progress-value">value</a>;
attribute float <a href="#max0" title=
"dom-progress-max">max</a>;
readonly attribute float <a href="#position" title=
"dom-progress-position">position</a>;
};
</pre></dd>
</dl>
<p>The <code><a href="#progress">progress</a></code> element
represents the completion progress of a task. The progress is
either indeterminate, indicating that progress is being made but
that it is not clear how much more work remains to be done before
the task is complete (e.g. because the task is waiting for a remote
host to respond), or the progress is a number in the range zero to
a maximum, giving the fraction of work that has so far been
completed.</p>
<p>There are two attributes that determine the current task
completion represented by the element.</p>
<p>The <dfn id="value1" title=
"attr-progress-value"><code>value</code></dfn> attribute specifies
how much of the task has been completed, and the <dfn id="max"
title="attr-progress-max"><code>max</code></dfn> attribute
specifies how much work the task requires in total. The units are
arbitrary and not specified.</p>
<p>Instead of using the attributes, authors are recommended to
<del class="diff-old">simply</del> include the current value and
the maximum value inline as text inside the element.</p>
<div class="example">
<p>Here is a snippet of a Web application that shows the progress
of some automated task:</p>
<pre>
<section>
<h2>Task Progress</h2>
<del class=
"diff-old"> <p><label>Progress: <progress><span id="p">0</span>%</progress></p>
</del>
<ins class=
"diff-chg"> <p>Progress: <progress><span id="p">0</span>%</progress></p>
</ins>
<script>
var progressBar = document.getElementById('p');
function updateProgress(newValue) {
progressBar.textContent = newValue;
}
</script>
</section>
</pre>
<p>(The <code>updateProgress()</code> method in this example would
be called by some other code on the page to update the actual
progress bar as the task progressed.)</p>
</div>
<p><strong>Author requirements</strong> : The <code title=
"attr-progress-max"><a href="#max">max</a></code> and <code title=
"attr-progress-value"><a href="#value1">value</a></code>
attributes, when present, must have values that are <a href=
"#valid1" title="valid floating point number">valid floating point
numbers</a> . The <code title="attr-progress-max"><a href=
"#max">max</a></code> attribute, if present, must have a value
greater than zero. The <code title="attr-progress-value"><a href=
"#value1">value</a></code> attribute, if present, must have a value
equal to or greater than zero, and less than or equal to the value
of the <code title="attr-progress-max"><a href=
"#max">max</a></code> attribute, if present.</p>
<p class="note"><ins class="diff-new">The</ins> <code><a href=
"#progress"><ins class="diff-new">progress</ins></a></code>
<ins class="diff-new">element is the wrong element to use for
something that is just a gauge, as opposed to task progress. For
instance, indicating disk space usage using</ins> <code><a href=
"#progress"><ins class="diff-new">progress</ins></a></code>
<ins class="diff-new">would be inappropriate. Instead, the</ins>
<code><a href="#meter"><ins class="diff-new">meter</ins></a></code>
<ins class="diff-new">element is available for such use
cases.</ins></p>
<p><strong>User agent requirements</strong> : User agents must
parse the <code title="attr-progress-max"><a href=
"#max">max</a></code> and <code title=
"attr-progress-value"><a href="#value1">value</a></code>
attributes' values according to the <a href="#rules1">rules for
parsing floating point number values</a> .</p>
<p>If the <code title="attr-progress-value"><a href=
"#value1">value</a></code> attribute is omitted, then user agents
must also parse the <code><a href=
"#textcontent">textContent</a></code> of the <code><a href=
"#progress">progress</a></code> element in question using the
<a href="#steps">steps for finding one or two numbers of a ratio in
a string</a> . These steps will return nothing, one number, one
number with a denominator punctuation character, or two
numbers.</p>
<p>Using the results of this processing, user agents must determine
whether the progress bar is an indeterminate progress bar, or
whether it is a determinate progress bar, and in the latter case,
what its current and maximum values are, all as follows:</p>
<ol>
<li>If the <code title="attr-progress-max"><a href=
"#max">max</a></code> attribute is omitted, and the <code title=
"attr-progress-value"><a href="#value1">value</a></code> is
omitted, and the results of parsing the <code><a href=
"#textcontent">textContent</a></code> was nothing, then the
progress bar is an indeterminate progress bar. Abort these
steps.</li>
<li>Otherwise, it is a determinate progress bar.</li>
<li>If the <code title="attr-progress-max"><a href=
"#max">max</a></code> attribute is included, then, if a value could
be parsed out of it, then the maximum value is that value.</li>
<li>Otherwise, if the <code title="attr-progress-max"><a href=
"#max">max</a></code> attribute is absent but the <code title=
"attr-progress-value"><a href="#value1">value</a></code> attribute
is present, or, if the <code title="attr-progress-max"><a href=
"#max">max</a></code> attribute is present but no value could be
parsed from it, then the maximum is 1.</li>
<li>Otherwise, if neither attribute is included, then, if the
<code><a href="#textcontent">textContent</a></code> contained one
number with an associated denominator punctuation character, then
the maximum value is the <span>value associated with that
denominator punctuation character</span> ; otherwise, if the
<code><a href="#textcontent">textContent</a></code> contained two
numbers, the maximum value is the higher of the two values;
otherwise, the maximum value is 1.</li>
<li>If the <code title="attr-progress-value"><a href=
"#value1">value</a></code> attribute is present on the element and
a value could be parsed out of it, that value is the current value
of the progress bar. Otherwise, if the attribute is present but no
value could be parsed from it, the current value is zero.</li>
<li>Otherwise if the <code title="attr-progress-value"><a href=
"#value1">value</a></code> attribute is absent and the <code title=
"attr-progress-max"><a href="#max">max</a></code> attribute is
present, then, if the <code><a href=
"#textcontent">textContent</a></code> was parsed and found to
contain just one number, with no associated denominator punctuation
character, then the current value is that number. Otherwise, if the
<code title="attr-progress-value"><a href=
"#value1">value</a></code> attribute is absent and the <code title=
"attr-progress-max"><a href="#max">max</a></code> attribute is
present then the current value is zero.</li>
<li>Otherwise, if neither attribute is present, then the current
value is the lower of the one or two numbers that were found in the
<code><a href="#textcontent">textContent</a></code> of the
element.</li>
<li>If the maximum value is less than or equal to zero, then it is
reset to 1.</li>
<li>If the current value is less than zero, then it is reset to
zero.</li>
<li>Finally, if the current value is greater than the maximum
value, then the current value is reset to the maximum value.</li>
</ol>
<p><strong>UA requirements for showing the progress bar</strong> :
When representing a <code><a href="#progress">progress</a></code>
element to the user, the UA should indicate whether it is a
determinate or indeterminate progress bar, and in the former case,
should indicate the relative position of the current value relative
to the maximum value.</p>
<p>The <dfn id="max0" title=
"dom-progress-max"><code>max</code></dfn> and <dfn id="value2"
title="dom-progress-value"><code>value</code></dfn> DOM attributes
must <a href="#reflect">reflect</a> the elements' content
attributes of the same name. When the relevant content attributes
are absent, the DOM attributes must return zero. The value parsed
from the <code><a href="#textcontent">textContent</a></code> never
affects the DOM values.</p>
<p class="big-issue">Would be cool to have the <code title=
"dom-progress-value"><a href="#value2">value</a></code> DOM
attribute update the <code><a href=
"#textcontent">textContent</a></code> in-line...</p>
<p>If the progress bar is an indeterminate progress bar, then the
<dfn id="position" title=
"dom-progress-position"><code>position</code></dfn> DOM attribute
must return <del class="diff-old">-1.</del> <ins class=
"diff-chg">−1.</ins> Otherwise, it must return the result of
dividing the current value by the maximum value.</p>
<h4 id="the-meter"><span class="secno"><del class=
"diff-old">3.12.12.</del> <ins class=
"diff-chg">3.10.12</ins></span> The <dfn id=
"meter"><code>meter</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-meter-value"><a href=
"#value3">value</a></code></dd>
<dd><code title="attr-meter-min"><a href="#min">min</a></code></dd>
<dd><code title="attr-meter-low"><a href="#low">low</a></code></dd>
<dd><code title="attr-meter-high"><a href=
"#high">high</a></code></dd>
<dd><code title="attr-meter-max"><a href=
"#max1">max</a></code></dd>
<dd><code title="attr-meter-optimum"><a href=
"#optimum">optimum</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlmeterelement">HTMLMeterElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
<del class="diff-old"> attribute long ;
attribute long ;
attribute long ;
attribute long ;
attribute long ;
attribute long ;
</del>
<ins class="diff-chg"> attribute float <a href="#value4"
title="dom-meter-value">value</a>;
attribute float <a href="#min0" title=
"dom-meter-min">min</a>;
attribute float <a href="#max2" title=
"dom-meter-max">max</a>;
attribute float <a href="#low0" title=
"dom-meter-low">low</a>;
attribute float <a href="#high0" title=
"dom-meter-high">high</a>;
attribute float <a href="#optimum0" title=
"dom-meter-optimum">optimum</a>;
</ins>
};
</pre></dd>
</dl>
<p>The <code><a href="#meter">meter</a></code> element represents a
scalar measurement within a known range, or a fractional value; for
example disk usage, the relevance of a query result, or the
fraction of a voting population to have selected a particular
candidate.</p>
<p>This is also known as a gauge.</p>
<p class="note">The <code><a href="#meter">meter</a></code> element
should not be used to indicate progress (as in a progress bar). For
that role, HTML provides a separate <code><a href=
"#progress">progress</a></code> element.</p>
<p class="note">The <code><a href="#meter">meter</a></code> element
also does not represent a scalar value of arbitrary range — for
example, it would be wrong to use this to report a weight, or
height, unless there is a known maximum value.</p>
<p>There are six attributes that determine the semantics of the
gauge represented by the element.</p>
<p>The <dfn id="min" title="attr-meter-min"><code>min</code></dfn>
attribute specifies the lower bound of the range, and the <dfn id=
"max1" title="attr-meter-max"><code>max</code></dfn> attribute
specifies the upper bound. The <dfn id="value3" title=
"attr-meter-value"><code>value</code></dfn> attribute specifies the
value to have the gauge indicate as the "measured" value.</p>
<p>The other three attributes can be used to segment the gauge's
range into "low", "medium", and "high" parts, and to indicate which
part of the gauge is the "optimum" part. The <dfn id="low" title=
"attr-meter-low"><code>low</code></dfn> attribute specifies the
range that is considered to be the "low" part, and the <dfn id=
"high" title="attr-meter-high"><code>high</code></dfn> attribute
specifies the range that is considered to be the "high" part. The
<dfn id="optimum" title=
"attr-meter-optimum"><code>optimum</code></dfn> attribute gives the
position that is "optimum"; if that is higher than the "high" value
then this indicates that the higher the value, the better; if it's
lower than the "low" mark then it indicates that lower values are
better, and naturally if it is in between then it indicates that
neither high nor low values are good.</p>
<p><strong>Authoring requirements</strong> : The recommended way of
giving the value is to include it as contents of the element,
either as two numbers (the higher number represents the maximum,
the other number the current <del class="diff-old">value),</del>
<ins class="diff-chg">value, and the minimum is assumed to be
zero),</ins> or as a percentage or similar (using one of the
characters such as "%"), or as a fraction.</p>
<p>The <code title="attr-meter-value"><a href=
"#value3">value</a></code> , <code title="attr-meter-min"><a href=
"#min">min</a></code> , <code title="attr-meter-low"><a href=
"#low">low</a></code> , <code title="attr-meter-high"><a href=
"#high">high</a></code> , <code title="attr-meter-max"><a href=
"#max1">max</a></code> , and <code title=
"attr-meter-optimum"><a href="#optimum">optimum</a></code>
attributes are all optional. When present, they must have values
that are <a href="#valid1" title=
"valid floating point number">valid floating point numbers
<del class="diff-old">.</del></a> , <ins class="diff-chg">and their
values must satisfy the following inequalities:</ins></p>
<ul class="brief">
<li><code title="attr-meter-min"><a href="#min"><ins class=
"diff-chg">min</ins></a></code> <ins class="diff-chg">≤</ins>
<code title="attr-meter-value"><a href="#value3"><ins class=
"diff-chg">value</ins></a></code> <ins class="diff-chg">≤</ins>
<code title="attr-meter-max"><a href="#max1"><ins class=
"diff-chg">max</ins></a></code></li>
<li><code title="attr-meter-min"><a href="#min"><ins class=
"diff-chg">min</ins></a></code> <ins class="diff-chg">≤</ins>
<code title="attr-meter-low"><a href="#low"><ins class=
"diff-chg">low</ins></a></code> <ins class="diff-chg">≤</ins>
<code title="attr-meter-high"><a href="#high"><ins class=
"diff-chg">high</ins></a></code> <ins class="diff-chg">≤</ins>
<code title="attr-meter-max"><a href="#max1"><ins class=
"diff-chg">max</ins></a></code></li>
<li><code title="attr-meter-min"><a href="#min"><ins class=
"diff-chg">min</ins></a></code> <ins class="diff-chg">≤</ins>
<code title="attr-meter-optimum"><a href="#optimum"><ins class=
"diff-chg">optimum</ins></a></code> <ins class="diff-chg">≤</ins>
<code title="attr-meter-max"><a href="#max1"><ins class=
"diff-chg">max</ins></a></code></li>
</ul>
<div class="example">
<p>The following examples all represent a measurement of three
quarters (of the maximum of whatever is being measured):</p>
<pre>
<meter>75%</meter>
<meter>750‰</meter>
<meter>3/4</meter>
<meter>6 blocks used (out of 8 total)</meter>
<meter>max: 100; current: 75</meter>
<meter><object data="graph75.png">0.75</object></meter>
<meter
min="0"
max="100"
value="75">
</meter>
</pre>
<p>The following example is incorrect use of the element, because
it doesn't give a range (and since the default maximum is 1, both
of the gauges would end up looking maxed out):</p>
<del class="diff-old"></del>
<pre>
<ins class=
"diff-chg"> class=bad><p>The grapefruit pie had a radius of <meter>12cm</meter>
</ins>
and
a
height
of
<meter>
2cm</meter>.</p>
<!--
<strong>
BAD!
</strong>
-->
</pre>
<p>Instead, one would either not include the meter element, or use
the meter element with a defined range to give the dimensions in
context compared to other pies:</p>
<pre>
<p>The grapefruit pie had a radius of 12cm and a height of
2cm.</p>
<dl>
<dt>Radius: <dd> <meter min=0 max=20 value=12>12cm</meter>
<dt>Height: <dd> <meter min=0 max=10 value=2>2cm</meter>
</dl>
</pre></div>
<p>There is no explicit way to specify units in the <code><a href=
"#meter">meter</a></code> element, but the units may be specified
in the <code title="attr-title"><a href="#title">title</a></code>
attribute in <del class="diff-old">freeform</del> <ins class=
"diff-chg">free-form</ins> text.</p>
<div class="example">
<p>The example above could be extended to mention the units:</p>
<pre>
<dl>
<dt>Radius: <dd> <meter min=0 max=20 value=12 title="centimeters">12cm</meter>
<dt>Height: <dd> <meter min=0 max=10 value=2 title="centimeters">2cm</meter>
</dl>
</pre></div>
<p><strong>User agent requirements</strong> : User agents must
parse the <code title="attr-meter-min"><a href=
"#min">min</a></code> , <code title="attr-meter-max"><a href=
"#max1">max</a></code> , <code title="attr-meter-value"><a href=
"#value3">value</a></code> , <code title="attr-meter-low"><a href=
"#low">low</a></code> , <code title="attr-meter-high"><a href=
"#high">high</a></code> , and <code title=
"attr-meter-optimum"><a href="#optimum">optimum</a></code>
attributes using the <a href="#rules1">rules for parsing floating
point number values</a> .</p>
<p>If the <code title="attr-meter-value"><a href=
"#value3">value</a></code> attribute has been omitted, the user
agent must also process the <code><a href=
"#textcontent">textContent</a></code> of the element according to
the <a href="#steps">steps for finding one or two numbers of a
ratio in a string</a> . These steps will return nothing, one
number, one number with a denominator punctuation character, or two
numbers.</p>
<p>User agents must then use all these numbers to obtain values for
six points on the gauge, as follows. (The order in which these are
evaluated is important, as some of the values refer to earlier
ones.)</p>
<dl>
<dt>The minimum value</dt>
<dd>
<p>If the <code title="attr-meter-min"><a href=
"#min">min</a></code> attribute is specified and a value could be
parsed out of it, then the minimum value is that value. Otherwise,
the minimum value is zero.</p>
</dd>
<dt>The maximum value</dt>
<dd>
<p>If the <code title="attr-meter-max"><a href=
"#max1">max</a></code> attribute is specified and a value could be
parsed out of it, the maximum value is that value.</p>
<p>Otherwise, if the <code title="attr-meter-max"><a href=
"#max1">max</a></code> attribute is specified but no value could be
parsed out of it, or if it was not specified, but either or both of
the <code title="attr-meter-min"><a href="#min">min</a></code> or
<code title="attr-meter-value"><a href="#value3">value</a></code>
attributes <em>were</em> specified, then the maximum value is
1.</p>
<p>Otherwise, none of the <code title="attr-meter-max"><a href=
"#max1">max</a></code> , <code title="attr-meter-min"><a href=
"#min">min</a></code> , and <code title="attr-meter-value"><a href=
"#value3">value</a></code> attributes were specified. If the result
of processing the <code><a href=
"#textcontent">textContent</a></code> of the element was either
nothing or just one number with no denominator punctuation
character, then the maximum value is 1; if the result was one
number but it had an associated denominator punctuation character,
then the maximum value is the <a href="#a-value" title=
"values associated with denominator punctuation characters">value
associated with that denominator punctuation character</a> ; and
finally, if there were two numbers parsed out of the <code><a href=
"#textcontent">textContent</a></code> , then the maximum is the
higher of those two numbers.</p>
<p>If the above machinations result in a maximum value less than
the minimum value, then the maximum value is actually the same as
the minimum value.</p>
</dd>
<dt>The actual value</dt>
<dd>
<p>If the <code title="attr-meter-value"><a href=
"#value3">value</a></code> attribute is specified and a value could
be parsed out of it, then that value is the actual value.</p>
<p>If the <code title="attr-meter-value"><a href=
"#value3">value</a></code> attribute is not specified but the
<code title="attr-meter-max"><a href="#max1">max</a></code>
attribute <em>is</em> specified and the result of processing the
<code><a href="#textcontent">textContent</a></code> of the element
was one number with no associated denominator punctuation
character, then that number is the actual value.</p>
<p>If neither of the <code title="attr-meter-value"><a href=
"#value3">value</a></code> and <code title=
"attr-meter-max"><a href="#max1">max</a></code> attributes are
specified, then, if the result of processing the <code><a href=
"#textcontent">textContent</a></code> of the element was one number
(with or without an associated denominator punctuation character),
then that is the actual value, and if the result of processing the
<code><a href="#textcontent">textContent</a></code> of the element
was two numbers, then the actual value is the lower of the two
numbers found.</p>
<p>Otherwise, if none of the above apply, the actual value is
zero.</p>
<p>If the above procedure results in an actual value less than the
minimum value, then the actual value is actually the same as the
minimum value.</p>
<p>If, on the other hand, the result is an actual value greater
than the maximum value, then the actual value is the maximum
value.</p>
</dd>
<dt>The low boundary</dt>
<dd>
<p>If the <code title="attr-meter-low"><a href=
"#low">low</a></code> attribute is specified and a value could be
parsed out of it, then the low boundary is that value. Otherwise,
the low boundary is the same as the minimum value.</p>
<p>If the above results in a low boundary that is less than the
minimum value, the low boundary is the minimum value.</p>
</dd>
<dt>The high boundary</dt>
<dd>
<p>If the <code title="attr-meter-high"><a href=
"#high">high</a></code> attribute is specified and a value could be
parsed out of it, then the high boundary is that value. Otherwise,
the high boundary is the same as the maximum value.</p>
<p>If the above results in a high boundary that is higher than the
maximum value, the high boundary is the maximum value.</p>
</dd>
<dt>The optimum point</dt>
<dd>
<p>If the <code title="attr-meter-optimum"><a href=
"#optimum">optimum</a></code> attribute is specified and a value
could be parsed out of it, then the optimum point is that value.
Otherwise, the optimum point is the midpoint between the minimum
value and the maximum value.</p>
<p>If the optimum point is then less than the minimum value, then
the optimum point is actually the same as the minimum value.
Similarly, if the optimum point is greater than the maximum value,
then it is actually the maximum value instead.</p>
</dd>
</dl>
<p>All of which should result in the following inequalities all
being true:</p>
<ul class="brief">
<li>minimum value ≤ actual value ≤ maximum value</li>
<li>minimum value ≤ low boundary ≤ high boundary ≤ maximum
value</li>
<li>minimum value ≤ optimum point ≤ maximum value</li>
</ul>
<p><strong>UA requirements for regions of the gauge</strong> : If
the optimum point is equal to the low boundary or the high
boundary, or anywhere in between them, then the region between the
low and high boundaries of the gauge must be treated as the optimum
region, and the low and high parts, if any, must be treated as
suboptimal. Otherwise, if the optimum point is less than the low
boundary, then the region between the minimum value and the low
boundary must be treated as the optimum region, the region between
the low boundary and the high boundary must be treated as a
suboptimal region, and the region between the high boundary and the
maximum value must be treated as an even less good region. Finally,
if the optimum point is higher than the high boundary, then the
situation is reversed; the region between the high boundary and the
maximum value must be treated as the optimum region, the region
between the high boundary and the low boundary must be treated as a
suboptimal region, and the remaining region between the low
boundary and the minimum value must be treated as an even less good
region.</p>
<p><strong>UA requirements for showing the gauge</strong> : When
representing a <code><a href="#meter">meter</a></code> element to
the user, the UA should indicate the relative position of the
actual value to the minimum and maximum values, and the
relationship between the actual value and the three regions of the
gauge.</p>
<div class="example">
<p>The following markup:</p>
<pre>
<h3>Suggested groups</h3>
<menu type="toolbar">
<a href="?cmd=hsg" onclick="hideSuggestedGroups()">Hide suggested groups</a>
</menu>
<ul>
<li>
<p><a href="/group/comp.infosystems.www.authoring.stylesheets/view">comp.infosystems.www.authoring.stylesheets</a> -
<a href="/group/comp.infosystems.www.authoring.stylesheets/subscribe">join</a></p>
<p>Group description: <strong>Layout/presentation on the WWW.</strong></p>
<p><strong><meter value="0.5">Moderate activity,</meter></strong> Usenet, 618 subscribers</p>
</li>
<li>
<p><a href="/group/netscape.public.mozilla.xpinstall/view">netscape.public.mozilla.xpinstall</a> -
<a href="/group/netscape.public.mozilla.xpinstall/subscribe">join</a></p>
<p>Group description: <strong>Mozilla XPInstall discussion.</strong></p>
<p><strong><meter value="0.25">Low activity,</meter></strong> Usenet, 22 subscribers</p>
</li>
<li>
<p><a href="/group/mozilla.dev.general/view">mozilla.dev.general</a> -
<a href="/group/mozilla.dev.general/subscribe">join</a></p>
<p><strong><meter value="0.25">Low activity,</meter></strong> Usenet, 66 subscribers</p>
</li>
</ul>
</pre>
<p>Might be rendered as follows:</p>
<p><img alt=
"With the <meter> elements rendered as inline green bars of varying lengths."
src="images/sample-meter.png"></p>
</div>
<p>User agents may combine the value of the <code title=
"attr-title"><a href="#title">title</a></code> attribute and the
other attributes to provide context-sensitive help or inline text
detailing the actual values.</p>
<div class="example">
<p>For example, the following snippet:</p>
<pre>
<meter
min=0
max=60
value=23.2
title=seconds>
</meter>
</pre>
<p>...might cause the user agent to display a gauge with a tooltip
saying "Value: 23.2 out of 60." on one line and "seconds" on a
second line.</p>
</div>
<p>The <dfn id="min0" title="dom-meter-min"><code>min</code></dfn>
, <dfn id="max2" title="dom-meter-max"><code>max</code></dfn> ,
<dfn id="value4" title="dom-meter-value"><code>value</code></dfn> ,
<dfn id="low0" title="dom-meter-low"><code>low</code></dfn> ,
<dfn id="high0" title="dom-meter-high"><code>high</code></dfn> ,
and <dfn id="optimum0" title=
"dom-meter-optimum"><code>optimum</code></dfn> DOM attributes must
<a href="#reflect">reflect</a> the elements' content attributes of
the same name. When the relevant content attributes are absent, the
DOM attributes must return zero. The value parsed from the
<code><a href="#textcontent">textContent</a></code> never affects
the DOM values.</p>
<p class="big-issue">Would be cool to have the <code title=
"dom-meter-value"><a href="#value4">value</a></code> DOM attribute
update the <code><a href="#textcontent">textContent</a></code>
in-line...</p>
<h4 id="the-code"><span class="secno"><del class=
"diff-old">3.12.13.</del> <ins class=
"diff-chg">3.10.13</ins></span> The <dfn id=
"code"><code>code</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd><del class="diff-old">None, but the title attribute has special
semantics on this element when used with the dfn element.</del>
<ins class="diff-chg">None.</ins></dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#code">code</a></code> element represents a
fragment of computer code. This could be an XML element name, a
filename, a computer program, or any other string that a computer
would <del class="diff-old">recognise.</del> <ins class=
"diff-chg">recognize.</ins></p>
<p>Although there is no formal way to indicate the language of
computer code being marked up, authors who wish to mark
<code><a href="#code">code</a></code> elements with the language
used, e.g. so that syntax highlighting scripts can use the right
rules, may do so by adding a class prefixed with " <code title=
"">language-</code> " to the element.</p>
<div class="example">
<p>The following example shows how <ins class="diff-new">the
element can be used in a paragraph to mark up element names and
computer code, including punctuation.</ins></p>
<pre>
<p>The <code>code</code> element represents a fragment of computer<ins class="diff-new">
code.</p>
<p>When you call the <code>activate()</code> method on the
<code>robotSnowman</code> object, the eyes glow.</p>
<p>The example below uses the <code>begin</code> keyword to indicate
the start of a statement block. It is paired with an <code>end</code>
keyword, which is followed by the <code>.</code> punctuation character
(full
stop)
to
indicate
the
end
of
the
program.</p>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-new">The following example shows how</ins> a
block of code could be marked up using the <code><a href=
"#pre">pre</a></code> and <code><a href="#code">code</a></code>
elements.</p>
<pre>
<pre><code class="language-pascal">var i: Integer;
begin
i := 1;
end.</code>
</pre>
</pre>
<p>A class is used in that example to indicate the language
used.</p>
</div>
<p class="note">See the <code><a href="#pre">pre</a></code> element
for more <del class="diff-old">detais.</del> <ins class=
"diff-chg">details.</ins></p>
<h4 id="the-var"><span class="secno"><del class=
"diff-old">3.12.14.</del> <ins class=
"diff-chg">3.10.14</ins></span> The <dfn id=
"var"><code>var</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd><del class="diff-old">None, but the title attribute has special
semantics on this element when used with the dfn element.</del>
<ins class="diff-chg">None.</ins></dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#var">var</a></code> element represents a
variable. This could be an actual variable in a mathematical
expression or programming context, or it could just be a term used
as a placeholder in prose.</p>
<div class="example">
<p>In the paragraph below, the letter "n" is being used as a
variable in prose:</p>
<pre>
<p>If there are <var>n</var> pipes leading to the ice
cream factory then I expect at <em>least</em> <var>n</var>
flavours
of
ice
cream
to
be
available
for
purchase!</p>
</pre></div>
<h4 id="the-samp"><span class="secno"><del class=
"diff-old">3.12.15.</del> <ins class=
"diff-chg">3.10.15</ins></span> The <dfn id=
"samp"><code>samp</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd><del class="diff-old">None, but the title attribute has special
semantics on this element when used with the dfn element.</del>
<ins class="diff-chg">None.</ins></dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#samp">samp</a></code> element represents
(sample) output from a program or computing system.</p>
<p class="note">See the <code><a href="#pre">pre</a></code> and
<code><a href="#kbd">kbd</a></code> elements for more <del class=
"diff-old">detais.</del> <ins class="diff-chg">details.</ins></p>
<div class="example">
<p>This example shows the <code><a href="#samp">samp</a></code>
element being used inline:</p>
<pre>
<p>The computer said <samp>Too much cheese in tray
two</samp>
but
I
didn't
know
what
that
meant.</p>
</pre>
<p>This second example shows a block of sample output. Nested
<code><a href="#samp">samp</a></code> and <code><a href=
"#kbd">kbd</a></code> elements allow for the styling of specific
elements of the sample output using a style sheet.</p>
<pre>
<pre><samp><samp class="prompt">jdoe@mowmow:~$</samp> <kbd>ssh demo.example.com</kbd>
Last login: Tue Apr 12 09:10:17 2005 from mowmow.example.com on pts/1
Linux demo 2.6.10-grsec+gg3+e+fhs6b+nfs+gr0501+++p3+c4a+gr2b-reslog-v6.189 #1 SMP Tue Feb 1 11:22:36 PST 2005 i686 unknown
<samp
class="prompt">
jdoe@demo:~$</samp>
<samp
class="cursor">
_</samp>
</samp>
</pre>
</pre></div>
<h4 id="the-kbd"><span class="secno"><del class=
"diff-old">3.12.16.</del> <ins class=
"diff-chg">3.10.16</ins></span> The <dfn id=
"kbd"><code>kbd</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#kbd">kbd</a></code> element represents user
input (typically keyboard input, although it may also be used to
represent other input, such as voice commands).</p>
<p>When the <code><a href="#kbd">kbd</a></code> element is nested
inside a <code><a href="#samp">samp</a></code> element, it
represents the input as it was echoed by the system.</p>
<p>When the <code><a href="#kbd">kbd</a></code> element
<em>contains</em> a <code><a href="#samp">samp</a></code> element,
it represents input based on system output, for example invoking a
menu item.</p>
<p>When the <code><a href="#kbd">kbd</a></code> element is nested
inside another <code><a href="#kbd">kbd</a></code> element, it
represents an actual key or other single unit of input as
appropriate for the input mechanism.</p>
<div class="example">
<p>Here the <code><a href="#kbd">kbd</a></code> element is used to
indicate keys to press:</p>
<pre>
<p>
To
make
George
eat
an
apple,
press
<kbd>
<kbd>
Shift</kbd>
+<kbd>
F3</kbd>
</kbd>
</p>
</pre>
<p>In this second example, the user is told to pick a particular
menu item. The outer <code><a href="#kbd">kbd</a></code> element
marks up a block of input, with the inner <code><a href=
"#kbd">kbd</a></code> elements representing each individual step of
the input, and the <code><a href="#samp">samp</a></code> elements
inside them indicating that the steps are input based on something
being displayed by the system, in this case menu labels:</p>
<pre>
<p>To make George eat an apple, select
<kbd><kbd><samp>File</samp></kbd>|<kbd><samp>Eat Apple...</samp></kbd></kbd>
</p>
</pre></div>
<h4 id="the-sub"><span class="secno"><del class=
"diff-old">3.12.17.</del> <ins class=
"diff-chg">3.10.17</ins></span> The <dfn id=
"sub"><code>sub</code></dfn> and <dfn id=
"sup"><code>sup</code></dfn> elements</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which these elements may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#sup">sup</a></code> element represents a
superscript and the <code><a href="#sub">sub</a></code> element
represents a subscript.</p>
<p>These elements must <del class="diff-old">only</del> be used
<ins class="diff-new">only</ins> to mark up typographical
conventions with specific meanings, not for typographical
presentation for presentation's sake. For example, it would be
inappropriate for the <code><a href="#sub">sub</a></code> and
<code><a href="#sup">sup</a></code> elements to be used in the name
of the LaTeX document preparation system. In general, authors
should <del class="diff-old">only</del> use these elements
<ins class="diff-new">only</ins> if the <em>absence</em> of those
elements would change the meaning of the content.</p>
<p>When the <code><a href="#sub">sub</a></code> element is used
inside a <code><a href="#var">var</a></code> element, it represents
the subscript that identifies the variable in a family of
variables.</p>
<div class="example">
<pre>
<p>The coordinate of the <var>i</var>th point is
(<var>x<sub><var>i</var></sub></var>, <var>y<sub><var>i</var></sub></var>).
For example, the 10th point has coordinate
(<var>
x<sub>
10</sub>
</var>,
<var>
y<sub>
10</sub>
</var>
).</p>
</pre></div>
<p>In certain languages, superscripts are part of the typographical
conventions for some abbreviations.</p>
<div class="example">
<pre>
<p>The most beautiful women are
<span lang="fr"><abbr>M<sup>lle</sup></abbr> Gwendoline</span> and
<span
lang="fr">
<abbr>
M<sup>
me</sup>
</abbr>
Denise</span>.</p>
</pre></div>
<p>Mathematical expressions often use subscripts and superscripts.
<ins class="diff-chg">Authors are encouraged to use MathML for
marking up mathematics, but authors may opt to use</ins>
<code><a href="#sub"><ins class="diff-chg">sub</ins></a></code>
<ins class="diff-chg">and</ins> <code><a href="#sup"><ins class=
"diff-chg">sup</ins></a></code> <ins class="diff-chg">if detailed
mathematical markup is not desired.</ins> <a href=
"#references"><ins class="diff-chg">[MathML]</ins></a></p>
<div class="example">
<pre>
<var>
E</var>
=<var>
m</var>
<var>
c</var>
<sup>
2</sup>
</pre>
<pre>
f(<var>
x</var>,
<var>
n</var>
)
=
log<sub>
4</sub>
<var>
x</var>
<sup>
<var>
n</var>
</sup>
</pre></div>
<h4 id="the-span"><span class="secno"><del class=
"diff-old">3.12.18.</del> <ins class=
"diff-chg">3.10.18</ins></span> The <dfn id=
"span"><code>span</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd><del class="diff-old">None, but the title attribute has special
semantics on this element when used with the dfn element.</del>
<ins class="diff-chg">None.</ins></dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#span">span</a></code> element doesn't mean
anything on its own, but can be useful when used together with
other attributes, e.g. <code title="attr-class"><a href=
"#class">class</a></code> , <code title="attr-lang"><a href=
"#lang">lang</a></code> , or <code title="attr-dir"><a href=
"#dir">dir</a> <del class="diff-old">, or when used in conjunction
with the dfn element.</del></code> .</p>
<h4 id="the-i"><span class="secno"><del class=
"diff-old">3.12.19.</del> <ins class=
"diff-chg">3.10.19</ins></span> The <dfn id=
"i"><code>i</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd><del class="diff-old">None, but the title attribute has special
semantics on this element when used with the dfn element.</del>
<ins class="diff-chg">None.</ins></dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#i">i</a></code> element represents a span of
text in an alternate voice or mood, or otherwise offset from the
normal prose, such as a taxonomic designation, a technical term, an
idiomatic phrase from another language, a thought, a ship name, or
some other prose whose typical typographic presentation is
italicized.</p>
<p>Terms in languages different from the main text should be
annotated with <code title="attr-lang"><a href=
"#lang">lang</a></code> attributes ( <code title=
"attr-xml-lang"><a href="#xmllang">xml:lang</a></code> in XML).</p>
<div class="example">
<p>The examples below show uses of the <code><a href=
"#i">i</a></code> element:</p>
<del class="diff-old"></del>
<pre>
<p>The <i class="taxonomy">Felis silvestris catus</i> is cute.</p>
<p>The term <i>prose content</i> is defined above.</p>
<p>
There
is
a
certain
<i
lang="fr">
je
ne
sais
quoi</i>
in
the
air.</p>
</pre>
<p>In the following example, a dream sequence is marked up using
<code><a href="#i">i</a></code> elements.</p>
<pre>
<p>Raymond tried to sleep.</p>
<p><i>The ship sailed away on Thursday</i>, he
dreamt. <i>The ship had many people aboard, including a beautiful
princess called Carey. He watched her, day-in, day-out, hoping she
would notice him, but she never did.</i></p>
<p><i>Finally one night he picked up the courage to speak with
her—</i></p>
<p>
Raymond
woke
with
a
start
as
the
fire
alarm
rang
out.</p>
</pre></div>
<p>The <code><a href="#i">i</a></code> element should be used as a
last resort when no other element is more appropriate. In
particular, citations should use the <code><a href=
"#cite2">cite</a></code> element, defining instances of terms
should use the <code><a href="#dfn">dfn</a></code> element, stress
emphasis should use the <code><a href="#em">em</a></code> element,
importance should be denoted with the <code><a href=
"#strong">strong</a></code> element, quotes should be marked up
with the <code><a href="#q">q</a></code> element, and small print
should use the <code><a href="#small">small</a></code> element.</p>
<p><ins class="diff-new">Authors are encouraged to use the</ins>
<code title="attr-class"><a href="#class"><ins class=
"diff-new">class</ins></a></code> <ins class="diff-new">attribute
on the</ins> <code><a href="#i"><ins class=
"diff-new">i</ins></a></code> <ins class="diff-new">element to
identify why the element is being used, so that if the style of a
particular use (e.g. dream sequences as opposed to taxonomic terms)
is to be changed at a later date, the author doesn't have to go
through the entire document (or series of related documents)
annotating each use.</ins></p>
<p class="note">Style sheets can be used to format <code><a href=
"#i">i</a></code> elements, just like any other element can be
restyled. Thus, it is not the case that content in <code><a href=
"#i">i</a></code> elements will necessarily be <del class=
"diff-old">italicised.</del> <ins class=
"diff-chg">italicized.</ins></p>
<h4 id="the-b"><span class="secno"><del class=
"diff-old">3.12.20.</del> <ins class=
"diff-chg">3.10.20</ins></span> The <dfn id=
"b"><code>b</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#b">b</a></code> element represents a span of
text to be stylistically offset from the normal prose without
conveying any extra importance, such as key words in a document
abstract, product names in a review, or other spans of text whose
typical typographic presentation is boldened.</p>
<div class="example">
<p>The following example shows a use of the <code><a href=
"#b">b</a></code> element to highlight key words without marking
them up as important:</p>
<pre>
<p>
The
<b>
frobonitor</b>
and
<b>
barbinator</b>
components
are
fried.</p>
</pre></div>
<div class="example">
<p><del class="diff-old">The following would be incorrect usage:
<p> <b> WARNING!</b> Do not frob the
barbinator!</p> In the previous example, the correct element
to use would have been strong , not b .</del> In the following
example, objects in a text adventure are highlighted as being
special by use of the <code><a href="#b">b</a></code> element.</p>
<pre>
<p>You enter a small room. Your <b>sword</b> glows
brighter.
A
<b>
rat</b>
scurries
past
the
corner
wall.</p>
</pre></div>
<div class="example">
<p>Another case where the <code><a href="#b">b</a></code> element
is appropriate is in marking up the lede (or lead) sentence or
paragraph. The following example shows how a <a href=
"http://news.bbc.co.uk/2/hi/uk_news/scotland/north_east/7101506.stm">
BBC article about kittens adopting a rabbit as their own</a> could
be marked up using HTML5 elements:</p>
<pre>
<article>
<h2>Kittens 'adopted' by pet rabbit</h2>
<p><b>Six abandoned kittens have found an unexpected new
mother figure — a pet rabbit.</b></p>
<p>Veterinary nurse Melanie Humble took the three-week-old
kittens to her Aberdeen home.</p>
<i>
[...]
</i>
</pre></div>
<p>The <code><a href="#b">b</a></code> element should be used as a
last resort when no other element is more appropriate. In
particular, headers should use the <code><a href=
"#h1">h1</a></code> to <code><a href="#h6">h6</a></code> elements,
stress emphasis should use the <code><a href="#em">em</a></code>
element, importance should be denoted with the <code><a href=
"#strong">strong</a></code> element, and text marked or highlighted
should use the <code><del class="diff-old">m</del> <a href=
"#mark"><ins class="diff-chg">mark</ins></a></code> element.</p>
<div class="example">
<p><ins class="diff-new">The following would be</ins>
<em><ins class="diff-new">incorrect</ins></em> <ins class=
"diff-new">usage:</ins></p>
<pre>
<ins class="diff-new">
<p>
<b>
WARNING!</b>
Do
not
frob
the
barbinator!</p>
</ins>
</pre>
<p><ins class="diff-new">In the previous example, the correct
element to use would have been</ins> <code><a href=
"#strong"><ins class="diff-new">strong</ins></a></code>
,<ins class="diff-new">not</ins> <code><a href="#b"><ins class=
"diff-new">b</ins></a></code> .</p>
</div>
<p class="note">Style sheets can be used to format <code><a href=
"#b">b</a></code> elements, just like any other element can be
restyled. Thus, it is not the case that content in <code><a href=
"#b">b</a></code> elements will necessarily be boldened.</p>
<h4 id="the-bdo"><span class="secno"><del class=
"diff-old">3.12.21.</del> <ins class=
"diff-chg">3.10.21</ins></span> The <dfn id=
"bdo"><code>bdo</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd>None, but the <code title="attr-dir"><a href=
"#dir">dir</a></code> global attribute has special requirements on
this element.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#bdo">bdo</a></code> element allows authors
to override the Unicode bidi algorithm by explicitly specifying a
direction override. <a href="#references">[BIDI]</a></p>
<p>Authors must specify the <code title="attr-dir"><a href=
"#dir">dir</a></code> attribute on this element, with the value
<code>ltr</code> to specify a left-to-right override and with the
value <code>rtl</code> to specify a right-to-left override.</p>
<p>If the element has the <code title="attr-dir"><a href=
"#dir">dir</a></code> attribute set to the exact value
<code>ltr</code> , then for the purposes of the bidi algorithm, the
user agent must act as if there was a U+202D LEFT-TO-RIGHT OVERRIDE
character at the start of the element, and a U+202C POP DIRECTIONAL
FORMATTING at the end of the element.</p>
<p>If the element has the <code title="attr-dir"><a href=
"#dir">dir</a></code> attribute set to the exact value
<code>rtl</code> , then for the purposes of the bidi algorithm, the
user agent must act as if there was a U+202E RIGHT-TO-LEFT OVERRIDE
character at the start of the element, and a U+202C POP DIRECTIONAL
FORMATTING at the end of the element.</p>
<p>The requirements on handling the <code><a href=
"#bdo">bdo</a></code> element for the bidi algorithm may be
implemented indirectly through the style layer. For example, an
HTML+CSS user agent should implement these requirements by
implementing the CSS <code>unicode-bidi</code> property. <a href=
"#references">[CSS21]</a></p>
<h4 id="the-ruby"><span class="secno"><del class=
"diff-old">3.13.</del> <ins class="diff-chg">3.10.22</ins></span>
<del class="diff-old">Edits</del> The <dfn id=
"ruby"><code><ins class="diff-new">ruby</ins></code> <del class=
"diff-old">ins</del></dfn> <ins class="diff-chg">element</ins></h4>
<dl class="element">
<dt><ins class="diff-chg">Categories</ins></dt>
<dd><a href="#phrasing0"><ins class="diff-chg">Phrasing
content</ins></a> .</dd>
<dt><ins class="diff-chg">Contexts in which this element may be
used:</ins></dt>
<dd><ins class="diff-chg">Where</ins> <a href=
"#phrasing0"><ins class="diff-chg">phrasing content</ins></a>
<ins class="diff-chg">is expected.</ins></dd>
<dt><ins class="diff-chg">Content model:</ins></dt>
<dd><ins class="diff-chg">One or more groups of:</ins> <a href=
"#phrasing0"><ins class="diff-chg">phrasing content</ins></a>
<ins class="diff-chg">followed either by a single</ins>
<code><a href="#rt"><ins class="diff-chg">rt</ins></a></code>
<ins class="diff-chg">element, or an</ins> <code><a href=
"#rp"><ins class="diff-chg">rp</ins></a></code> <ins class=
"diff-chg">element, an</ins> <code><a href="#rt"><ins class=
"diff-chg">rt</ins></a></code> <ins class="diff-new">element,</ins>
and <ins class="diff-new">another</ins> <code><del class=
"diff-old">del</del> <a href="#rp"><ins class=
"diff-chg">rp</ins></a></code> <del class="diff-old">elements
represent edits</del> <ins class="diff-chg">element.</ins></dd>
<dt><ins class="diff-chg">Element-specific attributes:</ins></dt>
<dd><ins class="diff-chg">None.</ins></dd>
<dt><ins class="diff-chg">DOM interface:</ins></dt>
<dd><ins class="diff-chg">Uses</ins> <code><a href=
"#htmlelement"><ins class="diff-chg">HTMLElement</ins></a></code>
.</dd>
</dl>
<p><ins class="diff-chg">The</ins> <code><a href=
"#ruby"><ins class="diff-chg">ruby</ins></a></code> <ins class=
"diff-chg">element allows one or more spans of phrasing
content</ins> to <del class="diff-old">the document.</del>
<ins class="diff-chg">be marked with ruby annotations.</ins></p>
<p><del class="diff-old">Since</del> <ins class="diff-chg">A</ins>
<code><a href="#ruby"><ins class="diff-chg">ruby</ins></a></code>
<ins class="diff-chg">element represents the spans of phrasing
content it contains, ignoring all</ins> the <ins class=
"diff-new">child</ins> <code><del class="diff-old">ins</del>
<a href="#rt"><ins class="diff-chg">rt</ins></a></code> and
<code><del class="diff-old">del</del> <a href="#rp"><ins class=
"diff-chg">rp</ins></a></code> elements <del class="diff-old">do
not affect paragraphing , it</del> <ins class="diff-chg">and their
descendants. Those spans of phrasing content have associated
annotations created using the</ins> <code><a href="#rt"><ins class=
"diff-chg">rt</ins></a></code> <ins class=
"diff-chg">element.</ins></p>
<div class="example">
<p><ins class="diff-chg">In this example, each ideograph in the
text</ins> <span lang="ja"><ins class="diff-chg">斎藤信男</ins></span>
is <del class="diff-old">possible,</del> <ins class=
"diff-chg">annotated with its reading.</ins></p>
<pre lang="ja">
... <ruby><ins class="diff-chg">
斎 <rt> さい </rt>
藤 <rt> とう </rt>
信 <rt> のぶ </rt>
男 <rt> お </rt>
</ruby>
...
</ins>
</pre>
<p><ins class="diff-chg">This might be rendered as:</ins></p>
<p><img alt=
"The four main ideographs, each with its reading annotation rendered in a smaller font above it."
src="images/sample-ruby.png"></p>
</div>
<h4 id="the-rt"><span class="secno"><ins class=
"diff-chg">3.10.23</ins></span> <ins class="diff-chg">The</ins>
<dfn id="rt"><code><ins class="diff-chg">rt</ins></code></dfn>
<ins class="diff-chg">element</ins></h4>
<dl class="element">
<dt><ins class="diff-chg">Categories</ins></dt>
<dd><ins class="diff-chg">None.</ins></dd>
<dt><ins class="diff-chg">Contexts</ins> in <del class=
"diff-old">some cases where paragraphs are implied</del>
<ins class="diff-chg">which this element may be used:</ins></dt>
<dd><ins class="diff-chg">As a child of a</ins> <code><a href=
"#ruby"><ins class="diff-chg">ruby</ins></a> <del class=
"diff-old">(without explicit</del></code> <ins class=
"diff-chg">element.</ins></dd>
<dt><ins class="diff-chg">Content model:</ins></dt>
<dd><a href="#phrasing0"><ins class="diff-chg">Phrasing
content</ins></a> .</dd>
<dt><ins class="diff-chg">Element-specific attributes:</ins></dt>
<dd><ins class="diff-chg">None.</ins></dd>
<dt><ins class="diff-chg">DOM interface:</ins></dt>
<dd><ins class="diff-chg">Uses</ins> <code><del class=
"diff-old">p</del> <a href="#htmlelement"><ins class=
"diff-chg">HTMLElement</ins></a></code> .</dd>
</dl>
<p><ins class="diff-chg">The</ins> <code><a href="#rt"><ins class=
"diff-chg">rt</ins></a></code> <del class="diff-old">elements), for
an</del> <ins class="diff-chg">element marks the ruby text
component of a ruby annotation.</ins></p>
<p><ins class="diff-chg">An</ins> <code><del class=
"diff-old">ins</del> <a href="#rt"><ins class=
"diff-chg">rt</ins></a></code> <del class="diff-old">or</del>
<ins class="diff-chg">element that is a child of a</ins>
<code><del class="diff-old">del</del> <a href="#ruby"><ins class=
"diff-chg">ruby</ins></a></code> element <del class="diff-old">to
span both</del> <ins class="diff-chg">represents</ins> an
<del class="diff-old">entire paragraph</del> <ins class=
"diff-chg">annotation (given by its children) for the zero</ins> or
<del class="diff-old">other non-</del> <ins class="diff-chg">more
nodes of</ins> phrasing content <ins class="diff-new">that
immediately precedes it in the</ins> <code><a href=
"#ruby"><ins class="diff-new">ruby</ins></a> <del class=
"diff-old">elements and part of another paragraph. For example:
<ins> <p> This is a paragraph that was inserted.
</p> This is another paragraph whose first sentence was
inserted at the same time as the paragraph above. </ins> This
is a second sentence, which was there all along.
</section></del></code> <ins class="diff-chg">element,
ignoring</ins> <code><a href="#rp"><ins class=
"diff-chg">rp</ins></a></code> <ins class=
"diff-chg">elements.</ins></p>
<p><del class="diff-old">By only wrapping some paragraphs in</del>
<ins class="diff-chg">An</ins> <code><del class="diff-old">p</del>
<a href="#rt"><ins class="diff-chg">rt</ins></a></code> <del class=
"diff-old">elements, one can even get the end of one
paragraph,</del> <ins class="diff-chg">element that is not</ins> a
<del class="diff-old">whole second paragraph, and the start</del>
<ins class="diff-chg">child</ins> of a <del class="diff-old">third
paragraph to be covered by</del> <code><a href="#ruby"><ins class=
"diff-chg">ruby</ins></a></code> <ins class="diff-chg">element
represents</ins> the same <ins class="diff-new">thing as its
children.</ins></p>
<h4 id="the-rp"><span class="secno"><ins class=
"diff-new">3.10.24</ins></span> <ins class="diff-new">The</ins>
<dfn id="rp"><code><ins class="diff-new">rp</ins></code>
<del class="diff-old">ins</del></dfn> <ins class=
"diff-chg">element</ins></h4>
<dl class="element">
<dt><ins class="diff-chg">Categories</ins></dt>
<dd><ins class="diff-chg">None.</ins></dd>
<dt><ins class="diff-chg">Contexts in which this element may be
used:</ins></dt>
<dd><ins class="diff-chg">As a child of a</ins> <code><a href=
"#ruby"><ins class="diff-chg">ruby</ins></a></code> <ins class=
"diff-new">element, either immediately before</ins> or <ins class=
"diff-new">immediately after an</ins> <code><del class=
"diff-old">del</del> <a href="#rt"><ins class=
"diff-chg">rt</ins></a></code> <ins class=
"diff-chg">element.</ins></dd>
<dt><ins class="diff-chg">Content model:</ins></dt>
<dd><ins class="diff-chg">If the</ins> <code><a href=
"#rp"><ins class="diff-chg">rp</ins></a></code> element <del class=
"diff-old">(though this</del> is <del class="diff-old">very
confusing, and not considered good practice): This is the first
paragraph. <ins>This sentence was inserted. <p>This
second paragraph was inserted.</p> This sentence was inserted
too.</ins> This is the third paragraph in this
example.</p> </section></del> <ins class=
"diff-chg">immediately after an</ins> <code><a href=
"#rt"><ins class="diff-chg">rt</ins></a></code> <ins class=
"diff-chg">element that is immediately preceded by another</ins>
<code><a href="#rp"><ins class="diff-chg">rp</ins></a></code>
<ins class="diff-chg">element: a single character from Unicode
character class Pe.</ins></dd>
<dd><ins class="diff-chg">Otherwise: a single character from
Unicode character class Ps.</ins></dd>
<dt><ins class="diff-chg">Element-specific attributes:</ins></dt>
<dd><ins class="diff-chg">None.</ins></dd>
<dt><ins class="diff-chg">DOM interface:</ins></dt>
<dd><ins class="diff-chg">Uses</ins> <code><a href=
"#htmlelement"><ins class="diff-chg">HTMLElement</ins></a></code>
.</dd>
</dl>
<p><del class="diff-old">However, due</del> <ins class=
"diff-chg">The</ins> <code><a href="#rp"><ins class=
"diff-chg">rp</ins></a></code> <ins class="diff-chg">element can be
used</ins> to <del class="diff-old">the way implied
paragraphs</del> <ins class="diff-chg">provide parentheses around a
ruby text component of a ruby annotation, to be shown by user
agents that don't support ruby annotations.</ins></p>
<p><ins class="diff-chg">An</ins> <code><a href="#rp"><ins class=
"diff-chg">rp</ins></a> <del class="diff-old">are defined,
it</del></code> <ins class="diff-chg">element that</ins> is
<del class="diff-old">not possible to mark up the end</del>
<ins class="diff-chg">a child</ins> of <del class="diff-old">one
paragraph</del> <ins class="diff-chg">a</ins> <code><a href=
"#ruby"><ins class="diff-chg">ruby</ins></a></code> <ins class=
"diff-chg">element represents nothing</ins> and <del class=
"diff-old">the start of the very next one using the same</del>
<ins class="diff-chg">it and its contents must be ignored. An</ins>
<code><del class="diff-old">ins</del> <a href="#rp"><ins class=
"diff-chg">rp</ins></a></code> <del class="diff-old">or</del>
<ins class="diff-chg">element whose parent element is not a</ins>
<code><del class="diff-old">del</del> <a href="#ruby"><ins class=
"diff-chg">ruby</ins></a></code> <del class="diff-old">element. You
instead have</del> <ins class="diff-chg">element represents the
same thing as its children.</ins></p>
<div class="example">
<p><ins class="diff-chg">The example above, in which each ideograph
in the text</ins> <span lang="ja"><ins class=
"diff-chg">斎藤信男</ins></span> <ins class="diff-chg">is annotated
with its reading, could be expanded</ins> to use <del class=
"diff-old">one (or two)</del> <code><del class="diff-old">p</del>
<a href="#rp"><ins class="diff-chg">rp</ins></a></code> <del class=
"diff-old">element(s) and two</del> <ins class="diff-chg">so that
in legacy user agentthe readings are in parentheses:</ins></p>
<pre lang="ja">
... <ruby><ins class="diff-chg">
斎 <rp>(</rp><rt>さい</rt><rp>)</rp>
藤 <rp>(</rp><rt>とう</rt><rp>)</rp>
信 <rp>(</rp><rt>のぶ</rt><rp>)</rp>
男 <rp>(</rp><rt>お</rt><rp>)</rp>
</ruby>
...
</ins>
</pre>
<p><ins class="diff-chg">In conforming user agents the rendering
would be as above, but in user agents that do not support ruby, the
rendering would be:</ins></p>
<pre ins="" class="diff-chg">
lang=ja>...
斎
(さい)
藤
(とう)
信
(のぶ)
男
(お)
...
</pre></div>
<h4 id="usage"><del class="diff-old">ins</del> <span class=
"secno"><ins class="diff-chg">3.10.25</ins></span> <ins class=
"diff-chg">Usage summary</ins></h4>
<p class="big-issue"><ins class="diff-chg">We need to summarize the
various elements, in particular to distinguish
b/i/em/strong/var/q/mark/cite.</ins></p>
<h4 id="footnotes"><span class="secno"><ins class=
"diff-chg">3.10.26</ins></span> <ins class=
"diff-chg">Footnotes</ins></h4>
<p><ins class="diff-chg">HTML does not have a dedicated mechanism
for marking up footnotes. Here are the recommended
alternatives.</ins></p>
<p><ins class="diff-chg">For short inline annotations, the</ins>
<code title="attr-title"><a href="#title"><ins class=
"diff-chg">title</ins></a></code> <del class="diff-old">or</del>
<ins class="diff-chg">attribute should be used.</ins></p>
<div class="example">
<p><ins class="diff-chg">In this example, two parts of a dialog are
annotated.</ins></p>
<pre>
<dialog><ins class="diff-chg">
<dt>Customer
<dd>Hello! I wish to register a complaint. Hello. Miss?
<dt>Shopkeeper
<dd><span title="Colloquial pronunciation of 'What do you'"
>Watcha</span> mean, miss?
<dt>Customer
<dd>Uh, I'm sorry, I have a cold. I wish to make a complaint.
<dt>Shopkeeper
<dd>Sorry, <span title="This is, of course, a lie.">we're
closing for lunch</span>.
</dialog>
</ins>
</pre></div>
<p><ins class="diff-chg">For longer annotations, the</ins>
<code><del class="diff-old">del</del> <a href="#a"><ins class=
"diff-chg">a</ins></a></code> <del class="diff-old">elements:</del>
<ins class="diff-chg">element should be used, pointing to an
element later in the document. The convention is that the contents
of the link be a number in square brackets.</ins></p>
<div class="example">
<p><del class="diff-old">For example:</del> <ins class=
"diff-chg">In this example, a footnote in the dialog links to a
paragraph below the dialog. The paragraph then reciprocally links
back to the dialog, allowing the user to return to the location of
the footnote.</ins></p>
<del class="diff-old"><p>This is the first paragraph.
<del>This sentence was deleted.</p>
<p><del>This sentence was deleted too.</del> That
sentence needed a separate &lt;del> element.</p></del>
<pre>
<dialog>
<ins class="diff-chg"> <dt>Announcer
<dd>Number 16: The <i>hand</i>.
<dt>Interviewer
<dd>Good evening. I have with me in the studio tonight Mr
Norman St John Polevaulter, who for the past few years has
been contradicting people. Mr Polevaulter, why <em>do</em>
you contradict people?
<dt>Norman
<dd>I don't. <a href="#fn1" id="r1">[1]</a>
<dt>Interviewer
<dd>You told me you did!
</dialog>
<section>
<p id="fn1"><a href="#r1">[1]</a> This is, naturally, a lie,
but paradoxically if it were true he could not say so without
contradicting the interviewer and thus making it false.</p>
</ins>
</section>
</pre></div>
<p><del class="diff-old">Partly because</del> <ins class=
"diff-chg">For side notes, longer annotations that apply to entire
sections</ins> of the <del class="diff-old">confusion described
above, authors are strongly recommended to always mark up all
paragraphs with</del> <ins class="diff-chg">text rather than just
specific words or sentences,</ins> the <code><del class=
"diff-old">p</del> <a href="#aside"><ins class=
"diff-chg">aside</ins></a></code> <del class="diff-old">element,
and</del> <ins class="diff-chg">element should be used.</ins></p>
<div class="example">
<p><ins class="diff-chg">In this example, a sidebar is given after
a dialog, giving some context</ins> to <del class="diff-old">not
have any</del> <ins class="diff-chg">the dialog.</ins></p>
<pre>
<dialog><ins class="diff-chg">
<dt>Customer
<dd>I will not buy this record, it is scratched.
<dt>Shopkeeper
<dd>I'm sorry?
<dt>Customer
<dd>I will not buy this record, it is scratched.
<dt>Shopkeeper
<dd>No no no, this's'a tobacconist's.
</dialog>
<aside>
<p>In 1970, the British Empire lay in ruins, and foreign
nationalists frequented the streets — many of them Hungarians
(not the streets — the foreign nationals). Sadly, Alexander
Yalt has been publishing incompetently-written phrase books.
</aside>
</ins>
</pre></div>
<h3 id="edits"><span class="secno"><ins class=
"diff-chg">3.11</ins></span> <ins class="diff-chg">Edits</ins></h3>
<p><ins class="diff-chg">The</ins> <code><a href=
"#ins">ins</a></code> <del class="diff-old">or</del> <ins class=
"diff-chg">and</ins> <code><a href="#del">del</a></code> elements
<del class="diff-old">that cross across any implied paragraphs
.</del> <ins class="diff-chg">represent edits to the
document.</ins></p>
<h4 id="the-ins"><span class="secno"><del class=
"diff-old">3.13.1.</del> <ins class="diff-chg">3.11.1</ins></span>
The <dfn id="ins"><code>ins</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>When the element only contains <a href="#phrasing0">phrasing
content</a> : <a href="#phrasing0">phrasing content</a> .</dd>
<dd>Otherwise: <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a>
.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>When the element only contains <a href="#phrasing0">phrasing
content</a> : where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dd>Otherwise: where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#transparent0">Transparent</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-mod-cite"><a href=
"#cite3">cite</a></code></dd>
<dd><code title="attr-mod-datetime"><a href=
"#datetime1">datetime</a></code></dd>
<dt>DOM interface:</dt>
<dd>Uses the <code><a href=
"#htmlmodelement">HTMLModElement</a></code> interface.</dd>
</dl>
<p>The <code><a href="#ins">ins</a></code> element represents an
addition to the document.</p>
<div class="example">
<p>The following represents the addition of a single paragraph:</p>
<pre>
<aside>
<ins>
<p> I like fruit. </p>
</ins>
</aside>
</pre>
<p>As does this, because everything in the <code><a href=
"#aside">aside</a></code> element here counts as <a href=
"#phrasing0">phrasing content</a> and therefore there is just one
<a href="#paragraph">paragraph</a> :</p>
<pre>
<aside>
<ins>
Apples are <em>tasty</em>.
</ins>
<ins>
So are pears.
</ins>
</aside>
</pre></div>
<p><code><a href="#ins">ins</a></code> elements should not cross
<a href="#paragraph" title="paragraph">implied paragraph</a>
boundaries.</p>
<div class="example">
<p>The following example represents the addition of two paragraphs,
the second of which was inserted in two parts. The first
<code><a href="#ins">ins</a></code> element in this example thus
crosses a paragraph boundary, which is considered poor form.</p>
<pre>
<aside>
<ins datetime="2005-03-16T00:00Z">
<p> I like fruit. </p>
Apples are <em>tasty</em>.
</ins>
<ins datetime="2007-12-19T00:00Z">
So are pears.
</ins>
</aside>
</pre>
<p>Here is a better way of marking this up. It uses more elements,
but none of the elements cross implied paragraph boundaries.</p>
<pre>
<aside>
<ins datetime="2005-03-16T00:00Z">
<p> I like fruit. </p>
</ins>
<ins datetime="2005-03-16T00:00Z">
Apples are <em>tasty</em>.
</ins>
<ins datetime="2007-12-19T00:00Z">
So are pears.
</ins>
</aside>
</pre></div>
<h4 id="the-del"><span class="secno"><del class=
"diff-old">3.13.2.</del> <ins class="diff-chg">3.11.2</ins></span>
The <dfn id="del"><code>del</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>When the element only contains <a href="#phrasing0">phrasing
content</a> : <a href="#phrasing0">phrasing content</a> .</dd>
<dd>Otherwise: <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a>
.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>When the element only contains <a href="#phrasing0">phrasing
content</a> : where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dd>Otherwise: where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#transparent0">Transparent</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-mod-cite"><a href=
"#cite3">cite</a></code></dd>
<dd><code title="attr-mod-datetime"><a href=
"#datetime1">datetime</a></code></dd>
<dt>DOM interface:</dt>
<dd>Uses the <code><a href=
"#htmlmodelement">HTMLModElement</a></code> interface.</dd>
</dl>
<p>The <code><a href="#del">del</a></code> element represents a
removal from the document.</p>
<p><code><a href="#del">del</a></code> elements should not cross
<a href="#paragraph" title="paragraph">implied paragraph</a>
boundaries.</p>
<h4 id="attributes"><span class="secno"><del class=
"diff-old">3.13.3.</del> <ins class="diff-chg">3.11.3</ins></span>
Attributes common to <code><a href="#ins">ins</a></code> and
<code><a href="#del">del</a></code> elements</h4>
<p>The <dfn id="cite3" title=
"attr-mod-cite"><code>cite</code></dfn> attribute may be used to
specify a URI that explains the change. When that document is long,
for instance the minutes of a meeting, authors are encouraged to
include a fragment identifier pointing to the specific part of that
document that discusses the change.</p>
<p>If the <code title="attr-mod-cite"><a href=
"#cite3">cite</a></code> attribute is present, it must be a URI (or
IRI) that explains the change. User agents should allow users to
follow such citation links.</p>
<p>The <dfn id="datetime1" title=
"attr-mod-datetime"><code>datetime</code></dfn> attribute may be
used to specify the time and date of the change.</p>
<p>If present, the <code title="attr-mod-datetime"><a href=
"#datetime1">datetime</a></code> attribute must be a <a href=
"#valid5">valid datetime</a> value.</p>
<p>User agents must parse the <code title=
"attr-mod-datetime"><a href="#datetime1">datetime</a></code>
attribute according to the <a href="#datetime-parser">parse a
string as a datetime value</a> algorithm. If that doesn't return a
time, then the modification has no associated timestamp (the value
is non-conforming; it is not a <a href="#valid5">valid datetime</a>
). Otherwise, the modification is marked as having been made at the
given datetime. User agents should use the associated timezone
information to determine which timezone to present the given
datetime in.</p>
<p>The <code><a href="#ins">ins</a></code> and <code><a href=
"#del">del</a></code> elements must implement the <code><a href=
"#htmlmodelement">HTMLModElement</a></code> interface:</p>
<pre class="idl">
interface <dfn id="htmlmodelement">HTMLModElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#cite4" title=
"dom-mod-cite">cite</a>;
attribute DOMString <a href="#datetime2" title=
"dom-mod-datetime">dateTime</a>;
};
</pre>
<p>The <dfn id="cite4" title="dom-mod-cite"><code>cite</code></dfn>
DOM attribute must <a href="#reflect">reflect</a> the element's
<del class="diff-old">> <code title=attr-mod-cite></del>
<code title="attr-mod-cite"><del class="diff-old"><a
href="#cite3"></del> <a href="#cite3">cite</a></code> content
attribute. The <dfn id="datetime2" title=
"dom-mod-datetime"><code>dateTime</code></dfn> DOM attribute must
<a href="#reflect">reflect</a> the element's <code title=
"">datetime</code> content attribute.</p>
<h4 id="edits0"><span class="secno"><ins class=
"diff-new">3.11.4</ins></span> <ins class="diff-new">Edits and
paragraphs</ins></h4>
<p><ins class="diff-new">Since the</ins> <code><a href=
"#ins"><ins class="diff-new">ins</ins></a></code> <ins class=
"diff-new">and</ins> <code><a href="#del"><ins class=
"diff-new">del</ins></a></code> <ins class="diff-new">elements do
not affect</ins> <a href="#paragraph" title="paragraph"><ins class=
"diff-new">paragraphing</ins></a> ,<ins class="diff-new">it is
possible, in some cases where paragraphs are</ins> <a href=
"#paragraph" title="paragraph"><ins class=
"diff-new">implied</ins></a> <ins class="diff-new">(without
explicit</ins> <code><a href="#p"><ins class=
"diff-new">p</ins></a></code> <ins class="diff-new">elements), for
an</ins> <code><a href="#ins"><ins class=
"diff-new">ins</ins></a></code> <ins class="diff-new">or</ins>
<code><a href="#del"><ins class="diff-new">del</ins></a></code>
<ins class="diff-new">element to span both an entire paragraph or
other non-</ins> <a href="#phrasing0"><ins class=
"diff-new">phrasing content</ins></a> <ins class=
"diff-new">elements and part of another paragraph.</ins></p>
<p><ins class="diff-new">For example:</ins></p>
<pre>
<section><ins class="diff-new">
<ins>
<p>
This is a paragraph that was inserted.
</p>
This is another paragraph whose first sentence was inserted
at the same time as the paragraph above.
</ins>
This is a second sentence, which was there all along.
</section>
</ins>
</pre>
<p><ins class="diff-new">By only wrapping some paragraphs in</ins>
<code><a href="#p"><ins class="diff-new">p</ins></a></code>
<ins class="diff-new">elements, one can even get the end of one
paragraph, a whole second paragraph, and the start of a third
paragraph to be covered by the same</ins> <code><a href=
"#ins"><ins class="diff-new">ins</ins></a></code> <ins class=
"diff-new">or</ins> <code><a href="#del"><ins class=
"diff-new">del</ins></a></code> <ins class="diff-new">element
(though this is very confusing, and not considered good
practice):</ins></p>
<pre>
<section><ins class="diff-new">
This is the first paragraph. <ins>This sentence was
inserted.
<p>This second paragraph was inserted.</p>
This sentence was inserted too.</ins> This is the
third paragraph in this example.
</section>
</ins>
</pre>
<p><ins class="diff-new">However, due to the way</ins> <a href=
"#paragraph" title="paragraph"><ins class="diff-new">implied
paragraphs</ins></a> <ins class="diff-new">are defined, it is not
possible to mark up the end of one paragraph and the start of the
very next one using the same</ins> <code><a href="#ins"><ins class=
"diff-new">ins</ins></a></code> <ins class="diff-new">or</ins>
<code><a href="#del"><ins class="diff-new">del</ins></a></code>
<ins class="diff-new">element. You instead have to use one (or
two)</ins> <code><a href="#p"><ins class=
"diff-new">p</ins></a></code> <ins class="diff-new">element(s) and
two</ins> <code><a href="#ins"><ins class=
"diff-new">ins</ins></a></code> <ins class="diff-new">or</ins>
<code><a href="#del"><ins class="diff-new">del</ins></a></code>
<ins class="diff-new">elements:</ins></p>
<p><ins class="diff-new">For example:</ins></p>
<pre>
<section><ins class="diff-new">
<p>This is the first paragraph. <del>This sentence was
deleted.</del></p>
<p><del>This sentence was deleted too.</del> That
sentence needed a separate &lt;del&gt; element.</p>
</section>
</ins>
</pre>
<p><ins class="diff-new">Partly because of the confusion described
above, authors are strongly recommended to always mark up all
paragraphs with the</ins> <code><a href="#p"><ins class=
"diff-new">p</ins></a></code> <ins class="diff-new">element, and to
not have any</ins> <code><a href="#ins"><ins class=
"diff-new">ins</ins></a></code> <ins class="diff-new">or</ins>
<code><a href="#del"><ins class="diff-new">del</ins></a></code>
<ins class="diff-new">elements that cross across any</ins> <a href=
"#paragraph" title="paragraph"><ins class="diff-new">implied
paragraphs</ins></a> .</p>
<h4 id="edits1"><span class="secno"><ins class=
"diff-new">3.11.5</ins></span> <ins class="diff-new">Edits and
lists</ins></h4>
<p><ins class="diff-new">The content models of the</ins>
<code><a href="#ol"><ins class="diff-new">ol</ins></a></code>
<ins class="diff-new">and</ins> <code><a href="#ul"><ins class=
"diff-new">ul</ins></a></code> <ins class="diff-new">elements do
not allow</ins> <code><a href="#ins"><ins class=
"diff-new">ins</ins></a></code> <ins class="diff-new">and</ins>
<code><a href="#del"><ins class="diff-new">del</ins></a></code>
<ins class="diff-new">elements as children. Lists always represent
all their items, including items that would otherwise have been
marked as deleted.</ins></p>
<p><ins class="diff-new">To indicate that an item is inserted or
deleted, an</ins> <code><a href="#ins"><ins class=
"diff-new">ins</ins></a></code> <ins class="diff-new">or</ins>
<code><a href="#del"><ins class="diff-new">del</ins></a></code>
<ins class="diff-new">element can be wrapped around the contents of
the</ins> <code><a href="#li"><ins class=
"diff-new">li</ins></a></code> <ins class="diff-new">element. To
indicate that an item has been replaced by another, a single</ins>
<code><a href="#li"><ins class="diff-new">li</ins></a></code>
<ins class="diff-new">element can have one or more</ins>
<code><a href="#del"><ins class="diff-new">del</ins></a></code>
<ins class="diff-new">elements followed by one or more</ins>
<code><a href="#ins"><ins class="diff-new">ins</ins></a></code>
<ins class="diff-new">elements.</ins></p>
<div class="example">
<p><ins class="diff-new">In the following example, a list that
started empty had items added and removed from it over time. The
bits in the example that have been emphasised show the parts that
are the "current" state of the list. The list item numbers don't
take into account the edits, though.</ins></p>
<pre>
<h1>Stop-ship bugs</h1><ins class="diff-new">
<ol>
<li><ins datetime="2008-02-12 15:20 Z"><em>Bug 225: Rain detector
doesn't work in snow</em></ins></li>
<li><del datetime="2008-03-01 20:22 Z"><ins datetime="2008-02-14
12:02 Z">Bug 228: Water buffer overflows in April</ins></del></li>
<li><ins datetime="2008-02-16 13:50 Z"><em>Bug 230: Water heater
doesn't use renewable fuels</em></ins></li>
<li><del datetime="2008-02-20 21:15 Z"><ins datetime="2008-02-16
14:25 Z">Bug 232: Carbon dioxide emissions detected after
startup</ins></del></li>
</ol>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-new">In the following example, a list that
started with just fruit was replaced by a list with just
colors.</ins></p>
<pre>
<h1>List of <del>fruits</del><ins>colors</ins></h1><ins class="diff-new">
<ul>
<li><del>Lime</del><ins>Green</ins></li>
<li><del>Apple</del></li>
<li>Orange</li>
<li><del>Pear</del></li>
<li><ins>Teal</ins></li>
<li><del>Lemon</del><ins>Yellow</ins></li>
<li>Olive</li>
<li><ins>Purple</ins>
</ul>
</ins>
</pre></div>
<h3 id="embedded0"><span class="secno"><del class=
"diff-old">3.14.</del> <ins class="diff-chg">3.12</ins></span>
Embedded content</h3>
<h4 id="the-figure"><span class="secno"><del class=
"diff-old">3.14.1.</del> <ins class="diff-chg">3.12.1</ins></span>
The <dfn id="figure"><code>figure</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dd><a href="#sectioning1"><ins class="diff-new">Sectioning
root</ins></a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">Either</del> <ins class=
"diff-chg">Either:</ins> one <code><a href=
"#legend">legend</a></code> element followed by <del class=
"diff-old">prose</del> <a href="#flow-content0"><ins class=
"diff-chg">flow</ins> content</a> .</dd>
<dd>Or: <del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
followed by one <code><a href="#legend">legend</a></code>
element.</dd>
<dd><ins class="diff-new">Or:</ins> <a href=
"#flow-content0"><ins class="diff-new">Flow content</ins></a>
.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#figure">figure</a></code> element represents
some <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> ,
<ins class="diff-chg">optionally</ins> with a <del class=
"diff-old">caption.</del> <ins class="diff-chg">caption, which can
be moved away from the main flow of the document without affecting
the document's meaning.</ins></p>
<p><ins class="diff-chg">The element can thus be used to annotate
illustrations, diagrams, photos, code listings, etc, that are
referred to from the main content of the document, but that could,
without affecting the flow of the document, be moved away from that
primary content, e.g. to the side of the page, to dedicated pages,
or to an appendix.</ins></p>
<p>The first <code><a href="#legend">legend</a></code> element
child of the element, if any, represents the caption of the
<code><a href="#figure">figure</a></code> element's contents. If
there is no child <code><a href="#legend">legend</a></code>
element, then there is no caption.</p>
<p>The remainder of the element's contents, if any, represents the
<del class="diff-old">captioned</del> content.</p>
<div class="example">
<p><ins class="diff-new">This example shows the</ins>
<code><a href="#figure"><ins class=
"diff-new">figure</ins></a></code> <ins class="diff-new">element to
mark up a code listing.</ins></p>
<pre>
<p>In <a href="#l4">listing 4</a> we see the primary core interface<ins class="diff-new">
API declaration.</p>
<figure id="l4">
<legend>Listing 4. The primary core interface API declaration.</legend>
<pre><code>interface PrimaryCore {
boolean verifyDataLine();
void sendData(in sequence&lt;byte> data);
void initSelfDestruct();
}</code></pre>
</figure>
<p>
The
API
is
designed
to
use
UTF-8.</p>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-new">Here we see a</ins> <code><a href=
"#figure"><ins class="diff-new">figure</ins></a></code> <ins class=
"diff-new">element to mark up a photo.</ins></p>
<pre>
<figure><ins class="diff-new">
<img src="bubbles-work.jpeg"
alt="Bubbles, sitting in his office chair, works on his
latest project intently.">
<legend>Bubbles at work</legend>
</figure>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-new">In this example, we see an image that
is</ins> <em><ins class="diff-new">not</ins></em> <ins class=
"diff-new">a figure, as well as an image and a video that
are.</ins></p>
<pre>
<h2>Malinko's comics</h2><ins class="diff-new">
<p>This case centered on some sort of "intellectual property"
infringement related to a comic (see Exhibit A). The suit started
after a trailer ending with these words:</p>
<img src="promblem-packed-action.png" alt="ROUGH COPY! Promblem-Packed Action!">
<p>...was aired. A lawyer, armed with a Bigger Notebook, launched a
preemptive strike using snowballs. A complete copy of the trailer is
included with Exhibit B.</p>
<figure>
<img src="ex-a.png" alt="Two squiggles on a dirty piece of paper.">
<legend>Exhibit A. The alleged <cite>rough copy</cite> comic.</legend>
</figure>
<figure>
<video src="ex-b.mov"></video>
<legend>Exhibit A. The alleged <cite>rough copy</cite> comic.</legend>
</figure>
<p>
The
case
was
resolved
out
of
court.</p>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-new">Here, a part of a poem is marked up
using</ins> <code><a href="#figure"><ins class=
"diff-new">figure</ins></a></code> .</p>
<pre>
<figure><ins class="diff-new">
<p>'Twas brillig, and the slithy toves<br>
Did gyre and gimble in the wabe;<br>
All mimsy were the borogoves,<br>
And the mome raths outgrabe.</p>
<legend><cite>Jabberwocky</cite> (first verse). Lewis Carroll, 1832-98</legend>
</figure>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-new">In this example, which could be part of a
much larger work discussing a castle, the figure has three images
in it.</ins></p>
<pre>
<figure><ins class="diff-new">
<img src="castle1423.jpeg" title="Etching. Anonymous, ca. 1423."
alt="The castle has one tower, and a tall wall around it.">
<img src="castle1858.jpeg" title="Oil-based paint on canvas. Maria Towle, 1858."
alt="The castle now has two towers and two walls.">
<img src="castle1999.jpeg" title="Film photograph. Peter Jankle, 1999."
alt="The castle lies in ruins, the original tower all that remains in one piece.">
<legend>The castle through the ages: 1423, 1858, and 1999 respectively.</legend>
</figure>
</ins>
</pre></div>
<h4 id="the-img"><span class="secno"><del class=
"diff-old">3.14.2.</del> <ins class="diff-chg">3.12.2</ins></span>
The <dfn id="img"><code>img</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#embedded1">Embedded content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#embedded1">embedded content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>Empty.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-img-alt"><a href="#alt">alt</a></code></dd>
<dd><code title="attr-img-src"><a href="#src">src</a></code></dd>
<dd><code title="attr-hyperlink-usemap"><a href=
"#usemap1">usemap</a></code></dd>
<dd><code title="attr-img-ismap"><a href=
"#ismap">ismap</a></code></dd>
<dd><code title="attr-dim-width"><a href=
"#width4">width</a></code></dd>
<dd><code title="attr-dim-height"><a href=
"#height3">height</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlimageelement">HTMLImageElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#alt0" title=
"dom-img-alt">alt</a>;
attribute DOMString <a href="#src0" title=
"dom-img-src">src</a>;
attribute DOMString <a href="#usemap" title=
"dom-img-useMap">useMap</a>;
attribute boolean <a href="#ismap0" title=
"dom-img-isMap">isMap</a>;
attribute long <a href="#width" title=
"dom-img-width">width</a>;
attribute long <a href="#height" title=
"dom-img-height">height</a>;
readonly attribute boolean <a href="#complete" title=
"dom-img-complete">complete</a>;
};
</pre>
<p class="note">An instance of <code><a href=
"#htmlimageelement">HTMLImageElement</a></code> can be obtained
using the <code title="dom-image"><a href=
"#image0">Image</a></code> constructor.</p>
</dd>
</dl>
<p>An <code><a href="#img">img</a></code> element represents an
image.</p>
<p>The image given by the <dfn id="src" title=
"attr-img-src"><code>src</code></dfn> attribute is the embedded
content, and the value of the <dfn id="alt" title=
"attr-img-alt"><code>alt</code></dfn> attribute is the
<code><a href="#img">img</a></code> element's <a href=
"#fallback">fallback content</a> .</p>
<p><strong>Authoring requirements</strong> : The <code title=
"attr-img-src"><a href="#src">src</a></code> attribute must be
present, and must contain a URI (or IRI).</p>
<p class="big-issue">Should we restrict the URI to pointing to an
image? What's an image? Is PDF an image? (Safari supports PDFs in
<img> elements.) How about SVG? (Opera supports those). WMFs?
XPMs? HTML?</p>
<p>The requirements for the <code title="attr-img-alt"><a href=
"#alt">alt</a></code> attribute depend on what the image is
intended to represent:</p>
<dl>
<dt>A phrase or paragraph with an alternative graphical
representation</dt>
<dd>
<p>Sometimes something can be more clearly stated in graphical
form, for example as a flowchart, a diagram, a graph, or a simple
map showing directions. In such cases, an image can be given using
the <code><a href="#img">img</a></code> element, but the lesser
textual version must still be given, so that users who are unable
to view the image (e.g. because they have a very slow connection,
or because they are using a text-only browser, or because they are
listening to the page being read out by a hands-free automobile
voice Web browser, or simply because they are blind) are still able
to understand the message being conveyed.</p>
<p>The text must be given in the <code title=
"attr-img-alt"><a href="#alt">alt</a></code> attribute, and must
convey the same message as the <del class="diff-old">the</del>
image specified in the <code title="attr-img-src"><a href=
"#src">src</a></code> attribute.</p>
<div class="example">
<p>In the following example we have <a href=
"images/parsing-model-overview.png">a flowchart</a> in image form,
with text in the <code title="attr-img-alt"><a href=
"#alt">alt</a></code> attribute rephrasing the flowchart in prose
form:</p>
<pre>
<p>In the common case, the data handled by the tokenisation stage
comes from the network, but it can also come from script.</p>
<p><strong><img src="images/parsing-model-overview.png" alt="The network
passes data to the Tokeniser stage, which passes data to the Tree
Construction stage. From there, data goes to both the DOM and to
Script Execution. Script Execution is linked to the DOM, and, using
document.write(),
passes
data
to
the
Tokeniser.">
</strong>
</p>
</pre></div>
<div class="example">
<p>Here's another example, showing a good solution and a bad
solution to the problem of including an image in a description.</p>
<p>First, here's the good solution. This sample shows how the
alternative text should just be what you would have put in the
prose if the image had never existed.</p>
<pre>
<!-- This is the correct way to do things. -->
<p>
You are standing in an open field west of a house.
<strong><img src="house.jpeg" alt="The house is white, with a boarded front door."></strong>
There is a small mailbox here.
</p>
</pre>
<p>Second, here's the bad solution. In this incorrect way of doing
things, the alternative text is simply a description of the image,
instead of a textual replacement for the image. It's bad because
when the image isn't shown, the text doesn't flow as well as in the
first example.</p>
<del class="diff-old"></del>
<pre class="bad">
<!-- <em>This is the wrong way to do things.</em> -->
<p>
You are standing in an open field west of a house.
<img src="house.jpeg" alt="A white house, with a boarded front door.">
There is a small mailbox here.
</p>
</pre></div>
<p>It is important to <del class="diff-old">realise</del>
<ins class="diff-chg">realize</ins> that the alternative text is a
<em>replacement</em> for the image, not a description of the
image.</p>
</dd>
<dt>Icons: a short phrase or label with an alternative graphical
representation</dt>
<dd>
<p>A document can contain information in iconic form. The icon is
intended to help users of visual browsers to <del class=
"diff-old">recognise</del> <ins class="diff-chg">recognize</ins>
features at a glance.</p>
<p>In some cases, the icon is supplemental to a text label
conveying the same meaning. In those cases, the <code title=
"attr-img-alt"><a href="#alt">alt</a></code> attribute must be
present but must be empty.</p>
<div class="example">
<p>Here the icons are next to text that conveys the same meaning,
so they have an empty <code title="attr-img-alt"><a href=
"#alt">alt</a></code> attribute:</p>
<pre>
<nav>
<p><a href="/help/"><strong><img src="/icons/help.png" alt=""></strong> Help</a></p>
<p><a href="/configure/"><strong><img src="/icons/configuration.png" alt=""></strong>
Configuration Tools</a></p>
</nav>
</pre></div>
<p>In other cases, the icon has no text next to it describing what
it means; the icon is supposed to be self-explanatory. In those
cases, an equivalent textual label must be given in the
<code title="attr-img-alt"><a href="#alt">alt</a></code>
attribute.</p>
<div class="example">
<p>Here, posts on a news site are <del class=
"diff-old">labelled</del> <ins class="diff-chg">labeled</ins> with
an icon indicating their topic.</p>
<pre>
<body>
<article>
<header>
<h1>Ratatouille wins <i>Best Movie of the Year</i> award</h1>
<p><strong><img src="movies.png" alt="Movies"></strong></p>
</header>
<p>Pixar has won yet another <i>Best Movie of the Year</i> award,
making this its 8th win in the last 12 years.</p>
</article>
<article>
<header>
<h1>Latest TWiT episode is online</h1>
<p><strong><img src="podcasts.png" alt="Podcasts"></strong></p>
</header>
<p>The latest TWiT episode has been posted, in which we hear
several tech news stories as well as learning much more about the
iPhone. This week, the panelists compare how reflective their
iPhones' Apple logos are.</p>
</article>
</body>
</pre></div>
<p>Many pages include logos, insignia, flags, or emblems, which
stand for a particular entity such as a company, <del class=
"diff-old">organisation,</del> <ins class=
"diff-chg">organization,</ins> project, band, software package,
country, or some such.</p>
<p>If the logo is being used to represent the entity, the
<code title="attr-img-alt"><a href="#alt">alt</a></code> attribute
must contain the name of the entity being represented by the logo.
The <code title="attr-img-alt"><a href="#alt">alt</a></code>
attribute must <em>not</em> contain text like the word "logo", as
it is not the fact that it is a logo that is being conveyed, it's
the entity itself.</p>
<p>If the logo is being used next to the name of the entity that it
represents, then the logo is supplemental, and its <code title=
"attr-img-alt"><a href="#alt">alt</a></code> attribute must instead
be empty.</p>
<p>If the logo is merely used as decorative material (as branding,
or, for example, as a side image in an article that mentions the
entity to which the logo belongs), then the entry below on purely
decorative images applies. If the logo is actually being discussed,
then it is being used as a phrase or paragraph (the description of
the logo) with an alternative graphical representation (the logo
itself), and the first entry above applies.</p>
<div class="example">
<p>In the following snippets, all four of the above cases are
present. First, we see a logo used to represent a company:</p>
<pre>
<h1>
<strong>
<img
src="XYZ.gif"
alt="The
XYZ
company">
</strong>
</h1>
</pre>
<p>Next, we see a paragraph which uses a logo right next to the
company name, and so doesn't have any alternative text:</p>
<pre>
<article>
<h2>News</h2>
<p>We have recently been looking at buying the <strong><img src="alpha.gif"
alt=""> ΑΒΓ company</strong>, a small Greek company
<del class="diff-old">specialising
</del>
<ins class="diff-chg">specializing
</ins>
in
our
type
of
product.</p>
</pre>
<p>In this third snippet, we have a logo being used in an aside, as
part of the larger article discussing the acquisition:</p>
<pre>
<strong><aside><p><img src="alpha-large.gif" alt=""></p></aside></strong>
<p>The ΑΒΓ company has had a good quarter, and our
pie chart studies of their accounts suggest a much bigger blue slice
than its green and orange slices, which is always a good sign.</p>
</article>
</pre>
<p>Finally, we have an opinion piece talking about a logo, and the
logo is therefore described in detail in the alternative text.</p>
<pre>
<p>Consider for a moment their logo:</p>
<strong><p><img src="/images/logo" alt="It consists of a green circle with a
green question mark centered inside it."></p></strong>
<p>How unoriginal can you get? I mean, oooooh, a question mark, how
<em>revolutionary</em>, how utterly <em>ground-breaking</em>, I'm
sure everyone will rush to adopt those specifications now! They could
at least have tried for some sort of, I don't know, sequence of
rounded squares with varying shades of green and bold white outlines,
at
least
that
would
look
good
on
the
cover
of
a
blue
book.</p>
</pre>
<p>This example shows how the alternative text should be written
such that if the image isn't available, and the text is used
instead, the text flows seamlessly into the surrounding text, as if
the image had never been there in the first place.</p>
</div>
</dd>
<dt>A graphical representation of some of the surrounding text</dt>
<dd>
<p>In many cases, the image is actually just supplementary, and its
presence merely reinforces the surrounding text. In these cases,
the <code title="attr-img-alt"><a href="#alt">alt</a></code>
attribute must be present but its value must be the empty
string.</p>
<div class="example">
<p>A flowchart that repeats the previous paragraph in graphical
form:</p>
<pre>
<p>The network passes data to the Tokeniser stage, which
passes data to the Tree Construction stage. From there, data goes
to both the DOM and to Script Execution. Script Execution is
linked to the DOM, and, using document.write(), passes data to
the Tokeniser.</p>
<strong>
<p>
<img
src="images/parsing-model-overview.png"
alt="">
</p>
</strong>
</pre></div>
<div class="example">
<p>A graph that repeats the previous paragraph in graphical
form:</p>
<pre>
<p>According to a study covering several billion pages,
about 62% of documents on the Web in 2007 triggered the Quirks
rendering mode of Web browsers, about 30% triggered the Almost
Standards mode, and about 9% triggered the Standards mode.</p>
<strong>
<p>
<img
src="rendering-mode-pie-chart.png"
alt="">
</p>
</strong>
</pre></div>
<p>In general, an image falls into this category if removing the
image doesn't make the page any less useful, but including the
image makes it a lot easier for users of visual browsers to
understand the concept.</p>
</dd>
<dt>A purely decorative image that doesn't add any information but
is still specific to the surrounding content</dt>
<dd>
<p>In some cases, the image isn't discussed by the surrounding
text, but it has some relevance. Such images are decorative, but
still form part of the content. In these cases, the <code title=
"attr-img-alt"><a href="#alt">alt</a></code> attribute must be
present but its value must be the empty string.</p>
<div class="example">
<p>Examples where the image is purely decorative despite being
relevant would include things like a photo of the Black Rock City
landscape in a blog post about an event at Burning Man, or an image
of a painting inspired by a poem, on a page reciting that poem. The
following snippet shows an example of the latter case (only the
first verse is included in this snippet):</p>
<pre>
<h1>The Lady of Shalott</h1>
<strong><p><img src="shalott.jpeg" alt=""></p></strong>
<p>On either side the river lie<br>
Long fields of barley and of rye,<br>
That clothe the wold and meet the sky;<br>
And through the field the road run by<br>
To many-tower'd Camelot;<br>
And up and down the people go,<br>
Gazing where the lilies blow<br>
Round an island there below,<br>
The
island
of
Shalott.</p>
</pre></div>
<p>In general, if an image is decorative but isn't especially
page-specific, for example an image that forms part of a site-wide
design scheme, the image should be specified in the site's CSS, not
in the markup of the document.</p>
</dd>
<dt>A key part of the content <del class="diff-old">that doesn't
have an obvious textual alternative</del></dt>
<dd>
<p>In <del class="diff-old">certain rare</del> <ins class=
"diff-chg">some</ins> cases, the image is <del class=
"diff-old">simply</del> a critical part of the <del class=
"diff-old">content, and</del> <ins class="diff-chg">content. This
could be the case, for instance, on a page that is part of a photo
gallery. The image is the whole</ins> <em><ins class=
"diff-chg">point</ins></em> <ins class="diff-chg">of the page
containing it.</ins></p>
<p><ins class="diff-chg">When it is possible for alternative text
to be provided, for example if the image is part of a series of
screenshots in a magazine review, or part of a comic strip, or is a
photograph in a blog entry about that photograph, text that conveys
can serve as a substitute for the image must be given as the
contents of the</ins> <code title="attr-img-alt"><a href=
"#alt"><ins class="diff-chg">alt</ins></a></code> <ins class=
"diff-chg">attribute.</ins></p>
<p><ins class="diff-chg">In a rare subset of these cases,</ins>
there might <del class="diff-old">even</del> be no alternative text
available. This could be the case, for instance, <del class=
"diff-old">in</del> <ins class="diff-chg">on</ins> a photo
<del class="diff-old">gallery, where a user</del> <ins class=
"diff-chg">upload site, if the site</ins> has <del class=
"diff-old">uploaded 3000</del> <ins class="diff-chg">received
8000</ins> photos from a <del class="diff-old">vacation trip,</del>
<ins class="diff-chg">user</ins> without <del class=
"diff-old">providing any descriptions of</del> the <del class=
"diff-old">images. The images are the whole point</del> <ins class=
"diff-chg">user annotating any</ins> of <del class="diff-old">the
pages containing</del> them. In such cases, the <code title=
"attr-img-alt"><a href="#alt">alt</a></code> attribute may be
omitted, but the <code title="attr-img-alt"><a href=
"#alt">alt</a></code> attribute should be included, with a useful
value, if at all possible. <del class="diff-old">If</del></p>
<p><ins class="diff-chg">In any case, if</ins> an image is a key
part of the content, the <code title="attr-img-alt"><a href=
"#alt">alt</a></code> attribute must not be specified with an empty
value.</p>
<div class="example">
<p>A <del class="diff-old">photo on a photo-sharing site:
<legend>Bubbles traveled everywhere with us.</legend>
</figure> A</del> screenshot in a gallery of screenshots for
a new <del class="diff-old">OS:</del> <ins class="diff-chg">OS,
with some alternative text:</ins></p>
<pre>
<figure>
<del class="diff-old">
</del>
<strong><img src="KDE%20Light%20desktop.png"
<ins class=
"diff-chg"> alt="The desktop is blue, with icons along the left hand side in
two columns, reading System, Home, K-Mail, etc. A window is
open showing that menus wrap to a second line if they
cannot fit in the window. The window has a list of icons
along the top, with an address bar below it, a list of
icons for tabs along the left edge, a status bar on the
bottom, and two panes in the middle. The desktop has a bar
at the bottom of the screen with a few buttons, a pager, a
list of open applications, and a clock."></ins>
</strong>
<legend>Screenshot of a KDE desktop.</legend>
</figure>
</pre>
<p><ins class="diff-new">A photo on a photo-sharing site, if the
site received the image with no metadata other than the
caption:</ins></p>
<pre>
<figure> <strong><img src="1100670787_6a7c664aef.jpg"></strong><ins class="diff-new">
<legend>Bubbles traveled everywhere with us.</legend>
</figure>
</ins>
</pre>
<p>In <del class="diff-old">both cases,</del> <ins class=
"diff-chg">this case,</ins> though, it would be better if a
detailed description of the important parts of the image
<del class="diff-old">were included.</del> <ins class=
"diff-chg">obtained from the user and included on the
page.</ins></p>
</div>
<div class="example">
<p>Sometimes there simply is no text that can do justice to an
image. For example, there is little that can be said to usefully
describe a Rorschach inkblot test.</p>
<pre>
<figure>
<strong><img src="/commons/a/a7/Rorschach1.jpg"></strong>
<legend>A black outline of the first of the ten cards
in the Rorschach inkblot test.</legend>
</figure>
</pre>
<p>Note that the following would be a very bad use of alternative
text:</p>
<del class="diff-old"></del>
<pre class="bad">
<!-- This example is wrong. Do not copy it. -->
<figure>
<img src="/commons/a/a7/Rorschach1.jpg" alt="A black outline
of the first of the ten cards in the Rorschach inkblot test.">
<legend>A black outline of the first of the ten cards
in the Rorschach inkblot test.</legend>
</figure>
</pre>
<p>Including the caption in the alternative text like this isn't
useful because it effectively duplicates the caption for users who
don't have images, taunting them twice yet not helping them any
more than if they had only read or heard the caption once.</p>
</div>
<p class="note">Since some users cannot use images at all (e.g.
because they have a very slow connection, or because they are using
a text-only browser, or because they are listening to the page
being read out by a hands-free automobile voice Web browser, or
simply because they are blind), the <code title=
"attr-img-alt"><a href="#alt">alt</a></code> attribute <del class=
"diff-old">should</del> <ins class="diff-chg">is</ins> only
<ins class="diff-new">allowed to</ins> be omitted when no
alternative text is available and none can be made available, e.g.
on automated image gallery sites.</p>
</dd>
<dt>An image in an e-mail or document intended for a specific
person who is known to be able to view images</dt>
<dd>
<p>When an image is included in a communication (such as an HTML
e-mail) aimed at someone who is known to be able to view images,
the <code title="attr-img-alt"><a href="#alt">alt</a></code>
attribute may be omitted. However, even in such cases it is
<del class="diff-old">stongly</del> <ins class=
"diff-chg">strongly</ins> recommended that alternative text be
included (as appropriate according to the kind of image involved,
as described in the above entries), so that the e-mail is still
usable should the user use a mail client that does not support
images, or should the e-mail be forwarded on to other users whose
abilities might not include easily seeing images.</p>
</dd>
</dl>
<p>The <code><a href="#img">img</a></code> must not be used as a
layout tool. In particular, <code><a href="#img">img</a></code>
elements should not be used to display fully transparent images, as
they rarely convey meaning and rarely add anything useful to the
document.</p>
<p class="big-issue">There has been some suggestion that the
<code title="">longdesc</code> attribute from HTML4, or some other
mechanism that is more powerful than <code title="">alt=""</code> ,
should be included. This has not yet been considered.</p>
<p><strong>User agent requirements</strong> : When the <code title=
"attr-img-alt"><a href="#alt">alt</a></code> attribute is present
and its value is the empty string, the image supplements the
surrounding content. In such cases, the image may be omitted
without affecting the meaning of the document.</p>
<p>When the <code title="attr-img-alt"><a href=
"#alt">alt</a></code> attribute is present and its value is not the
empty string, the image is a graphical equivalent of the string
given in the <code title="attr-img-alt"><a href=
"#alt">alt</a></code> attribute. In such cases, the image may be
replaced in the rendering by the string given in the attribute
without significantly affecting the meaning of the document.</p>
<p>When the <code title="attr-img-alt"><a href=
"#alt">alt</a></code> attribute is missing, the image represents a
key part of the content. Non-visual user agents should apply image
analysis heuristics to help the user make sense of the image.</p>
<p>The <code title="attr-img-alt"><a href="#alt">alt</a></code>
attribute does not represent advisory information. User agents must
not present the contents of the <code title="attr-img-alt"><a href=
"#alt">alt</a></code> attribute in the same way as content of the
<code title="attr-title"><a href="#title">title</a></code>
attribute.</p>
<p>If the <code title="attr-img-src"><a href="#src">src</a></code>
attribute is omitted, the image represents whatever string is given
by the element's <code title="attr-img-alt"><a href=
"#alt">alt</a></code> attribute, if any, or nothing, if that
attribute is empty or absent.</p>
<p><del class="diff-old">When the</del> <ins class=
"diff-chg">The</ins> <code title="attr-img-src"><a href=
"#src">src</a></code> <del class="diff-old">attribute is set,</del>
<ins class="diff-chg">attribute, on setting, must cause</ins> the
user agent <del class="diff-old">must</del> <ins class=
"diff-chg">to</ins> immediately begin to download the specified
resource , unless the user agent cannot support images, or its
support for images has been disabled.</p>
<p>The download of the image must <a href="#delays">delay the
<code title="event-load">load</code> event</a> .</p>
<p class="warning">This, unfortunately, can be used to perform a
rudimentary port scan of the user's local network (especially in
conjunction with scripting, though scripting isn't actually
necessary to carry out such an attack). User agents may implement
<a href="#origin0" title="origin">cross-origin</a> access control
policies that mitigate this attack.</p>
<p>Once the download has completed, if the image is a valid image,
the user agent must <a href="#firing4">fire a <code title=
"event-load">load</code> event</a> on the <code><a href=
"#img">img</a></code> <del class="diff-old">element.</del>
<ins class="diff-chg">element (this happens after</ins>
<code title="dom-img-complete"><a href="#complete"><ins class=
"diff-chg">complete</ins></a></code> <ins class="diff-chg">starts
returning true).</ins> If the download fails or it completes but
the image is not a valid or supported image, the user agent must
<a href="#firing5">fire an <code title="event-error">error</code>
event</a> on the <code><a href="#img">img</a></code> element.</p>
<p>The remote server's response metadata (e.g. an HTTP 404 status
code, or <a href="#content-type8" title="Content-Type">associated
Content-Type headers</a> ) must be ignored when determining whether
the resource obtained is a valid image or not.</p>
<p class="note">This allows servers to return images with error
responses.</p>
<p>User agents must not support non-image resources with the
<code><a href="#img">img</a></code> element.</p>
<p>The <code title="attr-hyperlink-usemap"><a href=
"#usemap1">usemap</a></code> attribute, if present, can indicate
that the image has an associated <a href="#image">image map</a>
.</p>
<p>The <dfn id="ismap" title=
"attr-img-ismap"><code>ismap</code></dfn> attribute, when used on
an element that is a descendant of an <code><a href=
"#a">a</a></code> element with an <code title=
"attr-hyperlink-href"><a href="#href6">href</a></code> attribute,
indicates by its presence that the element provides access to a
server-side image map. This affects how events are handled on the
corresponding <code><a href="#a">a</a></code> element.</p>
<p>The <code title="attr-img-ismap"><a href=
"#ismap">ismap</a></code> attribute is a <a href=
"#boolean0">boolean attribute</a> . The attribute must not be
specified on an element that does not have an ancestor
<code><a href="#a">a</a></code> element with an <code title=
"attr-hyperlink-href"><a href="#href6">href</a></code>
attribute.</p>
<p>The <code><a href="#img">img</a></code> element supports
<a href="#dimension0">dimension attributes</a> .</p>
<p>The DOM attributes <dfn id="alt0" title=
"dom-img-alt"><code>alt</code></dfn> , <dfn id="src0" title=
"dom-img-src"><code>src</code></dfn> , <dfn id="usemap" title=
"dom-img-useMap"><code>useMap</code></dfn> , and <dfn id="ismap0"
title="dom-img-isMap"><code>isMap</code></dfn> each must <a href=
"#reflect">reflect</a> the respective content attributes of the
same name.</p>
<p>The DOM attributes <dfn id="height" title=
"dom-img-height"><code>height</code></dfn> and <dfn id="width"
title="dom-img-width"><code>width</code></dfn> must return the
rendered height and width of the image, in CSS pixels, if the image
is being rendered, and is being rendered to a visual medium, or 0
otherwise. <a href="#references">[CSS21]</a></p>
<p>The DOM attribute <dfn id="complete" title=
"dom-img-complete"><code>complete</code></dfn> must return true if
the user agent has downloaded the image specified in the
<code title="attr-img-src"><a href="#src">src</a></code> attribute,
and it is a valid image, and false otherwise.</p>
<p class="note"><ins class="diff-new">The value of</ins>
<code title="dom-img-complete"><a href="#complete"><ins class=
"diff-new">complete</ins></a></code> <ins class="diff-new">can
change while a script is executing.</ins></p>
<div class="example">
<p><ins class="diff-new">A single image can have different
appropriate alternative text depending on the context.</ins></p>
<p><ins class="diff-new">In each of the following cases, the same
image is used, yet the</ins> <code title="attr-img-alt"><a href=
"#alt"><ins class="diff-new">alt</ins></a></code> <ins class=
"diff-new">text is different each time. The image is the coat of
arms of the Canton Geneva in Switzerland.</ins></p>
<p><ins class="diff-new">Here it is used as a supplementary
icon:</ins></p>
<pre>
<ins class="diff-new">
<p>
I
lived
in
<img
src="carouge.svg"
alt="">
Carouge.</p>
</ins>
</pre>
<p><ins class="diff-new">Here it is used as an icon representing
the town:</ins></p>
<pre>
<ins class="diff-new">
<p>
Home
town:
<img
src="carouge.svg"
alt="Carouge">
</p>
</ins>
</pre>
<p><ins class="diff-new">Here it is used as part of a text on the
town:</ins></p>
<pre>
<p>Carouge has a coat of arms.</p><ins class=
"diff-new">
<p><img src="carouge.svg" alt="The coat of arms depicts a lion, sitting in front of a tree."></p>
<p>
It
is
used
as
decoration
all
over
the
town.</p>
</ins>
</pre>
<p><ins class="diff-new">Here it is used as a way to support a
similar text where the description is given as well as, instead of
as an alternative to, the image:</ins></p>
<pre>
<p>Carouge has a coat of arms.</p><ins class=
"diff-new">
<p><img src="carouge.svg" alt=""></p>
<p>The coat of arms depicts a lion, sitting in front of a tree.
It
is
used
as
decoration
all
over
the
town.</p>
</ins>
</pre>
<p><ins class="diff-new">Here it is used as part of a
story:</ins></p>
<pre>
<p>He picked up the folder and a piece of paper fell out.</p><ins class="diff-new">
<p><img src="carouge.svg" alt="Shaped like a shield, the paper had a
red background, a green tree, and a yellow lion with its tongue
hanging out and whose tail was shaped like an S."></p>
<p>He stared at the folder. S! The answer he had been looking for all
this time was simply the letter S! How had he not seen that before? It all
came together now. The phone call where Hector had referred to a lion's tail,
the
time
Marco
had
stuck
his
tongue
out...</p>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-new">Here are some more examples showing the
same picture used in different contexts, with different appropriate
alternate texts each time.</ins></p>
<pre>
<article><ins class="diff-new">
<h1>My cats</h1>
<h2>Fluffy</h2>
<p>Fluffy is my favourite.</p>
<img src="fluffy.jpg" alt="She likes playing with a ball of yarn.">
<p>She's just too cute.</p>
<h2>Miles</h2>
<p>My other cat, Miles just eats and sleeps.</p>
</article>
</ins>
</pre>
<pre>
<article><ins class="diff-new">
<h1>Photography</h1>
<h2>Shooting moving targets indoors</h2>
<p>The trick here is to know how to anticipate; to know at what speed and
what distance the subject will pass by.</p>
<img src="fluffy.jpg" alt="A cat flying by, chasing a ball of yarn, can be
photographed quite nicely using this technique.">
<h2>Nature by night</h2>
<p>To achieve this, you'll need either an extremely sensitive film, or
immense flash lights.</p>
</article>
</ins>
</pre>
<pre>
<article><ins class="diff-new">
<h1>About me</h1>
<h2>My pets</h2>
<p>I've got a cat named Fluffy and a dog named Miles.</p>
<img src="fluffy.jpg" alt="Fluffy, my cat, tends to keep itself busy.">
<p>My dog Miles and I like go on long walks together.</p>
<h2>music</h2>
<p>After our walks, having emptied my mind, I like listening to Bach.</p>
</article>
</ins>
</pre>
<pre>
<article><ins class="diff-new">
<h1>Fluffy and the Yarn</h1>
<p>Fluffy was a cat who liked to play with yarn. He also liked to jump.</p>
<aside><img src="fluffy.jpg" alt="" title="Fluffy"></aside>
<p>He would play in the morning, he would play in the evening.</p>
</article>
</ins>
</pre></div>
<h4 id="the-iframe"><span class="secno"><del class=
"diff-old">3.14.3.</del> <ins class="diff-chg">3.12.3</ins></span>
The <dfn id="iframe"><code>iframe</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#embedded1">Embedded content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#embedded1">embedded content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>Text that conforms to the requirements given in the prose.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-iframe-src"><a href=
"#src1">src</a></code></dd>
<dd><code title="attr-iframe-name"><a href="#name1"><ins class=
"diff-new">name</ins></a></code></dd>
<dd><code title="attr-iframe-sandbox"><a href=
"#sandbox"><ins class="diff-new">sandbox</ins></a></code></dd>
<dd><code title="attr-iframe-seamless"><a href=
"#seamless"><ins class="diff-new">seamless</ins></a></code></dd>
<dd><code title="attr-dim-width"><a href="#width4"><ins class=
"diff-new">width</ins></a></code></dd>
<dd><code title="attr-dim-height"><a href="#height3"><ins class=
"diff-new">height</ins></a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmliframeelement">HTMLIFrameElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#src2" title=
"dom-iframe-src">src</a>;
<ins class="diff-new"> attribute DOMString <a href=
"#name2" title="dom-iframe-name">name</a>;
attribute DOMString <a href="#sandbox0" title=
"dom-iframe-sandbox">sandbox</a>;
attribute boolean <a href="#seamless1" title=
"dom-iframe-seamless">seamless</a>;
attribute long <a href="#width5" title=
"dom-dim-width">width</a>;
attribute long <a href="#height4" title=
"dom-dim-height">height</a>;
</ins>
};
</pre>
<p>Objects implementing the <code><a href=
"#htmliframeelement">HTMLIFrameElement</a></code> interface must
also implement the <code>EmbeddingElement</code> interface defined
in the Window Object specification. <a href=
"#references">[WINDOW]</a></p>
</dd>
</dl>
<p>The <code><a href="#iframe">iframe</a></code> element introduces
a new nested <a href="#browsing1">browsing context</a> .</p>
<p>The <dfn id="src1" title=
"attr-iframe-src"><code>src</code></dfn> attribute, if present,
must be a URI (or IRI) to a page that the nested <a href=
"#browsing1">browsing context</a> is to contain. When the browsing
context is created, if the attribute is present, the user agent
must <a href="#navigate">navigate</a> this browsing context to the
given URI, with <a href="#replacement">replacement enabled</a> ,
<ins class="diff-new">and with the</ins> <code><a href=
"#iframe"><ins class="diff-new">iframe</ins></a></code> <ins class=
"diff-new">element's document's</ins> <a href=
"#browsing1"><ins class="diff-new">browsing context</ins></a>
<ins class="diff-new">as the</ins> <a href="#source0"><ins class=
"diff-new">source browsing context</ins></a> . If the user <a href=
"#navigate" title="navigate">navigates</a> away from this page, the
<code><a href="#iframe">iframe</a></code> 's corresponding
<code><a href="#window">Window</a></code> object will reference new
<code>Document</code> objects, but the <code title=
"attr-iframe-src"><a href="#src1">src</a></code> attribute will not
change.</p>
<p>Whenever the <code title="attr-iframe-src"><a href=
"#src1">src</a></code> attribute is set, the nested <a href=
"#browsing1">browsing context</a> must be <a href="#navigate"
title="navigate">navigated</a> to the given <del class=
"diff-old">URI.</del> <ins class="diff-chg">URI, with the</ins>
<code><a href="#iframe"><ins class=
"diff-chg">iframe</ins></a></code> <ins class="diff-chg">element's
document's</ins> <a href="#browsing1"><ins class=
"diff-chg">browsing context</ins></a> <ins class="diff-chg">as
the</ins> <a href="#source0"><ins class="diff-chg">source browsing
context</ins></a> .</p>
<p>If the <code title="attr-iframe-src"><a href=
"#src1">src</a></code> attribute is not set when the element is
created, the browsing context will remain at the initial
<code>about:blank</code> page.</p>
<p><ins class="diff-new">The</ins> <dfn id="name1" title=
"attr-iframe-name"><code><ins class=
"diff-new">name</ins></code></dfn> <ins class="diff-new">attribute,
if present, must be a</ins> <a href="#valid8"><ins class=
"diff-new">valid browsing context name</ins></a> .<ins class=
"diff-new">When the browsing context is created, if the attribute
is present, the</ins> <a href="#browsing2"><ins class=
"diff-new">browsing context name</ins></a> <ins class=
"diff-new">must be set to the value of this attribute; otherwise,
the</ins> <a href="#browsing2"><ins class="diff-new">browsing
context name</ins></a> <ins class="diff-new">must be set to the
empty string.</ins></p>
<p><ins class="diff-new">Whenever the</ins> <code title=
"attr-iframe-name"><a href="#name1"><ins class=
"diff-new">name</ins></a></code> <ins class="diff-new">attribute is
set, the nested</ins> <a href="#browsing1"><ins class=
"diff-new">browsing context</ins></a> <ins class=
"diff-new">'s</ins> <a href="#browsing2" title=
"browsing context name"><ins class="diff-new">name</ins></a>
<ins class="diff-new">must be changed to the new value. If the
attribute is removed, the</ins> <a href="#browsing2"><ins class=
"diff-new">browsing context name</ins></a> <ins class=
"diff-new">must be set to the empty string.</ins></p>
<p>When content loads in an <code><a href=
"#iframe">iframe</a></code> , after any <code title=
"event-load"><a href="#load0">load</a></code> events are fired
within the content itself, the user agent must <a href=
"#firing4">fire a <code title="event-load">load</code> event</a> at
the <code><a href="#iframe">iframe</a></code> element. When content
fails to load (e.g. due to a network error), then the user agent
must <a href="#firing5">fire an <code title=
"event-error">error</code> event</a> at the element instead.</p>
<p>When there is an active parser in the <code><a href=
"#iframe">iframe</a></code> , and when anything in the
<code><a href="#iframe">iframe</a></code> that is <a href="#delays"
title="delay the load event">delaying the <code title=
"event-load">load</code> event</a> in the <code><a href=
"#iframe">iframe</a></code> 's <a href="#browsing1">browsing
context</a> , the <code><a href="#iframe">iframe</a></code> must
<a href="#delays">delay the <code title="event-load">load</code>
event</a> .</p>
<p class="note">If, during the handling of the <code title=
"event-load"><a href="#load0">load</a></code> event, the <a href=
"#browsing1">browsing context</a> in the <code><a href=
"#iframe">iframe</a></code> is again <a href="#navigate" title=
"navigate">navigated</a> , that will further <a href=
"#delays">delay the <code title="event-load">load</code> event</a>
.</p>
<hr>
<p><ins class="diff-new">The</ins> <dfn id="sandbox" title=
"attr-iframe-sandbox"><code><ins class=
"diff-new">sandbox</ins></code></dfn> <ins class=
"diff-new">attribute, when specified, enables a set of extra
restrictions on any content hosted by the</ins> <code><a href=
"#iframe"><ins class="diff-new">iframe</ins></a></code>
.<ins class="diff-new">Its value must be an</ins> <a href=
"#unordered"><ins class="diff-new">unordered set of unique
space-separated tokens</ins></a> .<ins class="diff-new">The allowed
values are</ins> <code title=
"attr-iframe-sandbox-allow-same-origin"><a href=
"#allow-same-origin"><ins class=
"diff-new">allow-same-origin</ins></a></code> ,<code title=
"attr-iframe-sandbox-allow-forms"><a href=
"#allow-forms"><ins class="diff-new">allow-forms</ins></a></code>
,<ins class="diff-new">and</ins> <code title=
"attr-iframe-sandbox-allow-scripts"><a href=
"#allow-scripts"><ins class=
"diff-new">allow-scripts</ins></a></code> .</p>
<p><ins class="diff-new">While the</ins> <code title=
"attr-iframe-sandbox"><a href="#sandbox"><ins class=
"diff-new">sandbox</ins></a></code> <ins class="diff-new">attribute
is specified, the</ins> <code><a href="#iframe"><ins class=
"diff-new">iframe</ins></a></code> <ins class=
"diff-new">element's</ins> <a href="#nested0"><ins class=
"diff-new">nested browsing context</ins></a> ,<ins class=
"diff-new">and all the browsing contexts</ins> <a href="#nested0"
title="nested browsing context"><ins class=
"diff-new">nested</ins></a> <ins class="diff-new">within it (either
directly or indirectly through other nested browsing contexts) must
have the following flags set:</ins></p>
<dl>
<dt><ins class="diff-new">The</ins> <dfn id="sandboxed"><ins class=
"diff-new">sandboxed navigation browsing context
flag</ins></dfn></dt>
<dd>
<p><ins class="diff-new">This flag</ins> <a href=
"#sandboxLinks"><ins class="diff-new">prevents content from
navigating browsing contexts other than the sandboxed browsing
context itself</ins></a> <ins class="diff-new">(or browsing
contexts further nested inside it).</ins></p>
<p><ins class="diff-new">This flag also</ins> <a href=
"#sandboxWindowOpen"><ins class="diff-new">prevents content from
creating new auxiliary browsing contexts</ins></a> ,<ins class=
"diff-new">e.g. using the</ins> <code title=
"attr-hyperlink-target"><a href="#target3"><ins class=
"diff-new">target</ins></a></code> <ins class="diff-new">attribute
or the</ins> <code title="dom-open"><a href="#open2"><ins class=
"diff-new">window.open()</ins></a></code> <ins class=
"diff-new">method.</ins></p>
</dd>
<dt><ins class="diff-new">The</ins> <dfn id=
"sandboxed0"><ins class="diff-new">sandboxed plugins browsing
context flag</ins></dfn></dt>
<dd>
<p><ins class="diff-new">This flag prevents content from
instantiating</ins> <a href="#plugin" title="plugin"><ins class=
"diff-new">plugins</ins></a> ,<ins class="diff-new">whether
using</ins> <a href="#sandboxPluginEmbed"><ins class=
"diff-new">the</ins> <code><ins class="diff-new">embed</ins></code>
<ins class="diff-new">element</ins></a> ,<a href=
"#sandboxPluginObject"><ins class="diff-new">the</ins>
<code><ins class="diff-new">object</ins></code> <ins class=
"diff-new">element</ins></a> ,<a href=
"#sandboxPluginApplet"><ins class="diff-new">the</ins>
<code><ins class="diff-new">applet</ins></code> <ins class=
"diff-new">element</ins></a> ,<ins class="diff-new">or
through</ins> <a href="#sandboxPluginNavigate"><ins class=
"diff-new">navigation</ins></a> <ins class="diff-new">of a</ins>
<a href="#nested0"><ins class="diff-new">nested browsing
context</ins></a> .</p>
</dd>
<dt><ins class="diff-new">The</ins> <dfn id=
"sandboxed1"><ins class="diff-new">sandboxed annoyances browsing
context flag</ins></dfn></dt>
<dd>
<p><ins class="diff-new">This flag prevents content from</ins>
<a href="#sandboxNotifications"><ins class="diff-new">showing
notifications</ins></a> <ins class="diff-new">outside of the</ins>
<a href="#nested0"><ins class="diff-new">nested browsing
context</ins></a> .</p>
</dd>
<dt><ins class="diff-new">The</ins> <dfn id=
"sandboxed2"><ins class="diff-new">sandboxed origin browsing
context flag</ins></dfn> ,<ins class="diff-new">unless the</ins>
<code title="attr-iframe-sandbox"><a href="#sandbox"><ins class=
"diff-new">sandbox</ins></a></code> <ins class=
"diff-new">attribute's value, when</ins> <a href="#split" title=
"split a string on spaces"><ins class="diff-new">split on
spaces</ins></a> ,<ins class="diff-new">is found to have the</ins>
<dfn id="allow-same-origin" title=
"attr-iframe-sandbox-allow-same-origin"><code><ins class=
"diff-new">allow-same-origin</ins></code></dfn> <ins class=
"diff-new">keyword set</ins></dt>
<dd>
<p><ins class="diff-new">This flag</ins> <a href=
"#sandboxOrigin"><ins class="diff-new">forces content into a unique
origin</ins></a> <ins class="diff-new">for the purposes of
the</ins> <a href="#origin0" title="origin"><ins class=
"diff-new">same-origin policy</ins></a> .</p>
<p><ins class="diff-new">This flag also</ins> <a href=
"#sandboxCookies"><ins class="diff-new">prevents script from
reading the</ins> <code title="dom-document-cookies"><ins class=
"diff-new">document.cookies</ins></code> <ins class="diff-new">DOM
attribute</ins></a> .</p>
<div class="note">
<p><ins class="diff-new">The</ins> <code title=
"attr-iframe-sandbox-allow-same-origin"><a href=
"#allow-same-origin"><ins class=
"diff-new">allow-same-origin</ins></a></code> <ins class=
"diff-new">attribute is intended for two cases.</ins></p>
<p><ins class="diff-new">First, it can be used to allow content
from the same site to be sandboxed to disable scripting, while
still allowing access to the DOM of the sandboxed
content.</ins></p>
<p><ins class="diff-new">Second, it can be used to embed content
from a third-party site, sandboxed to prevent that site from
opening popup windows, etc, without preventing the embedded page
from communicating back to its originating site, using the database
APIs to store data, etc.</ins></p>
</div>
</dd>
<dt><ins class="diff-new">The</ins> <dfn id=
"sandboxed3"><ins class="diff-new">sandboxed forms browsing context
flag</ins></dfn> ,<ins class="diff-new">unless the</ins>
<code title="attr-iframe-sandbox"><a href="#sandbox"><ins class=
"diff-new">sandbox</ins></a></code> <ins class=
"diff-new">attribute's value, when</ins> <a href="#split" title=
"split a string on spaces"><ins class="diff-new">split on
spaces</ins></a> ,<ins class="diff-new">is found to have the</ins>
<dfn id="allow-forms" title=
"attr-iframe-sandbox-allow-forms"><code><ins class=
"diff-new">allow-forms</ins></code></dfn> <ins class=
"diff-new">keyword set</ins></dt>
<dd>
<p><ins class="diff-new">This flag</ins> <a href=
"#sandboxSubmitBlocked"><ins class="diff-new">blocks form
submission</ins></a> .</p>
</dd>
<dt><ins class="diff-new">The</ins> <dfn id=
"sandboxed4"><ins class="diff-new">sandboxed scripts browsing
context flag</ins></dfn> ,<ins class="diff-new">unless the</ins>
<code title="attr-iframe-sandbox"><a href="#sandbox"><ins class=
"diff-new">sandbox</ins></a></code> <ins class=
"diff-new">attribute's value, when</ins> <a href="#split" title=
"split a string on spaces"><ins class="diff-new">split on
spaces</ins></a> ,<ins class="diff-new">is found to have the</ins>
<dfn id="allow-scripts" title=
"attr-iframe-sandbox-allow-scripts"><code><ins class=
"diff-new">allow-scripts</ins></code></dfn> <ins class=
"diff-new">keyword set</ins></dt>
<dd>
<p><ins class="diff-new">This flag</ins> <a href=
"#sandboxScriptBlocked"><ins class="diff-new">blocks script
execution</ins></a> .</p>
</dd>
</dl>
<p><ins class="diff-new">These flags must not be set unless the
conditions listed above define them as being set.</ins></p>
<div class="example">
<p><ins class="diff-new">In this example, some completely-unknown,
potentially hostile, user-provided HTML content is embedded in a
page. Because it is sandboxed, it is treated by the user agent as
being from a unique origin, despite the content being served from
the same site. Thus it is affected by all the normal cross-site
restrictions. In addition, the embedded page has scripting
disabled, plugins disabled, forms disabled, and it cannot navigate
any frames or windows other than itself (or any frames or windows
it itself embeds).</ins></p>
<pre>
<p>We're not scared of you! Here is your content, unedited:</p><ins class="diff-new">
<iframe
sandbox
src="getusercontent.cgi?id=12193">
</iframe>
</ins>
</pre>
<p><ins class="diff-new">Note that cookies are still send to the
server in the</ins> <code title=""><ins class=
"diff-new">getusercontent.cgi</ins></code> <ins class=
"diff-new">request, though they are not visible in the</ins>
<code title="dom-document-cookies"><ins class=
"diff-new">document.cookies</ins></code> <ins class="diff-new">DOM
attribute.</ins></p>
</div>
<div class="example">
<p><ins class="diff-new">In this example, a gadget from another
site is embedded. The gadget has scripting and forms enabled, and
the origin sandbox restrictions are lifted, allowing the gadget to
communicate with its originating server. The sandbox is still
useful, however, as it disables plugins and popups, thus reducing
the risk of the user being exposed to malware and other
annoyances.</ins></p>
<pre>
<iframe sandbox="allow-same-origin allow-forms allow-scripts"<ins class="diff-new">
src="http://maps.example.com/embedded.html">
</iframe>
</ins>
</pre></div>
<hr>
<p><ins class="diff-new">The</ins> <dfn id="seamless" title=
"attr-iframe-seamless"><code><ins class=
"diff-new">seamless</ins></code></dfn> <ins class=
"diff-new">attribute is a boolean attribute. When specified, it
indicates that the</ins> <code><a href="#iframe"><ins class=
"diff-new">iframe</ins></a></code> <ins class=
"diff-new">element's</ins> <a href="#browsing1"><ins class=
"diff-new">browsing context</ins></a> <ins class="diff-new">is to
be rendered in a manner that makes it appear to be part of the
containing document (seamlessly included in the parent document).
Specifically, when the attribute is set on an element and while
the</ins> <a href="#browsing1"><ins class="diff-new">browsing
context</ins></a> <ins class="diff-new">'s</ins> <a href=
"#active"><ins class="diff-new">active document</ins></a>
<ins class="diff-new">has the</ins> <a href=
"#same-origin"><ins class="diff-new">same origin</ins></a>
<ins class="diff-new">as the</ins> <code><a href=
"#iframe"><ins class="diff-new">iframe</ins></a></code> <ins class=
"diff-new">element's document, or the</ins> <a href=
"#browsing1"><ins class="diff-new">browsing context</ins></a>
<ins class="diff-new">'s</ins> <a href="#active"><ins class=
"diff-new">active document</ins></a> <ins class="diff-new">'s</ins>
<em><ins class="diff-new">URI</ins></em> <ins class="diff-new">has
the</ins> <a href="#same-origin"><ins class="diff-new">same
origin</ins></a> <ins class="diff-new">as the</ins> <code><a href=
"#iframe"><ins class="diff-new">iframe</ins></a></code> <ins class=
"diff-new">element's document, the following requirements
apply:</ins></p>
<ul>
<li>
<p><ins class="diff-new">The user agent must set the</ins> <dfn id=
"seamless0"><ins class="diff-new">seamless browsing context
flag</ins></dfn> <ins class="diff-new">to true for that</ins>
<a href="#browsing1"><ins class="diff-new">browsing
context</ins></a> .<ins class="diff-new">This will</ins> <a href=
"#seamlessLinks"><ins class="diff-new">cause links to open in the
parent browsing context</ins></a> .</p>
</li>
<li>
<p><ins class="diff-new">In a CSS-supporting user agent: the user
agent must add all the style sheets that apply to the</ins>
<code><a href="#iframe"><ins class=
"diff-new">iframe</ins></a></code> <ins class="diff-new">element to
the cascade of the</ins> <a href="#active"><ins class=
"diff-new">active document</ins></a> <ins class="diff-new">of
the</ins> <code><a href="#iframe"><ins class=
"diff-new">iframe</ins></a></code> <ins class=
"diff-new">element's</ins> <a href="#nested0"><ins class=
"diff-new">nested browsing context</ins></a> ,<ins class=
"diff-new">at the appropriate cascade levels, before any style
sheets specified by the document itself.</ins></p>
</li>
<li>
<p><ins class="diff-new">In a CSS-supporting user agent: the user
agent must, for the purpose of CSS property inheritance only, treat
the root element of the</ins> <a href="#active"><ins class=
"diff-new">active document</ins></a> <ins class="diff-new">of
the</ins> <code><a href="#iframe"><ins class=
"diff-new">iframe</ins></a></code> <ins class=
"diff-new">element's</ins> <a href="#nested0"><ins class=
"diff-new">nested browsing context</ins></a> <ins class=
"diff-new">as being a child of the</ins> <code><a href=
"#iframe"><ins class="diff-new">iframe</ins></a></code> <ins class=
"diff-new">element. (Thus inherited properties on the root element
of the document in the</ins> <code><a href="#iframe"><ins class=
"diff-new">iframe</ins></a></code> <ins class="diff-new">will
inherit the computed values of those properties on the</ins>
<code><a href="#iframe"><ins class=
"diff-new">iframe</ins></a></code> <ins class="diff-new">element
instead of taking their initial values.)</ins></p>
</li>
<li>
<p><ins class="diff-new">In visual media, in a CSS-supporting user
agent: the user agent should set the intrinsic width of the</ins>
<code><a href="#iframe"><ins class=
"diff-new">iframe</ins></a></code> <ins class="diff-new">to the
width that the element would have if it was a non-replaced
block-level element with 'width: auto'.</ins></p>
</li>
<li>
<p><ins class="diff-new">In visual media, in a CSS-supporting user
agent: the user agent should set the intrinsic height of the</ins>
<code><a href="#iframe"><ins class=
"diff-new">iframe</ins></a></code> <ins class="diff-new">to the
height of the bounding box around the content rendered in the</ins>
<code><a href="#iframe"><ins class=
"diff-new">iframe</ins></a></code> <ins class="diff-new">at its
current width.</ins></p>
</li>
<li>
<p><ins class="diff-new">In visual media, in a CSS-supporting user
agent: the user agent must force the height of the initial
containing block of the</ins> <a href="#active"><ins class=
"diff-new">active document</ins></a> <ins class="diff-new">of
the</ins> <a href="#nested0"><ins class="diff-new">nested browsing
context</ins></a> <ins class="diff-new">of the</ins> <code><a href=
"#iframe"><ins class="diff-new">iframe</ins></a></code> <ins class=
"diff-new">to zero.</ins></p>
<p class="note"><ins class="diff-new">This is intended to get
around the otherwise circular dependency of percentage dimensions
that depend on the height of the containing block, thus affecting
the height of the document's bounding box, thus affecting the
height of the viewport, thus affecting the size of the initial
containing block.</ins></p>
</li>
<li>
<p><ins class="diff-new">In speech media, the user agent should
render the</ins> <a href="#nested0"><ins class="diff-new">nested
browsing context</ins></a> <ins class="diff-new">without announcing
that it is a separate document.</ins></p>
</li>
<li>
<p><ins class="diff-new">User agents should, in general, act as if
the</ins> <a href="#active"><ins class="diff-new">active
document</ins></a> <ins class="diff-new">of the</ins>
<code><a href="#iframe"><ins class=
"diff-new">iframe</ins></a></code> <ins class="diff-new">'s</ins>
<a href="#nested0"><ins class="diff-new">nested browsing
context</ins></a> <ins class="diff-new">was part of the document
that the</ins> <code><a href="#iframe"><ins class=
"diff-new">iframe</ins></a></code> <ins class="diff-new">is
in.</ins></p>
<p class="example"><ins class="diff-new">For example if the user
agent supports listing all the links in a document, links in
"seamlessly" nested documents would be included in that list
without being significantly distinguished from links in the
document itself.</ins></p>
</li>
</ul>
<p class="big-issue"><ins class="diff-new">Parts of the above might
get moved into the rendering section at some point.</ins></p>
<p><ins class="diff-new">If the attribute is not specified, or if
the</ins> <a href="#origin0"><ins class="diff-new">origin</ins></a>
<ins class="diff-new">conditions listed above are not met, then the
user agent should render the</ins> <a href="#nested0"><ins class=
"diff-new">nested browsing context</ins></a> <ins class=
"diff-new">in a manner that is clearly distinguishable as a
separate</ins> <a href="#browsing1"><ins class="diff-new">browsing
context</ins></a> ,<ins class="diff-new">and the</ins> <a href=
"#seamless0"><ins class="diff-new">seamless browsing context
flag</ins></a> <ins class="diff-new">must be set to false for
that</ins> <a href="#browsing1"><ins class="diff-new">browsing
context</ins></a> .</p>
<p class="warning"><ins class="diff-new">It is important that user
agents recheck the above conditions whenever the</ins> <a href=
"#active"><ins class="diff-new">active document</ins></a>
<ins class="diff-new">of the</ins> <a href="#nested0"><ins class=
"diff-new">nested browsing context</ins></a> <ins class=
"diff-new">of the</ins> <code><a href="#iframe"><ins class=
"diff-new">iframe</ins></a></code> <ins class="diff-new">changes,
such that the</ins> <a href="#seamless0"><ins class=
"diff-new">seamless browsing context flag</ins></a> <ins class=
"diff-new">gets unset if the</ins> <a href="#nested0"><ins class=
"diff-new">nested browsing context</ins></a> <ins class=
"diff-new">is</ins> <a href="#navigate" title=
"navigate"><ins class="diff-new">navigated</ins></a> <ins class=
"diff-new">to another origin.</ins></p>
<div class="example">
<p><ins class="diff-new">In this example, the site's navigation is
embedded using a client-side include using an</ins> <code><a href=
"#iframe"><ins class="diff-new">iframe</ins></a></code>
.<ins class="diff-new">Any links in the</ins> <code><a href=
"#iframe"><ins class="diff-new">iframe</ins></a></code> <ins class=
"diff-new">will, in new user agents, be automatically opened in
the</ins> <code><a href="#iframe"><ins class=
"diff-new">iframe</ins></a></code> <ins class="diff-new">'s parent
browsing context; for legacy user agents, the site could also
include a</ins> <code><a href="#base"><ins class=
"diff-new">base</ins></a></code> <ins class="diff-new">element with
a</ins> <code title="attr-base-target"><a href=
"#target"><ins class="diff-new">target</ins></a></code> <ins class=
"diff-new">attribute with the value</ins> <code title=
""><ins class="diff-new">_parent</ins></code> .<ins class=
"diff-new">Similarly, in new user agents the styles of the parent
page will be automatically applied to the contents of the frame,
but to support legacy user agents authors might wish to include the
styles explicitly.</ins></p>
<pre>
<ins class="diff-new">
<nav>
<iframe
seamless
src="nav.include.html">
</iframe>
</nav>
</ins>
</pre></div>
<hr>
<p><ins class="diff-new">The</ins> <code><a href=
"#iframe"><ins class="diff-new">iframe</ins></a></code> <ins class=
"diff-new">element supports</ins> <a href="#dimension0"><ins class=
"diff-new">dimension attributes</ins></a> <ins class="diff-new">for
cases where the embedded content has specific dimensions (e.g. ad
units have well-defined dimensions).</ins></p>
<p>An <code><a href="#iframe">iframe</a></code> element never has
<a href="#fallback">fallback content</a> , as it will always create
a nested <a href="#browsing1">browsing context</a> , regardless of
whether the specified initial contents are successfully used.</p>
<p>Descendants of <code><a href="#iframe">iframe</a></code>
elements represent nothing. (In legacy user agents that do not
support <code><a href="#iframe">iframe</a></code> elements, the
contents would be parsed as markup that could act as fallback
content.)</p>
<p>The content model of <code><a href="#iframe">iframe</a></code>
elements is text, except that the text must be such that
<del class="diff-old">...</del> <span class="big-issue">... anyone
have any bright ideas?</span></p>
<p class="note">The <a href="#html-0">HTML parser</a> treats markup
inside <code><a href="#iframe">iframe</a></code> elements as
text.</p>
<p>The DOM <del class="diff-old">attribute</del> <ins class=
"diff-chg">attributes</ins> <dfn id="src2" title=
"dom-iframe-src"><code>src</code></dfn> , <dfn id="name2" title=
"dom-iframe-name"><code><ins class=
"diff-new">name</ins></code></dfn> ,<dfn id="sandbox0" title=
"dom-iframe-sandbox"><code><ins class=
"diff-new">sandbox</ins></code></dfn> ,<ins class=
"diff-new">and</ins> <dfn id="seamless1" title=
"dom-iframe-seamless"><code><ins class=
"diff-new">seamless</ins></code></dfn> must <a href=
"#reflect">reflect</a> the content <del class=
"diff-old">attribute</del> <ins class="diff-chg">attributes</ins>
of the same name.</p>
<h4 id="the-embed"><span class="secno"><del class=
"diff-old">3.14.4.</del> <ins class="diff-chg">3.12.4</ins></span>
The <dfn id="embed"><code>embed</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#embedded1">Embedded content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#embedded1">embedded content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>Empty.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-embed-src"><a href=
"#src3">src</a></code></dd>
<dd><code title="attr-embed-type"><a href=
"#type4">type</a></code></dd>
<dd><code title="attr-dim-width"><a href=
"#width4">width</a></code></dd>
<dd><code title="attr-dim-height"><a href=
"#height3">height</a></code></dd>
<dd>Any other attribute that has no namespace (see prose).</dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlembedelement">HTMLEmbedElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#src4" title=
"dom-embed-src">src</a>;
attribute DOMString <a href="#type5" title=
"dom-embed-type">type</a>;
<del class="diff-old"> attribute long ;
</del>
<ins class="diff-chg"> attribute long <a href="#width5"
title="dom-dim-width">width</a>;
</ins>
attribute long <a href="#height4" title=
"dom-dim-height">height</a>;
};
</pre>
<p>Depending on the type of content instantiated by the
<code><a href="#embed">embed</a></code> element, the node may also
support other interfaces.</p>
</dd>
</dl>
<p>The <code><a href="#embed">embed</a></code> element represents
an integration point for an external (typically non-HTML)
application or interactive content.</p>
<p>The <dfn id="src3" title="attr-embed-src"><code>src</code></dfn>
attribute gives the address of the resource being embedded. The
attribute must be present and contain a URI (or IRI).</p>
<p>If the <code title="attr-embed-src"><a href=
"#src3">src</a></code> attribute is missing, then the
<code><a href="#embed">embed</a></code> element must be <del class=
"diff-old">ignored.</del> <ins class="diff-chg">ignored (it
represents nothing).</ins></p>
<p id="sandboxPluginEmbed"><ins class="diff-chg">If the</ins>
<a href="#sandboxed0"><ins class="diff-chg">sandboxed plugins
browsing context flag</ins></a> <ins class="diff-chg">is set on
the</ins> <a href="#browsing1"><ins class="diff-chg">browsing
context</ins></a> <ins class="diff-chg">for which the</ins>
<code><a href="#embed"><ins class="diff-chg">embed</ins></a></code>
<ins class="diff-chg">element's document is the</ins> <a href=
"#active"><ins class="diff-chg">active document</ins></a>
,<ins class="diff-chg">then the user agent must render the</ins>
<code><a href="#embed"><ins class="diff-chg">embed</ins></a></code>
<ins class="diff-chg">element in a manner that conveys that
the</ins> <a href="#plugin"><ins class="diff-chg">plugin</ins></a>
<ins class="diff-chg">was disabled. The user agent may offer the
user the option to override the sandbox and instantiate the</ins>
<a href="#plugin"><ins class="diff-chg">plugin</ins></a>
<ins class="diff-chg">anyway; if the user invokes such an option,
the user agent must act as if the</ins> <a href=
"#sandboxed0"><ins class="diff-chg">sandboxed plugins browsing
context flag</ins></a> <ins class="diff-chg">was not set for the
purposes of this element.</ins></p>
<p class="warning"><ins class="diff-chg">Plugins are disabled in
sandboxed browsing contexts because they might not honor the
restrictions imposed by the sandbox (e.g. they might allow
scripting even when scripting in the sandbox is disabled). User
agents should convey the danger of overriding the sandbox to the
user if an option to do so is provided.</ins></p>
<p><ins class="diff-chg">Otherwise, the</ins> <code title=
"attr-embed-src"><a href="#src3"><ins class=
"diff-chg">src</ins></a></code> <ins class="diff-chg">attribute is
present, and the element is not in a sandboxed browsing
context:</ins></p>
<p>When the <code title="attr-embed-src"><a href=
"#src3">src</a></code> attribute is set, user agents are expected
to find an appropriate <del class="diff-old">handler</del> <a href=
"#plugin"><ins class="diff-chg">plugin</ins></a> for the specified
resource, based on the <a href="#type-of" title=
"concept-embed-type">content's type</a> , and hand that <del class=
"diff-old">handler</del> <a href="#plugin"><ins class=
"diff-chg">plugin</ins></a> the content of the resource. If the
<del class="diff-old">handler</del> <a href="#plugin"><ins class=
"diff-chg">plugin</ins></a> supports a scriptable interface, the
<code><a href="#htmlembedelement">HTMLEmbedElement</a></code>
object representing the element should expose that interfaces.</p>
<p>The download of the resource must <a href="#delays">delay the
<code title="event-load">load</code> event</a> .</p>
<p>The user agent should pass the names and values of all the
attributes of the <code><a href="#embed">embed</a></code> element
that have no namespace to the <del class="diff-old">handler</del>
<a href="#plugin"><ins class="diff-chg">plugin</ins></a> used. Any
(namespace-less) attribute may be specified on the <code><a href=
"#embed">embed</a></code> element. <del class="diff-old">This
specification does not define a mechanism for interacting with
third-party handlers, as it is expected to be user-agent-specific.
Some UAs might opt to support a plugin mechanism such as the
Netscape Plugin API; others may use remote content convertors or
have built-in support for certain types. [NPAPI]</del></p>
<p>The <code><a href="#embed">embed</a></code> element has no
<a href="#fallback">fallback content</a> . If the user agent can't
display the specified resource, e.g. because the given type is not
supported, then the user agent must use a default <del class=
"diff-old">handler</del> <ins class="diff-chg">plugin</ins> for the
content. (This default could be as simple as saying "Unsupported
Format", of course.)</p>
<p>The <dfn id="type4" title=
"attr-embed-type"><code>type</code></dfn> attribute, if present,
gives the MIME type of the linked resource. The value must be a
valid MIME type, optionally with parameters. <a href=
"#references">[RFC2046]</a></p>
<p>The <dfn id="type-of" title="concept-embed-type">type of the
content</dfn> being embedded is defined as follows:</p>
<ol>
<li>If the element has a <code title="attr-embed-type"><a href=
"#type4">type</a></code> attribute, then the value of the
<code title="attr-embed-type"><a href="#type4">type</a></code>
attribute is the <span>content's type</span> .</li>
<li>Otherwise, if the specified resource has <a href=
"#content-type8" title="Content-Type">explicit Content-Type
metadata</a> , then that is the <span>content's type</span> .</li>
<li>Otherwise, the content has no type and there can be no
appropriate <del class="diff-old">handler</del> <a href=
"#plugin"><ins class="diff-chg">plugin</ins></a> for it.</li>
</ol>
<p class="big-issue">Should we instead say that the
content-sniffing <del class="diff-old">that we're going to
define</del> <ins class="diff-chg">used</ins> for top-level
browsing contexts should apply here?</p>
<p class="big-issue">Should we require the type attribute to match
the server information?</p>
<p class="big-issue">We should say that 404s, etc, don't affect
whether the resource is used or not. Not sure how to say it here
though.</p>
<p><del class="diff-old">Browsers should take extreme care when
interacting with external content intended for third-party
renderers. When third-party software is run with the same
privileges as the user agent itself, vulnerabilities in the
third-party software become as dangerous as those in the user
agent.</del> The <code><a href="#embed">embed</a></code> element
supports <a href="#dimension0">dimension attributes</a> .</p>
<p>The DOM attributes <dfn id="src4" title=
"dom-embed-src"><code>src</code></dfn> and <dfn id="type5" title=
"dom-embed-type"><code>type</code></dfn> each must <a href=
"#reflect">reflect</a> the respective content attributes of the
same name.</p>
<h4 id="the-object"><span class="secno"><del class=
"diff-old">3.14.5.</del> <ins class="diff-chg">3.12.5</ins></span>
The <dfn id="object"><code>object</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#embedded1">Embedded content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#embedded1">embedded content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>Zero or more <code><a href="#param">param</a></code> elements,
then, <a href="#transparent0">transparent</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-object-data"><a href=
"#data">data</a></code></dd>
<dd><code title="attr-object-type"><a href=
"#type6">type</a></code></dd>
<dd><code title="attr-object-name"><a href="#name3"><ins class=
"diff-new">name</ins></a></code></dd>
<dd><code title="attr-hyperlink-usemap"><a href=
"#usemap1">usemap</a></code></dd>
<dd><code title="attr-dim-width"><a href=
"#width4">width</a></code></dd>
<dd><code title="attr-dim-height"><a href=
"#height3">height</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlobjectelement">HTMLObjectElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#data0" title=
"dom-object-data">data</a>;
attribute DOMString <a href="#type7" title=
"dom-object-type">type</a>;
<ins class="diff-new"> attribute DOMString <a href=
"#name4" title="dom-object-name">name</a>;
</ins>
attribute DOMString <a href="#usemap0" title=
"dom-object-useMap">useMap</a>;
<del class="diff-old"> attribute long ;
</del>
<ins class="diff-chg"> attribute long <a href="#width5"
title="dom-dim-width">width</a>;
</ins>
attribute long <a href="#height4" title=
"dom-dim-height">height</a>;
};
</pre>
<p>Objects implementing the <code><a href=
"#htmlobjectelement">HTMLObjectElement</a></code> interface must
also implement the <code>EmbeddingElement</code> interface defined
in the Window Object specification. <a href=
"#references">[WINDOW]</a></p>
<p>Depending on the type of content instantiated by the
<code><a href="#object">object</a></code> element, the node may
also support other interfaces.</p>
</dd>
</dl>
<p>The <code><a href="#object">object</a></code> element can
represent an external resource, which, depending on the type of the
resource, will either be treated as an image, as a nested <a href=
"#browsing1">browsing context</a> , or as an external resource to
be processed by a <del class="diff-old">third-party software
package.</del> <a href="#plugin"><ins class=
"diff-chg">plugin</ins></a> .</p>
<p>The <dfn id="data" title=
"attr-object-data"><code>data</code></dfn> attribute, if present,
specifies the address of the resource. If present, the attribute
must be a URI (or IRI).</p>
<p>The <dfn id="type6" title=
"attr-object-type"><code>type</code></dfn> attribute, if present,
specifies the type of the resource. If present, the attribute must
be a valid MIME type, optionally with parameters. <a href=
"#references">[RFC2046]</a></p>
<p>One or both of the <code title="attr-object-data"><a href=
"#data">data</a></code> and <code title="attr-object-type"><a href=
"#type6">type</a></code> attributes must be present.</p>
<p><del class="diff-old">Whenever</del> <ins class=
"diff-chg">The</ins> <dfn id="name3" title=
"attr-object-name"><code><ins class=
"diff-chg">name</ins></code></dfn> <ins class="diff-chg">attribute,
if present, must be a</ins> <a href="#valid8"><ins class=
"diff-chg">valid browsing context name</ins></a> .</p>
<p><ins class="diff-chg">When the element is created, and
subsequently whenever the</ins> <code title=
"attr-object-classid"><ins class="diff-chg">classid</ins></code>
<ins class="diff-chg">attribute changes, or, if the</ins>
<code title="attr-object-classid"><ins class=
"diff-chg">classid</ins></code> <ins class="diff-chg">attribute is
not present, whenever</ins> the <code title=
"attr-object-data"><a href="#data">data</a></code> attribute
changes, or, if <ins class="diff-new">neither</ins> <code title=
"attr-object-classid"><ins class="diff-new">classid</ins></code>
<ins class="diff-new">attribute nor</ins> the <code title=
"attr-object-data"><a href="#data">data</a></code> attribute
<del class="diff-old">is not</del> <ins class="diff-chg">are</ins>
present, whenever the <code title="attr-object-type"><a href=
"#type6">type</a></code> attribute changes, the user agent must run
the following steps to determine what the <code><a href=
"#object">object</a></code> element represents:</p>
<ol>
<li>
<p>If the <code title="attr-object-classid"><ins class=
"diff-new">classid</ins></code> <ins class="diff-new">attribute is
present, and has a value that isn't the empty string, then: if the
user agent can find a</ins> <a href="#plugin"><ins class=
"diff-new">plugin</ins></a> <ins class="diff-new">suitable
according to the value of the</ins> <code title=
"attr-object-classid"><ins class="diff-new">classid</ins></code>
<ins class="diff-new">attribute, and</ins> <a href=
"#sandboxPluginObject"><ins class="diff-new">plugins aren't being
sandboxed</ins></a> ,<ins class="diff-new">then that</ins> <a href=
"#plugin"><ins class="diff-new">plugin</ins></a> <a href=
"#object-plugin"><ins class="diff-new">should be used</ins></a>
,<ins class="diff-new">and the value of the</ins> <code title=
"attr-object-data"><a href="#data"><ins class=
"diff-new">data</ins></a></code> <ins class="diff-new">attribute,
if any, should be passed to the</ins> <a href="#plugin"><ins class=
"diff-new">plugin</ins></a> .<ins class="diff-new">If no
suitable</ins> <a href="#plugin"><ins class=
"diff-new">plugin</ins></a> <ins class="diff-new">can be found, or
if the</ins> <a href="#plugin"><ins class=
"diff-new">plugin</ins></a> <ins class="diff-new">reports an error,
jump to the last step in the overall set of steps
(fallback).</ins></p>
</li>
<li>
<p><ins class="diff-new">If the</ins> <code title=
"attr-object-data"><a href="#data">data</a></code> attribute is
present, then:</p>
<ol>
<li>
<p><ins class="diff-new">If the</ins> <code title=
"attr-object-type"><a href="#type6"><ins class=
"diff-new">type</ins></a></code> <ins class="diff-new">attribute is
present and its value is not a type that the user agent supports,
and is not a type that the user agent can find a</ins> <a href=
"#plugin"><ins class="diff-new">plugin</ins></a> <ins class=
"diff-new">for, then the user agent may jump to the last step in
the overall set of steps (fallback) without downloading the content
to examine its real type.</ins></p>
</li>
<li>
<p>Begin a load for the resource.</p>
<p>The download of the resource must <a href="#delays">delay the
<code title="event-load">load</code> event</a> .</p>
</li>
<li>
<p>If the resource is not yet available (e.g. because the resource
was not available in the cache, so that loading the resource
required making a request over the network), then jump to
<ins class="diff-new">the last</ins> step <del class=
"diff-old">3</del> in the overall set of steps (fallback). When the
resource becomes available, or if the load fails, restart this
algorithm from this step. Resources can load incrementally; user
agents may opt to consider a resource "available" whenever enough
data has been obtained to begin processing the resource.</p>
</li>
<li>
<p>If the load failed (e.g. <ins class="diff-new">an HTTP 404
error, a</ins> DNS error), <a href="#firing5">fire an <code title=
"event-error">error</code> event</a> at the element, then jump to
<ins class="diff-new">the last</ins> step <del class=
"diff-old">3</del> in the overall set of steps (fallback).</p>
</li>
<li>
<p>Determine the <var title="">resource type <del class=
"diff-old">,</del></var> , as follows:</p>
<del class="diff-old">This says to trust the type. Should we
instead use</del>
<ol>
<li>
<p><ins class="diff-chg">Let</ins> the <del class="diff-old">same
mechanism as for browsing contexts?</del> <var title=""><ins class=
"diff-chg">resource type</ins></var> <ins class="diff-chg">be
unknown.</ins></p>
</li>
<li>
<p>If the resource has <a href="#content-type8" title=
"Content-Type">associated Content-Type metadata <del class=
"diff-old">The</del></a> , <ins class="diff-chg">then let the</ins>
<var title=""><ins class="diff-chg">resource</ins> type <del class=
"diff-old">is</del></var> <ins class="diff-chg">be</ins> the type
specified in <a href="#content-type8" title="Content-Type">the
resource's Content-Type metadata</a> . <del class=
"diff-old">Otherwise, if</del></p>
</li>
<li>
<p><ins class="diff-chg">If</ins> the <var title=""><ins class=
"diff-new">resource type</ins></var> <ins class="diff-new">is
unknown or "</ins> <code title=""><ins class=
"diff-new">application/octet-stream</ins></code> <ins class=
"diff-new">" and there is a</ins> <code title=
"attr-object-type"><a href="#type6">type</a></code> attribute
<del class="diff-old">is</del> present <del class=
"diff-old">The</del> <ins class="diff-chg">on the</ins>
<code><a href="#object"><ins class=
"diff-chg">object</ins></a></code> <ins class="diff-chg">element,
then change the</ins> <var title=""><ins class=
"diff-chg">resource</ins> type <del class="diff-old">is</del></var>
<ins class="diff-chg">to instead be</ins> the type specified in
<del class="diff-old">the</del> <ins class="diff-chg">that</ins>
<code title="attr-object-type"><a href="#type6">type</a></code>
attribute. <del class="diff-old">Otherwise, there is no explicit
type information The</del></p>
</li>
<li>
<p><ins class="diff-chg">If the</ins> <var title=""><ins class=
"diff-chg">resource</ins> type</var> is <ins class="diff-new">still
unknown, then change</ins> the <var title=""><ins class=
"diff-chg">resource type</ins></var> <ins class="diff-chg">to
instead be the</ins> <a href="#sniffed" title=
"content-type sniffing">sniffed type of the resource <del class=
"diff-old">.</del></a> .</p>
</li>
</ol>
</li>
<li>
<p>Handle the content as given by the first of the following cases
that matches:</p>
<dl class="switch">
<dt>If the <var title="">resource <del class="diff-old">requires a
special handler (e.g.</del> <ins class="diff-chg">type</ins></var>
<ins class="diff-chg">can be handled by</ins> a <del class=
"diff-old">plugin)</del> <a href="#plugin"><ins class=
"diff-chg">plugin</ins></a> <ins class="diff-chg">and</ins>
<a href="#sandboxPluginObject"><ins class="diff-chg">plugins aren't
being sandboxed</ins></a></dt>
<dd>
<p>The user agent <a href="#object-plugin">should <del class=
"diff-old">find an appropriate handler for the specified resource,
based on the resource type found in the previous step,</del>
<ins class="diff-chg">use that plugin</ins></a> and pass the
content of the resource to that <del class=
"diff-old">handler.</del> <a href="#plugin"><ins class=
"diff-chg">plugin</ins></a> . If the <del class="diff-old">handler
supports a scriptable interface, the HTMLObjectElement</del>
<a href="#plugin"><ins class="diff-chg">plugin</ins></a>
<del class="diff-old">object representing the element should expose
that interface. The handler is not a nested browsing context . If
no appropriate handler can be found,</del> <ins class=
"diff-chg">reports an error,</ins> then jump to <ins class=
"diff-new">the last</ins> step <del class="diff-old">3</del> in the
overall set of steps (fallback).</p>
<del class="diff-old">The user agent should pass the names and
values of all the parameters given by param elements that are
children of the object element to the handler used. This
specification does not define a mechanism for interacting with
third-party handlers, as it is expected to be user-agent-specific.
Some UAs might opt to support a plugin mechanism such as the
Netscape Plugin API; others may use remote content convertors or
have built-in support for certain types. [NPAPI] this doesn't
completely duplicate the navigation section, since it handles
<param>, etc, but surely some work should be done to work
with it</del></dd>
<dt>If the <del class="diff-old">type of the</del> <var title=
"">resource <ins class="diff-new">type</ins></var> is an <span>XML
MIME type</span></dt>
<dt>If the <del class="diff-old">type of the</del> <var title=
"">resource <ins class="diff-new">type</ins></var> is HTML</dt>
<dt>If the <del class="diff-old">type of the</del> <var title=
"">resource <ins class="diff-new">type</ins></var> does not start
with " <code>image/</code> "</dt>
<dd>
<p>The <code><a href="#object">object</a></code> element must be
associated with a nested <a href="#browsing1">browsing context</a>
, if it does not already have one. The element's nested <a href=
"#browsing1">browsing context</a> must then be <a href="#navigate"
title="navigate">navigated</a> to the given resource, with <a href=
"#replacement">replacement enabled</a> , <ins class="diff-new">and
with the</ins> <code><a href="#object"><ins class=
"diff-new">object</ins></a></code> <ins class="diff-new">element's
document's</ins> <a href="#browsing1"><ins class=
"diff-new">browsing context</ins></a> <ins class="diff-new">as
the</ins> <a href="#source0"><ins class="diff-new">source browsing
context</ins></a> . (The <code title="attr-object-data"><a href=
"#data">data</a></code> attribute of the <code><a href=
"#object">object</a></code> element doesn't get updated if the
browsing context gets further navigated to other locations.)</p>
<p><ins class="diff-new">If the</ins> <code title=
"attr-object-name"><a href="#name3"><ins class=
"diff-new">name</ins></a></code> <ins class="diff-new">attribute is
present, the</ins> <a href="#browsing2"><ins class=
"diff-new">browsing context name</ins></a> <ins class=
"diff-new">must be set to the value of this attribute; otherwise,
the</ins> <a href="#browsing2"><ins class="diff-new">browsing
context name</ins></a> <ins class="diff-new">must be set to the
empty string.</ins></p>
<p class="big-issue">navigation might end up treating it as
something else, because it can do sniffing. how should we handle
that?</p>
</dd>
<dt>If the <var title="">resource <del class="diff-old">is a
supported image format,</del> <ins class=
"diff-chg">type</ins></var> <ins class="diff-chg">starts with
"</ins> <code><ins class="diff-chg">image/</ins></code> <ins class=
"diff-chg">",</ins> and support for images has not been
disabled</dt>
<dd>
<p><ins class="diff-new">Apply the</ins> <a href="#content-type6"
title="content-type sniffing: image"><ins class="diff-new">image
sniffing</ins></a> <ins class="diff-new">rules to determine the
type of the image.</ins></p>
<p>The <code><a href="#object">object</a></code> element represents
the specified image. The image is not a nested <a href=
"#browsing1">browsing context</a> .</p>
<del class="diff-old">shouldn't we use</del>
<p><ins class="diff-chg">If</ins> the <del class=
"diff-old">image-sniffing stuff here?</del> <ins class=
"diff-chg">image cannot be rendered, e.g. because it is malformed
or in an unsupported format, jump to the last step in the overall
set of steps (fallback).</ins></p>
</dd>
<dt>Otherwise</dt>
<dd>
<p>The <del class="diff-old">object element represents the
specified image, but the image cannot be shown.</del> <ins class=
"diff-chg">given</ins> <var title=""><ins class="diff-chg">resource
type</ins></var> <ins class="diff-chg">is not supported.</ins> Jump
to <ins class="diff-new">the last</ins> step <del class=
"diff-old">3 below</del> in the overall set of steps
(fallback).</p>
</dd>
</dl>
</li>
<li>
<p>The element's contents are not part of what the <code><a href=
"#object">object</a></code> element represents.</p>
</li>
<li>
<p>Once the resource is completely loaded, <a href="#firing4">fire
a <code title="event-load">load</code> event</a> at the
element.</p>
</li>
</ol>
</li>
<li>
<p>If the <code title="attr-object-data"><a href=
"#data">data</a></code> attribute is absent but the <code title=
"attr-object-type"><a href="#type6">type</a></code> attribute is
present, <a href="#sandboxPluginObject"><ins class=
"diff-new">plugins aren't being sandboxed</ins></a> , and
<del class="diff-old">if</del> the user agent can find a
<del class="diff-old">handler</del> <a href="#plugin"><ins class=
"diff-chg">plugin</ins></a> suitable according to the value of the
<code title="attr-object-type"><a href="#type6">type</a></code>
attribute, then that <del class="diff-old">handler should be used.
If the handler supports a scriptable interface, the
HTMLObjectElement</del> <a href="#plugin"><ins class=
"diff-chg">plugin</ins></a> <del class="diff-old">object
representing the element</del> <a href="#object-plugin">should
<del class="diff-old">expose that interface. The handler is not a
nested browsing context</del> <ins class="diff-chg">be
used</ins></a> . If no suitable <del class="diff-old">handler</del>
<a href="#plugin"><ins class="diff-chg">plugin</ins></a> can be
found, <ins class="diff-new">or if the</ins> <a href=
"#plugin"><ins class="diff-new">plugin</ins></a> <ins class=
"diff-new">reports an error,</ins> jump to the next step
(fallback).</p>
</li>
<li>
<p>(Fallback.) The <code><a href="#object">object</a></code>
element <del class="diff-old">doesn't represent anything
except</del> <ins class="diff-chg">represents</ins> what the
element's contents represent, ignoring any leading <code><a href=
"#param">param</a></code> element children. This is the element's
<a href="#fallback">fallback content</a> .</p>
</li>
</ol>
<del class="diff-old">In</del>
<p id="object-plugin"><ins class="diff-chg">When</ins> the
<del class="diff-old">absence of other factors (such as style
sheets), user agents must show</del> <ins class=
"diff-chg">algorithm above instantiates a</ins> <a href=
"#plugin"><ins class="diff-chg">plugin</ins></a> , the user
<del class="diff-old">what</del> <ins class="diff-chg">agent should
pass the names and values of all the</ins> <span title=
"concept-param-parameter"><ins class=
"diff-chg">parameters</ins></span> <ins class="diff-chg">given
by</ins> <code><a href="#param"><ins class=
"diff-chg">param</ins></a></code> <ins class="diff-chg">elements
that are children of</ins> the <code><a href=
"#object">object</a></code> element <del class=
"diff-old">represents. Thus,</del> <ins class="diff-chg">to
the</ins> <a href="#plugin"><ins class="diff-chg">plugin</ins></a>
<ins class="diff-chg">used. If the</ins> <a href=
"#plugin"><ins class="diff-chg">plugin</ins></a> <ins class=
"diff-chg">supports a scriptable interface, the</ins>
<code><a href="#htmlobjectelement"><ins class=
"diff-chg">HTMLObjectElement</ins></a></code> <ins class=
"diff-chg">object representing the element should expose that
interface. The</ins> <a href="#plugin"><ins class=
"diff-chg">plugin</ins></a> <ins class="diff-chg">is not a
nested</ins> <a href="#browsing1"><ins class="diff-chg">browsing
context</ins></a> .</p>
<p id="sandboxPluginObject"><ins class="diff-chg">If the</ins>
<a href="#sandboxed0"><ins class="diff-chg">sandboxed plugins
browsing context flag</ins></a> <ins class="diff-chg">is set on
the</ins> <a href="#browsing1"><ins class="diff-chg">browsing
context</ins></a> <ins class="diff-chg">for which the</ins>
<code><a href="#object"><ins class=
"diff-chg">object</ins></a></code> <ins class="diff-chg">element's
document is the</ins> <a href="#active"><ins class=
"diff-chg">active document</ins></a> ,<ins class="diff-chg">then
the steps above must always act as if they had failed to find
a</ins> <a href="#plugin"><ins class="diff-chg">plugin</ins></a>
,<ins class="diff-chg">even if one would otherwise have been
used.</ins></p>
<p><ins class="diff-chg">Due to the algorithm above,</ins> the
contents of <code><a href="#object">object</a></code> elements act
as <a href="#fallback">fallback content</a> , <del class=
"diff-old">to be</del> used only when referenced resources can't be
shown (e.g. because it returned a 404 error). This allows multiple
<code><a href="#object">object</a></code> elements to be nested
inside each other, targeting multiple user agents with different
capabilities, with the user agent picking the <del class=
"diff-old">best</del> <ins class="diff-chg">first</ins> one it
supports.</p>
<p><ins class="diff-new">Whenever the</ins> <code title=
"attr-object-name"><a href="#name3"><ins class=
"diff-new">name</ins></a></code> <ins class="diff-new">attribute is
set, if the</ins> <code><a href="#object"><ins class=
"diff-new">object</ins></a></code> <ins class="diff-new">element
has a nested</ins> <a href="#browsing1"><ins class=
"diff-new">browsing context</ins></a> ,<ins class=
"diff-new">its</ins> <a href="#browsing2" title=
"browsing context name"><ins class="diff-new">name</ins></a>
<ins class="diff-new">must be changed to the new value. If the
attribute is removed, if the</ins> <code><a href=
"#object"><ins class="diff-new">object</ins></a></code> <ins class=
"diff-new">element has a</ins> <a href="#browsing1"><ins class=
"diff-new">browsing context</ins></a> ,<ins class=
"diff-new">the</ins> <a href="#browsing2"><ins class=
"diff-new">browsing context name</ins></a> <ins class=
"diff-new">must be set to the empty string.</ins></p>
<p>The <code title="attr-hyperlink-usemap"><a href=
"#usemap1">usemap</a></code> attribute, if present while the
<code><a href="#object">object</a></code> element represents an
image, can indicate that the object has an associated <a href=
"#image">image map</a> . The attribute must be ignored if the
<code><a href="#object">object</a></code> element doesn't represent
an image.</p>
<p>The <code><a href="#object">object</a></code> element supports
<a href="#dimension0">dimension attributes</a> .</p>
<p>The DOM attributes <dfn id="data0" title=
"dom-object-data"><code>data</code></dfn> , <dfn id="type7" title=
"dom-object-type"><code>type</code></dfn> , <dfn id="name4" title=
"dom-object-name"><code><ins class=
"diff-new">name</ins></code></dfn> , and <dfn id="usemap0" title=
"dom-object-useMap"><code>useMap</code></dfn> each must <a href=
"#reflect">reflect</a> the respective content attributes of the
same name.</p>
<div class="example">
<p><ins class="diff-new">In the following example, a Java applet is
embedded in a page using the</ins> <code><a href=
"#object"><ins class="diff-new">object</ins></a></code> <ins class=
"diff-new">element. (Generally speaking, it is better to avoid
using applets like these and instead use native JavaScript and HTML
to provide the functionality, since that way the application will
work on all Web browsers without requiring a third-party plugin.
Many devices, especially embedded devices, do not support
third-party technologies like Java.)</ins></p>
<pre>
<figure><ins class="diff-new">
<object type="application/x-java-applet">
<param name="code" value="MyJavaClass">
<p>You do not have Java available, or it is disabled.</p>
</object>
<legend>My Java Clock</legend>
</figure>
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-new">In this example, an HTML page is embedded
in another using the</ins> <code><a href="#object"><ins class=
"diff-new">object</ins></a></code> <ins class=
"diff-new">element.</ins></p>
<pre>
<figure><ins class="diff-new">
<object data="clock.html"></object>
<legend>My HTML Clock</legend>
</figure>
</ins>
</pre></div>
<h4 id="the-param"><span class="secno"><del class=
"diff-old">3.14.6.</del> <ins class="diff-chg">3.12.6</ins></span>
The <dfn id="param"><code>param</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>As a child of an <code><a href="#object">object</a></code>
element, before any <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a>
.</dd>
<dt>Content model:</dt>
<dd>Empty.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-param-name"><a href=
"#name5">name</a></code></dd>
<dd><code title="attr-param-value"><a href=
"#value5">value</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlparamelement">HTMLParamElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
<del class="diff-old"> attribute DOMString ;
</del>
<ins class="diff-chg"> attribute DOMString <a href=
"#name6" title="dom-param-name">name</a>;
</ins>
attribute DOMString <a href="#value6" title=
"dom-param-value">value</a>;
};
</pre></dd>
</dl>
<p>The <code><a href="#param">param</a></code> element defines
parameters for <del class="diff-old">handlers</del> <ins class=
"diff-chg">plugins</ins> invoked by <code><a href=
"#object">object</a></code> elements.</p>
<p>The <dfn id="name5" title=
"attr-param-name"><code>name</code></dfn> attribute gives the name
of the parameter.</p>
<p>The <dfn id="value5" title=
"attr-param-value"><code>value</code></dfn> attribute gives the
value of the parameter.</p>
<p>Both attributes must be present. They may have any value.</p>
<p>If both attributes are present, and if the parent element of the
<code><a href="#param">param</a></code> is an <code><a href=
"#object">object</a></code> element, then the element defines a
<dfn id="parameter" title=
"concept-param-parameters">parameter</dfn> with the given
name/value pair.</p>
<p>The DOM attributes <dfn id="name6" title=
"dom-param-name"><code>name</code></dfn> and <dfn id="value6"
title="dom-param-value"><code>value</code></dfn> must both <a href=
"#reflect">reflect</a> the respective content attributes of the
same name.</p>
<h4 id="video"><span class="secno"><del class=
"diff-old">3.14.7.</del> <ins class="diff-chg">3.12.7</ins></span>
The <dfn id="video1"><code>video</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#embedded1">Embedded content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#embedded1">embedded content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>If the element has a <code title="attr-media-src"><a href=
"#src7">src</a></code> attribute: <a href=
"#transparent0">transparent</a> .</dd>
<dd>If the element does not have a <code title=
"attr-media-src"><a href="#src7">src</a></code> attribute: one or
more <code><a href="#source">source</a></code> elements, then,
<a href="#transparent0">transparent</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-media-src"><a href=
"#src7">src</a></code></dd>
<dd><code title="attr-video-poster"><a href=
"#poster">poster</a></code></dd>
<dd><code title="attr-media-autoplay"><a href=
"#autoplay">autoplay</a></code></dd>
<dd><code title="attr-media-start"><a href=
"#start2">start</a></code></dd>
<dd><code title="attr-media-loopstart"><a href=
"#loopstart">loopstart</a></code></dd>
<dd><code title="attr-media-loopend"><a href=
"#loopend">loopend</a></code></dd>
<dd><code title="attr-media-end"><a href="#end">end</a></code></dd>
<dd><code title="attr-media-playcount"><a href=
"#playcount">playcount</a></code></dd>
<dd><code title="attr-media-controls"><a href=
"#controls">controls</a></code></dd>
<dd><code title="attr-dim-width"><a href=
"#width4">width</a></code></dd>
<dd><code title="attr-dim-height"><a href=
"#height3">height</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlvideoelement">HTMLVideoElement</dfn> : <a href=
"#htmlmediaelement">HTMLMediaElement</a> {
<del class="diff-old"> attribute long ;
</del>
<ins class="diff-chg"> attribute long <a href="#width5"
title="dom-dim-width">width</a>;
</ins>
attribute long <a href="#height4" title=
"dom-dim-height">height</a>;
readonly attribute unsigned long <a href="#videowidth" title=
"dom-video-videoWidth">videoWidth</a>;
readonly attribute unsigned long <a href="#videoheight" title=
"dom-video-videoHeight">videoHeight</a>;
attribute DOMString <a href="#poster0" title=
"dom-video-poster">poster</a>;
};
</pre></dd>
</dl>
<p>A <code><a href="#video1">video</a></code> element represents a
video or movie.</p>
<p>Content may be provided inside the <code><a href=
"#video1">video</a></code> element. User agents should not show
this content to the user; it is intended for older Web browsers
which do not support <code><a href="#video1">video</a></code> , so
that legacy video plugins can be tried, or to show text to the
users of these older browser informing them of how to access the
video contents.</p>
<p class="note">In particular, this content is not <i><a href=
"#fallback">fallback content</a></i> intended to address
accessibility concerns. To make video content accessible to the
blind, deaf, and those with other physical or cognitive
disabilities, authors are expected to provide alternative media
streams and/or to embed accessibility aids (such as caption or
subtitle tracks) into their media streams.</p>
<p>The <code><a href="#video1">video</a></code> element is a
<a href="#media7">media element</a> whose <a href="#media9">media
data</a> is ostensibly video data, possibly with associated audio
data.</p>
<p>The <code title="attr-media-src"><a href="#src7">src</a></code>
, <code title="attr-media-autoplay"><a href=
"#autoplay">autoplay</a></code> , <code title=
"attr-media-start"><a href="#start2">start</a></code> ,
<code title="attr-media-loopstart"><a href=
"#loopstart">loopstart</a></code> , <code title=
"attr-media-loopend"><a href="#loopend">loopend</a></code> ,
<code title="attr-media-end"><a href="#end">end</a></code> ,
<code title="attr-media-playcount"><a href=
"#playcount">playcount</a></code> , and <code title=
"attr-media-controls"><a href="#controls">controls</a></code>
attributes are <a href="#media8" title=
"media element attributes">the attributes common to all media
elements</a> .</p>
<p>The <code><a href="#video1">video</a></code> element supports
<a href="#dimension0">dimension attributes</a> .</p>
<p>The <dfn id="poster" title=
"attr-video-poster"><code>poster</code></dfn> attribute gives the
address of an image file that the user agent can show while no
video data is available. The attribute, if present, must contain a
URI (or IRI).</p>
<p>The <dfn id="poster0" title=
"dom-video-poster"><code>poster</code></dfn> DOM attribute must
<a href="#reflect">reflect</a> the <code title=
"attr-video-poster"><a href="#poster">poster</a></code> content
attribute.</p>
<p>The <dfn id="videowidth" title=
"dom-video-videoWidth"><code>videoWidth</code></dfn> DOM attribute
must return the native width of the video in CSS pixels. The
<dfn id="videoheight" title=
"dom-video-videoHeight"><code>videoHeight</code></dfn> DOM
attribute must return the native height of the video in CSS pixels.
In the absence of resolution information defining the mapping of
pixels in the video to physical dimensions, user agents may assume
that one pixel in the video corresponds to one CSS pixel. If no
video data is available, then the attributes must return 0.</p>
<p>When no video data is available (the element's <code title=
"dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute is either
<code title="dom-media-EMPTY"><a href="#empty">EMPTY</a></code> ,
<code title="dom-media-LOADING"><a href=
"#loading0">LOADING</a></code> , or <code title=
"dom-media-LOADED_METADATA"><a href=
"#loadedmetadata">LOADED_METADATA</a></code> ), <code><a href=
"#video1">video</a></code> elements represent either the image
given by the <code title="attr-video-poster"><a href=
"#poster">poster</a></code> attribute, or nothing.</p>
<p>When a <code><a href="#video1">video</a></code> element is
<a href="#actively">actively playing</a> , it represents the frame
of video at the continuously increasing <a href="#current0" title=
"current playback position">"current" position</a> . When the
<a href="#current0">current playback position</a> changes such that
the last frame rendered is no longer the frame corresponding to the
<a href="#current0">current playback position</a> in the video, the
new frame must be rendered. Similarly, any audio associated with
the video must, if played, be played <del class=
"diff-old">synchronised</del> <ins class=
"diff-chg">synchronized</ins> with the <a href="#current0">current
playback position</a> , at the specified <a href="#volume" title=
"dom-media-volume">volume</a> with the specified <a href="#muted"
title="dom-media-muted">mute state</a> .</p>
<p>When a <code><a href="#video1">video</a></code> element is
<a href="#paused" title="dom-media-paused">paused <del class=
"diff-old">,</del></a> <ins class="diff-chg">and the</ins> <a href=
"#current0" title="current playback position"><ins class=
"diff-chg">current playback position</ins></a> <ins class=
"diff-chg">is the first frame of video,</ins> the element
represents <ins class="diff-new">either</ins> the frame of video
corresponding to the <a href="#current0" title=
"current playback position"><ins class="diff-chg">current playback
position</ins></a> <ins class="diff-chg">or the image given by
the</ins> <code title="attr-video-poster"><a href=
"#poster"><ins class="diff-chg">poster</ins></a></code> <ins class=
"diff-chg">attribute, at the discretion of the user
agent.</ins></p>
<p><ins class="diff-chg">When a</ins> <code><a href=
"#video1"><ins class="diff-chg">video</ins></a></code> <ins class=
"diff-chg">element is</ins> <a href="#paused" title=
"dom-media-paused"><ins class="diff-chg">paused</ins></a>
<ins class="diff-chg">at any other position, the element represents
the frame of video corresponding to the</ins> <a href="#current0"
title="current playback position">current playback position</a> ,
or, if that is not <del class="diff-old">available</del> yet
<ins class="diff-new">available</ins> (e.g. because the video is
seeking or buffering), the last <del class=
"diff-old">rendered</del> frame of <del class=
"diff-old">video.</del> <ins class="diff-chg">the video to have
been rendered.</ins></p>
<p>When a <code><a href="#video1">video</a></code> element is
neither <a href="#actively">actively playing</a> nor <a href=
"#paused" title="dom-media-paused">paused</a> (e.g. when seeking or
stalled), the element represents the last frame of the video to
have been rendered.</p>
<p class="note">Which frame in a video stream corresponds to a
particular playback position is defined by the video stream's
format.</p>
<p>Video content should be rendered inside the element's playback
area such that the video content is shown centered in the playback
area at the largest possible size that fits completely within it,
with the video content's <a href="#adjusted"><ins class=
"diff-new">adjusted</ins> aspect ratio</a> being preserved. Thus,
if the aspect ratio of the playback area does not match the
<a href="#adjusted"><ins class="diff-new">adjusted</ins> aspect
ratio</a> of the video, the video will be shown letterboxed. Areas
of the element's playback area that do not contain the video
represent nothing.</p>
<p><ins class="diff-new">The</ins> <dfn id="adjusted"><ins class=
"diff-new">adjusted aspect ratio</ins></dfn> <ins class=
"diff-new">of a video is the ratio of its</ins> <a href=
"#adjusted0"><ins class="diff-new">adjusted width</ins></a>
<ins class="diff-new">to its intrinsic height. The</ins> <dfn id=
"adjusted0"><ins class="diff-new">adjusted width</ins></dfn>
<ins class="diff-new">of a video is its intrinsic width multiplied
by its</ins> <a href="#pixel0"><ins class="diff-new">pixel
ratio</ins></a> .</p>
<p>In addition to the above, the user agent may provide messages to
the user (such as "buffering", "no video loaded", "error", or more
detailed information) by overlaying text or icons on the video or
other areas of the element's playback area, or in another
appropriate manner.</p>
<p>User agents that cannot render the video may instead make the
element represent a link to an external video playback utility or
to the video data itself.</p>
<p>User agents should provide controls to enable or disable the
display of closed captions associated with the video stream, though
such features should, again, not interfere with the page's normal
rendering.</p>
<p>User agents may allow users to view the video content in manners
more suitable to the user (e.g. full-screen or in an independent
resizable window). As for the other user interface features,
controls to enable this should not interfere with the page's normal
rendering unless the user agent is <a href="#expose" title=
"expose a user interface to the user">exposing a user interface</a>
. In such an independent context, however, user agents may make
full user interfaces visible, with, e.g., play, pause, seeking, and
volume controls, even if the <code title=
"attr-media-controls"><a href="#controls">controls</a></code>
attribute is absent.</p>
<p>User agents may allow video playback to affect system features
that could interfere with the user's experience; for example, user
agents could disable screensavers while video playback is in
progress.</p>
<p class="warning">User agents should not provide a public API to
cause videos to be shown full-screen. A script, combined with a
carefully crafted video file, could trick the user into thinking a
system-modal dialog had been shown, and prompt the user for a
password. There is also the danger of "mere" annoyance, with pages
launching full-screen videos when links are clicked or pages
navigated. Instead, user-agent specific interface features may be
provided to easily allow the user to obtain a full-screen playback
mode.</p>
<p class="big-issue"><ins class="diff-new">The spec does not
currently define the interaction of the "controls" attribute with
the "height" and "width" attributes. This will likely be defined in
the rendering section based on implementation experience. So far,
browsers seem to be making the controls overlay-only, thus somewhat
sidestepping the issue.</ins></p>
<h5 id="video0"><span class="secno"><del class=
"diff-old">3.14.7.1.</del> <ins class=
"diff-chg">3.12.7.1.</ins></span> Video and audio codecs for
<code><a href="#video1">video</a></code> elements</h5>
<p>User agents may support any video and audio codecs and container
formats.</p>
<p class="big-issue">It would be helpful for interoperability if
all browsers could support the same codecs. However, there are no
known codecs that satisfy all the current players: we need a codec
that is known to not require per-unit or per-distributor licensing,
that is compatible with the open source development model, that is
of sufficient quality as to be usable, and that is not an
additional submarine patent risk for large companies. This is an
ongoing issue and this section will be updated once more
information is available.</p>
<p class="note">Certain user agents might support no codecs at all,
e.g. text browsers running over SSH connections.</p>
<h4 id="audio"><span class="secno"><del class=
"diff-old">3.14.8.</del> <ins class="diff-chg">3.12.8</ins></span>
The <dfn id="audio1"><code>audio</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#embedded1">Embedded content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#embedded1">embedded content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>If the element has a <code title="attr-media-src"><a href=
"#src7">src</a></code> attribute: <a href=
"#transparent0">transparent</a> .</dd>
<dd>If the element does not have a <code title=
"attr-media-src"><a href="#src7">src</a></code> attribute: one or
more <code><a href="#source">source</a></code> elements, then,
<a href="#transparent0">transparent</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-media-src"><a href=
"#src7">src</a></code></dd>
<dd><code title="attr-media-autoplay"><a href=
"#autoplay">autoplay</a></code></dd>
<dd><code title="attr-media-start"><a href=
"#start2">start</a></code></dd>
<dd><code title="attr-media-loopstart"><a href=
"#loopstart">loopstart</a></code></dd>
<dd><code title="attr-media-loopend"><a href=
"#loopend">loopend</a></code></dd>
<dd><code title="attr-media-end"><a href="#end">end</a></code></dd>
<dd><code title="attr-media-playcount"><a href=
"#playcount">playcount</a></code></dd>
<dd><code title="attr-media-controls"><a href=
"#controls">controls</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlaudioelement">HTMLAudioElement</dfn> : <a href=
"#htmlmediaelement">HTMLMediaElement</a> {
// no members
};
</pre></dd>
</dl>
<p>An <code><a href="#audio1">audio</a></code> element represents a
sound or audio stream.</p>
<p>Content may be provided inside the <code><a href=
"#audio1">audio</a></code> element. User agents should not show
this content to the user; it is intended for older Web browsers
which do not support <code><a href="#audio1">audio</a></code> , so
that legacy audio plugins can be tried, or to show text to the
users of these older browser informing them of how to access the
audio contents.</p>
<p class="note">In particular, this content is not <i><a href=
"#fallback">fallback content</a></i> intended to address
accessibility concerns. To make audio content accessible to the
deaf or to those with other physical or cognitive disabilities,
authors are expected to provide alternative media streams and/or to
embed accessibility aids (such as transcriptions) into their media
streams.</p>
<p>The <code><a href="#audio1">audio</a></code> element is a
<a href="#media7">media element</a> whose <a href="#media9">media
data</a> is ostensibly audio data.</p>
<p>The <code title="attr-media-src"><a href="#src7">src</a></code>
, <code title="attr-media-autoplay"><a href=
"#autoplay">autoplay</a></code> , <code title=
"attr-media-start"><a href="#start2">start</a></code> ,
<code title="attr-media-loopstart"><a href=
"#loopstart">loopstart</a></code> , <code title=
"attr-media-loopend"><a href="#loopend">loopend</a></code> ,
<code title="attr-media-end"><a href="#end">end</a></code> ,
<code title="attr-media-playcount"><a href=
"#playcount">playcount</a></code> , and <code title=
"attr-media-controls"><a href="#controls">controls</a></code>
attributes are <a href="#media8" title=
"media element attributes">the attributes common to all media
elements</a> .</p>
<p>When an <code><a href="#audio1">audio</a></code> element is
<a href="#actively">actively playing</a> , it must have its audio
data played <del class="diff-old">synchronised</del> <ins class=
"diff-chg">synchronized</ins> with the <a href="#current0">current
playback position</a> , at the specified <a href="#volume" title=
"dom-media-volume">volume</a> with the specified <a href="#muted"
title="dom-media-muted">mute state</a> .</p>
<p>When an <code><a href="#audio1">audio</a></code> element is not
<a href="#actively">actively playing</a> , audio must not play for
the element.</p>
<h5 id="audio0"><span class="secno"><del class=
"diff-old">3.14.8.1.</del> <ins class=
"diff-chg">3.12.8.1.</ins></span> Audio codecs for <code><a href=
"#audio1">audio</a></code> elements</h5>
<p>User agents may support any audio codecs and container
formats.</p>
<p>User agents must support the WAVE container format with audio
encoded using the PCM format.</p>
<h4 id="the-source"><span class="secno"><ins class=
"diff-new">3.12.9</ins></span> <ins class="diff-new">The</ins>
<dfn id="source"><code><ins class=
"diff-new">source</ins></code></dfn> <ins class=
"diff-new">element</ins></h4>
<dl class="element">
<dt><ins class="diff-new">Categories</ins></dt>
<dd><ins class="diff-new">None.</ins></dd>
<dt><ins class="diff-new">Contexts in which this element may be
used:</ins></dt>
<dd><ins class="diff-new">As a child of a</ins> <a href=
"#media7"><ins class="diff-new">media element</ins></a>
,<ins class="diff-new">before any</ins> <a href=
"#flow-content0"><ins class="diff-new">flow content</ins></a>
.</dd>
<dt><ins class="diff-new">Content model:</ins></dt>
<dd><ins class="diff-new">Empty.</ins></dd>
<dt><ins class="diff-new">Element-specific attributes:</ins></dt>
<dd><code title="attr-source-src"><a href="#src5"><ins class=
"diff-new">src</ins></a></code></dd>
<dd><code title="attr-source-type"><a href="#type8"><ins class=
"diff-new">type</ins></a></code></dd>
<dd><code title="attr-source-media"><a href="#media5"><ins class=
"diff-new">media</ins></a></code></dd>
<dd><code title="attr-source-pixelratio"><a href=
"#pixelratio"><ins class=
"diff-new">pixelratio</ins></a></code></dd>
<dt><ins class="diff-new">DOM interface:</ins></dt>
<dd>
<pre ins="" class="diff-new">
class=idl>interface <dfn id=
"htmlsourceelement">HTMLSourceElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#src6" title=
"dom-source-src">src</a>;
attribute DOMString <a href="#type9" title=
"dom-source-type">type</a>;
attribute DOMString <a href="#media6" title=
"dom-source-media">media</a>;
attribute float <a href="#pixelratio0" title=
"dom-source-pixelRatio">pixelRatio</a>;
};
</pre></dd>
</dl>
<p><ins class="diff-new">The</ins> <code><a href=
"#source"><ins class="diff-new">source</ins></a></code> <ins class=
"diff-new">element allows authors to specify multiple</ins>
<a href="#media10" title="media resource"><ins class=
"diff-new">media resources</ins></a> <ins class=
"diff-new">for</ins> <a href="#media7" title=
"media element"><ins class="diff-new">media elements</ins></a>
.</p>
<p><ins class="diff-new">The</ins> <dfn id="src5" title=
"attr-source-src"><code><ins class=
"diff-new">src</ins></code></dfn> <ins class="diff-new">attribute
gives the address of the</ins> <a href="#media10"><ins class=
"diff-new">media resource</ins></a> .<ins class="diff-new">The
value must be a URI (or IRI). This attribute must be
present.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="type8" title=
"attr-source-type"><code><ins class=
"diff-new">type</ins></code></dfn> <ins class="diff-new">attribute
gives the type of the</ins> <a href="#media10"><ins class=
"diff-new">media resource</ins></a> ,<ins class="diff-new">to help
the user agent determine if it can play this</ins> <a href=
"#media10"><ins class="diff-new">media resource</ins></a>
<ins class="diff-new">before downloading it. Its value must be a
MIME type. The</ins> <code title=""><ins class=
"diff-new">codecs</ins></code> <ins class="diff-new">parameter may
be specified and might be necessary to specify exactly how the
resource is encoded.</ins> <a href="#references"><ins class=
"diff-new">[RFC2046]</ins></a> <a href="#references"><ins class=
"diff-new">[RFC4281]</ins></a></p>
<div class="example">
<p><ins class="diff-new">The following list shows some examples of
how to use the</ins> <code title=""><ins class=
"diff-new">codecs=</ins></code> <ins class="diff-new">MIME
parameter in the</ins> <code title="attr-source-type"><a href=
"#type8"><ins class="diff-new">type</ins></a></code> <ins class=
"diff-new">attribute.</ins></p>
<dl>
<dt><ins class="diff-new">H.264 Simple baseline profile video (main
and extended video compatible) level 3 and Low-Complexity AAC audio
in MP4 container</ins></dt>
<dd>
<pre>
<ins class="diff-new">
<source
src="video.mp4"
type="video/mp4;
codecs=&quot;avc1.42E01E,
mp4a.40.2&quot;">
</ins>
</pre></dd>
<dt><ins class="diff-new">H.264 Extended profile video
(baseline-compatible) level 3 and Low-Complexity AAC audio in MP4
container</ins></dt>
<dd>
<pre>
<ins class="diff-new">
<source
src="video.mp4"
type="video/mp4;
codecs=&quot;avc1.58A01E,
mp4a.40.2&quot;">
</ins>
</pre></dd>
<dt><ins class="diff-new">H.264 Main profile video level 3 and
Low-Complexity AAC audio in MP4 container</ins></dt>
<dd>
<pre>
<ins class="diff-new">
<source
src="video.mp4"
type="video/mp4;
codecs=&quot;avc1.4D401E,
mp4a.40.2&quot;">
</ins>
</pre></dd>
<dt><ins class="diff-new">H.264 "High" profile video (incompatible
with main, baseline, or extended profiles) level 3 and
Low-Complexity AAC audio in MP4 container</ins></dt>
<dd>
<pre>
<ins class="diff-new">
<source
src="video.mp4"
type="video/mp4;
codecs=&quot;avc1.64001E,
mp4a.40.2&quot;">
</ins>
</pre></dd>
<dt><ins class="diff-new">MPEG-4 Visual Simple Profile Level 0
video and Low-Complexity AAC audio in MP4 container</ins></dt>
<dd>
<pre>
<ins class="diff-new">
<source
src="video.mp4"
type="video/mp4;
codecs=&quot;mp4v.20.8,
mp4a.40.2&quot;">
</ins>
</pre></dd>
<dt><ins class="diff-new">MPEG-4 Advanced Simple Profile Level 0
video and Low-Complexity AAC audio in MP4 container</ins></dt>
<dd>
<pre>
<ins class="diff-new">
<source
src="video.mp4"
type="video/mp4;
codecs=&quot;mp4v.20.240,
mp4a.40.2&quot;">
</ins>
</pre></dd>
<dt><ins class="diff-new">MPEG-4 Visual Simple Profile Level 0
video and AMR audio in 3GPP container</ins></dt>
<dd>
<pre>
<ins class="diff-new">
<source
src="video.3gp"
type="video/3gpp;
codecs=&quot;mp4v.20.8,
samr&quot;">
</ins>
</pre></dd>
<dt><ins class="diff-new">Theora video and Vorbis audio in Ogg
container</ins></dt>
<dd>
<pre>
<ins class="diff-new">
<source
src="video.ogv"
type="video/ogg;
codecs=&quot;theora,
vorbis&quot;">
</ins>
</pre></dd>
<dt><ins class="diff-new">Theora video and Speex audio in Ogg
container</ins></dt>
<dd>
<pre>
<ins class="diff-new">
<source
src="video.ogv"
type="video/ogg;
codecs=&quot;theora,
speex&quot;">
</ins>
</pre></dd>
<dt><ins class="diff-new">Vorbis audio alone in Ogg
container</ins></dt>
<dd>
<pre>
<ins class="diff-new">
<source
src="audio.ogg"
type="audio/ogg;
codecs=vorbis">
</ins>
</pre></dd>
<dt><ins class="diff-new">Speex audio alone in Ogg
container</ins></dt>
<dd>
<pre>
<ins class="diff-new">
<source
src="audio.spx"
type="audio/ogg;
codecs=speex">
</ins>
</pre></dd>
<dt><ins class="diff-new">FLAC audio alone in Ogg
container</ins></dt>
<dd>
<pre>
<ins class="diff-new">
<source
src="audio.oga"
type="audio/ogg;
codecs=flac">
</ins>
</pre></dd>
<dt><ins class="diff-new">Dirac video and Vorbis audio in Ogg
container</ins></dt>
<dd>
<pre>
<ins class="diff-new">
<source
src="video.ogv"
type="video/ogg;
codecs=&quot;dirac,
vorbis&quot;">
</ins>
</pre></dd>
<dt><ins class="diff-new">Theora video and Vorbis audio in Matroska
container</ins></dt>
<dd>
<pre>
<ins class="diff-new">
<source
src="video.mkv"
type="video/x-matroska;
codecs=&quot;theora,
vorbis&quot;">
</ins>
</pre></dd>
</dl>
</div>
<p><ins class="diff-new">The</ins> <dfn id="media5" title=
"attr-source-media"><code><ins class=
"diff-new">media</ins></code></dfn> <ins class="diff-new">attribute
gives the intended media type of the</ins> <a href=
"#media10"><ins class="diff-new">media resource</ins></a>
,<ins class="diff-new">to help the user agent determine if
this</ins> <a href="#media10"><ins class="diff-new">media
resource</ins></a> <ins class="diff-new">is useful to the user
before downloading it. Its value must be a valid</ins> <a href=
"#mq"><ins class="diff-new">media query</ins></a> .<a href=
"#references"><ins class="diff-new">[MQ]</ins></a></p>
<p><ins class="diff-new">Either the</ins> <code title=
"attr-source-type"><a href="#type8"><ins class=
"diff-new">type</ins></a></code> <ins class="diff-new">attribute,
the</ins> <code title="attr-source-media"><a href=
"#media5"><ins class="diff-new">media</ins></a></code> <ins class=
"diff-new">attribute or both, must be specified, unless this is the
last</ins> <code><a href="#source"><ins class=
"diff-new">source</ins></a></code> <ins class="diff-new">element
child of the parent element.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="pixelratio" title=
"attr-source-pixelratio"><code><ins class=
"diff-new">pixelratio</ins></code></dfn> <ins class=
"diff-new">attribute allows the author to specify the pixel ratio
of anamorphic</ins> <a href="#media10" title=
"media resource"><ins class="diff-new">media resources</ins></a>
<ins class="diff-new">that do not self-describe their pixel ratio.
The attribute value, if specified, must be a</ins> <a href=
"#valid1"><ins class="diff-new">valid floating point
number</ins></a> <ins class="diff-new">giving the ratio of the
correct rendered width of each pixel to the actual width of each
pixel in the image (i.e., the multiple by which the video's
intrinsic width is to be multiplied to obtain the rendered width
that gives the correct aspect ratio). The default value, if the
attribute is omitted or cannot be parsed, is 1.0.</ins></p>
<p><ins class="diff-new">If a</ins> <code><a href=
"#source"><ins class="diff-new">source</ins></a></code> <ins class=
"diff-new">element is inserted into a</ins> <a href=
"#media7"><ins class="diff-new">media element</ins></a> <ins class=
"diff-new">that is already in a document and whose</ins>
<code title="dom-media-networkState"><a href=
"#networkstate"><ins class="diff-new">networkState</ins></a></code>
<ins class="diff-new">is in the</ins> <code title=
"dom-media-EMPTY"><a href="#empty"><ins class=
"diff-new">EMPTY</ins></a></code> <ins class="diff-new">state, the
user agent must implicitly invoke the</ins> <code title=
"dom-media-load"><a href="#load"><ins class=
"diff-new">load()</ins></a></code> <ins class="diff-new">method on
the</ins> <a href="#media7"><ins class="diff-new">media
element</ins></a> <ins class="diff-new">as soon as all other
scripts have finished executing. Any exceptions raised must be
ignored.</ins></p>
<p><ins class="diff-new">The DOM attributes</ins> <dfn id="src6"
title="dom-source-src"><code><ins class=
"diff-new">src</ins></code></dfn> ,<dfn id="type9" title=
"dom-source-type"><code><ins class=
"diff-new">type</ins></code></dfn> ,<ins class="diff-new">and</ins>
<dfn id="media6" title="dom-source-media"><code><ins class=
"diff-new">media</ins></code></dfn> <ins class=
"diff-new">must</ins> <a href="#reflect"><ins class=
"diff-new">reflect</ins></a> <ins class="diff-new">the respective
content attributes of the same name.</ins></p>
<p><ins class="diff-new">The DOM attribute</ins> <dfn id=
"pixelratio0" title="dom-source-pixelRatio"><code><ins class=
"diff-new">pixelRatio</ins></code></dfn> <ins class=
"diff-new">must</ins> <a href="#reflect"><ins class=
"diff-new">reflect</ins></a> <ins class="diff-new">the</ins>
<code title="attr-source-pixelratio"><a href=
"#pixelratio"><ins class="diff-new">pixelratio</ins></a></code>
<ins class="diff-new">content attribute.</ins></p>
<h4 id="media"><span class="secno"><del class=
"diff-old">3.14.9.</del> <ins class="diff-chg">3.12.10</ins></span>
Media elements</h4>
<p><dfn id="media7" title="media element">Media elements</dfn>
implement the following interface:</p>
<pre class="idl">
interface <dfn id=
"htmlmediaelement">HTMLMediaElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
// error state
readonly attribute <a href="#mediaerror">MediaError</a> <a href=
"#error0" title="dom-media-error">error</a>;
// network state
<del class="diff-old"> attribute DOMString ;
</del>
<ins class="diff-chg"> attribute DOMString <a href=
"#src8" title="dom-media-src">src</a>;
</ins>
readonly attribute DOMString <a href="#currentsrc" title=
"dom-media-currentSrc">currentSrc</a>;
const unsigned short <a href="#empty" title=
"dom-media-EMPTY">EMPTY</a> = 0;
const unsigned short <a href="#loading0" title=
"dom-media-LOADING">LOADING</a> = 1;
const unsigned short <a href="#loadedmetadata" title=
"dom-media-LOADED_METADATA">LOADED_METADATA</a> = 2;
const unsigned short <a href="#loadedfirstframe" title=
"dom-media-LOADED_FIRST_FRAME">LOADED_FIRST_FRAME</a> = 3;
const unsigned short <a href="#loaded" title=
"dom-media-LOADED">LOADED</a> = 4;
readonly attribute unsigned short <a href="#networkstate" title=
"dom-media-networkState">networkState</a>;
readonly attribute float <a href="#bufferingrate" title=
"dom-media-bufferingRate">bufferingRate</a>;
<ins class="diff-new"> readonly attribute boolean <a href=
"#bufferingthrottled" title=
"dom-media-bufferingThrottled">bufferingThrottled</a>;
</ins>
readonly attribute <a href="#timeranges">TimeRanges</a> <a href=
"#buffered" title="dom-media-buffered">buffered</a>;
<ins class="diff-new"> readonly attribute <a href=
"#byteranges">ByteRanges</a> <a href="#bufferedbytes" title=
"dom-media-bufferedBytes">bufferedBytes</a>;
readonly attribute unsigned long <a href="#totalbytes" title=
"dom-media-totalBytes">totalBytes</a>;
</ins>
void <a href="#load" title="dom-media-load">load</a>();
// ready state
const unsigned short <a href="#dataunavailable" title=
"dom-media-DATA_UNAVAILABLE">DATA_UNAVAILABLE</a> = 0;
const unsigned short <a href="#canshowcurrentframe" title=
"dom-media-CAN_SHOW_CURRENT_FRAME">CAN_SHOW_CURRENT_FRAME</a> = 1;
const unsigned short <a href="#canplay" title=
"dom-media-CAN_PLAY">CAN_PLAY</a> = 2;
const unsigned short <a href="#canplaythrough" title=
"dom-media-CAN_PLAY_THROUGH">CAN_PLAY_THROUGH</a> = 3;
<del class="diff-old"> readonly attribute unsigned short ;
</del>
<ins class="diff-chg"> readonly attribute unsigned short <a href=
"#readystate0" title="dom-media-readyState">readyState</a>;
</ins>
readonly attribute boolean <a href="#seeking0" title=
"dom-media-seeking">seeking</a>;
// playback state
attribute float <a href="#currenttime" title=
"dom-media-currentTime">currentTime</a>;
readonly attribute float <a href="#duration" title=
"dom-media-duration">duration</a>;
readonly attribute boolean <a href="#paused" title=
"dom-media-paused">paused</a>;
attribute float <a href="#defaultplaybackrate" title=
"dom-media-defaultPlaybackRate">defaultPlaybackRate</a>;
attribute float <a href="#playbackrate" title=
"dom-media-playbackRate">playbackRate</a>;
readonly attribute <a href="#timeranges">TimeRanges</a> <a href=
"#played" title="dom-media-played">played</a>;
readonly attribute <a href="#timeranges">TimeRanges</a> <a href=
"#seekable" title="dom-media-seekable">seekable</a>;
readonly attribute boolean <a href="#ended0" title=
"dom-media-ended">ended</a>;
attribute boolean <a href="#autoplay0" title=
"dom-media-autoplay">autoplay</a>;
void <a href="#play" title="dom-media-play">play</a>();
void <a href="#pause0" title="dom-media-pause">pause</a>();
// looping
attribute float <a href="#start3" title=
"dom-media-start">start</a>;
attribute float <a href="#end0" title=
"dom-media-end">end</a>;
attribute float <a href="#loopstart0" title=
"dom-media-loopStart">loopStart</a>;
attribute float <a href="#loopend0" title=
"dom-media-loopEnd">loopEnd</a>;
attribute unsigned long <a href="#playcount0" title=
"dom-media-playCount">playCount</a>;
attribute unsigned long <a href="#currentloop" title=
"dom-media-currentLoop">currentLoop</a>;
// cue ranges
void <a href="#addcuerange" title=
"dom-media-addCueRange">addCueRange</a>(in DOMString className, in float start, in float end, in boolean pauseOnExit, in <a href="#voidcallback">VoidCallback</a> enterCallback, in <a href="#voidcallback">VoidCallback</a> exitCallback);
void <span title=
"dom-media-removeCueRange">removeCueRanges</span>(in DOMString className);
// controls
attribute boolean <a href="#controls0" title=
"dom-media-controls">controls</a>;
attribute float <a href="#volume" title=
"dom-media-volume">volume</a>;
attribute boolean <a href="#muted" title=
"dom-media-muted">muted</a>;
};
</pre>
<p>The <dfn id="media8">media element attributes</dfn> ,
<code title="attr-media-src"><a href="#src7">src</a></code> ,
<code title="attr-media-autoplay"><a href=
"#autoplay">autoplay</a></code> , <code title=
"attr-media-start"><a href="#start2">start</a></code> ,
<code title="attr-media-loopstart"><a href=
"#loopstart">loopstart</a></code> , <code title=
"attr-media-loopend"><a href="#loopend">loopend</a></code> ,
<code title="attr-media-end"><a href="#end">end</a></code> ,
<code title="attr-media-playcount"><a href=
"#playcount">playcount</a></code> , and <code title=
"attr-media-controls"><a href="#controls">controls</a></code> ,
apply to all <a href="#media7" title="media element">media
elements</a> . They are defined in this section.</p>
<p><a href="#media7" title="media element">Media elements</a> are
used to present audio data, or video and audio data, to the user.
This is referred to as <dfn id="media9">media data</dfn> in this
section, since this section applies equally to <a href="#media7"
title="media element">media elements</a> for audio or for video.
The term <dfn id="media10">media resource</dfn> is used to refer to
the complete set of media data, e.g. the complete video file, or
complete audio file.</p>
<h5 id="error"><span class="secno"><del class=
"diff-old">3.14.9.1.</del> <ins class=
"diff-chg">3.12.10.1.</ins></span> Error codes</h5>
<p>All <a href="#media7" title="media element">media elements</a>
have an associated error status, which records the last error the
element encountered since the <code title="dom-media-load"><a href=
"#load">load()</a></code> method was last invoked. The <dfn id=
"error0" title="dom-media-error"><code>error</code></dfn>
attribute, on getting, must return the <code><a href=
"#mediaerror">MediaError</a></code> object created for this last
error, or null if there has not been an error.</p>
<pre class="idl">
interface <dfn id="mediaerror">MediaError</dfn> {
const unsigned short <a href="#mediaerraborted" title=
"dom-MediaError-MEDIA_ERR_ABORTED">MEDIA_ERR_ABORTED</a> = 1;
const unsigned short <a href="#mediaerrnetwork" title=
"dom-MediaError-MEDIA_ERR_NETWORK">MEDIA_ERR_NETWORK</a> = 2;
const unsigned short <a href="#mediaerrdecode" title=
"dom-MediaError-MEDIA_ERR_DECODE">MEDIA_ERR_DECODE</a> = 3;
readonly attribute unsigned short <a href="#code0" title=
"dom-MediaError-code">code</a>;
};
</pre>
<p>The <dfn id="code0" title=
"dom-MediaError-code"><code>code</code></dfn> attribute of a
<code><a href="#mediaerror">MediaError</a></code> object must
return the code for the error, which must be one of the
following:</p>
<dl>
<dt><dfn id="mediaerraborted" title=
"dom-MediaError-MEDIA_ERR_ABORTED"><code>MEDIA_ERR_ABORTED</code></dfn>
(numeric value 1)</dt>
<dd>The download of the <a href="#media10">media resource</a> was
aborted by the user agent at the user's request.</dd>
<dt><dfn id="mediaerrnetwork" title=
"dom-MediaError-MEDIA_ERR_NETWORK"><code>MEDIA_ERR_NETWORK</code></dfn>
(numeric value 2)</dt>
<dd>A network error of some description caused the user agent to
stop downloading the <a href="#media10">media resource</a> .</dd>
<dt><dfn id="mediaerrdecode" title=
"dom-MediaError-MEDIA_ERR_DECODE"><code>MEDIA_ERR_DECODE</code></dfn>
(numeric value 3)</dt>
<dd>An error of some description occurred while decoding the
<a href="#media10">media resource</a> .</dd>
</dl>
<h5 id="location"><span class="secno"><del class=
"diff-old">3.14.9.2.</del> <ins class=
"diff-chg">3.12.10.2.</ins></span> Location of the media
resource</h5>
<p>The <dfn id="src7" title="attr-media-src"><code>src</code></dfn>
content attribute on <a href="#media7" title="media element">media
elements</a> gives the address of the media resource (video, audio)
to show. The attribute, if present, must contain a URI (or
IRI).</p>
<p>If the <code title="attr-media-src"><a href=
"#src7">src</a></code> attribute of a <a href="#media7">media
element</a> that is already in a document and whose <code title=
"dom-media-networkState"><a href=
"#networkstate">networkState</a></code> is in the <code title=
"dom-media-EMPTY"><a href="#empty">EMPTY</a></code> state is added,
changed, or removed, the user agent must implicitly invoke the
<code title="dom-media-load"><a href="#load">load()</a></code>
method on the <a href="#media7">media element</a> as soon as all
other scripts have finished executing. Any exceptions raised must
be ignored.</p>
<p class="note">If a <code title="attr-media-src"><a href=
"#src7">src</a></code> attribute is specified, the resource it
specifies is the <a href="#media10">media resource</a> that will be
used. Otherwise, the resource specified by the first suitable
<code><a href="#source">source</a></code> element child of the
<a href="#media7">media element</a> is the one used.</p>
<p>The <dfn id="src8" title="dom-media-src"><code>src</code></dfn>
DOM attribute on <a href="#media7" title="media element">media
elements</a> must <a href="#reflect">reflect</a> the content
attribute of the same name.</p>
<p>To <dfn id="pick-a">pick a media resource</dfn> for a <a href=
"#media7">media element</a> , a user agent must use the following
steps:</p>
<ol>
<li>
<p><ins class="diff-new">Let the</ins> <var title=""><ins class=
"diff-new">chosen resource's pixel ratio</ins></var> <ins class=
"diff-new">be 1.0.</ins></p>
</li>
<li>
<p>If the <a href="#media7">media element</a> has a <code title=
"attr-media-src"><a href="#src7">src</a></code> , then the address
given in that attribute is the address of the <a href=
"#media10">media resource</a> ; jump to the last step.</p>
</li>
<li>
<p>Otherwise, let <var title="">candidate</var> be the first
<code><a href="#source">source</a></code> element child in the
<a href="#media7">media element</a> , or null if there is no such
child.</p>
</li>
<li>
<p><i><ins class="diff-new">Loop</ins></i> :<ins class=
"diff-new">this is the start of the loop that looks at the</ins>
<code><a href="#source"><ins class=
"diff-new">source</ins></a></code> <ins class=
"diff-new">elements.</ins></p>
</li>
<li>
<p><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">candidate</ins></var> <ins class="diff-new">is not null
and it has a</ins> <code title="attr-source-pixelratio"><a href=
"#pixelratio"><ins class="diff-new">pixelratio</ins></a></code>
<ins class="diff-new">attribute, then let the</ins> <var title=
""><ins class="diff-new">chosen resource's pixel ratio</ins></var>
<ins class="diff-new">be result of applying the</ins> <a href=
"#rules1"><ins class="diff-new">rules for parsing floating point
number values</ins></a> <ins class="diff-new">to the value of that
attribute, or 1.0 if those rules return an error.</ins></p>
</li>
<li>
<p>If either:</p>
<ul>
<li><var title="">candidate</var> is null, or</li>
<li>the <var title="">candidate</var> element has no <code title=
"attr-source-src"><a href="#src5">src</a></code> attribute, or</li>
<li>the <var title="">candidate</var> element has a <code title=
"attr-source-type"><a href="#type8">type</a></code> attribute and
that attribute's value, when parsed as a MIME type, does not
represent a type that the user agent can render (including any
codecs described by the <code title="">codec</code> parameter), or
<a href="#references">[RFC2046]</a> <a href=
"#references">[RFC4281]</a></li>
<li>the <var title="">candidate</var> element has a <code title=
"attr-source-media"><a href="#media5">media</a></code> attribute
and that attribute's value, when processed according to the rules
for <a href="#mq">media <del class="diff-old">queries,</del>
<ins class="diff-chg">queries</ins></a> , does not match the
current environment, <a href="#references">[MQ]</a></li>
</ul>
<p>...then the <var title="">candidate</var> is not suitable; go to
the next step.</p>
<p>Otherwise, the address given in that <var title=
"">candidate</var> element's <code title="attr-source-src"><a href=
"#src5">src</a></code> attribute is the address of the <a href=
"#media10">media resource</a> ; jump to the last step.</p>
</li>
<li>
<p>Let <var title="">candidate</var> be the next <code><a href=
"#source">source</a></code> element child in the <a href=
"#media7">media element</a> , or null if there are no more such
children.</p>
</li>
<li>
<p>If <var title="">candidate</var> is not null, return to
<ins class="diff-new">the</ins> step <del class="diff-old">3.</del>
<ins class="diff-chg">labeled</ins> <i><ins class=
"diff-chg">loop</ins></i> .</p>
</li>
<li>
<p>There is no <a href="#media10">media resource</a> . Abort these
steps.</p>
</li>
<li>
<p>Let the address of the <dfn id="chosen">chosen media
resource</dfn> be the one that was found before jumping to this
<del class="diff-old">step. A source element with no src attribute
is assumed to</del> <ins class="diff-chg">step, and let its</ins>
<dfn id="pixel0"><ins class="diff-chg">pixel ratio</ins></dfn> be
the <del class="diff-old">last source element — any source elements
after it are ignored (and are invalid).</del> <ins class=
"diff-chg">value of the</ins> <var title=""><ins class=
"diff-chg">chosen resource's pixel ratio</ins></var> .</p>
</li>
</ol>
<p>The <dfn id="currentsrc" title=
"dom-media-currentSrc"><code>currentSrc</code></dfn> DOM attribute
must return the empty string if the <a href="#media7">media
element</a> 's <code title="dom-media-networkState"><a href=
"#networkstate">networkState</a></code> has the value <a href=
"#empty" title="dom-media-EMPTY">EMPTY</a> , and the absolute URL
of the <a href="#chosen">chosen media resource</a> otherwise.</p>
<h5 id="network0"><span class="secno"><del class=
"diff-old">3.14.9.3.</del> <ins class=
"diff-chg">3.12.10.3.</ins></span> Network states</h5>
<p>As <a href="#media7" title="media element">media elements</a>
interact with the network, they go through several states. The
<dfn id="networkstate" title=
"dom-media-networkState"><code>networkState</code></dfn> attribute,
on getting, must return the current network state of the element,
which must be one of the following values:</p>
<dl>
<dt><dfn id="empty" title=
"dom-media-EMPTY"><code>EMPTY</code></dfn> (numeric value 0)</dt>
<dd>The element has not yet been <del class=
"diff-old">initialised.</del> <ins class=
"diff-chg">initialized.</ins> All attributes are in their initial
states.</dd>
<dt><dfn id="loading0" title=
"dom-media-LOADING"><code>LOADING</code></dfn> (numeric value
1)</dt>
<dd>The element has <a href="#pick-a" title=
"pick a media resource">picked a media resource</a> (the <a href=
"#chosen">chosen media resource</a> is available from the
<code title="dom-media-currentSrc"><a href=
"#currentsrc">currentSrc</a></code> attribute), but none of the
metadata has yet been obtained and therefore all the other
attributes are still in their initial states.</dd>
<dt><dfn id="loadedmetadata" title=
"dom-media-LOADED_METADATA"><code>LOADED_METADATA</code></dfn>
(numeric value 2)</dt>
<dd>Enough of the resource has been obtained that the metadata
attributes are initialized (e.g. the length is known). The API will
no longer raise exceptions when used.</dd>
<dt><dfn id="loadedfirstframe" title=
"dom-media-LOADED_FIRST_FRAME"><code>LOADED_FIRST_FRAME</code></dfn>
(numeric value 3)</dt>
<dd>Actual <a href="#media9">media data</a> has been obtained. In
the case of video, this specifically means that a frame of video is
available and can be shown.</dd>
<dt><dfn id="loaded" title=
"dom-media-LOADED"><code>LOADED</code></dfn> (numeric value 4)</dt>
<dd>The entire <a href="#media10">media resource</a> has been
obtained and is available to the user agent locally. Network
connectivity could be lost without affecting the media
playback.</dd>
</dl>
<p>The algorithm for the <code title="dom-media-load"><a href=
"#load">load()</a></code> method defined below describes exactly
when the <code title="dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute changes
value.</p>
<h5 id="loading"><span class="secno"><del class=
"diff-old">3.14.9.4.</del> <ins class=
"diff-chg">3.12.10.4.</ins></span> Loading the media resource</h5>
<p>All <a href="#media7" title="media element">media elements</a>
have a <dfn id="begun">begun flag</dfn> , which must begin in the
false state, a <dfn id="loaded-first-frame">loaded-first-frame
flag</dfn> , which must begin in the false state, and an <dfn id=
"autoplaying">autoplaying flag</dfn> , which must begin in the true
state.</p>
<p>When the <dfn id="load" title=
"dom-media-load"><code>load()</code></dfn> method on a <a href=
"#media7">media element</a> is invoked, the user agent must run the
following steps. Note that this algorithm might get aborted, e.g.
if the <code title="dom-media-load"><a href=
"#load">load()</a></code> method itself is invoked again.</p>
<ol>
<li>
<p>Any already-running instance of this algorithm for this element
must be aborted. If those method calls have not yet returned, they
must finish the step they are on, and then immediately return.</p>
</li>
<li>
<p>If the element's <a href="#begun">begun flag</a> is true, then
the <a href="#begun">begun flag</a> must be set to false, the
<code title="dom-media-error"><a href="#error0">error</a></code>
attribute must be set to a new <code><a href=
"#mediaerror">MediaError</a></code> object whose <code title=
"dom-MediaError-code"><a href="#code0">code</a></code> attribute is
set to <code title="dom-MediaError-MEDIA_ERR_ABORTED"><a href=
"#mediaerraborted">MEDIA_ERR_ABORTED</a></code> , and the user
agent must synchronously <a href="#firing6">fire a progress
event</a> called <code title="event-abort"><a href=
"#abort">abort</a></code> at the <a href="#media7">media
element</a> .</p>
</li>
<li>
<p>The <code title="dom-media-error"><a href=
"#error0">error</a></code> attribute must be set to null, the
<a href="#loaded-first-frame">loaded-first-frame flag</a> must be
set to false, and the <a href="#autoplaying">autoplaying flag</a>
must be set to true.</p>
</li>
<li>
<p>The <code title="dom-media-playbackRate"><a href=
"#playbackrate">playbackRate</a></code> attribute must be set to
the value of the <code title=
"dom-media-defaultPlaybackRate"><a href=
"#defaultplaybackrate">defaultPlaybackRate</a></code>
attribute.</p>
</li>
<li>
<p>If the <a href="#media7">media element</a> 's <code title=
"dom-media-networkState"><a href=
"#networkstate">networkState</a></code> is not set to <a href=
"#empty" title="dom-media-EMPTY">EMPTY</a> , then the following
substeps must be followed:</p>
<ol>
<li>The <code title="dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute must be set to
<a href="#empty" title="dom-media-EMPTY">EMPTY</a> .</li>
<li>If <code title="dom-media-readyState"><a href=
"#readystate0">readyState</a></code> is not set to <code title=
"dom-media-DATA_UNAVAILABLE"><a href=
"#dataunavailable">DATA_UNAVAILABLE</a></code> , it must be set to
that state .</li>
<li>If the <code title="dom-media-paused"><a href=
"#paused">paused</a></code> attribute is false, it must be set to
true .</li>
<li>If <code title="dom-media-seeking"><a href=
"#seeking0">seeking</a></code> is true, it must be set to
false.</li>
<li>The <a href="#current0">current playback position</a> must be
set to 0.</li>
<li>The <code title="dom-media-currentLoop"><a href=
"#currentloop">currentLoop</a></code> DOM attribute must be set to
0.</li>
<li>The user agent must synchronously <a href="#firing2">fire a
simple event</a> called <code title="event-emptied"><a href=
"#emptied">emptied</a></code> at the <a href="#media7">media
element</a> .</li>
</ol>
</li>
<li>
<p>The user agent must <a href="#pick-a">pick a media resource</a>
for the <a href="#media7">media element</a> . If that fails, the
method must raise an <code>INVALID_STATE_ERR</code> exception, and
abort these steps.</p>
</li>
<li>
<p>The <code title="dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute must be set to
<a href="#loading0" title="dom-media-LOADING">LOADING</a> .</p>
</li>
<li>
<p class="note">The <code title="dom-media-currentSrc"><a href=
"#currentsrc">currentSrc</a></code> attribute starts returning the
new value.</p>
</li>
<li>
<p>The user agent must then set the <a href="#begun">begun flag</a>
to true and <a href="#firing6">fire a progress event</a> called
<del class="diff-old">begin</del> <code title=
"event-loadstart"><a href="#loadstart"><ins class=
"diff-chg">loadstart</ins></a></code> at the <a href=
"#media7">media element</a> .</p>
</li>
<li>
<p>The method must return, but these steps must continue.</p>
</li>
<li>
<p class="note">Playback of any previously playing <a href=
"#media10">media resource</a> for this element stops.</p>
</li>
<li>
<p>If a download is in progress for the <a href="#media7">media
element</a> , the user agent should stop the download.</p>
</li>
<li>
<p>The user agent must then begin to download the <a href=
"#chosen">chosen media resource</a> . The rate of the download may
be throttled, however, in response to user preferences (including
throttling it to zero until the user indicates that the download
can start), or to balance the download with other connections
sharing the same bandwidth.</p>
</li>
<li>
<p>While the download is progressing, the user agent must <a href=
"#firing6">fire a progress event</a> called <code title=
"event-progress"><a href="#progress0">progress</a></code> at the
element every 350ms (±200ms) or for every byte received, whichever
is <em>least</em> frequent.</p>
<p>If at any point the user agent has received no data for more
than about three seconds, the user agent must <a href=
"#firing6">fire a progress event</a> called <code title=
"event-stalled"><a href="#stalled">stalled</a></code> at the
element.</p>
<p>User agents may allow users to selectively block or slow
<a href="#media9">media data</a> downloads. When a <a href=
"#media7">media element</a> 's download has been blocked, the user
agent must act as if it was stalled (as opposed to acting as if the
connection was closed).</p>
<p>The user agent may use whatever means necessary to download the
resource (within the constraints put forward by this and other
specifications); for example, reconnecting to the server in the
face of network errors, using HTTP partial range requests, or
switching to a streaming protocol. The user agent must <del class=
"diff-old">only</del> consider a resource erroneous <ins class=
"diff-new">only</ins> if it has given up trying to download it.</p>
<dl class="switch">
<dt>If the <a href="#media9">media data</a> cannot be downloaded at
all, due to network errors, causing the user agent to give up
trying to download the resource</dt>
<dd>
<p>DNS errors and HTTP 4xx and 5xx errors (and equivalents in other
protocols) must cause the user agent to execute the following
steps. User agents may also follow these steps in response to other
network errors of similar severity.</p>
<ol>
<li>The user agent should cancel the download.</li>
<li>The <code title="dom-media-error"><a href=
"#error0">error</a></code> attribute must be set to a new
<code><a href="#mediaerror">MediaError</a></code> object whose
<code title="dom-MediaError-code"><a href="#code0">code</a></code>
attribute is set to <code title=
"dom-MediaError-MEDIA_ERR_NETWORK"><a href=
"#mediaerrnetwork">MEDIA_ERR_NETWORK</a></code> .</li>
<li>The <a href="#begun">begun flag</a> must be set to false and
the user agent must <a href="#firing6">fire a progress event</a>
called <code title="event-error"><a href="#error1">error</a></code>
at the <a href="#media7">media element</a> .</li>
<li>The element's <code title="dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute must be switched
to the <a href="#empty" title="dom-media-EMPTY">EMPTY</a> value and
the user agent must <a href="#firing2">fire a simple event</a>
called <code title="event-emptied"><a href=
"#emptied">emptied</a></code> at the element.</li>
<li>These steps must be aborted.</li>
</ol>
</dd>
<dt id="fatal-decode-error">If the <a href="#media9">media data</a>
can be downloaded but is in an unsupported format, or can otherwise
not be rendered at all</dt>
<dd>
<p>The server returning a file of the wrong kind (e.g. one that
that turns out to not be pure audio when the <a href=
"#media7">media element</a> is an <code><a href=
"#audio1">audio</a></code> element), or the file using unsupported
codecs for all the data, must cause the user agent to execute the
following steps. User agents may also execute these steps in
response to other codec-related fatal errors, such as the file
requiring more resources to process than the user agent can provide
in real time.</p>
<ol>
<li>The user agent should cancel the download.</li>
<li>The <code title="dom-media-error"><a href=
"#error0">error</a></code> attribute must be set to a new
<code><a href="#mediaerror">MediaError</a></code> object whose
<code title="dom-MediaError-code"><a href="#code0">code</a></code>
attribute is set to <code title=
"dom-MediaError-MEDIA_ERR_DECODE"><a href=
"#mediaerrdecode">MEDIA_ERR_DECODE</a></code> .</li>
<li>The <a href="#begun">begun flag</a> must be set to false and
the user agent must <a href="#firing6">fire a progress event</a>
called <code title="event-error"><a href="#error1">error</a></code>
at the <a href="#media7">media element</a> .</li>
<li>The element's <code title="dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute must be switched
to the <a href="#empty" title="dom-media-EMPTY">EMPTY</a> value and
the user agent must <a href="#firing2">fire a simple event</a>
called <code title="event-emptied"><a href=
"#emptied">emptied</a></code> at the element.</li>
<li>These steps must be aborted.</li>
</ol>
</dd>
<dt>If the <a href="#media9">media data</a> download is aborted by
the user</dt>
<dd>
<p>The download is aborted by the user, e.g. because the user
navigated the browsing context to another page, the user agent must
execute the following steps. These steps are not followed if the
<code title="dom-media-load"><a href="#load">load()</a></code>
method itself is reinvoked, as the steps above handle that
particular kind of abort.</p>
<ol>
<li>The user agent should cancel the download.</li>
<li>The <code title="dom-media-error"><a href=
"#error0">error</a></code> attribute must be set to a new
<code><a href="#mediaerror">MediaError</a></code> object whose
<code title="dom-MediaError-code"><a href="#code0">code</a></code>
attribute is set to <code title=
"dom-MediaError-MEDIA_ERR_ABORT">MEDIA_ERR_ABORT</code> .</li>
<li>The <a href="#begun">begun flag</a> must be set to false and
the user agent must <a href="#firing6">fire a progress event</a>
called <code title="event-abort"><a href="#abort">abort</a></code>
at the <a href="#media7">media element</a> .</li>
<li>If the <a href="#media7">media element</a> 's <code title=
"dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute has the value
<code title="dom-media-LOADING"><a href=
"#loading0">LOADING</a></code> , the element's <code title=
"dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute must be switched
to the <a href="#empty" title="dom-media-EMPTY">EMPTY</a> value and
the user agent must <a href="#firing2">fire a simple event</a>
called <code title="event-emptied"><a href=
"#emptied">emptied</a></code> at the element. (If the <code title=
"dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute has a value
greater than <code title="dom-media-LOADING"><a href=
"#loading0">LOADING</a></code> , then this doesn't happen; the
available data, if any, will be playable.)</li>
<li>These steps must be aborted.</li>
</ol>
</dd>
<dt id="non-fatal-media-error">If the <a href="#media9">media
data</a> can be downloaded but has non-fatal errors or uses, in
part, codecs that are unsupported, preventing the user agent from
rendering the content completely correctly but not preventing
playback altogether</dt>
<dd>
<p>The server returning data that is partially usable but cannot be
optimally rendered must cause the user agent to execute the
following steps.</p>
<ol>
<li class="big-issue">Should we fire a 'warning' event? Set the
'error' flag to 'MEDIA_ERR_SUBOPTIMAL' or something?</li>
</ol>
</dd>
<dt>Once enough of the <a href="#media9">media data</a> has been
downloaded to determine the duration of the <a href=
"#media10">media resource</a> , its dimensions, and other
metadata</dt>
<dd>
<p>The user agent must follow these substeps:</p>
<ol>
<li>
<p>The <a href="#current0">current playback position</a> must be
set to the <var><a href="#effective">effective start</a></var>
.</p>
</li>
<li>
<p>The <code title="dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute must be set to
<code title="dom-media-LOADED_METADATA"><a href=
"#loadedmetadata">LOADED_METADATA</a></code> .</p>
</li>
<li>
<p class="note">A number of attributes, including <code title=
"dom-media-duration"><a href="#duration">duration</a></code> ,
<code title="dom-media-buffered"><a href=
"#buffered">buffered</a></code> , and <code title=
"dom-media-played"><a href="#played">played</a></code> , become
available.</p>
</li>
<li>
<p class="note">The user agent will <a href="#firing2">fire a
simple event</a> called <code title="event-durationchange"><a href=
"#durationchange">durationchange</a></code> at the element at this
point.</p>
</li>
<li>
<p>The user agent must <a href="#firing2">fire a simple event</a>
called <code title="event-loadedmetadata"><a href=
"#loadedmetadata0">loadedmetadata</a></code> at the element.</p>
</li>
</ol>
</dd>
<dt id="handling-first-frame-available">Once enough of the <a href=
"#media9">media data</a> has been downloaded to enable the user
agent to display the frame at the <a href="#effective">effective
start</a> of the <a href="#media10">media resource</a></dt>
<dd>
<p>The user agent must follow these substeps:</p>
<ol>
<li>
<p>The <code title="dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute must be set to
<code title="dom-media-LOADED_FIRST_FRAME"><a href=
"#loadedfirstframe">LOADED_FIRST_FRAME</a></code> .</p>
</li>
<li>
<p>The <code title="dom-media-readyState"><a href=
"#readystate0">readyState</a></code> attribute must change to
<code title="dom-media-CAN_SHOW_CURRENT_FRAME"><a href=
"#canshowcurrentframe">CAN_SHOW_CURRENT_FRAME</a></code> .</p>
</li>
<li>
<p>The <a href="#loaded-first-frame">loaded-first-frame flag</a>
must be set to true.</p>
</li>
<li>
<p>The user agent must <a href="#firing2">fire a simple event</a>
called <code title="event-loadedfirstframe"><a href=
"#loadedfirstframe0">loadedfirstframe</a></code> at the
element.</p>
</li>
<li>
<p>The user agent must <a href="#firing2">fire a simple event</a>
called <code title="event-canshowcurrentframe"><a href=
"#canshowcurrentframe0">canshowcurrentframe</a></code> at the
element.</p>
</li>
</ol>
</dd>
</dl>
<p>When the user agent has completed the download of the entire
<a href="#media10">media resource</a> , it must move on to the next
step.</p>
</li>
<li>
<p>If the download completes without errors, the <a href=
"#begun">begun flag</a> must be set to false, the <code title=
"dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute must be set to
<code title="dom-media-LOADED"><a href="#loaded">LOADED</a></code>
, and the user agent must <a href="#firing6">fire a progress
event</a> called <code title="event-load"><a href=
"#load0">load</a></code> at the element.</p>
</li>
</ol>
<p>If a <a href="#media7">media element</a> whose <code title=
"dom-media-networkState"><a href=
"#networkstate">networkState</a></code> has the value <code title=
"dom-media-EMPTY"><a href="#empty">EMPTY</a></code> is inserted
into a document, user agents must implicitly invoke the
<code title="dom-media-load"><a href="#load">load()</a></code>
method on the <a href="#media7">media element</a> as soon as all
other scripts have finished executing. Any exceptions raised must
be ignored.</p>
<p>The <dfn id="bufferingrate" title=
"dom-media-bufferingRate"><code>bufferingRate</code></dfn>
attribute must return the average number of bits received per
second for the current download over the past few seconds. If there
is no download in progress, the attribute must return 0.</p>
<p>The <dfn id="bufferingthrottled" title=
"dom-media-bufferingThrottled"><code><ins class=
"diff-new">bufferingThrottled</ins></code></dfn> <ins class=
"diff-new">attribute must return true if the user agent is
intentionally throttling the bandwidth used by the download
(including when throttling to zero to pause the download
altogether), and false otherwise.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="buffered" title=
"dom-media-buffered"><code>buffered</code></dfn> attribute must
return a static <del class="diff-old">normalised</del> <a href=
"#normalized"><ins class="diff-chg">normalized</ins>
<code>TimeRanges</code> object</a> that represents the ranges of
the <a href="#media10">media resource</a> , if any, that the user
agent has downloaded, at the time the attribute is evaluated.</p>
<p class="note">Typically this will be a single range anchored at
the zero point, but if, e.g. the user agent uses HTTP range
requests in response to seeking, then there could be multiple
ranges.</p>
<p><ins class="diff-new">The</ins> <dfn id="bufferedbytes" title=
"dom-media-bufferedBytes"><code><ins class=
"diff-new">bufferedBytes</ins></code></dfn> <ins class=
"diff-new">attribute must return a static</ins> <a href=
"#normalized0"><ins class="diff-new">normalized</ins>
<code><ins class="diff-new">ByteRanges</ins></code> <ins class=
"diff-new">object</ins></a> <ins class="diff-new">that represents
the ranges of the</ins> <a href="#media10"><ins class=
"diff-new">media resource</ins></a> ,<ins class="diff-new">if any,
that the user agent has downloaded, at the time the attribute is
evaluated.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="totalbytes" title=
"dom-media-totalBytes"><code><ins class=
"diff-new">totalBytes</ins></code></dfn> <ins class=
"diff-new">attribute must return the length of the</ins> <a href=
"#media10"><ins class="diff-new">media resource</ins></a>
,<ins class="diff-new">in bytes, if it is known and finite. If it
is not known, is infinite (e.g. streaming radio), or if no</ins>
<a href="#media9"><ins class="diff-new">media data</ins></a>
<ins class="diff-new">is available, the attribute must return
0.</ins></p>
<h5 id="offsets"><span class="secno"><del class=
"diff-old">3.14.9.5.</del> <ins class=
"diff-chg">3.12.10.5.</ins></span> Offsets into the media
resource</h5>
<p>The <dfn id="duration" title=
"dom-media-duration"><code>duration</code></dfn> attribute must
return the length of the <a href="#media10">media resource</a> , in
seconds. If no <a href="#media9">media data</a> is available, then
the attributes must return 0. If <a href="#media9">media data</a>
is available but the length is not known, the attribute must return
the Not-a-Number (NaN) value. If the <a href="#media10">media
resource</a> is known to be unbounded (e.g. a streaming radio),
then the attribute must return the positive Infinity value.</p>
<p>When the length of the <a href="#media10">media resource</a>
changes (e.g. from being unknown to known, or from indeterminate to
known, or from a previously established length to a new length) the
user agent must, once any running scripts have finished, <a href=
"#firing2">fire a simple event</a> called <code title=
"event-durationchange"><a href=
"#durationchange">durationchange</a></code> at the <a href=
"#media7">media element</a> .</p>
<p><a href="#media7" title="media element">Media elements</a> have
a <dfn id="current0">current playback position</dfn> , which must
initially be zero. The current position is a time.</p>
<p>The <dfn id="currenttime" title=
"dom-media-currentTime"><code>currentTime</code></dfn> attribute
must, on getting, return the <a href="#current0">current playback
position</a> , expressed in seconds. On setting, the user agent
must <a href="#seek" title="dom-media-seek">seek</a> to the new
value (which might raise an exception).</p>
<p>The <dfn id="start2" title=
"attr-media-start"><code>start</code></dfn> content attribute gives
the offset into the <a href="#media10">media resource</a> at which
playback is to begin. The default value is the default start
position of the <a href="#media10">media resource</a> , or 0 if not
enough <a href="#media9">media data</a> has been obtained yet to
determine the default start position or if the resource doesn't
specify a default start position.</p>
<p>The <dfn id="effective"><var>effective start</var></dfn> is the
smaller of the <code title="dom-media-start"><a href=
"#start3">start</a></code> DOM attribute and the end of the
<a href="#media10">media resource</a> .</p>
<p>The <dfn id="loopstart" title=
"attr-media-loopstart"><code>loopstart</code></dfn> content
attribute gives the offset into the <a href="#media10">media
resource</a> at which playback is to begin when looping a clip. The
default value of the <code title="attr-media-loopStart"><a href=
"#loopstart">loopstart</a></code> content attribute is the value of
the <code title="dom-media-start"><a href=
"#start3">start</a></code> DOM attribute.</p>
<p>The <dfn id="effective0"><var>effective loop start</var></dfn>
is the smaller of the <code title="dom-media-loopStart"><a href=
"#loopstart0">loopStart</a></code> DOM attribute and the end of the
<a href="#media10">media resource</a> .</p>
<p>The <dfn id="loopend" title=
"attr-media-loopend"><code>loopend</code></dfn> content attribute
gives an offset into the <a href="#media10">media resource</a> at
which playback is to jump back to the <code title=
"attr-media-loopstart"><a href="#loopstart">loopstart</a></code> ,
when looping the clip. The default value of the <code title=
"attr-media-loopEnd"><a href="#loopend">loopend</a></code> content
attribute is the value of the <code title="dom-media-end"><a href=
"#end0">end</a></code> DOM attribute.</p>
<p>The <dfn id="effective1"><var>effective loop end</var></dfn> is
the greater of the <code title="dom-media-start"><a href=
"#start3">start</a></code> , <code title=
"dom-media-loopStart"><a href="#loopstart0">loopStart</a></code> ,
and <code title="dom-media-loopEnd"><a href=
"#loopend0">loopEnd</a></code> DOM attributes, except if that is
greater than the end of the <a href="#media10">media resource</a> ,
in which case that's its value.</p>
<p>The <dfn id="end" title="attr-media-end"><code>end</code></dfn>
content attribute gives an offset into the <a href="#media10">media
resource</a> at which playback is to end. The default value is
infinity.</p>
<p>The <dfn id="effective2"><var>effective end</var></dfn> is the
greater of the <code title="dom-media-start"><a href=
"#start3">start</a></code> , <code title=
"dom-media-loopStart"><a href="#loopstart0">loopStart</a></code> ,
and <code title="dom-media-loopEnd"><a href=
"#loopend0">end</a></code> DOM attributes, except if that is
greater than the end of the <a href="#media10">media resource</a> ,
in which case that's its value.</p>
<p>The <code title="attr-media-start"><a href=
"#start2">start</a></code> , <code title=
"attr-media-loopstart"><a href="#loopstart">loopstart</a></code> ,
<code title="attr-media-loopend"><a href=
"#loopend">loopend</a></code> , and <code title=
"attr-media-end"><a href="#end">end</a></code> attributes must, if
specified, contain <span title="value time offset">value time
offsets</span> . To get the time values they represent, user agents
must use the <a href="#rules4">rules for parsing time offsets</a>
.</p>
<p>The <dfn id="start3" title=
"dom-media-start"><code>start</code></dfn> , <dfn id="loopstart0"
title="dom-media-loopStart"><code>loopStart</code></dfn> , <dfn id=
"loopend0" title="dom-media-loopEnd"><code>loopEnd</code></dfn> ,
and <dfn id="end0" title="dom-media-end"><code>end</code></dfn> DOM
attributes must <a href="#reflect">reflect</a> the <code title=
"attr-media-start"><a href="#start2">start</a></code> ,
<code title="attr-media-loopstart"><a href=
"#loopstart">loopstart</a></code> , <code title=
"attr-media-loopend"><a href="#loopend">loopend</a></code> , and
<code title="attr-media-end"><a href="#end">end</a></code> content
attributes on the <a href="#media7">media element</a>
respectively.</p>
<p>The <dfn id="playcount" title=
"attr-media-playcount"><code>playcount</code></dfn> content
attribute gives the number of times to play the clip. The default
value is 1.</p>
<p>The <dfn id="playcount0" title=
"dom-media-playCount"><code>playCount</code></dfn> DOM attribute
must <a href="#reflect">reflect</a> the <code title=
"attr-media-playcount"><a href="#playcount">playcount</a></code>
content attribute on the <a href="#media7">media element</a> . The
value must be <a href="#limited1">limited to only positive non-zero
numbers</a> .</p>
<p>The <dfn id="currentloop" title=
"dom-media-currentLoop"><code>currentLoop</code></dfn> attribute
must initially have the value 0. It gives the index of the current
loop. It is changed during playback as described below.</p>
<p>When any of the <code title="dom-media-start"><a href=
"#start3">start</a></code> , <code title=
"dom-media-loopStart"><a href="#loopstart0">loopStart</a></code> ,
<code title="dom-media-loopEnd"><a href=
"#loopend0">loopEnd</a></code> , <code title=
"dom-media-end"><a href="#end0">end</a></code> , and <code title=
"dom-media-playCount"><a href="#playcount0">playCount</a></code>
DOM attributes change value (either through content attribute
mutations reflecting into the DOM attribute, or direct mutations of
the DOM attribute), the user agent must apply the following
steps:</p>
<ol>
<li>
<p>If the <code title="dom-media-playCount"><a href=
"#playcount0">playCount</a></code> DOM attribute's value is less
than or equal to the <code title="dom-media-currentLoop"><a href=
"#currentloop">currentLoop</a></code> DOM attribute's value, then
the <code title="dom-media-currentLoop"><a href=
"#currentloop">currentLoop</a></code> DOM attribute's value must be
set to <span><code title="dom-media-playCount"><a href=
"#playcount0">playCount</a></code> -1</span> (which will make the
current loop the last loop).</p>
</li>
<li>
<p>If the <a href="#media7">media element</a> 's <code title=
"dom-media-networkState"><a href=
"#networkstate">networkState</a></code> is in the <code title=
"dom-media-EMPTY"><a href="#empty">EMPTY</a></code> state or the
<code title="dom-media-LOADING"><a href=
"#loading0">LOADING</a></code> state, then the user agent must at
this point abort these steps.</p>
</li>
<li>
<p>If the <code title="dom-media-currentLoop"><a href=
"#currentloop">currentLoop</a></code> is zero, and the <a href=
"#current0">current playback position</a> is before the
<var><a href="#effective">effective start</a></var> , the user
agent must <a href="#seek" title="dom-media-seek">seek</a> to the
<var><a href="#effective">effective start</a></var> .</p>
</li>
<li>
<p>If the <code title="dom-media-currentLoop"><a href=
"#currentloop">currentLoop</a></code> is greater than zero, and the
<a href="#current0">current playback position</a> is before the
<var><a href="#effective0">effective loop start</a></var> , the
user agent must <a href="#seek" title="dom-media-seek">seek</a> to
the <var><a href="#effective0">effective loop start</a></var> .</p>
</li>
<li>
<p>If the <code title="dom-media-currentLoop"><a href=
"#currentloop">currentLoop</a></code> is less than
<span><code title="dom-media-playCount"><a href=
"#playcount0">playCount</a></code> -1</span> , and the <a href=
"#current0">current playback position</a> is after the
<var><a href="#effective1">effective loop end</a></var> , the user
agent must <a href="#seek" title="dom-media-seek">seek</a> to the
<var><a href="#effective0">effective loop start</a></var> , and
increase <code title="dom-media-currentLoop"><a href=
"#currentloop">currentLoop</a></code> by 1.</p>
</li>
<li>
<p>If the <code title="dom-media-currentLoop"><a href=
"#currentloop">currentLoop</a></code> is equal to
<span><code title="dom-media-playCount"><a href=
"#playcount0">playCount</a></code> -1</span> , and the <a href=
"#current0">current playback position</a> is after the
<var><a href="#effective2">effective end</a></var> , the user agent
must <a href="#seek" title="dom-media-seek">seek</a> to the
<var><a href="#effective2">effective end</a></var> and then the
looping will end.</p>
</li>
</ol>
<h5 id="the-ready"><span class="secno"><del class=
"diff-old">3.14.9.6.</del> <ins class=
"diff-chg">3.12.10.6.</ins></span> The ready states</h5>
<p><a href="#media7" title="media element">Media elements</a> have
a <em>ready state</em> , which describes to what degree they are
ready to be rendered at the <a href="#current0">current playback
position</a> . The possible values are as follows; the ready state
of a media element at any particular time is the greatest value
describing the state of the element:</p>
<dl>
<dt><dfn id="dataunavailable" title=
"dom-media-DATA_UNAVAILABLE"><code>DATA_UNAVAILABLE</code></dfn>
(numeric value 0)</dt>
<dd>No data for the <a href="#current0">current playback
position</a> is available. <a href="#media7" title=
"media element">Media elements</a> whose <code title=
"dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute is less than
<code title="dom-media-LOADED_FIRST_FRAME"><a href=
"#loadedfirstframe">LOADED_FIRST_FRAME</a></code> are always in the
<code title="dom-media-DATA_UNAVAILABLE"><a href=
"#dataunavailable">DATA_UNAVAILABLE</a></code> state.</dd>
<dt><dfn id="canshowcurrentframe" title=
"dom-media-CAN_SHOW_CURRENT_FRAME"><code>CAN_SHOW_CURRENT_FRAME</code></dfn>
(numeric value 1)</dt>
<dd>Data for the immediate <a href="#current0">current playback
position</a> is available, but not enough data is available that
the user agent could successfully advance the <a href=
"#current0">current playback position</a> at all without
immediately reverting to the <code title=
"dom-media-DATA_UNAVAILABLE"><a href=
"#dataunavailable">DATA_UNAVAILABLE</a></code> state. In video,
this corresponds to the user agent having data from the current
frame, but not the next frame. In audio, this corresponds to the
user agent only having audio up to the <a href="#current0">current
playback position</a> , but no further.</dd>
<dt><dfn id="canplay" title=
"dom-media-CAN_PLAY"><code>CAN_PLAY</code></dfn> (numeric value
2)</dt>
<dd>Data for the immediate <a href="#current0">current playback
position</a> is available, as well as enough data for the user
agent to advance the <a href="#current0">current playback
position</a> at least a little without immediately reverting to the
<code title="dom-media-DATA_UNAVAILABLE"><a href=
"#dataunavailable">DATA_UNAVAILABLE</a></code> state. In video,
this corresponds to the user agent having data for the current
frame and the next frame. In audio, this corresponds <del class=
"diff-old">ot</del> <ins class="diff-chg">to</ins> the user agent
having data beyond the <a href="#current0">current playback
position</a> .</dd>
<dt><dfn id="canplaythrough" title=
"dom-media-CAN_PLAY_THROUGH"><code>CAN_PLAY_THROUGH</code></dfn>
(numeric value 3)</dt>
<dd>Data for the immediate <a href="#current0">current playback
position</a> is available, as well as enough data for the user
agent to advance the <a href="#current0">current playback
position</a> at least a little without immediately reverting to the
<code title="dom-media-DATA_UNAVAILABLE"><a href=
"#dataunavailable">DATA_UNAVAILABLE</a></code> state, and, in
addition, the user agent estimates that data is being downloaded at
a rate where the <a href="#current0">current playback position</a>
, if it were to advance at the rate given by the <code title=
"dom-media-defaultPlaybackRate"><a href=
"#defaultplaybackrate">defaultPlaybackRate</a></code> attribute,
would not overtake the available data before playback reaches the
<a href="#effective2">effective end</a> of the <a href=
"#media10">media resource</a> on the last <a href="#playcount0"
title="dom-media-playCount">loop</a> .</dd>
</dl>
<p>When the ready state of a <a href="#media7">media element</a>
whose <code title="dom-media-networkState"><a href=
"#networkstate">networkState</a></code> is not <code title=
"dom-media-EMPTY"><a href="#empty">EMPTY</a></code> changes, the
user agent must follow the steps given below:</p>
<dl class="switch">
<dt>If the new ready state is <code title=
"dom-media-DATA_UNAVAILABLE"><a href=
"#dataunavailable">DATA_UNAVAILABLE</a></code></dt>
<dd>
<p>The user agent must <a href="#firing2">fire a simple event</a>
called <code title="event-dataunavailable"><a href=
"#dataunavailable0">dataunavailable</a></code> at the element.</p>
</dd>
<dt>If the new ready state is <code title=
"dom-media-CAN_SHOW_CURRENT_FRAME"><a href=
"#canshowcurrentframe">CAN_SHOW_CURRENT_FRAME</a></code></dt>
<dd>
<p>If the element's <a href=
"#loaded-first-frame">loaded-first-frame flag</a> is true, the user
agent must <a href="#firing2">fire a simple event</a> called
<code title="event-canshowcurrentframe"><a href=
"#canshowcurrentframe0">canshowcurrentframe</a></code> event.</p>
<p class="note">The first time the <code title=
"dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute switches to this
value, the <a href="#loaded-first-frame">loaded-first-frame
flag</a> is false, and the event is fired <a href=
"#handling-first-frame-available">by the algorithm described
above</a> for the <code title="dom-media-load"><a href=
"#load">load()</a></code> method, in conjunction with other
steps.</p>
</dd>
<dt>If the new ready state is <code title=
"dom-media-CAN_PLAY"><a href="#canplay">CAN_PLAY</a></code></dt>
<dd>
<p>The user agent must <a href="#firing2">fire a simple event</a>
called <code title="event-canplay"><a href=
"#canplay0">canplay</a></code> .</p>
</dd>
<dt>If the new ready state is <code title=
"dom-media-CAN_PLAY_THROUGH"><a href=
"#canplaythrough">CAN_PLAY_THROUGH</a></code></dt>
<dd>
<p>The user agent must <a href="#firing2">fire a simple event</a>
called <code title="event-canplaythrough"><a href=
"#canplaythrough0">canplaythrough</a></code> event. If the <a href=
"#autoplaying">autoplaying flag</a> is true, and the <code title=
"dom-media-paused"><a href="#paused">paused</a></code> attribute is
true, and the <a href="#media7">media element</a> has an
<code title="attr-media-autoplay"><a href=
"#autoplay">autoplay</a></code> attribute specified, then the user
agent must also set the <code title="dom-media-paused"><a href=
"#paused">paused</a></code> attribute to false and <a href=
"#firing2">fire a simple event</a> called <code title=
"event-play"><a href="#play0">play</a></code> .</p>
</dd>
</dl>
<p class="note">It is possible for the ready state of a media
element to jump between these states discontinuously. For example,
the state of a media element whose <span>leaded-first-frame
flag</span> is false can jump straight from <code title=
"dom-media-DATA_UNAVAILABLE"><a href=
"#dataunavailable">DATA_UNAVAILABLE</a></code> to <code title=
"dom-media-CAN_PLAY_THROUGH"><a href=
"#canplaythrough">CAN_PLAY_THROUGH</a></code> without passing
through the <code title="dom-media-CAN_SHOW_CURRENT_FRAME"><a href=
"#canshowcurrentframe">CAN_SHOW_CURRENT_FRAME</a></code> and
<code title="dom-media-CAN_PLAY"><a href=
"#canplay">CAN_PLAY</a></code> states, and thus without firing the
<code title="event-canshowcurrentframe"><a href=
"#canshowcurrentframe0">canshowcurrentframe</a></code> and
<code title="event-canplay"><a href="#canplay0">canplay</a></code>
events. The only state that is <del class=
"diff-old">guarenteed</del> <ins class="diff-chg">guaranteed</ins>
to be reached is the <code title=
"dom-media-CAN_SHOW_CURRENT_FRAME"><a href=
"#canshowcurrentframe">CAN_SHOW_CURRENT_FRAME</a></code> state,
which is reached as part of the <code title=
"dom-media-load"><a href="#load">load()</a></code> method's
processing.</p>
<p>The <dfn id="readystate0" title=
"dom-media-readyState"><code>readyState</code></dfn> DOM attribute
must, on getting, return the value described above that describes
the current ready state of the <a href="#media7">media element</a>
.</p>
<p>The <dfn id="autoplay" title=
"attr-media-autoplay"><code>autoplay</code></dfn> attribute is a
<a href="#boolean0">boolean attribute</a> . When present, the
algorithm described herein will cause the user agent to
automatically begin playback of the <a href="#media10">media
resource</a> as soon as it can do so without stopping.</p>
<p>The <dfn id="autoplay0" title=
"dom-media-autoplay"><code>autoplay</code></dfn> DOM attribute must
<a href="#reflect">reflect</a> the content attribute of the same
name.</p>
<h5 id="playing"><span class="secno"><del class=
"diff-old">3.14.9.7.</del> <ins class=
"diff-chg">3.12.10.7.</ins></span> Playing the media resource</h5>
<p>The <dfn id="paused" title=
"dom-media-paused"><code>paused</code></dfn> attribute represents
whether the <a href="#media7">media element</a> is paused or not.
The attribute must initially be true.</p>
<p>A <a href="#media7">media element</a> is said to be <dfn id=
"actively">actively playing</dfn> when its <code title=
"dom-media-paused"><a href="#paused">paused</a></code> attribute is
false, the <code title="dom-media-readyState"><a href=
"#readystate0">readyState</a></code> attribute is either
<code title="dom-media-CAN_PLAY"><a href=
"#canplay">CAN_PLAY</a></code> or <code title=
"dom-media-CAN_PLAY_THROUGH"><a href=
"#canplaythrough">CAN_PLAY_THROUGH</a></code> , the element has not
<a href="#ended">ended playback</a> , playback has not <a href=
"#stopped">stopped due to errors</a> , and the element has not
<a href="#paused0">paused for user interaction</a> .</p>
<p>A <a href="#media7">media element</a> is said to have <dfn id=
"ended">ended playback</dfn> when the element's <code title=
"dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute is <code title=
"dom-media-LOADED_METADATA"><a href=
"#loadedmetadata">LOADED_METADATA</a></code> or greater, the
<a href="#current0">current playback position</a> is equal to the
<var><a href="#effective2">effective end</a></var> of the <a href=
"#media10">media resource</a> , and the <code title=
"dom-media-currentLoop"><a href=
"#currentloop">currentLoop</a></code> attribute is equal to
<span><code title="dom-media-playCount"><a href=
"#playcount0">playCount</a></code> -1</span> .</p>
<p>A <a href="#media7">media element</a> is said to have <dfn id=
"stopped">stopped due to errors</dfn> when the element's
<code title="dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute is <code title=
"dom-media-LOADED_METADATA"><a href=
"#loadedmetadata">LOADED_METADATA</a></code> or greater, and the
user agent <a href="#non-fatal-media-error">encounters a non-fatal
error</a> during the processing of the <a href="#media9">media
data</a> , and due to that error, is not able to play the content
at the <a href="#current0">current playback position</a> .</p>
<p>A <a href="#media7">media element</a> is said to have <dfn id=
"paused0">paused for user interaction</dfn> when its <code title=
"dom-media-paused"><a href="#paused">paused</a></code> attribute is
false, the <code title="dom-media-readyState"><a href=
"#readystate0">readyState</a></code> attribute is either
<code title="dom-media-CAN_PLAY"><a href=
"#canplay">CAN_PLAY</a></code> or <code title=
"dom-media-CAN_PLAY_THROUGH"><a href=
"#canplaythrough">CAN_PLAY_THROUGH</a></code> and the user agent
has reached a point in the <a href="#media10">media resource</a>
where the user has to make a selection for the resource to
continue.</p>
<p>It is possible for a <a href="#media7">media element</a> to have
both <a href="#ended">ended playback</a> and <a href=
"#paused0">paused for user interaction</a> at the same time.</p>
<p id="media-playback">When a <a href="#media7">media element</a>
is <a href="#actively">actively playing</a> and its <span title=
"dom-ownerDocument">owner <code>Document</code></span> is an
<a href="#active">active document</a> , its <a href=
"#current0">current playback position</a> must increase
monotonically at <code title="dom-media-playbackRate"><a href=
"#playbackrate">playbackRate</a></code> units of media time per
unit time of wall clock time. If this value is not 1, the user
agent may apply pitch adjustments to any audio component of the
<a href="#media10">media resource</a> .</p>
<p><a href="#media10" title="media resource">Media resources</a>
might be internally scripted or interactive. Thus, a <a href=
"#media7">media element</a> could play in a non-linear fashion. If
this happens, the user agent must act as if the algorithm for
<a href="#seek" title="dom-media-seek">seeking</a> was used
whenever the <a href="#current0">current playback position</a>
changes in a discontinuous fashion (so that the relevant events
fire).</p>
<p id="fire-waiting-when-waiting">When a <a href="#media7">media
element</a> that is <a href="#actively">actively playing</a> stops
playing because its <code title="dom-media-readyState"><a href=
"#readystate0">readyState</a></code> attribute changes to a value
lower than <code title="dom-media-CAN_PLAY"><a href=
"#canplay">CAN_PLAY</a></code> , without the element having
<a href="#ended">ended playback</a> , or playback having <a href=
"#stopped">stopped due to errors</a> , or playback having <a href=
"#paused0">paused for user interaction</a> , <ins class=
"diff-new">or the</ins> <a href="#seek" title=
"dom-media-seek"><ins class="diff-new">seeking algorithm</ins></a>
<ins class="diff-new">being invoked,</ins> the user agent must
<a href="#firing2">fire a simple event</a> called <code title=
"event-timeupdate"><a href="#timeupdate">timeupdate</a></code> at
the element, and then must <a href="#firing2">fire a simple
event</a> called <code title="event-waiting"><a href=
"#waiting">waiting</a></code> at the element.</p>
<p>When a <a href="#media7">media element</a> that is <a href=
"#actively">actively playing</a> stops playing because it has
<a href="#paused0">paused for user interaction</a> , the user agent
must <a href="#firing2">fire a simple event</a> called <code title=
"event-timeupdate"><a href="#timeupdate">timeupdate</a></code> at
the element.</p>
<p>When <code title="dom-media-currentLoop"><a href=
"#currentloop">currentLoop</a></code> is less than
<span><code title="dom-media-playCount"><a href=
"#playcount0">playCount</a></code> -1</span> and the <a href=
"#current0">current playback position</a> reaches the <var><a href=
"#effective1">effective loop end</a></var> , then the user agent
must <a href="#seek" title="dom-media-seek">seek</a> to the
<var><a href="#effective0">effective loop start</a></var> ,
increase <code title="dom-media-currentLoop"><a href=
"#currentloop">currentLoop</a></code> by 1, and <a href=
"#firing2">fire a simple event</a> called <code title=
"event-timeupdate"><a href="#timeupdate">timeupdate</a></code>
.</p>
<p>When <code title="dom-media-currentLoop"><a href=
"#currentloop">currentLoop</a></code> is equal to the
<span><code title="dom-media-playCount"><a href=
"#playcount0">playCount</a></code> -1</span> and the <a href=
"#current0">current playback position</a> reaches the <var><a href=
"#effective2">effective end</a></var> , then the user agent must
follow these steps:</p>
<ol>
<li>
<p>The user agent must stop playback.</p>
</li>
<li>
<p class="note">The <code title="dom-media-ended"><a href=
"#ended0">ended</a></code> attribute becomes true.</p>
</li>
<li>
<p>The user agent must <a href="#firing2">fire a simple event</a>
called <code title="event-timeupdate"><a href=
"#timeupdate">timeupdate</a></code> at the element.</p>
</li>
<li>
<p>The user agent must <a href="#firing2">fire a simple event</a>
called <code title="event-ended"><a href="#ended1">ended</a></code>
at the element.</p>
</li>
</ol>
<p>The <dfn id="defaultplaybackrate" title=
"dom-media-defaultPlaybackRate"><code>defaultPlaybackRate</code></dfn>
attribute gives the desired speed at which the <a href=
"#media10">media resource</a> is to play, as a multiple of its
intrinsic speed. The attribute is mutable, but on setting, if the
new value is 0.0, a <code>NOT_SUPPORTED_ERR</code> exception must
be raised instead of the value being changed. It must initially
have the value 1.0.</p>
<p>The <dfn id="playbackrate" title=
"dom-media-playbackRate"><code>playbackRate</code></dfn> attribute
gives the speed at which the <a href="#media10">media resource</a>
plays, as a multiple of its intrinsic speed. If it is not equal to
the <code title="dom-media-defaultPlaybackRate"><a href=
"#defaultplaybackrate">defaultPlaybackRate</a></code> , then the
implication is that the user is using a feature such as fast
forward or slow motion playback. The attribute is mutable, but on
setting, if the new value is 0.0, a <code>NOT_SUPPORTED_ERR</code>
exception must be raised instead of the value being changed.
Otherwise, the playback must change speed (if the element is
<a href="#actively">actively playing</a> ). It must initially have
the value 1.0.</p>
<p>When the <code title="dom-media-defaultPlaybackRate"><a href=
"#defaultplaybackrate">defaultPlaybackRate</a></code> or
<code title="dom-media-playbackRate"><a href=
"#playbackrate">playbackRate</a></code> attributes change value
(either by being set by script or by being changed directly by the
user agent, e.g. in response to user control) the user agent must,
once any running scripts have finished, <a href="#firing2">fire a
simple event</a> called <code title="event-ratechange"><a href=
"#ratechange">ratechange</a></code> at the <a href="#media7">media
element</a> .</p>
<p>When the <dfn id="play" title=
"dom-media-play"><code>play()</code></dfn> method on a <a href=
"#media7">media element</a> is invoked, the user agent must run the
following steps.</p>
<ol>
<li>
<p>If the <a href="#media7">media element</a> 's <code title=
"dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute has the value
<a href="#empty" title="dom-media-EMPTY">EMPTY</a> , then the user
agent must invoke the <code title="dom-media-load"><a href=
"#load">load()</a></code> method and wait for it to return. If that
raises an exception, that exception must be reraised by the
<code title="dom-media-play"><a href="#play">play()</a></code>
method.</p>
</li>
<li>
<p>If the <a href="#ended" title="ended playback">playback has
ended</a> , then the user agent must set <code title=
"dom-media-currentLoop"><a href=
"#currentloop">currentLoop</a></code> to zero and <a href="#seek"
title="dom-media-seek">seek</a> to the <var><a href=
"#effective">effective start</a></var> .</p>
<p class="note"><ins class="diff-new">If this involved a seek, the
user agent will</ins> <a href="#firing2"><ins class="diff-new">fire
a simple event</ins></a> <ins class="diff-new">called</ins>
<code title="event-timeupdate"><a href="#timeupdate"><ins class=
"diff-new">timeupdate</ins></a></code> <ins class="diff-new">at
the</ins> <a href="#media7"><ins class="diff-new">media
element</ins></a> .</p>
</li>
<li>
<p>The <code title="dom-media-playbackRate"><a href=
"#playbackrate">playbackRate</a></code> attribute must be set to
the value of the <code title=
"dom-media-defaultPlaybackRate"><a href=
"#defaultplaybackrate">defaultPlaybackRate</a></code>
attribute.</p>
<p class="note"><ins class="diff-new">If this caused the</ins>
<code title="dom-media-playbackRate"><a href=
"#playbackrate"><ins class="diff-new">playbackRate</ins></a></code>
<ins class="diff-new">attribute to change value, the user agent
will</ins> <a href="#firing2"><ins class="diff-new">fire a simple
event</ins></a> <ins class="diff-new">called</ins> <code title=
"event-ratechange"><a href="#ratechange"><ins class=
"diff-new">ratechange</ins></a></code> <ins class="diff-new">at
the</ins> <a href="#media7"><ins class="diff-new">media
element</ins></a> .</p>
</li>
<li>
<p>If the <a href="#media7">media element</a> 's <code title=
"dom-media-paused"><a href="#paused">paused</a></code> attribute is
true, it must be set to false.</p>
</li>
<li>
<p>The <a href="#media7">media element</a> 's <a href=
"#autoplaying">autoplaying flag</a> must be set to false.</p>
</li>
<li>
<p>The method must then return. <del class="diff-old">If the second
step above involved a seek, the user agent will fire a simple event
called timeupdate at the media element . If the third step above
caused the playbackRate attribute to change value, the user agent
will fire a simple event called ratechange at the media element
.</del></p>
</li>
<li>
<p>If the fourth step above changed the value of <code title=
"dom-media-paused"><a href="#paused">paused</a></code> , the user
agent <del class="diff-old">must</del> <ins class="diff-chg">must,
after any running scripts have finished executing, and after any
other events triggered by this algorithm (specifically</ins>
<code title="event-timeupdate"><a href="#timeupdate"><ins class=
"diff-chg">timeupdate</ins></a></code> <ins class=
"diff-chg">and</ins> <code title="event-ratechange"><a href=
"#ratechange"><ins class="diff-chg">ratechange</ins></a></code>
<ins class="diff-chg">) have fired,</ins> <a href="#firing2">fire a
simple event</a> called <code title="event-pause"><a href=
"#pause1">play</a></code> at the <del class="diff-old">media
element .</del> <ins class="diff-chg">element.</ins></p>
</li>
</ol>
<p>When the <dfn id="pause0" title=
"dom-media-pause"><code>pause()</code></dfn> method is invoked, the
user agent must run the following steps:</p>
<ol>
<li>
<p>If the <a href="#media7">media element</a> 's <code title=
"dom-media-networkState"><a href=
"#networkstate">networkState</a></code> attribute has the value
<a href="#empty" title="dom-media-EMPTY">EMPTY</a> , then the user
agent must invoke the <code title="dom-media-load"><a href=
"#load">load()</a></code> method and wait for it to return. If that
raises an exception, that exception must be reraised by the
<code title="dom-media-play"><a href="#play">pause()</a></code>
method.</p>
</li>
<li>
<p>If the <a href="#media7">media element</a> 's <code title=
"dom-media-paused"><a href="#paused">paused</a></code> attribute is
false, it must be set to true.</p>
</li>
<li>
<p>The <a href="#media7">media element</a> 's <a href=
"#autoplaying">autoplaying flag</a> must be set to false.</p>
</li>
<li>
<p>The method must then return.</p>
</li>
<li>
<p>If the second step above changed the value of <code title=
"dom-media-paused"><a href="#paused">paused</a></code> ,
<ins class="diff-new">then, after any running scripts have finished
executing,</ins> the user agent must first <a href="#firing2">fire
a simple event</a> called <code title="event-timeupdate"><a href=
"#timeupdate">timeupdate</a></code> at the element, and then
<a href="#firing2">fire a simple event</a> called <code title=
"event-pause"><a href="#pause1">pause</a></code> at the
element.</p>
</li>
</ol>
<p>When a <a href="#media7">media element</a> is <span>removed from
a <code>Document</code></span> , <ins class="diff-new">if the</ins>
<a href="#media7"><ins class="diff-new">media element</ins></a>
<ins class="diff-new">'s</ins> <code title=
"dom-media-networkState"><a href="#networkstate"><ins class=
"diff-new">networkState</ins></a></code> <ins class=
"diff-new">attribute has a value other than</ins> <a href="#empty"
title="dom-media-EMPTY"><ins class="diff-new">EMPTY</ins></a>
<ins class="diff-new">then</ins> the user agent must act as if the
<code title="dom-media-pause"><a href="#pause0">pause()</a></code>
method had been invoked.</p>
<p><a href="#media7" title="media element">Media elements</a> that
are <a href="#actively">actively playing</a> while not <span>in a
<code>Document</code></span> must not play any video, but should
play any audio component. Media elements must not stop playing just
because all references to them have been removed; only once a media
element to which no references exist has reached a point where no
further audio remains to be played for that element (e.g. because
the element is paused or because the end of the clip has been
reached) may the element be <span>garbage collected</span> .</p>
<p class="note">If the <a href="#media7">media element</a> 's
<code title="dom-ownerDocument">ownerDocument</code> stops being an
active document, then the playback will <a href=
"#media-playback">stop</a> until the document is active again.</p>
<p>The <dfn id="ended0" title=
"dom-media-ended"><code>ended</code></dfn> attribute must return
true if the <a href="#media7">media element</a> has <a href=
"#ended">ended playback</a> , and false otherwise.</p>
<p>The <dfn id="played" title=
"dom-media-played"><code>played</code></dfn> attribute must return
a static <del class="diff-old">normalised</del> <a href=
"#normalized"><ins class="diff-chg">normalized</ins>
<code>TimeRanges</code> object</a> that represents the ranges of
the <a href="#media10">media resource</a> , if any, that the user
agent has so far rendered, at the time the attribute is
evaluated.</p>
<h5 id="seeking"><span class="secno"><del class=
"diff-old">3.14.9.8.</del> <ins class=
"diff-chg">3.12.10.8.</ins></span> Seeking</h5>
<p>The <dfn id="seeking0" title=
"dom-media-seeking"><code>seeking</code></dfn> attribute must
initially have the value false.</p>
<p>When the user agent is required to <dfn id="seek" title=
"dom-media-seek">seek</dfn> to a particular <var title="">new
playback position</var> in the <a href="#media10">media
resource</a> , it means that the user agent must run the following
steps:</p>
<ol>
<li>
<p>If the <a href="#media7">media element</a> 's <code title=
"dom-media-networkState"><a href=
"#networkstate">networkState</a></code> is less than <code title=
"dom-media-LOADED_METADATA"><a href=
"#loadedmetadata">LOADED_METADATA</a></code> , then the user agent
must raise an <code>INVALID_STATE_ERR</code> exception (if the seek
was in response to a DOM method call or setting of a DOM
attribute), and abort these steps.</p>
</li>
<li>
<p>If <code title="dom-media-currentLoop"><a href=
"#currentloop">currentLoop</a></code> is 0, let <var title=
"">min</var> be the <var><a href="#effective">effective
start</a></var> . Otherwise, let it be the <var><a href=
"#effective0">effective loop start</a></var> .</p>
</li>
<li>
<p>If <code title="dom-media-currentLoop"><a href=
"#currentloop">currentLoop</a></code> is equal to <del class=
"diff-old">the value of</del> <span><code title=
"dom-media-playCount"><a href="#playcount0">playCount</a>
<del class="diff-old">,</del></code> <ins class=
"diff-chg">-1</ins></span> , let <var title="">max</var> be the
<var><a href="#effective2">effective end</a></var> . Otherwise, let
it be the <var><a href="#effective1">effective loop end</a></var>
.</p>
</li>
<li>
<p>If the <var title="">new playback position</var> is more than
<var title="">max</var> , let it be <var title="">max</var> .</p>
</li>
<li>
<p>If the <var title="">new playback position</var> is less than
<var title="">min</var> , let it be <var title="">min</var> .</p>
</li>
<li>
<p>If the (possibly now changed) <var title="">new playback
position</var> is not in one of the ranges given in the
<code title="dom-media-seekable"><a href=
"#seekable">seekable</a></code> attribute, then the user agent must
raise an <code>INDEX_SIZE_ERR</code> exception (if the seek was in
response to a DOM method call or setting of a DOM attribute), and
abort these steps.</p>
</li>
<li>
<p>The <a href="#current0">current playback position</a> must be
set to the given <var title="">new playback position</var> .</p>
</li>
<li>
<p>The <code title="dom-media-seeking"><a href=
"#seeking0">seeking</a></code> DOM attribute must be set to
true.</p>
</li>
<li>
<p><ins class="diff-new">If the seek was in response to a DOM
method call or setting of a DOM attribute, then continue the
script.</ins> The <ins class="diff-new">remainder of these steps
must be run asynchronously.</ins></p>
</li>
<li>
<p><ins class="diff-new">Once any running scripts have finished
executing, the</ins> user agent must <a href="#firing2">fire a
simple event</a> called <code title="event-timeupdate"><a href=
"#timeupdate">timeupdate</a></code> at the element.</p>
</li>
<li>
<p><del class="diff-old">As soon as</del> <ins class="diff-chg">If
the</ins> <a href="#media7"><ins class="diff-chg">media
element</ins></a> <ins class="diff-chg">was</ins> <a href=
"#actively"><ins class="diff-chg">actively playing</ins></a>
<ins class="diff-chg">immediately before it started seeking, but
seeking caused its</ins> <code title=
"dom-media-readyState"><a href="#readystate0"><ins class=
"diff-chg">readyState</ins></a></code> <ins class=
"diff-chg">attribute to change to a value lower than</ins>
<code title="dom-media-CAN_PLAY"><a href="#canplay"><ins class=
"diff-chg">CAN_PLAY</ins></a></code> ,<ins class="diff-chg">the
user agent must</ins> <a href="#firing2"><ins class="diff-chg">fire
a simple event</ins></a> <ins class="diff-chg">called</ins>
<code title="event-waiting"><a href="#waiting"><ins class=
"diff-chg">waiting</ins></a></code> <ins class="diff-chg">at the
element.</ins></p>
</li>
<li>
<p><ins class="diff-chg">If, when it reaches this step,</ins> the
user agent has <ins class="diff-new">still not</ins> established
whether or not the <a href="#media9">media data</a> for the
<var title="">new playback position</var> is available, and, if it
is, decoded enough data to play back that position, the <ins class=
"diff-new">user agent must</ins> <a href="#firing2"><ins class=
"diff-new">fire a simple event</ins></a> <ins class=
"diff-new">called</ins> <code title="event-seeking"><a href=
"#seeking1"><ins class="diff-new">seeking</ins></a></code>
<ins class="diff-new">at the element.</ins></p>
</li>
<li>
<p><ins class="diff-new">The user agent must wait until it has
established whether or not the</ins> <a href="#media9"><ins class=
"diff-new">media data</ins></a> <ins class="diff-new">for the</ins>
<var title=""><ins class="diff-new">new playback
position</ins></var> <ins class="diff-new">is available, and, if it
is, until it has decoded enough data to play back that
position.</ins></p>
</li>
<li>
<p><ins class="diff-new">The</ins> <code title=
"dom-media-seeking"><a href="#seeking0">seeking</a></code> DOM
attribute must be set to false.</p>
</li>
<li>
<p><ins class="diff-new">Once any running scripts have finished
executing, the user agent must</ins> <a href="#firing2"><ins class=
"diff-new">fire a simple event</ins></a> <ins class=
"diff-new">called</ins> <code title="event-seeked"><a href=
"#seeked"><ins class="diff-new">seeked</ins></a></code> <ins class=
"diff-new">at the element.</ins></p>
</li>
</ol>
<p>The <dfn id="seekable" title=
"dom-media-seekable"><code>seekable</code></dfn> attribute must
return a static <del class="diff-old">normalised</del> <a href=
"#normalized"><ins class="diff-chg">normalized</ins>
<code>TimeRanges</code> object</a> that represents the ranges of
the <a href="#media10">media resource</a> , if any, that the user
agent is able to seek to, at the time the attribute is evaluated,
notwithstanding the looping attributes (i.e. the <var><a href=
"#effective">effective start</a></var> and <var><a href=
"#effective2">effective end</a></var> , etc, don't affect the
<code title="dom-media-seekable"><a href="#seekable"><del class=
"diff-old">seeking</del> <ins class=
"diff-chg">seekable</ins></a></code> attribute).</p>
<p class="note">If the user agent can seek to anywhere in the
<a href="#media10">media resource</a> , e.g. because it a simple
movie file and the user agent and the server support HTTP Range
requests, then the attribute would return an object with one range,
whose start is the time of the first frame (typically zero), and
whose end is the same as the time of the first frame plus the
<code title="dom-media-duration"><a href=
"#duration">duration</a></code> attribute's value (which would
equal the time of the last frame).</p>
<h5 id="cue-ranges"><span class="secno"><del class=
"diff-old">3.14.9.9.</del> <ins class=
"diff-chg">3.12.10.9.</ins></span> Cue ranges</h5>
<p><a href="#media7" title="media element">Media elements</a> have
a set of <dfn id="cue-ranges0" title="cue range">cue ranges</dfn> .
Each cue range is made up of the following information:</p>
<dl>
<dt>A class name</dt>
<dd>A group of related ranges can be given the same class name so
that they can all be removed at the same time.</dd>
<dt>A start time</dt>
<dt>An end time</dt>
<dd>The actual time range, using the same timeline as the <a href=
"#media10">media resource</a> itself.</dd>
<dt>A "pause" boolean</dt>
<dd>A flag indicating whether to pause playback on exit.</dd>
<dt>An "enter" callback</dt>
<dd>A callback that is called when the <a href="#current0">current
playback position</a> enters the range.</dd>
<dt>An "exit" callback</dt>
<dd>A callback that is called when the <a href="#current0">current
playback position</a> exits the range.</dd>
<dt>An "active" boolean</dt>
<dd>A flag indicating whether the range is active or not.</dd>
</dl>
<p>The <dfn id="addcuerange" title=
"dom-media-addCueRange"><code>addCueRange( <var title=
"">className</var> , <var title="">start</var> , <var title=
"">end</var> , <var title="">pauseOnExit</var> , <var title=
"">enterCallback</var> , <var title="">exitCallback</var>
)</code></dfn> method must, when called, add a <a href=
"#cue-ranges0">cue range</a> to the <a href="#media7">media
element</a> , that cue range having the class name <var title=
"">className</var> , the start time <var title="">start</var> (in
seconds), the end time <var title="">end</var> (in seconds), the
"pause" boolean with the same value as <var title=
"">pauseOnExit</var> , the "enter" callback <var title=
"">enterCallback</var> , the "exit" callback <var title=
"">exitCallback</var> , and an "active" boolean that is true if the
<a href="#current0">current playback position</a> is equal to or
greater than the start time and less than the end time, and false
otherwise.</p>
<p>The <dfn id="removecueranges" title=
"dom-media-removeCueRanges"><code>removeCueRanges( <var title=
"">className</var> )</code></dfn> method must, when called, remove
all the <a href="#cue-ranges0" title="cue range">cue ranges</a> of
the <a href="#media7">media element</a> which have the class name
<var title="">className</var> .</p>
<p>When the <a href="#current0">current playback position</a> of a
<a href="#media7">media element</a> changes (e.g. due to playback
or seeking), the user agent must run the following steps. If the
<a href="#current0">current playback position</a> changes while the
steps are running, then the user agent must wait for the steps to
complete, and then must immediately rerun the steps. (These steps
are thus run as often as possible or needed — if one iteration
takes a long time, this can cause certain ranges to be skipped over
as the user agent rushes ahead to "catch up".)</p>
<ol>
<li>
<p>Let <var title="">current ranges</var> be an ordered list of
<a href="#cue-ranges0" title="cue range">cue ranges</a> ,
<del class="diff-old">initialised</del> <ins class=
"diff-chg">initialized</ins> to contain all the <a href=
"#cue-ranges0" title="cue range">cue ranges</a> of the <a href=
"#media7">media element</a> whose start times are less than or
equal to the <a href="#current0">current playback position</a> and
whose end times are greater than the <a href="#current0">current
playback position</a> , in the order they were added to the
element.</p>
</li>
<li>
<p>Let <var title="">other ranges</var> be an ordered list of
<a href="#cue-ranges0" title="cue range">cue ranges</a> ,
<del class="diff-old">initialised</del> <ins class=
"diff-chg">initialized</ins> to contain all the <a href=
"#cue-ranges0" title="cue range">cue ranges</a> of the <a href=
"#media7">media element</a> that are not present in <var title=
"">current ranges</var> , in the order they were added to the
element.</p>
</li>
<li>
<p>If none of the <a href="#cue-ranges0" title="cue range">cue
ranges</a> in <var title="">current ranges</var> have their
"active" boolean set to "false" (inactive) and none of the <a href=
"#cue-ranges0" title="cue range">cue ranges</a> in <var title=
"">other ranges</var> have their "active" boolean set to "true"
(active), then abort these steps.</p>
</li>
<li>
<p>If the time was reached through the usual monotonic increase of
the current playback position during normal playback, the user
agent must then <a href="#firing2">fire a simple event</a> called
<code title="event-timeupdate"><a href=
"#timeupdate">timeupdate</a></code> at the element. (In the other
cases, such as explicit seeks, relevant events get fired as part of
the overall process of changing the current playback position.)</p>
</li>
<li>
<p>If the time was reached through the usual monotonic increase of
the current playback position during normal playback, and there are
<a href="#cue-ranges0" title="cue range">cue ranges</a> in
<var title="">other ranges</var> that have both their "active"
boolean and their "pause" boolean set to "true", then immediately
act as if the element's <code title="dom-media-pause"><a href=
"#pause0">pause()</a></code> method had been invoked. (In the other
cases, such as explicit seeks, playback is not paused by exiting a
cue range, even if that cue range has its "pause" boolean set to
"true".)</p>
</li>
<li>
<p>Invoke all the non-null "exit" callbacks for all of the <a href=
"#cue-ranges0" title="cue range">cue ranges</a> in <var title=
"">other ranges</var> that have their "active" boolean set to
"true" (active), in list order.</p>
</li>
<li>
<p>Invoke all the non-null "enter" callbacks for all of the
<a href="#cue-ranges0" title="cue range">cue ranges</a> in
<var title="">current ranges</var> that have their "active" boolean
set to "false" (inactive), in list order.</p>
</li>
<li>
<p>Set the "active" boolean of all the <a href="#cue-ranges0"
title="cue range">cue ranges</a> in the <var title="">current
ranges</var> list to "true" (active), and the "active" boolean of
all the <a href="#cue-ranges0" title="cue range">cue ranges</a> in
the <var title="">other ranges</var> list to "false"
(inactive).</p>
</li>
</ol>
<p>Invoking a callback (an object implementing the <code><a href=
"#voidcallback">VoidCallback</a></code> interface) means calling
its <code title="dom-VoidCallback-handleEvent"><a href=
"#handleevent">handleEvent()</a></code> method.</p>
<pre class="idl">
interface <dfn id="voidcallback">VoidCallback</dfn> {
void <a href="#handleevent" title=
"dom-voidCallback-handleEvent">handleEvent</a>();
};
</pre>
<p>The <dfn id="handleevent" title=
"dom-voidCallback-handleEvent"><code>handleEvent</code></dfn>
method of objects implementing the <code><a href=
"#voidcallback">VoidCallback</a></code> interface is the
<del class="diff-old">entrypoint</del> <ins class="diff-chg">entry
point</ins> for the callback represented by the object. <del class=
"diff-old">In the ECMAScript DOM binding, the ECMAScript native
Function type must implement the VoidCallback interface such that
invoking the handleEvent() method of that interface on the object
from another language binding invokes the function itself. In the
ECMAScript binding itself, however, the handleEvent() method of the
interface is not directly accessible on Function objects. Such
functions, when invoked, must be called at the scope of the
browsing context .</del></p>
<h5 id="user-interface"><span class="secno"><del class=
"diff-old">3.14.9.10.</del> <ins class=
"diff-chg">3.12.10.10.</ins></span> User interface</h5>
<p>The <dfn id="controls" title=
"attr-media-controls"><code>controls</code></dfn> attribute is a
<a href="#boolean0">boolean attribute</a> . If the attribute is
present, or if <del class="diff-old">scripting</del> <ins class=
"diff-chg">the</ins> <a href="#media7"><ins class="diff-chg">media
element</ins></a> is <del class="diff-old">disabled</del> <a href=
"#without"><ins class="diff-chg">without script</ins></a> , then
the user agent should <dfn id="expose">expose a user interface to
the user</dfn> . This user interface should include features to
begin playback, pause playback, seek to an arbitrary position in
the content (if the content supports arbitrary seeking), change the
volume, and show the media content in manners more suitable to the
user (e.g. full-screen video or in an independent resizable
window). Other controls may also be made available.</p>
<p>If the attribute is absent, then the user agent should avoid
making a user interface available that could conflict with an
author-provided user interface. User agents may make the following
features available, however, even when the attribute is absent:</p>
<p>User agents may provide controls to affect playback of the media
resource (e.g. play, pause, seeking, and volume controls), but such
features should not interfere with the page's normal rendering. For
example, such features could be exposed in the <a href=
"#media7">media element</a> 's context menu.</p>
<p>Where possible (specifically, for starting, stopping, pausing,
and unpausing playback, for muting or changing the volume of the
audio, and for seeking), user interface features exposed by the
user agent must be implemented in terms of the DOM API described
above, so that, e.g., all the same events fire.</p>
<p>The <dfn id="controls0" title=
"dom-media-controls"><code>controls</code></dfn> DOM attribute must
<a href="#reflect">reflect</a> the content attribute of the same
name.</p>
<p>The <dfn id="volume" title=
"dom-media-volume"><code>volume</code></dfn> attribute must return
the playback volume of any audio portions of the <a href=
"#media7">media element</a> , in the range 0.0 (silent) to 1.0
(loudest). Initially, the volume must be 0.5, but user agents may
remember the last set value across sessions, on a per-site basis or
otherwise, so the volume may start at other values. On setting, if
the new value is in the range 0.0 to 1.0 inclusive, the attribute
must be set to the new value and the playback volume must be
correspondingly adjusted as soon as possible after setting the
attribute, with 0.0 being silent, and 1.0 being the loudest
setting, values in between increasing in loudness. The range need
not be linear. The loudest setting may be lower than the system's
loudest possible setting; for example the user could have set a
maximum volume. If the new value is outside the range 0.0 to 1.0
inclusive, then, on setting, an <code>INDEX_SIZE_ERR</code>
exception must be raised instead.</p>
<p>The <dfn id="muted" title=
"dom-media-muted"><code>muted</code></dfn> attribute must return
true if the audio channels are muted and false otherwise. On
setting, the attribute must be set to the new value; if the new
value is true, audio playback for this <a href="#media10">media
resource</a> must then be muted, and if false, audio playback must
then be enabled.</p>
<p>Whenever either the <code title="dom-media-muted"><a href=
"#muted">muted</a></code> or <code title=
"dom-media-volume"><a href="#volume">volume</a></code> attributes
are changed, after any running scripts have finished executing, the
user agent must <a href="#firing2">fire a simple event</a> called
<code title="event-volumechange"><a href=
"#volumechange">volumechange</a></code> at the <a href=
"#media7">media element</a> .</p>
<h5 id="time-ranges"><span class="secno"><del class=
"diff-old">3.14.9.11.</del> <ins class=
"diff-chg">3.12.10.11.</ins></span> Time <del class=
"diff-old">range</del> <ins class="diff-chg">ranges</ins></h5>
<p>Objects implementing the <code><a href=
"#timeranges">TimeRanges</a></code> interface represent a list of
ranges (periods) of time.</p>
<pre class="idl">
interface <dfn id="timeranges">TimeRanges</dfn> {
readonly attribute unsigned long <a href="#length3" title=
"dom-TimeRanges-length">length</a>;
float <a href="#start4" title=
"dom-TimeRanges-start">start</a>(in unsigned long index);
float <a href="#endindex" title=
"dom-TimeRanges-end">end</a>(in unsigned long index);
};
</pre>
<p>The <dfn id="length3" title=
"dom-TimeRanges-length"><code>length</code></dfn> DOM attribute
must return the number of ranges represented by the object.</p>
<p>The <dfn id="start4" title="dom-TimeRanges-start"><code>start(
<var title="">index</var> )</code></dfn> method must return the
position of the start of the <var title="">index</var> th range
represented by the object, in seconds measured from the start of
the timeline that the object covers.</p>
<p>The <dfn id="endindex" title="dom-TimeRanges-end"><code>end(
<var title="">index</var> )</code></dfn> method must return the
position of the end of the <var title="">index</var> th range
represented by the object, in seconds measured from the start of
the timeline that the object covers.</p>
<p>These methods must raise <code>INDEX_SIZE_ERR</code> exceptions
if called with an <var title="">index</var> argument greater than
or equal to the number of ranges represented by the object.</p>
<p>When a <code><a href="#timeranges">TimeRanges</a></code> object
is said to be a <del class="diff-old">normalised</del> <dfn id=
"normalized"><ins class="diff-chg">normalized</ins>
<code>TimeRanges</code> object</dfn> , the ranges it represents
must obey the following criteria:</p>
<ul>
<li>The start of a range must be greater than the end of all
earlier ranges.</li>
<li>The start of a range must be less than the end of that same
range.</li>
</ul>
<p>In other words, the ranges in such an object are ordered, don't
overlap, <ins class="diff-new">aren't empty,</ins> and don't touch
(adjacent ranges are folded into one bigger range).</p>
<p>The timelines used by the objects returned by the <code title=
"dom-media-buffered"><a href="#buffered">buffered</a></code> ,
<code title="dom-media-seekable"><a href=
"#seekable">seekable</a></code> and <code title=
"dom-media-played"><a href="#played">played</a></code> DOM
attributes of <a href="#media7" title="media element">media
elements</a> must be the same as that element's <a href=
"#media10">media resource</a> 's timeline.</p>
<h5 id="byte-ranges"><span class="secno"><ins class=
"diff-new">3.12.10.12.</ins></span> <ins class="diff-new">Byte
ranges</ins></h5>
<p><ins class="diff-new">Objects implementing the</ins>
<code><a href="#byteranges"><ins class=
"diff-new">ByteRanges</ins></a></code> <ins class=
"diff-new">interface represent a list of ranges of bytes.</ins></p>
<pre class="idl">
interface <dfn id="byteranges">ByteRanges</dfn> {<ins class=
"diff-new">
readonly attribute unsigned long <a href="#length4" title=
"dom-ByteRanges-length">length</a>;
unsigned long <a href="#start5" title=
"dom-ByteRanges-start">start</a>(in unsigned long index);
unsigned long <a href="#endindex0" title=
"dom-ByteRanges-end">end</a>(in unsigned long index);
};
</ins>
</pre>
<p><ins class="diff-new">The</ins> <dfn id="length4" title=
"dom-ByteRanges-length"><code><ins class=
"diff-new">length</ins></code></dfn> <ins class="diff-new">DOM
attribute must return the number of ranges represented by the
object.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="start5" title=
"dom-ByteRanges-start"><code><ins class="diff-new">start(</ins>
<var title=""><ins class="diff-new">index</ins></var> <ins class=
"diff-new">)</ins></code></dfn> <ins class="diff-new">method must
return the position of the first byte of the</ins> <var title=
""><ins class="diff-new">index</ins></var> <ins class="diff-new">th
range represented by the object.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="endindex0" title=
"dom-ByteRanges-end"><code><ins class="diff-new">end(</ins>
<var title=""><ins class="diff-new">index</ins></var> <ins class=
"diff-new">)</ins></code></dfn> <ins class="diff-new">method must
return the position of the byte immediately after the last byte of
the</ins> <var title=""><ins class="diff-new">index</ins></var>
<ins class="diff-new">th range represented by the object. (The byte
position returned by this method is not in the range itself. If the
first byte of the range is the byte at position 0, and the entire
stream of bytes is in the range, then the value of the position of
the byte returned by this method for that range will be the same as
the number of bytes in the stream.)</ins></p>
<p><ins class="diff-new">These methods must raise</ins>
<code><ins class="diff-new">INDEX_SIZE_ERR</ins></code> <ins class=
"diff-new">exceptions if called with an</ins> <var title=
""><ins class="diff-new">index</ins></var> <ins class=
"diff-new">argument greater than or equal to the number of ranges
represented by the object.</ins></p>
<p><ins class="diff-new">When a</ins> <code><a href=
"#byteranges"><ins class="diff-new">ByteRanges</ins></a></code>
<ins class="diff-new">object is said to be a</ins> <dfn id=
"normalized0"><ins class="diff-new">normalized</ins>
<code><ins class="diff-new">ByteRanges</ins></code> <ins class=
"diff-new">object</ins></dfn> ,<ins class="diff-new">the ranges it
represents must obey the following criteria:</ins></p>
<ul>
<li><ins class="diff-new">The start of a range must be greater than
the end of all earlier ranges.</ins></li>
<li><ins class="diff-new">The start of a range must be less than
the end of that same range.</ins></li>
</ul>
<p><ins class="diff-new">In other words, the ranges in such an
object are ordered, don't overlap, aren't empty, and don't touch
(adjacent ranges are folded into one bigger range).</ins></p>
<h5 id="mediaevents"><span class="secno"><del class=
"diff-old">3.14.9.12.</del> <ins class=
"diff-chg">3.12.10.13.</ins></span> Event summary</h5>
<p>The following events fire on <a href="#media7" title=
"media element">media elements</a> as part of the processing model
described above:</p>
<table>
<thead>
<tr>
<th>Event name</th>
<th>Interface</th>
<th>Dispatched when...</th>
<th>Preconditions</th>
</tr>
</thead>
<tbody>
<tr>
<td><dfn id="loadstart" title="event-loadstart"><code><del class=
"diff-old">begin</del> <ins class=
"diff-chg">loadstart</ins></code></dfn></td>
<td><code>ProgressEvent</code> <a href=
"#references">[PROGRESS]</a></td>
<td>The user agent begins fetching the <a href="#media9">media
data</a> , synchronously during the <code title=
"dom-media-load"><a href="#load">load()</a></code> method
call.</td>
<td><code title="dom-media-networkState"><a href=
"#networkstate">networkState</a></code> equals <code title=
"dom-media-LOADING"><a href="#loading0">LOADING</a></code></td>
</tr>
<tr>
<td><dfn id="progress0" title=
"event-progress"><code>progress</code></dfn></td>
<td><code>ProgressEvent</code> <a href=
"#references">[PROGRESS]</a></td>
<td>The user agent is fetching <a href="#media9">media data</a>
.</td>
<td><code title="dom-media-networkState"><a href=
"#networkstate">networkState</a></code> is more than <code title=
"dom-media-EMPTY"><a href="#empty">EMPTY</a></code> and less than
<code title="dom-media-LOADED"><a href=
"#loaded">LOADED</a></code></td>
</tr>
<tr>
<td><dfn id="loadedmetadata0" title=
"event-loadedmetadata"><code>loadedmetadata</code></dfn></td>
<td><code>Event</code></td>
<td>The user agent is fetching <a href="#media9">media data</a> ,
and the <a href="#media10">media resource</a> 's metadata has just
been received.</td>
<td><code title="dom-media-networkState"><a href=
"#networkstate">networkState</a></code> equals <code title=
"dom-media-LOADED_METADATA"><a href=
"#loadedmetadata">LOADED_METADATA</a></code></td>
</tr>
<tr>
<td><dfn id="loadedfirstframe0" title=
"event-loadedfirstframe"><code>loadedfirstframe</code></dfn></td>
<td><code>Event</code></td>
<td>The user agent is fetching <a href="#media9">media data</a> ,
and the <a href="#media10">media resource</a> 's first frame has
just been received.</td>
<td><code title="dom-media-networkState"><a href=
"#networkstate">networkState</a></code> equals <code title=
"dom-media-LOADED_FIRST_FRAME"><a href=
"#loadedfirstframe">LOADED_FIRST_FRAME</a></code></td>
</tr>
<tr>
<td><dfn id="load0" title="event-load"><code>load</code></dfn></td>
<td><code>ProgressEvent</code> <a href=
"#references">[PROGRESS]</a></td>
<td>The user agent finishes downloading the entire <a href=
"#media10">media resource</a> .</td>
<td><code title="dom-media-networkState"><a href=
"#networkstate">networkState</a></code> equals <code title=
"dom-media-LOADED"><a href="#loaded">LOADED</a></code></td>
</tr>
<tr>
<td><dfn id="abort" title=
"event-abort"><code>abort</code></dfn></td>
<td><code>ProgressEvent</code> <a href=
"#references">[PROGRESS]</a></td>
<td>The user agent stops fetching the <a href="#media9">media
data</a> before it is completely downloaded. This can be fired
synchronously during the <code title="dom-media-load"><a href=
"#load">load()</a></code> method call.</td>
<td><code title="dom-media-error"><a href=
"#error0">error</a></code> is an object with the code <code title=
"dom-MediaError-MEDIA_ERR_ABORTED"><a href=
"#mediaerraborted">MEDIA_ERR_ABORTED</a></code> . <code title=
"dom-media-networkState"><a href=
"#networkstate">networkState</a></code> equals either <code title=
"dom-media-EMPTY"><a href="#empty">EMPTY</a></code> or <code title=
"dom-media-LOADED"><a href="#loaded">LOADED</a></code> , depending
on when the download was aborted.</td>
</tr>
<tr>
<td><dfn id="error1" title=
"event-error"><code>error</code></dfn></td>
<td><code>ProgressEvent</code> <a href=
"#references">[PROGRESS]</a></td>
<td>An error occurs while fetching the <a href="#media9">media
data</a> .</td>
<td><code title="dom-media-error"><a href=
"#error0">error</a></code> is an object with the code <code title=
"dom-MediaError-MEDIA_ERR_NETWORK_ERROR">MEDIA_ERR_NETWORK_ERROR</code>
or higher. <code title="dom-media-networkState"><a href=
"#networkstate">networkState</a></code> equals either <code title=
"dom-media-EMPTY"><a href="#empty">EMPTY</a></code> or <code title=
"dom-media-LOADED"><a href="#loaded">LOADED</a></code> , depending
on when the download was aborted.</td>
</tr>
<tr>
<td><dfn id="emptied" title=
"event-emptied"><code>emptied</code></dfn></td>
<td><code>Event</code></td>
<td>A <a href="#media7">media element</a> whose <code title=
"dom-media-networkState"><a href=
"#networkstate">networkState</a></code> was previously not in the
<code title="dom-media-EMPTY"><a href="#empty">EMPTY</a></code>
state has just switched to that state (either because of a fatal
error during load that's about to be reported, or because the
<code title="dom-media-load"><a href="#load">load()</a></code>
method was reinvoked, in which case it is fired synchronously
during the <code title="dom-media-load"><a href=
"#load">load()</a></code> method call).</td>
<td><code title="dom-media-networkState"><a href=
"#networkstate">networkState</a></code> is <code title=
"dom-media-EMPTY"><a href="#empty">EMPTY</a></code> ; all the DOM
attributes are in their initial states.</td>
</tr>
<tr>
<td><dfn id="stalled" title=
"event-stalled"><code>stalled</code></dfn></td>
<td><code>ProgressEvent</code></td>
<td>The user agent is trying to fetch <a href="#media9">media
data</a> , but data is unexpectedly not forthcoming.</td>
<td></td>
</tr>
<tr>
<td><dfn id="play0" title="event-play"><code>play</code></dfn></td>
<td><code>Event</code></td>
<td>Playback has begun. Fired after the <code title=
"dom-media-play"><a href="#play">play</a></code> method has
returned.</td>
<td><code title="dom-media-paused"><a href=
"#paused">paused</a></code> is newly false.</td>
</tr>
<tr>
<td><dfn id="pause1" title=
"event-pause"><code>pause</code></dfn></td>
<td><code>Event</code></td>
<td>Playback has been paused. Fired after the <code title=
"dom-media-pause"><a href="#pause0">pause</a></code> method has
returned.</td>
<td><code title="dom-media-paused"><a href=
"#paused">paused</a></code> is newly true.</td>
</tr>
<tr>
<td><dfn id="waiting" title=
"event-waiting"><code>waiting</code></dfn></td>
<td><code>Event</code></td>
<td>Playback has stopped because the next frame is not available,
but the user agent expects that frame to become available in due
course.</td>
<td><code title="dom-media-readyState"><a href=
"#readystate0">readyState</a></code> is either <code title=
"dom-media-DATA_UNAVAILABLE"><a href=
"#dataunavailable">DATA_UNAVAILABLE</a></code> or <code title=
"dom-media-CAN_SHOW_CURRENT_FRAME"><a href=
"#canshowcurrentframe">CAN_SHOW_CURRENT_FRAME</a></code> , and
<code title="dom-media-paused"><a href="#paused">paused</a></code>
is false. Either <code title="dom-media-seeking"><a href=
"#seeking0">seeking</a></code> is true, or the <a href=
"#current0">current playback position</a> is not contained in any
of the ranges in <code title="dom-media-buffered"><a href=
"#buffered">buffered</a></code> . It is possible for playback to
stop for two other reasons without <code title=
"dom-media-paused"><a href="#paused">paused</a></code> being false,
but those two reasons do not fire this event: maybe <a href=
"#ended" title="ended playback">playback ended</a> , or playback
<a href="#stopped">stopped due to errors</a> .</td>
</tr>
<tr>
<td><dfn id="seeking1" title="event-seeking"><code><ins class=
"diff-new">seeking</ins></code></dfn></td>
<td><code><ins class="diff-new">Event</ins></code></td>
<td><ins class="diff-new">The</ins> <code title=
"dom-media-seeking"><a href="#seeking0"><ins class=
"diff-new">seeking</ins></a></code> <ins class="diff-new">DOM
attribute changed to true and the seek operation is taking long
enough that the user agent has time to fire the event.</ins></td>
<td></td>
</tr>
<tr>
<td><dfn id="seeked" title="event-seeked"><code><ins class=
"diff-new">seeked</ins></code></dfn></td>
<td><code><ins class="diff-new">Event</ins></code></td>
<td><ins class="diff-new">The</ins> <code title=
"dom-media-seeking"><a href="#seeking0"><ins class=
"diff-new">seeking</ins></a></code> <ins class="diff-new">DOM
attribute changed to false.</ins></td>
<td></td>
</tr>
<tr>
<td><dfn id="timeupdate" title=
"event-timeupdate"><code>timeupdate</code></dfn></td>
<td><code>Event</code></td>
<td>The <a href="#current0">current playback position</a> changed
in an interesting way, for example discontinuously.</td>
<td></td>
</tr>
<tr>
<td><dfn id="ended1" title=
"event-ended"><code>ended</code></dfn></td>
<td><code>Event</code></td>
<td>Playback has stopped because the end of the <a href=
"#media10">media resource</a> was reached.</td>
<td><code title="dom-media-currentTime"><a href=
"#currenttime">currentTime</a></code> equals the <var><a href=
"#effective2">effective end</a></var> ; <code title=
"dom-media-ended"><a href="#ended0">ended</a></code> is true.</td>
</tr>
<tr>
<td><dfn id="dataunavailable0" title=
"event-dataunavailable"><code>dataunavailable</code></dfn></td>
<td><code>Event</code></td>
<td>The user agent cannot render the data at the <a href=
"#current0">current playback position</a> because data for the
current frame is not immediately available.</td>
<td>The <code title="dom-media-readyState"><a href=
"#readystate0">readyState</a></code> attribute is newly equal to
<code title="DATA_UNAVAILABLE">DATA_UNAVAILABLE</code> .</td>
</tr>
<tr>
<td><dfn id="canshowcurrentframe0" title=
"event-canshowcurrentframe"><code>canshowcurrentframe</code></dfn></td>
<td><code>Event</code></td>
<td>The user agent cannot render the data after the <a href=
"#current0">current playback position</a> because data for the next
frame is not immediately available.</td>
<td>The <code title="dom-media-readyState"><a href=
"#readystate0">readyState</a></code> attribute is newly equal to
<code title="dom-media-CAN_SHOW_CURRENT_FRAME"><a href=
"#canshowcurrentframe">CAN_SHOW_CURRENT_FRAME</a></code> .</td>
</tr>
<tr>
<td><dfn id="canplay0" title=
"event-canplay"><code>canplay</code></dfn></td>
<td><code>Event</code></td>
<td>The user agent can resume playback of the <a href=
"#media9">media data</a> , but estimates that if playback were to
be started now, the <a href="#media10">media resource</a> could not
be rendered at the current playback rate up to its end without
having to stop for further buffering of content.</td>
<td>The <code title="dom-media-readyState"><a href=
"#readystate0">readyState</a></code> attribute is newly equal to
<code title="dom-media-CAN_PLAY"><a href=
"#canplay">CAN_PLAY</a></code> .</td>
</tr>
<tr>
<td><dfn id="canplaythrough0" title=
"event-canplaythrough"><code>canplaythrough</code></dfn></td>
<td><code>Event</code></td>
<td>The user agent estimates that if playback were to be started
now, the <a href="#media10">media resource</a> could be rendered at
the current playback rate all the way to its end without having to
stop for further buffering.</td>
<td>The <code title="dom-media-readyState"><a href=
"#readystate0">readyState</a></code> attribute is newly equal to
<code title="dom-media-CAN_PLAY_THROUGH"><a href=
"#canplaythrough">CAN_PLAY_THROUGH</a></code> .</td>
</tr>
<tr>
<td><dfn id="ratechange" title=
"event-ratechange"><code>ratechange</code></dfn></td>
<td><code>Event</code></td>
<td>Either the <code title="dom-media-defaultPlaybackRate"><a href=
"#defaultplaybackrate">defaultPlaybackRate</a></code> or the
<code title="dom-media-playbackRate"><a href=
"#playbackrate">playbackRate</a></code> attribute has just been
updated.</td>
<td></td>
</tr>
<tr>
<td><dfn id="durationchange" title=
"event-durationchange"><code>durationchange</code></dfn></td>
<td><code>Event</code></td>
<td>The <code title="dom-media-duration"><a href=
"#duration">duration</a></code> attribute has just been
updated.</td>
<td></td>
</tr>
<tr>
<td><dfn id="volumechange" title=
"event-volumechange"><code>volumechange</code></dfn></td>
<td><code>Event</code></td>
<td>Either the <code title="dom-media-volume"><a href=
"#volume">volume</a></code> attribute or the <code title=
"dom-media-muted"><a href="#muted">muted</a></code> attribute has
changed. Fired after the relevant attribute's setter has
returned.</td>
<td></td>
</tr>
</tbody>
</table>
<h5 id="security0"><span class="secno"><del class=
"diff-old">3.14.9.13.</del> <ins class=
"diff-chg">3.12.10.14.</ins></span> Security and privacy
considerations</h5>
<p class="big-issue">Talk about making sure interactive media files
(e.g. SVG) don't have access to the container DOM (XSS potential);
talk about not exposing any sensitive data like metadata from
tracks in the media files (intranet snooping risk) <del class=
"diff-old">3.14.10. The source element Categories None. Contexts in
which this element may be used: As a child of a media element ,
before any prose content . Content model: Empty. Element-specific
attributes: src type media DOM interface: <pre
class=idl>interface { attribute DOMString ; attribute DOMString
; attribute DOMString ; }; The source element allows authors to
specify multiple media resources for media elements . The src
attribute gives the address of the media resource . The value must
be a URI (or IRI). This attribute must be present. The type
attribute gives the type of the media resource , to help the user
agent determine if it can play this media resource before
downloading it. Its value must be a MIME type. The codecs parameter
may be specified and might be necessary to specify exactly how the
resource is encoded. [RFC2046] [RFC4281] The following list shows
some examples of how to use the codecs= MIME parameter in the type
attribute. H.264 Simple baseline profile video (main and extended
video compatible) level 3 and Low-Complexity AAC audio in MP4
container <source src="video.mp4" type="video/mp4;
codecs=&quot;avc1.42E01E, mp4a.40.2&quot;"> H.264
Extended profile video (baseline-compatible) level 3 and
Low-Complexity AAC audio in MP4 container <source
src="video.mp4" type="video/mp4; codecs=&quot;avc1.58A01E,
mp4a.40.2&quot;"> H.264 Main profile video level 3 and
Low-Complexity AAC audio in MP4 container <source
src="video.mp4" type="video/mp4; codecs=&quot;avc1.4D401E,
mp4a.40.2&quot;"> H.264 "High" profile video (incompatible
with main, baseline, or extended profiles) level 3 and
Low-Complexity AAC audio in MP4 container <source
src="video.mp4" type="video/mp4; codecs=&quot;avc1.64001E,
mp4a.40.2&quot;"> MPEG-4 Visual Simple Profile Level 0 video
and Low-Complexity AAC audio in MP4 container <source
src="video.mp4" type="video/mp4; codecs=&quot;mp4v.20.8,
mp4a.40.2&quot;"> MPEG-4 Advanced Simple Profile Level 0
video and Low-Complexity AAC audio in MP4 container <source
src="video.mp4" type="video/mp4; codecs=&quot;mp4v.20.240,
mp4a.40.2&quot;"> MPEG-4 Visual Simple Profile Level 0 video
and AMR audio in 3GPP container <source src="video.3gp"
type="video/3gpp; codecs=&quot;mp4v.20.8, samr&quot;">
Theora video and Vorbis audio in Ogg container <source
src="video.ogv" type="video/ogg; codecs=&quot;theora,
vorbis&quot;"> Theora video and Speex audio in Ogg container
<source src="video.ogv" type="video/ogg;
codecs=&quot;theora, speex&quot;"> Vorbis audio alone in
Ogg container <source src="audio.oga" type="audio/ogg;
codecs=vorbis"> Speex audio alone in Ogg container <source
src="audio.oga" type="audio/ogg; codecs=speex"> Flac audio alone
in Ogg container <source src="audio.oga" type="audio/ogg;
codecs=flac"> Dirac video and Vorbis audio in Ogg container
<source src="video.ogv" type="video/ogg; codecs=&quot;dirac,
vorbis&quot;"> Theora video and Vorbis audio in Matroska
container <source src="video.mkv" type="video/x-matroska;
codecs=&quot;theora, vorbis&quot;"> The media attribute
gives the intended media type of the media resource , to help the
user agent determine if this media resource is useful to the user
before downloading it. Its value must be a valid media query. [MQ]
Either the type attribute, the media attribute or both, must be
specified, unless this is the last source element child of the
parent element. If a source element is inserted into a media
element that is already in a document and whose networkState is in
the EMPTY state, the user agent must implicitly invoke the load()
method on the media element as soon as all other scripts have
finished executing. Any exceptions raised must be ignored. The DOM
attributes src , type , and media must reflect the respective
content attributes of the same name.</del></p>
<h4 id="the-canvas"><span class="secno"><del class=
"diff-old">3.14.11.</del> <ins class=
"diff-chg">3.12.11</ins></span> The <dfn id=
"canvas"><code>canvas</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#embedded1">Embedded content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#embedded1">embedded content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><a href="#transparent0">Transparent</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-canvas-width"><a href=
"#width0">width</a></code></dd>
<dd><code title="attr-canvas-height"><a href=
"#height0">height</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlcanvaselement">HTMLCanvasElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
<del class="diff-old"> attribute unsigned long ;
attribute unsigned long ;
</del>
<ins class="diff-chg"> attribute unsigned long <a href=
"#width1" title="dom-canvas-width">width</a>;
attribute unsigned long <a href="#height1" title=
"dom-canvas-height">height</a>;
</ins>
DOMString <a href="#todataurl" title=
"dom-canvas-toDataURL">toDataURL</a>();
DOMString <a href="#todataurl0" title=
"dom-canvas-toDataURL-type">toDataURL</a>(in DOMString type);
DOMObject <a href="#getcontext" title=
"dom-canvas-getContext">getContext</a>(in DOMString contextId);
};
</pre></dd>
</dl>
<p>The <code><a href="#canvas">canvas</a></code> element represents
a resolution-dependent bitmap canvas, which can be used for
rendering graphs, game graphics, or other visual images on the
fly.</p>
<p>Authors should not use the <code><a href=
"#canvas">canvas</a></code> element in a document when a more
suitable element is available. For example, it is inappropriate to
use a <code><a href="#canvas">canvas</a></code> element to render a
page heading: if the desired presentation of the heading is
graphically intense, it should be marked up using appropriate
elements (typically <code><a href="#h1">h1</a></code> ) and then
styled using CSS and supporting technologies such as XBL.</p>
<p>When authors use the <code><a href="#canvas">canvas</a></code>
element, they should also provide content that, when presented to
the user, conveys essentially the same function or purpose as the
bitmap canvas. This content may be placed as content of the
<code><a href="#canvas">canvas</a></code> element. The contents of
the <code><a href="#canvas">canvas</a></code> element, if any, are
the element's <a href="#fallback">fallback content</a> .</p>
<p>In interactive visual <del class="diff-old">media with scripting
enabled ,</del> <ins class="diff-chg">media, if</ins> the
<code><a href="#canvas">canvas</a></code> element is <a href=
"#with-script"><ins class="diff-new">with script</ins></a>
,<ins class="diff-new">the</ins> <code><a href=
"#canvas"><ins class="diff-new">canvas</ins></a></code> <ins class=
"diff-new">element represents</ins> an embedded element with a
dynamically created image.</p>
<p>In non-interactive, static, visual media, if the <code><a href=
"#canvas">canvas</a></code> element has been previously painted on
(e.g. if the page was viewed in an interactive visual medium and is
now being printed, or if some script that ran during the page
layout process painted on the element), then the <code><a href=
"#canvas">canvas</a></code> element <del class="diff-old">must be
treated as</del> <ins class="diff-chg">represents</ins> <a href=
"#embedded1">embedded content</a> with the current image and size.
Otherwise, the <del class="diff-old">element's</del> <ins class=
"diff-chg">element represents its</ins> <a href=
"#fallback">fallback content</a> <del class="diff-old">must be
used</del> instead.</p>
<p>In non-visual media, and in visual media <del class=
"diff-old">with scripting disabled ,</del> <ins class=
"diff-chg">if</ins> the <code><a href="#canvas">canvas</a></code>
<del class="diff-old">element's</del> <ins class="diff-chg">element
is</ins> <a href="#without"><ins class="diff-chg">without
script</ins></a> ,<ins class="diff-chg">the</ins> <code><a href=
"#canvas"><ins class="diff-chg">canvas</ins></a></code> <ins class=
"diff-chg">element represents its</ins> <a href=
"#fallback">fallback content</a> <del class="diff-old">must be
used</del> instead.</p>
<p>The <code><a href="#canvas">canvas</a></code> element has two
attributes to control the size of the coordinate space: <dfn id=
"width0" title="attr-canvas-width"><code>width</code></dfn> and
<dfn id="height0" title=
"attr-canvas-height"><code>height</code></dfn> . These attributes,
when specified, must have values that are <a href="#valid" title=
"valid non-negative integer">valid non-negative integers</a> . The
<a href="#rules">rules for parsing non-negative integers</a> must
be used to obtain their numeric values. If an attribute is missing,
or if parsing its value returns an error, then the default value
must be used instead. The <code title="attr-canvas-width"><a href=
"#width0">width</a></code> attribute defaults to 300, and the
<code title="attr-canvas-height"><a href=
"#height0">height</a></code> attribute defaults to 150.</p>
<p>The intrinsic dimensions of the <code><a href=
"#canvas">canvas</a></code> element equal the size of the
coordinate space, with the numbers interpreted in CSS pixels.
However, the element can be sized arbitrarily by a style sheet.
During rendering, the image is scaled to fit this layout size.</p>
<p>The size of the coordinate space does not necessarily represent
the size of the actual bitmap that the user agent will use
internally or during rendering. On high-definition displays, for
instance, the user agent may internally use a bitmap with two
device pixels per unit in the coordinate space, so that the
rendering remains at high quality throughout.</p>
<p><del class="diff-old">The canvas must initially be fully
transparent black.</del> Whenever the <code title=
"attr-canvas-width"><a href="#width0">width</a></code> and
<code title="attr-canvas-height"><a href=
"#height0">height</a></code> attributes are set (whether to a new
value or to the previous value), the bitmap and any associated
contexts must be cleared back to their initial state and
<del class="diff-old">reinitialised</del> <ins class=
"diff-chg">reinitialized</ins> with the newly specified coordinate
space dimensions.</p>
<p>The <dfn id="width1" title=
"dom-canvas-width"><code>width</code></dfn> and <dfn id="height1"
title="dom-canvas-height"><code>height</code></dfn> DOM attributes
must <a href="#reflect">reflect</a> the content attributes of the
same name.</p>
<div class="example">
<p>Only one square appears to be drawn in the following
example:</p>
<pre>
// canvas is a reference to a <canvas> element
var context = canvas.getContext('2d');
context.fillRect(0,0,50,50);
canvas.setAttribute('width', '300'); // clears the canvas
context.fillRect(0,100,50,50);
canvas.width = canvas.width; // clears the canvas
context.fillRect(100,0,50,50);
//
only
this
square
remains
</pre></div>
<p><ins class="diff-new">When the canvas is initialized it must be
set to fully transparent black.</ins></p>
<p>To draw on the canvas, authors must first obtain a reference to
a <dfn id="context0">context</dfn> using the <dfn id="getcontext"
title="dom-canvas-getContext"><code>getContext( <var title=
"">contextId</var> )</code></dfn> method of the <code><a href=
"#canvas">canvas</a></code> element.</p>
<p>This specification only defines one context, with the name "
<code title="canvas-context-2d"><a href="#d">2d</a></code> ". If
<code title="dom-canvas-getContext"><a href=
"#getcontext">getContext()</a></code> is called with that exact
string for its <var title="">contextId</var> argument, then the UA
must return a reference to an object implementing <code><a href=
"#canvasrenderingcontext2d">CanvasRenderingContext2D</a></code> .
Other specifications may define their own contexts, which would
return different objects.</p>
<p>Vendors may also define experimental contexts using the syntax
<code><var title="">vendorname</var> - <var title=
"">context</var></code> , for example, <code>moz-3d</code> .</p>
<p>When the UA is passed an empty string or a string specifying a
context that it does not support, then it must return null. String
comparisons must be literal and case-sensitive.</p>
<p><ins class="diff-new">Arguments other than the</ins> <var title=
""><ins class="diff-new">contextId</ins></var> <ins class=
"diff-new">must be ignored, and must not cause the user agent to
raise an exception (as would normally occur if a method was called
with the wrong number of arguments).</ins></p>
<p class="note">A future version of this specification will
probably define a <code>3d</code> context (probably based on the
OpenGL ES API).</p>
<p>The <dfn id="todataurl" title=
"dom-canvas-toDataURL"><code>toDataURL()</code></dfn> method must,
when called with no arguments, return a <code title="">data:</code>
URI containing a representation of the image as a PNG file.
<a href="#references">[PNG]</a> .</p>
<p><ins class="diff-new">If the canvas has no pixels (i.e. either
its horizontal dimension or its vertical dimension is zero) then
the method must return the string "</ins> <code title=
""><ins class="diff-new">data:,</ins></code> <ins class=
"diff-new">". (This is the shortest</ins> <code title=
""><ins class="diff-new">data:</ins></code> <ins class=
"diff-new">URI; it represents the empty string in a</ins>
<code title=""><ins class="diff-new">text/plain</ins></code>
<ins class="diff-new">resource.)</ins></p>
<p>The <dfn id="todataurl0" title=
"dom-canvas-toDataURL-type"><code>toDataURL( <var title=
"">type</var> )</code></dfn> method (when called with one <em>or
more</em> arguments) must return a <code title="">data:</code> URI
containing a representation of the image in the format given by
<var title="">type</var> . The possible values are MIME types with
no parameters, for example <code>image/png</code> ,
<code>image/jpeg</code> , or even maybe <code>image/svg+xml</code>
if the implementation actually keeps enough information to reliably
render an SVG image from the canvas.</p>
<p>Only support for <code>image/png</code> is required. User agents
may support other types. If the user agent does not support the
requested type, it must return the image using the PNG format.</p>
<p>User agents must convert the provided type to lower case before
establishing if they support that type and before creating the
<code title="">data:</code> URI.</p>
<p class="note">When trying to use types other than
<code>image/png</code> , authors can check if the image was really
returned in the requested format by checking to see if the returned
string starts with one the exact strings " <code title=
"">data:image/png,</code> " or " <code title=
"">data:image/png;</code> ". If it does, the image is PNG, and thus
the requested type was not supported. <ins class="diff-new">(The
one exception to this is if the canvas has either no height or no
width, in which case the result might simply be "</ins>
<code title=""><ins class="diff-new">data:,</ins></code>
<ins class="diff-new">".)</ins></p>
<p>Arguments other than the <var title="">type</var> must be
ignored, and must not cause the user agent to raise an exception
(as would normally occur if a method was called with the wrong
number of arguments). A future version of this specification will
probably allow extra parameters to be passed to <code title=
"dom-canvas-toDataURL"><a href="#todataurl">toDataURL()</a></code>
to allow authors to more carefully control compression settings,
image metadata, etc. <del class="diff-old">Security: To prevent
information leakage , the toDataURL() and getImageData() methods
should raise a security exception if the canvas has ever had an
image painted on it whose origin is different from that of the
script calling the method.</del></p>
<h5 id="the-2d"><span class="secno"><del class=
"diff-old">3.14.11.1.</del> <ins class=
"diff-chg">3.12.11.1.</ins></span> The 2D context</h5>
<p>When the <code title="dom-canvas-getContext"><a href=
"#getcontext">getContext()</a></code> method of a <code><a href=
"#canvas">canvas</a></code> element is invoked with <dfn id="d"
title="canvas-context-2d"><code>2d</code></dfn> as the argument, a
<code><a href=
"#canvasrenderingcontext2d">CanvasRenderingContext2D</a></code>
object is returned.</p>
<p>There is only one <code><a href=
"#canvasrenderingcontext2d">CanvasRenderingContext2D</a></code>
object per canvas, so calling the <code title=
"dom-canvas-getContext"><a href=
"#getcontext">getContext()</a></code> method with the <code title=
"canvas-context-2d"><a href="#d">2d</a></code> argument a second
time must return the same object.</p>
<p>The 2D context represents a flat <del class=
"diff-old">cartesian</del> <ins class="diff-chg">Cartesian</ins>
surface whose origin (0,0) is at the top left corner, with the
coordinate space having <var title="">x</var> values increasing
when going right, and <var title="">y</var> values increasing when
going down.</p>
<pre class="idl">
interface <dfn id=
"canvasrenderingcontext2d">CanvasRenderingContext2D</dfn> {
// back-reference to the canvas
readonly attribute <a href=
"#htmlcanvaselement">HTMLCanvasElement</a> <a href="#canvas0"
title="dom-context-2d-canvas">canvas</a>;
// state
void <a href="#save" title=
"dom-context-2d-save">save</a>(); // push state on state stack
void <a href="#restore" title=
"dom-context-2d-restore">restore</a>(); // pop state stack and restore state
// transformations (default transform is the identity matrix)
void <a href="#scale" title=
"dom-context-2d-scale">scale</a>(in float x, in float y);
void <a href="#rotate" title=
"dom-context-2d-rotate">rotate</a>(in float angle);
void <a href="#translate" title=
"dom-context-2d-translate">translate</a>(in float x, in float y);
void <a href="#transform" title=
"dom-context-2d-transform">transform</a>(in float m11, in float m12, in float m21, in float m22, in float dx, in float dy);
void <a href="#settransform" title=
"dom-context-2d-setTransform">setTransform</a>(in float m11, in float m12, in float m21, in float m22, in float dx, in float dy);
// compositing
attribute float <a href="#globalalpha" title=
"dom-context-2d-globalAlpha">globalAlpha</a>; // (default 1.0)
attribute DOMString <a href="#globalcompositeoperation"
title=
"dom-context-2d-globalCompositeOperation">globalCompositeOperation</a>; // (default source-over)
// colors and styles
attribute DOMObject <a href="#strokestyle" title=
"dom-context-2d-strokeStyle">strokeStyle</a>; // (default black)
attribute DOMObject <a href="#fillstyle" title=
"dom-context-2d-fillStyle">fillStyle</a>; // (default black)
<a href="#canvasgradient0">CanvasGradient</a> <a href=
"#createlineargradient" title=
"dom-context-2d-createLinearGradient">createLinearGradient</a>(in float x0, in float y0, in float x1, in float y1);
<a href="#canvasgradient0">CanvasGradient</a> <a href=
"#createradialgradient" title=
"dom-context-2d-createRadialGradient">createRadialGradient</a>(in float x0, in float y0, in float r0, in float x1, in float y1, in float r1);
<del class="diff-old"> image, DOMString repetition);
image, DOMString repetition);
</del>
<a href="#canvaspattern0">CanvasPattern</a> <a href=
"#createpattern" title=
"dom-context-2d-createPattern">createPattern</a>(in <a href=
"#htmlimageelement">HTMLImageElement</a> image, in DOMString repetition);
<a href="#canvaspattern0">CanvasPattern</a> <a href=
"#createpattern" title=
"dom-context-2d-createPattern">createPattern</a>(in <a href=
"#htmlcanvaselement">HTMLCanvasElement</a> image, in DOMString repetition);
// line caps/joins
attribute float <a href="#linewidth" title=
"dom-context-2d-lineWidth">lineWidth</a>; // (default 1)
attribute DOMString <a href="#linecap" title=
"dom-context-2d-lineCap">lineCap</a>; // "butt", "round", "square" (default "butt")
attribute DOMString <a href="#linejoin" title=
"dom-context-2d-lineJoin">lineJoin</a>; // "round", "bevel", "miter" (default "miter")
attribute float <a href="#miterlimit" title=
"dom-context-2d-miterLimit">miterLimit</a>; // (default 10)
// shadows
attribute float <a href="#shadowoffsetx" title=
"dom-context-2d-shadowOffsetX">shadowOffsetX</a>; // (default 0)
attribute float <a href="#shadowoffsety" title=
"dom-context-2d-shadowOffsetY">shadowOffsetY</a>; // (default 0)
attribute float <a href="#shadowblur" title=
"dom-context-2d-shadowBlur">shadowBlur</a>; // (default 0)
attribute DOMString <a href="#shadowcolor" title=
"dom-context-2d-shadowColor">shadowColor</a>; // (default transparent black)
// rects
void <a href="#clearrect" title=
"dom-context-2d-clearRect">clearRect</a>(in float x, in float y, in float w, in float h);
void <a href="#fillrect" title=
"dom-context-2d-fillRect">fillRect</a>(in float x, in float y, in float w, in float h);
void <a href="#strokerect" title=
"dom-context-2d-strokeRect">strokeRect</a>(in float x, in float y, in float w, in float h);
// path API
void <a href="#beginpath" title=
"dom-context-2d-beginPath">beginPath</a>();
void <a href="#closepath" title=
"dom-context-2d-closePath">closePath</a>();
void <a href="#moveto" title=
"dom-context-2d-moveTo">moveTo</a>(in float x, in float y);
void <a href="#lineto" title=
"dom-context-2d-lineTo">lineTo</a>(in float x, in float y);
void <a href="#quadraticcurveto" title=
"dom-context-2d-quadraticCurveTo">quadraticCurveTo</a>(in float cpx, in float cpy, in float x, in float y);
void <a href="#beziercurveto" title=
"dom-context-2d-bezierCurveTo">bezierCurveTo</a>(in float cp1x, in float cp1y, in float cp2x, in float cp2y, in float x, in float y);
void <a href="#arcto" title=
"dom-context-2d-arcTo">arcTo</a>(in float x1, in float y1, in float x2, in float y2, in float radius);
void <a href="#rectx" title=
"dom-context-2d-rect">rect</a>(in float x, in float y, in float w, in float h);
void <a href="#arcx-" title=
"dom-context-2d-arc">arc</a>(in float x, in float y, in float radius, in float startAngle, in float endAngle, in boolean anticlockwise);
void <a href="#fill" title="dom-context-2d-fill">fill</a>();
void <a href="#stroke" title=
"dom-context-2d-stroke">stroke</a>();
void <a href="#clip" title="dom-context-2d-clip">clip</a>();
boolean <a href="#ispointinpath" title=
"dom-context-2d-isPointInPath">isPointInPath</a>(in float x, in float y);
<ins class="diff-new"> // text
attribute DOMString <a href="#font" title=
"dom-context-2d-font">font</a>; // (default 10px sans-serif)
attribute DOMString <a href="#textalign" title=
"dom-context-2d-textAlign">textAlign</a>; // "start", "end", "left", "right", "center" (default: "start")
attribute DOMString <a href="#textbaseline" title=
"dom-context-2d-textBaseline">textBaseline</a>; // "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" (default: "alphabetic")
void <a href="#filltext" title=
"dom-context-2d-fillText">fillText</a>(in DOMString text, in float x, in float y);
void <a href="#filltext" title=
"dom-context-2d-fillText">fillText</a>(in DOMString text, in float x, in float y, in float maxWidth);
void <a href="#stroketext" title=
"dom-context-2d-strokeText">strokeText</a>(in DOMString text, in float x, in float y);
void <a href="#stroketext" title=
"dom-context-2d-strokeText">strokeText</a>(in DOMString text, in float x, in float y, in float maxWidth);
</ins> <a href="#textmetrics">TextMetrics</a> <a href=
"#measuretext" title=
"dom-context-2d-measureText">measureText</a>(in DOMString text);
// drawing images
void <a href="#drawimage" title=
"dom-context-2d-drawImage">drawImage</a>(in <a href=
"#htmlimageelement">HTMLImageElement</a> image, in float dx, in float dy);
void <a href="#drawimage" title=
"dom-context-2d-drawImage">drawImage</a>(in <a href=
"#htmlimageelement">HTMLImageElement</a> image, in float dx, in float dy, in float dw, in float dh);
void <a href="#drawimage" title=
"dom-context-2d-drawImage">drawImage</a>(in <a href=
"#htmlimageelement">HTMLImageElement</a> image, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh);
void <a href="#drawimage" title=
"dom-context-2d-drawImage">drawImage</a>(in <a href=
"#htmlcanvaselement">HTMLCanvasElement</a> image, in float dx, in float dy);
void <a href="#drawimage" title=
"dom-context-2d-drawImage">drawImage</a>(in <a href=
"#htmlcanvaselement">HTMLCanvasElement</a> image, in float dx, in float dy, in float dw, in float dh);
void <a href="#drawimage" title=
"dom-context-2d-drawImage">drawImage</a>(in <a href=
"#htmlcanvaselement">HTMLCanvasElement</a> image, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh);
// pixel manipulation
<a href="#imagedata">ImageData</a> <a href="#createimagedata"
title=
"dom-context-2d-createImageData">createImageData</a>(in float sw, in float sh);
<a href="#imagedata">ImageData</a> <a href="#getimagedata" title=
"dom-context-2d-getImageData">getImageData</a>(in float sx, in float sy, in float sw, in float sh);
void <a href="#putimagedata" title=
"dom-context-2d-putImageData">putImageData</a>(in <a href=
"#imagedata">ImageData</a> imagedata, in float dx, in float dy);
<del class=
"diff-old"> // drawing text is not supported in this version of the API
// (there is no way to predict what metrics the fonts will have,
// which makes fonts very hard to use for painting)
</del>
<ins class="diff-chg"> void <a href="#putimagedata" title=
"dom-context-2d-putImageData">putImageData</a>(in <a href=
"#imagedata">ImageData</a> imagedata, in float dx, in float dy, in float dirtyX, in float dirtyY, in float dirtyWidth, in float dirtyHeight);
</ins>
};
interface <dfn id="canvasgradient">CanvasGradient</dfn> {
// opaque object
void <a href="#addcolorstop" title=
"dom-canvasgradient-addColorStop">addColorStop</a>(in float offset, in DOMString color);
};
interface <dfn id="canvaspattern">CanvasPattern</dfn> {
// opaque object
};
<ins class="diff-new">interface <dfn id=
"textmetrics">TextMetrics</dfn> {
readonly attribute float <a href="#width2" title=
"dom-textmetrics-width">width</a>;
};
</ins>
interface <dfn id="imagedata">ImageData</dfn> {
<del class="diff-old"> readonly attribute long int ;
</del>
<ins class="diff-chg"> readonly attribute long int <a href=
"#width3" title="dom-imagedata-width">width</a>;
</ins>
readonly attribute long int <a href="#height2" title=
"dom-imagedata-height">height</a>;
readonly attribute int[] <a href="#data1" title=
"dom-imagedata-data">data</a>;
};
</pre>
<p>The <dfn id="canvas0" title=
"dom-context-2d-canvas"><code>canvas</code></dfn> attribute must
return the <code><a href="#canvas">canvas</a></code> element that
the context paints on.</p>
<p><ins class="diff-new">Unless otherwise stated, for the 2D
context interface, any method call with a numeric argument whose
value is infinite or a NaN value must be ignored.</ins></p>
<h6 id="the-canvas0"><span class="secno"><del class=
"diff-old">3.14.11.1.1.</del> <ins class=
"diff-chg">3.12.11.1.1.</ins></span> The canvas state</h6>
<p>Each context maintains a stack of drawing states. <dfn id=
"drawing0" title="drawing state">Drawing states</dfn> consist
of:</p>
<ul class="brief">
<li>The current <a href="#transformations0" title=
"dom-context-2d-transformation">transformation matrix</a> .</li>
<li>The current <a href="#clipping">clipping <del class=
"diff-old">path</del> <ins class="diff-chg">region</ins></a> .</li>
<li>The current values of the following attributes: <code title=
"dom-context-2d-strokeStyle"><a href=
"#strokestyle">strokeStyle</a></code> , <code title=
"dom-context-2d-fillStyle"><a href=
"#fillstyle">fillStyle</a></code> , <code title=
"dom-context-2d-globalAlpha"><a href=
"#globalalpha">globalAlpha</a></code> , <code title=
"dom-context-2d-lineWidth"><a href=
"#linewidth">lineWidth</a></code> , <code title=
"dom-context-2d-lineCap"><a href="#linecap">lineCap</a></code> ,
<code title="dom-context-2d-lineJoin"><a href=
"#linejoin">lineJoin</a></code> , <code title=
"dom-context-2d-miterLimit"><a href=
"#miterlimit">miterLimit</a></code> , <code title=
"dom-context-2d-shadowOffsetX"><a href=
"#shadowoffsetx">shadowOffsetX</a></code> , <code title=
"dom-context-2d-shadowOffsetY"><a href=
"#shadowoffsety">shadowOffsetY</a></code> , <code title=
"dom-context-2d-shadowBlur"><a href=
"#shadowblur">shadowBlur</a></code> , <code title=
"dom-context-2d-shadowColor"><a href=
"#shadowcolor">shadowColor</a></code> , <code title=
"dom-context-2d-globalCompositeOperation"><a href=
"#globalcompositeoperation">globalCompositeOperation</a></code> ,
<code title="dom-context-2d-font"><a href="#font"><ins class=
"diff-new">font</ins></a></code> ,<code title=
"dom-context-2d-textAlign"><a href="#textalign"><ins class=
"diff-new">textAlign</ins></a></code> ,<code title=
"dom-context-2d-textBaseline"><a href="#textbaseline"><ins class=
"diff-new">textBaseline</ins></a></code> .</li>
</ul>
<p class="note">The current path and the current bitmap are not
part of the drawing state. The current path is persistent, and can
only be reset using the <code title=
"dom-context-2d-beginPath"><a href=
"#beginpath">beginPath()</a></code> method. The current bitmap is
<span title="concept-canvas-image">a property of the canvas</span>
, not the context.</p>
<p>The <dfn id="save" title=
"dom-context-2d-save"><code>save()</code></dfn> method must push a
copy of the current drawing state onto the drawing state stack.</p>
<p>The <dfn id="restore" title=
"dom-context-2d-restore"><code>restore()</code></dfn> method must
pop the top entry in the drawing state stack, and reset the drawing
state it describes. If there is no saved state, the method must do
nothing.</p>
<h6 id="transformations"><span class="secno"><del class=
"diff-old">3.14.11.1.2.</del> <ins class=
"diff-chg">3.12.11.1.2.</ins></span> <dfn id="transformations0"
title="dom-context-2d-transformation">Transformations</dfn></h6>
<p>The transformation matrix is applied to coordinates when
creating shapes and paths.</p>
<p>When the context is created, the transformation matrix must
initially be the identity transform. It may then be adjusted using
the transformation methods.</p>
<p>The <del class="diff-old">transformation matrix can become
infinite, at which point nothing is drawn anymore. The</del>
transformations must be performed in reverse order. For instance,
if a scale transformation that doubles the width is applied,
followed by a rotation transformation that rotates drawing
operations by a quarter turn, and a rectangle twice as wide as it
is tall is then drawn on the canvas, the actual result will be a
square.</p>
<p>The <dfn id="scale" title="dom-context-2d-scale"><code>scale(
<var title="">x</var> , <var title="">y</var> )</code></dfn> method
must add the scaling transformation described by the arguments to
the transformation matrix. The <var title="">x</var> argument
represents the scale factor in the horizontal direction and the
<var title="">y</var> argument represents the scale factor in the
vertical direction. The factors are multiples. <del class=
"diff-old">If either argument is Infinity the transformation matrix
must be marked as infinite instead of the method throwing an
exception.</del></p>
<p>The <dfn id="rotate" title="dom-context-2d-rotate"><code>rotate(
<var title="">angle</var> )</code></dfn> method must add the
rotation transformation described by the argument to the
transformation matrix. The <var title="">angle</var> argument
represents a clockwise rotation angle expressed in radians.
<ins class="diff-new">If the</ins> <var title=""><ins class=
"diff-new">angle</ins></var> <ins class="diff-new">argument is
infinite, the method call must be ignored.</ins></p>
<p>The <dfn id="translate" title=
"dom-context-2d-translate"><code>translate( <var title="">x</var> ,
<var title="">y</var> )</code></dfn> method must add the
translation transformation described by the arguments to the
transformation matrix. The <var title="">x</var> argument
represents the translation distance in the horizontal direction and
the <var title="">y</var> argument represents the translation
distance in the vertical direction. The arguments are in coordinate
space units. <del class="diff-old">If either argument is Infinity
the transformation matrix must be marked as infinite instead of the
method throwing an exception.</del></p>
<p>The <dfn id="transform" title=
"dom-context-2d-transform"><code>transform( <var title="">m11</var>
, <var title="">m12</var> , <var title="">m21</var> , <var title=
"">m22</var> , <var title="">dx</var> , <var title="">dy</var>
)</code></dfn> method must multiply the current transformation
matrix with the matrix described by:</p>
<table class="matrix">
<tbody>
<tr>
<td><var title="">m11</var></td>
<td><var title="">m21</var></td>
<td><var title="">dx</var></td>
</tr>
<tr>
<td><var title="">m12</var></td>
<td><var title="">m22</var></td>
<td><var title="">dy</var></td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>1</td>
</tr>
</tbody>
</table>
<p><del class="diff-old">If any of the arguments are Infinity the
transformation matrix must be marked as infinite instead of the
method throwing an exception.</del> The <dfn id="settransform"
title="dom-context-2d-setTransform"><code>setTransform( <var title=
"">m11</var> , <var title="">m12</var> , <var title="">m21</var> ,
<var title="">m22</var> , <var title="">dx</var> , <var title=
"">dy</var> )</code></dfn> method must reset the current transform
to the identity matrix, and then invoke the <code><a href=
"#transform" title="dom-context-2d-transform">transform</a> (
<var title="">m11</var> , <var title="">m12</var> , <var title=
"">m21</var> , <var title="">m22</var> , <var title="">dx</var> ,
<var title="">dy</var> )</code> method with the same arguments.
<del class="diff-old">If any of the arguments are Infinity the
transformation matrix must be marked as infinite instead of the
method throwing an exception.</del></p>
<h6 id="compositing"><span class="secno"><del class=
"diff-old">3.14.11.1.3.</del> <ins class=
"diff-chg">3.12.11.1.3.</ins></span> Compositing</h6>
<p>All drawing operations are affected by the global compositing
attributes, <code title="dom-context-2d-globalAlpha"><a href=
"#globalalpha">globalAlpha</a></code> and <code title=
"dom-context-2d-globalCompositeOperation"><a href=
"#globalcompositeoperation">globalCompositeOperation</a></code>
.</p>
<p>The <dfn id="globalalpha" title=
"dom-context-2d-globalAlpha"><code>globalAlpha</code></dfn>
attribute gives an alpha value that is applied to shapes and images
before they are composited onto the canvas. The value must be in
the range from 0.0 (fully transparent) to 1.0 (no additional
transparency). If an attempt is made to set the attribute to a
value outside this range, the attribute must retain its previous
value. When the context is created, the <code title=
"dom-context-2d-globalAlpha"><a href=
"#globalalpha">globalAlpha</a></code> attribute must initially have
the value 1.0.</p>
<p>The <dfn id="globalcompositeoperation" title=
"dom-context-2d-globalCompositeOperation"><code>globalCompositeOperation</code></dfn>
attribute sets how shapes and images are drawn onto the existing
bitmap, once they have had <code title=
"dom-context-2d-globalAlpha"><a href=
"#globalalpha">globalAlpha</a></code> and the current
transformation matrix applied. It must be set to a value from the
following list. In the descriptions below, the source image,
<var title="">A</var> , is the shape or image being rendered, and
the destination image, <var title="">B</var> , is the current state
of the bitmap.</p>
<dl>
<dt><dfn id="source-atop" title=
"gcop-source-atop"><code>source-atop</code></dfn></dt>
<dd><var title="">A</var> atop <var title="">B</var> . Display the
source image wherever both images are opaque. Display the
destination image wherever the destination image is opaque but the
source image is transparent. Display transparency elsewhere.</dd>
<dt><dfn id="source-in" title=
"gcop-source-in"><code>source-in</code></dfn></dt>
<dd><var title="">A</var> in <var title="">B</var> . Display the
source image wherever both the source image and destination image
are opaque. Display transparency elsewhere.</dd>
<dt><dfn id="source-out" title=
"gcop-source-out"><code>source-out</code></dfn></dt>
<dd><var title="">A</var> out <var title="">B</var> . Display the
source image wherever the source image is opaque and the
destination image is transparent. Display transparency
elsewhere.</dd>
<dt><dfn id="source-over" title=
"gcop-source-over"><code>source-over</code></dfn> (default)</dt>
<dd><var title="">A</var> over <var title="">B</var> . Display the
source image wherever the source image is opaque. Display the
destination image elsewhere.</dd>
<dt><dfn id="destination-atop" title=
"gcop-destination-atop"><code>destination-atop</code></dfn></dt>
<dd><var title="">B</var> atop <var title="">A</var> . Same as
<code title="gcop-source-atop"><a href=
"#source-atop">source-atop</a></code> but using the destination
image instead of the source image and vice versa.</dd>
<dt><dfn id="destination-in" title=
"gcop-destination-in"><code>destination-in</code></dfn></dt>
<dd><var title="">B</var> in <var title="">A</var> . Same as
<code title="gcop-source-in"><a href=
"#source-in">source-in</a></code> but using the destination image
instead of the source image and vice versa.</dd>
<dt><dfn id="destination-out" title=
"gcop-destination-out"><code>destination-out</code></dfn></dt>
<dd><var title="">B</var> out <var title="">A</var> . Same as
<code title="gcop-source-out"><a href=
"#source-out">source-out</a></code> but using the destination image
instead of the source image and vice versa.</dd>
<dt><dfn id="destination-over" title=
"gcop-destination-over"><code>destination-over</code></dfn></dt>
<dd><var title="">B</var> over <var title="">A</var> . Same as
<code title="gcop-source-over"><a href=
"#source-over">source-over</a></code> but using the destination
image instead of the source image and vice versa.</dd>
<dt><dfn id="lighter" title=
"gcop-lighter"><code>lighter</code></dfn></dt>
<dd><var title="">A</var> plus <var title="">B</var> . Display the
sum of the source image and destination image, with color values
approaching 1 as a limit.</dd>
<dt><dfn id="copy" title="gcop-copy"><code>copy</code></dfn></dt>
<dd><var title="">A</var> ( <var title="">B</var> is ignored).
Display the source image instead of the destination image.</dd>
<dt><dfn id="xor" title="gcop-xor"><code>xor</code></dfn></dt>
<dd><var title="">A</var> xor <var title="">B</var> . Exclusive OR
of the source image and destination image.</dd>
<dt><code><var title="">vendorName</var> - <var title=
"">operationName</var></code></dt>
<dd>Vendor-specific extensions to the list of composition operators
should use this syntax.</dd>
</dl>
<p>These values are all case-sensitive — they must be used exactly
as shown. User agents must <del class="diff-old">only
recognise</del> <ins class="diff-chg">not recognize</ins> values
that <ins class="diff-new">do not</ins> exactly match the values
given above.</p>
<p>The operators in the above list must be treated as described by
the Porter-Duff operator given at the start of their description
(e.g. <var title="">A</var> over <var title="">B</var> ). <a href=
"#references">[PORTERDUFF]</a></p>
<p>On setting, if the user agent does not <del class=
"diff-old">recognise</del> <ins class="diff-chg">recognize</ins>
the specified value, it must be ignored, leaving the value of
<code title="dom-context-2d-globalCompositeOperation"><a href=
"#globalcompositeoperation">globalCompositeOperation</a></code>
unaffected.</p>
<p>When the context is created, the <code title=
"dom-context-2d-globalCompositeOperation"><a href=
"#globalcompositeoperation">globalCompositeOperation</a></code>
attribute must initially have the value <code>source-over</code>
.</p>
<h6 id="colors"><span class="secno"><del class=
"diff-old">3.14.11.1.4.</del> <ins class=
"diff-chg">3.12.11.1.4.</ins></span> Colors and styles</h6>
<p>The <dfn id="strokestyle" title=
"dom-context-2d-strokeStyle"><code>strokeStyle</code></dfn>
attribute represents the color or style to use for the lines around
shapes, and the <dfn id="fillstyle" title=
"dom-context-2d-fillStyle"><code>fillStyle</code></dfn> attribute
represents the color or style to use inside the shapes.</p>
<p>Both attributes can be either strings, <code><a href=
"#canvasgradient0">CanvasGradient</a></code> s, or <code><a href=
"#canvaspattern0">CanvasPattern</a></code> s. On setting, strings
must be parsed as CSS <color> values and the color assigned,
and <code><a href="#canvasgradient0">CanvasGradient</a></code> and
<code><a href="#canvaspattern0">CanvasPattern</a></code> objects
must be assigned themselves. <a href="#references">[CSS3COLOR]</a>
If the value is a string but is not a valid color, or is neither a
string, a <code><a href=
"#canvasgradient0">CanvasGradient</a></code> , nor a <code><a href=
"#canvaspattern0">CanvasPattern</a></code> , then it must be
ignored, and the attribute must retain its previous value.</p>
<p>On getting, if the value is a color, then the <del class=
"diff-old">serialisation</del> <a href="#serialization" title=
"serialization of a color"><ins class=
"diff-chg">serialization</ins> of the color</a> must be returned.
Otherwise, if it is not a color but a <code><a href=
"#canvasgradient0">CanvasGradient</a></code> or <code><a href=
"#canvaspattern0">CanvasPattern</a></code> , then the respective
object must be returned. (Such objects are opaque and therefore
only useful for assigning to other attributes or for comparison to
other gradients or patterns.)</p>
<p>The <del class="diff-old">serialisation</del> <dfn id=
"serialization"><ins class="diff-chg">serialization</ins> of a
color</dfn> for a color value is a string, computed as follows: if
it has alpha equal to 1.0, then the string is a lowercase six-digit
hex value, prefixed with a "#" character (U+0023 NUMBER SIGN), with
the first two digits representing the red component, the next two
digits representing the green component, and the last two digits
representing the blue component, the digits being in the range 0-9
a-f (U+0030 to U+0039 and U+0061 to U+0066). Otherwise, the color
value has alpha less than 1.0, and the string is the color value in
the CSS <code title="">rgba()</code> functional-notation format:
the literal string <code title="">rgba</code> (U+0072 U+0067 U+0062
U+0061) followed by a U+0028 LEFT PARENTHESIS, a base-ten integer
in the range 0-255 representing the red component (using digits
0-9, U+0030 to U+0039, in the shortest form possible), a literal
U+002C COMMA and U+0020 SPACE, an integer for the green component,
a comma and a space, an integer for the blue component, another
comma and space, a U+0030 DIGIT ZERO, a U+002E FULL STOP
(representing the decimal point), one or more digits in the range
0-9 (U+0030 to U+0039) representing the fractional part of the
alpha value, and finally a U+0029 RIGHT PARENTHESIS.</p>
<p>When the context is created, the <code title=
"dom-context-2d-strokeStyle"><a href=
"#strokestyle">strokeStyle</a></code> and <code title=
"dom-context-2d-fillStyle"><a href=
"#fillstyle">fillStyle</a></code> attributes must initially have
the string value <code title="">#000000</code> .</p>
<p>There are two types of gradients, linear gradients and radial
gradients, both represented by objects implementing the opaque
<dfn id="canvasgradient0"><code>CanvasGradient</code></dfn>
interface.</p>
<p>Once a gradient has been created (see below), stops are placed
along it to define how the colors are distributed along the
gradient. The color of the gradient at each stop is the color
specified for that stop. Between each such stop, the colors and the
alpha component must be linearly interpolated over the RGBA space
without premultiplying the alpha value to find the color to use at
that offset. Before the first stop, the color must be the color of
the first stop. After the last stop, the color must be the color of
the last stop. When there are no stops, the gradient is transparent
black.</p>
<p>The <dfn id="addcolorstop" title=
"dom-canvasgradient-addColorStop"><code>addColorStop( <var title=
"">offset</var> , <var title="">color</var> )</code></dfn> method
on the <code><a href="#canvasgradient0">CanvasGradient</a></code>
interface adds a new stop to a gradient. If the <var title=
"">offset</var> is less than <del class="diff-old">0 or</del>
<ins class="diff-chg">0,</ins> greater than <del class=
"diff-old">1</del> <ins class="diff-chg">1, infinite, or NaN,</ins>
then an <code>INDEX_SIZE_ERR</code> exception must be raised. If
the <var title="">color</var> cannot be parsed as a CSS color, then
a <code>SYNTAX_ERR</code> exception must be raised. Otherwise, the
gradient must have a new stop placed, at offset <var title=
"">offset</var> relative to the whole gradient, and with the color
obtained by parsing <var title="">color</var> as a CSS
<color> value. If multiple stops are added at the same offset
on a gradient, they must be placed in the order added, with the
first one closest to the start of the gradient, and each subsequent
one infinitesimally further along towards the end point (in effect
causing all but the first and last stop added at each point to be
ignored).</p>
<p>The <dfn id="createlineargradient" title=
"dom-context-2d-createLinearGradient"><code>createLinearGradient(
<var title="">x0</var> , <var title="">y0</var> , <var title=
"">x1</var> , <var title="">y1</var> )</code></dfn> method takes
four <del class="diff-old">arguments, representing</del>
<ins class="diff-chg">arguments that, after being subjected to
the</ins> <a href="#transformations0" title=
"dom-context-2d-transformation"><ins class="diff-chg">current
transformation matrix</ins></a> ,<ins class=
"diff-chg">represent</ins> the start point ( <var title="">x0</var>
, <var title="">y0</var> ) and end point ( <var title="">x1</var> ,
<var title="">y1</var> ) of the <del class="diff-old">gradient, in
coordinate space units, and</del> <ins class="diff-chg">gradient.
If any of the arguments to</ins> <code title=
"dom-context-2d-createLinearGradient"><a href=
"#createlineargradient"><ins class=
"diff-chg">createLinearGradient()</ins></a></code> <ins class=
"diff-chg">are infinite or NaN, the method must raise an</ins>
<code><ins class="diff-chg">INDEX_SIZE_ERR</ins></code> <ins class=
"diff-chg">exception. Otherwise, the method</ins> must return a
linear <code><a href="#canvasgradient0">CanvasGradient</a></code>
<del class="diff-old">initialised</del> <ins class=
"diff-chg">initialized</ins> with <del class="diff-old">that</del>
<ins class="diff-chg">the specified</ins> line.</p>
<p>Linear gradients must be rendered such that at and before the
starting point on the canvas the color at offset 0 is used, that at
and after the ending point the color at offset 1 is used, and that
all points on a line perpendicular to the line that crosses the
start and end points have the color at the point where those two
lines cross (with the colors coming from the interpolation
described above).</p>
<p>If <span><var title="">x <sub>0</sub></var> =
<var title="">x <sub>1</sub></var></span> and <span><var title="">y
<sub>0</sub></var> = <var title="">y
<sub>1</sub></var></span> , then the linear gradient must paint
nothing.</p>
<p>The <dfn id="createradialgradient" title=
"dom-context-2d-createRadialGradient"><code>createRadialGradient(
<var title="">x0</var> , <var title="">y0</var> , <var title=
"">r0</var> , <var title="">x1</var> , <var title="">y1</var> ,
<var title="">r1</var> )</code></dfn> method takes six arguments,
the first three representing the start circle with origin (
<var title="">x0</var> , <var title="">y0</var> ) and radius
<var title="">r0</var> , and the last three representing the end
circle with origin ( <var title="">x1</var> , <var title=
"">y1</var> ) and radius <var title="">r1</var> . The values are in
coordinate space units. <del class="diff-old">The method must
return a radial CanvasGradient initialised with those two
circles.</del> If either of <var title="">r0</var> or <var title=
"">r1</var> are negative, <ins class="diff-new">or if any of the
arguments are infinite or NaN,</ins> an <code>INDEX_SIZE_ERR</code>
exception must be raised. <ins class="diff-new">Otherwise, the
method must return a radial</ins> <code><a href=
"#canvasgradient0"><ins class=
"diff-new">CanvasGradient</ins></a></code> <ins class=
"diff-new">initialized with the two specified circles, after
transforming them according to the</ins> <a href=
"#transformations0" title=
"dom-context-2d-transformation"><ins class="diff-new">current
transformation matrix</ins></a> .</p>
<p>Radial gradients must be rendered by following these steps:</p>
<ol>
<li>
<p><ins class="diff-new">If</ins> <span><var title=""><ins class=
"diff-new">x</ins> <sub><ins class="diff-new">0</ins></sub></var>
<ins class="diff-new"> = </ins> <var title=""><ins class=
"diff-new">x</ins> <sub><ins class=
"diff-new">1</ins></sub></var></span> <ins class=
"diff-new">and</ins> <span><var title=""><ins class=
"diff-new">y</ins> <sub><ins class="diff-new">0</ins></sub></var>
<ins class="diff-new"> = </ins> <var title=""><ins class=
"diff-new">y</ins> <sub><ins class=
"diff-new">1</ins></sub></var></span> <ins class=
"diff-new">and</ins> <span><var title=""><ins class=
"diff-new">r</ins> <sub><ins class="diff-new">0</ins></sub></var>
<ins class="diff-new"> = </ins> <var title=""><ins class=
"diff-new">r</ins> <sub><ins class=
"diff-new">1</ins></sub></var></span> ,<ins class="diff-new">then
the radial gradient must paint nothing. Abort these
steps.</ins></p>
</li>
<li>
<p>Let <span>x( <var title="">ω</var> ) = ( <var title=
"">x <sub>1</sub></var> - <var title="">x <sub>0</sub></var> )
<var title="">ω</var> + <var title="">x
<sub>0</sub></var></span></p>
<p>Let <span>y( <var title="">ω</var> ) = ( <var title=
"">y <sub>1</sub></var> - <var title="">y <sub>0</sub></var> )
<var title="">ω</var> + <var title="">y
<sub>0</sub></var></span></p>
<p>Let <span>r( <var title="">ω</var> ) = ( <var title=
"">r <sub>1</sub></var> - <var title="">r <sub>0</sub></var> )
<var title="">ω</var> + <var title="">r
<sub>0</sub></var></span></p>
<p>Let the color at <var title="">ω</var> be the color of the
gradient at offset 0.0 for all values of <var title="">ω</var> less
than 0.0, the color at offset 1.0 for all values of <var title=
"">ω</var> greater than 1.0, and the color at the given offset for
values of <var title="">ω</var> in the range <span>0.0 ≤
<var title="">ω</var> ≤ 1.0</span></p>
</li>
<li>
<p>For all values of <var title="">ω</var> where <span>r(
<var title="">ω</var> ) > 0</span> , starting with the
value of <var title="">ω</var> nearest to positive infinity and
ending with the value of <var title="">ω</var> nearest to negative
infinity, draw the circumference of the circle with radius <span>r(
<var title="">ω</var> )</span> at position ( <span>x( <var title=
"">ω</var> )</span> , <span>y( <var title="">ω</var> )</span> ),
with the color at <var title="">ω</var> , but only painting on the
parts of the canvas that have not yet been painted on by earlier
circles in this step for this rendering of the gradient.</p>
</li>
</ol>
<del class="diff-old">If x 0 = x 1 and y 0
= y 1 and r 0 = r 1 , then the radial
gradient must paint nothing.</del>
<p class="note">This effectively creates a cone, touched by the two
circles defined in the creation of the gradient, with the part of
the cone before the start circle (0.0) using the color of the first
offset, the part of the cone after the end circle (1.0) using the
color of the last offset, and areas outside the cone untouched by
the gradient (transparent black).</p>
<p>Gradients must <del class="diff-old">only</del> be painted
<ins class="diff-new">only</ins> where the relevant stroking or
filling effects requires that they be drawn. <del class=
"diff-old">Support for actually painting gradients is optional.
Instead of painting the gradients, user agents may instead just
paint the first stop's color. However, createLinearGradient() and
createRadialGradient() must always return objects when passed valid
arguments.</del></p>
<p>Patterns are represented by objects implementing the opaque
<dfn id="canvaspattern0"><code>CanvasPattern</code></dfn>
interface.</p>
<p>To create objects of this type, the <dfn id="createpattern"
title="dom-context-2d-createPattern"><code><del class=
"diff-old">createPattern(image, repetition)</del> <ins class=
"diff-chg">createPattern(</ins> <var title=""><ins class=
"diff-chg">image</ins></var> ,<var title=""><ins class=
"diff-chg">repetition</ins></var> <ins class=
"diff-chg">)</ins></code></dfn> method is used. The first argument
gives the image to use as the pattern (either an <code><a href=
"#htmlimageelement">HTMLImageElement</a></code> or an
<code><a href="#htmlcanvaselement">HTMLCanvasElement</a></code> ).
Modifying this image after calling the <code title=
"dom-context-2d-createPattern"><a href=
"#createpattern">createPattern()</a></code> method must not affect
the pattern. The second argument must be a string with one of the
following values: <code title="">repeat</code> , <code title=
"">repeat-x</code> , <code title="">repeat-y</code> , <code title=
"">no-repeat</code> . If the empty string or null is specified,
<code title="">repeat</code> must be assumed. If an <del class=
"diff-old">unrecognised</del> <ins class=
"diff-chg">unrecognized</ins> value is given, then the user agent
must raise a <code>SYNTAX_ERR</code> exception. User agents must
<del class="diff-old">recognise</del> <ins class=
"diff-chg">recognize</ins> the four values described above exactly
(e.g. they must not do case folding). The method must return a
<code><a href="#canvaspattern0">CanvasPattern</a></code> object
suitably <del class="diff-old">initialised.</del> <ins class=
"diff-chg">initialized.</ins></p>
<p>The <var title="">image</var> argument must be an instance of an
<code><a href="#htmlimageelement">HTMLImageElement</a></code> or
<code><a href="#htmlcanvaselement">HTMLCanvasElement</a></code> .
If the <var title="">image</var> is of the wrong <del class=
"diff-old">type,</del> <ins class="diff-chg">type or null,</ins>
the implementation must raise a <code>TYPE_MISMATCH_ERR</code>
exception.</p>
<p>If the <var title="">image</var> argument is an <code><a href=
"#htmlimageelement">HTMLImageElement</a></code> object whose
<code title="dom-img-complete"><a href=
"#complete">complete</a></code> attribute is false, then the
implementation must raise an <code>INVALID_STATE_ERR</code>
exception.</p>
<p><ins class="diff-new">If the</ins> <var title=""><ins class=
"diff-new">image</ins></var> <ins class="diff-new">argument is
an</ins> <code><a href="#htmlcanvaselement"><ins class=
"diff-new">HTMLCanvasElement</ins></a></code> <ins class=
"diff-new">object with either a horizontal dimension or a vertical
dimension equal to zero, then the implementation must raise
an</ins> <code><ins class="diff-new">INVALID_STATE_ERR</ins></code>
<ins class="diff-new">exception.</ins></p>
<p>Patterns must be painted so that the top left of the first image
is anchored at the origin of the coordinate space, and images are
then repeated horizontally to the left and right (if the
<code>repeat-x</code> string was specified) or vertically up and
down (if the <code>repeat-y</code> string was specified) or in all
four directions all over the canvas (if the <code>repeat</code>
string was specified). The images are not <del class=
"diff-old">be</del> scaled by this process; one CSS pixel of the
image must be painted on one coordinate space unit. Of course,
patterns must <del class="diff-old">only</del> actually <ins class=
"diff-new">be</ins> painted <ins class="diff-new">only</ins> where
the stroking or filling effect requires that they be drawn, and are
affected by the current transformation matrix.</p>
<p><ins class="diff-new">When the</ins> <code title=
"dom-context-2d-createPattern"><a href="#createpattern"><ins class=
"diff-new">createPattern()</ins></a></code> <ins class=
"diff-new">method is passed, as its</ins> <var title=""><ins class=
"diff-new">image</ins></var> <ins class="diff-new">argument, an
animated image, the poster frame of the animation, or the first
frame of the animation if there is no poster frame, must be
used.</ins></p>
<p>Support for patterns is optional. If the user agent doesn't
support patterns, then <code title=
"dom-context-2d-createPattern"><a href=
"#createpattern">createPattern()</a></code> must return null.</p>
<h6 id="line-styles"><span class="secno"><del class=
"diff-old">3.14.11.1.5.</del> <ins class=
"diff-chg">3.12.11.1.5.</ins></span> Line styles</h6>
<p>The <dfn id="linewidth" title=
"dom-context-2d-lineWidth"><code>lineWidth</code></dfn> attribute
gives the <del class="diff-old">default</del> width of lines, in
coordinate space units. On setting, <del class=
"diff-old">zero</del> <ins class="diff-chg">zero, negative,
infinite,</ins> and <del class="diff-old">negative</del>
<ins class="diff-chg">NaN</ins> values must be ignored, leaving the
value unchanged.</p>
<p>When the context is created, the <code title=
"dom-context-2d-lineWidth"><a href=
"#linewidth">lineWidth</a></code> attribute must initially have the
value <code>1.0</code> .</p>
<p>The <dfn id="linecap" title=
"dom-context-2d-lineCap"><code>lineCap</code></dfn> attribute
defines the type of endings that UAs <del class=
"diff-old">shall</del> <ins class="diff-chg">will</ins> place on
the end of lines. The three valid values are <code>butt</code> ,
<code>round</code> , and <code>square</code> . The
<code>butt</code> value means that the end of each line is a flat
edge perpendicular to the direction of the line. The
<code>round</code> value means that a semi-circle with the diameter
equal to the width of the line <del class="diff-old">is</del>
<ins class="diff-chg">must</ins> then <ins class=
"diff-new">be</ins> added on to the end of the line. The
<code>square</code> value means that <del class="diff-old">at the
end of each line is</del> a rectangle with the length of the line
width and the width of half the line width, placed flat against the
edge perpendicular to the direction of the <ins class=
"diff-new">line, must be added at the end of each</ins> line. On
setting, any other value than the literal strings <code>butt</code>
, <code>round</code> , and <code>square</code> must be ignored,
leaving the value unchanged.</p>
<p>When the context is created, the <code title=
"dom-context-2d-lineCap"><a href="#linecap">lineCap</a></code>
attribute must initially have the value <code>butt</code> .</p>
<p>The <dfn id="linejoin" title=
"dom-context-2d-lineJoin"><code>lineJoin</code></dfn> attribute
defines the type of corners that <del class="diff-old">that</del>
UAs will place where two lines meet. The three valid values are
<code><del class="diff-old">round</del> <ins class=
"diff-chg">bevel</ins></code> , <code><del class=
"diff-old">bevel</del> <ins class="diff-chg">round</ins></code> ,
and <code>miter</code> .</p>
<p>On setting, any other value than the literal strings
<code><del class="diff-old">round</del> <ins class=
"diff-chg">bevel</ins></code> , <code><del class=
"diff-old">bevel</del> <ins class="diff-chg">round</ins></code> ,
and <code>miter</code> must be ignored, leaving the value
unchanged.</p>
<p>When the context is created, the <code title=
"dom-context-2d-lineJoin"><a href="#linejoin">lineJoin</a></code>
attribute must initially have the value <code>miter</code> .</p>
<p><del class="diff-old">The round value means that</del>
<ins class="diff-chg">A join exists at any point in</ins> a
<del class="diff-old">filled arc</del> <ins class=
"diff-chg">subpath shared by two consecutive lines. When a subpath
is closed, then a join also exists at its first point (equivalent
to its last point)</ins> connecting the <del class=
"diff-old">corners on</del> <ins class="diff-chg">first and last
lines in</ins> the <del class="diff-old">outside of</del>
<ins class="diff-chg">subpath.</ins></p>
<p><ins class="diff-chg">In addition to</ins> the <del class=
"diff-old">join, with</del> <ins class="diff-chg">point where</ins>
the <del class="diff-old">diameter equal</del> <ins class=
"diff-chg">join occurs, two additional points are relevant</ins> to
<ins class="diff-new">each join, one for each line: the two corners
found half</ins> the line <del class="diff-old">width, and</del>
<ins class="diff-chg">width away from</ins> the <del class=
"diff-old">origin at</del> <ins class="diff-chg">join point, one
perpendicular to each line, each on</ins> the <del class=
"diff-old">point where</del> <ins class="diff-chg">side furthest
from</ins> the <del class="diff-old">inside edges</del> <ins class=
"diff-chg">other line.</ins></p>
<p><ins class="diff-chg">A filled triangle connecting these two
opposite corners with a straight line, with the third point</ins>
of the <del class="diff-old">lines touch,</del> <ins class=
"diff-chg">triangle being the join point,</ins> must be rendered at
<ins class="diff-new">all</ins> joins. The <code title=
"dom-context-2d-lineJoin"><a href="#linejoin"><ins class=
"diff-new">lineJoin</ins></a></code> <ins class=
"diff-new">attribute controls whether anything else is rendered.
The three aforementioned values have the following
meanings:</ins></p>
<p><ins class="diff-new">The</ins> <code>bevel</code> value means
that <ins class="diff-new">this is all that is rendered at
joins.</ins></p>
<p><ins class="diff-new">The</ins> <code><ins class=
"diff-new">round</ins></code> <ins class="diff-new">value means
that</ins> a filled <del class="diff-old">triangle</del>
<ins class="diff-chg">arc</ins> connecting <del class=
"diff-old">those</del> <ins class="diff-chg">the</ins> two
<ins class="diff-new">aforementioned</ins> corners <del class=
"diff-old">with a straight line, the third point</del> of the
<del class="diff-old">triangle being</del> <ins class=
"diff-chg">join, abutting (and not overlapping)</ins> the
<del class="diff-old">point where</del> <ins class=
"diff-chg">aforementioned triangle, with</ins> the <del class=
"diff-old">lines touch on</del> <ins class="diff-chg">diameter
equal to</ins> the <del class="diff-old">inside</del> <ins class=
"diff-chg">line width and the origin at the point</ins> of the
join, must be rendered at joins.</p>
<p>The <code>miter</code> value means that a <ins class=
"diff-new">second</ins> filled <del class="diff-old">four- or
five-sided polygon</del> <ins class="diff-chg">triangle</ins> must
<ins class="diff-new">(if it can given the miter length)</ins> be
<del class="diff-old">placed</del> <ins class=
"diff-chg">rendered</ins> at the join, with <del class=
"diff-old">two of the lines</del> <ins class="diff-chg">one
line</ins> being the <del class="diff-old">perpendicular edges
of</del> <ins class="diff-chg">line between</ins> the <del class=
"diff-old">joining lines,</del> <ins class="diff-chg">two
aforementioned corners, abutting the first triangle,</ins> and the
other two being continuations of the outside edges of the two
joining lines, as long as required to intersect without going over
the miter <del class="diff-old">limit.</del> <ins class=
"diff-chg">length.</ins></p>
<p>The miter length is the distance from the point where the lines
touch on the inside of the join to the intersection of the line
edges on the outside of the join. The miter limit ratio is the
maximum allowed ratio of the <del class="diff-old">miter</del>
length <ins class="diff-new">of the two continuation lines</ins> to
the line width. If the miter <del class="diff-old">limit</del>
<ins class="diff-chg">length</ins> would be exceeded, <del class=
"diff-old">then a fifth line</del> <ins class="diff-chg">this
second triangle</ins> must <ins class="diff-new">not</ins> be
<del class="diff-old">added to the polygon, connecting the two
outside lines, such that the distance from the inside point of the
join to the point in the middle of this fifth line is the maximum
allowed value for the miter length.</del> <ins class=
"diff-chg">rendered.</ins></p>
<p>The miter limit ratio can be explicitly set using the <dfn id=
"miterlimit" title=
"dom-context-2d-miterLimit"><code>miterLimit</code></dfn>
attribute. On setting, <del class="diff-old">zero</del> <ins class=
"diff-chg">zero, negative, infinite,</ins> and <del class=
"diff-old">negative</del> <ins class="diff-chg">NaN</ins> values
must be ignored, leaving the value unchanged.</p>
<p>When the context is created, the <code title=
"dom-context-2d-miterLimit"><a href=
"#miterlimit">miterLimit</a></code> attribute must initially have
the value <code>10.0</code> .</p>
<h6 id="shadows"><span class="secno"><del class=
"diff-old">3.14.11.1.6.</del> <ins class=
"diff-chg">3.12.11.1.6.</ins></span> <dfn id=
"shadows0">Shadows</dfn></h6>
<p>All drawing operations are affected by the four global shadow
attributes.</p>
<p>The <dfn id="shadowcolor" title=
"dom-context-2d-shadowColor"><code>shadowColor</code></dfn>
attribute sets the color of the shadow.</p>
<p>When the context is created, the <code title=
"dom-context-2d-shadowColor"><a href=
"#shadowcolor">shadowColor</a></code> attribute initially must be
fully-transparent black.</p>
<p>On getting, the <del class="diff-old">serialisation</del>
<a href="#serialization" title=
"serialization of a color"><ins class=
"diff-chg">serialization</ins> of the color</a> must be
returned.</p>
<p>On setting, the new value must be parsed as a CSS <color>
value and the color assigned. If the value is not a valid color,
then it must be ignored, and the attribute must retain its previous
value. <a href="#references">[CSS3COLOR]</a></p>
<p>The <dfn id="shadowoffsetx" title=
"dom-context-2d-shadowOffsetX"><code>shadowOffsetX</code></dfn> and
<dfn id="shadowoffsety" title=
"dom-context-2d-shadowOffsetY"><code>shadowOffsetY</code></dfn>
attributes specify the distance that the shadow will be offset in
the positive horizontal and positive vertical distance
respectively. Their values are in coordinate space units. They are
not affected by the current transformation matrix.</p>
<p>When the context is created, the shadow offset attributes
initially have the value <code>0</code> .</p>
<p>On getting, they must return their current value. On setting,
the attribute being set must be set to the new <del class=
"diff-old">value.</del> <ins class="diff-chg">value, except if the
value is infinite or NaN, in which case the new value must be
ignored.</ins></p>
<p>The <dfn id="shadowblur" title=
"dom-context-2d-shadowBlur"><code>shadowBlur</code></dfn> attribute
specifies the size of the blurring effect. (The units do not map to
coordinate space units, and are not affected by the current
transformation matrix.)</p>
<p>When the context is created, the <code title=
"dom-context-2d-shadowBlur"><a href=
"#shadowblur">shadowBlur</a></code> attribute must initially have
the value <code>0</code> .</p>
<p>On getting, the attribute must return its current value. On
<del class="diff-old">setting, if the value is greater than or
equal to zero, then</del> <ins class="diff-chg">setting</ins> the
attribute must be set to the new <del class="diff-old">value;
otherwise,</del> <ins class="diff-chg">value, except if</ins> the
<del class="diff-old">new</del> value is <ins class=
"diff-new">negative, infinite or NaN, in which case the new value
must be</ins> ignored.</p>
<p>Support for shadows is optional. When they are supported, then,
when shadows are drawn, they must be rendered as follows:</p>
<ol>
<li>
<p>Let <var title="">A</var> be the source image for which a shadow
is being created.</p>
</li>
<li>
<p>Let <var title="">B</var> be an infinite transparent black
bitmap, with a coordinate space and an origin identical to
<var title="">A</var> .</p>
</li>
<li>
<p>Copy the alpha channel of <var title="">A</var> to <var title=
"">B</var> , offset by <code title=
"dom-context-2d-shadowOffsetX"><a href=
"#shadowoffsetx">shadowOffsetX</a></code> in the positive
<var title="">x</var> direction, and <code title=
"dom-context-2d-shadowOffsetY"><a href=
"#shadowoffsety">shadowOffsetY</a></code> in the positive
<var title="">y</var> direction.</p>
</li>
<li>
<p>If <code title="dom-context-2d-shadowBlur"><a href=
"#shadowblur">shadowBlur</a></code> is greater than 0:</p>
<ol>
<li>
<p>If <code title="dom-context-2d-shadowBlur"><a href=
"#shadowblur">shadowBlur</a></code> is less than 8, let <var title=
"">σ</var> be half the value of <code title=
"dom-context-2d-shadowBlur"><a href=
"#shadowblur">shadowBlur</a></code> ; otherwise, let <var title=
"">σ</var> be the square root of multiplying the value of
<code title="dom-context-2d-shadowBlur"><a href=
"#shadowblur">shadowBlur</a></code> by 2.</p>
</li>
<li>
<p>Perform a 2D Gaussian Blur on <var title="">B</var> , using
<var title="">σ</var> as the standard deviation.</p>
</li>
</ol>
<p>User agents may limit values of <var title="">σ</var> to an
implementation-specific maximum value to avoid exceeding hardware
limitations during the Gaussian blur operation.</p>
</li>
<li>
<p>Set the red, green, and blue components of every pixel in
<var title="">B</var> to the red, green, and blue components
(respectively) of the color of <code title=
"dom-context-2d-shadowColor"><a href=
"#shadowcolor">shadowColor</a></code> .</p>
</li>
<li>
<p>Multiply the alpha component of every pixel in <var title=
"">B</var> by the alpha component of the color of <code title=
"dom-context-2d-shadowColor"><a href=
"#shadowcolor">shadowColor</a></code> .</p>
</li>
<li>
<p>The shadow is in the bitmap <var title="">B</var> , and is
rendered as part of the drawing model described below.</p>
</li>
</ol>
<h6 id="simple"><span class="secno"><del class=
"diff-old">3.14.11.1.7.</del> <ins class=
"diff-chg">3.12.11.1.7.</ins></span> Simple shapes
(rectangles)</h6>
<p>There are three methods that immediately draw rectangles to the
bitmap. They each take four arguments; the first two give the
<var title="">x</var> and <var title="">y</var> coordinates of the
top left of the rectangle, and the second two give the width
<var title="">w</var> and height <var title="">h</var> of the
rectangle, respectively.</p>
<p>The <a href="#transformations0" title=
"dom-context-2d-transformation">current transformation matrix</a>
must be applied to the following four coordinates, which form the
path that must then be closed to get the specified rectangle:
<span>( <var title="">x</var> , <var title="">y</var> )</span> ,
<span>( <span><var title="">x</var> + <var title="">w</var></span>
, <var title="">y</var> )</span> , <span>( <span><var title=
"">x</var> + <var title="">w</var></span> , <span><var title=
"">y</var> + <var title="">h</var></span> )</span> , <span>(
<var title="">x</var> , <span><var title="">y</var> + <var title=
"">h</var></span> )</span> .</p>
<p>Shapes are painted without affecting the current path, and are
subject to <ins class="diff-chg">the</ins> <a href="#clipping"
title="clipping region">clipping <del class="diff-old">paths</del>
<ins class="diff-chg">region</ins></a> , and, with the exception of
<code title="dom-context-2d-clearRect"><a href=
"#clearrect">clearRect()</a></code> , also <a href="#shadows0"
title="shadows">shadow effects</a> , <a href="#globalalpha" title=
"dom-context-2d-globalAlpha">global alpha</a> , and <a href=
"#globalcompositeoperation" title=
"dom-context-2d-globalCompositeOperation">global composition
operators</a> .</p>
<p><del class="diff-old">Negative values for width and height must
cause the implementation to raise an INDEX_SIZE_ERR
exception.</del> The <dfn id="clearrect" title=
"dom-context-2d-clearRect"><code><del class=
"diff-old">clearRect()</del> <ins class="diff-chg">clearRect(</ins>
<var title=""><ins class="diff-chg">x</ins></var> ,<var title=
""><ins class="diff-chg">y</ins></var> ,<var title=""><ins class=
"diff-chg">w</ins></var> ,<var title=""><ins class=
"diff-chg">h</ins></var> <ins class="diff-chg">)</ins></code></dfn>
method must clear the pixels in the specified rectangle that also
intersect the current clipping <del class="diff-old">path</del>
<ins class="diff-chg">region</ins> to a fully transparent black,
erasing any previous image. If either height or width are zero,
this method has no effect.</p>
<p>The <dfn id="fillrect" title=
"dom-context-2d-fillRect"><code><del class=
"diff-old">fillRect()</del> <ins class="diff-chg">fillRect(</ins>
<var title=""><ins class="diff-chg">x</ins></var> ,<var title=
""><ins class="diff-chg">y</ins></var> ,<var title=""><ins class=
"diff-chg">w</ins></var> ,<var title=""><ins class=
"diff-chg">h</ins></var> <ins class="diff-chg">)</ins></code></dfn>
method must paint the specified rectangular area using the
<code title="dom-context-2d-fillStyle"><a href=
"#fillstyle">fillStyle</a></code> . If either height or width are
zero, this method has no effect.</p>
<p>The <dfn id="strokerect" title=
"dom-context-2d-strokeRect"><code><del class=
"diff-old">strokeRect()</del> <ins class=
"diff-chg">strokeRect(</ins> <var title=""><ins class=
"diff-chg">x</ins></var> ,<var title=""><ins class=
"diff-chg">y</ins></var> ,<var title=""><ins class=
"diff-chg">w</ins></var> ,<var title=""><ins class=
"diff-chg">h</ins></var> <ins class="diff-chg">)</ins></code></dfn>
method must stroke the specified rectangle's path using the
<code title="dom-context-2d-strokeStyle"><a href=
"#strokestyle">strokeStyle</a></code> , <code title=
"dom-context-2d-lineWidth"><a href=
"#linewidth">lineWidth</a></code> , <code title=
"dom-context-2d-lineJoin"><a href="#linejoin">lineJoin</a></code> ,
and (if appropriate) <code title=
"dom-context-2d-miterLimit"><a href=
"#miterlimit">miterLimit</a></code> attributes. If both height and
width are zero, this method has no effect, since there is no path
to stroke (it's a point). If only one of the two is zero, then the
method will draw a line instead (the path for the outline is just a
straight line along the non-zero dimension).</p>
<h6 id="complex"><span class="secno"><del class=
"diff-old">3.14.11.1.8.</del> <ins class=
"diff-chg">3.12.11.1.8.</ins></span> Complex shapes (paths)</h6>
<p>The context always has a current path. There is only one current
path, it is not part of the <span title="dom-context-2d-">drawing
state</span> .</p>
<p>A <dfn id="path">path</dfn> has a list of zero or more subpaths.
Each subpath consists of a list of one or more points, connected by
straight or curved lines, and a flag indicating whether the subpath
is closed or not. A closed subpath is one where the last point of
the subpath is connected to the first point of the subpath by a
straight line. Subpaths with fewer than two points are ignored when
painting the path.</p>
<p>Initially, the context's path must have zero subpaths.</p>
<p>The <del class="diff-old">coordinates given in the
arguments</del> <ins class="diff-chg">points and lines added</ins>
to <ins class="diff-new">the path by</ins> these methods must be
transformed according to the <a href="#transformations0" title=
"dom-context-2d-transformation">current transformation matrix</a>
<del class="diff-old">before applying the calculations described
below and before adding any points to the path.</del> <ins class=
"diff-chg">as they are added.</ins></p>
<p>The <dfn id="beginpath" title=
"dom-context-2d-beginPath"><code>beginPath()</code></dfn> method
must empty the list of subpaths so that the context once again has
zero subpaths.</p>
<p>The <dfn id="moveto" title="dom-context-2d-moveTo"><code>moveTo(
<var title="">x</var> , <var title="">y</var> )</code></dfn> method
must create a new subpath with the specified point as its first
(and only) point.</p>
<p>The <dfn id="closepath" title=
"dom-context-2d-closePath"><code>closePath()</code></dfn> method
must do nothing if the context has no subpaths. Otherwise, it must
mark the last subpath as closed, create a new subpath whose first
point is the same as the previous subpath's first point, and
finally add this new subpath to the path. (If the last subpath had
more than one point in its list of points, then this is equivalent
to adding a straight line connecting the last point back to the
first point, thus "closing" the shape, and then repeating the last
<code title="dom-context-2d-moveTo"><a href=
"#moveto">moveTo()</a></code> call.)</p>
<p>New points and the lines connecting them are added to subpaths
using the methods described below. In all cases, the methods only
modify the last subpath in the context's paths.</p>
<p>The <dfn id="lineto" title="dom-context-2d-lineTo"><code>lineTo(
<var title="">x</var> , <var title="">y</var> )</code></dfn> method
must do nothing if the context has no subpaths. Otherwise, it must
connect the last point in the subpath to the given point (
<var title="">x</var> , <var title="">y</var> ) using a straight
line, and must then add the given point ( <var title="">x</var> ,
<var title="">y</var> ) to the subpath.</p>
<p>The <dfn id="quadraticcurveto" title=
"dom-context-2d-quadraticCurveTo"><code>quadraticCurveTo(
<var title="">cpx</var> , <var title="">cpy</var> , <var title=
"">x</var> , <var title="">y</var> )</code></dfn> method must do
nothing if the context has no subpaths. Otherwise it must connect
the last point in the subpath to the given point ( <var title=
"">x</var> , <var title="">y</var> ) using a quadratic Bézier curve
with control point ( <var title="">cpx</var> , <var title=
"">cpy</var> ), and must then add the given point ( <var title=
"">x</var> , <var title="">y</var> ) to the subpath. <a href=
"#references">[BEZIER]</a></p>
<p>The <dfn id="beziercurveto" title=
"dom-context-2d-bezierCurveTo"><code>bezierCurveTo( <var title=
"">cp1x</var> , <var title="">cp1y</var> , <var title="">cp2x</var>
, <var title="">cp2y</var> , <var title="">x</var> , <var title=
"">y</var> )</code></dfn> method must do nothing if the context has
no subpaths. Otherwise, it must connect the last point in the
subpath to the given point ( <var title="">x</var> , <var title=
"">y</var> ) using a cubic Bézier curve with control points (
<var title="">cp1x</var> , <var title="">cp1y</var> ) and (
<var title="">cp2x</var> , <var title="">cp2y</var> ). Then, it
must add the point ( <var title="">x</var> , <var title="">y</var>
) to the subpath. <a href="#references">[BEZIER]</a></p>
<p>The <dfn id="arcto" title="dom-context-2d-arcTo"><code>arcTo(
<var title="">x1</var> , <var title="">y1</var> , <var title=
"">x2</var> , <var title="">y2</var> , <var title="">radius</var>
)</code></dfn> method must do nothing if the context has no
subpaths. If the context <em>does</em> have a subpath, then the
<del class="diff-old">behaviour</del> <ins class=
"diff-chg">behavior</ins> depends on the arguments and the last
point in the subpath.</p>
<p><ins class="diff-new">Negative values for</ins> <var title=
""><ins class="diff-new">radius</ins></var> <ins class=
"diff-new">must cause the implementation to raise an</ins>
<code><ins class="diff-new">INDEX_SIZE_ERR</ins></code> <ins class=
"diff-new">exception.</ins></p>
<p>Let the point ( <var title="">x0</var> , <var title="">y0</var>
) be the last point in the subpath. <del class=
"diff-old">Let</del></p>
<p><ins class="diff-chg">If the point (</ins> <var title=
""><del class="diff-old">The Arc</del> <ins class=
"diff-chg">x0</ins></var> ,<var title=""><ins class=
"diff-chg">y0</ins></var> <del class="diff-old">be</del>
<ins class="diff-chg">) is equal to</ins> the <del class=
"diff-old">shortest arc given by circumference of</del> <ins class=
"diff-chg">point (</ins> <var title=""><ins class=
"diff-chg">x1</ins></var> ,<var title=""><ins class=
"diff-chg">y1</ins></var> <ins class="diff-chg">), or if</ins> the
<del class="diff-old">circle</del> <ins class="diff-chg">point
(</ins> <var title=""><ins class="diff-chg">x1</ins></var>
,<var title=""><ins class="diff-chg">y1</ins></var> <ins class=
"diff-chg">) is equal to the point (</ins> <var title=
""><ins class="diff-chg">x2</ins></var> ,<var title=""><ins class=
"diff-chg">y2</ins></var> <ins class="diff-chg">), then the method
must add the point (</ins> <var title=""><ins class=
"diff-chg">x1</ins></var> ,<var title=""><ins class=
"diff-chg">y1</ins></var> <ins class="diff-chg">) to the subpath,
and connect</ins> that <del class="diff-old">has one</del> point
<del class="diff-old">tangent</del> to the <del class=
"diff-old">line defined</del> <ins class="diff-chg">previous point
(</ins> <var title=""><ins class="diff-chg">x0</ins></var>
,<var title=""><ins class="diff-chg">y0</ins></var> <ins class=
"diff-chg">)</ins> by <ins class="diff-new">a straight
line.</ins></p>
<p><ins class="diff-new">Otherwise, if</ins> the points (
<var title="">x0</var> , <var title="">y0</var> <del class=
"diff-old">)</del> <ins class="diff-chg">), (</ins> <var title=
""><ins class="diff-chg">x1</ins></var> ,<var title=""><ins class=
"diff-chg">y1</ins></var> <ins class="diff-chg">),</ins> and (
<var title=""><ins class="diff-new">x2</ins></var> ,<var title=
""><ins class="diff-new">y2</ins></var> <ins class="diff-new">) all
lie on a single straight line, then: if the direction from (</ins>
<var title=""><ins class="diff-new">x0</ins></var> ,<var title=
""><ins class="diff-new">y0</ins></var> <ins class="diff-new">) to
(</ins> <var title="">x1</var> , <var title="">y1</var> <ins class=
"diff-new">) is the same as the direction from (</ins> <var title=
""><ins class="diff-new">x1</ins></var> ,<var title=""><ins class=
"diff-new">y1</ins></var> <ins class="diff-new">) to (</ins>
<var title=""><ins class="diff-new">x2</ins></var> ,<var title=
""><ins class="diff-new">y2</ins></var> ), <del class=
"diff-old">another</del> <ins class="diff-chg">then method must add
the</ins> point <del class="diff-old">tangent</del> <ins class=
"diff-chg">(</ins> <var title=""><ins class=
"diff-chg">x1</ins></var> ,<var title=""><ins class=
"diff-chg">y1</ins></var> <ins class="diff-chg">)</ins> to the
<del class="diff-old">line defined</del> <ins class=
"diff-chg">subpath, and connect that point to the previous point
(</ins> <var title=""><ins class="diff-chg">x0</ins></var>
,<var title=""><ins class="diff-chg">y0</ins></var> <ins class=
"diff-chg">)</ins> by <ins class="diff-new">a straight line;
otherwise,</ins> the <del class="diff-old">points</del> <ins class=
"diff-chg">direction from (</ins> <var title=""><ins class=
"diff-chg">x0</ins></var> ,<var title=""><ins class=
"diff-chg">y0</ins></var> <ins class="diff-chg">) to</ins> (
<var title="">x1</var> , <var title="">y1</var> ) <del class=
"diff-old">and</del> <ins class="diff-chg">is the opposite of the
direction from (</ins> <var title=""><ins class=
"diff-chg">x1</ins></var> ,<var title=""><ins class=
"diff-chg">y1</ins></var> <ins class="diff-chg">) to</ins> (
<var title="">x2</var> , <var title="">y2</var> ), and <del class=
"diff-old">that has radius</del> <ins class="diff-chg">the method
must add a point (</ins> <var title=""><del class="diff-old">radius
. The points at which this circle touches these two lines are
called</del> <ins class="diff-chg">x</ins> <sub><ins class=
"diff-chg">∞</ins></sub></var> ,<var title=""><ins class=
"diff-chg">y</ins> <sub><ins class="diff-chg">∞</ins></sub></var>
<ins class="diff-chg">) to</ins> the <del class=
"diff-old">start</del> <ins class="diff-chg">subpath,</ins> and
<del class="diff-old">end tangent points respectively. If</del>
<ins class="diff-chg">connect that point to</ins> the <ins class=
"diff-new">previous</ins> point ( <var title=""><ins class=
"diff-new">x0</ins></var> ,<var title=""><ins class=
"diff-new">y0</ins></var> <ins class="diff-new">) by a straight
line, where (</ins> <var title=""><ins class="diff-new">x</ins>
<sub><ins class="diff-new">∞</ins></sub></var> ,<var title=
""><ins class="diff-new">y</ins> <sub><ins class=
"diff-new">∞</ins></sub></var> <ins class="diff-new">) is the point
that is infinitely far away from (</ins> <var title=""><ins class=
"diff-new">x1</ins></var> ,<var title=""><ins class=
"diff-new">y1</ins></var> <ins class="diff-new">), that lies on the
same line as (</ins> <var title=""><ins class=
"diff-new">x0</ins></var> ,<var title=""><ins class=
"diff-new">y0</ins></var> <ins class="diff-new">), (</ins>
<var title=""><ins class="diff-new">x1</ins></var> ,<var title=
""><ins class="diff-new">y1</ins></var> <ins class="diff-new">),
and (</ins> <var title="">x2</var> , <var title="">y2</var>
<del class="diff-old">)</del> <ins class="diff-chg">), and
that</ins> is on the <ins class="diff-new">same side of (</ins>
<var title=""><ins class="diff-new">x1</ins></var> ,<var title=
""><ins class="diff-new">y1</ins></var> <ins class="diff-new">) on
that</ins> line <del class="diff-old">defined</del> <ins class=
"diff-chg">as (</ins> <var title=""><ins class=
"diff-chg">x2</ins></var> ,<var title=""><ins class=
"diff-chg">y2</ins></var> <ins class="diff-chg">).</ins></p>
<p><ins class="diff-chg">Otherwise, let</ins> <var title=
""><ins class="diff-chg">The Arc</ins></var> <ins class=
"diff-chg">be the shortest arc given</ins> by <ins class=
"diff-new">circumference of</ins> the <del class=
"diff-old">points</del> <ins class="diff-chg">circle that has
radius</ins> <var title=""><ins class="diff-chg">radius</ins></var>
,<ins class="diff-chg">and that has one point tangent to the
half-infinite line that crosses the point</ins> ( <var title=
"">x0</var> , <var title="">y0</var> ) and <ins class=
"diff-new">ends at the point (</ins> <var title=""><ins class=
"diff-new">x1</ins></var> ,<var title=""><ins class=
"diff-new">y1</ins></var> <ins class="diff-new">), and that has a
different point tangent to the half-infinite line that ends at the
point</ins> ( <var title="">x1</var> , <var title="">y1</var> )
<del class="diff-old">then</del> <ins class="diff-chg">and
crosses</ins> the <del class="diff-old">method must do nothing, as
no arc would satisfy</del> <ins class="diff-chg">point (</ins>
<var title=""><ins class="diff-chg">x2</ins></var> ,<var title=
""><ins class="diff-chg">y2</ins></var> <ins class="diff-chg">).
The points at which this circle touches these two lines are
called</ins> the <del class="diff-old">above constraints.</del>
<ins class="diff-chg">start and end tangent points
respectively.</ins></p>
<p><del class="diff-old">Otherwise, the</del> <ins class=
"diff-chg">The</ins> method must connect the point ( <var title=
"">x0</var> , <var title="">y0</var> ) to the start tangent point
by a straight line, <ins class="diff-new">adding the start tangent
point to the subpath, and</ins> then <ins class=
"diff-new">must</ins> connect the start tangent point to the end
tangent point by <var title="">The Arc</var> , <del class=
"diff-old">and finally add</del> <ins class="diff-chg">adding</ins>
the <del class="diff-old">start and</del> end tangent <del class=
"diff-old">points</del> <ins class="diff-chg">point</ins> to the
subpath.</p>
<p><del class="diff-old">Negative or zero values for radius must
cause the implementation to raise an INDEX_SIZE_ERR
exception.</del> The <dfn id="arcx-" title=
"dom-context-2d-arc"><code>arc( <var title="">x</var> , <var title=
"">y</var> , <var title="">radius</var> , <var title=
"">startAngle</var> , <var title="">endAngle</var> , <var title=
"">anticlockwise</var> )</code></dfn> method draws an arc. If the
context has any subpaths, then the method must add a straight line
from the last point in the subpath to the start point of the arc.
In any case, it must draw the arc between the start point of the
arc and the end point of the arc, and add the start and end points
of the arc to the subpath. The arc and its start and end points are
defined as follows:</p>
<p>Consider a circle that has its origin at ( <var title="">x</var>
, <var title="">y</var> ) and that has radius <var title=
"">radius</var> . The points at <var title="">startAngle</var> and
<var title="">endAngle</var> along the circle's circumference,
measured in radians clockwise from the positive x-axis, are the
start and end points respectively. The arc is the path along the
circumference of this circle from the start point to the end point,
going anti-clockwise if the <var title="">anticlockwise</var>
argument is true, and clockwise otherwise. <del class=
"diff-old">Negative</del> <ins class="diff-chg">Since the points
are on the circle, as opposed to being simply angles from zero, the
arc can never cover an angle greater than 2π radians. If the two
angles are equal,</ins> or <ins class="diff-new">if the radius is
zero, then the arc is defined as being of</ins> zero <ins class=
"diff-new">length in both directions.</ins></p>
<p><ins class="diff-new">Negative</ins> values for <var title=
"">radius</var> must cause the implementation to raise an
<code>INDEX_SIZE_ERR</code> exception.</p>
<p>The <dfn id="rectx" title="dom-context-2d-rect"><code>rect(
<var title="">x</var> , <var title="">y</var> , <var title=
"">w</var> , <var title="">h</var> )</code></dfn> method must
create a new subpath containing just the four points ( <var title=
"">x</var> , <var title="">y</var> ), ( <var title="">x</var> +
<var title="">w</var> , <var title="">y</var> ), ( <var title=
"">x</var> + <var title="">w</var> , <var title="">y</var> +
<var title="">h</var> ), ( <var title="">x</var> , <var title=
"">y</var> + <var title="">h</var> ), with those four points
connected by straight lines, and must then mark the subpath as
closed. It must then create a new subpath with the point (
<var title="">x</var> , <var title="">y</var> ) as the only point
in the subpath.</p>
<p><del class="diff-old">Negative values for w and h must cause the
implementation to raise an INDEX_SIZE_ERR exception.</del> The
<dfn id="fill" title=
"dom-context-2d-fill"><code>fill()</code></dfn> method must fill
<del class="diff-old">each subpath</del> <ins class="diff-chg">all
the subpaths</ins> of the current <del class="diff-old">path in
turn,</del> <ins class="diff-chg">path,</ins> using <code title=
"dom-context-2d-fillStyle"><a href=
"#fillstyle">fillStyle</a></code> , and using the non-zero winding
number rule. Open subpaths must be implicitly closed when being
filled (without affecting the actual subpaths).</p>
<p class="note"><ins class="diff-new">Thus, if two overlapping but
otherwise independent subpaths have opposite windings, they cancel
out and result in no fill. If they have the same winding, that area
just gets painted once.</ins></p>
<p>The <dfn id="stroke" title=
"dom-context-2d-stroke"><code>stroke()</code></dfn> method must
<del class="diff-old">stroke each subpath</del> <ins class=
"diff-chg">calculate the strokes of all the subpaths</ins> of the
current <del class="diff-old">path in turn,</del> <ins class=
"diff-chg">path,</ins> using the <code title=
"dom-context-2d-lineWidth"><del class="diff-old">strokeStyle</del>
<a href="#linewidth"><ins class=
"diff-chg">lineWidth</ins></a></code> , <code title=
"dom-context-2d-lineCap"><del class="diff-old">lineWidth</del>
<a href="#linecap"><ins class="diff-chg">lineCap</ins></a></code> ,
<code title="dom-context-2d-lineJoin"><a href=
"#linejoin">lineJoin</a></code> , and (if appropriate) <code title=
"dom-context-2d-miterLimit"><a href=
"#miterlimit">miterLimit</a></code> <del class=
"diff-old">attributes.</del> <ins class="diff-chg">attributes, and
then fill the combined stroke area using the</ins> <code title=
"dom-context-2d-strokeStyle"><a href="#strokestyle"><ins class=
"diff-chg">strokeStyle</ins></a></code> ,<ins class=
"diff-chg">attribute.</ins></p>
<p class="note"><ins class="diff-chg">Since the subpaths are all
stroked as one, overlapping parts of the paths in one stroke
operation are treated as if their union was what was
painted.</ins></p>
<p>Paths, when filled or stroked, must be painted without affecting
the current path, and must be subject to <del class=
"diff-old">transformations ,</del> <a href="#shadows0" title=
"shadows">shadow effects</a> , <a href="#globalalpha" title=
"dom-context-2d-globalAlpha">global alpha</a> , <ins class=
"diff-chg">the</ins> <a href="#clipping" title=
"clipping region">clipping <del class="diff-old">paths</del>
<ins class="diff-chg">region</ins></a> , and <a href=
"#globalcompositeoperation" title=
"dom-context-2d-globalCompositeOperation">global composition
operators</a> . <del class="diff-old">The transformation is applied
to</del> <ins class="diff-chg">(Transformations affect</ins> the
path when <del class="diff-old">it</del> <ins class="diff-chg">the
path</ins> is <del class="diff-old">drawn,</del> <ins class=
"diff-chg">created,</ins> not when <ins class="diff-new">it is
painted, though</ins> the <del class="diff-old">path</del>
<ins class="diff-chg">stroke</ins> <em><a href=
"#style1"><ins class="diff-chg">style</ins></a></em> is <del class=
"diff-old">constructed. Thus, a single path can be constructed and
then drawn according to different transformations without
recreating</del> <ins class="diff-chg">still affected by</ins> the
<ins class="diff-new">transformation during painting.)</ins></p>
<p><ins class="diff-new">Zero-length line segments must be pruned
before stroking a</ins> path. <ins class="diff-new">Empty subpaths
must be ignored.</ins></p>
<p>The <dfn id="clip" title=
"dom-context-2d-clip"><code>clip()</code></dfn> method must create
a new <dfn id="clipping">clipping <del class="diff-old">path</del>
<ins class="diff-chg">region</ins></dfn> by calculating the
intersection of the current clipping <del class=
"diff-old">path</del> <ins class="diff-chg">region</ins> and the
area described by the current path, using the non-zero winding
number rule. Open subpaths must be implicitly closed when computing
the clipping <del class="diff-old">path,</del> <ins class=
"diff-chg">region,</ins> without affecting the actual subpaths.
<ins class="diff-new">The new clipping region replaces the current
clipping region.</ins></p>
<p>When the context is <del class="diff-old">created,</del>
<ins class="diff-chg">initialized,</ins> the <del class=
"diff-old">initial</del> clipping <del class="diff-old">path
is</del> <ins class="diff-chg">region must be set to</ins> the
rectangle with the top left corner at (0,0) and the width and
height of the coordinate space.</p>
<p>The <dfn id="ispointinpath" title=
"dom-context-2d-isPointInPath"><code>isPointInPath( <var title=
"">x</var> , <var title="">y</var> )</code></dfn> method must
return true if the point given by the <var title="">x</var> and
<var title="">y</var> coordinates passed to the method, when
treated as coordinates in the <del class="diff-old">canvas'</del>
<ins class="diff-chg">canvas</ins> coordinate space unaffected by
the current transformation, is <del class="diff-old">within</del>
<ins class="diff-chg">inside</ins> the <del class=
"diff-old">area</del> <ins class="diff-chg">current path; and must
return false otherwise. Points on the path itself are considered to
be inside the path. If either</ins> of the <ins class=
"diff-new">arguments is infinite or NaN, then the method must
return false.</ins></p>
<h6 id="text"><span class="secno"><ins class=
"diff-new">3.12.11.1.9.</ins></span> <ins class=
"diff-new">Text</ins></h6>
<p><ins class="diff-new">The</ins> <dfn id="font" title=
"dom-context-2d-font"><code><ins class=
"diff-new">font</ins></code></dfn> <ins class="diff-new">DOM
attribute, on setting, must be parsed the same way as the 'font'
property of CSS (but without supporting property-independent
stylesheet syntax like 'inherit'), and the resulting font must be
assigned to the context, with the 'line-height' component forced to
'normal'.</ins> <a href="#references"><ins class=
"diff-new">[CSS]</ins></a></p>
<p><ins class="diff-new">Font names must be interpreted in the
context of the</ins> <code><a href="#canvas">canvas <del class=
"diff-old">that</del></a></code> <ins class="diff-chg">element's
stylesheets; any fonts embedded using</ins> <code title=
""><ins class="diff-chg">@font-face</ins></code> <ins class=
"diff-chg">must therefore be available.</ins> <a href=
"#references"><ins class="diff-chg">[CSSWEBFONTS]</ins></a></p>
<p><ins class="diff-chg">Only vector fonts should be used by the
user agent; if a user agent were to use bitmap fonts then
transformations</ins> would <ins class="diff-new">likely make the
font look very ugly.</ins></p>
<p><ins class="diff-new">On getting, the</ins> <code title=
"dom-context-2d-font"><a href="#font"><ins class=
"diff-new">font</ins></a></code> <ins class="diff-new">attribute
must return the serialized form of the current font of the
context.</ins> <a href="#references"><ins class=
"diff-new">[CSSOM]</ins></a></p>
<p><ins class="diff-new">When the context is created, the font of
the context must</ins> be <del class="diff-old">filled</del>
<ins class="diff-chg">set to 10px sans-serif. When the 'font-size'
component is set to lengths using percentages, 'em' or 'ex' units,
or the 'larger' or 'smaller' keywords, these must be interpreted
relative to the computed value of the 'font-size' property of the
corresponding</ins> <code><a href="#canvas"><ins class=
"diff-chg">canvas</ins></a></code> <ins class="diff-chg">element.
When the 'font-weight' component is set to the relative values
'bolder' and 'lighter', these must be interpreted relative to the
computed value of the 'font-weight' property of the
corresponding</ins> <code><a href="#canvas"><ins class=
"diff-chg">canvas</ins></a></code> <ins class=
"diff-chg">element.</ins></p>
<p><ins class="diff-chg">The</ins> <dfn id="textalign" title=
"dom-context-2d-textAlign"><code><ins class=
"diff-chg">textAlign</ins></code></dfn> <ins class="diff-chg">DOM
attribute, on getting, must return the current value. On
setting,</ins> if the <ins class="diff-new">value is one of</ins>
<code title=""><ins class="diff-new">start</ins></code>
,<code title=""><ins class="diff-new">end</ins></code>
,<code title=""><ins class="diff-new">left</ins></code>
,<code title=""><ins class="diff-new">right</ins></code>
,<ins class="diff-new">or</ins> <code title=""><ins class=
"diff-new">center</ins></code> ,<ins class="diff-new">then the
value must be changed to the new value. Otherwise, the new value
must be ignored. When the context is created, the</ins>
<code title="dom-context-2d-textAlign"><a href=
"#textalign"><ins class="diff-new">textAlign</ins></a></code>
<ins class="diff-new">attribute must initially have the value</ins>
<code title=""><ins class="diff-new">start</ins></code> .</p>
<p><ins class="diff-new">The</ins> <dfn id="textbaseline" title=
"dom-context-2d-textBaseline"><code><ins class=
"diff-new">textBaseline</ins></code></dfn> <ins class=
"diff-new">DOM attribute, on getting, must return the</ins> current
<del class="diff-old">path</del> <ins class="diff-chg">value. On
setting, if the value is one of</ins> <code title=
"dom-context-2d-textBaseline-top"><a href="#top"><ins class=
"diff-chg">top</ins></a></code> ,<code title=
"dom-context-2d-textBaseline-hanging"><a href=
"#hanging"><ins class="diff-chg">hanging</ins></a></code>
,<code title="dom-context-2d-textBaseline-middle"><a href=
"#middle"><ins class="diff-chg">middle</ins></a></code>
,<code title="dom-context-2d-textBaseline-alphabetic"><a href=
"#alphabetic"><ins class="diff-chg">alphabetic</ins></a></code>
,<code title="dom-context-2d-textBaseline-ideographic"><a href=
"#ideographic"><ins class="diff-chg">ideographic</ins></a></code>
,<ins class="diff-chg">or</ins> <code title=
"dom-context-2d-textBaseline-bottom"><a href="#bottom"><ins class=
"diff-chg">bottom</ins></a></code> ,<ins class="diff-chg">then the
value must be changed to the new value. Otherwise, the new value
must be ignored. When the context is created, the</ins>
<code title="dom-context-2d-textBaseline"><a href=
"#textbaseline"><ins class="diff-chg">textBaseline</ins></a></code>
<ins class="diff-chg">attribute must initially have the value</ins>
<code title=""><ins class="diff-chg">alphabetic</ins></code> .</p>
<p><ins class="diff-chg">The</ins> <code title=
"dom-context-2d-textBaseline"><a href="#textbaseline"><ins class=
"diff-chg">textBaseline</ins></a></code> <ins class=
"diff-chg">attribute's allowed keywords correspond to alignment
points in the font:</ins></p>
<p><img alt=
"The top of the em square is roughly at the top of the glyphs in a font, the hanging baseline is where some glyphs like आ are anchored, the middle is half-way between the top of the em square and the bottom of the em square, the alphabetic baseline is where characters like Á, ÿ, f, and Ω are anchored, the ideographic baseline is where glyphs like 私 and 達 are anchored, and the bottom of the em square is roughly at the bottom of the glyphs in a font. The top and bottom of the bounding box can be far from these baselines, due to glyphs extending far outside the em square."
src="images/baselines.png"></p>
<p><ins class="diff-chg">The keywords map to these alignment points
as follows:</ins></p>
<dl>
<dt><dfn id="top" title=
"dom-context-2d-textBaseline-top"><code><ins class=
"diff-chg">top</ins></code></dfn></dt>
<dd><ins class="diff-chg">The top of the em square</ins></dd>
<dt><dfn id="hanging" title=
"dom-context-2d-textBaseline-hanging"><code><ins class=
"diff-chg">hanging</ins></code></dfn></dt>
<dd><ins class="diff-chg">The hanging baseline</ins></dd>
<dt><dfn id="middle" title=
"dom-context-2d-textBaseline-middle"><code><ins class=
"diff-chg">middle</ins></code></dfn></dt>
<dd><ins class="diff-chg">The middle of the em square</ins></dd>
<dt><dfn id="alphabetic" title=
"dom-context-2d-textBaseline-alphabetic"><code><ins class=
"diff-chg">alphabetic</ins></code></dfn></dt>
<dd><ins class="diff-chg">The alphabetic baseline</ins></dd>
<dt><dfn id="ideographic" title=
"dom-context-2d-textBaseline-ideographic"><code><ins class=
"diff-chg">ideographic</ins></code></dfn></dt>
<dd><ins class="diff-chg">The ideographic baseline</ins></dd>
<dt><dfn id="bottom" title=
"dom-context-2d-textBaseline-bottom"><code><ins class=
"diff-chg">bottom</ins></code></dfn></dt>
<dd><ins class="diff-chg">The bottom of the em square</ins></dd>
</dl>
<p><ins class="diff-chg">The</ins> <dfn id="filltext" title=
"dom-context-2d-fillText"><code><ins class=
"diff-chg">fillText()</ins></code></dfn> <ins class=
"diff-chg">and</ins> <dfn id="stroketext" title=
"dom-context-2d-strokeText"><code><ins class=
"diff-chg">strokeText()</ins></code></dfn> <ins class=
"diff-chg">methods take three or four arguments,</ins> <var title=
""><ins class="diff-chg">text</ins></var> ,<var title=
""><ins class="diff-chg">x</ins></var> ,<var title=""><ins class=
"diff-chg">y</ins></var> ,<ins class="diff-chg">and
optionally</ins> <var title=""><ins class=
"diff-chg">maxWidth</ins></var> ,<ins class="diff-chg">and render
the given</ins> <var title=""><ins class=
"diff-chg">text</ins></var> <ins class="diff-chg">at the given
(</ins> <var title=""><ins class="diff-chg">x</ins></var>
,<var title=""><ins class="diff-chg">y</ins></var> <ins class=
"diff-chg">) coordinates ensuring that the text isn't wider
than</ins> <var title=""><ins class="diff-chg">maxWidth</ins></var>
<ins class="diff-chg">if specified, using the current</ins>
<code title="dom-context-2d-font"><a href="#font"><ins class=
"diff-chg">font</ins></a></code> ,<code title=
"dom-context-2d-textAlign"><a href="#textalign"><ins class=
"diff-chg">textAlign</ins></a></code> ,<ins class=
"diff-chg">and</ins> <code title=
"dom-context-2d-textBaseline"><a href="#textbaseline"><ins class=
"diff-chg">textBaseline</ins></a></code> <ins class=
"diff-chg">values. Specifically, when the methods are called, the
user agent must run the following steps:</ins></p>
<ol>
<li>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">font</ins></var> <ins class="diff-chg">be the current
font of the browsing context, as given by the</ins> <code title=
"dom-context-2d-font"><a href="#font"><ins class=
"diff-chg">font</ins></a></code> <ins class=
"diff-chg">attribute.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Replace all the</ins> <a href="#space"
title="space character"><ins class="diff-chg">space
characters</ins></a> <ins class="diff-chg">in</ins> <var title=
""><ins class="diff-chg">text</ins></var> <ins class=
"diff-chg">with U+0020 SPACE characters.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Form a hypothetical infinitely wide CSS
line box containing a single inline box containing the text</ins>
<var title=""><ins class="diff-chg">text</ins></var> ,<ins class=
"diff-chg">with all the properties at their initial values except
the 'font' property of the inline element set to</ins> <var title=
""><ins class="diff-chg">font</ins></var> <ins class="diff-chg">and
the 'direction' property of the inline element set to the
'direction' property of the</ins> <code><a href=
"#canvas"><ins class="diff-chg">canvas</ins></a></code> <ins class=
"diff-chg">element.</ins> <a href="#references"><ins class=
"diff-chg">[CSS]</ins></a></p>
</li>
<li>
<p><ins class="diff-chg">If the</ins> <var title=""><ins class=
"diff-chg">maxWidth</ins></var> <ins class=
"diff-chg">argument</ins> was <ins class="diff-new">specified and
the hypothetical width of the inline box in the hypothetical line
box is greater than</ins> <var title=""><ins class=
"diff-new">maxWidth</ins></var> <ins class="diff-new">CSS pixels,
then change</ins> <var title=""><ins class=
"diff-new">font</ins></var> to <ins class="diff-new">have a more
condensed font (if one is available or if a reasonably readable one
can</ins> be <del class="diff-old">filled;</del> <ins class=
"diff-chg">synthesized by applying a horizontal scale factor to the
font) or a smaller font, and return to the previous step.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Let the</ins> <var title=""><ins class=
"diff-chg">anchor point</ins></var> <ins class="diff-chg">be a
point on the inline box, determined by the</ins> <code title=
"dom-context-2d-textAlign"><a href="#textalign"><ins class=
"diff-chg">textAlign</ins></a></code> <ins class=
"diff-chg">and</ins> <code title=
"dom-context-2d-textBaseline"><a href="#textbaseline"><ins class=
"diff-chg">textBaseline</ins></a></code> <ins class=
"diff-chg">values, as follows:</ins></p>
<p><ins class="diff-chg">Horizontal position:</ins></p>
<dl>
<dt><ins class="diff-chg">If</ins> <code title=
"dom-context-2d-textAlign"><a href="#textalign"><ins class=
"diff-chg">textAlign</ins></a></code> <ins class=
"diff-chg">is</ins> <code title=""><ins class=
"diff-chg">left</ins></code></dt>
<dt><ins class="diff-chg">If</ins> <code title=
"dom-context-2d-textAlign"><a href="#textalign"><ins class=
"diff-chg">textAlign</ins></a></code> <ins class=
"diff-chg">is</ins> <code title=""><ins class=
"diff-chg">start</ins></code> <ins class="diff-chg">and the
'direction' property on the</ins> <code><a href=
"#canvas"><ins class="diff-chg">canvas</ins></a></code> <ins class=
"diff-chg">element has a computed value of 'ltr'</ins></dt>
<dt><ins class="diff-chg">If</ins> <code title=
"dom-context-2d-textAlign"><a href="#textalign"><ins class=
"diff-chg">textAlign</ins></a></code> <ins class=
"diff-chg">is</ins> <code title=""><ins class=
"diff-chg">end</ins></code> <ins class="diff-chg">and the
'direction' property on the</ins> <code><a href=
"#canvas"><ins class="diff-chg">canvas</ins></a></code> <ins class=
"diff-chg">element has a computed value of 'rtl'</ins></dt>
<dd><ins class="diff-chg">Let the</ins> <var title=""><ins class=
"diff-chg">anchor point</ins></var> <ins class="diff-chg">'s
horizontal position be the left edge of the inline box.</ins></dd>
<dt><ins class="diff-chg">If</ins> <code title=
"dom-context-2d-textAlign"><a href="#textalign"><ins class=
"diff-chg">textAlign</ins></a></code> <ins class=
"diff-chg">is</ins> <code title=""><ins class=
"diff-chg">right</ins></code></dt>
<dt><ins class="diff-chg">If</ins> <code title=
"dom-context-2d-textAlign"><a href="#textalign"><ins class=
"diff-chg">textAlign</ins></a></code> <ins class=
"diff-chg">is</ins> <code title=""><ins class=
"diff-chg">end</ins></code> <ins class="diff-chg">and the
'direction' property on the</ins> <code><a href=
"#canvas"><ins class="diff-chg">canvas</ins></a></code> <ins class=
"diff-chg">element has a computed value of 'ltr'</ins></dt>
<dt><ins class="diff-chg">If</ins> <code title=
"dom-context-2d-textAlign"><a href="#textalign"><ins class=
"diff-chg">textAlign</ins></a></code> <ins class=
"diff-chg">is</ins> <code title=""><ins class=
"diff-chg">start</ins></code> <ins class="diff-chg">and the
'direction' property on the</ins> <code><a href=
"#canvas"><ins class="diff-chg">canvas</ins></a></code> <ins class=
"diff-chg">element has a computed value of 'rtl'</ins></dt>
<dd><ins class="diff-chg">Let the</ins> <var title=""><ins class=
"diff-chg">anchor point</ins></var> <ins class="diff-chg">'s
horizontal position be the right edge of the inline box.</ins></dd>
<dt><ins class="diff-chg">If</ins> <code title=
"dom-context-2d-textAlign"><a href="#textalign"><ins class=
"diff-chg">textAlign</ins></a></code> <ins class=
"diff-chg">is</ins> <code title=""><ins class=
"diff-chg">center</ins></code></dt>
<dd><ins class="diff-chg">Let the</ins> <var title=""><ins class=
"diff-chg">anchor point</ins></var> <ins class="diff-chg">'s
horizontal position be half way between the left and right edges of
the inline box.</ins></dd>
</dl>
<p><ins class="diff-chg">Vertical position:</ins></p>
<dl>
<dt><ins class="diff-chg">If</ins> <code title=
"dom-context-2d-textBaseline"><a href="#textbaseline"><ins class=
"diff-chg">textBaseline</ins></a></code> <ins class=
"diff-chg">is</ins> <code title=
"dom-context-2d-textBaseline-top"><a href="#top"><ins class=
"diff-chg">top</ins></a></code></dt>
<dd><ins class="diff-chg">Let the</ins> <var title=""><ins class=
"diff-chg">anchor point</ins></var> <ins class="diff-chg">'s
vertical position be the top of the em box of the first available
font of the inline box.</ins></dd>
<dt><ins class="diff-chg">If</ins> <code title=
"dom-context-2d-textBaseline"><a href="#textbaseline"><ins class=
"diff-chg">textBaseline</ins></a></code> <ins class=
"diff-chg">is</ins> <code title=
"dom-context-2d-textBaseline-hanging"><a href=
"#hanging"><ins class="diff-chg">hanging</ins></a></code></dt>
<dd><ins class="diff-chg">Let the</ins> <var title=""><ins class=
"diff-chg">anchor point</ins></var> <ins class="diff-chg">'s
vertical position be the hanging baseline of the first available
font of the inline box.</ins></dd>
<dt><ins class="diff-chg">If</ins> <code title=
"dom-context-2d-textBaseline"><a href="#textbaseline"><ins class=
"diff-chg">textBaseline</ins></a></code> <ins class=
"diff-chg">is</ins> <code title=
"dom-context-2d-textBaseline-middle"><a href="#middle"><ins class=
"diff-chg">middle</ins></a></code></dt>
<dd><ins class="diff-chg">Let the</ins> <var title=""><ins class=
"diff-chg">anchor point</ins></var> <ins class="diff-chg">'s
vertical position be half way between the bottom and the top of the
em box of the first available font of the inline box.</ins></dd>
<dt><ins class="diff-chg">If</ins> <code title=
"dom-context-2d-textBaseline"><a href="#textbaseline"><ins class=
"diff-chg">textBaseline</ins></a></code> <ins class=
"diff-chg">is</ins> <code title=
"dom-context-2d-textBaseline-alphabetic"><a href=
"#alphabetic"><ins class=
"diff-chg">alphabetic</ins></a></code></dt>
<dd><ins class="diff-chg">Let the</ins> <var title=""><ins class=
"diff-chg">anchor point</ins></var> <ins class="diff-chg">'s
vertical position be the alphabetic baseline of the first available
font of the inline box.</ins></dd>
<dt><ins class="diff-chg">If</ins> <code title=
"dom-context-2d-textBaseline"><a href="#textbaseline"><ins class=
"diff-chg">textBaseline</ins></a></code> <ins class=
"diff-chg">is</ins> <code title=
"dom-context-2d-textBaseline-ideographic"><a href=
"#ideographic"><ins class=
"diff-chg">ideographic</ins></a></code></dt>
<dd><ins class="diff-chg">Let the</ins> <var title=""><ins class=
"diff-chg">anchor point</ins></var> <ins class="diff-chg">'s
vertical position be the ideographic baseline of the first
available font of the inline box.</ins></dd>
<dt><ins class="diff-chg">If</ins> <code title=
"dom-context-2d-textBaseline"><a href="#textbaseline"><ins class=
"diff-chg">textBaseline</ins></a></code> <ins class=
"diff-chg">is</ins> <code title=
"dom-context-2d-textBaseline-bottom"><a href="#bottom"><ins class=
"diff-chg">bottom</ins></a></code></dt>
<dd><ins class="diff-chg">Let the</ins> <var title=""><ins class=
"diff-chg">anchor point</ins></var> <ins class="diff-chg">'s
vertical position be the bottom of the em box of the first
available font of the inline box.</ins></dd>
</dl>
</li>
<li>
<p><ins class="diff-chg">Paint the hypothetical inline box as the
shape given by the text's glyphs, as transformed by the</ins>
<a href="#transformations0" title=
"dom-context-2d-transformation"><ins class="diff-chg">current
transformation matrix</ins></a> ,<ins class="diff-chg">and anchored
and sized so that before applying the</ins> <a href=
"#transformations0" title=
"dom-context-2d-transformation"><ins class="diff-chg">current
transformation matrix</ins></a> ,<ins class="diff-chg">the</ins>
<var title=""><ins class="diff-chg">anchor point</ins></var>
<ins class="diff-chg">is at (</ins> <var title=""><ins class=
"diff-chg">x</ins></var> ,<var title=""><ins class=
"diff-chg">y</ins></var> <ins class="diff-chg">) and each CSS pixel
is mapped to one coordinate space unit.</ins></p>
<p><ins class="diff-chg">For</ins> <code title=
"dom-context-2d-fillText"><a href="#filltext"><ins class=
"diff-chg">fillText()</ins></a></code> <code title=
"dom-context-2d-fillStyle"><a href="#fillstyle"><ins class=
"diff-chg">fillStyle</ins></a></code> <ins class="diff-chg">must be
applied to the glyphs and</ins> <code title=
"dom-context-2d-strokeStyle"><a href="#strokestyle"><ins class=
"diff-chg">strokeStyle</ins></a></code> <ins class="diff-chg">must
be ignored. For</ins> <code title=
"dom-context-2d-strokeText"><a href="#stroketext"><ins class=
"diff-chg">strokeText()</ins></a></code> <ins class="diff-chg">the
reverse holds</ins> and <code title=
"dom-context-2d-strokeStyle"><a href="#strokestyle"><ins class=
"diff-new">strokeStyle</ins></a></code> must <ins class=
"diff-new">be applied to the glyph outlines and</ins> <code title=
"dom-context-2d-fillStyle"><a href="#fillstyle"><ins class=
"diff-new">fillStyle</ins></a></code> <ins class="diff-new">must be
ignored.</ins></p>
<p><ins class="diff-new">Text is painted without affecting the
current path, and is subject to</ins> <a href="#shadows0" title=
"shadows"><ins class="diff-new">shadow effects</ins></a> ,<a href=
"#globalalpha" title="dom-context-2d-globalAlpha"><ins class=
"diff-new">global alpha</ins></a> ,<ins class="diff-new">the</ins>
<a href="#clipping" title="clipping region"><ins class=
"diff-new">clipping region</ins></a> ,<ins class=
"diff-new">and</ins> <a href="#globalcompositeoperation" title=
"dom-context-2d-globalCompositeOperation"><ins class=
"diff-new">global composition operators</ins></a> .</p>
</li>
</ol>
<p><ins class="diff-new">The</ins> <dfn id="measuretext" title=
"dom-context-2d-measureText"><code><ins class=
"diff-new">measureText()</ins></code></dfn> <ins class=
"diff-new">method takes one argument,</ins> <var title=
""><ins class="diff-new">text</ins></var> .<ins class=
"diff-new">When the method is invoked, the user agent must replace
all the</ins> <a href="#space" title="space character"><ins class=
"diff-new">space characters</ins></a> <ins class=
"diff-new">in</ins> <var title=""><ins class=
"diff-new">text</ins></var> <ins class="diff-new">with U+0020 SPACE
characters, and then must form a hypothetical infinitely wide CSS
line box containing a single inline box containing the text</ins>
<var title=""><ins class="diff-new">text</ins></var> ,<ins class=
"diff-new">with all the properties at their initial values except
the 'font' property of the inline element set to the current font
of the browsing context, as given by the</ins> <code title=
"dom-context-2d-font"><a href="#font"><ins class=
"diff-new">font</ins></a></code> <ins class="diff-new">attribute,
and must then</ins> return <del class="diff-old">false
otherwise.</del> <ins class="diff-chg">a new</ins> <code><a href=
"#textmetrics"><ins class="diff-chg">TextMetrics</ins></a></code>
<ins class="diff-chg">object with its</ins> <code title=
"dom-textmetrics-width"><a href="#width2"><ins class=
"diff-chg">width</ins></a></code> <ins class="diff-chg">attribute
set to the width of that inline box, in CSS pixels.</ins> <a href=
"#references"><ins class="diff-chg">[CSS]</ins></a></p>
<p><ins class="diff-chg">The</ins> <code><a href=
"#textmetrics"><ins class="diff-chg">TextMetrics</ins></a></code>
<ins class="diff-chg">interface is used for the objects returned
from</ins> <code title="dom-context-2d-measureText"><a href=
"#measuretext"><ins class="diff-chg">measureText()</ins></a></code>
.<ins class="diff-chg">It has one attribute,</ins> <dfn id="width2"
title="dom-textmetrics-width"><code><ins class=
"diff-chg">width</ins></code></dfn> ,<ins class="diff-chg">which is
set by the</ins> <code title="dom-context-2d-measureText"><a href=
"#measuretext"><ins class="diff-chg">measureText()</ins></a></code>
<ins class="diff-chg">method.</ins></p>
<p class="note"><ins class="diff-chg">Glyphs rendered using</ins>
<code title="dom-context-2d-fillText"><a href=
"#filltext"><ins class="diff-chg">fillText()</ins></a></code>
<ins class="diff-chg">and</ins> <code title=
"dom-context-2d-strokeText"><a href="#stroketext"><ins class=
"diff-chg">strokeText()</ins></a></code> <ins class="diff-chg">can
spill out of the box given by the font size (the em square size)
and the width returned by</ins> <code title=
"dom-context-2d-measureText"><a href="#measuretext"><ins class=
"diff-chg">measureText()</ins></a></code> <ins class=
"diff-chg">(the text width). This version of the specification does
not provide a way to obtain the bounding box dimensions of the
text. If the text is to be rendered and removed, care needs to be
taken to replace the entire area of the canvas that the clipping
region covers, not just the box given by the em square height and
measured text width.</ins></p>
<p class="note"><ins class="diff-chg">A future version of the 2D
context API may provide a way to render fragments of documents,
rendered using CSS, straight to the canvas. This would be provided
in preference to a dedicated way of doing multiline
layout.</ins></p>
<h6 id="images"><span class="secno"><del class=
"diff-old">3.14.11.1.9.</del> <ins class=
"diff-chg">3.12.11.1.10.</ins></span> Images</h6>
<p>To draw images onto the canvas, the <dfn id="drawimage" title=
"dom-context-2d-drawImage"><code>drawImage</code></dfn> method can
be used.</p>
<p>This method is overloaded with three variants: <code title=
"">drawImage( <var title="">image</var> , <var title="">dx</var> ,
<var title="">dy</var> )</code> , <code title="">drawImage(
<var title="">image</var> , <var title="">dx</var> , <var title=
"">dy</var> , <var title="">dw</var> , <var title="">dh</var>
)</code> , and <code title="">drawImage( <var title="">image</var>
, <var title="">sx</var> , <var title="">sy</var> , <var title=
"">sw</var> , <var title="">sh</var> , <var title="">dx</var> ,
<var title="">dy</var> , <var title="">dw</var> , <var title=
"">dh</var> )</code> . (Actually it is overloaded with six; each of
those three can take either an <code><a href=
"#htmlimageelement">HTMLImageElement</a></code> or an
<code><a href="#htmlcanvaselement">HTMLCanvasElement</a></code> for
the <var title="">image</var> argument.) If not specified, the
<var title="">dw</var> and <var title="">dh</var> arguments
<ins class="diff-new">must</ins> default to the values of
<var title="">sw</var> and <var title="">sh</var> , interpreted
such that one CSS pixel in the image is treated as one unit in the
canvas coordinate space. If the <var title="">sx</var> ,
<var title="">sy</var> , <var title="">sw</var> , and <var title=
"">sh</var> arguments are omitted, they <ins class=
"diff-new">must</ins> default to 0, 0, the image's intrinsic width
in image pixels, and the image's intrinsic height in image pixels,
respectively.</p>
<p>The <var title="">image</var> argument must be an instance of an
<code><a href="#htmlimageelement">HTMLImageElement</a></code> or
<code><a href="#htmlcanvaselement">HTMLCanvasElement</a></code> .
If the <var title="">image</var> is of the wrong <del class=
"diff-old">type,</del> <ins class="diff-chg">type or null,</ins>
the implementation must raise a <code>TYPE_MISMATCH_ERR</code>
exception.</p>
<p>If <del class="diff-old">one of</del> the <var title=
""><del class="diff-old">sy</del> <ins class=
"diff-chg">image</ins></var> <ins class="diff-chg">argument is
an</ins> <code><a href="#htmlimageelement"><ins class=
"diff-chg">HTMLImageElement</ins></a></code> <ins class=
"diff-chg">object whose</ins> <code title=
"dom-img-complete"><a href="#complete"><ins class=
"diff-chg">complete</ins></a></code> <ins class=
"diff-chg">attribute is false, then the implementation must raise
an</ins> <code><ins class="diff-chg">INVALID_STATE_ERR</ins></code>
<ins class="diff-chg">exception.</ins></p>
<p><ins class="diff-chg">The source rectangle is the rectangle
whose corners are the four points (</ins> <var title=""><ins class=
"diff-chg">sx</ins></var> , <var title=""><ins class=
"diff-new">sy</ins></var> <ins class="diff-new">), (</ins>
<span><var title=""><ins class="diff-new">sx</ins></var>
<ins class="diff-new">+</ins> <var title="">sw <del class=
"diff-old">,</del></var></span> , <var title=""><ins class=
"diff-chg">sy</ins></var> <ins class="diff-chg">), (</ins>
<span><var title=""><ins class="diff-chg">sx</ins></var>
<ins class="diff-chg">+</ins> <var title="">sw</var></span> ,
<span><var title=""><ins class="diff-new">sy</ins></var>
<ins class="diff-new">+</ins> <var title=""><ins class=
"diff-new">sh</ins></var></span> <ins class="diff-new">), (</ins>
<var title=""><ins class="diff-new">sx</ins></var> , <del class=
"diff-old">and</del> <span><var title=""><ins class=
"diff-chg">sy</ins></var> <ins class="diff-chg">+</ins> <var title=
"">sh</var> <del class="diff-old">arguments is outside</del></span>
<ins class="diff-chg">).</ins></p>
<p><ins class="diff-chg">If</ins> the <del class="diff-old">size
of</del> <ins class="diff-chg">source rectangle is not entirely
within</ins> the <ins class="diff-new">source</ins> image, or if
one of the <var title=""><del class="diff-old">dw</del> <ins class=
"diff-chg">sw</ins></var> <del class="diff-old">and</del>
<ins class="diff-chg">or</ins> <var title=""><del class=
"diff-old">dh</del> <ins class="diff-chg">sh</ins></var> arguments
is <del class="diff-old">negative,</del> <ins class=
"diff-chg">zero,</ins> the implementation must raise an
<code>INDEX_SIZE_ERR</code> exception. <del class=
"diff-old">If</del></p>
<p><ins class="diff-chg">The destination rectangle is</ins> the
<ins class="diff-new">rectangle whose corners are the four points
(</ins> <var title=""><del class="diff-old">image</del> <ins class=
"diff-chg">dx</ins></var> ,<var title=""><ins class=
"diff-chg">dy</ins></var> <del class="diff-old">argument is
an</del> <ins class="diff-chg">), (</ins> <span><del class=
"diff-old">HTMLImageElement</del> <var title=""><ins class=
"diff-chg">dx</ins></var> <ins class="diff-chg">+</ins> <var title=
""><ins class="diff-chg">dw</ins></var> <del class=
"diff-old">object whose complete attribute is false, then the
implementation must raise an INVALID_STATE_ERR
exception.</del></span> , <var title=""><ins class=
"diff-chg">dy</ins></var> <ins class="diff-chg">), (</ins>
<span><var title=""><ins class="diff-chg">dx</ins></var>
<ins class="diff-chg">+</ins> <var title=""><ins class=
"diff-chg">dw</ins></var></span> ,<span><var title=""><ins class=
"diff-chg">dy</ins></var> <ins class="diff-chg">+</ins> <var title=
""><ins class="diff-chg">dh</ins></var></span> <ins class=
"diff-chg">), (</ins> <var title=""><ins class=
"diff-chg">dx</ins></var> ,<span><var title=""><ins class=
"diff-chg">dy</ins></var> <ins class="diff-chg">+</ins> <var title=
""><ins class="diff-chg">dh</ins></var></span> <ins class=
"diff-chg">).</ins></p>
<p>When <code title="dom-context-2d-drawImage"><a href=
"#drawimage">drawImage()</a></code> is invoked, the <del class=
"diff-old">specified</del> region of the image specified by the
source rectangle <del class="diff-old">( sx , sy , sw , sh )</del>
must be painted on the region of the canvas specified by the
destination <del class="diff-old">rectangle ( dx , dy , dw , dh
),</del> <ins class="diff-chg">rectangle,</ins> after applying the
<a href="#transformations0" title=
"dom-context-2d-transformation">current transformation matrix
<del class="diff-old">.</del></a> <ins class="diff-chg">to the
points of the destination rectangle.</ins></p>
<p><img alt="" src="images/drawImage.png"></p>
<p class="note">When a canvas is drawn onto itself, the drawing
model requires the source to be copied before the image is drawn
back onto the canvas, so it is possible to copy parts of a canvas
onto overlapping parts of itself.</p>
<p><ins class="diff-new">When the</ins> <code title=
"dom-context-2d-drawImage"><a href="#drawimage"><ins class=
"diff-new">drawImage()</ins></a></code> <ins class=
"diff-new">method is passed, as its</ins> <var title=""><ins class=
"diff-new">image</ins></var> <ins class="diff-new">argument, an
animated image, the poster frame of the animation, or the first
frame of the animation if there is no poster frame, must be
used.</ins></p>
<p>Images are painted without affecting the current path, and are
subject to <a href="#shadows0" title="shadows">shadow effects</a> ,
<a href="#globalalpha" title="dom-context-2d-globalAlpha">global
alpha</a> , <ins class="diff-chg">the</ins> <a href="#clipping"
title="clipping region">clipping <del class="diff-old">paths</del>
<ins class="diff-chg">region</ins></a> , and <a href=
"#globalcompositeoperation" title=
"dom-context-2d-globalCompositeOperation">global composition
operators</a> .</p>
<h6 id="pixel"><span class="secno"><del class=
"diff-old">3.14.11.1.10.</del> <ins class=
"diff-chg">3.12.11.1.11.</ins></span> <dfn id="pixel1">Pixel
manipulation</dfn></h6>
<p>The <dfn id="createimagedata" title=
"dom-context-2d-createImageData"><code><ins class=
"diff-new">createImageData(</ins> <var title=""><ins class=
"diff-new">sw</ins></var> ,<var title=""><ins class=
"diff-new">sh</ins></var> <ins class=
"diff-new">)</ins></code></dfn> <ins class="diff-new">method must
return an</ins> <code><a href="#imagedata"><ins class=
"diff-new">ImageData</ins></a></code> <ins class="diff-new">object
representing a rectangle with a width in CSS pixels equal to the
absolute magnitude of</ins> <var title=""><ins class=
"diff-new">sw</ins></var> <ins class="diff-new">and a height in CSS
pixels equal to the absolute magnitude of</ins> <var title=
""><ins class="diff-new">sh</ins></var> ,<ins class=
"diff-new">filled with transparent black.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="getimagedata" title=
"dom-context-2d-getImageData"><code>getImageData( <var title=
"">sx</var> , <var title="">sy</var> , <var title="">sw</var> ,
<var title="">sh</var> )</code></dfn> method must return an
<code><a href="#imagedata">ImageData</a></code> object representing
the underlying pixel data for the area of the canvas denoted by the
rectangle <del class="diff-old">which has its top left corner
at</del> <ins class="diff-chg">whose corners are</ins> the
<ins class="diff-new">four points</ins> ( <var title="">sx</var> ,
<var title="">sy</var> <del class="diff-old">) coordinate, and that
has width</del> <ins class="diff-chg">), (</ins> <span><var title=
""><ins class="diff-chg">sx</ins></var> <ins class=
"diff-chg">+</ins> <var title="">sw</var> <del class="diff-old">and
height</del></span> , <var title=""><ins class=
"diff-chg">sy</ins></var> <ins class="diff-chg">), (</ins>
<span><var title=""><ins class="diff-chg">sx</ins></var>
<ins class="diff-chg">+</ins> <var title=""><ins class=
"diff-chg">sw</ins></var></span> ,<span><var title=""><ins class=
"diff-chg">sy</ins></var> <ins class="diff-chg">+</ins> <var title=
"">sh <del class="diff-old">.</del></var></span> <ins class=
"diff-chg">), (</ins> <var title=""><ins class=
"diff-chg">sx</ins></var> ,<span><var title=""><ins class=
"diff-chg">sy</ins></var> <ins class="diff-chg">+</ins> <var title=
""><ins class="diff-chg">sh</ins></var></span> <ins class=
"diff-chg">), in canvas coordinate space units.</ins> Pixels
outside the canvas must be returned as transparent black. Pixels
must be returned as non-premultiplied alpha values.</p>
<p><ins class="diff-new">If any of the arguments to</ins>
<code title="dom-context-2d-createImageData"><a href=
"#createimagedata"><ins class=
"diff-new">createImageData()</ins></a></code> <ins class=
"diff-new">or</ins> <code title=
"dom-context-2d-getImageData"><a href="#getimagedata"><ins class=
"diff-new">getImageData()</ins></a></code> <ins class=
"diff-new">are infinite or NaN, or if either the</ins> <var title=
""><ins class="diff-new">sw</ins></var> <ins class=
"diff-new">or</ins> <var title=""><ins class=
"diff-new">sh</ins></var> <ins class="diff-new">arguments are zero,
the method must instead raise an</ins> <code><ins class=
"diff-new">INDEX_SIZE_ERR</ins></code> <ins class=
"diff-new">exception.</ins></p>
<p><code><a href="#imagedata">ImageData</a></code> objects must be
<del class="diff-old">initialised</del> <ins class=
"diff-chg">initialized</ins> so that their <dfn id="width3" title=
"dom-imagedata-width"><code>width</code></dfn> attribute is set to
<var title="">w</var> , the number of physical device pixels per
row in the image data, their <dfn id="height2" title=
"dom-imagedata-height"><code>height</code></dfn> attribute is set
to <var title="">h</var> , the number of rows in the image data,
and the <dfn id="data1" title=
"dom-imagedata-data"><code>data</code></dfn> attribute is
<del class="diff-old">initialised</del> <ins class=
"diff-chg">initialized</ins> to an array of <var title="">h</var> ×
<var title="">w</var> ×4 integers. The pixels must be represented
in this array in left-to-right order, row by row, starting at the
top left, with each pixel's red, green, blue, and alpha components
being given in that order. Each component of each device pixel
represented in this array must be in the range 0..255, representing
the 8 bit value for that component. At least one pixel must be
returned.</p>
<p>The values of the <code title="dom-imagedata-data"><a href=
"#data1">data</a></code> array may be changed (the length of the
array, and the other attributes in <code><a href=
"#imagedata">ImageData</a></code> objects, are all read-only). On
setting, JS <code>undefined</code> values must be converted to
zero. Other values must first be converted to numbers using
JavaScript's ToNumber algorithm, and if the result is <del class=
"diff-old">not</del> a <del class="diff-old">number,</del>
<ins class="diff-chg">NaN value,</ins> a
<code>TYPE_MISMATCH_ERR</code> exception must be raised. If the
result is less than 0, it must be clamped to zero. If the result is
more than 255, it must be clamped to 255. If the number is not an
integer, it must be rounded to the nearest integer using the IEEE
754r <i>roundTiesToEven</i> rounding mode. <a href=
"#references">[ECMA262]</a> <a href=
"#references">[IEEE754R]</a></p>
<p class="note">The width and height ( <var title="">w</var> and
<var title="">h</var> ) might be different from the <var title=
"">sw</var> and <var title="">sh</var> arguments to the <del class=
"diff-old">function,</del> <ins class="diff-chg">above
methods,</ins> e.g. if the canvas is backed by a high-resolution
<del class="diff-old">bitmap. If the getImageData( sx , sy , sw ,
sh ) method is called with either</del> <ins class=
"diff-chg">bitmap, or if</ins> the <var title="">sw</var>
<del class="diff-old">or</del> <ins class="diff-chg">and</ins>
<var title="">sh</var> arguments <del class="diff-old">set to zero
or negative values, the method must raise an INDEX_SIZE_ERR
exception.</del> <ins class="diff-chg">are negative.</ins></p>
<p>The <dfn id="putimagedata" title=
"dom-context-2d-putImageData"><code>putImageData( <var title=
"">imagedata</var> , <var title="">dx</var> , <var title=
"">dy</var> , <var title=""><ins class=
"diff-new">dirtyX</ins></var> ,<var title=""><ins class=
"diff-new">dirtyY</ins></var> ,<var title=""><ins class=
"diff-new">dirtyWidth</ins></var> ,<var title=""><ins class=
"diff-new">dirtyHeight</ins></var> )</code></dfn> method
<del class="diff-old">must take the given</del> <ins class=
"diff-chg">writes data from</ins> <code><a href=
"#imagedata">ImageData</a></code> <del class="diff-old">structure,
and place it at the specified location ( dx , dy ) in the canvas
coordinate space, mapping each pixel represented by</del>
<ins class="diff-chg">structures back to</ins> the <del class=
"diff-old">ImageData structure into one device pixel.</del>
<ins class="diff-chg">canvas.</ins></p>
<p>If the first argument to the method is <ins class=
"diff-new">null or</ins> not an <del class="diff-old">object whose
[[Class]] property is</del> <code><a href=
"#imagedata">ImageData</a> <del class="diff-old">, but all of the
following conditions are true,</del></code> <ins class=
"diff-chg">object that was returned by</ins> <code title=
"dom-context-2d-createImageData"><a href=
"#createimagedata"><ins class=
"diff-chg">createImageData()</ins></a></code> <ins class=
"diff-chg">or</ins> <code title=
"dom-context-2d-getImageData"><a href="#getimagedata"><ins class=
"diff-chg">getImageData()</ins></a></code> then the <del class=
"diff-old">method must treat the first argument as if it was
an</del> <code title="dom-context-2d-putImageData"><del class=
"diff-old">ImageData</del> <a href="#putimagedata"><ins class=
"diff-chg">putImageData()</ins></a></code> <del class=
"diff-old">object (and thus not</del> <ins class="diff-chg">method
must</ins> raise <del class="diff-old">the</del> <ins class=
"diff-chg">a</ins> <code>TYPE_MISMATCH_ERR</code> <del class=
"diff-old">exception): The method's first argument is</del>
<ins class="diff-chg">exception.</ins></p>
<p><ins class="diff-chg">If any of the arguments to the method are
infinite or NaN, the method must raise</ins> an <del class=
"diff-old">object with</del> <code><ins class=
"diff-chg">INDEX_SIZE_ERR</ins></code> <ins class=
"diff-chg">exception.</ins></p>
<p><ins class="diff-chg">When the last four arguments are omitted,
they must be assumed to have the values 0, 0, the</ins>
<code title="dom-imagedata-width"><a href=
"#width3">width</a></code> <ins class="diff-new">member of
the</ins> <var title=""><ins class="diff-new">imagedata</ins></var>
<ins class="diff-new">structure,</ins> and <ins class=
"diff-new">the</ins> <code title="dom-imagedata-height"><a href=
"#height2">height</a></code> <del class="diff-old">attributes</del>
<ins class="diff-chg">member of the</ins> <var title=""><ins class=
"diff-chg">imagedata</ins></var> <ins class="diff-chg">structure,
respectively.</ins></p>
<p><ins class="diff-chg">When invoked</ins> with <del class=
"diff-old">integer values and a</del> <ins class=
"diff-chg">arguments that do not, per the last few paragraphs,
cause an exception to be raised, the</ins> <code title=
"dom-context-2d-putImageData"><del class="diff-old">data</del>
<a href="#putimagedata"><ins class=
"diff-chg">putImageData()</ins></a></code> <del class=
"diff-old">attribute whose value</del> <ins class="diff-chg">method
must act as follows:</ins></p>
<ol>
<li>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">dx</ins> <sub><ins class=
"diff-chg">device</ins></sub></var> <ins class="diff-chg">be the
x-coordinate of the device pixel in the underlying pixel data of
the canvas corresponding to the</ins> <var title=""><ins class=
"diff-chg">dx</ins></var> <ins class="diff-chg">coordinate in the
canvas coordinate space.</ins></p>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">dy</ins> <sub><ins class=
"diff-chg">device</ins></sub></var> <ins class="diff-chg">be the
y-coordinate of the device pixel in the underlying pixel data of
the canvas corresponding to the</ins> <var title=""><ins class=
"diff-chg">dy</ins></var> <ins class="diff-chg">coordinate in the
canvas coordinate space.</ins></p>
</li>
<li>
<p><ins class="diff-chg">If</ins> <var title=""><ins class=
"diff-chg">dirtyWidth</ins></var> is <del class="diff-old">an
enumerable list</del> <ins class="diff-chg">negative, let</ins>
<var title=""><ins class="diff-chg">dirtyX</ins></var> <ins class=
"diff-chg">be</ins> <span><var title=""><ins class=
"diff-chg">dirtyX</ins></var> <ins class="diff-chg">+</ins>
<var title=""><ins class="diff-chg">dirtyWidth</ins></var></span>
,<ins class="diff-chg">and let</ins> <var title=""><ins class=
"diff-chg">dirtyWidth</ins></var> <ins class="diff-chg">be equal to
the absolute magnitude</ins> of <del class="diff-old">values that
are either JS Numbers or</del> <var title=""><ins class=
"diff-chg">dirtyWidth</ins></var> .</p>
<p><ins class="diff-chg">If</ins> <var title=""><ins class=
"diff-chg">dirtyHeight</ins></var> <ins class="diff-chg">is
negative, let</ins> <var title=""><ins class=
"diff-chg">dirtyY</ins></var> <ins class="diff-chg">be</ins>
<span><var title=""><ins class="diff-chg">dirtyY</ins></var>
<ins class="diff-chg">+</ins> <var title=""><ins class=
"diff-chg">dirtyHeight</ins></var></span> ,<ins class=
"diff-chg">and let</ins> <var title=""><ins class=
"diff-chg">dirtyHeight</ins></var> <ins class="diff-chg">be equal
to</ins> the <del class="diff-old">JS value undefined .</del>
<ins class="diff-chg">absolute magnitude of</ins> <var title=
""><ins class="diff-chg">dirtyHeight</ins></var> .</p>
</li>
<li><del class="diff-old">The</del>
<p><ins class="diff-chg">If</ins> <var title=""><ins class=
"diff-chg">dirtyX</ins></var> <ins class="diff-chg">is negative,
let</ins> <var title=""><ins class=
"diff-chg">dirtyWidth</ins></var> <ins class="diff-chg">be</ins>
<span><del class="diff-old">ImageData</del> <var title=
""><ins class="diff-chg">dirtyWidth</ins></var> <ins class=
"diff-chg">+</ins> <var title=""><ins class=
"diff-chg">dirtyX</ins></var></span> ,<ins class="diff-chg">and
let</ins> <var title=""><ins class="diff-chg">dirtyX</ins></var>
<ins class="diff-chg">be zero.</ins></p>
<p><ins class="diff-chg">If</ins> <var title=""><ins class=
"diff-chg">dirtyY</ins></var> <ins class="diff-chg">is negative,
let</ins> <var title=""><ins class=
"diff-chg">dirtyHeight</ins></var> <ins class="diff-chg">be</ins>
<span><var title=""><ins class="diff-chg">dirtyHeight</ins></var>
<ins class="diff-chg">+</ins> <var title=""><ins class=
"diff-chg">dirtyY</ins></var></span> ,<ins class="diff-chg">and
let</ins> <var title=""><ins class="diff-chg">dirtyY</ins></var>
<ins class="diff-chg">be zero.</ins></p>
</li>
<li>
<p><ins class="diff-chg">If</ins> <span><var title=""><ins class=
"diff-chg">dirtyX</ins></var> <ins class="diff-chg">+</ins>
<var title=""><ins class="diff-chg">dirtyWidth</ins></var></span>
<ins class="diff-chg">is greater than the</ins> <code title=
"dom-imagedata-width"><a href="#width3"><ins class=
"diff-chg">width</ins></a></code> <del class=
"diff-old">object's</del> <ins class="diff-chg">attribute of
the</ins> <var title=""><ins class="diff-chg">imagedata</ins></var>
<ins class="diff-chg">argument, let</ins> <var title=""><ins class=
"diff-chg">dirtyWidth</ins></var> <ins class="diff-chg">be the
value of that</ins> <code title="dom-imagedata-width"><a href=
"#width3">width</a></code> <ins class="diff-new">attribute, minus
the value of</ins> <var title=""><ins class=
"diff-new">dirtyX</ins></var> .</p>
<p><ins class="diff-new">If</ins> <span><var title=""><ins class=
"diff-new">dirtyY</ins></var> <ins class="diff-new">+</ins>
<var title=""><ins class="diff-new">dirtyHeight</ins></var></span>
is greater than <del class="diff-old">zero. The</del> <ins class=
"diff-chg">the</ins> <code title="dom-imagedata-height"><del class=
"diff-old">ImageData</del> <a href="#height2"><ins class=
"diff-chg">height</ins></a></code> <del class=
"diff-old">object's</del> <ins class="diff-chg">attribute of
the</ins> <var title=""><ins class="diff-chg">imagedata</ins></var>
<ins class="diff-chg">argument, let</ins> <var title=""><ins class=
"diff-chg">dirtyHeight</ins></var> <ins class="diff-chg">be the
value of that</ins> <code title="dom-imagedata-height"><a href=
"#height2">height</a></code> <ins class="diff-new">attribute, minus
the value of</ins> <var title=""><ins class=
"diff-new">dirtyY</ins></var> .</p>
</li>
<li>
<p><ins class="diff-new">If, after those changes, either</ins>
<var title=""><ins class="diff-new">dirtyWidth</ins></var>
<ins class="diff-new">or</ins> <var title=""><ins class=
"diff-new">dirtyHeight</ins></var> is <del class="diff-old">greater
than zero.</del> <ins class="diff-chg">negative or zero, stop these
steps without affecting the canvas.</ins></p>
</li>
<li><del class="diff-old">The</del>
<p><ins class="diff-chg">Otherwise, for all values of</ins>
<var title=""><ins class="diff-chg">x</ins></var> <ins class=
"diff-chg">and</ins> <var title=""><ins class=
"diff-chg">y</ins></var> <ins class="diff-chg">where</ins>
<span><del class="diff-old">ImageData</del> <var title=
""><ins class="diff-chg">dirtyX</ins></var> <ins class=
"diff-chg"> ≤ </ins> <var title=""><ins class=
"diff-chg">x</ins></var> <ins class=
"diff-chg"> < </ins> <span><del class=
"diff-old">object's</del> <var title=""><ins class=
"diff-chg">dirtyX</ins></var> <ins class="diff-chg">+</ins>
<var title=""><ins class="diff-chg">dirtyWidth</ins></var>
<del class="diff-old">width</del></span> <del class=
"diff-old">multiplied by its</del></span> <ins class=
"diff-chg">and</ins> <span><del class="diff-old">height</del>
<var title=""><ins class="diff-chg">dirtyY</ins></var> <ins class=
"diff-chg"> ≤ </ins> <var title=""><ins class=
"diff-chg">y</ins></var> <ins class=
"diff-chg"> < </ins> <span><del class=
"diff-old">multiplied by 4 is equal to</del> <var title=
""><ins class="diff-chg">dirtyY</ins></var> <ins class=
"diff-chg">+</ins> <var title=""><ins class=
"diff-chg">dirtyHeight</ins></var></span></span> ,<ins class=
"diff-chg">copy</ins> the <del class="diff-old">number</del>
<ins class="diff-chg">four channels</ins> of <del class=
"diff-old">entries</del> <ins class="diff-chg">the pixel with
coordinate (</ins> <var title=""><ins class=
"diff-chg">x</ins></var> ,<var title=""><ins class=
"diff-chg">y</ins></var> <ins class="diff-chg">)</ins> in the
<var title=""><ins class="diff-chg">imagedata</ins></var>
<ins class="diff-chg">data structure to the pixel with coordinate
(</ins> <span><del class="diff-old">ImageData</del> <var title=
""><ins class="diff-chg">x</ins> <sub><ins class=
"diff-chg">device</ins></sub> <del class=
"diff-old">object's</del></var> <ins class="diff-chg">+</ins>
<var title=""><ins class="diff-chg">x</ins></var> <del class=
"diff-old">data</del></span> , <span><del class=
"diff-old">property. In the</del> <var title=""><ins class=
"diff-chg">y</ins> <sub><ins class="diff-chg">device</ins></sub>
<del class="diff-old">data</del></var> <ins class=
"diff-chg">+</ins> <var title=""><ins class=
"diff-chg">y</ins></var> <del class="diff-old">property, undefined
values must be treated as zero, any numbers below zero must be
clamped to zero, any numbers above 255 must be clamped to 255, and
any numbers that are not integers must be rounded to</del></span>
<ins class="diff-chg">) in</ins> the <del class="diff-old">nearest
integer using</del> <ins class="diff-chg">underlying pixel data
of</ins> the <del class="diff-old">IEEE 754r roundTiesToEven
rounding mode. [IEEE754R]</del> <ins class=
"diff-chg">canvas.</ins></p>
</li>
</ol>
<p>The handling of pixel rounding when the specified coordinates do
not exactly map to the device coordinate space is not defined by
this specification, except that the following must result in no
visible changes to the rendering:</p>
<pre>
context.putImageData(context.getImageData(x,
y,
w,
h),
x,
y);
</pre>
<p>...for any value of <var title="">x</var> and <var title=
"">y</var> . In other words, while user agents may round the
arguments of the two methods so that they map to device pixel
boundaries, any rounding performed must be performed consistently
for both the <code title="dom-context-2d-getImageData"><a href=
"#getimagedata">getImageData()</a></code> and <code title=
"dom-context-2d-putImageData"><a href=
"#putimagedata">putImageData()</a></code> operations.</p>
<p>The current path, <a href="#transformations0" title=
"dom-context-2d-transformation">transformation matrix</a> ,
<a href="#shadows0" title="shadows">shadow attributes</a> ,
<a href="#globalalpha" title="dom-context-2d-globalAlpha">global
alpha</a> , <ins class="diff-chg">the</ins> <a href="#clipping"
title="clipping region">clipping <del class="diff-old">path</del>
<ins class="diff-chg">region</ins></a> , and <a href=
"#globalcompositeoperation" title=
"dom-context-2d-globalCompositeOperation">global composition
operator</a> must not affect the <code title=
"dom-context-2d-getImageData"><a href=
"#getimagedata">getImageData()</a></code> and <code title=
"dom-context-2d-putImageData"><a href=
"#putimagedata">putImageData()</a></code> methods.</p>
<div class="example">
<p>The data returned by <code title=
"dom-context-2d-getImageData"><a href=
"#getimagedata">getImageData()</a></code> is at the resolution of
the canvas backing store, which is likely to not be one device
pixel to each CSS pixel if the display used is a high resolution
display. Thus, while one could create an <code><a href=
"#imagedata">ImageData</a></code> object, one would not necessarily
know what resolution the canvas expected (how many pixels the
canvas wants to paint over one coordinate space unit pixel).</p>
<p>In the following example, the script first obtains the size of
the canvas backing store, and then generates a few new
<code><a href="#imagedata">ImageData</a></code> objects which can
be used.</p>
<pre>
// canvas is a reference to a <canvas> element
<del class=
"diff-old"> // (note: this example uses JavaScript 1.7 features)
</del>
var context = canvas.getContext('2d');
<del class=
"diff-old"> var backingStore = context.getImageData(0, 0, canvas.width, canvas.height);
var actualWidth = backingStore.width;
var actualHeight = backingStore.height;
function CreateImageData(w, h) {
return {
height: h,
width: w,
data: [i for (i in function (n) { for (let i = 0; i < n; i += 1) yield 0 }(w*h*4)) ]
};
}
</del>
// create a blank slate
<del class=
"diff-old"> var data = CreateImageData(actualWidth, actualHeight);
</del>
<ins class=
"diff-chg"> var data = context.createImageData(canvas.width, canvas.height);
</ins>
// create some plasma
FillPlasma(data, 'green'); // green plasma
// add a cloud to the plasma
<del class=
"diff-old"> AddCloud(data, actualWidth/2, actualHeight/2); // put a cloud in the middle
</del>
<ins class=
"diff-chg"> AddCloud(data, data.width/2, data.height/2); // put a cloud in the middle
</ins>
// paint the plasma+cloud on the canvas
context.putImageData(data, 0, 0);
// support methods
function FillPlasma(data, color) { ... }
<del class="diff-old"> function AddCload(data, x, y) { ... }
</del>
<ins class="diff-chg"> function AddCloud(data, x, y) { ... }
</ins>
</pre></div>
<div class="example">
<p>Here is an example of using <code title=
"dom-context-2d-getImageData"><a href=
"#getimagedata">getImageData()</a></code> and <code title=
"dom-context-2d-putImageData"><a href=
"#putimagedata">putImageData()</a></code> to implement an edge
detection filter.</p>
<pre>
<!DOCTYPE HTML>
<html>
<head>
<title>Edge detection demo</title>
<script>
var image = new Image();
function init() {
image.onload = demo;
image.src = "image.jpeg";
}
function demo() {
var canvas = document.getElementsByTagName('canvas')[0];
var context = canvas.getContext('2d');
// draw the image onto the canvas
context.drawImage(image, 0, 0);
// get the image data to manipulate
var input = context.getImageData(0, 0, canvas.width, canvas.height);
<del class="diff-old"> // edge detection
</del>
<ins class=
"diff-chg"> // get an empty slate to put the data into
var output = context.crateImageData(canvas.width, canvas.height);
// alias some variables for convenience
</ins>
// notice that we are using input.width and input.height here
// as they might not be the same as canvas.width and canvas.height
// (in particular, they might be different on high-res displays)
var w = input.width, h = input.height;
var inputData = input.data;
<del class="diff-old"> var outputData = new Array(w*h*4);
</del>
<ins class="diff-chg"> var outputData = output.data;
// edge detection
</ins>
for (var y = 1; y < h-1; y += 1) {
for (var x = 1; x < w-1; x += 1) {
for (var c = 0; c < 3; c += 1) {
var i = (y*w + x)*4 + c;
outputData[i] = 127 + -inputData[i - w*4 - 4] - inputData[i - w*4] - inputData[i - w*4 + 4] +
-inputData[i - 4] + 8*inputData[i] - inputData[i + 4] +
-inputData[i + w*4 - 4] - inputData[i + w*4] - inputData[i + w*4 + 4];
}
outputData[(y*w + x)*4 + 3] = 255; // alpha
}
}
// put the image data back after manipulation
<del class="diff-old"> var output = {
width: w,
height: h,
data: outputData
};
</del>
context.putImageData(output, 0, 0);
}
</script>
</head>
<body onload="init()">
<canvas></canvas>
</body>
</html>
</pre></div>
<h6 id="drawing"><span class="secno"><del class=
"diff-old">3.14.11.1.11.</del> <ins class=
"diff-chg">3.12.11.1.12.</ins></span> Drawing model</h6>
<p>When a shape or image is painted, user agents must follow these
steps, in the order given (or act as if they do):</p>
<ol>
<li>
<p>Render the shape or image, creating image <var title="">A</var>
, as described in the previous sections. For shapes, the current
fill, stroke, and line styles must be <del class=
"diff-old">honoured,</del> <ins class="diff-chg">honored,</ins> and
the stroke must itself also be subjected to the current
transformation matrix.</p>
</li>
<li>
<p>If shadows are supported:</p>
<ol>
<li>
<p>Render the shadow from image <var title="">A</var> , using the
current shadow styles, creating image <var title="">B</var> .</p>
</li>
<li>
<p>Multiply the alpha component of every pixel in <var title=
"">B</var> by <code title="dom-context-2d-globalAlpha"><a href=
"#globalalpha">globalAlpha</a></code> .</p>
</li>
<li>
<p>Within the clipping <del class="diff-old">path,</del>
<ins class="diff-chg">region,</ins> composite <var title="">B</var>
over the current canvas bitmap using the current composition
operator.</p>
</li>
</ol>
</li>
<li>
<p>Multiply the alpha component of every pixel in <var title=
"">A</var> by <code title="dom-context-2d-globalAlpha"><a href=
"#globalalpha">globalAlpha</a></code> .</p>
</li>
<li>
<p>Within the clipping <del class="diff-old">path,</del>
<ins class="diff-chg">region,</ins> composite <var title="">A</var>
over the current canvas bitmap using the current composition
operator.</p>
</li>
</ol>
<h5 id="color"><span class="secno"><del class=
"diff-old">3.14.11.2.</del> <ins class=
"diff-chg">3.12.11.2.</ins></span> Color spaces and color
correction</h5>
<p>The <code><a href="#canvas">canvas</a></code> APIs must perform
<del class="diff-old">colour</del> <ins class=
"diff-chg">color</ins> correction at only two points: when
rendering images with their own gamma correction <ins class=
"diff-new">and color space</ins> information onto the canvas, to
convert the image to the color space used by the canvas (e.g. using
the <code title="dom-context-2d-drawImage"><a href=
"#drawimage">drawImage()</a></code> method with an <code><a href=
"#htmlimageelement">HTMLImageElement</a></code> object), and when
rendering the actual canvas bitmap to the output device.</p>
<p class="note">Thus, in the 2D context, colors used to draw shapes
onto the canvas will exactly match colors obtained through the
<code title="dom-context-2d-getImageData"><a href=
"#getimagedata">getImageData()</a></code> method.</p>
<p>The <code title="dom-canvas-toDataURL"><a href=
"#todataurl">toDataURL()</a></code> method must not include color
space information in the resource returned. <ins class=
"diff-new">Where the output format allows it, the color of pixels
in resources created by</ins> <code title=
"dom-canvas-toDataURL"><a href="#todataurl"><ins class=
"diff-new">toDataURL()</ins></a></code> <ins class="diff-new">must
match those returned by the</ins> <code title=
"dom-context-2d-getImageData"><a href="#getimagedata"><ins class=
"diff-new">getImageData()</ins></a></code> <ins class=
"diff-new">method.</ins></p>
<p>In user agents that support CSS, the color space used by a
<code><a href="#canvas">canvas</a></code> element must match the
color space used for processing any colors for that element in
CSS.</p>
<p><ins class="diff-new">The gamma correction and color space
information of images must be handled in such a way that an image
rendered directly using an</ins> <code><a href="#img"><ins class=
"diff-new">img</ins></a></code> <ins class="diff-new">element would
use the same colors as one painted on a</ins> <code><a href=
"#canvas"><ins class="diff-new">canvas</ins></a></code> <ins class=
"diff-new">element that is then itself rendered. Furthermore, the
rendering of images that have no color correction information (such
as those returned by the</ins> <code title=
"dom-canvas-toDataURL"><a href="#todataurl"><ins class=
"diff-new">toDataURL()</ins></a></code> <ins class=
"diff-new">method) must be rendered with no color
correction.</ins></p>
<p class="note"><ins class="diff-new">Thus, in the 2D context,
calling the</ins> <code title="dom-context-2d-drawImage"><a href=
"#drawimage"><ins class="diff-new">drawImage()</ins></a></code>
<ins class="diff-new">method to render the output of the</ins>
<code title="dom-canvas-toDataURL"><a href="#todataurl"><ins class=
"diff-new">toDataURL()</ins></a></code> <ins class=
"diff-new">method to the canvas, given the appropriate dimensions,
has no visible effect.</ins></p>
<h5 id="security1"><span class="secno"><ins class=
"diff-new">3.12.11.3.</ins></span> <ins class="diff-new">Security
with</ins> <code><a href="#canvas"><ins class=
"diff-new">canvas</ins></a></code> <ins class=
"diff-new">elements</ins></h5>
<p><strong><ins class="diff-new">Information leakage</ins></strong>
<ins class="diff-new">can occur if scripts from one</ins> <a href=
"#origin0"><ins class="diff-new">origin</ins></a> <ins class=
"diff-new">are exposed to images from another origin (one that
isn't the</ins> <a href="#same-origin" title=
"same origin"><ins class="diff-new">same</ins></a> <ins class=
"diff-new">).</ins></p>
<p><ins class="diff-new">To mitigate this,</ins> <code><a href=
"#canvas"><ins class="diff-new">canvas</ins></a></code> <ins class=
"diff-new">elements are defined to have a flag indicating whether
they are</ins> <i><ins class="diff-new">origin-clean</ins></i>
.<ins class="diff-new">All</ins> <code><a href=
"#canvas"><ins class="diff-new">canvas</ins></a></code> <ins class=
"diff-new">elements must start with their</ins> <i><ins class=
"diff-new">origin-clean</ins></i> <ins class="diff-new">set to
true. The flag must be set to false if any of the following actions
occur:</ins></p>
<ul>
<li>
<p><ins class="diff-new">The element's 2D context's</ins>
<code title="dom-context-2d-drawImage"><a href=
"#drawimage"><ins class="diff-new">drawImage()</ins></a></code>
<ins class="diff-new">method is called with an</ins> <code><a href=
"#htmlimageelement"><ins class=
"diff-new">HTMLImageElement</ins></a></code> <ins class=
"diff-new">whose</ins> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> <ins class="diff-new">is not the</ins>
<a href="#same-origin" title="same origin"><ins class=
"diff-new">same</ins></a> <ins class="diff-new">as that of
the</ins> <code><ins class="diff-new">Document</ins></code>
<ins class="diff-new">object that owns the</ins> <code><a href=
"#canvas"><ins class="diff-new">canvas</ins></a></code> <ins class=
"diff-new">element.</ins></p>
</li>
<li>
<p><ins class="diff-new">The element's 2D context's</ins>
<code title="dom-context-2d-drawImage"><a href=
"#drawimage"><ins class="diff-new">drawImage()</ins></a></code>
<ins class="diff-new">method is called with an</ins> <code><a href=
"#htmlcanvaselement"><ins class=
"diff-new">HTMLCanvasElement</ins></a></code> <ins class=
"diff-new">whose</ins> <i><ins class=
"diff-new">origin-clean</ins></i> <ins class="diff-new">flag is
false.</ins></p>
</li>
<li>
<p><ins class="diff-new">The element's 2D context's</ins>
<code title="dom-context-2d-fillStyle"><a href=
"#fillstyle"><ins class="diff-new">fillStyle</ins></a></code>
<ins class="diff-new">attribute is set to a</ins> <code><a href=
"#canvaspattern0"><ins class=
"diff-new">CanvasPattern</ins></a></code> <ins class=
"diff-new">object that was created from an</ins> <code><a href=
"#htmlimageelement"><ins class=
"diff-new">HTMLImageElement</ins></a></code> <ins class=
"diff-new">whose</ins> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> <ins class="diff-new">is not the</ins>
<a href="#same-origin" title="same origin"><ins class=
"diff-new">same</ins></a> <ins class="diff-new">as that of
the</ins> <code><ins class="diff-new">Document</ins></code>
<ins class="diff-new">object that owns the</ins> <code><a href=
"#canvas"><ins class="diff-new">canvas</ins></a></code> <ins class=
"diff-new">element.</ins></p>
</li>
<li>
<p><ins class="diff-new">The element's 2D context's</ins>
<code title="dom-context-2d-fillStyle"><a href=
"#fillstyle"><ins class="diff-new">fillStyle</ins></a></code>
<ins class="diff-new">attribute is set to a</ins> <code><a href=
"#canvaspattern0"><ins class=
"diff-new">CanvasPattern</ins></a></code> <ins class=
"diff-new">object that was created from an</ins> <code><a href=
"#htmlcanvaselement"><ins class=
"diff-new">HTMLCanvasElement</ins></a></code> <ins class=
"diff-new">whose</ins> <i><ins class=
"diff-new">origin-clean</ins></i> <ins class="diff-new">flag is
false.</ins></p>
</li>
<li>
<p><ins class="diff-new">The element's 2D context's</ins>
<code title="dom-context-2d-strokeStyle"><a href=
"#strokestyle"><ins class="diff-new">strokeStyle</ins></a></code>
<ins class="diff-new">attribute is set to a</ins> <code><a href=
"#canvaspattern0"><ins class=
"diff-new">CanvasPattern</ins></a></code> <ins class=
"diff-new">object that was created from an</ins> <code><a href=
"#htmlimageelement"><ins class=
"diff-new">HTMLImageElement</ins></a></code> <ins class=
"diff-new">whose</ins> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> <ins class="diff-new">is not the</ins>
<a href="#same-origin" title="same origin"><ins class=
"diff-new">same</ins></a> <ins class="diff-new">as that of
the</ins> <code><ins class="diff-new">Document</ins></code>
<ins class="diff-new">object that owns the</ins> <code><a href=
"#canvas"><ins class="diff-new">canvas</ins></a></code> <ins class=
"diff-new">element.</ins></p>
</li>
<li>
<p><ins class="diff-new">The element's 2D context's</ins>
<code title="dom-context-2d-strokeStyle"><a href=
"#strokestyle"><ins class="diff-new">strokeStyle</ins></a></code>
<ins class="diff-new">attribute is set to a</ins> <code><a href=
"#canvaspattern0"><ins class=
"diff-new">CanvasPattern</ins></a></code> <ins class=
"diff-new">object that was created from an</ins> <code><a href=
"#htmlcanvaselement"><ins class=
"diff-new">HTMLCanvasElement</ins></a></code> <ins class=
"diff-new">whose</ins> <i><ins class=
"diff-new">origin-clean</ins></i> <ins class="diff-new">flag is
false.</ins></p>
</li>
</ul>
<p><ins class="diff-new">Whenever the</ins> <code title=
"dom-canvas-toDataURL"><a href="#todataurl"><ins class=
"diff-new">toDataURL()</ins></a></code> <ins class=
"diff-new">method of a</ins> <code><a href="#canvas"><ins class=
"diff-new">canvas</ins></a></code> <ins class="diff-new">element
whose</ins> <i><ins class="diff-new">origin-clean</ins></i>
<ins class="diff-new">flag is set to false is called, the method
must immediately raise a security exception.</ins></p>
<p><ins class="diff-new">Whenever the</ins> <code title=
"dom-context-2d-getImageData"><a href="#getimagedata"><ins class=
"diff-new">getImageData()</ins></a></code> <ins class=
"diff-new">method of the 2D context of a</ins> <code><a href=
"#canvas"><ins class="diff-new">canvas</ins></a></code> <ins class=
"diff-new">element whose</ins> <i><ins class=
"diff-new">origin-clean</ins></i> <ins class="diff-new">flag is set
to false is called, the method must immediately raise a security
exception.</ins></p>
<h4 id="the-map"><span class="secno"><del class=
"diff-old">3.14.12.</del> <ins class=
"diff-chg">3.12.12</ins></span> The <dfn id=
"map"><code>map</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Element-specific attributes:</dt>
<dd><del class="diff-old">None, but the</del> <del class=
"diff-old">id</del> <code title="attr-map-name"><a href=
"#name7"><ins class="diff-chg">name</ins></a></code> <del class=
"diff-old">global attribute has special requirements on this
element.</del></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id="htmlmapelement">HTMLMapElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
<ins class="diff-new"> attribute DOMString <a href=
"#name8" title="dom-map-name">name</a>;
</ins>
readonly attribute <a href=
"#htmlcollection0">HTMLCollection</a> <a href="#areas" title=
"dom-map-areas">areas</a>;
readonly attribute <a href=
"#htmlcollection0">HTMLCollection</a> <a href="#images1" title=
"dom-map-images">images</a>;
};
</pre></dd>
</dl>
<p>The <code><a href="#map">map</a></code> element, in <del class=
"diff-old">conjuction</del> <ins class="diff-chg">conjunction</ins>
with any <code><a href="#area">area</a></code> element descendants,
defines an <a href="#image">image map</a> .</p>
<p><del class="diff-old">There</del> <ins class=
"diff-chg">The</ins> <dfn id="name7" title=
"attr-map-name"><code><ins class="diff-chg">name</ins></code></dfn>
<ins class="diff-chg">attribute gives the map a name so that it can
be referenced. The attribute</ins> must <del class=
"diff-old">always</del> be <del class="diff-old">an</del>
<ins class="diff-chg">present and must have a non-empty value.
Whitespace is significant in this attribute's value. If the</ins>
<code title="attr-id"><a href="#id">id</a></code> attribute
<del class="diff-old">present on map elements.</del> <ins class=
"diff-chg">is also specified, both attributes must have the same
value.</ins></p>
<p>The <dfn id="areas" title=
"dom-map-areas"><code>areas</code></dfn> attribute must return an
<code><a href="#htmlcollection0">HTMLCollection</a></code> rooted
at the <code><a href="#map">map</a></code> element, whose filter
matches only <code><a href="#area">area</a></code> elements.</p>
<p>The <dfn id="images1" title=
"dom-map-images"><code>images</code></dfn> attribute must return an
<code><a href="#htmlcollection0">HTMLCollection</a></code> rooted
at the <code>Document</code> node, whose filter matches only
<code><a href="#img">img</a></code> and <code><a href=
"#object">object</a></code> elements that are associated with this
<code><a href="#map">map</a></code> element according to the
<a href="#image">image map</a> processing model.</p>
<p><ins class="diff-new">The DOM attribute</ins> <dfn id="name8"
title="dom-map-name"><code><ins class=
"diff-new">name</ins></code></dfn> <ins class="diff-new">must</ins>
<a href="#reflect"><ins class="diff-new">reflect</ins></a>
<ins class="diff-new">the content attribute of the same
name.</ins></p>
<h4 id="the-area"><span class="secno"><del class=
"diff-old">3.14.13.</del> <ins class=
"diff-chg">3.12.13</ins></span> The <dfn id=
"area"><code>area</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#phrasing0">phrasing content</a> is expected,
but only if there is a <code><a href="#map">map</a></code> element
ancestor.</dd>
<dt>Content model:</dt>
<dd>Empty.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-area-alt"><a href="#alt1">alt</a></code></dd>
<dd><code title="attr-area-coords"><a href=
"#coords">coords</a></code></dd>
<dd><code title="attr-area-shape"><a href=
"#shape">shape</a></code></dd>
<dd><code title="attr-hyperlink-href"><a href=
"#href6">href</a></code></dd>
<dd><code title="attr-hyperlink-target"><a href=
"#target3">target</a></code></dd>
<dd><code title="attr-hyperlink-ping"><a href=
"#ping">ping</a></code></dd>
<dd><code title="attr-hyperlink-rel"><a href=
"#rel3">rel</a></code></dd>
<dd><code title="attr-hyperlink-media"><a href=
"#media12">media</a></code></dd>
<dd><code title="attr-hyperlink-hreflang"><a href=
"#hreflang3">hreflang</a></code></dd>
<dd><code title="attr-hyperlink-type"><a href=
"#type17">type</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlareaelement">HTMLAreaElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#alt2" title=
"dom-area-alt">alt</a>;
attribute DOMString <a href="#coords0" title=
"dom-area-coords">coords</a>;
attribute DOMString <a href="#shape0" title=
"dom-area-shape">shape</a>;
attribute DOMString <a href="#href4" title=
"dom-area-href">href</a>;
attribute DOMString <a href="#target2" title=
"dom-area-target">target</a>;
attribute DOMString <a href="#ping1" title=
"dom-area-ping">ping</a>;
attribute DOMString <a href="#rel2" title=
"dom-area-rel">rel</a>;
readonly attribute DOMTokenList <a href="#rellist1" title=
"dom-area-relList">relList</a>;
attribute DOMString <a href="#media11" title=
"dom-area-media">media</a>;
attribute DOMString <a href="#hreflang2" title=
"dom-area-hreflang">hreflang</a>;
attribute DOMString <a href="#type10" title=
"dom-area-type">type</a>;
};
</pre></dd>
</dl>
<p>The <code><a href="#area">area</a></code> element represents
either a hyperlink with some text and a corresponding area on an
<a href="#image">image map</a> , or a dead area on an image
map.</p>
<p>If the <code><a href="#area">area</a></code> element has an
<code title="attr-hyperlink-href"><a href="#href6">href</a></code>
attribute, then the <code><a href="#area">area</a></code> element
represents a <a href="#hyperlinks">hyperlink</a> ; the <dfn id=
"alt1" title="attr-area-alt"><code>alt</code></dfn> attribute,
which must then be present, specifies the text.</p>
<p>However, if the <code><a href="#area">area</a></code> element
has no <code title="attr-hyperlink-href"><a href=
"#href6">href</a></code> attribute, then the area represented by
the element cannot be selected, and the <code title=
"attr-area-alt"><a href="#alt1">alt</a></code> attribute must be
omitted.</p>
<p>In both cases, the <code title="attr-area-shape"><a href=
"#shape">shape</a></code> and <code title=
"attr-area-coords"><a href="#coords">coords</a></code> attributes
specify the area.</p>
<p>The <dfn id="shape" title=
"attr-area-shape"><code>shape</code></dfn> attribute is an <a href=
"#enumerated">enumerated attribute</a> . The following table lists
the keywords defined for this attribute. The states given in the
first cell of the <del class="diff-old">the</del> rows with
keywords give the states to which those keywords map. Some of the
keywords are non-conforming, as noted in the last column.</p>
<table>
<thead>
<tr>
<th>State</th>
<th>Keywords</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2"><dfn id="circle" title=
"attr-area-shape-circle">Circle state</dfn></td>
<td><code title="">circ</code></td>
<td>Non-conforming</td>
</tr>
<tr>
<td><code title="">circle</code></td>
<td></td>
</tr>
<tr>
<td><dfn id="default0" title="attr-area-shape-default">Default
state</dfn></td>
<td><code title="">default</code></td>
<td></td>
</tr>
<tr>
<td rowspan="2"><dfn id="polygon" title=
"attr-area-shape-poly">Polygon state</dfn></td>
<td><code title="">poly</code></td>
<td></td>
</tr>
<tr>
<td><code title="">polygon</code></td>
<td>Non-conforming</td>
</tr>
<tr>
<td rowspan="2"><dfn id="rectangle" title=
"attr-area-shape-rect">Rectangle state</dfn></td>
<td><code title="">rect</code></td>
<td></td>
</tr>
<tr>
<td><code title="">rectangle</code></td>
<td>Non-conforming</td>
</tr>
</tbody>
</table>
<p>The attribute may be <del class="diff-old">ommited.</del>
<ins class="diff-chg">omitted.</ins> The <i>missing value
default</i> is the <a href="#rectangle" title=
"attr-area-shape-rect">rectangle</a> state.</p>
<p>The <dfn id="coords" title=
"attr-area-coords"><code>coords</code></dfn> attribute must, if
specified, contain a <a href="#valid4">valid list of integers</a> .
This attribute gives the coordinates for the shape described by the
<code title="attr-area-shape"><a href="#shape">shape</a></code>
attribute. The processing for this attribute is described as part
of the <a href="#image">image map</a> processing model.</p>
<p>In the <a href="#circle" title="attr-area-shape-circle">circle
state</a> , <code><a href="#area">area</a></code> elements must
have a <code title="attr-area-coords"><a href=
"#coords">coords</a></code> attribute present, with three integers,
the last of which must be non-negative. The first integer must be
the distance in CSS pixels from the left edge of the image to the
center of the circle, the second integer must be the distance in
CSS pixels from the top edge of the image to the center of the
circle, and the third integer must be the radius of the circle,
again in CSS pixels.</p>
<p>In the <a href="#default0" title=
"attr-area-shape-default">default state</a> state, <code><a href=
"#area">area</a></code> elements must not have a <code title=
"attr-area-coords"><a href="#coords">coords</a></code>
attribute.</p>
<p>In the <a href="#polygon" title="attr-area-shape-poly">polygon
state</a> , <code><a href="#area">area</a></code> elements must
have a <code title="attr-area-coords"><a href=
"#coords">coords</a></code> attribute with at least six integers,
and the number of integers must be even. Each pair of integers must
represent a coordinate given as the distances from the left and the
top of the image in CSS pixels respectively, and all the
coordinates together must represent the points of the polygon, in
order.</p>
<p>In the <a href="#rectangle" title=
"attr-area-shape-rect">rectangle state</a> , <code><a href=
"#area">area</a></code> elements must have a <code title=
"attr-area-coords"><a href="#coords">coords</a></code> attribute
with exactly four integers, the first of which must be less than
the third, and the second of which must be less than the fourth.
The four points must represent, respectively, the distance from the
left edge of the image to the top left side of the rectangle, the
distance from the top edge to the top side, the distance from the
left edge to the right side, and the distance from the top edge to
the bottom side, all in CSS pixels.</p>
<p>When user agents allow users to <a href="#following0" title=
"following hyperlinks">follow hyperlinks</a> created using the
<code><a href="#area">area</a></code> element, as described in the
next section, the <code title="attr-hyperlink-href"><a href=
"#href6">href</a></code> , <code title=
"attr-hyperlink-target"><a href="#target3">target</a></code> and
<code title="attr-hyperlink-ping"><a href="#ping">ping</a></code>
attributes decide how the link is followed. The <code title=
"attr-hyperlink-rel"><a href="#rel3">rel</a></code> , <code title=
"attr-hyperlink-media"><a href="#media12">media</a></code> ,
<code title="attr-hyperlink-hreflang"><a href=
"#hreflang3">hreflang</a></code> , and <code title=
"attr-hyperlink-type"><a href="#type17">type</a></code> attributes
may be used to indicate to the user the likely nature of the target
resource before the user follows the link.</p>
<p>The <code title="attr-hyperlink-target"><a href=
"#target3">target</a></code> , <code title=
"attr-hyperlink-ping"><a href="#ping">ping</a></code> ,
<code title="attr-hyperlink-rel"><a href="#rel3">rel</a></code> ,
<code title="attr-hyperlink-media"><a href=
"#media12">media</a></code> , <code title=
"attr-hyperlink-hreflang"><a href="#hreflang3">hreflang</a></code>
, and <code title="attr-hyperlink-type"><a href=
"#type17">type</a></code> attributes must be omitted if the
<code title="attr-hyperlink-href"><a href="#href6">href</a></code>
attribute is not present.</p>
<p>The <a href="#activation0">activation behavior</a> of
<code><a href="#area">area</a></code> elements is to run the
following steps:</p>
<ol>
<li>If the <code title="event-DOMActivate">DOMActivate</code> event
in question is not <span title=
"concept-events-trusted">trusted</span> (i.e. a <code title=
"dom-click"><a href="#click">click()</a></code> method call was the
reason for the event being dispatched), and the <code><a href=
"#area">area</a></code> element's <code title=
"attr-area-target">target</code> attribute is <span class=
"big-issue">...</span> then raise an
<code>INVALID_ACCESS_ERR</code> exception.</li>
<li>Otherwise, the user agent must <a href="#following0" title=
"following hyperlinks">follow the hyperlink</a> defined by the
<code><a href="#area">area</a></code> element, if any.</li>
</ol>
<p class="note">One way that a user agent can enable users to
follow hyperlinks is by allowing <code><a href=
"#area">area</a></code> elements to be clicked, or focussed and
activated by the keyboard. This <span title=
"interactive elements">will cause</span> the aforementioned
<a href="#activation0">activation behavior</a> to be invoked.</p>
<p>The DOM attributes <dfn id="alt2" title=
"dom-area-alt"><code>alt</code></dfn> , <dfn id="coords0" title=
"dom-area-coords"><code>coords</code></dfn> , <del class=
"diff-old">shape ,</del> <dfn id="href4" title=
"dom-area-href"><code>href</code></dfn> , <dfn id="target2" title=
"dom-area-target"><code>target</code></dfn> , <dfn id="ping1"
title="dom-area-ping"><code>ping</code></dfn> , <dfn id="rel2"
title="dom-area-rel"><code>rel</code></dfn> , <dfn id="media11"
title="dom-area-media"><code>media</code></dfn> , <dfn id=
"hreflang2" title="dom-area-hreflang"><code>hreflang</code></dfn> ,
and <dfn id="type10" title="dom-area-type"><code>type</code></dfn>
, each must <a href="#reflect">reflect</a> the respective content
attributes of the same name.</p>
<p>The DOM attribute <dfn id="shape0" title=
"dom-area-shape"><code><ins class=
"diff-new">shape</ins></code></dfn> <ins class=
"diff-new">must</ins> <a href="#reflect"><ins class=
"diff-new">reflect</ins></a> <ins class="diff-new">the</ins>
<code title="attr-area-shape"><a href="#shape"><ins class=
"diff-new">shape</ins></a></code> <ins class="diff-new">content
attribute,</ins> <a href="#limited0"><ins class="diff-new">limited
to only known values</ins></a> .</p>
<p><ins class="diff-new">The DOM attribute</ins> <dfn id="rellist1"
title="dom-area-rellist"><code>relList</code></dfn> must <a href=
"#reflect">reflect</a> the <code title=
"attr-hyperlink-rel"><a href="#rel3">rel</a></code> content
attribute.</p>
<h4 id="image-maps"><span class="secno"><del class=
"diff-old">3.14.14.</del> <ins class=
"diff-chg">3.12.14</ins></span> Image maps</h4>
<p>An <dfn id="image">image map</dfn> allows geometric areas on an
image to be associated with <a href="#hyperlinks" title=
"hyperlink">hyperlinks</a> .</p>
<p>An image, in the form of an <code><a href="#img">img</a></code>
element or an <code><a href="#object">object</a></code> element
representing an image, may be associated with an image map (in the
form of a <code><a href="#map">map</a></code> element) by
specifying a <dfn id="usemap1" title=
"attr-hyperlink-usemap"><code>usemap</code></dfn> attribute on the
<code><a href="#img">img</a></code> or <code><a href=
"#object">object</a></code> element. The <code title=
"attr-area-usemap">usemap</code> attribute, if specified, must be a
<a href="#valid7">valid <del class="diff-old">hashed ID</del>
<ins class="diff-chg">hash-name</ins> reference</a> to a
<code><a href="#map">map</a></code> element.</p>
<p>If an <code><a href="#img">img</a></code> element or an
<code><a href="#object">object</a></code> element representing an
image has a <code title="attr-area-usemap">usemap</code> attribute
specified, user agents must process it as follows:</p>
<ol>
<li>
<p>First, <a href="#rules5">rules for parsing a <del class=
"diff-old">hashed ID</del> <ins class="diff-chg">hash-name</ins>
reference</a> to a <code><a href="#map">map</a></code> element must
be followed. This will return either an element (the <var title=
"">map</var> ) or null.</p>
</li>
<li>
<p>If that returned null, then abort these steps. The image is not
associated with an image map after all.</p>
</li>
<li>
<p>Otherwise, the user agent must collect all the <code><a href=
"#area">area</a></code> elements that are descendants of the
<var title="">map</var> . Let those be the <var title=
"">areas</var> .</p>
</li>
</ol>
<p>Having obtained the list of <code><a href=
"#area">area</a></code> elements that form the image map (the
<var title="">areas</var> ), interactive user agents must process
the list in one of two ways.</p>
<p>If the user agent intends to show the text that the
<code><a href="#img">img</a></code> element represents, then it
must use the following steps.</p>
<p class="note">In user agents that do not support images, or that
have images disabled, <code><a href="#object">object</a></code>
elements cannot represent images, and thus this section never
applies (the <a href="#fallback">fallback content</a> is shown
instead). The following steps therefore only apply to
<code><a href="#img">img</a></code> elements.</p>
<ol>
<li>
<p>Remove all the <code><a href="#area">area</a></code> elements in
<var title="">areas</var> that have no <code title=
"attr-hyperlink-href"><a href="#href6">href</a></code>
attribute.</p>
</li>
<li>
<p>Remove all the <code><a href="#area">area</a></code> elements in
<var title="">areas</var> that have no <code title=
"attr-area-alt"><a href="#alt1">alt</a></code> attribute, or whose
<code title="attr-area-alt"><a href="#alt1">alt</a></code>
attribute's value is the empty string, <em>if</em> there is another
<code><a href="#area">area</a></code> element in <var title=
"">areas</var> with the same value in the <code title=
"attr-hyperlink-href"><a href="#href6">href</a></code> attribute
and with a non-empty <code title="attr-area-alt"><a href=
"#alt1">alt</a></code> attribute.</p>
</li>
<li>
<p>Each remaining <code><a href="#area">area</a></code> element in
<var title="">areas</var> represents a <a href=
"#hyperlinks">hyperlink</a> . Those hyperlinks should all be made
available to the user in a manner associated with the text of the
<code><a href="#img">img</a> <del class="diff-old">or input
element.</del></code> .</p>
<p>In this context, user agents may represent <code><a href=
"#area">area</a></code> and <code><a href="#img">img</a></code>
elements with no specified <code title="">alt</code> attributes, or
whose <code title="">alt</code> attributes are the empty string or
some other non-visible text, in a user-agent-defined fashion
intended to indicate the lack of suitable author-provided text.</p>
</li>
</ol>
<p>If the user agent intends to show the image and allow
interaction with the image to select hyperlinks, then the image
must be associated with a set of layered shapes, taken from the
<code><a href="#area">area</a></code> elements in <var title=
"">areas</var> , in reverse tree order (so the last specified
<code><a href="#area">area</a></code> element in the <var title=
"">map</var> is the bottom-most shape, and the first element in the
<var title="">map</var> , in tree order, is the top-most
shape).</p>
<p>Each <code><a href="#area">area</a></code> element in
<var title="">areas</var> must be processed as follows to obtain a
shape to layer onto the image:</p>
<ol>
<li>
<p>Find the state that the element's <code title=
"attr-area-shape"><a href="#shape">shape</a></code> attribute
represents.</p>
</li>
<li>
<p>Use the <a href="#rules3">rules for parsing a list of
integers</a> to parse the element's <code title=
"attr-area-coords"><a href="#coords">coords</a></code> attribute,
if it is present, and let the result be the <var title=
"">coords</var> list. If the attribute is absent, let the
<var title="">coords</var> list be the empty list.</p>
</li>
<li>
<p>If the number of items in the <var title="">coords</var> list is
less than the minimum number given for the <code><a href=
"#area">area</a></code> element's current state, as per the
following table, then the shape is empty; abort these steps.</p>
<table>
<thead>
<tr>
<th>State</th>
<th>Minimum number of items</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#circle" title="attr-area-shape-circle">Circle
state</a></td>
<td>3</td>
</tr>
<tr>
<td><a href="#default0" title="attr-area-shape-default">Default
state</a></td>
<td>0</td>
</tr>
<tr>
<td><a href="#polygon" title="attr-area-shape-poly">Polygon
state</a></td>
<td>6</td>
</tr>
<tr>
<td><a href="#rectangle" title="attr-area-shape-rect">Rectangle
state</a></td>
<td>4</td>
</tr>
</tbody>
</table>
</li>
<li>
<p>Check for excess items in the <var title="">coords</var> list as
per the entry in the following list corresponding to the
<code title="attr-area-shape"><a href="#shape">shape</a></code>
attribute's state:</p>
<dl class="switch">
<dt><a href="#circle" title="attr-area-shape-circle">Circle
state</a></dt>
<dd>Drop any items in the list beyond the third.</dd>
<dt><a href="#default0" title="attr-area-shape-default">Default
state</a></dt>
<dd>Drop all items in the list.</dd>
<dt><a href="#polygon" title="attr-area-shape-poly">Polygon
state</a></dt>
<dd>Drop the last item if there's an odd number of items.</dd>
<dt><a href="#rectangle" title="attr-area-shape-rect">Rectangle
state</a></dt>
<dd>Drop any items in the list beyond the fourth.</dd>
</dl>
</li>
<li>
<p>If the <code title="attr-area-shape"><a href=
"#shape">shape</a></code> attribute represents the <a href=
"#rectangle" title="attr-area-shape-rect">rectangle state</a> , and
the first number in the list is numerically less than the third
number in the list, then swap those two numbers around.</p>
</li>
<li>
<p>If the <code title="attr-area-shape"><a href=
"#shape">shape</a></code> attribute represents the <a href=
"#rectangle" title="attr-area-shape-rect">rectangle state</a> , and
the second number in the list is numerically less than the fourth
number in the list, then swap those two numbers around.</p>
</li>
<li>
<p>If the <code title="attr-area-shape"><a href=
"#shape">shape</a></code> attribute represents the <a href=
"#circle" title="attr-area-shape-circle">circle state</a> , and the
third number in the list is less than or equal to zero, then the
shape is empty; abort these steps.</p>
</li>
<li>
<p>Now, the shape represented by the element is the one described
for the entry in the list below corresponding to the state of the
<code title="attr-area-shape"><a href="#shape">shape</a></code>
attribute:</p>
<dl class="switch">
<dt><a href="#circle" title="attr-area-shape-circle">Circle
state</a></dt>
<dd>
<p>Let <var title="">x</var> be the first number in <var title=
"">coords</var> , <var title="">y</var> be the second number, and
<var title="">r</var> be the third number.</p>
<p>The shape is a circle whose center is <var title="">x</var> CSS
pixels from the left edge of the image and <var title="">x</var>
CSS pixels from the top edge of the image, and whose radius is
<var title="">r</var> pixels.</p>
</dd>
<dt><a href="#default0" title="attr-area-shape-default">Default
state</a></dt>
<dd>
<p>The shape is a rectangle that exactly covers the entire
image.</p>
</dd>
<dt><a href="#polygon" title="attr-area-shape-poly">Polygon
state</a></dt>
<dd>
<p>Let <var title="">x <sub title=""><var title=
"">i</var></sub></var> be the <span>(2 <var title="">i</var>
)</span> th entry in <var title="">coords</var> , and <var title=
"">y <sub title=""><var title="">i</var></sub></var> be the
<span>(2 <var title="">i</var> +1)</span> th entry in <var title=
"">coords</var> (the first entry in <var title="">coords</var>
being the one with index 0).</p>
<p>Let <var title="">the coordinates</var> be ( <var title="">x
<sub title=""><var title="">i</var></sub></var> , <var title="">y
<sub title=""><var title="">i</var></sub></var> ), interpreted in
CSS pixels measured from the top left of the image, for all integer
values of <var title="">i</var> from 0 to <span>( <var title=
"">N</var> /2)-1</span> , where <var title="">N</var> is the number
of items in <var title="">coords</var> .</p>
<p>The shape is a polygon whose vertices are given by <var title=
"">the coordinates</var> , and whose interior is established using
the even-odd rule. <a href="#references">[GRAPHICS]</a></p>
</dd>
<dt><a href="#rectangle" title="attr-area-shape-rect">Rectangle
state</a></dt>
<dd>
<p>Let <var title="">x1</var> be the first number in <var title=
"">coords</var> , <var title="">y1</var> be the second number,
<var title="">x2</var> be the third number, and <var title=
"">y2</var> be the fourth number.</p>
<p>The shape is a rectangle whose top-left corner is given by the
coordinate ( <var title="">x1</var> , <var title="">y1</var> ) and
whose bottom right corner is given by the coordinate ( <var title=
"">x2</var> , <var title="">y2</var> ), those coordinates being
interpreted as CSS pixels from the top left corner of the
image.</p>
</dd>
</dl>
<p>For historical reasons, the coordinates must be interpreted
relative to the <em>displayed</em> image, even if it stretched
using CSS or the image element's <code title="">width</code> and
<code title="">height</code> attributes.</p>
</li>
</ol>
<p>Mouse clicks on an image associated with a set of layered shapes
per the above algorithm must be dispatched to the top-most shape
covering the point that the pointing device indicated (if any), and
then, must be dispatched again (with a new <code>Event</code>
object) to the image element itself. User agents may also allow
individual <code><a href="#area">area</a></code> elements
representing <a href="#hyperlinks" title="hyperlink">hyperlinks</a>
to be selected and activated (e.g. using a keyboard); events from
this are not also propagated to the image.</p>
<p class="note">Because a <code><a href="#map">map</a></code>
element (and its <code><a href="#area">area</a></code> elements)
can be associated with multiple <code><a href="#img">img</a></code>
and <code><a href="#object">object</a></code> elements, it is
possible for an <code><a href="#area">area</a></code> element to
correspond to multiple focusable areas of the document.</p>
<p>Image maps are <em><a href="#live">live</a></em> ; if the DOM is
mutated, then the user agent must act as if it had rerun the
algorithms for image maps.</p>
<h4 id="mathml"><span class="secno"><ins class=
"diff-new">3.12.15</ins></span> <ins class=
"diff-new">MathML</ins></h4>
<p><ins class="diff-new">The</ins> <code><ins class=
"diff-new">math</ins></code> <ins class="diff-new">element from
the</ins> <a href="#mathml0"><ins class="diff-new">MathML
namespace</ins></a> <ins class="diff-new">falls into the</ins>
<a href="#embedded1"><ins class="diff-new">embedded
content</ins></a> <ins class="diff-new">category for the purposes
of the content models in this specification.</ins></p>
<p><ins class="diff-new">User agents must handle text other
than</ins> <a href="#inter-element"><ins class=
"diff-new">inter-element whitespace</ins></a> <ins class=
"diff-new">found in MathML elements whose content models do not
allow raw text by pretending for the purposes of MathML content
models, layout, and rendering that that text is actually wrapped in
an</ins> <code title=""><ins class="diff-new">mtext</ins></code>
<ins class="diff-new">element in the</ins> <a href=
"#mathml0"><ins class="diff-new">MathML namespace</ins></a>
.<ins class="diff-new">(Such text is not, however,
conforming.)</ins></p>
<p><ins class="diff-new">User agents must act as if any MathML
element whose contents does not match the element's content model
was replaced, for the purposes of MathML layout and rendering, by
an</ins> <code title=""><ins class="diff-new">merror</ins></code>
<ins class="diff-new">element in the</ins> <a href=
"#mathml0"><ins class="diff-new">MathML namespace</ins></a>
<ins class="diff-new">containing some appropriate error
message.</ins></p>
<p><ins class="diff-new">To enable authors to use MathML tools that
only accept MathML in its XML form, interactive HTML user agents
are encouraged to provide a way to export any MathML fragment as a
namespace-well-formed XML fragment.</ins></p>
<h4 id="svg"><span class="secno"><ins class=
"diff-new">3.12.16</ins></span> <ins class=
"diff-new">SVG</ins></h4>
<p><ins class="diff-new">The</ins> <code><ins class=
"diff-new">svg</ins></code> <ins class="diff-new">element from
the</ins> <a href="#svg-namespace"><ins class="diff-new">SVG
namespace</ins></a> <ins class="diff-new">falls into the</ins>
<a href="#embedded1"><ins class="diff-new">embedded
content</ins></a> <ins class="diff-new">category for the purposes
of the content models in this specification.</ins></p>
<p><ins class="diff-new">To enable authors to use SVG tools that
only accept SVG in its XML form, interactive HTML user agents are
encouraged to provide a way to export any SVG fragment as a
namespace-well-formed XML fragment.</ins></p>
<h4 id="dimension"><span class="secno"><del class=
"diff-old">3.14.15.</del> <ins class=
"diff-chg">3.12.17</ins></span> <dfn id="dimension0">Dimension
attributes</dfn></h4>
<p>The <dfn id="width4" title=
"attr-dim-width"><code>width</code></dfn> and <dfn id="height3"
title="attr-dim-height"><code>height</code></dfn> attributes on
<code><a href="#img">img</a></code> , <code><a href=
"#embed">embed</a></code> , <code><a href=
"#object">object</a></code> , and <code><a href=
"#video1">video</a></code> elements may be specified to give the
dimensions of the visual content of the element (the width and
height respectively, relative to the nominal direction of the
output medium), in CSS pixels. The attributes, if specified, must
have values that are <a href="#valid3">valid positive non-zero
integers</a> .</p>
<p>The specified dimensions given may differ from the dimensions
specified in the resource itself, since the resource may have a
resolution that differs from the CSS pixel resolution. (On screens,
CSS pixels have a resolution of 96ppi, but in general the CSS pixel
resolution depends on the reading distance.) If both attributes are
specified, then the ratio of the specified width to the specified
height must be the same as the ratio of the logical width to the
logical height in the resource. The two attributes must be omitted
if the resource in question does not have both a logical width and
a logical height.</p>
<p>To parse the attributes, user agents must use the <a href=
"#rules2">rules for parsing dimension values</a> . This will return
either an integer length, a percentage value, or nothing. The user
agent requirements for processing the values obtained from parsing
these attributes are described <a href="#sizing" title=
"sizing of embedded content">in the rendering section</a> . If one
of these attributes, when parsing, returns no value, it must be
treated, for the purposes of those requirements, as if it was not
specified.</p>
<p>The <dfn id="width5" title=
"dom-dim-width"><code>width</code></dfn> and <dfn id="height4"
title="dom-dim-height"><code>height</code></dfn> DOM attributes on
the <code><a href="#embed">embed</a></code> , <code><a href=
"#object">object</a></code> , and <code><a href=
"#video1">video</a></code> elements must <a href=
"#reflect">reflect</a> the content attributes of the same name.</p>
<h3 id="tabular"><span class="secno"><del class=
"diff-old">3.15.</del> <ins class="diff-chg">3.13</ins></span>
Tabular data</h3>
<h4 id="table-intro"><span class="secno"><ins class=
"diff-new">3.13.1</ins></span> <ins class=
"diff-new">Introduction</ins></h4>
<p><em><ins class="diff-new">This section is
non-normative.</ins></em></p>
<p class="big-issue">...examples,<ins class="diff-new">how to write
tables accessibly, a brief mention of the table model,
etc...</ins></p>
<h4 id="the-table"><span class="secno"><del class=
"diff-old">3.15.1.</del> <ins class="diff-chg">3.13.2</ins></span>
The <dfn id="table"><code>table</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>In this order: optionally a <code><a href=
"#caption0">caption</a></code> element, followed by either zero or
more <code><a href="#colgroup">colgroup</a></code> elements,
followed optionally by a <code><a href="#thead0">thead</a></code>
element, followed optionally by a <code><a href=
"#tfoot0">tfoot</a></code> element, followed by either zero or more
<code><a href="#tbody">tbody</a></code> elements <em>or</em> one or
more <code><a href="#tr">tr</a></code> elements, followed
optionally by a <code><a href="#tfoot0">tfoot</a></code> element
(but there can only be one <code><a href="#tfoot0">tfoot</a></code>
element child in total).</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmltableelement">HTMLTableElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
attribute <span>HTMLTableCaptionElement</span> <a href=
"#caption" title="dom-table-caption">caption</a>;
HTMLElement <a href="#createcaption" title=
"dom-table-createCaption">createCaption</a>();
void <a href="#deletecaption" title=
"dom-table-deleteCaption">deleteCaption</a>();
attribute <a href=
"#htmltablesectionelement">HTMLTableSectionElement</a> <a href=
"#thead" title="dom-table-tHead">tHead</a>;
HTMLElement <a href="#createthead" title=
"dom-table-createTHead">createTHead</a>();
void <a href="#deletethead" title=
"dom-table-deleteTHead">deleteTHead</a>();
attribute <a href=
"#htmltablesectionelement">HTMLTableSectionElement</a> <a href=
"#tfoot" title="dom-table-tFoot">tFoot</a>;
HTMLElement <a href="#createtfoot" title=
"dom-table-createTFoot">createTFoot</a>();
void <a href="#deletetfoot" title=
"dom-table-deleteTFoot">deleteTFoot</a>();
readonly attribute <a href=
"#htmlcollection0">HTMLCollection</a> <a href="#tbodies" title=
"dom-table-tBodies">tBodies</a>;
<ins class="diff-new"> HTMLElement <a href="#createtbody" title=
"dom-table-createTBody">createTBody</a>();
</ins>
readonly attribute <a href=
"#htmlcollection0">HTMLCollection</a> <a href="#rows" title=
"dom-table-rows">rows</a>;
HTMLElement <a href="#insertrow" title=
"dom-table-insertRow">insertRow</a>(in long index);
void <a href="#deleterow" title=
"dom-table-deleteRow">deleteRow</a>(in long index);
};
</pre></dd>
</dl>
<p>The <code><a href="#table">table</a></code> element represents
data with more than one dimension (a <a href="#table1" title=
"concept-table">table</a> ).</p>
<p class="big-issue">we need some editorial text on how layout
tables are bad practice and non-conforming</p>
<p>The children of a <code><a href="#table">table</a></code>
element must be, in order:</p>
<ol>
<li>
<p>Zero or one <code><a href="#caption0">caption</a></code>
elements.</p>
</li>
<li>
<p>Zero or more <code><a href="#colgroup">colgroup</a></code>
elements.</p>
</li>
<li>
<p>Zero or one <code><a href="#thead0">thead</a></code>
elements.</p>
</li>
<li>
<p>Zero or one <code><a href="#tfoot0">tfoot</a></code> elements,
if the last element in the table is not a <code><a href=
"#tfoot0">tfoot</a></code> element.</p>
</li>
<li>
<p>Either:</p>
<ul>
<li>Zero or more <code><a href="#tbody">tbody</a></code> elements,
or</li>
<li>One or more <code><a href="#tr">tr</a></code> elements.
<strong class="note"><ins class="diff-new">(Only expressible in
the</ins> <span title=""><ins class="diff-new">XML
serialization</ins></span> .)</strong></li>
</ul>
</li>
<li>
<p>Zero or one <code><a href="#tfoot0">tfoot</a></code> element, if
there are no other <code><a href="#tfoot0">tfoot</a></code>
elements in the table.</p>
</li>
</ol>
<p>The <code><a href="#table">table</a></code> element takes part
in the <a href="#table0">table model</a> .</p>
<p>The <dfn id="caption" title=
"dom-table-caption"><code>caption</code></dfn> DOM attribute must
return, on getting, the first <code><a href=
"#caption0">caption</a></code> element child of the <code><a href=
"#table">table</a></code> <del class="diff-old">element.</del>
<ins class="diff-chg">element, if any, or null otherwise.</ins> On
setting, if the new value is a <code><a href=
"#caption0">caption</a></code> element, the first <code><a href=
"#caption0">caption</a></code> element child of the <code><a href=
"#table">table</a></code> element, if any, must be removed, and the
new value must be inserted as the first node of the <code><a href=
"#table">table</a></code> element. If the new value is not a
<code><a href="#caption0">caption</a></code> element, then a
<code>HIERARCHY_REQUEST_ERR</code> DOM exception must be raised
instead.</p>
<p>The <dfn id="createcaption" title=
"dom-table-createCaption"><code>createCaption()</code></dfn> method
must return the first <code><a href="#caption0">caption</a></code>
element child of the <code><a href="#table">table</a></code>
element, if any; otherwise a new <code><a href=
"#caption0">caption</a></code> element must be created, inserted as
the first node of the <code><a href="#table">table</a></code>
element, and then returned.</p>
<p>The <dfn id="deletecaption" title=
"dom-table-deleteCaption"><code>deleteCaption()</code></dfn> method
must remove the first <code><a href="#caption0">caption</a></code>
element child of the <code><a href="#table">table</a></code>
element, if any.</p>
<p>The <dfn id="thead" title=
"dom-table-tHead"><code>tHead</code></dfn> DOM attribute must
return, on getting, the first <code><a href=
"#thead0">thead</a></code> element child of the <code><a href=
"#table">table</a></code> <del class="diff-old">element.</del>
<ins class="diff-chg">element, if any, or null otherwise.</ins> On
setting, if the new value is a <code><a href=
"#thead0">thead</a></code> element, the first <code><a href=
"#thead0">thead</a></code> element child of the <code><a href=
"#table">table</a></code> element, if any, must be removed, and the
new value must be inserted immediately before the first element in
the <code><a href="#table">table</a></code> element that is neither
a <code><a href="#caption0">caption</a></code> element nor a
<code><a href="#colgroup">colgroup</a></code> element, if any, or
at the end of the table otherwise. If the new value is not a
<code><a href="#thead0">thead</a></code> element, then a
<code>HIERARCHY_REQUEST_ERR</code> DOM exception must be raised
instead.</p>
<p>The <dfn id="createthead" title=
"dom-table-createTHead"><code>createTHead()</code></dfn> method
must return the first <code><a href="#thead0">thead</a></code>
element child of the <code><a href="#table">table</a></code>
element, if any; otherwise a new <code><a href=
"#thead0">thead</a></code> element must be created and inserted
immediately before the first element in the <code><a href=
"#table">table</a></code> element that is neither a <code><a href=
"#caption0">caption</a></code> element nor a <code><a href=
"#colgroup">colgroup</a></code> element, if any, or at the end of
the table otherwise, and then that new element must be
returned.</p>
<p>The <dfn id="deletethead" title=
"dom-table-deleteTHead"><code>deleteTHead()</code></dfn> method
must remove the first <code><a href="#thead0">thead</a></code>
element child of the <code><a href="#table">table</a></code>
element, if any.</p>
<p>The <dfn id="tfoot" title=
"dom-table-tFoot"><code>tFoot</code></dfn> DOM attribute must
return, on getting, the first <code><a href=
"#tfoot0">tfoot</a></code> element child of the <code><a href=
"#table">table</a></code> <del class="diff-old">element.</del>
<ins class="diff-chg">element, if any, or null otherwise.</ins> On
setting, if the new value is a <code><a href=
"#tfoot0">tfoot</a></code> element, the first <code><a href=
"#tfoot0">tfoot</a></code> element child of the <code><a href=
"#table">table</a></code> element, if any, must be removed, and the
new value must be inserted immediately before the first element in
the <code><a href="#table">table</a></code> element that is neither
a <code><a href="#caption0">caption</a></code> element, a
<code><a href="#colgroup">colgroup</a></code> element, nor a
<code><a href="#thead0">thead</a></code> element, if any, or at the
end of the table if there are no such elements. If the new value is
not a <code><a href="#tfoot0">tfoot</a></code> element, then a
<code>HIERARCHY_REQUEST_ERR</code> DOM exception must be raised
instead.</p>
<p>The <dfn id="createtfoot" title=
"dom-table-createTFoot"><code>createTFoot()</code></dfn> method
must return the first <code><a href="#tfoot0">tfoot</a></code>
element child of the <code><a href="#table">table</a></code>
element, if any; otherwise a new <code><a href=
"#tfoot0">tfoot</a></code> element must be created and inserted
immediately before the first element in the <code><a href=
"#table">table</a></code> element that is neither a <code><a href=
"#caption0">caption</a></code> element, a <code><a href=
"#colgroup">colgroup</a></code> element, nor a <code><a href=
"#thead0">thead</a></code> element, if any, or at the end of the
table if there are no such elements, and then that new element must
be returned.</p>
<p>The <dfn id="deletetfoot" title=
"dom-table-deleteTFoot"><code>deleteTFoot()</code></dfn> method
must remove the first <code><a href="#tfoot0">tfoot</a></code>
element child of the <code><a href="#table">table</a></code>
element, if any.</p>
<p>The <dfn id="tbodies" title=
"dom-table-tBodies"><code>tBodies</code></dfn> attribute must
return an <code><a href=
"#htmlcollection0">HTMLCollection</a></code> rooted at the
<code><a href="#table">table</a></code> node, whose filter matches
only <code><a href="#tbody">tbody</a></code> elements that are
children of the <code><a href="#table">table</a></code>
element.</p>
<p>The <dfn id="createtbody" title=
"dom-table-createTBody"><code><ins class=
"diff-new">createTBody()</ins></code></dfn> <ins class=
"diff-new">method must create a new</ins> <code><a href=
"#tbody"><ins class="diff-new">tbody</ins></a></code> <ins class=
"diff-new">element, insert it immediately after the last</ins>
<code><a href="#tbody"><ins class="diff-new">tbody</ins></a></code>
<ins class="diff-new">element in the</ins> <code><a href=
"#table"><ins class="diff-new">table</ins></a></code> <ins class=
"diff-new">element, if any, or at the end of the</ins>
<code><a href="#table"><ins class="diff-new">table</ins></a></code>
<ins class="diff-new">element if the</ins> <code><a href=
"#table"><ins class="diff-new">table</ins></a></code> <ins class=
"diff-new">element has no</ins> <code><a href="#tbody"><ins class=
"diff-new">tbody</ins></a></code> <ins class="diff-new">element
children, and then must return the new</ins> <code><a href=
"#tbody"><ins class="diff-new">tbody</ins></a></code> <ins class=
"diff-new">element.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="rows" title=
"dom-table-rows"><code>rows</code></dfn> attribute must return an
<code><a href="#htmlcollection0">HTMLCollection</a></code> rooted
at the <code><a href="#table">table</a></code> node, whose filter
matches only <code><a href="#tr">tr</a></code> elements that are
either children of the <code><a href="#table">table</a></code>
element, or children of <code><a href="#thead0">thead</a></code> ,
<code><a href="#tbody">tbody</a></code> , or <code><a href=
"#tfoot0">tfoot</a></code> elements that are themselves children of
the <code><a href="#table">table</a></code> element. The elements
in the collection must be ordered such that those elements whose
parent is a <code><a href="#thead0">thead</a></code> are included
first, in tree order, followed by those elements whose parent is
either a <code><a href="#table">table</a></code> or <code><a href=
"#tbody">tbody</a></code> element, again in tree order, followed
finally by those elements whose parent is a <code><a href=
"#tfoot0">tfoot</a></code> element, still in tree order.</p>
<p>The <del class="diff-old">behaviour</del> <ins class=
"diff-chg">behavior</ins> of the <dfn id="insertrow" title=
"dom-table-insertRow"><code>insertRow( <var title="">index</var>
)</code></dfn> method depends on the state of the table. When it is
called, the method must act as required by the first item in the
following list of conditions that describes the state of the table
and the <var title="">index</var> argument:</p>
<dl class="switch">
<dt>If <var title="">index</var> is less than <del class=
"diff-old">-1</del> <ins class="diff-chg">−1</ins> or greater than
the number of elements in <code title="dom-table-rows"><a href=
"#rows">rows</a></code> collection:</dt>
<dd>The method must raise an <code>INDEX_SIZE_ERR</code>
exception.</dd>
<dt>If the <code title="dom-table-rows"><a href=
"#rows">rows</a></code> collection has zero elements in it, and the
<code><a href="#table">table</a></code> has no <code><a href=
"#tbody">tbody</a></code> elements in it:</dt>
<dd>The method must create a <code><a href=
"#tbody">tbody</a></code> element, then create a <code><a href=
"#tr">tr</a></code> element, then append the <code><a href=
"#tr">tr</a></code> element to the <code><a href=
"#tbody">tbody</a></code> element, then append the <code><a href=
"#tbody">tbody</a></code> element to the <code><a href=
"#table">table</a></code> element, and finally return the
<code><a href="#tr">tr</a></code> element.</dd>
<dt>If the <code title="dom-table-rows"><a href=
"#rows">rows</a></code> collection has zero elements in it:</dt>
<dd>The method must create a <code><a href="#tr">tr</a></code>
element, append it to the last <code><a href=
"#tbody">tbody</a></code> element in the table, and return the
<code><a href="#tr">tr</a></code> element.</dd>
<dt>If <var title="">index</var> is equal to <del class=
"diff-old">-1</del> <ins class="diff-chg">−1</ins> or equal to the
number of items in <code title="dom-table-rows"><a href=
"#rows">rows</a></code> collection:</dt>
<dd>The method must create a <code><a href="#tr">tr</a></code>
element, and append it to the parent of the last <code><a href=
"#tr">tr</a></code> element in the <code title=
"dom-table-rows"><a href="#rows">rows</a></code> collection. Then,
the newly created <code><a href="#tr">tr</a></code> element must be
returned.</dd>
<dt>Otherwise:</dt>
<dd>The method must create a <code><a href="#tr">tr</a></code>
element, insert it immediately before the <var title="">index</var>
th <code><a href="#tr">tr</a></code> element in the <code title=
"dom-table-rows"><a href="#rows">rows</a></code> collection, in the
same parent, and finally must return the newly created
<code><a href="#tr">tr</a></code> element.</dd>
</dl>
<p><del class="diff-old">The</del> <ins class="diff-chg">When
the</ins> <dfn id="deleterow" title=
"dom-table-deleteRow"><code>deleteRow( <var title="">index</var>
)</code></dfn> method <ins class="diff-new">is called, the user
agent</ins> must <del class="diff-old">remove</del> <ins class=
"diff-chg">run</ins> the <ins class="diff-new">following
steps:</ins></p>
<ol>
<li>
<p><ins class="diff-new">If</ins> <var title="">index</var>
<del class="diff-old">th element</del> <ins class="diff-chg">is
equal to −1, then</ins> <var title=""><ins class=
"diff-chg">index</ins></var> <ins class="diff-chg">must be set to
the number if items</ins> in the <code title=
"dom-table-rows"><a href="#rows">rows</a></code> <del class=
"diff-old">collection from its parent. If</del> <ins class=
"diff-chg">collection, minus one.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Now, if</ins> <var title="">index</var> is
less than <del class="diff-old">zero</del> <ins class=
"diff-chg">zero,</ins> or greater than or equal to the number of
elements in the <code title="dom-table-rows"><a href=
"#rows">rows</a></code> collection, the method must instead raise
an <code>INDEX_SIZE_ERR</code> <del class=
"diff-old">exception.</del> <ins class="diff-chg">exception, and
these steps must be aborted.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Otherwise, the method must remove
the</ins> <var title=""><ins class="diff-chg">index</ins></var>
<ins class="diff-chg">th element in the</ins> <code title=
"dom-table-rows"><a href="#rows"><ins class=
"diff-chg">rows</ins></a></code> <ins class="diff-chg">collection
from its parent.</ins></p>
</li>
</ol>
<h4 id="the-caption"><span class="secno"><del class=
"diff-old">3.15.2.</del> <ins class="diff-chg">3.13.3</ins></span>
The <dfn id="caption0"><code>caption</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>As the first element child of a <code><a href=
"#table">table</a></code> element.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#caption0">caption</a></code> element
represents the title of the <code><a href="#table">table</a></code>
that is its parent, if it has a parent and that is a <code><a href=
"#table">table</a></code> element.</p>
<p>The <code><a href="#caption0">caption</a></code> element takes
part in the <a href="#table0">table model</a> .</p>
<h4 id="the-colgroup"><span class="secno"><del class=
"diff-old">3.15.3.</del> <ins class="diff-chg">3.13.4</ins></span>
The <dfn id="colgroup"><code>colgroup</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>As a child of a <code><a href="#table">table</a></code>
element, after any <code><a href="#caption0">caption</a></code>
elements and before any <code><a href="#thead0">thead</a></code> ,
<code><a href="#tbody">tbody</a></code> , <code><a href=
"#tfoot0">tfoot</a></code> , and <code><a href="#tr">tr</a></code>
elements.</dd>
<dt>Content model:</dt>
<dd>Zero or more <code><a href="#col">col</a></code> elements.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-colgroup-span"><a href=
"#span0">span</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmltablecolelement">HTMLTableColElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
attribute unsigned long <a href="#span1" title=
"dom-colgroup-span">span</a>;
};
</pre></dd>
</dl>
<p>The <code><a href="#colgroup">colgroup</a></code> element
represents a <a href="#column0" title=
"concept-column-group">group</a> of one or more <a href="#column"
title="concept-column">columns</a> in the <code><a href=
"#table">table</a></code> that is its parent, if it has a parent
and that is a <code><a href="#table">table</a></code> element.</p>
<p>If the <code><a href="#colgroup">colgroup</a></code> element
contains no <code><a href="#col">col</a></code> elements, then the
element may have a <dfn id="span0" title=
"attr-colgroup-span"><code>span</code></dfn> content attribute
specified, whose value must be a <a href="#valid">valid
non-negative integer</a> greater than zero. <del class=
"diff-old">Its default value, which must be used if parsing the
attribute as a non-negative integer returns either an error or
zero, is 1.</del></p>
<p>The <code><a href="#colgroup">colgroup</a></code> element and
its <code title="attr-colgroup-span"><a href=
"#span0">span</a></code> attribute take part in the <a href=
"#table0">table model</a> .</p>
<p>The <dfn id="span1" title=
"dom-colgroup-span"><code>span</code></dfn> DOM attribute must
<a href="#reflect">reflect</a> the content attribute of the same
<del class="diff-old">name, with the exception that on setting, if
the new</del> <ins class="diff-chg">name. The</ins> value
<del class="diff-old">is 0, then an INDEX_SIZE_ERR exception</del>
must be <del class="diff-old">raised.</del> <a href=
"#limited1"><ins class="diff-chg">limited to only positive non-zero
numbers</ins></a> .</p>
<h4 id="the-col"><span class="secno"><del class=
"diff-old">3.15.4.</del> <ins class="diff-chg">3.13.5</ins></span>
The <dfn id="col"><code>col</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>As a child of a <code><a href="#colgroup">colgroup</a></code>
element that doesn't have a <code title="attr-col-span"><a href=
"#span2">span</a></code> attribute.</dd>
<dt>Content model:</dt>
<dd>Empty.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-col-span"><a href=
"#span2">span</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<p><code><a href=
"#htmltablecolelement">HTMLTableColElement</a></code> , same as for
<code><a href="#colgroup">colgroup</a></code> elements. This
interface defines one member, <code title="dom-col-span"><a href=
"#span3">span</a></code> .</p>
</dd>
</dl>
<p>If a <code><a href="#col">col</a></code> element has a parent
and that is a <code><a href="#colgroup">colgroup</a></code> element
that itself has a parent that is a <code><a href=
"#table">table</a></code> element, then the <code><a href=
"#col">col</a></code> element represents one or more <a href=
"#column" title="concept-column">columns</a> in the <a href=
"#column0" title="concept-column-group">column group</a>
represented by that <code><a href="#colgroup">colgroup</a></code>
.</p>
<p>The element may have a <dfn id="span2" title=
"attr-col-span"><code>span</code></dfn> content attribute
specified, whose value must be a <a href="#valid">valid
non-negative integer</a> greater than zero. <del class=
"diff-old">Its default value, which must be used if parsing the
attribute as a non-negative integer returns either an error or
zero, is 1.</del></p>
<p>The <code><a href="#col">col</a></code> element and its
<code title="attr-col-span"><a href="#span2">span</a></code>
attribute take part in the <a href="#table0">table model</a> .</p>
<p>The <dfn id="span3" title="dom-col-span"><code>span</code></dfn>
DOM attribute must <a href="#reflect">reflect</a> the content
attribute of the same <del class="diff-old">name, with the
exception that on setting, if the new</del> <ins class=
"diff-chg">name. The</ins> value <del class="diff-old">is 0, then
an INDEX_SIZE_ERR exception</del> must be <del class=
"diff-old">raised.</del> <a href="#limited1"><ins class=
"diff-chg">limited to only positive non-zero numbers</ins></a>
.</p>
<h4 id="the-tbody"><span class="secno"><del class=
"diff-old">3.15.5.</del> <ins class="diff-chg">3.13.6</ins></span>
The <dfn id="tbody"><code>tbody</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>As a child of a <code><a href="#table">table</a></code>
element, after any <code><a href="#caption0">caption</a></code> ,
<code><a href="#colgroup">colgroup</a></code> , and <code><a href=
"#thead0">thead</a></code> elements, but only if there are no
<code><a href="#tr">tr</a></code> elements that are children of the
<code><a href="#table">table</a></code> element.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">One</del> <ins class=
"diff-chg">Zero</ins> or more <code><a href="#tr">tr</a></code>
elements</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmltablesectionelement">HTMLTableSectionElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
readonly attribute <a href=
"#htmlcollection0">HTMLCollection</a> <a href="#rows0" title=
"dom-tbody-rows">rows</a>;
<a href="#htmlelement">HTMLElement</a> <a href="#insertrow0"
title="dom-tbody-insertRow">insertRow</a>(in long index);
void <a href="#deleterow0" title=
"dom-tbody-deleteRow">deleteRow</a>(in long index);
};
</pre>
<p>The <code><a href=
"#htmltablesectionelement">HTMLTableSectionElement</a></code>
interface is also used for <code><a href="#thead0">thead</a></code>
and <code><a href="#tfoot0">tfoot</a></code> elements.</p>
</dd>
</dl>
<p>The <code><a href="#tbody">tbody</a></code> element represents a
<a href="#row-group" title="concept-row-group">block</a> of
<a href="#row0" title="concept-row">rows</a> that consist of a body
of data for the parent <code><a href="#table">table</a></code>
element, if the <code><a href="#tbody">tbody</a></code> element has
a parent and it is a <code><a href="#table">table</a></code> .</p>
<p>The <code><a href="#tbody">tbody</a></code> element takes part
in the <a href="#table0">table model</a> .</p>
<p>The <dfn id="rows0" title=
"dom-tbody-rows"><code>rows</code></dfn> attribute must return an
<code><a href="#htmlcollection0">HTMLCollection</a></code> rooted
at the element, whose filter matches only <code><a href=
"#tr">tr</a></code> elements that are children of the element.</p>
<p>The <dfn id="insertrow0" title=
"dom-tbody-insertRow"><code>insertRow( <var title="">index</var>
)</code></dfn> method must, when invoked on an element <var title=
"">table section</var> , act as follows:</p>
<p>If <var title="">index</var> is less than <del class=
"diff-old">-1</del> <ins class="diff-chg">−1</ins> or greater than
the number of elements in the <code title="dom-tbody-rows"><a href=
"#rows0">rows</a></code> collection, the method must raise an
<code>INDEX_SIZE_ERR</code> exception.</p>
<p>If <var title="">index</var> is equal to <del class=
"diff-old">-1</del> <ins class="diff-chg">−1</ins> or equal to the
number of items in the <code title="dom-tbody-rows"><a href=
"#rows0">rows</a></code> collection, the method must create a
<code><a href="#tr">tr</a></code> element, append it to the element
<var title="">table section</var> , and return the newly created
<code><a href="#tr">tr</a></code> element.</p>
<p>Otherwise, the method must create a <code><a href=
"#tr">tr</a></code> element, insert it as a child of the
<var title="">table section</var> element, immediately before the
<var title="">index</var> th <code><a href="#tr">tr</a></code>
element in the <code title="dom-tbody-rows"><a href=
"#rows0">rows</a></code> collection, and finally must return the
newly created <code><a href="#tr">tr</a></code> element.</p>
<p>The <dfn id="deleterow0" title=
"dom-tbody-deleteRow"><code>deleteRow( <var title="">index</var>
)</code></dfn> method must remove the <var title="">index</var> th
element in the <code title="dom-tbody-rows"><a href=
"#rows0">rows</a></code> collection from its parent. If <var title=
"">index</var> is less than zero or greater than or equal to the
number of elements in the <code title="dom-tbody-rows"><a href=
"#rows0">rows</a></code> collection, the method must instead raise
an <code>INDEX_SIZE_ERR</code> exception.</p>
<h4 id="the-thead"><span class="secno"><del class=
"diff-old">3.15.6.</del> <ins class="diff-chg">3.13.7</ins></span>
The <dfn id="thead0"><code>thead</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>As a child of a <code><a href="#table">table</a></code>
element, after any <code><a href="#caption0">caption</a></code> ,
and <code><a href="#colgroup">colgroup</a></code> elements and
before any <code><a href="#tbody">tbody</a></code> , <code><a href=
"#tfoot0">tfoot</a></code> , and <code><a href="#tr">tr</a></code>
elements, but only if there are no other <code><a href=
"#thead0">thead</a></code> elements that are children of the
<code><a href="#table">table</a></code> element.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">One</del> <ins class=
"diff-chg">Zero</ins> or more <code><a href="#tr">tr</a></code>
elements</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><code><a href=
"#htmltablesectionelement">HTMLTableSectionElement</a></code> , as
defined for <code><a href="#tbody">tbody</a></code> elements.</dd>
</dl>
<p>The <code><a href="#thead0">thead</a></code> element represents
the <a href="#row-group" title="concept-row-group">block</a> of
<a href="#row0" title="concept-row">rows</a> that consist of the
column labels (headers) for the parent <code><a href=
"#table">table</a></code> element, if the <code><a href=
"#thead0">thead</a></code> element has a parent and it is a
<code><a href="#table">table</a></code> .</p>
<p>The <code><a href="#thead0">thead</a></code> element takes part
in the <a href="#table0">table model</a> .</p>
<h4 id="the-tfoot"><span class="secno"><del class=
"diff-old">3.15.7.</del> <ins class="diff-chg">3.13.8</ins></span>
The <dfn id="tfoot0"><code>tfoot</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>As a child of a <code><a href="#table">table</a></code>
element, after any <code><a href="#caption0">caption</a></code> ,
<code><a href="#colgroup">colgroup</a></code> , and <code><a href=
"#thead0">thead</a></code> elements and before any <code><a href=
"#tbody">tbody</a></code> and <code><a href="#tr">tr</a></code>
elements, but only if there are no other <code><a href=
"#tfoot0">tfoot</a></code> elements that are children of the
<code><a href="#table">table</a></code> element.</dd>
<dd>As a child of a <code><a href="#table">table</a></code>
element, after any <code><a href="#caption0">caption</a></code> ,
<code><a href="#colgroup">colgroup</a></code> , <code><a href=
"#thead0">thead</a></code> , <code><a href=
"#tbody">tbody</a></code> , and <code><a href="#tr">tr</a></code>
elements, but only if there are no other <code><a href=
"#tfoot0">tfoot</a></code> elements that are children of the
<code><a href="#table">table</a></code> element.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">One</del> <ins class=
"diff-chg">Zero</ins> or more <code><a href="#tr">tr</a></code>
elements</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><code><a href=
"#htmltablesectionelement">HTMLTableSectionElement</a></code> , as
defined for <code><a href="#tbody">tbody</a></code> elements.</dd>
</dl>
<p>The <code><a href="#tfoot0">tfoot</a></code> element represents
the <a href="#row-group" title="concept-row-group">block</a> of
<a href="#row0" title="concept-row">rows</a> that consist of the
column summaries (footers) for the parent <code><a href=
"#table">table</a></code> element, if the <code><a href=
"#tfoot0">tfoot</a></code> element has a parent and it is a
<code><a href="#table">table</a></code> .</p>
<p>The <code><a href="#tfoot0">tfoot</a></code> element takes part
in the <a href="#table0">table model</a> .</p>
<h4 id="the-tr"><span class="secno"><del class=
"diff-old">3.15.8.</del> <ins class="diff-chg">3.13.9</ins></span>
The <dfn id="tr"><code>tr</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>As a child of a <code><a href="#thead0">thead</a></code>
element.</dd>
<dd>As a child of a <code><a href="#tbody">tbody</a></code>
element.</dd>
<dd>As a child of a <code><a href="#tfoot0">tfoot</a></code>
element.</dd>
<dd>As a child of a <code><a href="#table">table</a></code>
element, after any <code><a href="#caption0">caption</a></code> ,
<code><a href="#colgroup">colgroup</a></code> , and <code><a href=
"#thead0">thead</a></code> elements, but only if there are no
<code><a href="#tbody">tbody</a></code> elements that are children
of the <code><a href="#table">table</a></code> element.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">One</del> <ins class=
"diff-chg">Zero</ins> or more <code><a href="#td">td</a></code> or
<code><a href="#th">th</a></code> elements</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmltablerowelement">HTMLTableRowElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
readonly attribute long <a href="#rowindex" title=
"dom-tr-rowIndex">rowIndex</a>;
readonly attribute long <a href="#sectionrowindex" title=
"dom-tr-sectionRowIndex">sectionRowIndex</a>;
readonly attribute <a href=
"#htmlcollection0">HTMLCollection</a> <a href="#cells" title=
"dom-tr-cells">cells</a>;
<a href="#htmlelement">HTMLElement</a> <a href="#insertcell"
title="dom-tr-insertCell">insertCell</a>(in long index);
void <span>deleteCell</span>(in long index);
};
</pre></dd>
</dl>
<p>The <code><a href="#tr">tr</a></code> element represents a
<a href="#row0" title="concept-row">row</a> of <a href="#cell"
title="concept-cell">cells</a> in a <a href="#table1" title=
"concept-table">table</a> .</p>
<p>The <code><a href="#tr">tr</a></code> element takes part in the
<a href="#table0">table model</a> .</p>
<p>The <dfn id="rowindex" title=
"dom-tr-rowIndex"><code>rowIndex</code></dfn> <del class=
"diff-old">element</del> <ins class="diff-chg">attribute</ins>
must, if the element has a parent <code><a href=
"#table">table</a></code> element, or a parent <code><a href=
"#tbody">tbody</a></code> , <code><a href=
"#thead0">thead</a></code> , or <code><a href=
"#tfoot0">tfoot</a></code> element and a <em>grandparent</em>
<code><a href="#table">table</a></code> element, return the index
of the <code><a href="#tr">tr</a></code> element in that
<code><a href="#table">table</a></code> element's <code title=
"dom-table-rows"><a href="#rows">rows</a></code> collection. If
there is no such <code><a href="#table">table</a></code> element,
then the attribute must return <del class="diff-old">0.</del>
<ins class="diff-chg">−1.</ins></p>
<p>The <dfn id="sectionrowindex" title=
"dom-tr-sectionRowIndex"><code>sectionRowIndex</code></dfn>
<del class="diff-old">DOM</del> attribute must, if the element has
a parent <code><a href="#table">table</a></code> , <code><a href=
"#tbody">tbody</a></code> , <code><a href=
"#thead0">thead</a></code> , or <code><a href=
"#tfoot0">tfoot</a></code> element, return the index of the
<code><a href="#tr">tr</a></code> element in the parent element's
<code title="">rows</code> collection (for tables, that's the
<code title="dom-table-rows"><a href="#rows">rows</a></code>
collection; for table sections, that's the <code title=
"dom-tbody-rows"><a href="#rows0">rows</a></code> collection). If
there is no such parent element, then the attribute must return
<del class="diff-old">0.</del> <ins class="diff-chg">−1.</ins></p>
<p>The <dfn id="cells" title=
"dom-tr-cells"><code>cells</code></dfn> attribute must return an
<code><a href="#htmlcollection0">HTMLCollection</a></code> rooted
at the <code><a href="#tr">tr</a></code> element, whose filter
matches only <code><a href="#td">td</a></code> and <code><a href=
"#th">th</a></code> elements that are children of the
<code><a href="#tr">tr</a></code> element.</p>
<p>The <dfn id="insertcell" title=
"dom-tr-insertCell"><code>insertCell( <var title="">index</var>
)</code></dfn> method must act as follows:</p>
<p>If <var title="">index</var> is less than <del class=
"diff-old">-1</del> <ins class="diff-chg">−1</ins> or greater than
the number of elements in the <code title="dom-tr-cells"><a href=
"#cells">cells</a></code> collection, the method must raise an
<code>INDEX_SIZE_ERR</code> exception.</p>
<p>If <var title="">index</var> is equal to <del class=
"diff-old">-1</del> <ins class="diff-chg">−1</ins> or equal to the
number of items in <code title="dom-tr-cells"><a href=
"#cells">cells</a></code> collection, the method must create a
<code><a href="#td">td</a></code> element, append it to the
<code><a href="#tr">tr</a></code> element, and return the newly
created <code><a href="#td">td</a></code> element.</p>
<p>Otherwise, the method must create a <code><a href=
"#td">td</a></code> element, insert it as a child of the
<code><a href="#tr">tr</a></code> element, immediately before the
<var title="">index</var> th <code><a href="#td">td</a></code> or
<code><a href="#th">th</a></code> element in the <code title=
"dom-tr-cells"><a href="#cells">cells</a></code> collection, and
finally must return the newly created <code><a href=
"#td">td</a></code> element.</p>
<p>The <dfn id="deletecell" title=
"dom-tr-deleteCell"><code>deleteCell( <var title="">index</var>
)</code></dfn> method must remove the <var title="">index</var> th
element in the <code title="dom-tr-cells"><a href=
"#cells">cells</a></code> collection from its parent. If
<var title="">index</var> is less than zero or greater than or
equal to the number of elements in the <code title=
"dom-tr-cells"><a href="#cells">cells</a></code> collection, the
method must instead raise an <code>INDEX_SIZE_ERR</code>
exception.</p>
<h4 id="the-td"><span class="secno"><del class=
"diff-old">3.15.9.</del> <ins class="diff-chg">3.13.10</ins></span>
The <dfn id="td"><code>td</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">None.</del> <a href=
"#sectioning1"><ins class="diff-chg">Sectioning root</ins></a>
.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>As a child of a <code><a href="#tr">tr</a></code> element.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-tdth-colspan"><a href=
"#colspan">colspan</a></code></dd>
<dd><code title="attr-tdth-rowspan"><a href=
"#rowspan">rowspan</a></code></dd>
<dd><code title="attr-td-headers"><a href="#headers"><ins class=
"diff-new">headers</ins></a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre>
<del class="diff-old"> class=idl>interface {
attribute long ;
attribute long ;
readonly attribute long ;
</del>
<ins class="diff-chg"> class=idl>interface <dfn id=
"htmltabledatacellelement">HTMLTableDataCellElement</dfn> : <a href="#htmltablecellelement">HTMLTableCellElement</a> {
attribute DOMString <a href="#headers0" title=
"dom-td-headers">headers</a>;
</ins>
};
</pre></dd>
</dl>
<p>The <code><a href="#td">td</a></code> element represents a data
<a href="#cell" title="concept-cell">cell</a> in a table.</p>
<p>The <code><a href="#td">td</a></code> element may have a
<dfn id="headers" title="attr-td-headers"><code><del class=
"diff-old">colspan</del> <ins class=
"diff-chg">headers</ins></code></dfn> content attribute <ins class=
"diff-new">specified. The</ins> <code title=
"attr-td-headers"><a href="#headers"><ins class=
"diff-new">headers</ins></a></code> <ins class=
"diff-new">attribute, if</ins> specified, <del class=
"diff-old">whose value</del> must <del class="diff-old">be</del>
<ins class="diff-chg">contain</ins> a <del class="diff-old">valid
non-negative integer greater than zero. Its default value,</del>
<ins class="diff-chg">string consisting of an</ins> <a href=
"#unordered"><ins class="diff-chg">unordered set of unique
space-separated tokens</ins></a> ,<ins class="diff-chg">each
of</ins> which must <del class="diff-old">be used if parsing</del>
<ins class="diff-chg">have</ins> the <del class=
"diff-old">attribute as</del> <ins class="diff-chg">value of an ID
of</ins> a <del class="diff-old">non-negative integer</del>
<code><a href="#th"><ins class="diff-chg">th</ins></a> <del class=
"diff-old">returns either an error or zero, is 1. The</del></code>
<ins class="diff-chg">element taking part in the same</ins>
<a href="#table1" title="concept-table"><ins class=
"diff-chg">table</ins></a> <ins class="diff-chg">as the</ins>
<code><a href="#td">td</a></code> element <del class="diff-old">may
also have a rowspan content</del> <ins class="diff-chg">(as defined
by the</ins> <a href="#table0"><ins class="diff-chg">table
model</ins></a> <ins class="diff-chg">).</ins></p>
<p><ins class="diff-chg">The exact effect of the</ins> attribute
<del class="diff-old">specified, whose value must be a valid
non-negative integer . Its default value,</del> <ins class=
"diff-chg">is described in detail in the</ins> <a href=
"#algorithm3"><ins class="diff-chg">algorithm for assigning header
cells to data cells</ins></a> , which <ins class="diff-new">user
agents</ins> must <del class="diff-old">be used if parsing</del>
<ins class="diff-chg">apply to determine</ins> the <del class=
"diff-old">attribute as a non-negative integer returns an error, is
also 1.</del> <ins class="diff-chg">relationships between data
cells and header cells.</ins></p>
<p>The <code><a href="#td">td</a></code> element and its
<code title="attr-tdth-colspan"><a href=
"#colspan">colspan</a></code> and <code title=
"attr-tdth-rowspan"><a href="#rowspan">rowspan</a></code>
attributes take part in the <a href="#table0">table model</a> .</p>
<p>The <del class="diff-old">colspan DOM attribute must reflect the
content attribute of the same name, with the exception that on
setting, if the new value is 0, then an INDEX_SIZE_ERR exception
must be raised. The</del> <dfn id="headers0" title=
"dom-td-headers"><code><del class="diff-old">rowspan</del>
<ins class="diff-chg">headers</ins></code></dfn> DOM attribute must
<a href="#reflect">reflect</a> the content attribute of the same
name. <del class="diff-old">The cellIndex DOM attribute must, if
the element has a parent tr element, return the index of the cell's
element in the parent element's cells collection. If there is no
such parent element, then the attribute must return 0. There has
been some suggestion that the headers attribute from HTML4, or some
other mechanism that is more powerful than scope="" , should be
included. This has not yet been considered.</del></p>
<h4 id="the-th"><span class="secno"><del class=
"diff-old">3.15.10.</del> <ins class=
"diff-chg">3.13.11</ins></span> The <dfn id=
"th"><code>th</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>As a child of a <code><a href="#tr">tr</a></code> element.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-tdth-colspan"><a href=
"#colspan">colspan</a></code></dd>
<dd><code title="attr-tdth-rowspan"><a href=
"#rowspan">rowspan</a></code></dd>
<dd><code title="attr-th-scope"><a href=
"#scope0">scope</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmltableheadercellelement">HTMLTableHeaderCellElement</dfn> : <a href="#htmltablecellelement">HTMLTableCellElement</a> {
attribute DOMString <a href="#scope1" title=
"dom-th-scope">scope</a>;
};
</pre></dd>
</dl>
<p>The <code><a href="#th">th</a></code> element represents a
header <a href="#cell" title="concept-cell">cell</a> in a
table.</p>
<p>The <code><a href="#th">th</a></code> element may have a
<del class="diff-old">colspan content attribute specified, whose
value must be a valid non-negative integer greater than zero. Its
default value, which must be used if parsing the attribute as a
non-negative integer returns either an error or zero, is 1. The th
element may also have a rowspan content attribute specified, whose
value must be a valid non-negative integer . Its default value,
which must be used if parsing the attribute as a non-negative
integer returns an error, is also 1. The th element may have
a</del> <dfn id="scope0" title=
"attr-th-scope"><code>scope</code></dfn> content attribute
specified. The <code title="attr-th-scope"><a href=
"#scope0">scope</a></code> attribute is an <a href=
"#enumerated">enumerated attribute</a> with five states, four of
which have explicit keywords:</p>
<dl>
<dt>The <dfn id="row" title=
"attr-th-scope-row"><code>row</code></dfn> keyword, which maps to
the <em>row</em> state</dt>
<dd>The <em>row</em> state means the header cell applies to all the
remaining cells in the row.</dd>
<dt>The <dfn id="col0" title=
"attr-th-scope-col"><code>col</code></dfn> keyword, which maps to
the <em>column</em> state</dt>
<dd>The <em>column</em> state means the header cell applies to all
the remaining cells in the column.</dd>
<dt>The <dfn id="rowgroup" title=
"attr-th-scope-rowgroup"><code>rowgroup</code></dfn> keyword, which
maps to the <em>row group</em> state</dt>
<dd>The <em>row group</em> state means the header cell applies to
all the remaining cells in the row group.</dd>
<dt>The <dfn id="colgroup0" title=
"attr-th-scope-colgroup"><code>colgroup</code></dfn> keyword, which
maps to the <em>column group</em> state</dt>
<dd>The <em>column group</em> state means the header cell applies
to all the remaining cells in the column group.</dd>
<dt>The <em>auto</em> state</dt>
<dd>The <em>auto</em> state makes the header cell apply to a set of
cells selected based on context.</dd>
</dl>
<p>The <code title="attr-th-scope"><a href=
"#scope0">scope</a></code> attribute's <em>missing value
default</em> is the <em>auto</em> state.</p>
<p>The exact effect of these values is described in detail in the
<a href="#algorithm3">algorithm for assigning header cells to data
cells</a> , which user agents must apply to determine the
relationships between data cells and header cells.</p>
<p>The <code><a href="#th">th</a></code> element and its
<code title="attr-tdth-colspan"><a href="#colspan">colspan</a>
<del class="diff-old">, rowspan ,</del></code> and <code title=
"attr-tdth-rowspan"><del class="diff-old">scope</del> <a href=
"#rowspan"><ins class="diff-chg">rowspan</ins></a></code>
attributes take part in the <a href="#table0">table model</a> .</p>
<p>The <dfn id="scope1" title=
"dom-th-scope"><code>scope</code></dfn> DOM attribute must <a href=
"#reflect">reflect</a> the content attribute of the same name.</p>
<h4 id="attributes0"><span class="secno"><ins class=
"diff-new">3.13.12</ins></span> <ins class="diff-new">Attributes
common to</ins> <code><a href="#td"><ins class=
"diff-new">td</ins></a></code> <ins class="diff-new">and</ins>
<code><a href="#th"><ins class="diff-new">th</ins></a></code>
<ins class="diff-new">elements</ins></h4>
<p>The <code><del class="diff-old">HTMLTableHeaderCellElement</del>
<a href="#td"><ins class="diff-chg">td</ins></a></code> <del class=
"diff-old">interface inherits</del> <ins class="diff-chg">and</ins>
<code><a href="#th"><ins class="diff-chg">th</ins></a></code>
<ins class="diff-chg">elements may have a</ins> <dfn id="colspan"
title="attr-tdth-colspan"><code><ins class=
"diff-chg">colspan</ins></code></dfn> <ins class="diff-chg">content
attribute specified, whose value must be a</ins> <a href=
"#valid"><ins class="diff-chg">valid non-negative integer</ins></a>
<ins class="diff-chg">greater than zero.</ins></p>
<p><ins class="diff-chg">The</ins> <code><a href="#td"><ins class=
"diff-chg">td</ins></a></code> <ins class="diff-chg">and</ins>
<code><a href="#th"><ins class="diff-chg">th</ins></a></code>
<ins class="diff-chg">elements may also have a</ins> <dfn id=
"rowspan" title="attr-tdth-rowspan"><code><ins class=
"diff-chg">rowspan</ins></code></dfn> <ins class="diff-chg">content
attribute specified, whose value must be a</ins> <a href=
"#valid"><ins class="diff-chg">valid non-negative integer</ins></a>
.</p>
<p><ins class="diff-chg">The</ins> <code><a href="#td"><ins class=
"diff-chg">td</ins></a></code> <ins class="diff-chg">and</ins>
<code><a href="#th"><ins class="diff-chg">th</ins></a></code>
<ins class="diff-chg">elements implement interfaces that
inherit</ins> from the <code><a href=
"#htmltablecellelement">HTMLTableCellElement</a></code> <del class=
"diff-old">interface and therefore</del> <ins class=
"diff-chg">interface:</ins></p>
<pre ins="" class="diff-chg">
class=idl>interface <dfn id=
"htmltablecellelement">HTMLTableCellElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
attribute long <a href="#colspan0" title=
"dom-tdth-colSpan">colSpan</a>;
attribute long <a href="#rowspan0" title=
"dom-tdth-rowSpan">rowSpan</a>;
readonly attribute long <a href="#cellindex" title=
"dom-tdth-cellIndex">cellIndex</a>;
};
</pre>
<p><ins class="diff-chg">The</ins> <dfn id="colspan0" title=
"dom-tdth-colSpan"><code><ins class=
"diff-chg">colSpan</ins></code></dfn> <ins class="diff-chg">DOM
attribute must</ins> <a href="#reflect"><ins class=
"diff-chg">reflect</ins></a> <ins class="diff-chg">the content
attribute of the same name. The value must be</ins> <a href=
"#limited1"><ins class="diff-chg">limited to only positive non-zero
numbers</ins></a> .</p>
<p><ins class="diff-chg">The</ins> <dfn id="rowspan0" title=
"dom-tdth-rowSpan"><code><ins class=
"diff-chg">rowSpan</ins></code></dfn> <ins class="diff-chg">DOM
attribute must</ins> <a href="#reflect"><ins class=
"diff-chg">reflect</ins></a> <ins class="diff-chg">the content
attribute of the same name. Its default value, which must be used
if</ins> <a href="#rules" title=
"rules for parsing non-negative integers"><ins class=
"diff-chg">parsing the attribute as a non-negative
integer</ins></a> <ins class="diff-chg">returns an error, is</ins>
also <ins class="diff-new">1.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="cellindex" title=
"dom-tdth-cellIndex"><code><ins class=
"diff-new">cellIndex</ins></code></dfn> <ins class="diff-new">DOM
attribute must, if the element</ins> has <ins class="diff-new">a
parent</ins> <code><a href="#tr"><ins class=
"diff-new">tr</ins></a></code> <ins class="diff-new">element,
return</ins> the <del class="diff-old">DOM attributes defined
above</del> <ins class="diff-chg">index of the cell's element</ins>
in the <ins class="diff-chg">parent element's</ins> <code title=
"dom-tr-cells"><del class="diff-old">td</del> <a href=
"#cells"><ins class="diff-chg">cells</ins></a></code> <del class=
"diff-old">section.</del> <ins class="diff-chg">collection. If
there is no such parent element, then the attribute must return
0.</ins></p>
<h4 id="processing"><span class="secno"><del class=
"diff-old">3.15.11.</del> <ins class=
"diff-chg">3.13.13</ins></span> Processing model</h4>
<p>The various table elements and their content attributes together
define the <dfn id="table0">table model</dfn> .</p>
<p>A <dfn id="table1" title="concept-table">table</dfn> consists of
cells aligned on a two-dimensional grid of <dfn id="slots" title=
"concept-slots">slots</dfn> with coordinates ( <var title=
"">x</var> , <var title="">y</var> ). The grid is finite, and is
either empty or has one or more slots. If the grid has one or more
slots, then the <var title="">x</var> coordinates are always in the
range <span><del class="diff-old">1 ≤ </del> <ins class=
"diff-chg">0 ≤ </ins> <var title="">x</var> <del class=
"diff-old"> ≤ </del> <ins class=
"diff-chg"> < </ins> <var title="">x <sub title=
""><del class="diff-old">max</del> <ins class=
"diff-chg">width</ins></sub></var></span> , and the <var title=
"">y</var> coordinates are always in the range <span><del class=
"diff-old">1 ≤ </del> <ins class=
"diff-chg">0 ≤ </ins> <var title="">y</var> <del class=
"diff-old"> ≤ </del> <ins class=
"diff-chg"> < </ins> <var title="">y <sub title=
""><del class="diff-old">max</del> <ins class=
"diff-chg">height</ins></sub></var></span> . If one or both of
<var title="">x <sub title=""><del class="diff-old">max</del>
<ins class="diff-chg">width</ins></sub></var> and <var title="">y
<sub title=""><del class="diff-old">max</del> <ins class=
"diff-chg">height</ins></sub></var> are zero, then the table is
empty (has no slots). Tables correspond to <code><a href=
"#table">table</a></code> elements.</p>
<p>A <dfn id="cell" title="concept-cell">cell</dfn> is a set of
slots anchored at a slot ( <var title="">cell <sub title=
"">x</sub></var> , <var title="">cell <sub title="">y</sub></var>
), and with a particular <var title="">width</var> and <var title=
"">height</var> such that the cell covers all the slots with
coordinates ( <var title="">x</var> , <var title="">y</var> ) where
<span><var title="">cell <sub title="">x</sub></var> ≤
<var title="">x</var> < <var title="">cell
<sub title="">x</sub></var> + <var title="">width</var></span> and
<span><var title="">cell <sub title="">y</sub></var> ≤
<var title="">y</var> < <var title="">cell
<sub title="">y</sub></var> + <var title="">height</var></span> .
<del class="diff-old">Cell</del> <ins class="diff-chg">Cells</ins>
can either be <em>data cells</em> or <em>header cells</em> . Data
cells correspond to <code><a href="#td">td</a></code> elements, and
have zero or more associated header cells. Header cells correspond
to <code><a href="#th">th</a></code> elements.</p>
<p>A <dfn id="row0" title="concept-row">row</dfn> is a complete set
of slots from <span><var title="">x</var> <del class=
"diff-old">=1</del> <ins class="diff-chg">=0</ins></span> to
<span><var title="">x</var> = <var title="">x <sub title=
""><del class="diff-old">max</del> <ins class=
"diff-chg">width</ins></sub></var> <ins class=
"diff-chg">-1</ins></span> , for a particular value of <var title=
"">y</var> . Rows correspond to <code><a href="#tr">tr</a></code>
elements.</p>
<p>A <dfn id="column" title="concept-column">column</dfn> is a
complete set of slots from <span><var title="">y</var> <del class=
"diff-old">=1</del> <ins class="diff-chg">=0</ins></span> to
<span><var title="">y</var> = <var title="">y <sub title=
""><del class="diff-old">max</del> <ins class=
"diff-chg">height</ins></sub></var> <ins class=
"diff-chg">-1</ins></span> , for a particular value of <var title=
"">x</var> . Columns can correspond to <code><a href=
"#col">col</a></code> elements, but in the <del class=
"diff-old">absense</del> <ins class="diff-chg">absence</ins> of
<code><a href="#col">col</a></code> elements are implied.</p>
<p>A <dfn id="row-group" title="concept-row-group">row group</dfn>
is a set of <a href="#row0" title="concept-row">rows</a> anchored
at a slot <del class="diff-old">(1,</del> <ins class=
"diff-chg">(0,</ins> <var title="">group <sub title=
"">y</sub></var> ) with a particular <var title="">height</var>
such that the row group covers all the slots with coordinates (
<var title="">x</var> , <var title="">y</var> ) where
<span><del class="diff-old">1 ≤ </del> <ins class=
"diff-chg">0 ≤ </ins> <var title="">x</var>
< <var title="">x <sub title=""><del class=
"diff-old">max</del> <ins class=
"diff-chg">width</ins></sub></var></span> and <span><var title=
"">group <sub title="">y</sub></var> ≤ <var title=
"">y</var> < <var title="">group <sub title=
"">y</sub></var> + <var title="">height</var></span> . Row groups
correspond to <code><a href="#tbody">tbody</a></code> ,
<code><a href="#thead0">thead</a></code> , and <code><a href=
"#tfoot0">tfoot</a></code> elements. Not every row is necessarily
in a row group.</p>
<p>A <dfn id="column0" title="concept-column-group">column
group</dfn> is a set of <a href="#column" title=
"concept-column">columns</a> anchored at a slot ( <var title=
"">group <sub title="">x</sub></var> , <del class=
"diff-old">1)</del> <ins class="diff-chg">0)</ins> with a
particular <var title="">width</var> such that the column group
covers all the slots with coordinates ( <var title="">x</var> ,
<var title="">y</var> ) where <span><var title="">group <sub title=
"">x</sub></var> ≤ <var title="">x</var>
< <var title="">group <sub title="">x</sub></var> +
<var title="">width</var></span> and <span><del class=
"diff-old">1 ≤ </del> <ins class=
"diff-chg">0 ≤ </ins> <var title="">y</var>
< <var title="">y <sub title=""><del class=
"diff-old">max</del> <ins class=
"diff-chg">height</ins></sub></var></span> . Column groups
correspond to <code><a href="#colgroup">colgroup</a></code>
elements. Not every column is necessarily in a column group.</p>
<p><a href="#row-group" title="concept-row-group">Row groups</a>
cannot overlap each other. Similarly, <a href="#column0" title=
"concept-column-group">column groups</a> cannot overlap each
other.</p>
<p>A <a href="#cell" title="concept-cell">cell</a> cannot cover
slots that are from two or more <a href="#row-group" title=
"concept-row-group">row groups</a> . It is, however, possible for a
cell to be in multiple <a href="#column0" title=
"concept-column-group">column groups</a> . All the slots that form
part of one cell are part of zero or one <a href="#row-group"
title="concept-row-group">row groups</a> and zero or more <a href=
"#column0" title="concept-column-group">column groups</a> .</p>
<p>In addition to <a href="#cell" title="concept-cell">cells</a> ,
<a href="#column" title="concept-column">columns</a> , <a href=
"#row0" title="concept-row">rows</a> , <a href="#row-group" title=
"concept-row-group">row groups</a> , and <a href="#column0" title=
"concept-column-group">column groups</a> , <a href="#table1" title=
"concept-table">tables</a> can have a <code><a href=
"#caption0">caption</a></code> element associated with them. This
gives the table a heading, or legend.</p>
<p>A <dfn id="table2">table model error</dfn> is an error with the
data represented by <code><a href="#table">table</a></code>
elements and their descendants. Documents must not have table model
errors.</p>
<h5 id="forming"><span class="secno"><del class=
"diff-old">3.15.11.1.</del> <ins class=
"diff-chg">3.13.13.1.</ins></span> Forming a table</h5>
<p>To determine which elements correspond to which slots in a
<a href="#table1" title="concept-table">table</a> associated with a
<code><a href="#table">table</a></code> element, to determine the
dimensions of the table ( <var title="">x <sub title=""><del class=
"diff-old">max</del> <ins class="diff-chg">width</ins></sub></var>
and <var title="">y <sub title=""><del class="diff-old">max</del>
<ins class="diff-chg">height</ins></sub></var> ), and to determine
if there are any <a href="#table2" title="table model error">table
model errors</a> , user agents must use the following
algorithm:</p>
<ol>
<li>
<p>Let <var title="">x <sub title=""><del class=
"diff-old">max</del> <ins class="diff-chg">width</ins></sub></var>
be zero.</p>
</li>
<li>
<p>Let <var title="">y <sub title=""><del class=
"diff-old">max</del> <ins class="diff-chg">height</ins></sub></var>
be zero.</p>
</li>
<li>
<p>Let <var title=""><ins class="diff-new">pending</ins>
<code><a href="#tfoot0"><ins class=
"diff-new">tfoot</ins></a></code> <ins class=
"diff-new">elements</ins></var> <ins class="diff-new">be a list
of</ins> <code><a href="#tfoot0"><ins class=
"diff-new">tfoot</ins></a></code> <ins class="diff-new">elements,
initially empty.</ins></p>
</li>
<li>
<p><ins class="diff-new">Let</ins> <var title="">the table</var> be
the <a href="#table1" title="concept-table">table</a> represented
by the <code><a href="#table">table</a></code> element. The
<var title="">x <sub title=""><del class="diff-old">max</del>
<ins class="diff-chg">width</ins></sub></var> and <var title="">y
<sub title=""><del class="diff-old">max</del> <ins class=
"diff-chg">height</ins></sub></var> variables give <var title=
"">the table</var> 's <del class="diff-old">extent.</del>
<ins class="diff-chg">dimensions.</ins> <var title="">The
table</var> is initially empty.</p>
</li>
<li>
<p>If the <code><a href="#table">table</a></code> element has no
<del class="diff-old">table children,</del> <ins class=
"diff-chg">children elements,</ins> then return <var title="">the
table</var> (which will be empty), and abort these steps.</p>
</li>
<li>
<p><ins class="diff-new">Associate the first</ins> <code><a href=
"#caption0"><ins class="diff-new">caption</ins></a></code>
<ins class="diff-new">element child of the</ins> <code><a href=
"#table"><ins class="diff-new">table</ins></a></code> <ins class=
"diff-new">element with</ins> <var title=""><ins class=
"diff-new">the table</ins></var> .<ins class="diff-new">If there
are no such children, then it has no associated</ins>
<code><a href="#caption0"><ins class=
"diff-new">caption</ins></a></code> <ins class=
"diff-new">element.</ins></p>
</li>
<li>
<p>Let the <var title="">current element</var> be the first element
child of the <code><a href="#table">table</a></code> element.</p>
<p>If a step in this algorithm ever requires the <var title=
"">current element</var> to be <dfn id="advanced" title=
"concept-table-advance">advanced to the next child of the
<code>table</code></dfn> when there is no such next child, then the
<del class="diff-old">algorithm</del> <ins class="diff-chg">user
agent</ins> must <del class="diff-old">be aborted at that point
and</del> <ins class="diff-chg">jump to</ins> the <del class=
"diff-old">algorithm must return</del> <ins class="diff-chg">step
labeled</ins> <i><ins class="diff-chg">end</ins></i> ,<ins class=
"diff-chg">near</ins> the <del class="diff-old">table .</del>
<ins class="diff-chg">end of this algorithm.</ins></p>
</li>
<li>
<p>While the <var title="">current element</var> is not one of the
following elements, <a href="#advanced" title=
"concept-table-advance">advance <del class="diff-old">the current
element to the next child of the table</del></a> <del class=
"diff-old">: caption colgroup thead tbody tfoot tr If the current
element is a caption , then that is the caption element associated
with the table . Otherwise, it has no associated caption element.
If the current element is a caption , then while the current
element is not one of the following elements, advance</del> the
<var title="">current element</var> to the next child of the
<code><a href="#table">table</a></code> :</p>
<ul class="brief">
<li><code><a href="#colgroup">colgroup</a></code></li>
<li><code><a href="#thead0">thead</a></code></li>
<li><code><a href="#tbody">tbody</a></code></li>
<li><code><a href="#tfoot0">tfoot</a></code></li>
<li><code><a href="#tr">tr</a></code></li>
</ul>
<del class="diff-old">(Otherwise, the current element will already
be one of those elements.)</del></li>
<li>
<p>If the <var title="">current element</var> is a <code><a href=
"#colgroup">colgroup</a></code> , follow these substeps:</p>
<ol>
<li>
<p><i>Column <del class="diff-old">groups.</del> <ins class=
"diff-chg">groups</ins></i> : Process the <var title="">current
element</var> according to the appropriate <del class=
"diff-old">one of the following two cases:</del> <ins class=
"diff-chg">case below:</ins></p>
<dl class="switch">
<dt>If the <var title="">current element</var> has any
<code><a href="#col">col</a></code> element children</dt>
<dd>
<p>Follow these steps:</p>
<ol>
<li>
<p>Let <var title="">x <sub title="">start</sub></var> have the
value <ins class="diff-new">of</ins> <span><var title="">x
<sub title=""><del class="diff-old">max</del> <ins class=
"diff-chg">width</ins></sub></var> <del class=
"diff-old">+1</del></span> .</p>
</li>
<li>
<p>Let the <var title="">current column</var> be the first
<code><a href="#col">col</a></code> element child of the
<code><a href="#colgroup">colgroup</a></code> element.</p>
</li>
<li>
<p><del class="diff-old">Columns.</del> <i><ins class=
"diff-chg">Columns</ins></i> : If the <var title="">current
column</var> <code><a href="#col">col</a></code> element has a
<code title="attr-col-span"><a href="#span2">span</a></code>
attribute, then parse its value using the <a href="#rules">rules
for parsing non-negative integers</a> .</p>
<p>If the result of parsing the value is not an error or zero, then
let <var title="">span</var> be that value.</p>
<p>Otherwise, if the <code><a href="#col">col</a></code> element
has no <code title="attr-col-span"><a href="#span2">span</a></code>
attribute, or if trying to parse the attribute's value resulted in
an error, then let <var title="">span</var> be 1.</p>
</li>
<li>
<p>Increase <var title="">x <sub title=""><del class=
"diff-old">max</del> <ins class="diff-chg">width</ins></sub></var>
by <var title="">span</var> .</p>
</li>
<li>
<p>Let the last <var title="">span</var> <a href="#column" title=
"concept-column">columns</a> in <var title="">the table</var>
correspond to the <var title="">current column</var> <code><a href=
"#col">col</a></code> element.</p>
</li>
<li>
<p>If <var title="">current column</var> is not the last
<code><a href="#col">col</a></code> element child of the
<code><a href="#colgroup">colgroup</a></code> element, then let the
<var title="">current column</var> be the next <code><a href=
"#col">col</a></code> element child of the <code><a href=
"#colgroup">colgroup</a></code> element, and return to the
<del class="diff-old">third</del> step <del class="diff-old">of
this innermost group of steps (columns).</del> <ins class=
"diff-chg">labeled</ins> <i><ins class="diff-chg">columns</ins></i>
.</p>
</li>
<li>
<p>Let all the last <a href="#column" title=
"concept-column">columns</a> in <var title="">the table</var> from
<span>x= <var title="">x <sub title="">start</sub></var></span> to
<span>x= <var title="">x <sub title=""><del class=
"diff-old">max</del> <ins class="diff-chg">width</ins></sub></var>
<ins class="diff-chg">-1</ins></span> form a new <a href="#column0"
title="concept-column-group">column group</a> , anchored at the
slot ( <var title="">x <sub title="">start</sub></var> ,
<del class="diff-old">1),</del> <ins class="diff-chg">0),</ins>
with width <span><var title="">x <sub title=""><del class=
"diff-old">max</del> <ins class="diff-chg">width</ins></sub></var>
- <var title="">x <sub title="">start</sub></var> <del class=
"diff-old">-1,</del></span> , corresponding to the <code><a href=
"#colgroup">colgroup</a></code> element.</p>
</li>
</ol>
</dd>
<dt>If the <var title="">current element</var> has no
<code><a href="#col">col</a></code> element children</dt>
<dd>
<ol>
<li>
<p>If the <code><a href="#colgroup">colgroup</a></code> element has
a <code title="attr-colgroup-span"><a href="#span0">span</a></code>
attribute, then parse its value using the <a href="#rules">rules
for parsing non-negative integers</a> .</p>
<p>If the result of parsing the value is not an error or zero, then
let <var title="">span</var> be that value.</p>
<p>Otherwise, if the <code><a href="#colgroup">colgroup</a></code>
element has no <code title="attr-col-span"><a href=
"#span2">span</a></code> attribute, or if trying to parse the
attribute's value resulted in an error, then let <var title=
"">span</var> be 1.</p>
</li>
<li>
<p>Increase <var title="">x <sub title=""><del class=
"diff-old">max</del> <ins class="diff-chg">width</ins></sub></var>
by <var title="">span</var> .</p>
</li>
<li>
<p>Let the last <var title="">span</var> <a href="#column" title=
"concept-column">columns</a> in <var title="">the table</var> form
a new <a href="#column0" title="concept-column-group">column
group</a> , anchored at the slot ( <span><var title="">x
<sub title=""><del class="diff-old">max</del> <ins class=
"diff-chg">width</ins></sub></var> - <var title="">span</var>
<del class="diff-old">+1, 1),</del></span> , <ins class=
"diff-chg">0),</ins> with width <var title="">span</var> ,
corresponding to the <code><a href="#colgroup">colgroup</a></code>
element.</p>
</li>
</ol>
</dd>
</dl>
</li>
<li>
<p><a href="#advanced" title="concept-table-advance">Advance</a>
the <var title="">current element</var> to the next child of the
<code><a href="#table">table</a></code> .</p>
</li>
<li>
<p>While the <var title="">current element</var> is not one of the
following elements, <a href="#advanced" title=
"concept-table-advance">advance</a> the <var title="">current
element</var> to the next child of the <code><a href=
"#table">table</a></code> :</p>
<ul class="brief">
<li><code><a href="#colgroup">colgroup</a></code></li>
<li><code><a href="#thead0">thead</a></code></li>
<li><code><a href="#tbody">tbody</a></code></li>
<li><code><a href="#tfoot0">tfoot</a></code></li>
<li><code><a href="#tr">tr</a></code></li>
</ul>
</li>
<li>
<p>If the <var title="">current element</var> is a <code><a href=
"#colgroup">colgroup</a></code> element, jump to <ins class=
"diff-new">the</ins> step <del class="diff-old">1 in these substeps
(column groups).</del> <ins class="diff-chg">labeled</ins>
<i><ins class="diff-chg">column groups</ins></i> <ins class=
"diff-chg">above.</ins></p>
</li>
</ol>
</li>
<li>
<p>Let <var title="">y <sub title="">current</sub></var> be zero.
<del class="diff-old">When the algorithm is aborted, if y current
does not equal y max , then that is a table model error .</del></p>
</li>
<li>
<p>Let the <var title="">list of downward-growing cells</var> be an
empty list.</p>
</li>
<li>
<p><del class="diff-old">Rows.</del> <i><ins class=
"diff-chg">Rows</ins></i> : While the <var title="">current
element</var> is not one of the following elements, <a href=
"#advanced" title="concept-table-advance">advance</a> the
<var title="">current element</var> to the next child of the
<code><a href="#table">table</a></code> :</p>
<ul class="brief">
<li><code><a href="#thead0">thead</a></code></li>
<li><code><a href="#tbody">tbody</a></code></li>
<li><code><a href="#tfoot0">tfoot</a></code></li>
<li><code><a href="#tr">tr</a></code></li>
</ul>
</li>
<li>
<p>If the <var title="">current element</var> is a <code><a href=
"#tr">tr</a></code> , then run the <a href="#algorithm1">algorithm
for processing rows</a> , <a href="#advanced" title=
"concept-table-advance"><ins class="diff-new">advance</ins></a>
<del class="diff-old">(defined below),</del> <ins class=
"diff-chg">the</ins> <var title=""><ins class="diff-chg">current
element</ins></var> <ins class="diff-chg">to the next child of
the</ins> <code><a href="#table"><ins class=
"diff-chg">table</ins></a></code> ,<ins class="diff-chg">and return
to the step labeled</ins> <i><ins class="diff-chg">rows</ins></i>
.</p>
</li>
<li>
<p><ins class="diff-chg">Run the</ins> <a href=
"#algorithm0"><ins class="diff-chg">algorithm for ending a row
group</ins></a> .</p>
</li>
<li>
<p><ins class="diff-chg">If the</ins> <var title=""><ins class=
"diff-chg">current element</ins></var> <ins class="diff-chg">is
a</ins> <code><a href="#tfoot0"><ins class=
"diff-chg">tfoot</ins></a></code> , then <ins class="diff-new">add
that element to the list of</ins> <var title=""><ins class=
"diff-new">pending</ins> <code><a href="#tfoot0"><ins class=
"diff-new">tfoot</ins></a></code> <ins class=
"diff-new">elements</ins></var> ,<a href="#advanced" title=
"concept-table-advance"><ins class="diff-new">advance</ins></a>
<ins class="diff-new">the</ins> <var title=""><ins class=
"diff-new">current element</ins></var> <ins class="diff-new">to the
next child of the</ins> <code><a href="#table"><ins class=
"diff-new">table</ins></a></code> ,<ins class="diff-new">and</ins>
return to the <del class="diff-old">previous</del> step <del class=
"diff-old">(rows).</del> <ins class="diff-chg">labeled</ins>
<i><ins class="diff-chg">rows</ins></i> .</p>
</li>
<li>
<p><del class="diff-old">Otherwise,</del> <ins class=
"diff-chg">The</ins> <var title=""><ins class="diff-chg">current
element</ins></var> <ins class="diff-chg">is either a</ins>
<code><a href="#thead0"><ins class=
"diff-chg">thead</ins></a></code> <ins class="diff-chg">or a</ins>
<code><a href="#tbody"><ins class="diff-chg">tbody</ins></a></code>
.</p>
<p><ins class="diff-chg">Run the</ins> <a href=
"#algorithm"><ins class="diff-chg">algorithm for processing row
groups</ins></a> .</p>
</li>
<li>
<p><a href="#advanced" title="concept-table-advance"><ins class=
"diff-chg">Advance</ins></a> <ins class="diff-chg">the</ins>
<var title=""><ins class="diff-chg">current element</ins></var>
<ins class="diff-chg">to the next child of the</ins> <code><a href=
"#table"><ins class="diff-chg">table</ins></a></code> .</p>
</li>
<li>
<p><ins class="diff-chg">Return to the step labeled</ins>
<i><ins class="diff-chg">rows</ins></i> .</p>
</li>
<li>
<p><i><ins class="diff-chg">End</ins></i> :<ins class=
"diff-chg">For each</ins> <code><a href="#tfoot0"><ins class=
"diff-chg">tfoot</ins></a></code> <ins class="diff-chg">element in
the list of</ins> <var title=""><ins class="diff-chg">pending</ins>
<code><a href="#tfoot0"><ins class=
"diff-chg">tfoot</ins></a></code> <ins class=
"diff-chg">elements</ins></var> ,<ins class="diff-chg">in tree
order,</ins> run the <a href="#algorithm">algorithm for <del class=
"diff-old">ending</del> <ins class="diff-chg">processing row
groups</ins></a> .</p>
</li>
<li>
<p><ins class="diff-chg">If there exists</ins> a <a href="#row0"
title="concept-row">row <del class="diff-old">group</del></a>
<ins class="diff-chg">or</ins> <a href="#column" title=
"concept-column"><ins class="diff-chg">column</ins></a> <ins class=
"diff-chg">in the</ins> <a href="#table1" title=
"concept-table"><ins class="diff-chg">table</ins></a> <var title=
""><ins class="diff-chg">the table</ins></var> <ins class=
"diff-chg">containing only</ins> <span title=
"concept-slot"><ins class="diff-chg">slots</ins></span> <ins class=
"diff-chg">that do not have a</ins> <a href="#cell" title=
"concept-cell"><ins class="diff-chg">cell</ins></a> <ins class=
"diff-chg">anchored to them, then this is a</ins> <a href=
"#table2"><ins class="diff-chg">table model error</ins></a> .</p>
</li>
<li>
<p><ins class="diff-new">Return</ins> <var title=""><ins class=
"diff-new">the table</ins></var> .</p>
</li>
</ol>
<p><ins class="diff-new">The</ins> <dfn id="algorithm"><ins class=
"diff-new">algorithm for processing row groups</ins></dfn>
,<ins class="diff-new">which is invoked by the set of steps above
for processing</ins> <code><a href="#thead0"><ins class=
"diff-new">thead</ins></a></code> ,<code><a href=
"#tbody"><ins class="diff-new">tbody</ins></a></code> ,<ins class=
"diff-new">and</ins> <code><a href="#tfoot0"><ins class=
"diff-new">tfoot</ins></a></code> <ins class="diff-new">elements,
is:</ins></p>
<ol>
<li>
<p>Let <var title="">y <sub title="">start</sub></var> have the
value <ins class="diff-chg">of</ins> <var title="">y <sub title=
""><del class="diff-old">max</del> <ins class=
"diff-chg">height</ins></sub> <del class="diff-old">+1
.</del></var> .</p>
</li>
<li>
<p>For each <code><a href="#tr">tr</a></code> element that is a
child of the <del class="diff-old">current</del> element
<del class="diff-old">,</del> <ins class="diff-chg">being
processed,</ins> in tree order, run the <a href=
"#algorithm1">algorithm for processing rows <del class=
"diff-old">(defined below).</del></a> .</p>
</li>
<li>
<p>If <span><var title="">y <sub title=""><del class=
"diff-old">max</del> <ins class="diff-chg">height</ins></sub></var>
<del class="diff-old"> ≥ </del> <ins class=
"diff-chg"> > </ins> <var title="">y <sub title=
"">start</sub></var></span> , then let all the last <a href="#row0"
title="concept-row">rows</a> in <var title="">the table</var> from
<span>y= <var title="">y <sub title="">start</sub></var></span> to
<span>y= <var title="">y <sub title=""><del class=
"diff-old">max</del> <ins class="diff-chg">height</ins></sub></var>
<ins class="diff-chg">-1</ins></span> form a new <a href=
"#row-group" title="concept-row-group">row group</a> , anchored at
the slot with coordinate <del class="diff-old">(1,</del>
<ins class="diff-chg">(0,</ins> <var title="">y <sub title=
"">start</sub></var> ), with height <span><var title="">y
<sub title=""><del class="diff-old">max</del> <ins class=
"diff-chg">height</ins></sub></var> - <var title="">y <sub title=
"">start</sub></var> <del class="diff-old">+1,</del></span> ,
corresponding to the <var title="">current element</var> .</p>
</li>
<li>
<p>Run the <a href="#algorithm0">algorithm for ending a row group
<del class="diff-old">again. Return to step 12 (rows).</del></a>
.</p>
</li>
</ol>
<p>The <dfn id="algorithm0">algorithm for ending a row group</dfn>
, which is invoked by the set of steps above when starting and
ending a block of rows, is:</p>
<ol>
<li>
<p><del class="diff-old">If y current is less than y max , then
this is a table model error .</del> While <var title="">y
<sub title="">current</sub></var> is less than <var title="">y
<sub title=""><del class="diff-old">max</del> <ins class=
"diff-chg">height</ins></sub></var> , follow these steps:</p>
<ol>
<li>
<p><ins class="diff-new">Run the</ins> <a href=
"#algorithm2"><ins class="diff-new">algorithm for growing
downward-growing cells</ins></a> .</p>
</li>
<li>
<p>Increase <var title="">y <sub title="">current</sub></var> by
1.</p>
<del class="diff-old">Run the algorithm for growing
downward-growing cells .</del></li>
</ol>
</li>
<li>
<p>Empty the <var title="">list of downward-growing cells</var>
.</p>
</li>
</ol>
<p>The <dfn id="algorithm1">algorithm for processing rows</dfn> ,
which is invoked by the set of steps above for processing
<code><a href="#tr">tr</a></code> elements, is:</p>
<ol>
<li>
<p><del class="diff-old">Increase</del> <ins class=
"diff-chg">If</ins> <var title=""><ins class="diff-chg">y</ins>
<sub title=""><ins class="diff-chg">height</ins></sub></var>
<ins class="diff-chg">is equal to</ins> <var title="">y <sub title=
"">current</sub></var> , <ins class="diff-new">then increase</ins>
<var title=""><ins class="diff-new">y</ins> <sub title=
""><ins class="diff-new">height</ins></sub></var> by 1. <del class=
"diff-old">Run the algorithm for growing downward-growing cells
.</del> <ins class="diff-chg">(</ins> <var title=""><ins class=
"diff-chg">y</ins> <sub title=""><ins class=
"diff-chg">current</ins></sub></var> <ins class="diff-chg">is
never</ins> <em><ins class="diff-chg">greater</ins></em>
<ins class="diff-chg">than</ins> <var title=""><ins class=
"diff-chg">y</ins> <sub title=""><ins class=
"diff-chg">height</ins></sub></var> .)</p>
</li>
<li>
<p>Let <var title="">x <sub title="">current</sub></var> be
<del class="diff-old">1. If the tr element being processed contains
no td or th elements, then abort this set of steps and return to
the algorithm above.</del> <ins class="diff-chg">0.</ins></p>
</li>
<li>
<p>Let <var title="">current cell</var> be the first <code><a href=
"#td">td</a></code> or <code><a href="#th">th</a></code> element in
the <code><a href="#tr">tr</a></code> element being processed.</p>
</li>
<li>
<p><ins class="diff-new">Run the</ins> <a href=
"#algorithm2"><ins class="diff-new">algorithm for growing
downward-growing cells</ins></a> .</p>
</li>
<li>
<p><del class="diff-old">Cells.</del> <i><ins class=
"diff-chg">Cells</ins></i> : While <var title="">x <sub title=
"">current</sub></var> is less than <del class="diff-old">or equal
to</del> <var title="">x <sub title=""><del class=
"diff-old">max</del> <ins class="diff-chg">width</ins></sub></var>
and the slot with coordinate ( <var title="">x <sub title=
"">current</sub></var> , <var title="">y <sub title=
"">current</sub></var> ) already has a cell assigned to it,
increase <var title="">x <sub title="">current</sub></var> by
1.</p>
</li>
<li>
<p>If <var title="">x <sub title="">current</sub></var> is
<del class="diff-old">greater than</del> <ins class=
"diff-chg">equal to</ins> <var title="">x <sub title=""><del class=
"diff-old">max</del> <ins class="diff-chg">width</ins></sub></var>
, increase <var title="">x <sub title=""><del class=
"diff-old">max</del> <ins class="diff-chg">width</ins></sub></var>
by <del class="diff-old">1 (which will make them equal).</del>
<ins class="diff-chg">1. (</ins> <var title=""><ins class=
"diff-chg">x</ins> <sub title=""><ins class=
"diff-chg">current</ins></sub></var> <ins class="diff-chg">is
never</ins> <em><ins class="diff-chg">greater</ins></em>
<ins class="diff-chg">than</ins> <var title=""><ins class=
"diff-chg">x</ins> <sub title=""><ins class=
"diff-chg">width</ins></sub></var> .)</p>
</li>
<li>
<p>If the <var title="">current cell</var> has a <code title=
"attr-tdth-colspan"><a href="#colspan">colspan</a></code>
attribute, then <a href="#rules" title=
"rules for parsing non-negative integers">parse that attribute's
value <del class="diff-old">,</del></a> , and let <var title=
"">colspan</var> be the result.</p>
<p>If parsing that value failed, or returned zero, or if the
attribute is absent, then let <var title="">colspan</var> be 1,
instead.</p>
</li>
<li>
<p>If the <var title="">current cell</var> has a <code title=
"attr-tdth-rowspan"><a href="#rowspan">rowspan</a></code>
attribute, then <a href="#rules" title=
"rules for parsing non-negative integers">parse that attribute's
value <del class="diff-old">,</del></a> , and let <var title=
"">rowspan</var> be the result.</p>
<p>If parsing that value failed or if the attribute is absent, then
let <var title="">rowspan</var> be 1, instead.</p>
</li>
<li>
<p>If <var title="">rowspan</var> is zero, then let <var title=
"">cell grows downward</var> be true, and set <var title=
"">rowspan</var> to 1. Otherwise, let <var title="">cell grows
downward</var> be false.</p>
</li>
<li>
<p>If <span><var title="">x <sub title=""><del class=
"diff-old">max</del> <ins class="diff-chg">width</ins></sub></var>
< <var title="">x <sub title="">current</sub></var>
+ <var title="">colspan</var> <del class="diff-old">-1</del></span>
, then let <var title="">x <sub title=""><del class=
"diff-old">max</del> <ins class="diff-chg">width</ins></sub></var>
be <span><var title="">x <sub title="">current</sub></var> +
<var title="">colspan</var> <del class="diff-old">-1.</del></span>
.</p>
</li>
<li>
<p>If <span><var title="">y <sub title=""><del class=
"diff-old">max</del> <ins class="diff-chg">height</ins></sub></var>
< <var title="">y <sub title="">current</sub></var>
+ <var title="">rowspan</var> <del class="diff-old">-1</del></span>
, then let <var title="">y <sub title=""><del class=
"diff-old">max</del> <ins class="diff-chg">height</ins></sub></var>
be <span><var title="">y <sub title="">current</sub></var> +
<var title="">rowspan</var> <del class="diff-old">-1.</del></span>
.</p>
</li>
<li>
<p>Let the slots with coordinates ( <var title="">x</var> ,
<var title="">y</var> ) such that <span><var title="">x <sub title=
"">current</sub></var> ≤ <var title="">x</var>
< <var title="">x <sub title="">current</sub></var>
+ <var title="">colspan</var></span> and <span><var title="">y
<sub title="">current</sub></var> ≤ <var title=
"">y</var> < <var title="">y <sub title=
"">current</sub></var> + <var title="">rowspan</var></span> be
covered by a new <a href="#cell" title="concept-cell">cell</a>
<var title="">c</var> , anchored at ( <var title="">x <sub title=
"">current</sub></var> , <var title="">y <sub title=
"">current</sub></var> ), which has width <var title=
"">colspan</var> and height <var title="">rowspan</var> ,
corresponding to the <var title="">current cell</var> element.</p>
<p>If the <var title="">current cell</var> element is a
<code><a href="#th">th</a></code> element, let this new cell
<var title="">c</var> be a header cell; otherwise, let it be a data
cell. To establish what header cells apply to a data cell, use the
<a href="#algorithm3">algorithm for assigning header cells to data
cells</a> described in the next section.</p>
<p>If any of the slots involved already had a <a href="#cell"
title="concept-cell">cell</a> covering them, then this is a
<a href="#table2">table model error</a> . Those slots now have two
cells overlapping.</p>
</li>
<li>
<p>If <var title="">cell grows downward</var> is true, then add the
tuple { <var title="">c</var> , <var title="">x <sub title=
"">current</sub></var> , <var title="">colspan</var> } to the
<var title="">list of downward-growing cells</var> .</p>
</li>
<li>
<p>Increase <var title="">x <sub title="">current</sub></var> by
<var title="">colspan</var> .</p>
</li>
<li>
<p>If <var title="">current cell</var> is the last <code><a href=
"#td">td</a></code> or <code><a href="#th">th</a></code> element in
the <code><a href="#tr">tr</a></code> element being processed, then
<ins class="diff-new">increase</ins> <var title=""><ins class=
"diff-new">y</ins> <sub title=""><ins class=
"diff-new">current</ins></sub></var> <ins class="diff-new">by
1,</ins> abort this set of <del class="diff-old">steps</del>
<ins class="diff-chg">steps,</ins> and return to the algorithm
above.</p>
</li>
<li>
<p>Let <var title="">current cell</var> be the next <code><a href=
"#td">td</a></code> or <code><a href="#th">th</a></code> element in
the <code><a href="#tr">tr</a></code> element being processed.</p>
</li>
<li>
<p>Return to step 5 (cells).</p>
</li>
</ol>
<p><del class="diff-old">The</del> <ins class="diff-chg">When the
algorithms above require the user agent to run the</ins> <dfn id=
"algorithm2">algorithm for growing downward-growing cells</dfn> ,
<del class="diff-old">used when adding a new row, is as follows: If
the list of downward-growing cells is empty, do nothing. Abort
these steps; return to</del> the <del class="diff-old">step that
invoked this algorithm. Otherwise, if y max is less than y current
, then increase y max by 1 (this will make it equal to y current ).
For</del> <ins class="diff-chg">user agent must, for</ins> each {
<var title="">cell</var> , <var title="">cell <sub title=
"">x</sub></var> , <var title="">width</var> } tuple in the
<var title="">list of downward-growing cells</var> , <ins class=
"diff-new">if any,</ins> extend the <a href="#cell" title=
"concept-cell">cell</a> <var title="">cell</var> so that it also
covers the slots with coordinates ( <var title="">x</var> ,
<var title="">y <sub title="">current</sub></var> ), where
<span><var title="">cell <sub title="">x</sub></var> ≤
<var title="">x</var> < <var title="">cell
<sub title="">x</sub></var> + <var title="">width</var> <del class=
"diff-old">-1</del></span> . <del class="diff-old">If, after
establishing which elements correspond to which slots, there exists
a column in the table containing only slots that do not have a cell
anchored to them, then this is a table model error .</del></p>
<h5 id="header-and-data-cell-semantics"><span class=
"secno"><del class="diff-old">3.15.11.2.</del> <ins class=
"diff-chg">3.13.13.2.</ins></span> Forming relationships between
data cells and header cells</h5>
<p>Each data cell can be assigned zero or more header cells. The
<dfn id="algorithm3">algorithm for assigning header cells to data
cells</dfn> is as follows.</p>
<ol>
<li>
<p>For each header cell in the table, in <a href="#tree-order">tree
order <del class="diff-old">:</del></a> , <ins class="diff-chg">run
these substeps:</ins></p>
<ol>
<li>
<p>Let ( <var title="">header <sub title="">x</sub></var> ,
<var title="">header <sub title="">y</sub></var> ) be the
coordinate of the slot to which the header cell is anchored.</p>
</li>
<li>
<p><ins class="diff-new">Let</ins> <var title=""><ins class=
"diff-new">header</ins> <sub title=""><ins class=
"diff-new">width</ins></sub></var> <ins class="diff-new">be the
width of the header cell.</ins></p>
</li>
<li>
<p><ins class="diff-new">Let</ins> <var title=""><ins class=
"diff-new">header</ins> <sub title=""><ins class=
"diff-new">height</ins></sub></var> <ins class="diff-new">be the
height of the header cell.</ins></p>
</li>
<li>
<p><ins class="diff-new">Let</ins> <var title=""><ins class=
"diff-new">data cells</ins></var> <ins class="diff-new">be a list
of data cells, initially empty.</ins></p>
</li>
<li>
<p>Examine the <code title="attr-th-scope"><a href=
"#scope0">scope</a></code> attribute of the <code><a href=
"#th">th</a></code> element corresponding to the header cell, and,
based on its state, apply the appropriate substep:</p>
<dl class="switch">
<dt>If it is in the <em title="attr-th-scope-row"><a href=
"#row">row</a></em> state</dt>
<dd>
<p><del class="diff-old">Assign</del> <ins class="diff-chg">Add
all</ins> the <del class="diff-old">header cell to any</del> data
cells <del class="diff-old">anchored at</del> <ins class=
"diff-chg">that cover</ins> slots with coordinates ( <var title=
""><del class="diff-old">data</del> <ins class=
"diff-chg">slot</ins> <sub title="">x</sub></var> , <var title=
""><del class="diff-old">data</del> <ins class=
"diff-chg">slot</ins> <sub title="">y</sub></var> <del class=
"diff-old">)</del> <ins class="diff-chg">),</ins> where
<span><var title="">header <sub title="">x</sub></var> <del class=
"diff-old"> < </del> <ins class="diff-chg">+</ins>
<var title=""><del class="diff-old">data</del> <ins class=
"diff-chg">header</ins> <sub title=""><del class="diff-old">x</del>
<ins class="diff-chg">width</ins></sub></var> ≤
<var title=""><ins class="diff-new">slot</ins> <sub title=
""><ins class="diff-new">x</ins></sub></var> <ins class=
"diff-new"> < </ins> <var title="">x <sub title=
""><del class="diff-old">max</del> <ins class=
"diff-chg">width</ins></sub></var></span> and <span><var title=
""><del class="diff-old">data</del> <ins class=
"diff-chg">header</ins> <sub title="">y</sub></var> <del class=
"diff-old"> = </del> <ins class=
"diff-chg"> ≤ </ins> <var title=""><ins class=
"diff-chg">slot</ins> <sub title=""><ins class=
"diff-chg">y</ins></sub></var> <ins class=
"diff-chg"> < </ins> <var title="">header <sub title=
"">y</sub></var> <ins class="diff-new">+</ins> <var title=
""><ins class="diff-new">header</ins> <sub title=""><ins class=
"diff-new">height</ins></sub></var> <del class=
"diff-old">.</del></span> , <ins class="diff-chg">to the</ins>
<var title=""><ins class="diff-chg">data cells</ins></var>
<ins class="diff-chg">list.</ins></p>
</dd>
<dt>If it is in the <em title="attr-th-scope-col"><a href=
"#col0">column</a></em> state</dt>
<dd>
<p><del class="diff-old">Assign</del> <ins class="diff-chg">Add
all</ins> the <del class="diff-old">header cell to any</del> data
cells <del class="diff-old">anchored at</del> <ins class=
"diff-chg">that cover</ins> slots with coordinates ( <var title=
""><del class="diff-old">data</del> <ins class=
"diff-chg">slot</ins> <sub title="">x</sub></var> , <var title=
""><del class="diff-old">data</del> <ins class=
"diff-chg">slot</ins> <sub title="">y</sub></var> <del class=
"diff-old">)</del> <ins class="diff-chg">),</ins> where
<span><var title=""><del class="diff-old">data</del> <ins class=
"diff-chg">header</ins> <sub title="">x</sub></var> <del class=
"diff-old"> = </del> <ins class=
"diff-chg"> ≤ </ins> <var title=""><ins class=
"diff-chg">slot</ins> <sub title=""><ins class=
"diff-chg">x</ins></sub></var> <ins class=
"diff-chg"> < </ins> <var title="">header <sub title=
"">x</sub></var> <ins class="diff-new">+</ins> <var title=
""><ins class="diff-new">header</ins> <sub title=""><ins class=
"diff-new">width</ins></sub></var></span> and <span><var title=
"">header <sub title="">y</sub></var> <del class=
"diff-old"> < </del> <ins class="diff-chg">+</ins>
<var title=""><del class="diff-old">data</del> <ins class=
"diff-chg">header</ins> <sub title=""><del class="diff-old">y</del>
<ins class="diff-chg">height</ins></sub></var> ≤
<var title=""><ins class="diff-new">slot</ins> <sub title=
""><ins class="diff-new">y</ins></sub></var> <ins class=
"diff-new"> < </ins> <var title="">y <sub title=
""><del class="diff-old">max</del> <ins class=
"diff-chg">height</ins></sub></var> <del class=
"diff-old">.</del></span> , <ins class="diff-chg">to the</ins>
<var title=""><ins class="diff-chg">data cells</ins></var>
<ins class="diff-chg">list.</ins></p>
</dd>
<dt>If it is in the <em title="attr-th-scope-rowgroup"><a href=
"#rowgroup">row group</a></em> state</dt>
<dd>
<p>If the header cell is not in a <a href="#row-group" title=
"concept-row-group">row group</a> , then <del class=
"diff-old">don't assign the header cell to any data cells.</del>
<ins class="diff-chg">do nothing.</ins></p>
<p>Otherwise, let <del class="diff-old">(1,</del> <ins class=
"diff-chg">(0,</ins> <var title="">group <sub title=
"">y</sub></var> ) be the slot at which the row group is anchored,
let <var title="">height</var> be the number of rows in the row
group, and <del class="diff-old">assign</del> <ins class=
"diff-chg">add all</ins> the <del class="diff-old">header cell to
any</del> data cells <del class="diff-old">anchored at</del>
<ins class="diff-chg">that cover</ins> slots with coordinates (
<var title=""><del class="diff-old">data</del> <ins class=
"diff-chg">slot</ins> <sub title="">x</sub></var> , <var title=
""><del class="diff-old">data</del> <ins class=
"diff-chg">slot</ins> <sub title="">y</sub></var> <del class=
"diff-old">)</del> <ins class="diff-chg">),</ins> where
<span><var title="">header <sub title="">x</sub></var>
≤ <var title=""><del class="diff-old">data</del>
<ins class="diff-chg">slot</ins> <sub title="">x</sub></var>
<del class="diff-old"> ≤ </del> <ins class=
"diff-chg"> < </ins> <var title="">x <sub title=
""><del class="diff-old">max</del> <ins class=
"diff-chg">width</ins></sub></var></span> and <span><var title=
"">header <sub title="">y</sub></var> ≤ <var title=
""><del class="diff-old">data</del> <ins class=
"diff-chg">slot</ins> <sub title="">y</sub></var> <
<var title="">group <sub title="">y</sub></var> + <var title=
"">height</var> <del class="diff-old">.</del></span> , <ins class=
"diff-chg">to the</ins> <var title=""><ins class="diff-chg">data
cells</ins></var> <ins class="diff-chg">list.</ins></p>
</dd>
<dt>If it is in the <em title="attr-th-scope-colgroup"><a href=
"#colgroup0">column group</a></em> state</dt>
<dd>
<p>If the header cell is not <ins class="diff-new">anchored</ins>
in a <a href="#column0" title="concept-column-group">column
group</a> , then <del class="diff-old">don't assign the header cell
to any data cells.</del> <ins class="diff-chg">do
nothing.</ins></p>
<p>Otherwise, let ( <var title="">group <sub title="">x</sub></var>
, <del class="diff-old">1)</del> <ins class="diff-chg">0)</ins> be
the slot at which <del class="diff-old">the</del> <ins class=
"diff-chg">that</ins> column group is anchored, let <var title=
"">width</var> be the number of columns in the column group, and
<del class="diff-old">assign</del> <ins class="diff-chg">add
all</ins> the <del class="diff-old">header cell to any</del> data
cells <del class="diff-old">anchored at</del> <ins class=
"diff-chg">that cover</ins> slots with coordinates ( <var title=
""><del class="diff-old">data</del> <ins class=
"diff-chg">slot</ins> <sub title="">x</sub></var> , <var title=
""><del class="diff-old">data</del> <ins class=
"diff-chg">slot</ins> <sub title="">y</sub></var> <del class=
"diff-old">)</del> <ins class="diff-chg">),</ins> where
<span><var title="">header <sub title="">x</sub></var>
≤ <var title=""><del class="diff-old">data</del>
<ins class="diff-chg">slot</ins> <sub title="">x</sub></var>
< <var title="">group <sub title="">x</sub></var> +
<var title="">width</var></span> and <span><var title="">header
<sub title="">y</sub></var> ≤ <var title=""><del class=
"diff-old">data</del> <ins class="diff-chg">slot</ins> <sub title=
"">y</sub></var> <del class="diff-old"> ≤ </del>
<ins class="diff-chg"> < </ins> <var title="">y
<sub title=""><del class="diff-old">max</del> <ins class=
"diff-chg">height</ins></sub></var> <del class=
"diff-old">.</del></span> , <ins class="diff-chg">to the</ins>
<var title=""><ins class="diff-chg">data cells</ins></var>
<ins class="diff-chg">list.</ins></p>
</dd>
<dt>Otherwise, it is in the <em title="">auto</em> state</dt>
<dd>
<p><ins class="diff-new">Run these steps:</ins></p>
<ol>
<li>
<p>If the header cell is <del class="diff-old">not in the first row
of the table, or not in the first cell of</del> <a href=
"#equivalent"><ins class="diff-chg">equivalent to</ins> a
<del class="diff-old">row,</del> <ins class="diff-chg">wide
cell</ins></a> ,<ins class="diff-chg">let</ins> <var title=
""><ins class="diff-chg">header</ins> <sub title=""><ins class=
"diff-chg">width</ins></sub></var> <ins class=
"diff-chg">equal</ins> <span><var title=""><ins class=
"diff-chg">x</ins> <sub title=""><ins class=
"diff-chg">width</ins></sub></var> <ins class="diff-chg">-</ins>
<var title=""><ins class="diff-chg">header</ins> <sub title=
""><ins class="diff-chg">x</ins></sub></var></span> .<a href=
"#references"><ins class="diff-chg">[UNICODE]</ins></a></p>
</li>
<li>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">x</ins></var> <ins class="diff-chg">equal</ins>
<span><var title=""><ins class="diff-chg">header</ins> <sub title=
""><ins class="diff-chg">x</ins></sub></var> <ins class=
"diff-chg">+</ins> <var title=""><ins class="diff-chg">header</ins>
<sub title=""><ins class="diff-chg">width</ins></sub></var></span>
.</p>
</li>
<li>
<p><i><ins class="diff-chg">Horizontal</ins></i> :<ins class=
"diff-chg">If</ins> <var title=""><ins class=
"diff-chg">x</ins></var> <ins class="diff-chg">is equal to</ins>
<var title=""><ins class="diff-chg">x</ins> <sub title=
""><ins class="diff-chg">width</ins></sub></var> , then <del class=
"diff-old">don't assign</del> <ins class="diff-chg">jump down
to</ins> the <ins class="diff-new">step below labeled</ins>
<i><ins class="diff-new">vertical</ins></i> .</p>
</li>
<li>
<p><ins class="diff-new">If there is a</ins> header cell
<ins class="diff-new">anchored at (</ins> <var title=""><ins class=
"diff-new">x</ins></var> ,<var title=""><ins class=
"diff-new">header</ins> <sub title=""><ins class=
"diff-new">y</ins></sub></var> <ins class="diff-new">) with
height</ins> <var title=""><ins class="diff-new">header</ins>
<sub title=""><ins class="diff-new">height</ins></sub></var>
,<ins class="diff-new">then jump down</ins> to <del class=
"diff-old">any</del> <ins class="diff-chg">the step below
labeled</ins> <i><ins class="diff-chg">vertical</ins></i> .</p>
</li>
<li>
<p><ins class="diff-chg">Add all the</ins> data <del class=
"diff-old">cells.</del> <ins class="diff-chg">cells that cover
slots with coordinates (</ins> <var title=""><ins class=
"diff-chg">slot</ins> <sub title=""><ins class=
"diff-chg">x</ins></sub></var> ,<var title=""><ins class=
"diff-chg">slot</ins> <sub title=""><ins class=
"diff-chg">y</ins></sub></var> <ins class="diff-chg">), where</ins>
<span><var title=""><ins class="diff-chg">slot</ins> <sub title=
""><ins class="diff-chg">x</ins></sub></var> <ins class=
"diff-chg"> = </ins> <var title=""><ins class=
"diff-chg">x</ins></var></span> <ins class="diff-chg">and</ins>
<span><var title=""><ins class="diff-chg">header</ins> <sub title=
""><ins class="diff-chg">y</ins></sub></var> <ins class=
"diff-chg"> ≤ </ins> <var title=""><ins class=
"diff-chg">slot</ins> <sub title=""><ins class=
"diff-chg">y</ins></sub></var> <ins class=
"diff-chg"> < </ins> <var title=""><ins class=
"diff-chg">header</ins> <sub title=""><ins class=
"diff-chg">y</ins></sub></var> <ins class="diff-chg">+</ins>
<var title=""><ins class="diff-chg">header</ins> <sub title=
""><ins class="diff-chg">height</ins></sub></var></span>
,<ins class="diff-chg">to the</ins> <var title=""><ins class=
"diff-chg">data cells</ins></var> <ins class=
"diff-chg">list.</ins></p>
</li>
<li>
<p><del class="diff-old">Otherwise, if</del> <ins class=
"diff-chg">Increase</ins> <var title=""><ins class=
"diff-chg">x</ins></var> <ins class="diff-chg">by 1.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Jump up to</ins> the <ins class=
"diff-new">step above labeled</ins> <i><ins class=
"diff-new">horizontal</ins></i> .</p>
</li>
<li>
<p><i><ins class="diff-new">Vertical</ins></i> :<ins class=
"diff-new">Let</ins> <var title=""><ins class=
"diff-new">y</ins></var> <ins class="diff-new">equal</ins>
<span><var title="">header <sub title=""><ins class=
"diff-new">y</ins></sub></var> <ins class="diff-new">+</ins>
<var title=""><ins class="diff-new">header</ins> <sub title=
""><ins class="diff-new">height</ins></sub></var></span> .</p>
</li>
<li>
<p><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">y</ins></var> <ins class="diff-new">is equal to</ins>
<var title=""><ins class="diff-new">y</ins> <sub title=
""><ins class="diff-new">height</ins></sub></var> ,<ins class=
"diff-new">then jump to the step below labeled</ins> <i><ins class=
"diff-new">end</ins></i> .</p>
</li>
<li>
<p><ins class="diff-new">If there is a header cell</ins>
<var title=""><ins class="diff-new">cell</ins></var> <ins class=
"diff-new">anchored at (</ins> <var title=""><ins class=
"diff-new">header</ins> <sub title=""><ins class=
"diff-new">x</ins></sub></var> ,<var title=""><ins class=
"diff-new">y</ins></var> <ins class="diff-new">), then follow these
substeps:</ins></p>
<ol>
<li>
<p><ins class="diff-new">If the header cell</ins> <var title=
"">cell</var> is <del class="diff-old">in</del> <a href=
"#equivalent"><ins class="diff-chg">equivalent to a wide
cell</ins></a> ,<ins class="diff-chg">then let</ins> <var title=
""><ins class="diff-chg">width</ins></var> <ins class=
"diff-chg">be</ins> <span><var title=""><ins class=
"diff-chg">x</ins> <sub title=""><ins class=
"diff-chg">width</ins></sub></var> <ins class="diff-chg">-</ins>
<var title=""><ins class="diff-chg">header</ins> <sub title=
""><ins class="diff-chg">x</ins></sub></var></span> .<ins class=
"diff-chg">Otherwise, let</ins> <var title=""><ins class=
"diff-chg">width</ins></var> <ins class="diff-chg">be</ins> the
<del class="diff-old">first row</del> <ins class=
"diff-chg">width</ins> of the <del class="diff-old">table, assign
the</del> header cell <var title=""><ins class=
"diff-new">cell</ins></var> .</p>
</li>
<li>
<p><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">width</ins></var> <ins class="diff-new">is equal</ins>
to <del class="diff-old">any</del> <var title=""><ins class=
"diff-chg">header</ins> <sub title=""><ins class=
"diff-chg">width</ins></sub></var> ,<ins class="diff-chg">then jump
to the step below labeled</ins> <i><ins class=
"diff-chg">end</ins></i> .</p>
</li>
</ol>
</li>
<li>
<p><ins class="diff-chg">Add all the</ins> data cells <del class=
"diff-old">anchored at</del> <ins class="diff-chg">that cover</ins>
slots with coordinates ( <var title=""><del class=
"diff-old">data</del> <ins class="diff-chg">slot</ins> <sub title=
"">x</sub></var> , <var title=""><del class="diff-old">data</del>
<ins class="diff-chg">slot</ins> <sub title="">y</sub></var>
<del class="diff-old">)</del> <ins class="diff-chg">),</ins> where
<span><var title=""><del class="diff-old">data</del> <ins class=
"diff-chg">header</ins> <sub title="">x</sub></var> <del class=
"diff-old"> = </del> <ins class=
"diff-chg"> ≤ </ins> <var title=""><ins class=
"diff-chg">slot</ins> <sub title=""><ins class=
"diff-chg">x</ins></sub></var> <ins class=
"diff-chg"> < </ins> <var title="">header <sub title=
"">x</sub></var> <ins class="diff-new">+</ins> <var title=
""><ins class="diff-new">header</ins> <sub title=""><ins class=
"diff-new">width</ins></sub></var></span> and <span><var title=
""><del class="diff-old">header</del> <ins class=
"diff-chg">slot</ins> <sub title="">y</sub></var> <del class=
"diff-old"> < </del> <ins class=
"diff-chg"> = </ins> <var title=""><del class=
"diff-old">data</del> y</var></span> , <ins class="diff-new">to
the</ins> <var title=""><ins class="diff-new">data
cells</ins></var> <del class="diff-old"> ≤ </del>
<ins class="diff-chg">list.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Increase</ins> <var title="">y <del class=
"diff-old">max</del></var> <ins class="diff-chg">by 1.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Jump up to the step above labeled</ins>
<i><ins class="diff-chg">vertical</ins></i> .</p>
</li>
<li>
<p><i><ins class="diff-new">End</ins></i> :<ins class=
"diff-new">Coalesce all the duplicate entries in the</ins>
<var title=""><ins class="diff-new">data cells</ins></var>
<ins class="diff-new">list, so that each data cell is only present
once, in tree order.</ins></p>
</li>
</ol>
</dd>
</dl>
</li>
<li>
<p><ins class="diff-new">Assign the header cell to all the data
cells in the</ins> <var title=""><ins class="diff-new">data
cells</ins></var> <ins class="diff-new">list that correspond
to</ins> <code><del class="diff-old">.</del> <a href=
"#td"><ins class="diff-chg">td</ins></a></code> <ins class=
"diff-chg">elements that do not have a</ins> <code title=
"attr-td-headers"><a href="#headers"><ins class=
"diff-chg">headers</ins></a></code> <ins class="diff-chg">attribute
specified.</ins></p>
</li>
</ol>
</li>
<li>
<p><ins class="diff-chg">For each data cell in the table, in</ins>
<a href="#tree-order"><ins class="diff-chg">tree order</ins></a>
,<ins class="diff-chg">run these substeps:</ins></p>
<ol>
<li>
<p><ins class="diff-chg">If the data cell corresponds to a</ins>
<code><a href="#td"><ins class="diff-chg">td</ins></a></code>
<ins class="diff-chg">element that does not have a</ins>
<code title="attr-td-headers"><a href="#headers"><ins class=
"diff-chg">headers</ins></a></code> <ins class="diff-chg">attribute
specified, then skip these substeps and move on to the next data
cell (if any).</ins></p>
</li>
<li>
<p>Otherwise, <ins class="diff-new">take the value of the</ins>
<code title="attr-td-headers"><a href="#headers"><ins class=
"diff-new">headers</ins></a></code> <ins class="diff-new">attribute
and</ins> <a href="#split" title=
"split a string on spaces"><ins class="diff-new">split it on
spaces</ins></a> ,<ins class="diff-new">letting</ins> <var title=
""><ins class="diff-new">id list</ins></var> <ins class=
"diff-new">be the list of tokens obtained.</ins></p>
</li>
<li>
<p><ins class="diff-new">For each token in</ins> the <var title=
""><ins class="diff-new">id list</ins></var> ,<ins class=
"diff-new">run the following steps:</ins></p>
<ol>
<li>
<p><ins class="diff-new">Let</ins> <var title=""><ins class=
"diff-new">id</ins></var> <ins class="diff-new">be the
token.</ins></p>
</li>
<li>
<p><ins class="diff-new">If there is a</ins> header cell
<del class="diff-old">is</del> in the <del class="diff-old">first
column of</del> <a href="#table1" title="concept-table"><ins class=
"diff-chg">table</ins></a> <ins class="diff-chg">whose
corresponding</ins> <code><a href="#th"><ins class=
"diff-chg">th</ins></a></code> <ins class="diff-chg">element has an
ID that is equal to</ins> the <del class="diff-old">table;</del>
<ins class="diff-chg">value of</ins> <var title=""><ins class=
"diff-chg">id</ins></var> ,<ins class="diff-chg">then</ins> assign
<del class="diff-old">the</del> <ins class="diff-chg">that</ins>
header cell to <del class="diff-old">any</del> <ins class=
"diff-chg">the</ins> data <del class="diff-old">cells</del>
<ins class="diff-chg">cell.</ins></p>
</li>
</ol>
</li>
</ol>
</li>
</ol>
<p><ins class="diff-chg">A header cell</ins> anchored at
<ins class="diff-new">(</ins> <var title=""><ins class=
"diff-new">header</ins> <sub title=""><ins class=
"diff-new">x</ins></sub></var> ,<var title=""><ins class=
"diff-new">header</ins> <sub title=""><ins class=
"diff-new">y</ins></sub></var> <ins class="diff-new">) with
width</ins> <var title=""><ins class="diff-new">header</ins>
<sub title=""><ins class="diff-new">width</ins></sub></var>
<ins class="diff-new">and height</ins> <var title=""><ins class=
"diff-new">header</ins> <sub title=""><ins class=
"diff-new">height</ins></sub></var> <ins class="diff-new">is said
to be</ins> <dfn id="equivalent"><ins class="diff-new">equivalent
to a wide cell</ins></dfn> <ins class="diff-new">if all the</ins>
slots with coordinates ( <var title=""><del class=
"diff-old">data</del> <ins class="diff-chg">slot</ins> <sub title=
"">x</sub></var> , <var title=""><del class="diff-old">data</del>
<ins class="diff-chg">slot</ins> <sub title="">y</sub></var>
<del class="diff-old">)</del> <ins class="diff-chg">),</ins> where
<span><var title="">header <sub title="">x</sub></var> <del class=
"diff-old"> < </del> <ins class="diff-chg">+</ins>
<var title=""><del class="diff-old">data</del> <ins class=
"diff-chg">header</ins> <sub title=""><del class="diff-old">x</del>
<ins class="diff-chg">width</ins></sub></var> ≤
<var title=""><ins class="diff-new">slot</ins> <sub title=
""><ins class="diff-new">x</ins></sub></var> <ins class=
"diff-new"> < </ins> <var title="">x <sub title=
""><del class="diff-old">max</del> <ins class=
"diff-chg">width</ins></sub></var></span> and <span><var title=
""><del class="diff-old">data</del> <ins class=
"diff-chg">header</ins> <sub title="">y</sub></var> <del class=
"diff-old"> = </del> <ins class=
"diff-chg"> ≤ </ins> <var title=""><ins class=
"diff-chg">slot</ins> <sub title=""><ins class=
"diff-chg">y</ins></sub></var> <ins class=
"diff-chg"> < </ins> <var title="">header <sub title=
"">y</sub></var> <ins class="diff-new">+</ins> <var title=
""><ins class="diff-new">header</ins> <sub title=""><ins class=
"diff-new">height</ins></sub> <del class=
"diff-old">.</del></var></span> , <ins class="diff-chg">are all
either empty or covered by</ins> <a href="#empty0" title=
"empty data cell"><ins class="diff-chg">empty data cells</ins></a>
.</p>
<p><ins class="diff-chg">A data cell is said to be an</ins>
<dfn id="empty0"><ins class="diff-chg">empty data cell</ins></dfn>
<ins class="diff-chg">if it contains no elements and its text
content, if any, consists only of characters in the Unicode
character class Zs.</ins> <a href="#references"><ins class=
"diff-chg">[UNICODE]</ins></a></p>
<p><ins class="diff-chg">User agents may remove</ins> <a href=
"#empty0" title="empty data cell"><ins class="diff-chg">empty data
cells</ins></a> <ins class="diff-chg">when analyzing data in
a</ins> <a href="#table1" title="concept-table"><ins class=
"diff-chg">table</ins></a> .</p>
<h3 id="forms"><span class="secno"><del class=
"diff-old">3.16.</del> <ins class="diff-chg">3.14</ins></span>
Forms</h3>
<p class="big-issue">This section will contain definitions of the
<code>form</code> element and so forth.</p>
<p class="big-issue">This section will be a rewrite of the HTML4
Forms and Web Forms 2.0 specifications, with hopefully no normative
changes.</p>
<h4 id="the-form"><span class="secno"><del class=
"diff-old">3.16.1.</del> <ins class="diff-chg">3.14.1</ins></span>
The <code>form</code> element</h4>
<h4 id="the-fieldset"><span class="secno"><del class=
"diff-old">3.16.2.</del> <ins class="diff-chg">3.14.2</ins></span>
The <code>fieldset</code> element</h4>
<h4 id="the-input"><span class="secno"><del class=
"diff-old">3.16.3.</del> <ins class="diff-chg">3.14.3</ins></span>
The <code>input</code> element</h4>
<h4 id="the-button"><span class="secno"><del class=
"diff-old">3.16.4.</del> <ins class="diff-chg">3.14.4</ins></span>
The <code>button</code> element</h4>
<h4 id="the-label"><span class="secno"><del class=
"diff-old">3.16.5.</del> <ins class="diff-chg">3.14.5</ins></span>
The <code>label</code> element</h4>
<h4 id="the-select"><span class="secno"><del class=
"diff-old">3.16.6.</del> <ins class="diff-chg">3.14.6</ins></span>
The <code>select</code> element</h4>
<h4 id="the-datalist"><span class="secno"><del class=
"diff-old">3.16.7.</del> <ins class="diff-chg">3.14.7</ins></span>
The <code>datalist</code> element</h4>
<h4 id="the-optgroup"><span class="secno"><del class=
"diff-old">3.16.8.</del> <ins class="diff-chg">3.14.8</ins></span>
The <code>optgroup</code> element</h4>
<h4 id="the-option"><span class="secno"><del class=
"diff-old">3.16.9.</del> <ins class="diff-chg">3.14.9</ins></span>
The <code>option</code> element</h4>
<h4 id="the-textarea"><span class="secno"><del class=
"diff-old">3.16.10.</del> <ins class=
"diff-chg">3.14.10</ins></span> The <code>textarea</code>
element</h4>
<h4 id="the-output"><span class="secno"><del class=
"diff-old">3.16.11.</del> <ins class=
"diff-chg">3.14.11</ins></span> The <code>output</code>
element</h4>
<h4 id="processing0"><span class="secno"><del class=
"diff-old">3.16.12.</del> <ins class=
"diff-chg">3.14.12</ins></span> Processing model</h4>
<p class="big-issue">See <a href=
"http://www.whatwg.org/specs/web-forms/current-work/#extend-form-controls">
WF2</a> for now</p>
<h5 id="form-submission"><span class="secno"><del class=
"diff-old">3.16.12.1.</del> <ins class=
"diff-chg">3.14.12.1.</ins></span> Form submission</h5>
<p class="big-issue">See <a href=
"http://www.whatwg.org/specs/web-forms/current-work/#form-submission">
WF2</a> for now</p>
<p class="big-issue" id="sandboxSubmitBlocked"><ins class=
"diff-new">If a form is in a browsing context whose</ins> <a href=
"#sandboxed3"><ins class="diff-new">sandboxed forms browsing
context flag</ins></a> <ins class="diff-new">is set, it must not be
submitted.</ins></p>
<h3 id="scripting0"><span class="secno"><del class=
"diff-old">3.17.</del> <ins class="diff-chg">3.15</ins></span>
Scripting</h3>
<p><ins class="diff-new">Scripts allow authors to add interactivity
to their documents.</ins></p>
<p><ins class="diff-new">Authors are encouraged to use declarative
alternatives to scripting where possible, as declarative mechanisms
are often more maintainable, and many users disable
scripting.</ins></p>
<div class="example">
<p><ins class="diff-new">For example, instead of using script to
show or hide a section to show more details, the</ins>
<code><a href="#details"><ins class=
"diff-new">details</ins></a></code> <ins class="diff-new">element
could be used.</ins></p>
</div>
<p><ins class="diff-new">Authors are also encouraged to make their
applications degrade gracefully in the absence of scripting
support.</ins></p>
<div class="example">
<p><ins class="diff-new">For example, if an author provides a link
in a table header to dynamically resort the table, the link could
also be made to function without scripts by requesting the sorted
table from the server.</ins></p>
</div>
<h4 id="script"><span class="secno"><del class=
"diff-old">3.17.1.</del> <ins class="diff-chg">3.15.1</ins></span>
The <dfn id="script1"><code>script</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#metadata0">Metadata content</a> .</dd>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#metadata0">metadata content</a> is
expected.</dd>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>If there is no <code title="attr-script-src"><a href=
"#src9">src</a></code> attribute, depends on the value of the
<code title="attr-script-type"><a href="#type11">type</a></code>
attribute.</dd>
<dd>If there <em>is</em> a <code title="attr-script-src"><a href=
"#src9">src</a></code> attribute, the element must be empty.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-script-src"><a href=
"#src9">src</a></code></dd>
<dd><code title="attr-script-async"><a href=
"#async">async</a></code></dd>
<dd><code title="attr-script-defer"><a href=
"#defer">defer</a></code></dd>
<dd><code title="attr-script-type"><a href=
"#type11">type</a></code></dd>
<dd><code title="attr-script-charset"><a href=
"#charset2"><ins class="diff-new">charset</ins></a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlscriptelement">HTMLScriptElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
attribute DOMString <code title=
"dom-script-src"><a href="#src10">src</a></code>;
attribute boolean <code title=
"dom-script-async"><a href="#async0">async</a></code>;
attribute boolean <code title=
"dom-script-defer"><a href="#defer0">defer</a></code>;
attribute DOMString <code title=
"dom-script-type"><a href="#type12">type</a></code>;
<del class="diff-old"> attribute DOMString ;
</del>
<ins class="diff-chg"> attribute DOMString <code title=
"dom-script-charset"><a href="#charset3">charset</a></code>;
attribute DOMString <code title=
"dom-script-text"><a href="#text1">text</a></code>;
</ins>
};
</pre></dd>
</dl>
<p>The <code><a href="#script1">script</a></code> element allows
authors to include dynamic script <ins class="diff-new">and script
data</ins> in their documents.</p>
<p>When <ins class="diff-new">used to include dynamic
scripts,</ins> the <ins class="diff-chg">scripts may either be
embedded inline or may be imported from an external file using
the</ins> <code title="attr-script-src"><a href="#src9">src</a>
<del class="diff-old">attribute</del></code> <ins class=
"diff-chg">attribute. If the language</ins> is <del class=
"diff-old">set,</del> <ins class="diff-chg">not that described by
"</ins> <code title=""><ins class=
"diff-chg">text/javascript</ins></code> <ins class="diff-chg">",
then</ins> the <ins class="diff-chg">type of the script's language
must be given using the</ins> <code title=
"attr-script-type"><del class="diff-old">script</del> <a href=
"#type11"><ins class="diff-chg">type</ins></a></code> <del class=
"diff-old">element refers</del> <ins class=
"diff-chg">attribute.</ins></p>
<p><ins class="diff-chg">When used</ins> to <del class=
"diff-old">an external file. The value</del> <ins class=
"diff-chg">include script data, the script data must be embedded
inline, the format</ins> of the <del class=
"diff-old">attribute</del> <ins class="diff-chg">data</ins> must be
<del class="diff-old">a URI (or IRI). If</del> <ins class=
"diff-chg">given using the</ins> <code title=
"attr-script-type"><a href="#type11"><ins class=
"diff-chg">type</ins></a></code> <ins class="diff-chg">attribute,
and</ins> the <code title="attr-script-src"><a href=
"#src9">src</a></code> attribute <del class="diff-old">is</del>
<ins class="diff-chg">must</ins> not <del class="diff-old">set,
then</del> <ins class="diff-chg">be specified.</ins></p>
<p><ins class="diff-chg">The</ins> <dfn id="type11" title=
"attr-script-type"><code><ins class=
"diff-chg">type</ins></code></dfn> <ins class="diff-chg">attribute
gives</ins> the <del class="diff-old">script is given by</del>
<ins class="diff-chg">language of</ins> the <del class=
"diff-old">contents</del> <ins class="diff-chg">script or
format</ins> of the <del class="diff-old">element.</del>
<ins class="diff-chg">script data. If the attribute is present, its
value must be a valid MIME type, optionally with parameters.
The</ins> <code title=""><ins class="diff-chg">charset</ins></code>
<ins class="diff-chg">parameter must not be specified. (The
default, which is used if the attribute is absent, is "</ins>
<code title=""><ins class="diff-chg">text/javascript</ins></code>
<ins class="diff-chg">".)</ins> <a href="#references"><ins class=
"diff-chg">[RFC2046]</ins></a></p>
<p>The <del class="diff-old">language</del> <dfn id="src9" title=
"attr-script-src"><code><ins class=
"diff-chg">src</ins></code></dfn> <ins class="diff-chg">attribute,
if specified, gives the address</ins> of the <ins class=
"diff-new">external</ins> script <del class="diff-old">may</del>
<ins class="diff-chg">resource to use. The value of the attribute
must</ins> be <ins class="diff-new">a URI (or IRI) to a script
resource of the type</ins> given by the <code title=
"attr-script-type"><a href="#type11"><ins class=
"diff-chg">type</ins></a></code> <ins class="diff-chg">attribute,
if the attribute is present, or of the</ins> type <ins class=
"diff-new">"</ins> <code title=""><ins class=
"diff-new">text/javascript</ins></code> <ins class="diff-new">", if
the attribute is absent.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="charset2" title=
"attr-script-charset"><code><ins class=
"diff-new">charset</ins></code></dfn> <del class=
"diff-old">attribute.</del> <ins class="diff-chg">attribute gives
the character encoding of the external script resource. The
attribute must not be specified if the</ins> <code title=
"attr-script-src"><a href="#src9"><ins class=
"diff-chg">src</ins></a></code> <ins class="diff-chg">attribute is
not present.</ins> If the attribute is <del class=
"diff-old">present,</del> <ins class="diff-chg">set,</ins> its
value must be a valid <del class="diff-old">MIME type, optionally
with parameters.</del> <ins class="diff-chg">character encoding
name, and must be the preferred name for that encoding.</ins>
<a href="#references"><del class="diff-old">[RFC2046]</del>
<ins class="diff-chg">[IANACHARSET]</ins></a></p>
<p><ins class="diff-chg">The encoding specified must be the
encoding used by the script resource. If the</ins> <code title=
"attr-script-charset"><a href="#charset2"><ins class=
"diff-chg">charset</ins></a></code> <ins class="diff-new">attribute
is omitted, the character encoding of the document will be used. If
the script resource uses a different encoding than the document,
then the attribute must be specified.</ins></p>
<p>The <dfn id="async" title=
"attr-script-async"><code>async</code></dfn> and <dfn id="defer"
title="attr-script-defer"><code>defer</code></dfn> attributes are
<a href="#boolean0" title="boolean attribute">boolean
attributes</a> that indicate how the script should be executed.</p>
<p>There are three possible modes that can be selected using these
attributes. If the <code title="attr-script-async"><a href=
"#async">async</a></code> attribute is present, then the script
will be executed asynchronously, as soon as it is available. If the
<code title="attr-script-async"><a href="#async">async</a></code>
attribute is not present but the <code title=
"attr-script-defer"><a href="#defer">defer</a></code> attribute is
present, then the script is executed when the page has finished
parsing. If neither attribute is present, then the script is
downloaded and executed immediately, before the user agent
continues parsing the page. The exact processing details for these
attributes is described below.</p>
<p>The <code title="attr-script-defer"><a href=
"#defer">defer</a></code> attribute may be specified even if the
<code title="attr-script-async"><a href="#async">async</a></code>
attribute is specified, to cause legacy Web browsers that only
support <code title="attr-script-defer"><a href=
"#defer">defer</a></code> (and not <code title=
"attr-script-async"><a href="#async">async</a></code> ) to fall
back to the <code title="attr-script-defer"><a href=
"#defer">defer</a></code> behavior instead of the synchronous
blocking behavior that is the default.</p>
<p>Changing the <code title="attr-script-src"><a href=
"#src9">src</a></code> , <code title="attr-script-type"><a href=
"#type11">type</a></code> , <code title=
"attr-script-charset"><a href="#charset2"><ins class=
"diff-new">charset</ins></a></code> , <code title=
"attr-script-async"><a href="#async">async</a></code> , and
<code title="attr-script-defer"><a href="#defer">defer</a></code>
attributes dynamically has no direct effect; these attribute are
only used at specific times described below (namely, when the
element is inserted into the document).</p>
<p><code><a href="#script1">script</a></code> elements have
<del class="diff-old">three</del> <ins class="diff-chg">four</ins>
associated pieces of metadata. The first is a flag indicating
whether or not the script block has been <dfn id="already">"already
executed"</dfn> . Initially, <code><a href=
"#script1">script</a></code> elements must have this flag unset
(script blocks, when created, are not "already executed"). When a
<code><a href="#script1">script</a></code> element is cloned, the
"already executed" flag, if set, must be propagated to the clone
when it is created. The second is a flag indicating whether the
element was <dfn id="parser-inserted">"parser-inserted"</dfn> .
This flag is set by the <a href="#html-0">HTML parser</a> and is
used to handle <code title="dom-document-write-HTML"><a href=
"#document.write...">document.write()</a></code> calls. The third
<del class="diff-old">piece</del> <ins class="diff-chg">and fourth
pieces</ins> of metadata <del class="diff-old">is</del> <ins class=
"diff-chg">are</ins> <dfn id="the-scripts"><var>the script's
type</var></dfn> <ins class="diff-new">and</ins> <dfn id=
"the-scripts0"><var><ins class="diff-new">the script's character
encoding</ins></var></dfn> . <del class="diff-old">It is</del>
<ins class="diff-chg">They are</ins> determined when the script is
run, based on the attributes on the element at that time.</p>
<p><dfn id="running" title="running a script">Running a
script</dfn> : <del class="diff-old">when</del> <ins class=
"diff-chg">When</ins> a script block is <span>inserted into a
document</span> , the user agent must act as follows:</p>
<ol>
<li>
<p>If the <code><a href="#script1">script</a></code> element has a
<code title="attr-script-type"><a href="#type11">type</a></code>
attribute <del class="diff-old">but</del> <ins class=
"diff-chg">and</ins> its value is the empty string, or if the
<code><a href="#script1">script</a></code> element has no
<code title="attr-script-type"><a href="#type11">type</a></code>
attribute but it has a <code title=
"attr-script-language">language</code> <del class=
"diff-old">attribute,</del> <ins class="diff-chg">attribute</ins>
and <em>that</em> attribute's value is the empty string,
<ins class="diff-new">or if the</ins> <code><a href=
"#script1"><ins class="diff-new">script</ins></a></code>
<ins class="diff-new">element has neither a</ins> <code title=
"attr-script-type"><a href="#type11"><ins class=
"diff-new">type</ins></a></code> <ins class="diff-new">attribute
nor a</ins> <code title="attr-script-language"><ins class=
"diff-new">language</ins></code> <ins class=
"diff-new">attribute,</ins> let <var><a href="#the-scripts">the
script's type</a></var> for this <code><a href=
"#script1">script</a></code> element be " <code title=
"">text/javascript</code> ".</p>
<p>Otherwise, if the <code><a href="#script1">script</a></code>
element has a <code title="attr-script-type"><a href=
"#type11">type</a></code> attribute, let <var><a href=
"#the-scripts">the script's type</a></var> for this <code><a href=
"#script1">script</a></code> element be the value of that
attribute.</p>
<p>Otherwise, <del class="diff-old">if</del> the element has a
<code title="attr-script-language">language</code> <del class=
"diff-old">attribute,</del> <ins class="diff-chg">attribute;</ins>
let <var><a href="#the-scripts">the script's type</a></var> for
this <code><a href="#script1">script</a></code> element be the
concatenation of the string " <code title="">text/</code> "
followed by the value of the <code title=
"attr-script-language">language</code> attribute.</p>
</li>
<li>
<p>If <del class="diff-old">scripting is disabled , or if</del> the
<code><del class="diff-old">Document</del> <a href=
"#script1"><ins class="diff-chg">script</ins></a></code>
<ins class="diff-new">element</ins> has <ins class=
"diff-chg">a</ins> <code title="attr-script-charset"><del class=
"diff-old">designMode</del> <a href="#charset2"><ins class=
"diff-chg">charset</ins></a></code> <del class=
"diff-old">enabled,</del> <ins class="diff-chg">attribute, then
let</ins> <var><a href="#the-scripts0"><ins class="diff-chg">the
script's character encoding</ins></a></var> <ins class=
"diff-chg">for this</ins> <code><a href="#script1"><ins class=
"diff-chg">script</ins></a></code> <ins class="diff-chg">element be
the encoding given by the</ins> <code title=
"attr-script-charset"><a href="#charset2"><ins class=
"diff-chg">charset</ins></a></code> <ins class=
"diff-chg">attribute.</ins></p>
<p><ins class="diff-chg">Otherwise, let</ins> <var><a href=
"#the-scripts0"><ins class="diff-chg">the script's character
encoding</ins></a></var> <ins class="diff-chg">for this</ins>
<code><a href="#script1"><ins class=
"diff-chg">script</ins></a></code> <ins class="diff-chg">element be
the same as</ins> <a href="#character1" title=
"document's character encoding"><ins class="diff-chg">the encoding
of the document itself</ins></a> .</p>
</li>
<li>
<p><ins class="diff-chg">If the</ins> <code><a href=
"#script1"><ins class="diff-chg">script</ins></a></code>
<ins class="diff-chg">element is</ins> <a href=
"#without"><ins class="diff-chg">without script</ins></a> , or if
the <code><a href="#script1">script</a></code> element was created
by an <span>XML parser</span> that itself was created as part of
the processing of the <code title="dom-innerHTML-XML"><a href=
"#innerhtml1">innerHTML</a></code> attribute's setter , or if the
user agent does not <a href="#support">support the scripting
language</a> given by <var><a href="#the-scripts">the script's
type</a></var> for this <code><a href="#script1">script</a></code>
element, or if the <code><a href="#script1">script</a></code>
element has its <a href="#already">"already executed"</a> flag set,
then the user agent must abort these steps at this point. The
script is not executed.</p>
</li>
<li>
<p>The user agent must set the element's <a href=
"#already">"already executed"</a> flag.</p>
</li>
<li>
<p>If the element has a <code title="attr-script-src"><a href=
"#src9">src</a></code> attribute, then a load for the specified
content must be started.</p>
<p class="note">Later, once the load has completed, the user agent
will have to complete <a href="#when-a" title=
"when a script completes loading">the steps described below</a>
.</p>
<p>For performance reasons, user agents may start loading the
script as soon as the attribute is set, instead, in the hope that
the element will be inserted into the document. Either way, once
the element is inserted into the document, the load must have
started. If the UA performs such prefetching, but the element is
never inserted in the document, or the <code title=
"attr-script-src"><a href="#src9">src</a></code> attribute is
dynamically changed, then the user agent will not execute the
script, and the load will have been effectively wasted.</p>
</li>
<li>
<p>Then, the first of the following options that describes the
situation must be followed:</p>
<dl class="switch">
<dt>If the document is still being parsed, and the element has a
<code title="attr-script-defer"><a href="#defer">defer</a></code>
attribute, and the element does not have an <code title=
"attr-script-async"><a href="#async">async</a></code>
attribute</dt>
<dd>The element must be added to the end of the <a href=
"#list-of">list of scripts that will execute when the document has
finished parsing</a> . The user agent must begin <a href="#when-a"
title="when a script completes loading">the next set of steps</a>
when the script is ready. <span class="big-issue">This isn't
compatible with IE for inline deferred scripts, but then what IE
does is pretty hard to pin down exactly. Do we want to keep this
like it is? Be more compatible?</span></dd>
<dt>If the element has an <code title="attr-script-async"><a href=
"#async">async</a></code> attribute and a <code title=
"attr-script-src"><a href="#src9">src</a></code> attribute</dt>
<dd>The element must be added to the end of the <a href=
"#list-of0">list of scripts that will execute asynchronously</a> .
The user agent must jump to <a href="#when-a" title=
"when a script completes loading">the next set of steps</a> once
the script is ready.</dd>
<dt>If the element has an <code title="attr-script-async"><a href=
"#async">async</a></code> attribute but no <code title=
"attr-script-src"><a href="#src9">src</a></code> attribute, and the
<a href="#list-of0">list of scripts that will execute
asynchronously</a> is not empty</dt>
<dd>The element must be added to the end of the <a href=
"#list-of0">list of scripts that will execute asynchronously</a>
.</dd>
<dt>If the element has a <code title="attr-script-src"><a href=
"#src9">src</a></code> attribute and has been flagged as <a href=
"#parser-inserted">"parser-inserted"</a></dt>
<dd>The element is <a href="#the-script">the script that will
execute as soon as the parser resumes</a> . (There can only be one
such script at a time.)</dd>
<dt>If the element has a <code title="attr-script-src"><a href=
"#src9">src</a></code> attribute</dt>
<dd>The element must be added to the end of the <a href=
"#list-of1">list of scripts that will execute as soon as
possible</a> . The user agent must jump to <a href="#when-a" title=
"when a script completes loading">the next set of steps</a> when
the script is ready.</dd>
<dt>Otherwise</dt>
<dd>The user agent must immediately <a href="#executing0" title=
"executing a script block">execute the script</a> , even if other
scripts are already executing.</dd>
</dl>
</li>
</ol>
<p><dfn id="when-a" title="when a script completes loading">When a
script completes loading</dfn> : If a script whose element was
added to one of the lists mentioned above completes loading while
the document is still being parsed, then the parser handles it.
Otherwise, when a script completes loading, the UA must run the
following steps as soon as as any other scripts that may be
executing have finished executing:</p>
<dl class="switch">
<dt>If the script's element was added to the <dfn id="list-of">list
of scripts that will execute when the document has finished
parsing</dfn> :</dt>
<dd>
<ol>
<li>
<p>If the script's element is not the first element in the list,
then do nothing yet. Stop going through these steps.</p>
</li>
<li>
<p>Otherwise, <a href="#executing0" title=
"executing a script block">execute the script</a> (that is, the
script associated with the first element in the list).</p>
</li>
<li>
<p>Remove the script's element from the list (i.e. shift out the
first entry in the list).</p>
</li>
<li>
<p>If there are any more entries in the list, and if the script
associated with the element that is now the first in the list is
already loaded, then jump back to step two to execute it.</p>
</li>
</ol>
</dd>
<dt>If the script's element was added to the <dfn id=
"list-of0">list of scripts that will execute asynchronously</dfn>
:</dt>
<dd>
<ol>
<li>
<p>If the script is not the first element in the list, then do
nothing yet. Stop going through these steps.</p>
</li>
<li>
<p><a href="#executing0" title="executing a script block">Execute
the script</a> (the script associated with the first element in the
list).</p>
</li>
<li>
<p>Remove the script's element from the list (i.e. shift out the
first entry in the list).</p>
</li>
<li>
<p>If there are any more scripts in the list, and the element now
at the head of the list had no <code title=
"attr-script-src"><a href="#src9">src</a></code> attribute when it
was added to the list, or had one, but its associated script has
finished loading, then jump back to step two to execute the script
associated with this element.</p>
</li>
</ol>
</dd>
<dt>If the script's element was added to the <dfn id=
"list-of1">list of scripts that will execute as soon as
possible</dfn> :</dt>
<dd>
<ol>
<li>
<p><a href="#executing0" title="executing a script block">Execute
the script</a> .</p>
</li>
<li>
<p>Remove the script's element from the list.</p>
</li>
</ol>
</dd>
<dt>If the script is <dfn id="the-script">the script that will
execute as soon as the parser resumes</dfn> :</dt>
<dd>
<p>The script will be handled <a href=
"#scriptTagParserResumes">when the parser resumes</a> (amazingly
enough).</p>
</dd>
</dl>
<p>The download of an external script must <a href="#delays">delay
the <code title="event-load">load</code> event</a> .</p>
<p><dfn id="executing0" title="executing a script block">Executing
a script block</dfn> : <ins class="diff-new">When the steps above
require that the script be executed, the user agent must act as
follows:</ins></p>
<dl class="switch">
<dt>If the load resulted in an error (for example a DNS error, or
an HTTP 404 <del class="diff-old">error), then executing</del>
<ins class="diff-chg">error)</ins></dt>
<dd>
<p><ins class="diff-chg">Executing</ins> the script must just
consist of <a href="#firing5" title="fire an error event">firing an
<code title="event-error">error</code> event</a> at the
element.</p>
</dd>
<dt>If the load was <del class="diff-old">successful, then first
the user agent must fire a load event at the element, and then, if
scripting is enabled , and</del> <ins class=
"diff-chg">successful</ins></dt>
<dd>
<ol>
<li>
<p><ins class="diff-chg">If</ins> the <code><del class=
"diff-old">Document does not have</del> <del class=
"diff-old">designMode</del> <a href="#script1"><ins class=
"diff-chg">script</ins></a></code> <del class="diff-old">enabled,
and the</del> <ins class="diff-chg">element's</ins>
<code>Document</code> is the <a href="#active">active document</a>
in its <a href="#browsing1">browsing context</a> , the user agent
must execute the script:</p>
<dl class="switch">
<dt>If the script is from an external <del class="diff-old">file,
then that</del> <ins class="diff-chg">file</ins></dt>
<dd>
<p><ins class="diff-chg">That</ins> file must be used as the file
to execute.</p>
<p><ins class="diff-new">The file must be interpreted using the
character encoding given by</ins> <var><a href=
"#the-scripts0"><ins class="diff-new">the script's character
encoding</ins></a></var> ,<ins class="diff-new">regardless of any
metadata given by the file's</ins> <a href="#content-type8" title=
"Content-Type"><ins class="diff-new">Content-Type
metadata</ins></a> .</p>
<p class="big-issue"><ins class="diff-new">This means that a UTF-16
document will always assume external scripts are UTF-16...? This
applies, e.g., to document's created using createDocument()... It
also means changing document.charSet will affect the character
encoding used to interpret scripts, is that really what
happens?</ins></p>
</dd>
<dt>If the script is <del class="diff-old">inline, then, for</del>
<ins class="diff-chg">inline</ins></dt>
<dd>
<p><ins class="diff-chg">For</ins> scripting languages that consist
of pure text, user agents must use the value of the DOM
<code title="dom-script-text"><a href="#text1">text</a></code>
attribute (defined below) as the script to execute, and for
XML-based scripting languages, user agents must use all the child
nodes of the <code><a href="#script1">script</a></code> element as
the script to execute.</p>
</dd>
</dl>
<p>In any case, the user agent must execute the script according to
the semantics defined by the language associated with <var><a href=
"#the-scripts">the script's type</a></var> (see the <a href=
"#scriptingLanguages">scripting languages</a> section below).</p>
<p><del class="diff-old">Scripts</del> <ins class=
"diff-chg">The</ins> <a href="#script2"><ins class=
"diff-chg">script execution context</ins></a> <ins class=
"diff-chg">of the script</ins> must be <del class=
"diff-old">executed in</del> the <del class="diff-old">scope</del>
<code><a href="#window"><ins class=
"diff-chg">Window</ins></a></code> <ins class=
"diff-chg">object</ins> of <del class="diff-old">the</del>
<ins class="diff-chg">that</ins> <a href="#browsing1">browsing
context <del class="diff-old">of the element's Document .</del></a>
.</p>
<p class="note">The element's attributes' values might have changed
between when the element was inserted into the document and when
the script has finished loading, as may its other attributes;
similarly, the element itself might have been taken back out of the
DOM, or had other changes made. These changes do not in any way
affect the above steps; only the values of the attributes at the
time the <code><a href="#script1">script</a></code> element is
first inserted into the document matter.</p>
</li>
<li>
<p><ins class="diff-new">Then, the user agent must</ins> <a href=
"#firing4"><ins class="diff-new">fire a</ins> <code title=
"event-load"><ins class="diff-new">load</ins></code> <ins class=
"diff-new">event</ins></a> <ins class="diff-new">at the</ins>
<code><a href="#script1"><ins class=
"diff-new">script</ins></a></code> <ins class=
"diff-new">element.</ins></p>
</li>
</ol>
</dd>
</dl>
<p>The DOM attributes <dfn id="src10" title=
"dom-script-src"><code>src</code></dfn> , <dfn id="type12" title=
"dom-script-type"><code>type</code></dfn> , <dfn id="charset3"
title="dom-script-charset"><code><ins class=
"diff-new">charset</ins></code></dfn> , <dfn id="async0" title=
"dom-script-async"><code>async</code></dfn> , and <dfn id="defer0"
title="dom-script-defer"><code>defer</code></dfn> , each must
<a href="#reflect">reflect</a> the respective content attributes of
the same name.</p>
<p>The DOM attribute <dfn id="text1" title=
"dom-script-text"><code>text</code></dfn> must return a
concatenation of the contents of all the <a href="#text-node"
title="text node">text nodes</a> that are direct children of the
<code><a href="#script1">script</a></code> element (ignoring any
other nodes such as comments or elements), in tree order. On
setting, it must act the same way as the <code><a href=
"#textcontent">textContent</a></code> DOM attribute.</p>
<h5 id="scriptingLanguages"><span class="secno"><del class=
"diff-old">3.17.1.1.</del> <ins class=
"diff-chg">3.15.1.1.</ins></span> Scripting languages</h5>
<p>A user agent is said to <dfn id="support">support the scripting
language</dfn> if <var><a href="#the-scripts">the script's
type</a></var> matches the MIME type of a scripting language that
the user agent implements.</p>
<p>The following lists some MIME types and the languages to which
they refer:</p>
<dl>
<dt><code>text/javascript</code></dt>
<dd>ECMAScript. <a href="#references">[ECMA262]</a></dd>
<dt><code>text/javascript;e4x=1</code></dt>
<dd>ECMAScript with ECMAScript for XML. <a href=
"#references">[ECMA357]</a></dd>
</dl>
<p>User agents may support other MIME types and other
languages.</p>
<p>When examining types to determine if they support the language,
user agents must not ignore unknown MIME parameters — types with
unknown parameters must be assumed to be unsupported.</p>
<h4 id="the-noscript"><span class="secno"><del class=
"diff-old">3.17.2.</del> <ins class="diff-chg">3.15.2</ins></span>
The <dfn id="noscript"><code>noscript</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#metadata0">Metadata content</a> .</dd>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>In a <code><a href="#head">head</a></code> element of an
<a href="#html-" title="> HTML documents">HTML document</a> , if
there are no ancestor <code><a href="#noscript">noscript</a></code>
elements.</dd>
<dd>Where <a href="#phrasing0">phrasing content</a> is expected in
<a href="#html-">HTML documents</a> , if there are no ancestor
<code><a href="#noscript">noscript</a></code> elements.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">When scripting is disabled</del> <a href=
"#without"><ins class="diff-chg">Without script</ins></a> , in a
<code><a href="#head">head</a></code> element: in any order, zero
or more <code><a href="#link">link</a></code> elements, zero or
more <code><a href="#style1">style</a></code> elements, and zero or
more <code><a href="#meta0">meta</a></code> elements.</dd>
<dd><del class="diff-old">When scripting is disabled</del> <a href=
"#without"><ins class="diff-chg">Without script</ins></a> , not in
a <code><a href="#head">head</a></code> element: <a href=
"#transparent0">transparent</a> , but there must be no
<code><a href="#noscript">noscript</a></code> element
descendants.</dd>
<dd><del class="diff-old">When scripting is enabled</del> <a href=
"#with-script"><ins class="diff-chg">With script</ins></a> : text
that conforms to the requirements given in the prose.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#noscript">noscript</a></code> element does
not represent anything. It is used to present different markup to
user agents that support scripting and those that don't support
scripting, by affecting how the document is parsed.</p>
<p>The <code><a href="#noscript">noscript</a></code> element must
not be used in <a href="#xml-documents">XML documents</a> .</p>
<p class="note"><strong><ins class="diff-new">The</ins>
<code><a href="#noscript"><ins class=
"diff-new">noscript</ins></a></code> <ins class="diff-new">element
is only effective in the</ins> <span title=""><ins class=
"diff-new">HTML serialization</ins></span> <ins class="diff-new">,
it has no effect in the</ins> <span title=""><ins class=
"diff-new">XML serialization</ins></span> .</strong></p>
<p>When used in <a href="#html-">HTML documents</a> , the allowed
content model <del class="diff-old">depends on whether
scripting</del> is <del class="diff-old">enabled or not, and
whether the element is in</del> <ins class="diff-chg">as
follows:</ins></p>
<p><ins class="diff-chg">In</ins> a <code><a href=
"#head">head</a></code> <del class="diff-old">element or not. In
a</del> <ins class="diff-chg">element, if the</ins>
<code><del class="diff-old">head</del> <a href=
"#noscript"><ins class="diff-chg">noscript</ins></a></code>
<del class="diff-old">element, if scripting</del> <ins class=
"diff-chg">element</ins> is <del class="diff-old">disabled</del>
<a href="#without"><ins class="diff-chg">without script</ins></a> ,
then the content model of a <code><a href=
"#noscript">noscript</a></code> element must contain only
<code><a href="#link">link</a></code> , <code><a href=
"#style1">style</a></code> , and <code><a href=
"#meta0">meta</a></code> elements. If <del class=
"diff-old">scripting</del> <ins class="diff-chg">the</ins>
<code><a href="#noscript"><ins class=
"diff-chg">noscript</ins></a></code> <ins class=
"diff-chg">element</ins> is <del class="diff-old">enabled</del>
<a href="#with-script"><ins class="diff-chg">with script</ins></a>
, then the content model of a <code><a href=
"#noscript">noscript</a></code> element is text, except that
invoking the <a href="#html-fragment0">HTML fragment parsing
algorithm</a> with the <code><a href=
"#noscript">noscript</a></code> element as the <var title=
"">context</var> <ins class="diff-new">element</ins> and the text
contents as the <var title="">input</var> must result in a list of
nodes that consists only of <code><a href="#link">link</a></code> ,
<code><a href="#style1">style</a></code> , and <code><a href=
"#meta0">meta</a></code> elements.</p>
<p>Outside of <code><a href="#head">head</a></code> elements, if
<del class="diff-old">scripting</del> <ins class=
"diff-chg">the</ins> <code><a href="#noscript"><ins class=
"diff-chg">noscript</ins></a></code> <ins class=
"diff-chg">element</ins> is <del class="diff-old">disabled</del>
<a href="#without"><ins class="diff-chg">without script</ins></a> ,
then the content model of a <code><a href=
"#noscript">noscript</a></code> element is <a href=
"#transparent0">transparent</a> , with the additional restriction
that a <code><a href="#noscript">noscript</a></code> element must
not have a <code><a href="#noscript">noscript</a></code> element as
an ancestor (that is, <code><a href="#noscript">noscript</a></code>
can't be nested).</p>
<p>Outside of <code><a href="#head">head</a></code> elements, if
<del class="diff-old">scripting</del> <ins class=
"diff-chg">the</ins> <code><a href="#noscript"><ins class=
"diff-chg">noscript</ins></a></code> <ins class=
"diff-chg">element</ins> is <del class="diff-old">enabled</del>
<a href="#with-script"><ins class="diff-chg">with script</ins></a>
, then the content model of a <code><a href=
"#noscript">noscript</a></code> element is text, except that the
text must be such that running the following algorithm results in a
conforming document with no <code><a href=
"#noscript">noscript</a></code> elements and no <code><a href=
"#script1">script</a></code> elements, and such that no step in the
algorithm causes an <a href="#html-0">HTML parser</a> to flag a
<a href="#parse1">parse error</a> :</p>
<ol>
<li>Remove every <code><a href="#script1">script</a></code> element
from the document.</li>
<li>Make a list of every <code><a href=
"#noscript">noscript</a></code> element in the document. For every
<code><a href="#noscript">noscript</a></code> element in that list,
perform the following steps:
<ol>
<li>Let the <var title="">parent element</var> be the parent
element of the <code><a href="#noscript">noscript</a></code>
element.</li>
<li>Take all the children of the <var title="">parent element</var>
that come before the <code><a href="#noscript">noscript</a></code>
element, and call these elements <var title="">the before
children</var> .</li>
<li>Take all the children of the <var title="">parent element</var>
that come <em>after</em> the <code><a href=
"#noscript">noscript</a></code> element, and call these elements
<var title="">the after children</var> .</li>
<li>Let <var title="">s</var> be the concatenation of all the
<a href="#text-node">text node</a> children of the <code><a href=
"#noscript">noscript</a></code> element.</li>
<li>Set the <code title="dom-innerHTML-HTML"><a href=
"#innerhtml0">innerHTML</a></code> attribute of the <var title=
"">parent element</var> to the value of <var title="">s</var> .
(This, as a side-effect, causes the <code><a href=
"#noscript">noscript</a></code> element to be removed from the
document.)</li>
<li>Insert <var title="">the before children</var> at the start of
the <var title="">parent element</var> , preserving their original
relative order.</li>
<li>Insert <var title="">the after children</var> at the end of the
<var title="">parent element</var> , preserving their original
relative order.</li>
</ol>
</li>
</ol>
<p>The <code><a href="#noscript">noscript</a></code> element has no
other requirements. In particular, children of the <code><a href=
"#noscript">noscript</a></code> element are not exempt from form
submission, scripting, and so forth, even when <del class=
"diff-old">scripting</del> <ins class="diff-chg">the element</ins>
is <del class="diff-old">enabled.</del> <a href=
"#with-script"><ins class="diff-chg">with script</ins></a> .</p>
<p class="note">All these contortions are required because, for
historical reasons, the <code><a href=
"#noscript">noscript</a></code> element <del class=
"diff-old">causes</del> <ins class="diff-chg">is handled
differently by</ins> the <a href="#html-0">HTML parser</a>
<del class="diff-old">to act differently</del> based on whether
<a href="#scripting2" title="scripting flag">scripting <del class=
"diff-old">is</del> <ins class="diff-chg">was</ins> enabled or
<del class="diff-old">not.</del> <ins class=
"diff-chg">not</ins></a> <ins class="diff-chg">when the parser was
invoked.</ins> The element is not allowed in XML, because in XML
the parser is not affected by such state, and thus the element
would not have the desired effect.</p>
<p class="note"><ins class="diff-new">The</ins> <code><a href=
"#noscript"><ins class="diff-new">noscript</ins></a></code>
<ins class="diff-new">element interacts poorly with the</ins>
<code title="dom-document-designMode"><a href=
"#designMode"><ins class="diff-new">designMode</ins></a></code>
<ins class="diff-new">feature. Authors are encouraged to not
use</ins> <code><a href="#noscript"><ins class=
"diff-new">noscript</ins></a></code> <ins class="diff-new">elements
on pages that will have</ins> <code title=
"dom-document-designMode"><a href="#designMode"><ins class=
"diff-new">designMode</ins></a></code> <ins class=
"diff-new">enabled.</ins></p>
<h4 id="the-event-source"><span class="secno"><del class=
"diff-old">3.17.3.</del> <ins class="diff-chg">3.15.3</ins></span>
The <dfn id="event-source"><code>event-source</code></dfn>
element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#metadata0">Metadata content</a> .</dd>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#metadata0">metadata content</a> is
expected.</dd>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>Empty.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-event-source-src"><a href=
"#src11">src</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmleventsourceelement">HTMLEventSourceElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#src12" title=
"dom-event-source-src">src</a>;
};
</pre></dd>
</dl>
<p>The <code><a href="#event-source">event-source</a></code>
element represents a target for events generated by a remote
server.</p>
<p>The <dfn id="src11" title=
"attr-event-source-src"><code>src</code></dfn> attribute, if
specified, must give a URI (or IRI) pointing to a resource that
uses the <code><del class=
"diff-old">application/x-dom-event-stream</del> <ins class=
"diff-chg">text/event-stream</ins></code> format.</p>
<p>When the element is inserted into the document, if it has the
<code title="attr-event-source-src"><a href="#src11">src</a></code>
attribute specified, the user agent must act as if the <code title=
"dom-remoteEventTarget-addEventSource"><a href=
"#addeventsource">addEventSource()</a></code> method on the
<code><a href="#event-source">event-source</a></code> element had
been invoked with the URI resulting from resolving the <code title=
"attr-event-source-src"><a href="#src11">src</a></code> attribute's
value to an absolute URI.</p>
<p>While the element is in a document, if its <code title=
"attr-event-source-src"><a href="#src11">src</a></code> attribute
is mutated, the user agent must act as if first the <code title=
"dom-remoteEventTarget-removeEventSource"><a href=
"#removeeventsource">removeEventSource()</a></code> method on the
<code><a href="#event-source">event-source</a></code> element had
been invoked with the URI resulting from resolving the old value of
the attribute to an absolute URI, and then as if the <code title=
"dom-remoteEventTarget-addEventSource"><a href=
"#addeventsource">addEventSource()</a></code> method on the element
had been invoked with the URI resulting from resolving the
<em>new</em> value of the <code title=
"attr-event-source-src"><a href="#src11">src</a></code> attribute
to an absolute URI.</p>
<p>When the element is removed from the document, if it has the
<code title="attr-event-source-src"><a href="#src11">src</a></code>
attribute specified, or, when the <code title=
"attr-event-source-src"><a href="#src11">src</a></code> attribute
is about to be removed, the user agent must act as if the
<code title="dom-remoteEventTarget-removeEventSource"><a href=
"#removeeventsource">removeEventSource()</a></code> method on the
<code><a href="#event-source">event-source</a></code> element had
been invoked with the URI resulting from resolving the <code title=
"attr-event-source-src"><a href="#src11">src</a></code> attribute's
value to an absolute URI.</p>
<p>There can be more than one <code><a href=
"#event-source">event-source</a></code> element per document, but
authors should take care to avoid opening multiple connections to
the same server as HTTP recommends a limit to the number of
simultaneous connections that a user agent can open per server.</p>
<p>The <dfn id="src12" title=
"dom-event-source-src"><code>src</code></dfn> DOM attribute must
<a href="#reflect">reflect</a> the content attribute of the same
name.</p>
<h3 id="interactive-elements"><span class="secno"><del class=
"diff-old">3.18.</del> <ins class="diff-chg">3.16</ins></span>
Interactive elements</h3>
<h4 id="the-details"><span class="secno"><del class=
"diff-old">3.18.1.</del> <ins class="diff-chg">3.16.1</ins></span>
The <dfn id="details"><code>details</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><span><del class="diff-old">Prose</del> <ins class=
"diff-chg">Flow</ins> element</span> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>One <code><a href="#legend">legend</a></code> element followed
by <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a>
.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-details-open"><a href=
"#open0">open</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmldetailselement">HTMLDetailsElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
<del class="diff-old"> attribute boolean ;
</del>
<ins class="diff-chg"> attribute boolean <a href="#open1"
title="dom-details-open">open</a>;
</ins>
};
</pre></dd>
</dl>
<p>The <code><a href="#details">details</a></code> element
represents additional information or controls which the user can
obtain on demand.</p>
<p>The first element child of a <code><a href=
"#details">details</a></code> element, if it is a <code><a href=
"#legend">legend</a></code> element, represents the summary of the
details.</p>
<p>If the first element is not a <code><a href=
"#legend">legend</a></code> element, the UA should provide its own
legend (e.g. "Details").</p>
<p>The <dfn id="open0" title=
"attr-details-open"><code>open</code></dfn> content attribute is a
<a href="#boolean0">boolean attribute</a> . If present, it
indicates that the details should be shown to the user. If the
attribute is absent, the details should not be shown.</p>
<p>If the attribute is removed, then the details should be hidden.
If the attribute is added, the details should be shown.</p>
<p>The user should be able to request that the details be shown or
hidden.</p>
<p>The <dfn id="open1" title=
"dom-details-open"><code>open</code></dfn> attribute must <a href=
"#reflect">reflect</a> the <code title="attr-details-open"><a href=
"#open0">open</a></code> content attribute.</p>
<p class="big-issue">Rendering will be described in the Rendering
section in due course. Basically CSS :open and :closed match the
element, it's a block-level element by default, and when it matches
:closed it renders as if it had an XBL binding attached to it whose
template was just <code><template> ▶<content
includes="legend:first-child">Details</content>
</template></code> , and when it's :open it acts as if it had
an XBL binding attached to it whose template was just
<code><template> ▼<content
includes="legend:first-child">Details</content>
<content/> </template></code> or some such.</p>
<p class="big-issue">Clicking the legend would make it open/close
(and would change the content attribute). Question: Do we want the
content attribute to reflect the actual state like this? I think we
do, the DOM not reflecting state has been a pain in the neck
before. But is it semantically ok?</p>
<h4 id="datagrid"><span class="secno"><del class=
"diff-old">3.18.2.</del> <ins class="diff-chg">3.16.2</ins></span>
The <dfn id="datagrid0"><code>datagrid</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><span><del class="diff-old">Prose</del> <ins class=
"diff-chg">Flow</ins> element</span> .</dd>
<dd><span>Interactive element</span> .</dd>
<dd><a href="#sectioning1"><ins class="diff-new">Sectioning
root</ins></a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>Either: Nothing.</dd>
<dd>Or: <del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a> , but
where the first element child node, if any, is not a <code><a href=
"#table">table</a></code> , <code><ins class=
"diff-new">select</ins></code> ,<ins class="diff-new">or</ins>
<code><ins class="diff-new">datalist</ins></code> element.</dd>
<dd>Or: A single <code><a href="#table">table</a></code>
element.</dd>
<dd>Or: A single <code>select</code> element.</dd>
<dd>Or: A single <code>datalist</code> element.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-datagrid-multiple"><a href=
"#multiple0">multiple</a></code></dd>
<dd><code title="attr-datagrid-disabled"><a href=
"#disabled3">disabled</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmldatagridelement">HTMLDataGridElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
attribute <a href=
"#datagriddataprovider">DataGridDataProvider</a> <a href="#data2"
title="dom-datagrid-data">data</a>;
readonly attribute <a href=
"#datagridselection">DataGridSelection</a> <a href="#selection0"
title="dom-datagrid-selection">selection</a>;
attribute boolean <a href="#multiple" title=
"dom-datagrid-multiple">multiple</a>;
attribute boolean <a href="#disabled2" title=
"dom-datagrid-disabled">disabled</a>;
void <a href="#updateeverything" title=
"dom-datagrid-updateEverything">updateEverything</a>();
void <a href="#updaterowschanged" title=
"dom-datagrid-updateRowsChanged">updateRowsChanged</a>(in <a href=
"#rowspecification">RowSpecification</a> row, in unsigned long count);
void <a href="#updaterowsinserted" title=
"dom-datagrid-updateRowsInserted">updateRowsInserted</a>(in <a href="#rowspecification">RowSpecification</a> row, in unsigned long count);
void <a href="#updaterowsremoved" title=
"dom-datagrid-updateRowsRemoved">updateRowsRemoved</a>(in <a href=
"#rowspecification">RowSpecification</a> row, in unsigned long count);
void <a href="#updaterowchanged" title=
"dom-datagrid-updateRowChanged">updateRowChanged</a>(in <a href=
"#rowspecification">RowSpecification</a> row);
void <a href="#updatecolumnchanged" title=
"dom-datagrid-updateColumnChanged">updateColumnChanged</a>(in unsigned long column);
void <a href="#updatecellchanged" title=
"dom-datagrid-updateCellChanged">updateCellChanged</a>(in <a href=
"#rowspecification">RowSpecification</a> row, in unsigned long column);
};
</pre></dd>
</dl>
<p class="big-issue">One possible thing to be added is a way to
detect when a row/selection has been deleted, activated, etc, by
the user (delete key, enter key, etc).</p>
<p class="big-issue">This element is defined as interactive, which
means it can't contain other interactive elements, despite the fact
that we expect it to work with other interactive elements e.g.
checkboxes and input fields. It should be called something like a
Leaf Interactive Element or something, which counts for ancestors
looking in and not descendants looking out.</p>
<p>The <code><a href="#datagrid0">datagrid</a></code> element
represents an interactive representation of tree, list, or tabular
data.</p>
<p>The data being presented can come either from the content, as
elements given as children of the <code><a href=
"#datagrid0">datagrid</a></code> element, or from a scripted data
provider given by the <code title="dom-datagrid-data"><a href=
"#data2">data</a></code> DOM attribute.</p>
<p>The <code title="attr-datagrid-multiple"><a href=
"#multiple0">multiple</a></code> and <code title=
"attr-datagrid-disabled"><a href="#disabled3">disabled</a></code>
attributes are <a href="#boolean0" title=
"boolean attribute">boolean attributes</a> . Their effects are
described in the processing model sections below.</p>
<p>The <dfn id="multiple" title=
"dom-datagrid-multiple"><code>multiple</code></dfn> and <dfn id=
"disabled2" title=
"dom-datagrid-disabled"><code>disabled</code></dfn> DOM attributes
must <a href="#reflect">reflect</a> the <code title=
"attr-datagrid-multiple"><a href="#multiple0">multiple</a></code>
and <code title="attr-datagrid-disabled"><a href=
"#disabled3">disabled</a></code> content attributes
respectively.</p>
<h5 id="the-datagrid"><span class="secno"><del class=
"diff-old">3.18.2.1.</del> <ins class=
"diff-chg">3.16.2.1.</ins></span> The <code><a href=
"#datagrid0">datagrid</a></code> data model</h5>
<p><em>This section is non-normative.</em></p>
<p>In the <code><a href="#datagrid0">datagrid</a></code> data
model, data is structured as a set of rows representing a tree,
each row being split into a number of columns. The columns are
always present in the data model, although individual columns may
be hidden in the presentation.</p>
<p>Each row can have child rows. Child rows may be hidden or shown,
by closing or opening (respectively) the parent row.</p>
<p>Rows are referred to by the path along the tree that one would
take to reach the row, using zero-based indices. Thus, the first
row of a list is row "0", the second row is row "1"; the first
child row of the first row is row "0,0", the second child row of
the first row is row "0,1"; the fourth child of the seventh child
of the third child of the tenth row is "9,2,6,3", etc.</p>
<p>The columns can have captions. Those captions are not considered
a row in their own right, they are obtained separately.</p>
<p>Selection of data in a <code><a href=
"#datagrid0">datagrid</a></code> operates at the row level. If the
<code title="attr-datagrid-multiple"><a href=
"#multiple0">multiple</a></code> attribute is present, multiple
rows can be selected at once, otherwise the user can only select
one row at a time.</p>
<p>The <code><a href="#datagrid0">datagrid</a></code> element can
be disabled entirely by setting the <code title=
"attr-datagrid-disabled"><a href="#disabled3">disabled</a></code>
attribute.</p>
<p>Columns, rows, and cells can each have specific flags, known as
classes, applied to them by the data provider. These classes
<a href="#datagridClassSummary">affect the functionality</a> of the
<code><a href="#datagrid0">datagrid</a></code> element, and are
also <a href="#datagridPseudos">passed to the style system</a> .
They are similar in concept to the <code title=
"attr-class"><a href="#class">class</a></code> attribute, except
that they are not specified on elements but are given by scripted
data providers.</p>
<h5 id="how-rows"><span class="secno"><del class=
"diff-old">3.18.2.2.</del> <ins class=
"diff-chg">3.16.2.2.</ins></span> How rows are identified</h5>
<p>The chains of numbers that give a row's path, or identifier, are
represented by objects that implement the <a href=
"#rowspecification">RowSpecification</a> interface. <del class=
"diff-old">{</del></p>
<pre>
<ins class=
"diff-chg"> class=idl>[NoInterfaceObject] interface <dfn id=
"rowspecification">RowSpecification</dfn> {
</ins>
// binding-specific interface
};
</pre>
<p>In ECMAScript, two classes of objects are said to implement this
interface: Numbers representing non-negative integers, and
homogeneous arrays of Numbers representing non-negative integers.
Thus, <code>[1,0,9]</code> is a <a href=
"#rowspecification">RowSpecification</a> , as is <code>1</code> on
its own. However, <code>[1,0.2,9]</code> is not a <a href=
"#rowspecification">RowSpecification</a> object, since its second
value is not an integer.</p>
<p>User agents must always represent <code><a href=
"#rowspecification">RowSpecification</a></code> s in ECMAScript by
using arrays, even if the path only has one number.</p>
<p>The root of the tree is represented by the empty path; in
ECMAScript, this is the empty array ( <code>[]</code> ). Only the
<code title="dom-provider-getRowCount"><a href=
"#getrowcount">getRowCount()</a></code> and <code title=
"dom-provider-getChildAtPosition"><a href=
"#getchildatposition">GetChildAtPosition()</a></code> methods ever
get called with the empty path.</p>
<h5 id="the-data"><span class="secno"><del class=
"diff-old">3.18.2.3.</del> <ins class=
"diff-chg">3.16.2.3.</ins></span> The data provider interface</h5>
<p><em>The conformance criteria in this section apply to any
implementation of the <code><a href=
"#datagriddataprovider">DataGridDataProvider</a></code> , including
(and most commonly) the content author's
implementation(s).</em></p>
<pre class="idl">
// To be implemented by Web authors as a JS object
<del class="diff-old">interface {
</del>
<ins class="diff-chg">[NoInterfaceObject] interface <dfn id=
"datagriddataprovider">DataGridDataProvider</dfn> {
</ins>
void <a href="#initialize" title=
"dom-provider-initialize">initialize</a>(in HTMLDataGridElement datagrid);
unsigned long <a href="#getrowcount" title=
"dom-provider-getRowCount">getRowCount</a>(in <a href=
"#rowspecification">RowSpecification</a> row);
unsigned long <a href="#getchildatposition" title=
"dom-provider-getChildAtPosition">getChildAtPosition</a>(in <a href="#rowspecification">RowSpecification</a> parentRow, in unsigned long position);
unsigned long <a href="#getcolumncount" title=
"dom-provider-getColumnCount">getColumnCount</a>();
DOMString <a href="#getcaptiontext" title=
"dom-provider-getCaptionText">getCaptionText</a>(in unsigned long column);
void <a href="#getcaptionclasses" title=
"dom-provider-getCaptionClasses">getCaptionClasses</a>(in unsigned long column, in DOMTokenList classes);
DOMString <a href="#getrowimage" title=
"dom-provider-getRowImage">getRowImage</a>(in <a href=
"#rowspecification">RowSpecification</a> row);
<a href="#htmlmenuelement">HTMLMenuElement</a> <a href=
"#getrowmenu" title=
"dom-provider-getRowMenu">getRowMenu</a>(in <a href=
"#rowspecification">RowSpecification</a> row);
void <a href="#getrowclasses" title=
"dom-provider-getRowClasses">getRowClasses</a>(in <a href=
"#rowspecification">RowSpecification</a> row, in DOMTokenList classes);
DOMString <a href="#getcelldata" title=
"dom-provider-getCellData">getCellData</a>(in <a href=
"#rowspecification">RowSpecification</a> row, in unsigned long column);
void <a href="#getcellclasses" title=
"dom-provider-getCellClasses">getCellClasses</a>(in <a href=
"#rowspecification">RowSpecification</a> row, in unsigned long column, in DOMTokenList classes);
void <a href="#togglecolumnsortstate" title=
"dom-provider-toggleColumnSortState">toggleColumnSortState</a>(in unsigned long column);
void <a href="#setcellcheckedstate" title=
"dom-provider-setCellCheckedState">setCellCheckedState</a>(in <a href="#rowspecification">RowSpecification</a> row, in unsigned long column, in long state);
void <a href="#cyclecell" title=
"dom-provider-cycleCell">cycleCell</a>(in <a href=
"#rowspecification">RowSpecification</a> row, in unsigned long column);
void <a href="#editcell" title=
"dom-provider-editCell">editCell</a>(in <a href=
"#rowspecification">RowSpecification</a> row, in unsigned long column, in DOMString data);
};
</pre>
<p>The <code><a href=
"#datagriddataprovider">DataGridDataProvider</a></code> interface
represents the interface that objects must implement to be used as
custom data views for <code><a href=
"#datagrid0">datagrid</a></code> elements.</p>
<p>Not all the methods are required. The minimum number of methods
that must be implemented in a useful view is two: the <code title=
"dom-provider-getRowCount"><a href=
"#getrowcount">getRowCount()</a></code> and <code title=
"dom-provider-getCellData"><a href=
"#getcelldata">getCellData()</a></code> methods.</p>
<p>Once the object is written, it must be hooked up to the
<code><a href="#datagrid0">datagrid</a></code> using the <dfn id=
"data2" title="dom-datagrid-data"><code>data</code></dfn> DOM
attribute.</p>
<p>The following methods may be usefully implemented:</p>
<dl>
<dt><dfn id="initialize" title=
"dom-provider-initialize"><code>initialize( <var title=
"">datagrid</var> )</code></dfn></dt>
<dd>Called by the <code><a href="#datagrid0">datagrid</a></code>
element (the one given by the <var title="">datagrid</var>
argument) after it has first populated itself. This would typically
be used to set the initial selection of the <code><a href=
"#datagrid0">datagrid</a></code> element when it is first loaded.
The data provider could also use this method call to register a
<code title="event-select"><a href="#select">select</a></code>
event handler on the <code><a href="#datagrid0">datagrid</a></code>
in order to monitor selection changes.</dd>
<dt><dfn id="getrowcount" title=
"dom-provider-getRowCount"><code>getRowCount( <var title=
"">row</var> )</code></dfn></dt>
<dd>Must return the number of rows that are children of the
specified <var title="">row</var> , including rows that are
off-screen. If <var title="">row</var> is empty, then the number of
rows at the top level must be returned. If the value that this
method would return for a given <var title="">row</var> changes,
the relevant update methods on the <code><a href=
"#datagrid0">datagrid</a></code> must be called first. Otherwise,
this method must always return the same number. For a list (as
opposed to a tree), this method must return 0 whenever it is called
with a <var title="">row</var> identifier that is not empty.</dd>
<dt><dfn id="getchildatposition" title=
"dom-provider-getChildAtPosition"><code>getChildAtPosition(
<var title="">parentRow</var> , <var title="">position</var>
)</code></dfn></dt>
<dd>Must return the index of the row that is a child of <var title=
"">parentRow</var> and that is to be positioned as the <var title=
"">position</var> th row under <var title="">parentRow</var> when
rendering the children of <var title="">parentRow</var> . If
<var title="">parentRow</var> is empty, then <var title=
"">position</var> refers to the <var title="">position</var> th row
at the top level of the data grid. May be omitted if the rows are
always to be sorted in the natural order. (The natural order is the
one where the method always returns <var title="">position</var> .)
For a given <var title="">parentRow</var> , this method must never
return the same value for different values of <var title=
"">position</var> . The returned value <var title="">x</var> must
be in the range 0 ≤ <var title="">x</var>
< <var title="">n</var> , where <var title=
"">n</var> is the value returned by <code title=
"dom-provider-getRowCount"><a href="#getrowcount">getRowCount(
<var title="">parentRow</var> )</a></code> .</dd>
<dt><dfn id="getcolumncount" title=
"dom-provider-getColumnCount"><code>getColumnCount()</code></dfn></dt>
<dd>Must return the number of columns currently in the data model
(including columns that might be hidden). May be omitted if there
is only one column. If the value that this method would return
changes, the <code><a href="#datagrid0">datagrid</a></code> 's
<code title="dom-datagrid-updateEverything"><a href=
"#updateeverything">updateEverything()</a></code> method must be
called.</dd>
<dt><dfn id="getcaptiontext" title=
"dom-provider-getCaptionText"><code>getCaptionText( <var title=
"">column</var> )</code></dfn></dt>
<dd>Must return the caption, or label, for column <var title=
"">column</var> . May be omitted if the columns have no captions.
If the value that this method would return changes, the
<code><a href="#datagrid0">datagrid</a></code> 's <code title=
"dom-datagrid-updateColumnChanged"><a href=
"#updatecolumnchanged">updateColumnChanged()</a></code> method must
be called with the appropriate column index.</dd>
<dt><dfn id="getcaptionclasses" title=
"dom-provider-getCaptionClasses"><code>getCaptionClasses(
<var title="">column</var> , <var title="">classes</var>
)</code></dfn></dt>
<dd>Must add the classes that apply to column <var title=
"">column</var> to the <var title="">classes</var> object. May be
omitted if the columns have no special classes. If the classes that
this method would add changes, the <code><a href=
"#datagrid0">datagrid</a></code> 's <code title=
"dom-datagrid-updateColumnChanged"><a href=
"#updatecolumnchanged">updateColumnChanged()</a></code> method must
be called with the appropriate column index. Some classes have
<a href="#datagridClassSummary">predefined meanings</a> .</dd>
<dt><dfn id="getrowimage" title=
"dom-provider-getRowImage"><code>getRowImage( <var title=
"">row</var> )</code></dfn></dt>
<dd>Must return a URI to an image that represents row <var title=
"">row</var> , or the empty string if there is no applicable image.
May be omitted if no rows have associated images. If the value that
this method would return changes, the <code><a href=
"#datagrid0">datagrid</a></code> 's update methods must be called
to update the row in question.</dd>
<dt><dfn id="getrowmenu" title=
"dom-provider-getRowMenu"><code>getRowMenu( <var title="">row</var>
)</code></dfn></dt>
<dd>Must return an <code><a href=
"#htmlmenuelement">HTMLMenuElement</a></code> object that is to be
used as a context menu for row <var title="">row</var> , or null if
there is no particular context menu. May be omitted if none of the
rows have a special context menu. As this method is called
immediately before showing the menu in question, no precautions
need to be taken if the return value of this method changes.</dd>
<dt><dfn id="getrowclasses" title=
"dom-provider-getRowClasses"><code>getRowClasses( <var title=
"">row</var> , <var title="">classes</var> )</code></dfn></dt>
<dd>Must add the classes that apply to row <var title="">row</var>
to the <var title="">classes</var> object. May be omitted if the
rows have no special classes. If the classes that this method would
add changes, the <code><a href="#datagrid0">datagrid</a></code> 's
update methods must be called to update the row in question. Some
classes have <a href="#datagridClassSummary">predefined
meanings</a> .</dd>
<dt><dfn id="getcelldata" title=
"dom-provider-getCellData"><code>getCellData( <var title=
"">row</var> , <var title="">column</var> )</code></dfn></dt>
<dd>Must return the value of the cell on row <var title=
"">row</var> in column <var title="">column</var> . For text cells,
this must be the text to show for that cell. For <a href=
"#progress1" title="datagrid-cell-class-progress">progress bar
cells</a> , this must be either a floating point number in the
range 0.0 to 1.0 (converted to a string representation ),
indicating the fraction of the progress bar to show as full (1.0
meaning complete), or the empty string, indicating an indeterminate
progress bar. If the value that this method would return changes,
the <code><a href="#datagrid0">datagrid</a></code> 's update
methods must be called to update the rows that changed. If only one
cell changed, the <code title=
"dom-datagrid-updateCellChanged"><a href=
"#updatecellchanged">updateCellChanged()</a></code> method may be
used.</dd>
<dt><dfn id="getcellclasses" title=
"dom-provider-getCellClasses"><code>getCellClasses( <var title=
"">row</var> , <var title="">column</var> , <var title=
"">classes</var> )</code></dfn></dt>
<dd>Must add the classes that apply to the cell on row <var title=
"">row</var> in column <var title="">column</var> to the
<var title="">classes</var> object. May be omitted if the cells
have no special classes. If the classes that this method would add
changes, the <code><a href="#datagrid0">datagrid</a></code> 's
update methods must be called to update the rows or cells in
question. Some classes have <a href=
"#datagridClassSummary">predefined meanings</a> .</dd>
<dt><dfn id="togglecolumnsortstate" title=
"dom-provider-toggleColumnSortState"><code>toggleColumnSortState(
<var title="">column</var> )</code></dfn></dt>
<dd>Called by the <code><a href="#datagrid0">datagrid</a></code>
when the user tries to sort the data using a particular column
<var title="">column</var> . The data provider must update its
state so that the <code title=
"dom-provider-getChildAtPosition"><a href=
"#getchildatposition">GetChildAtPosition()</a></code> method
returns the new order, and the classes of the columns returned by
<code title="dom-provider-getCaptionClasses"><a href=
"#getcaptionclasses">getCaptionClasses()</a></code> represent the
new sort status. There is no need to tell the <code><a href=
"#datagrid0">datagrid</a></code> that it the data has changed, as
the <code><a href="#datagrid0">datagrid</a></code> automatically
assumes that the entire data model will need updating.</dd>
<dt><dfn id="setcellcheckedstate" title=
"dom-provider-setCellCheckedState"><code>setCellCheckedState(
<var title="">row</var> , <var title="">column</var> , <var title=
"">state</var> )</code></dfn></dt>
<dd>Called by the <code><a href="#datagrid0">datagrid</a></code>
when the user changes the state of a checkbox cell on row
<var title="">row</var> , column <var title="">column</var> . The
checkbox should be toggled to the state given by <var title=
"">state</var> , which is a positive integer (1) if the checkbox is
to be checked, zero (0) if it is to be unchecked, and a negative
number <del class="diff-old">(-1)</del> <ins class=
"diff-chg">(−1)</ins> if it is to be set to the indeterminate
state. There is no need to tell the <code><a href=
"#datagrid0">datagrid</a></code> that the cell has changed, as the
<code><a href="#datagrid0">datagrid</a></code> automatically
assumes that the given cell will need updating.</dd>
<dt><dfn id="cyclecell" title=
"dom-provider-cycleCell"><code>cycleCell( <var title="">row</var> ,
<var title="">column</var> )</code></dfn></dt>
<dd>Called by the <code><a href="#datagrid0">datagrid</a></code>
when the user changes the state of a cyclable cell on row
<var title="">row</var> , column <var title="">column</var> . The
data provider should change the state of the cell to the new state,
as appropriate. There is no need to tell the <code><a href=
"#datagrid0">datagrid</a></code> that the cell has changed, as the
<code><a href="#datagrid0">datagrid</a></code> automatically
assumes that the given cell will need updating.</dd>
<dt><dfn id="editcell" title=
"dom-provider-editCell"><code>editCell( <var title="">row</var> ,
<var title="">column</var> , <var title="">data</var>
)</code></dfn></dt>
<dd>Called by the <code><a href="#datagrid0">datagrid</a></code>
when the user edits the cell on row <var title="">row</var> ,
column <var title="">column</var> . The new value of the cell is
given by <var title="">data</var> . The data provider should update
the cell accordingly. There is no need to tell the <code><a href=
"#datagrid0">datagrid</a></code> that the cell has changed, as the
<code><a href="#datagrid0">datagrid</a></code> automatically
assumes that the given cell will need updating.</dd>
</dl>
<p>The following classes (for rows, columns, and cells) may be
usefully used in conjunction with this interface:</p>
<table id="datagridClassSummary">
<tbody>
<tr>
<th>Class name</th>
<th>Applies to</th>
<th>Description</th>
</tr>
<tr>
<td><dfn id="checked" title=
"datagrid-cell-class-checked"><code>checked</code></dfn></td>
<td>Cells</td>
<td>The cell has a checkbox and it is checked. (The <code title=
"datagrid-cell-class-cyclable"><a href=
"#cyclable">cyclable</a></code> and <code title=
"datagrid-cell-class-progress"><a href=
"#progress1">progress</a></code> classes override this,
though.)</td>
</tr>
<tr>
<td><dfn id="cyclable" title=
"datagrid-cell-class-cyclable"><code>cyclable</code></dfn></td>
<td>Cells</td>
<td>The cell can be cycled through multiple values. (The
<code title="datagrid-cell-class-progress"><a href=
"#progress1">progress</a></code> class overrides this,
though.)</td>
</tr>
<tr>
<td><dfn id="editable" title=
"datagrid-cell-class-editable"><code>editable</code></dfn></td>
<td>Cells</td>
<td>The cell can be edited. (The <code title=
"datagrid-cell-class-cyclable"><a href=
"#cyclable">cyclable</a></code> , <code title=
"datagrid-cell-class-progress"><a href=
"#progress1">progress</a></code> , <code title=
"datagrid-cell-class-checked"><a href="#checked">checked</a></code>
, <code title="datagrid-cell-class-checked"><a href=
"#checked">unchecked</a></code> and <code title=
"datagrid-cell-class-checked"><a href=
"#checked">indeterminate</a></code> classes override this,
though.)</td>
</tr>
<tr>
<td><dfn id="header0" title=
"datagrid-row-class-header"><code>header</code></dfn></td>
<td>Rows</td>
<td>The row is a heading, not a data row.</td>
</tr>
<tr>
<td><dfn id="indeterminate" title=
"datagrid-cell-class-indeterminate"><code>indeterminate</code></dfn></td>
<td>Cells</td>
<td>The cell has a checkbox, and it can be set to an indeterminate
state. If neither the <code title=
"datagrid-cell-class-checked"><a href="#checked">checked</a></code>
nor <code title="datagrid-cell-class-checked"><a href=
"#checked">unchecked</a></code> classes are present, then the
checkbox is in that state, too. (The <code title=
"datagrid-cell-class-cyclable"><a href=
"#cyclable">cyclable</a></code> and <code title=
"datagrid-cell-class-progress"><a href=
"#progress1">progress</a></code> classes override this,
though.)</td>
</tr>
<tr>
<td><dfn id="initially-hidden" title=
"datagrid-column-class-initially-hidden"><code>initially-hidden</code></dfn></td>
<td>Columns</td>
<td>The column will not be shown when the <code><a href=
"#datagrid0">datagrid</a></code> is initially rendered. If this
class is not present on the column when the <code><a href=
"#datagrid0">datagrid</a></code> is initially rendered, the column
will be visible if space allows.</td>
</tr>
<tr>
<td><dfn id="initially-closed" title=
"datagrid-row-class-initially-closed"><code>initially-closed</code></dfn></td>
<td>Rows</td>
<td>The row will be closed when the <code><a href=
"#datagrid0">datagrid</a></code> is initially rendered. If neither
this class nor the <code title=
"datagrid-row-class-initially-open"><a href=
"#initially-open">initially-open</a></code> class is present on the
row when the <code><a href="#datagrid0">datagrid</a></code> is
initially rendered, the initial state will depend on platform
conventions.</td>
</tr>
<tr>
<td><dfn id="initially-open" title=
"datagrid-row-class-initially-open"><code>initially-open</code></dfn></td>
<td>Rows</td>
<td>The row will be opened when the <code><a href=
"#datagrid0">datagrid</a></code> is initially rendered. If neither
this class nor the <code title=
"datagrid-row-class-initially-closed"><a href=
"#initially-closed">initially-closed</a></code> class is present on
the row when the <code><a href="#datagrid0">datagrid</a></code> is
initially rendered, the initial state will depend on platform
conventions.</td>
</tr>
<tr>
<td><dfn id="progress1" title=
"datagrid-cell-class-progress"><code>progress</code></dfn></td>
<td>Cells</td>
<td>The cell is a progress bar.</td>
</tr>
<tr>
<td><dfn id="reversed1" title=
"datagrid-column-class-reversed"><code>reversed</code></dfn></td>
<td>Columns</td>
<td>If the cell is sorted, the sort direction is descending,
instead of ascending.</td>
</tr>
<tr>
<td><dfn id="selectable-separator" title=
"datagrid-row-class-selectable-separator"><code>selectable-separator</code></dfn></td>
<td>Rows</td>
<td>The row is a normal, selectable, data row, except that instead
of having data, it only has a separator. (The <code title=
"datagrid-row-class-header"><a href="#header0">header</a></code>
and <code title="datagrid-row-class-separator"><a href=
"#separator">separator</a></code> classes override this,
though.)</td>
</tr>
<tr>
<td><dfn id="separator" title=
"datagrid-row-class-separator"><code>separator</code></dfn></td>
<td>Rows</td>
<td>The row is a separator row, not a data row. (The <code title=
"datagrid-row-class-header"><a href="#header0">header</a></code>
class overrides this, though.)</td>
</tr>
<tr>
<td><dfn id="sortable" title=
"datagrid-column-class-sortable"><code>sortable</code></dfn></td>
<td>Columns</td>
<td>The data can be sorted by this column.</td>
</tr>
<tr>
<td><dfn id="sorted" title=
"datagrid-column-class-sorted"><code>sorted</code></dfn></td>
<td>Columns</td>
<td>The data is sorted by this column. Unless the <code title=
"datagrid-column-class-reversed"><a href=
"#reversed1">reversed</a></code> class is also present, the sort
direction is ascending.</td>
</tr>
<tr>
<td><dfn id="unchecked" title=
"datagrid-cell-class-unchecked"><code>unchecked</code></dfn></td>
<td>Cells</td>
<td>The cell has a checkbox and, unless the <code title=
"datagrid-cell-class-checked"><a href="#checked">checked</a></code>
class is present as well, it is unchecked. (The <code title=
"datagrid-cell-class-cyclable"><a href=
"#cyclable">cyclable</a></code> and <code title=
"datagrid-cell-class-progress"><a href=
"#progress1">progress</a></code> classes override this,
though.)</td>
</tr>
</tbody>
</table>
<h5 id="the-default"><span class="secno"><del class=
"diff-old">3.18.2.4.</del> <ins class=
"diff-chg">3.16.2.4.</ins></span> The default data provider</h5>
<p>The user agent must supply a default data provider for the case
where the <code><a href="#datagrid0">datagrid</a></code> 's
<code title="dom-datagrid-data"><a href="#data2">data</a></code>
attribute is null. It must act as described in this section.</p>
<p>The <del class="diff-old">behaviour</del> <ins class=
"diff-chg">behavior</ins> of the default data provider depends on
the nature of the first element child of the <code><a href=
"#datagrid0">datagrid</a></code> .</p>
<dl class="switch">
<dt>While the first element child is a <code><a href=
"#table">table</a></code> element</dt>
<dd>
<p><strong><code title="dom-provider-getRowCount"><a href=
"#getrowcount">getRowCount( <var title="">row</var>
)</a></code></strong> : The number of rows returned by the default
data provider for the root of the tree (when <var title=
"">row</var> is empty) must be the total number of <code><a href=
"#tr">tr</a></code> elements that are children of <code><a href=
"#tbody">tbody</a></code> elements that are children of the
<code><a href="#table">table</a></code> , if there are any such
child <code><a href="#tbody">tbody</a></code> elements. If there
are no such <code><a href="#tbody">tbody</a></code> elements then
the number of rows returned for the root must be the number of
<code><a href="#tr">tr</a></code> elements that are children of the
<code><a href="#table">table</a></code> .</p>
<p>When <var title="">row</var> is not empty, the number of rows
returned must be zero.</p>
<p class="note">The <code><a href="#table">table</a></code> -based
default data provider cannot represent a tree.</p>
<p class="note">Rows in <code><a href="#thead0">thead</a></code>
elements do not contribute to the number of rows returned, although
they do affect the columns and column captions. Rows in
<code><a href="#tfoot0">tfoot</a></code> elements are <a href=
"#ignored" title="ignore">ignored</a> completely by this
algorithm.</p>
<p id="defaultDataProviderTableMapper"><strong><code title=
"dom-provider-getChildAtPosition"><a href=
"#getchildatposition">getChildAtPosition( <var title="">row</var> ,
<var title="">i</var> )</a></code></strong> : The default data
provider must return the mapping appropriate to the <a href=
"#defaultDataProviderTableSort">current sort order</a> .</p>
<p><strong><code title="dom-provider-getColumnCount"><a href=
"#getcolumncount">getColumnCount()</a></code></strong> : The number
of columns returned must be the number of <code><a href=
"#td">td</a></code> element children in the first <code><a href=
"#tr">tr</a></code> element child of the first <code><a href=
"#tbody">tbody</a></code> element child of the <code><a href=
"#table">table</a></code> , if there are any such <code><a href=
"#tbody">tbody</a></code> elements. If there are no such
<code><a href="#tbody">tbody</a></code> elements, then it must be
the number of <code><a href="#td">td</a></code> element children in
the first <code><a href="#tr">tr</a></code> element child of the
<code><a href="#table">table</a></code> , if any, or otherwise 1.
If the number that would be returned by these rules is 0, then 1
must be returned instead.</p>
<p><strong><code title="dom-provider-getCaptionText"><a href=
"#getcaptiontext">getCaptionText( <var title="">i</var>
)</a></code></strong> : If the <code><a href=
"#table">table</a></code> has no <code><a href=
"#thead0">thead</a></code> element child, or if its first
<code><a href="#thead0">thead</a></code> element child has no
<code><a href="#tr">tr</a></code> element child, the default data
provider must return the empty string for all captions. Otherwise,
the value of the <code><a href=
"#textcontent">textContent</a></code> attribute of the <var title=
"">i</var> th <code><a href="#th">th</a></code> element child of
the first <code><a href="#tr">tr</a></code> element child of the
first <code><a href="#thead0">thead</a></code> element child of the
<code><a href="#table">table</a></code> element must be returned.
If there is no such <code><a href="#th">th</a></code> element, the
empty string must be returned.</p>
<p><strong><code title="dom-provider-getCaptionClasses"><a href=
"#getcaptionclasses">getCaptionClasses( <var title="">i</var> ,
<var title="">classes</var> )</a></code></strong> : If the
<code><a href="#table">table</a></code> has no <code><a href=
"#thead0">thead</a></code> element child, or if its first
<code><a href="#thead0">thead</a></code> element child has no
<code><a href="#tr">tr</a></code> element child, the default data
provider must not add any classes for any of the captions.
Otherwise, each class in the <code title="attr-class"><a href=
"#class">class</a></code> attribute of the <var title="">i</var> th
<code><a href="#th">th</a></code> element child of the first
<code><a href="#tr">tr</a></code> element child of the first
<code><a href="#thead0">thead</a></code> element child of the
<code><a href="#table">table</a></code> element must be added to
the <var title="">classes</var> . If there is no such
<code><a href="#th">th</a></code> element, no classes must be
added. The user agent must then:</p>
<ol>
<li>Remove the <code title="datagrid-column-class-sorted"><a href=
"#sorted">sorted</a></code> and <code title=
"datagrid-column-class-reversed"><a href=
"#reversed1">reversed</a></code> classes.</li>
<li>If the <code><a href="#table">table</a></code> element has a
<code title="attr-class"><a href="#class">class</a></code>
attribute that includes the <code title="">sortable</code> class,
add the <code title="datagrid-column-class-sortable"><a href=
"#sortable">sortable</a></code> class.</li>
<li>If the column is the one currently being used to sort the data,
add the <code title="datagrid-column-class-sorted"><a href=
"#sorted">sorted</a></code> class.</li>
<li>If the column is the one currently being used to sort the data,
and it is sorted in descending order, add the <code title=
"datagrid-column-class-reversed"><a href=
"#reversed1">reversed</a></code> class as well.</li>
</ol>
<p>The various row- and cell- related methods operate relative to a
particular element, the element of the row or cell specified by
their arguments.</p>
<p><strong>For rows</strong> : Since the default data provider for
a <code><a href="#table">table</a></code> always returns 0 as the
number of children for any row other than the root, the path to the
row passed to these methods will always consist of a single number.
In the prose below, this number is referred to as <var title=
"">i</var> .</p>
<p>If the <code><a href="#table">table</a></code> has
<code><a href="#tbody">tbody</a></code> element children, the
element for the <var title="">i</var> th row is the <var title=
"">i</var> th <code><a href="#tr">tr</a></code> element that is a
child of a <code><a href="#tbody">tbody</a></code> element that is
a child of the <code><a href="#table">table</a></code> element. If
the <code><a href="#table">table</a></code> does not have
<code><a href="#tbody">tbody</a></code> element children, then the
element for the <var title="">i</var> th real row is the
<var title="">i</var> th <code><a href="#tr">tr</a></code> element
that is a child of the <code><a href="#table">table</a></code>
element.</p>
<p><strong>For cells</strong> : Given a row and its element, the
row's <var title="">i</var> th cell's element is the <var title=
"">i</var> th <code><a href="#td">td</a></code> element child of
the row element.</p>
<p class="note">The <code>colspan</code> and <code>rowspan</code>
attributes are <a href="#ignored" title="ignore">ignored</a> by
this algorithm.</p>
<p><strong><code title="dom-provider-getRowImage"><a href=
"#getrowimage">getRowImage( <var title="">i</var>
)</a></code></strong> : If the row's first cell's element has an
<code><a href="#img">img</a></code> element child, then the URI of
the row's image is the URI of the first <code><a href=
"#img">img</a></code> element child of the row's first cell's
element. Otherwise, the URI of the row's image is the empty
string.</p>
<p><strong><code title="dom-provider-getRowMenu"><a href=
"#getrowmenu">getRowMenu( <var title="">i</var>
)</a></code></strong> : If the row's first cell's element has a
<code><a href="#menu">menu</a></code> element child, then the row's
menu is the first <code><a href="#menu">menu</a></code> element
child of the row's first cell's element. Otherwise, the row has no
menu.</p>
<p><strong><code title="dom-provider-getRowClasses"><a href=
"#getrowclasses">getRowClasses( <var title="">i</var> , <var title=
"">classes</var> )</a></code></strong> : The default data provider
must never add a class to the row's classes.</p>
<p id="defaultDataProviderTableSort"><strong><code title=
"dom-provider-toggleColumnSortState"><a href=
"#togglecolumnsortstate">toggleColumnSortState( <var title=
"">i</var> )</a></code></strong> : If the data is already being
sorted on the given column, then the user agent must change the
current sort mapping to be the inverse of the current sort mapping;
if the sort order was ascending before, it is now descending,
otherwise it is now ascending. Otherwise, if the current sort
column is another column, or the data model is currently not
sorted, the user agent must create a new mapping, which maps rows
in the data model to rows in the DOM so that the rows in the data
model are sorted by the specified column, in ascending order.
(Which sort comparison operator to use is left up to the UA to
decide.)</p>
<p>When the sort mapping is changed, the values returned by the
<code title="dom-provider-getChildAtPosition"><a href=
"#getchildatposition">getChildAtPosition()</a></code> method for
the default data provider <a href=
"#defaultDataProviderTableMapper">will change appropriately</a>
.</p>
<p><strong><code title="dom-provider-getCellData"><a href=
"#getcelldata">getCellData( <var title="">i</var> , <var title=
"">j</var> )</a></code> , <code title=
"dom-provider-getCellClasses"><a href=
"#getcellclasses">getCellClasses( <var title="">i</var> ,
<var title="">j</var> , <var title="">classes</var> )</a></code> ,
<code title="dom-provider-setCellCheckedState"><a href=
"#setcellcheckedstate">getCellCheckedState( <var title="">i</var> ,
<var title="">j</var> , <var title="">state</var> )</a></code> ,
<code title="dom-provider-cycleCell"><a href=
"#cyclecell">cycleCell( <var title="">i</var> , <var title=
"">j</var> )</a></code> , and <code title=
"dom-provider-editCell"><a href="#editcell">editCell( <var title=
"">i</var> , <var title="">j</var> , <var title="">data</var>
)</a></code></strong> : See <a href=
"#commonDefaultDataGridMethodDefinitions">the common definitions
below</a> .</p>
<p>The data provider must call the <code><a href=
"#datagrid0">datagrid</a></code> 's update methods appropriately
whenever the descendants of the <code><a href=
"#datagrid0">datagrid</a></code> mutate. For example, if a
<code><a href="#tr">tr</a></code> is removed, then the <code title=
"dom-datagrid-updateRowsRemoved"><a href=
"#updaterowsremoved">updateRowsRemoved()</a></code> methods would
probably need to be invoked, and any change to a cell or its
descendants must cause the cell to be updated. If the
<code><a href="#table">table</a></code> element stops being the
first child of the <code><a href="#datagrid0">datagrid</a></code> ,
then the data provider must call the <code title=
"dom-datagrid-updateEverything"><a href=
"#updateeverything">updateEverything()</a></code> method on the
<code><a href="#datagrid0">datagrid</a></code> . Any change to a
cell that is in the column that the data provider is currently
using as its sort column must also cause the sort to be
reperformed, with a call to <code title=
"dom-datagrid-updateEverything"><a href=
"#updateeverything">updateEverything()</a></code> if the change did
affect the sort order.</p>
</dd>
<dt>While the first element child is a <code>select</code> or
<code>datalist</code> element</dt>
<dd>
<p>The default data provider must return 1 for the column count,
the empty string for the column's caption, and must not add any
classes to the column's classes.</p>
<p>For the rows, assume the existence of a node filter view of the
descendants of the first element child of the <code><a href=
"#datagrid0">datagrid</a></code> element (the <code>select</code>
or <code>datalist</code> element), that skips all nodes other than
<code>optgroup</code> and <code>option</code> elements, as well as
any descendents of any <code>option</code> elements.</p>
<p>Given a path <var title="">row</var> , the corresponding element
is the one obtained by drilling into the view, taking the child
given by the path each time.</p>
<div class="example">
<p>Given the following XML markup:</p>
<pre>
<datagrid>
<select>
<!-- the options and optgroups have had their labels and values removed
to make the underlying structure clearer -->
<optgroup>
<option/>
<option/>
</optgroup>
<optgroup>
<option/>
<optgroup id="a">
<option/>
<option/>
<bogus/>
<option id="b"/>
</optgroup>
<option/>
</optgroup>
</select>
</datagrid>
</pre>
<p>The path "1,1,2" would select the element with ID "b". In the
filtered view, the text nodes, comment nodes, and bogus elements
are ignored; so for instance, the element with ID "a" (path "1,1")
has only 3 child nodes in the view.</p>
</div>
<p><code title="dom-provider-getRowCount"><a href=
"#getrowcount">getRowCount( <var title="">row</var> )</a></code>
must drill through the view to find the element corresponding to
the method's argument, and return the number of child nodes in the
filtered view that the corresponding element has. (If the
<var title="">row</var> is empty, the corresponding element is the
<code>select</code> element at the root of the filtered view.)</p>
<p><code title="dom-provider-getChildAtPosition"><a href=
"#getchildatposition">getChildAtPosition( <var title="">row</var> ,
<var title="">position</var> )</a></code> must return <var title=
"">position</var> . (The <code>select</code> /
<code>datalist</code> default data provider does not support
sorting the data grid.)</p>
<p><code title="dom-provider-getRowImage"><a href=
"#getrowimage">getRowImage( <var title="">i</var> )</a></code> must
return the empty string, <code title=
"dom-provider-getRowMenu"><a href="#getrowmenu">getRowMenu(
<var title="">i</var> )</a></code> must return null.</p>
<p><code title="dom-provider-getRowClasses"><a href=
"#getrowclasses">getRowClasses( <var title="">row</var> ,
<var title="">classes</var> )</a></code> must add the classes from
the following list to <var title="">classes</var> when their
condition is met:</p>
<ul>
<li>If the <var title="">row</var> 's corresponding element is an
<code>optgroup</code> element: <code title=
"datagrid-row-class-header"><a href=
"#header0">header</a></code></li>
<li>If the <var title="">row</var> 's corresponding element
contains other elements that are also in the view, and the
element's <code title="attr-class"><a href=
"#class">class</a></code> attribute contains the <code title=
"">closed</code> class: <code title=
"datagrid-row-class-initially-closed"><a href=
"#initially-closed">initially-closed</a></code></li>
<li>If the <var title="">row</var> 's corresponding element
contains other elements that are also in the view, and the
element's <code title="attr-class"><a href=
"#class">class</a></code> attribute contains the <code title=
"">open</code> class: <code title=
"datagrid-row-class-initially-open"><a href=
"#initially-open">initially-open</a></code></li>
</ul>
<p>The <code title="dom-provider-getCellData"><a href=
"#getcelldata">getCellData( <var title="">row</var> , <var title=
"">cell</var> )</a></code> method must return the value of the
<code title="attr-optgroup-label">label</code> attribute if the
<var title="">row</var> 's corresponding element is an
<code>optgroup</code> element, otherwise, if the <var title=
"">row</var> 's corresponding element is an <code>option</code>
element, its <code title="attr-option-label">label</code> attribute
if it has one, otherwise the value of its <code><a href=
"#textcontent">textContent</a></code> DOM attribute.</p>
<p>The <code title="dom-provider-getCellClasses"><a href=
"#getcellclasses">getCellClasses( <var title="">row</var> ,
<var title="">cell</var> , <var title="">classes</var> )</a></code>
method must add no classes.</p>
<p class="big-issue">autoselect some rows when <del class=
"diff-old">initialised,</del> <ins class=
"diff-chg">initialized,</ins> reflect the selection in the select,
reflect the multiple attribute somehow.</p>
<p>The data provider must call the <code><a href=
"#datagrid0">datagrid</a></code> 's update methods appropriately
whenever the descendants of the <code><a href=
"#datagrid0">datagrid</a></code> mutate.</p>
</dd>
<dt>While the first element child is another element</dt>
<dd>
<p>The default data provider must return 1 for the column count,
the empty string for the column's caption, and must not add any
classes to the column's classes.</p>
<p>For the rows, assume the existence of a node filter view of the
descendants of the <code><a href="#datagrid0">datagrid</a></code>
that skips all nodes other than <code><a href="#li">li</a></code> ,
<code><a href="#h1">h1</a></code> <del class="diff-old">-</del>
<ins class="diff-chg">–</ins> <code><a href="#h6">h6</a></code> ,
and <code><a href="#hr">hr</a></code> elements, and skips any
descendants of <code><a href="#menu">menu</a></code> elements.</p>
<p>Given this view, each element in the view represents a row in
the data model. The element corresponding to a path <var title=
"">row</var> is the one obtained by drilling into the view, taking
the child given by the path each time. The element of the row of a
particular method call is the element given by drilling into the
view along the path given by the method's arguments.</p>
<p><code title="dom-provider-getRowCount"><a href=
"#getrowcount">getRowCount( <var title="">row</var> )</a></code>
must return the number of child elements in this view for the given
row, or the number of elements at the root of the view if the
<var title="">row</var> is empty.</p>
<div class="example">
<p>In the following example, the elements are identified by the
paths given by their child text nodes:</p>
<pre>
<datagrid>
<ol>
<li> row 0 </li>
<li> row 1
<ol>
<li> row 1,0 </li>
</ol>
</li>
<li> row 2 </li>
</ol>
</datagrid>
</pre>
<p>In this example, only the <code><a href="#li">li</a></code>
elements actually appear in the data grid; the <code><a href=
"#ol">ol</a></code> element does not affect the data grid's
processing model.</p>
</div>
<p><code title="dom-provider-getChildAtPosition"><a href=
"#getchildatposition">getChildAtPosition( <var title="">row</var> ,
<var title="">position</var> )</a></code> must return <var title=
"">position</var> . (The generic default data provider does not
support sorting the data grid.)</p>
<p><code title="dom-provider-getRowImage"><a href=
"#getrowimage">getRowImage( <var title="">i</var> )</a></code> must
return the URI of the image given by the first <code><a href=
"#img">img</a></code> element descendant (in the real DOM) of the
row's element, that is not also a descendant of another element in
the filtered view that is a descendant of the row's element.</p>
<div class="example">
<p>In the following example, the row with path "1,0" returns
"http://example.com/a" as its image URI, and the other rows
(including the row with path "1") return the empty string:</p>
<pre>
<datagrid>
<ol>
<li> row 0 </li>
<li> row 1
<ol>
<li> row 1,0 <img src="http://example.com/a" alt=""> </li>
</ol>
</li>
<li> row 2 </li>
</ol>
</datagrid>
</pre></div>
<p><code title="dom-provider-getRowMenu"><a href=
"#getrowmenu">getRowMenu( <var title="">i</var> )</a></code> must
return the first <code><a href="#menu">menu</a></code> element
descendant (in the real DOM) of the row's element, that is not also
a descendant of another element in the filtered view that is a
<del class="diff-old">decsendant</del> <ins class=
"diff-chg">descendant</ins> of the row's element. (This is
analogous to the image case above.)</p>
<p><code title="dom-provider-getRowClasses"><a href=
"#getrowclasses">getRowClasses( <var title="">i</var> , <var title=
"">classes</var> )</a></code> must add the classes from the
following list to <var title="">classes</var> when their condition
is met:</p>
<ul>
<li>If the row's element contains other elements that are also in
the view, and the element's <code title="attr-class"><a href=
"#class">class</a></code> attribute contains the <code title=
"">closed</code> class: <code title=
"datagrid-row-class-initially-closed"><a href=
"#initially-closed">initially-closed</a></code></li>
<li>If the row's element contains other elements that are also in
the view, and the element's <code title="attr-class"><a href=
"#class">class</a></code> attribute contains the <code title=
"">open</code> class: <code title=
"datagrid-row-class-initially-open"><a href=
"#initially-open">initially-open</a></code></li>
<li>If the row's element is an <code><a href="#h1">h1</a></code>
<del class="diff-old">-</del> <ins class="diff-chg">–</ins>
<code><a href="#h6">h6</a></code> element: <code title=
"datagrid-row-class-header"><a href=
"#header0">header</a></code></li>
<li>If the row's element is an <code><a href="#hr">hr</a></code>
element: <code title="datagrid-row-class-separator"><a href=
"#separator">separator</a></code></li>
</ul>
<p>The <code title="dom-provider-getCellData"><a href=
"#getcelldata">getCellData( <var title="">i</var> , <var title=
"">j</var> )</a></code> , <code title=
"dom-provider-getCellClasses"><a href=
"#getcellclasses">getCellClasses( <var title="">i</var> ,
<var title="">j</var> , <var title="">classes</var> )</a></code> ,
<code title="dom-provider-setCellCheckedState"><a href=
"#setcellcheckedstate">getCellCheckedState( <var title="">i</var> ,
<var title="">j</var> , <var title="">state</var> )</a></code> ,
<code title="dom-provider-cycleCell"><a href=
"#cyclecell">cycleCell( <var title="">i</var> , <var title=
"">j</var> )</a></code> , and <code title=
"dom-provider-editCell"><a href="#editcell">editCell( <var title=
"">i</var> , <var title="">j</var> , <var title="">data</var>
)</a></code> methods must act as described in <a href=
"#commonDefaultDataGridMethodDefinitions">the common definitions
below</a> , treating the row's element as being the cell's
element.</p>
<p class="big-issue" id="generic-provider-selection">selection
handling?</p>
<p>The data provider must call the <code><a href=
"#datagrid0">datagrid</a></code> 's update methods appropriately
whenever the descendants of the <code><a href=
"#datagrid0">datagrid</a></code> mutate.</p>
</dd>
<dt>Otherwise, while there is no element child</dt>
<dd>
<p>The data provider must return 0 for the number of rows, 1 for
the number of columns, the empty string for the first column's
caption, and must add no classes when asked for that column's
classes. If the <code><a href="#datagrid0">datagrid</a></code> 's
child list changes such that there is a first element child, then
the data provider must call the <code title=
"dom-datagrid-updateEverything"><a href=
"#updateeverything">updateEverything()</a></code> method on the
<code><a href="#datagrid0">datagrid</a></code> .</p>
</dd>
</dl>
<h6 id="commonDefaultDataGridMethodDefinitions"><span class=
"secno"><del class="diff-old">3.18.2.4.1.</del> <ins class=
"diff-chg">3.16.2.4.1.</ins></span> Common default data provider
method definitions for cells</h6>
<p>These definitions are used for the cell-specific methods of the
default data providers (other than in the <code>select</code> /
<code>datalist</code> case). How they behave is based on the
contents of an element that represents the cell given by their
first two arguments. Which element that is is defined in the
previous section.</p>
<dl>
<dt>Cyclable cells</dt>
<dd>
<p>If the first element child of a cell's element is a
<code>select</code> element that has a no <code title=
"attr-select-multiple">multiple</code> attribute and has at least
one <code>option</code> element descendent, then the cell acts as a
cyclable cell.</p>
<p>The "current" <code>option</code> element is the selected
<code>option</code> element, or the first <code>option</code>
element if none is selected.</p>
<p>The <code title="dom-provider-getCellData"><a href=
"#getcelldata">getCellData()</a></code> method must return the
<code><a href="#textcontent">textContent</a></code> of the current
<code>option</code> element (the <code title=
"attr-option-label">label</code> attribute is <a href="#ignored"
title="ignore">ignored</a> in this context as the
<code>optgroup</code> s are not displayed).</p>
<p>The <code title="dom-provider-getCellClasses"><a href=
"#getcellclasses">getCellClasses()</a></code> method must add the
<code title="datagrid-cell-class-cyclable"><a href=
"#cyclable">cyclable</a></code> class and then all the classes of
the current <code>option</code> element.</p>
<p>The <code title="dom-provider-cycleCell"><a href=
"#cyclecell">cycleCell()</a></code> method must change the
selection of the <code>select</code> element such that the next
<code>option</code> element after the current <code>option</code>
element is the only one that is selected (in <a href=
"#tree-order">tree order</a> ). If the current <code>option</code>
element is the last <code>option</code> element descendent of the
<code>select</code> , then the first <code>option</code> element
descendent must be selected instead.</p>
<p>The <code title="dom-provider-setCellCheckedState"><a href=
"#setcellcheckedstate">setCellCheckedState()</a></code> and
<code title="dom-provider-editCell"><a href=
"#editcell">editCell()</a></code> methods must do nothing.</p>
</dd>
<dt>Progress bar cells</dt>
<dd>
<p>If the first element child of a cell's element is a
<code><a href="#progress">progress</a></code> element, then the
cell acts as a progress bar cell.</p>
<p>The <code title="dom-provider-getCellData"><a href=
"#getcelldata">getCellData()</a></code> method must return the
value returned by the <code><a href="#progress">progress</a></code>
element's <code title="dom-progress-position"><a href=
"#position">position</a></code> DOM attribute.</p>
<p>The <code title="dom-provider-getCellClasses"><a href=
"#getcellclasses">getCellClasses()</a></code> method must add the
<code title="datagrid-cell-class-progress"><a href=
"#progress1">progress</a></code> class.</p>
<p>The <code title="dom-provider-setCellCheckedState"><a href=
"#setcellcheckedstate">setCellCheckedState()</a></code> ,
<code title="dom-provider-cycleCell"><a href=
"#cyclecell">cycleCell()</a></code> , and <code title=
"dom-provider-editCell"><a href="#editcell">editCell()</a></code>
methods must do nothing.</p>
</dd>
<dt>Checkbox cells</dt>
<dd>
<p>If the first element child of a cell's element is an
<code>input</code> element that has a <code title=
"attr-input-type">type</code> attribute with the value <code title=
"">checkbox</code> , then the cell acts as a check box cell.</p>
<p>The <code title="dom-provider-getCellData"><a href=
"#getcelldata">getCellData()</a></code> method must return the
<code><a href="#textcontent">textContent</a></code> of the cell
element.</p>
<p>The <code title="dom-provider-getCellClasses"><a href=
"#getcellclasses">getCellClasses()</a></code> method must add the
<code title="datagrid-cell-class-checked"><a href=
"#checked">checked</a></code> class if the <code>input</code>
element is <span title="dom-input-checked">checked</span> , and the
<code title="datagrid-cell-class-unchecked"><a href=
"#unchecked">unchecked</a></code> class otherwise.</p>
<p>The <code title="dom-provider-setCellCheckedState"><a href=
"#setcellcheckedstate">setCellCheckedState()</a></code> method must
set the <code>input</code> element's checkbox <span title=
"dom-input-checked">state</span> to checked if the method's third
argument is 1, and to unchecked otherwise.</p>
<p>The <code title="dom-provider-cycleCell"><a href=
"#cyclecell">cycleCell()</a></code> and <code title=
"dom-provider-editCell"><a href="#editcell">editCell()</a></code>
methods must do nothing.</p>
</dd>
<dt>Editable cells</dt>
<dd>
<p>If the first element child of a cell's element is an
<code>input</code> element that has a <code title=
"attr-input-type">type</code> attribute with the value <code title=
"">text</code> or that has no <code title=
"attr-input-type">type</code> attribute at all, then the cell acts
as an editable cell.</p>
<p>The <code title="dom-provider-getCellData"><a href=
"#getcelldata">getCellData()</a></code> method must return the
<code title="dom-input-value">value</code> of the
<code>input</code> element.</p>
<p>The <code title="dom-provider-getCellClasses"><a href=
"#getcellclasses">getCellClasses()</a></code> method must add the
<code title="datagrid-cell-class-editable"><a href=
"#editable">editable</a></code> class.</p>
<p>The <code title="dom-provider-editCell"><a href=
"#editcell">editCell()</a></code> method must set the
<code>input</code> element's <code title=
"dom-input-value">value</code> DOM attribute to the value of the
third argument to the method.</p>
<p>The <code title="dom-provider-setCellCheckedState"><a href=
"#setcellcheckedstate">setCellCheckedState()</a></code> and
<code title="dom-provider-cycleCell"><a href=
"#cyclecell">cycleCell()</a></code> methods must do nothing.</p>
</dd>
</dl>
<h5 id="populating"><span class="secno"><del class=
"diff-old">3.18.2.5.</del> <ins class=
"diff-chg">3.16.2.5.</ins></span> Populating the <code><a href=
"#datagrid0">datagrid</a></code> element</h5>
<p>A <code><a href="#datagrid0">datagrid</a></code> must be
disabled until its end tag has been parsed (in the case of a
<code><a href="#datagrid0">datagrid</a></code> element in the
original document markup) or until it has been inserted into the
document (in the case of a dynamically created element). After that
point, the element must fire a single <code title=
"event-load"><a href="#load0">load</a></code> event at itself,
which doesn't bubble and cannot be canceled.</p>
<p class="big-issue">The end-tag parsing thing should be moved to
the parsing section.</p>
<p>The <code><a href="#datagrid0">datagrid</a></code> must then
populate itself using the data provided by the data provider
assigned to the <code title="dom-datagrid-data"><a href=
"#data2">data</a></code> DOM attribute. After the view is populated
(using the methods described below), the <code><a href=
"#datagrid0">datagrid</a></code> must invoke the <code title=
"dom-provider-initialize"><a href=
"#initialize">initialize()</a></code> method on the data provider
specified by the <code title="dom-datagrid-data"><a href=
"#data2">data</a></code> attribute, passing itself (the
<code><a href="#htmldatagridelement">HTMLDataGridElement</a></code>
object) as the only argument.</p>
<p>When the <code title="dom-datagrid-data"><a href=
"#data2">data</a></code> attribute is null, the <code><a href=
"#datagrid0">datagrid</a></code> must use the default data provider
described in the previous section.</p>
<p>To obtain data from the data provider, the element must invoke
methods on the data provider object in the following ways:</p>
<dl>
<dt>To determine the total number of columns</dt>
<dd>Invoke the <code title="dom-provider-getColumnCount"><a href=
"#getcolumncount">getColumnCount()</a></code> method with no
arguments. The return value is the number of columns. If the return
value is zero or negative, not an integer, or simply not a numeric
type, or if the method is not defined, then 1 must be used
instead.</dd>
<dt>To get the captions to use for the columns</dt>
<dd>Invoke the <code title="dom-provider-getCaptionText"><a href=
"#getcaptiontext">getCaptionText()</a></code> method with the index
of the column in question. The index <var title="">i</var> must be
in the range 0 ≤ <var title="">i</var> < <var title="">N</var> ,
where <var title="">N</var> is the total number of columns. The
return value is the string to use when referring to that column. If
the method returns null or the empty string, the column has no
caption. If the method is not defined, then none of the columns
have any captions.</dd>
<dt>To establish what classes apply to a column</dt>
<dd>Invoke the <code title=
"dom-provider-getCaptionClasses"><a href="#getcaptionclasses">getCaptionClasses()</a></code>
method with the index of the column in question, and an object
implementing the <code><a href=
"#domtokenlist0">DOMTokenList</a></code> interface, associated with
an anonymous empty string. The index <var title="">i</var> must be
in the range 0 ≤ <var title="">i</var> < <var title="">N</var> ,
where <var title="">N</var> is the total number of columns. The
tokens contained in the string underlying <code><a href=
"#domtokenlist0">DOMTokenList</a></code> object when the method
returns represent the classes that apply to the given column. If
the method is not defined, no classes apply to the column.</dd>
<dt>To establish whether a column should be initially included in
the visible columns</dt>
<dd>Check whether the <code title=
"datagrid-column-class-initially-hidden"><a href=
"#initially-hidden">initially-hidden</a></code> class applies to
the column. If it does, then the column should not be initially
included; if it does not, then the column should be initially
included.</dd>
<dt id="columnType2">To establish whether the data can be sorted
relative to a particular column</dt>
<dd>Check whether the <code title=
"datagrid-column-class-sortable"><a href=
"#sortable">sortable</a></code> class applies to the column. If it
does, then the user should be able to ask the UA to display the
data sorted by that column; if it does not, then the user agent
must not allow the user to ask for the data to be sorted by that
column.</dd>
<dt>To establish if a column is a sorted column</dt>
<dd>If the user agent can handle multiple columns being marked as
sorted simultaneously: Check whether the <code title=
"datagrid-column-class-sorted"><a href="#sorted">sorted</a></code>
class applies to the column. If it does, then that column is the
sorted column, otherwise it is not.</dd>
<dd>If the user agent can only handle one column being marked as
sorted at a time: Check each column in turn, starting with the
first one, to see whether the <code title=
"datagrid-column-class-sorted"><a href="#sorted">sorted</a></code>
class applies to that column. The first column that has that class,
if any, is the sorted column. If none of the columns have that
class, there is no sorted column.</dd>
<dt>To establish the sort direction of a sorted column</dt>
<dd>Check whether the <code title=
"datagrid-column-class-reversed"><a href=
"#reversed1">reversed</a></code> class applies to the column. If it
does, then the sort direction is descending (down; first rows have
the highest values), otherwise it is ascending (up; first rows have
the lowest values).</dd>
<dt>To determine the total number of rows</dt>
<dd>Determine the number of rows for the root of the data grid, and
determine the number of child rows for each open row. The total
number of rows is the sum of all these numbers.</dd>
<dt>To determine the number of rows for the root of the data
grid</dt>
<dd>Invoke the <code title="dom-provider-getRowCount"><a href=
"#getrowcount">getRowCount()</a></code> method with a
<code><a href="#rowspecification">RowSpecification</a></code>
object representing the empty path as its only argument. The return
value is the number of rows at the top level of the data grid. If
the return value of the method is negative, not an integer, or
simply not a numeric type, or if the method is not defined, then
zero must be used instead.</dd>
<dt>To determine the number of child rows for a row</dt>
<dd>Invoke the <code title="dom-provider-getRowCount"><a href=
"#getrowcount">getRowCount()</a></code> method with a
<code><a href="#rowspecification">RowSpecification</a></code>
object representing the path to the row in question. The return
value is the number of child rows for the given row. If the return
value of the method is negative, not an integer, or simply not a
numeric type, or if the method is not defined, then zero must be
used instead.</dd>
<dt>To determine what order to render rows in</dt>
<dd>
<p>Invoke the <code title=
"dom-provider-getChildAtPosition"><a href="#getchildatposition">getChildAtPosition()</a></code>
method with a <code><a href=
"#rowspecification">RowSpecification</a></code> object representing
the path to the parent of the rows that are being rendered as the
first argument, and the position that is being rendered as the
second argument. The return value is the index of the row to render
in that position.</p>
<div class="example">
<p>If the rows are:</p>
<ol>
<li>Row "0"
<ol>
<li>Row "0,0"</li>
<li>Row "0,1"</li>
</ol>
</li>
<li>Row "1"
<ol>
<li>Row "1,0"</li>
<li>Row "1,1"</li>
</ol>
</li>
</ol>
<p>...and the <code title=
"dom-provider-getChildAtPosition"><a href="#getchildatposition">getChildAtPosition()</a></code>
method is implemented as follows:</p>
<pre>
function getChildAtPosition(parent, child) {
// always return the reverse order
return getRowCount(parent)-child-1;
}
</pre>
<p>...then the rendering would actually be:</p>
<ol>
<li>Row "1"
<ol>
<li>Row "1,1"</li>
<li>Row "1,0"</li>
</ol>
</li>
<li>Row "0"
<ol>
<li>Row "0,1"</li>
<li>Row "0,0"</li>
</ol>
</li>
</ol>
</div>
<p>If the return value of the method is negative, larger than the
number of rows that the <code title=
"dom-provider-getRowCount"><a href=
"#getrowcount">getRowCount()</a></code> method reported for that
parent, not an integer, or simply not a numeric type, then the
entire data grid should be disabled. Similarly, if the method
returns the same value for two or more different values for the
second argument (with the same first argument, and assuming that
the data grid hasn't had relevant update methods invoked in the
meantime), then the data grid should be disabled. Instead of
disabling the data grid, the user agent may act as if the
<code title="dom-provider-getChildAtPosition"><a href=
"#getchildatposition">getChildAtPosition()</a></code> method was
not defined on the data provider (thus disabling sorting for that
data grid, but still letting the user interact with the data). If
the method is not defined, then the return value must be assumed to
be the same as the second argument (an <del class=
"diff-old">indentity</del> <ins class="diff-chg">identity</ins>
transform; the data is rendered in its natural order).</p>
</dd>
<dt>To establish what classes apply to a row</dt>
<dd>Invoke the <code title="dom-provider-getRowClasses"><a href=
"#getrowclasses">getRowClasses()</a></code> method with a
<code><a href="#rowspecification">RowSpecification</a></code>
object representing the row in question, and a <code><a href=
"#domtokenlist0">DOMTokenList</a></code> associated with an empty
string. The tokens contained in the <code><a href=
"#domtokenlist0">DOMTokenList</a></code> object's underlying string
when the method returns represent the classes that apply to the row
in question. If the method is not defined, no classes apply to the
row.</dd>
<dt>To establish whether a row is a data row or a special row</dt>
<dd>Examine the classes that apply to the row. If the <code title=
"datagrid-row-class-header"><a href="#header0">header</a></code>
class applies to the row, then it is not a data row, it is a
subheading. The data from the first cell of the row is the text of
the subheading, the rest of the cells must be ignored. Otherwise,
if the <code title="datagrid-row-class-separator"><a href=
"#separator">separator</a></code> class applies to the row, then in
the place of the row, a separator should be shown. Otherwise, if
the <code title="datagrid-row-class-selectable-separator"><a href=
"#selectable-separator">selectable-separator</a></code> class
applies to the row, then the row should be a data row, but
represented as a separator. (The difference between a <code title=
"datagrid-row-class-separator"><a href=
"#separator">separator</a></code> and a <code title=
"datagrid-row-class-selectable-separator"><a href=
"#selectable-separator">selectable-separator</a></code> is that the
former is not an item that can be actually selected, whereas the
second can be selected and thus has a context menu that applies to
it, and so forth.) For both kinds of separator rows, the data of
the rows' cells must all be ignored. If none of those three classes
apply then the row is a simple data row.</dd>
<dt id="rowType1">To establish whether a row is openable</dt>
<dd>Determine the number of child rows for that row. If there are
one or more child rows, then the row is openable.</dd>
<dt>To establish whether a row should be initially open or
closed</dt>
<dd>If <a href="#rowType1">the row is openable</a> , examine the
classes that apply to the row. If the <code title=
"datagrid-row-class-initially-open"><a href=
"#initially-open">initially-open</a></code> class applies to the
row, then it should be initially open. Otherwise, if the
<code title="datagrid-row-class-initially-closed"><a href=
"#initially-closed">initially-closed</a></code> class applies to
the row, then it must be initially closed. Otherwise, if neither
class applies to the row, or if the row is not openable, then the
initial state of the row <del class="diff-old">is entirely up to
the UA.</del> <ins class="diff-chg">should be based on platform
conventions.</ins></dd>
<dt>To obtain a URI to an image representing a row</dt>
<dd>Invoke the <code title="dom-provider-getRowImage"><a href=
"#getrowimage">getRowImage()</a></code> method with a
<code><a href="#rowspecification">RowSpecification</a></code>
object representing the row in question. The return value is a
string representing a URI (or IRI) to an image. Relative URIs must
be interpreted relative to the <code><a href=
"#datagrid0">datagrid</a></code> 's <a href="#elements2" title=
"element's base URI">base <del class="diff-old">URI.</del>
<ins class="diff-chg">URI</ins></a> . If the method returns the
empty string, null, or if the method is not defined, then the row
has no associated image.</dd>
<dt>To obtain a context menu appropriate for a particular row</dt>
<dd>Invoke the <code title="dom-provider-getRowMenu"><a href=
"#getrowmenu">getRowMenu()</a></code> method with a <code><a href=
"#rowspecification">RowSpecification</a></code> object representing
the row in question. The return value is a reference to an object
implementing the <code><a href=
"#htmlmenuelement">HTMLMenuElement</a></code> interface, i.e. a
<code><a href="#menu">menu</a></code> element DOM node. (This
element must then be interpreted as described in the section on
context menus to obtain the actual context menu to use. ) If the
method returns something that is not an <code><a href=
"#htmlmenuelement">HTMLMenuElement</a></code> , or if the method is
not defined, then the row has no associated context menu. User
agents may provide their own default context menu, and may add
items to the author-provided context menu. For example, such a menu
could allow the user to change the presentation of the
<code><a href="#datagrid0">datagrid</a></code> element.</dd>
<dt>To establish the value of a particular cell</dt>
<dd>Invoke the <code title="dom-provider-getCellData"><a href=
"#getcelldata">getCellData()</a></code> method with the first
argument being a <code><a href=
"#rowspecification">RowSpecification</a></code> object representing
the row of the cell in question and the second argument being the
index of the cell's column. The second argument must be a
non-negative integer less than the total number of columns. The
return value is the value of the cell. If the return value is null
or the empty string, or if the method is not defined, then the cell
has no data. (For progress bar cells, the cell's value must be
further interpreted, as described below.)</dd>
<dt>To establish what classes apply to a cell</dt>
<dd>Invoke the <code title="dom-provider-getCellClasses"><a href=
"#getcellclasses">getCellClasses()</a></code> method with the first
argument being a <code><a href=
"#rowspecification">RowSpecification</a></code> object representing
the row of the cell in question, the second argument being the
index of the cell's column, and the third being an object
implementing the <code><a href=
"#domtokenlist0">DOMTokenList</a></code> interface, associated with
an empty string. The second argument must be a non-negative integer
less than the total number of columns. The tokens contained in the
<code><a href="#domtokenlist0">DOMTokenList</a></code> object's
underlying string when the method returns represent the classes
that apply to that cell. If the method is not defined, no classes
apply to the cell.</dd>
<dt id="cellType1">To establish how the type of a cell</dt>
<dd>Examine the classes that apply to the cell. If the <code title=
"datagrid-cell-class-progress"><a href=
"#progress1">progress</a></code> class applies to the cell, it is a
progress bar. Otherwise, if the <code title=
"datagrid-cell-class-cyclable"><a href=
"#cyclable">cyclable</a></code> class applies to the cell, it is a
cycling cell whose value can be cycled between multiple states.
Otherwise, none of these classes apply, and the cell is a simple
text cell.</dd>
<dt>To establish the value of a progress bar cell</dt>
<dd>If the value <var title="">x</var> of the cell is a string that
can be <a href="#rules1" title=
"rules for parsing floating point number values">converted to a
floating-point number</a> in the range 0.0 ≤ <var title=
"">x</var> ≤ 1.0, then the progress bar has that value
(0.0 means no progress, 1.0 means complete). Otherwise, the
progress bar is an indeterminate progress bar.</dd>
<dt id="cellType2">To establish how a simple text cell should be
presented</dt>
<dd>Check whether one of the <code title=
"datagrid-cell-class-checked"><a href="#checked">checked</a></code>
, <code title="datagrid-cell-class-unchecked"><a href=
"#unchecked">unchecked</a></code> , or <code title=
"datagrid-cell-class-indeterminate"><a href=
"#indeterminate">indeterminate</a></code> classes applies to the
cell. If any of these are present, then the cell has a checkbox,
otherwise none are present and the cell does not have a checkbox.
If the cell has no checkbox, check whether the <code title=
"datagrid-cell-class-editable"><a href=
"#editable">editable</a></code> class applies to the cell. If it
does, then the cell value is editable, otherwise the cell value is
static.</dd>
<dt>To establish the state of a cell's checkbox, if it has one</dt>
<dd>Check whether the <code title=
"datagrid-cell-class-checked"><a href="#checked">checked</a></code>
class applies to the cell. If it does, the cell is checked.
Otherwise, check whether the <code title=
"datagrid-cell-class-unchecked"><a href=
"#unchecked">unchecked</a></code> class applies to the cell. If it
does, the cell is unchecked. Otherwise, the <code title=
"datagrid-cell-class-indeterminate"><a href=
"#indeterminate">indeterminate</a></code> class <del class=
"diff-old">appplies</del> <ins class="diff-chg">applies</ins> to
the cell and the cell's checkbox is in an indeterminate state. When
the <code title="datagrid-cell-class-indeterminate"><a href=
"#indeterminate">indeterminate</a></code> class <del class=
"diff-old">appplies</del> <ins class="diff-chg">applies</ins> to
the cell, the checkbox is a tristate checkbox, and the user can set
it to the indeterminate state. Otherwise, only the <code title=
"datagrid-cell-class-checked"><a href="#checked">checked</a></code>
and/or <code title="datagrid-cell-class-unchecked"><a href=
"#unchecked">unchecked</a></code> classes apply to the cell, and
the cell can only be toggled <del class="diff-old">betwen</del>
<ins class="diff-chg">between</ins> those two states.</dd>
</dl>
<p>If the data provider ever raises an exception while the
<code><a href="#datagrid0">datagrid</a></code> is invoking one of
its methods, the <code><a href="#datagrid0">datagrid</a></code>
must act, for the purposes of that particular method call, as if
the relevant method had not been defined.</p>
<p>A <code><a href="#rowspecification">RowSpecification</a></code>
object <var title="">p</var> with <var title="">n</var> path
components passed to a method of the data provider must fulfill the
constraint <span>0 ≤ <var title="">p <sub title=
""><var title="">i</var></sub></var> < <var title=
"">m</var> -1</span> for all integer values of <var title=
"">i</var> in the range <span>0 ≤ <var title="">i</var>
< <var title="">n</var> -1</span> , where
<var title="">m</var> is the value that was last returned by the
<code title="dom-provider-getRowCount"><a href=
"#getrowcount">getRowCount()</a></code> method when it was passed
the <code><a href="#rowspecification">RowSpecification</a></code>
object <var title="">q</var> with <span><var title="">i</var>
-1</span> items, where <span><var title="">p <sub title=
""><var title="">i</var></sub></var> = <var title="">q
<sub title=""><var title="">i</var></sub></var></span> for all
integer values of <var title="">i</var> in the range
<span>0 ≤ <var title="">i</var> <
<var title="">n</var> -1</span> , with any changes implied by the
update methods taken into account.</p>
<p id="inconsistentDataProvider">The data model is considered
stable: user agents may assume that subsequent calls to the data
provider methods will return the same data, until one of the update
methods is called on the <code><a href=
"#datagrid0">datagrid</a></code> element. If a user agent is
returned inconsistent data, for example if the number of rows
returned by <code title="dom-provider-getRowCount"><a href=
"#getrowcount">getRowCount()</a></code> varies in ways that do not
match the calls made to the update methods, the user agent may
disable the <code><a href="#datagrid0">datagrid</a></code> . User
agents that do not disable the <code><a href=
"#datagrid0">datagrid</a></code> in inconsistent cases must
<del class="diff-old">honour</del> <ins class=
"diff-chg">honor</ins> the most recently returned values.</p>
<p>User agents may cache returned values so that the data provider
is never asked for data that could contradict earlier data. User
agents must not cache the return value of the <code title=
"dom-provider-getRowMenu"><a href=
"#getrowmenu">getRowMenu</a></code> method.</p>
<p>The exact algorithm used to populate the data grid is not
defined here, since it will differ based on the presentation used.
However, the <del class="diff-old">behaviour</del> <ins class=
"diff-chg">behavior</ins> of user agents must be consistent with
the descriptions above. For example, it would be non-conformant for
a user agent to make cells have both a checkbox and be editable, as
the descriptions above state that cells that have a checkbox cannot
be edited.</p>
<h5 id="updating"><span class="secno"><del class=
"diff-old">3.18.2.6.</del> <ins class=
"diff-chg">3.16.2.6.</ins></span> Updating the <code><a href=
"#datagrid0">datagrid</a></code></h5>
<p>Whenever the <code title="dom-datagrid-data"><a href=
"#data2">data</a></code> attribute is set to a new value, the
<code><a href="#datagrid0">datagrid</a></code> must clear the
current selection, remove all the displayed rows, and plan to
repopulate itself using the information from the new data provider
at the earliest opportunity.</p>
<p>There are a number of update methods that can be invoked on the
<code><a href="#datagrid0">datagrid</a></code> element to cause it
to refresh itself in slightly less drastic ways:</p>
<p>When the <dfn id="updateeverything" title=
"dom-datagrid-updateEverything"><code>updateEverything()</code></dfn>
method is called, the user agent must repopulate the entire
<code><a href="#datagrid0">datagrid</a></code> . If the number of
rows decreased, the selection must be updated appropriately. If the
number of rows increased, the new rows should be left
unselected.</p>
<p>When the <dfn id="updaterowschanged" title=
"dom-datagrid-updateRowsChanged"><code>updateRowsChanged(
<var title="">row</var> , <var title="">count</var> )</code></dfn>
method is called, the user agent must refresh the rendering of the
rows starting from the row specified by <var title="">row</var> ,
and including the <var title="">count</var> next siblings of the
row (or as many next siblings as it has, if that is less than
<var title="">count</var> ), including all descendant rows.</p>
<p>When the <dfn id="updaterowsinserted" title=
"dom-datagrid-updateRowsInserted"><code>updateRowsInserted(
<var title="">row</var> , <var title="">count</var> )</code></dfn>
method is called, the user agent must assume that <var title=
"">count</var> new rows have been inserted, such that the first new
row is <del class="diff-old">indentified</del> <ins class=
"diff-chg">identified</ins> by <var title="">row</var> . The user
agent must update its rendering and the selection accordingly. The
new rows should not be selected.</p>
<p>When the <dfn id="updaterowsremoved" title=
"dom-datagrid-updateRowsRemoved"><code>updateRowsRemoved(
<var title="">row</var> , <var title="">count</var> )</code></dfn>
method is called, the user agent must assume that <var title=
"">count</var> rows have been removed starting from the row that
used to be identifier by <var title="">row</var> . The user agent
must update its rendering and the selection accordingly.</p>
<p>The <dfn id="updaterowchanged" title=
"dom-datagrid-updateRowChanged"><code>updateRowChanged( <var title=
"">row</var> )</code></dfn> method must be exactly equivalent to
calling <code title="dom-datagrid-updateRowsChanged"><a href=
"#updaterowschanged">updateRowsChanged( <var title="">row</var> ,
1)</a></code> .</p>
<p>When the <dfn id="updatecolumnchanged" title=
"dom-datagrid-updateColumnChanged"><code>updateColumnChanged(
<var title="">column</var> )</code></dfn> method is called, the
user agent must refresh the rendering of the specified column
<var title="">column</var> , for all rows.</p>
<p>When the <dfn id="updatecellchanged" title=
"dom-datagrid-updateCellChanged"><code>updateCellChanged(
<var title="">row</var> , <var title="">column</var> )</code></dfn>
method is called, the user agent must refresh the rendering of the
cell on row <var title="">row</var> , in column <var title=
"">column</var> .</p>
<p>Any effects the update methods have on the <code><a href=
"#datagrid0">datagrid</a></code> 's selection is not considered a
change to the selection, and must therefore not fire the
<code title="event-select"><a href="#select">select</a></code>
event.</p>
<p>These update methods should <del class="diff-old">only</del> be
called <ins class="diff-new">only</ins> by the data provider, or
code acting on behalf of the data provider. In particular, calling
the <code title="dom-datagrid-updateRowsInserted"><a href=
"#updaterowsinserted">updateRowsInserted()</a></code> and
<code title="dom-datagrid-updateRowsRemoved"><a href=
"#updaterowsremoved">updateRowsRemoved()</a></code> methods without
actually inserting or removing rows from the data provider is
<a href="#inconsistentDataProvider">likely to result in
inconsistent renderings</a> , and the user agent is likely to
disable the data grid.</p>
<h5 id="requirements"><span class="secno"><del class=
"diff-old">3.18.2.7.</del> <ins class=
"diff-chg">3.16.2.7.</ins></span> Requirements for interactive user
agents</h5>
<p><em>This section only applies to interactive user
agents.</em></p>
<p>If the <code><a href="#datagrid0">datagrid</a></code> element
has a <dfn id="disabled3" title=
"attr-datagrid-disabled"><code>disabled</code></dfn> attribute,
then the user agent must disable the <code><a href=
"#datagrid0">datagrid</a></code> , preventing the user from
interacting with it. The <code><a href=
"#datagrid0">datagrid</a></code> element should still continue to
update itself when the data provider signals changes to the data,
though. Obviously, conformance requirements stating that
<code><a href="#datagrid0">datagrid</a></code> elements must react
to users in particular ways do not apply when one is disabled.</p>
<p>If <a href="#rowType1">a row is openable</a> , then the user
should be able to toggle its open/closed state. When a row's
open/closed state changes, the user agent must update the rendering
to match the new state.</p>
<p>If a cell is a cell whose value <a href="#cellType1">can be
cycled between multiple states</a> , then the user must be able to
activate the cell to cycle its value. When the user activates this
"cycling" <del class="diff-old">behaviour</del> <ins class=
"diff-chg">behavior</ins> of a cell, then the <code><a href=
"#datagrid0">datagrid</a></code> must invoke the data provider's
<code title="dom-provider-cycleCell"><a href=
"#cyclecell">cycleCell()</a></code> method, with a <code><a href=
"#rowspecification">RowSpecification</a></code> object representing
the cell's row as the first argument and the cell's column index as
the second. The <code><a href="#datagrid0">datagrid</a></code> must
act as if the <code><a href="#datagrid0">datagrid</a></code> 's
<code title="dom-datagrid-updateCellChanged"><a href=
"#updatecellchanged">updateCellChanged()</a></code> method had been
invoked with those same arguments immediately before the provider's
method was invoked.</p>
<p>When a cell <a href="#cellType2">has a checkbox</a> , the user
must be able to set the checkbox's state. When the user changes the
state of a checkbox in such a cell, the <code><a href=
"#datagrid0">datagrid</a></code> must invoke the data provider's
<code title="dom-provider-setCellCheckedState"><a href=
"#setcellcheckedstate">setCellCheckedState()</a></code> method,
with a <code><a href=
"#rowspecification">RowSpecification</a></code> object representing
the cell's row as the first argument, the cell's column index as
the second, and the checkbox's new state as the third. The state
should be represented by the number 1 if the new state is checked,
0 if the new state is unchecked, and <del class="diff-old">-1</del>
<ins class="diff-chg">−1</ins> if the new state is indeterminate
(which must <del class="diff-old">only</del> be possible
<ins class="diff-new">only</ins> if the cell has the <code title=
"datagrid-cell-class-indeterminate"><a href=
"#indeterminate">indeterminate</a></code> class set). The
<code><a href="#datagrid0">datagrid</a></code> must act as if the
<code><a href="#datagrid0">datagrid</a></code> 's <code title=
"dom-datagrid-updateCellChanged"><a href=
"#updatecellchanged">updateCellChanged()</a></code> method had been
invoked, specifying the same cell, immediately before the
provider's method was invoked.</p>
<p>If a cell <a href="#cellType2">is editable</a> , the user must
be able to edit the data for that cell, and doing so must cause the
user agent to invoke the <code title=
"dom-provider-editCell"><a href="#editcell">editCell()</a></code>
method of the data provider with three arguments: a <code><a href=
"#rowspecification">RowSpecification</a></code> object representing
the cell's row, the cell's column's index, and the new text entered
by the user. The user agent must act as if the <code title=
"dom-datagrid-updateCellChanged"><a href=
"#updatecellchanged">updateCellChanged()</a></code> method had been
invoked, with the same row and column specified, immediately before
the provider's method was invoked.</p>
<h5 id="the-selection"><span class="secno"><del class=
"diff-old">3.18.2.8.</del> <ins class=
"diff-chg">3.16.2.8.</ins></span> The selection</h5>
<p><em>This section only applies to interactive user agents. For
other user agents, the <code title=
"dom-datagrid-selection"><a href="#selection0">selection</a></code>
attribute must return null.</em></p>
<pre class="idl">
interface <dfn id="datagridselection">DataGridSelection</dfn> {
readonly attribute unsigned long <span title=
"dom-DataGridSelection-count">length</span>;
<del class="diff-old"> (in unsigned long index);
</del>
<ins class="diff-chg"> [IndexGetter] <a href=
"#rowspecification">RowSpecification</a> <span title=
"dom-DataGridSelection-">item</span>(in unsigned long index);
</ins>
boolean <a href="#isselected" title=
"dom-DataGridSelection-isSelected">isSelected</a>(in <a href=
"#rowspecification">RowSpecification</a> row);
void <a href="#setselected" title=
"dom-DataGridSelection-setSelected">setSelected</a>(in <a href=
"#rowspecification">RowSpecification</a> row, in boolean selected);
void <a href="#selectall" title=
"dom-DataGridSelection-selectAll">selectAll</a>();
void <a href="#invert" title=
"dom-DataGridSelection-invert">invert</a>();
void <a href="#clear" title=
"dom-DataGridSelection-clear">clear</a>();
};
</pre>
<p>Each <code><a href="#datagrid0">datagrid</a></code> element must
keep track of which rows are currently selected. Initially no rows
are selected, but this can be changed via the methods described in
this section.</p>
<p>The selection of a <code><a href=
"#datagrid0">datagrid</a></code> is represented by its <dfn id=
"selection0" title=
"dom-datagrid-selection"><code>selection</code></dfn> DOM
attribute, which must be a <code><a href=
"#datagridselection">DataGridSelection</a></code> object.</p>
<p><code><a href="#datagridselection">DataGridSelection</a></code>
objects represent the rows in the selection. In the selection the
rows must be ordered in the natural order of the data provider (and
not, e.g., the rendered order). Rows that are not rendered because
one of their ancestors is closed must share the same selection
state as their nearest rendered ancestor. Such rows are not
considered part of the selection for the purposes of iterating over
the selection.</p>
<p class="note">This selection API doesn't allow for hidden rows to
be selected because it is trivial to create a data provider that
has infinite depth, which would then require the selection to be
infinite if every row, including every hidden row, was
selected.</p>
<p>The <dfn id="length5" title=
"dom-DataGridSelection-length"><code>length</code></dfn> attribute
must return the number of rows currently present in the selection.
The <dfn id="itemindex3" title=
"dom-DataGridSelection-item"><code>item( <var title="">index</var>
)</code></dfn> method must return the <var title="">index</var> th
row in the selection. If the argument is out of range (less than
zero or greater than the number of selected rows minus one), then
it must raise an <code>INDEX_SIZE_ERR</code> exception. <a href=
"#references">[DOM3CORE]</a></p>
<p>The <dfn id="isselected" title=
"dom-DataGridSelection-isSelected"><code>isSelected()</code></dfn>
method must return the selected state of the row specified by its
argument. If the specified row exists and is selected, it must
return true, otherwise it must return false.</p>
<p>The <dfn id="setselected" title=
"dom-DataGridSelection-setSelected"><code>setSelected()</code></dfn>
method takes two arguments, <var title="">row</var> and <var title=
"">selected</var> . When invoked, it must set the selection state
of row <var title="">row</var> to selected if <var title=
"">selected</var> is true, and unselected if it is false. If
<var title="">row</var> is not a row in the data grid, the method
must raise an <code>INDEX_SIZE_ERR</code> exception. If the
specified row is not rendered because one of its ancestors is
closed, the method must do nothing.</p>
<p>The <dfn id="selectall" title=
"dom-DataGridSelection-selectAll"><code>selectAll()</code></dfn>
method must mark all the rows in the data grid as selected. After a
call to <code title="dom-DataGridSelection-selectAll"><a href=
"#selectall">selectAll()</a></code> , the <code title=
"dom-DataGridSelection-length"><a href="#length5">length</a></code>
attribute will return the number of rows in the data grid, not
counting children of closed rows.</p>
<p>The <dfn id="invert" title=
"dom-DataGridSelection-invert"><code>invert()</code></dfn> method
must cause all the rows in the selection that were marked as
selected to now be marked as not selected, and vice versa.</p>
<p>The <dfn id="clear" title=
"dom-DataGridSelection-clear"><code>clear()</code></dfn> method
must mark all the rows in the data grid to be marked as not
selected. After a call to <code title=
"dom-DataGridSelection-clear"><a href="#clear">clear()</a></code> ,
the <code title="dom-DataGridSelection-length"><a href=
"#length5">length</a></code> attribute will return zero.</p>
<p>If the <code><a href="#datagrid0">datagrid</a></code> element
has a <dfn id="multiple0" title=
"attr-datagrid-multiple"><code>multiple</code></dfn> attribute,
then the user must be able to select any number of rows (zero or
more). If the attribute is not present, then the user must
<del class="diff-old">only</del> <ins class="diff-chg">not</ins> be
able to select <ins class="diff-new">more than</ins> a single row
at a time, and selecting another one must unselect all the other
rows.</p>
<p class="note">This only applies to the user. Scripts can select
multiple rows even when the <code title=
"attr-datagrid-multiple"><a href="#multiple0">multiple</a></code>
attribute is absent.</p>
<p>Whenever the selection of a <code><a href=
"#datagrid0">datagrid</a></code> changes, whether due to the user
interacting with the element, or as a result of calls to methods of
the <code title="dom-datagrid-selection"><a href=
"#selection0">selection</a></code> object, a <dfn id="select"
title="event-select"><code>select</code></dfn> event that bubbles
but is not cancelable must be fired on the <code><a href=
"#datagrid0">datagrid</a></code> element. If changes are made to
the selection via calls to the object's methods during the
execution of a script, then the <code title="event-select"><a href=
"#select">select</a></code> events must be coalesced into one,
which must then be fired when the script execution has
completed.</p>
<p class="note">The <code><a href=
"#datagridselection">DataGridSelection</a></code> interface has no
relation to the <code><a href="#selection1">Selection</a></code>
interface.</p>
<h5 id="columns"><span class="secno"><del class=
"diff-old">3.18.2.9.</del> <ins class=
"diff-chg">3.16.2.9.</ins></span> Columns and captions</h5>
<p><em>This section only applies to interactive user
agents.</em></p>
<p>Each <code><a href="#datagrid0">datagrid</a></code> element must
keep track of which columns are currently being rendered. User
agents should initially show all the columns except those with the
<code title="datagrid-column-class-initially-hidden"><a href=
"#initially-hidden">initially-hidden</a></code> class, but may
allow users to hide or show columns. User agents should initially
display the columns in the order given by the data provider, but
may allow this order to be changed by the user.</p>
<p>If columns are not being used, as might be the case if the data
grid is being presented in an icon view, or if an overview of data
is being read in an aural context, then the text of the first
column of each row should be used to represent the row.</p>
<p>If none of the columns have any captions (i.e. if the data
provider does not provide a <code title=
"dom-provider-getCaptionText"><a href=
"#getcaptiontext">getCaptionText()</a></code> method), then user
agents may avoid showing the column headers at all. This may
prevent the user from performing actions on the columns (such as
reordering them, changing the sort column, and so on).</p>
<p class="note">Whatever the order used for rendering, and
irrespective of what columns are being shown or hidden, the "first
column" as referred to in this specification is always the column
with index zero, and the "last column" is always the column with
the index one less than the value returned by the <code title=
"dom-provider-getcolumnCount"><a href=
"#getcolumncount">getColumnCount()</a></code> method of the data
provider.</p>
<p>If <a href="#columnType2">a column is sortable</a> , then the
user must be able to invoke it to sort the data. When the user does
so, then the <code><a href="#datagrid0">datagrid</a></code> must
invoke the data provider's <code title=
"dom-provider-toggleColumnSortState"><a href=
"#togglecolumnsortstate">toggleColumnSortState()</a></code> method,
with the column's index as the only argument. The <code><a href=
"#datagrid0">datagrid</a></code> must <em>then</em> act as if the
<code><a href="#datagrid0">datagrid</a></code> 's <code title=
"dom-datagrid-updateEverything"><a href=
"#updateeverything">updateEverything()</a></code> method had been
invoked.</p>
<h4 id="the-command"><span class="secno"><del class=
"diff-old">3.18.3.</del> <ins class="diff-chg">3.16.3</ins></span>
The <dfn id="command0"><code>command</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#metadata0">Metadata content</a> .</dd>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <a href="#metadata0">metadata content</a> is
expected.</dd>
<dd>Where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>Empty.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-command-type"><a href=
"#type13">type</a></code></dd>
<dd><code title="attr-command-label"><a href=
"#label">label</a></code></dd>
<dd><code title="attr-command-icon"><a href=
"#icon">icon</a></code></dd>
<dd><code title="attr-command-hidden"><a href=
"#hidden">hidden</a></code></dd>
<dd><code title="attr-command-disabled"><a href=
"#disabled4">disabled</a></code></dd>
<dd><code title="attr-command-checked"><a href=
"#checked0">checked</a></code></dd>
<dd><code title="attr-command-radiogroup"><a href=
"#radiogroup">radiogroup</a></code></dd>
<dd><code title="attr-command-default"><a href=
"#default1">default</a></code></dd>
<dd>Also, the <code title="attr-command-title"><a href=
"#title6">title</a></code> attribute has special semantics on this
element.</dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlcommandelement">HTMLCommandElement</dfn> : <a href=
"#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#type14" title=
"dom-command-type">type</a>;
attribute DOMString <a href="#label0" title=
"dom-command-label">label</a>;
attribute DOMString <a href="#icon0" title=
"dom-command-icon">icon</a>;
attribute boolean <a href="#hidden0" title=
"dom-command-hidden">hidden</a>;
attribute boolean <a href="#disabled5" title=
"dom-command-disabled">disabled</a>;
attribute boolean <a href="#checked1" title=
"dom-command-checked">checked</a>;
attribute DOMString <a href="#radiogroup0" title=
"dom-command-radiogroup">radiogroup</a>;
attribute boolean <a href="#default2" title=
"dom-command-default">default</a>;
void <a href="#click0" title=
"dom-command-click">click</a>(); // shadows <code><a href=
"#htmlelement">HTMLElement</a></code>.<code title=
"dom-click"><a href="#click">click()</a></code>
};
</pre>
<p>The <code title="command-ro"><a href=
"#command2">Command</a></code> interface must also be implemented
by this element.</p>
</dd>
</dl>
<p>The <code><a href="#command0">command</a></code> element
represents a command that the user can invoke.</p>
<p>The <dfn id="type13" title=
"attr-command-type"><code>type</code></dfn> attribute indicates the
kind of command: either a normal command with an associated action,
or a state or option that can be toggled, or a selection of one
item from a list of items.</p>
<p>The attribute's value must be either " <code title=
"">command</code> ", " <code title="">checkbox</code> ", or "
<code title="">radio</code> ", denoting each of these three types
of commands respectively. The attribute may also be omitted if the
element is to represent the first of these types, a simple
command.</p>
<p>The <dfn id="label" title=
"attr-command-label"><code>label</code></dfn> attribute gives the
name of the command, as shown to the user.</p>
<p>The <dfn id="title6" title=
"attr-command-title"><code>title</code></dfn> attribute gives a
hint describing the command, which might be shown to the user to
help him.</p>
<p>The <dfn id="icon" title=
"attr-command-icon"><code>icon</code></dfn> attribute gives a
picture that represents the command. If the attribute is specified,
the attribute's value must contain a URI (or IRI).</p>
<p>The <dfn id="hidden" title=
"attr-command-hidden"><code>hidden</code></dfn> attribute is a
<a href="#boolean0">boolean attribute</a> that, if present,
indicates that the command is not relevant and is to be hidden.</p>
<p>The <dfn id="disabled4" title=
"attr-command-disabled"><code>disabled</code></dfn> attribute is a
<a href="#boolean0">boolean attribute</a> that, if present,
indicates that the command is not available in the current
state.</p>
<p class="note">The distinction between <a href="#disabled6" title=
"command-facet-DisabledState">Disabled State</a> and <a href=
"#hidden1" title="command-facet-HiddenState">Hidden State</a> is
subtle. A command should be Disabled if, in the same context, it
could be enabled if only certain aspects of the situation were
changed. A command should be marked as Hidden if, in that
situation, the command will never be enabled. For example, in the
context menu for a water faucet, the command "open" might be
Disabled if the faucet is already open, but the command "eat" would
be marked Hidden since the faucet could never be eaten.</p>
<p>The <dfn id="checked0" title=
"attr-command-checked"><code>checked</code></dfn> attribute is a
<a href="#boolean0">boolean attribute</a> that, if present,
indicates that the command is selected.</p>
<p>The <dfn id="radiogroup" title=
"attr-command-radiogroup"><code>radiogroup</code></dfn> attribute
gives the name of the group of commands that will be toggled when
the command itself is toggled, for commands whose <code title=
"attr-command-type"><a href="#type13">type</a></code> attribute has
the value " <code title="">radio</code> ". The scope of the name is
the child list of the parent element.</p>
<p>If the <code><a href="#command0">command</a></code> element is
used when <span title="menu generation">generating</span> a
<span>context menu</span> , then the <dfn id="default1" title=
"attr-command-default"><code>default</code></dfn> attribute
indicates, if present, that the command is the one that would have
been invoked if the user had directly activated the menu's subject
instead of using its context menu. The <code title=
"attr-command-default"><a href="#default1">default</a></code>
attribute is a <a href="#boolean0">boolean attribute</a> .</p>
<div class="example">
<p class="big-issue">Need an example that shows an element that, if
double-clicked, invokes an action, but that also has a context
menu, showing the various <code><a href=
"#command0">command</a></code> attributes off, and that has a
default command.</p>
</div>
<p>The <dfn id="type14" title=
"dom-command-type"><code>type</code></dfn> , <dfn id="label0"
title="dom-command-label"><code>label</code></dfn> , <dfn id=
"icon0" title="dom-command-icon"><code>icon</code></dfn> , <dfn id=
"hidden0" title="dom-command-hidden"><code>hidden</code></dfn> ,
<dfn id="disabled5" title=
"dom-command-disabled"><code>disabled</code></dfn> , <dfn id=
"checked1" title="dom-command-checked"><code>checked</code></dfn> ,
<dfn id="radiogroup0" title=
"dom-command-radiogroup"><code>radiogroup</code></dfn> , and
<dfn id="default2" title=
"dom-command-default"><code>default</code></dfn> DOM attributes
must <a href="#reflect">reflect</a> their respective namesake
content attributes.</p>
<p>The <dfn id="click0" title=
"dom-command-click"><code>click()</code></dfn> method's <del class=
"diff-old">behaviour</del> <ins class="diff-chg">behavior</ins>
depends on the value of the <code title=
"attr-command-type"><a href="#type13">type</a></code> attribute of
the element, as follows:</p>
<dl class="switch">
<dt>If the <code title="attr-command-type"><a href=
"#type13">type</a></code> attribute has the value <code title=
"">checkbox</code></dt>
<dd>
<p>If the element has a <code title="attr-command-checked"><a href=
"#checked0">checked</a></code> attribute, the UA must remove that
attribute. Otherwise, the UA must add a <code title=
"attr-command-checked"><a href="#checked0">checked</a></code>
attribute, with the literal value <code title="">checked</code> .
The UA must then <a href="#firing">fire a <code title=
"">click</code> event</a> at the element.</p>
</dd>
<dt>If the <code title="attr-command-type"><a href=
"#type13">type</a></code> attribute has the value <code title=
"">radio</code></dt>
<dd>
<p>If the element has a parent, then the UA must walk the list of
child nodes of that parent element, and for each node that is a
<code><a href="#command0">command</a></code> element, if that
element has a <code title="attr-command-radiogroup"><a href=
"#radiogroup">radiogroup</a></code> attribute whose value exactly
matches the current element's (treating missing <code title=
"attr-command-radiogroup"><a href=
"#radiogroup">radiogroup</a></code> attributes as if they were the
empty string), and has a <code title=
"attr-command-checked"><a href="#checked0">checked</a></code>
attribute, must remove that attribute and <a href="#firing">fire a
<code title="">click</code> event</a> at the element.</p>
<p>Then, the element's <code title="attr-command-checked"><a href=
"#checked0">checked</a></code> attribute attribute must be set to
the literal value <code title="">checked</code> and a <span title=
"file a click event"><code title="">click</code> event must be
fired</span> at the element.</p>
</dd>
<dt>Otherwise</dt>
<dd>
<p>The UA must <a href="#firing">fire a <code title="">click</code>
event</a> at the element.</p>
</dd>
</dl>
<p class="note">Firing a synthetic <code title=
"event-click">click</code> event at the element does not cause any
of the actions described above to happen.</p>
<p class="big-issue">should change all the above so it actually is
just <del class="diff-old">trigged</del> <ins class=
"diff-chg">triggered</ins> by a click event, then we could remove
the shadowing click() method and rely on actual events.</p>
<p class="big-issue">Need to define the command="" attribute</p>
<p class="note"><code><a href="#command0">command</a></code>
elements are not rendered unless they <a href="#menu" title=
"menu">form part of a menu</a> .</p>
<h4 id="menus"><span class="secno"><del class=
"diff-old">3.18.4.</del> <ins class="diff-chg">3.16.4</ins></span>
The <dfn id="menu"><code>menu</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dd>If there is a <code><a href="#menu">menu</a></code> element
ancestor: <a href="#phrasing0">phrasing content</a> .</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dd>If there is a <code><a href="#menu">menu</a></code> element
ancestor: where <a href="#phrasing0">phrasing content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>Either: Zero or more <code><a href="#li">li</a></code>
elements.</dd>
<dd>Or: <a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-menu-type"><a href=
"#type15">type</a></code></dd>
<dd><code title="attr-menu-label"><a href=
"#label1">label</a></code></dd>
<dd><code title="attr-menu-autosubmit"><a href=
"#autosubmit">autosubmit</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlmenuelement">HTMLMenuElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
attribute DOMString <span title=
"dom-menu-type">type</span>;
attribute DOMString <span title=
"dom-menu-label">label</span>;
attribute boolean <span title=
"dom-menu-autosubmit">autosubmit</span>;
};
</pre></dd>
</dl>
<p>The <code><a href="#menu">menu</a></code> element represents a
list of commands.</p>
<p>The <dfn id="type15" title=
"attr-menu-type"><code>type</code></dfn> attribute is an <a href=
"#enumerated">enumerated attribute</a> indicating the kind of menu
being declared. The attribute has three states. The <code title=
"attr-menu-type-context">context</code> keyword maps to the
<dfn id="context1" title="context menu state">context menu</dfn>
state, in which the element is declaring a context menu. The
<code title="attr-menu-type-toolbar">toolbar</code> keyword maps to
the <dfn id="tool-bar" title="tool bar state">tool bar</dfn> state,
in which the element is <del class="diff-old">declaraing</del>
<ins class="diff-chg">declaring</ins> a tool bar. The attribute may
also be omitted. The <i>missing value default</i> is the <dfn id=
"list" title="list state">list</dfn> state, which indicates that
the element is merely a list of commands that is neither declaring
a context menu nor defining a tool bar.</p>
<p>If a <code><a href="#menu">menu</a></code> element's
<code title="attr-menu-type"><a href="#type15">type</a></code>
attribute is in the <a href="#context1" title=
"context menu state">context menu</a> state, then the element
represents the commands of a context menu, and the user can only
interact with the commands if that context menu is activated.</p>
<p>If a <code><a href="#menu">menu</a></code> element's
<code title="attr-menu-type"><a href="#type15">type</a></code>
attribute is in the <a href="#tool-bar" title="tool bar state">tool
bar</a> state, then the element represents a list of active
commands that the user can immediately interact with.</p>
<p>If a <code><a href="#menu">menu</a></code> element's
<code title="attr-menu-type"><a href="#type15">type</a></code>
attribute is in the <a href="#list" title="list state">list</a>
state, then the element either represents an unordered list of
items (each represented by an <code><a href="#li">li</a></code>
element), each of which represents a command that the user may
perform or activate, or, if the element has no <code><a href=
"#li">li</a></code> element children, <del class=
"diff-old">prose</del> <a href="#flow-content0"><ins class=
"diff-chg">flow</ins> content</a> describing available
commands.</p>
<p>The <dfn id="label1" title=
"attr-menu-label"><code>label</code></dfn> attribute gives the
label of the menu. It is used by user agents to display nested
menus in the UI. For example, a context menu containing another
menu would use the nested menu's <code title=
"attr-menu-label"><a href="#label1">label</a></code> attribute for
the submenu's menu label.</p>
<p>The <dfn id="autosubmit" title=
"attr-menu-autosubmit"><code>autosubmit</code></dfn> attribute is a
<a href="#boolean0">boolean attribute</a> that, if present,
indicates that selections made to form controls in this menu are to
result in the control's form being immediately submitted.</p>
<p>If a <code title="event-change">change</code> event bubbles
through a <code><a href="#menu">menu</a></code> element, then, in
addition to any other default action that that event might have,
the UA must act as if the following was an additional default
action for that event: if (when it comes time to execute the
default action) the <code><a href="#menu">menu</a></code> element
has an <code title="attr-menu-autosubmit"><a href=
"#autosubmit">autosubmit</a></code> attribute, and the target of
the event is an <code>input</code> element, and that element has a
<code title="attr-input-type">type</code> attribute whose value is
either <code title="">radio</code> or <code title=
"">checkbox</code> , and the <code>input</code> element in question
has a non-null <code title="dom-input-form">form</code> DOM
attribute, then the UA must invoke the <code title=
"dom-form-submit">submit()</code> method of the <code>form</code>
element indicated by that DOM attribute.</p>
<h5 id="menus-intro"><span class="secno"><del class=
"diff-old">3.18.4.1.</del> <ins class=
"diff-chg">3.16.4.1.</ins></span> Introduction</h5>
<p><em>This section is non-normative.</em></p>
<p class="big-issue">...</p>
<h5 id="building"><span class="secno"><del class=
"diff-old">3.18.4.2.</del> <ins class=
"diff-chg">3.16.4.2.</ins></span> <dfn id="building0">Building
menus and tool bars</dfn></h5>
<p>A menu (or tool bar) consists of a list of zero or more of the
following components:</p>
<ul class="brief">
<li><a href="#command1" title="concept-command">Commands</a> ,
which can be marked as default commands</li>
<li>Separators</li>
<li>Other menus (which allows the list to be nested)</li>
</ul>
<p>The list corresponding to a particular <code><a href=
"#menu">menu</a></code> element is built by iterating over its
child nodes. For each child node in <a href="#tree-order">tree
order</a> , the required <del class="diff-old">behaviour</del>
<ins class="diff-chg">behavior</ins> depends on what the node is,
as follows:</p>
<dl class="switch">
<dt>An element that <a href="#command1" title=
"concept-command">defines a command</a></dt>
<dd>Append the command to the menu. If the element is a
<code><a href="#command0">command</a></code> element with a
<code title="attr-command-default"><a href=
"#default1">default</a></code> attribute, mark the command as being
a default command.</dd>
<dt>An <code><a href="#hr">hr</a></code> element</dt>
<dt>An <code>option</code> element that has a <code title=
"attr-option-value">value</code> attribute set to the empty string,
and has a <code title="attr-option-disabled">disabled</code>
attribute, and whose <code><a href=
"#textcontent">textContent</a></code> consists of a string of one
or more hyphens (U+002D HYPHEN-MINUS)</dt>
<dd>Append a separator to the menu.</dd>
<dt>An <code><a href="#li">li</a></code> element</dt>
<dd>Iterate over the children of the <code><a href=
"#li">li</a></code> element.</dd>
<dt>A <code><a href="#menu">menu</a></code> element with no
<code title="attr-menu-label"><a href="#label1">label</a></code>
attribute</dt>
<dt>A <code>select</code> element</dt>
<dd>Append a separator to the menu, then iterate over the children
of the <code><a href="#menu">menu</a></code> or <code>select</code>
element, then append another separator.</dd>
<dt>A <code><a href="#menu">menu</a></code> element with a
<code title="attr-menu-label"><a href="#label1">label</a></code>
attribute</dt>
<dt>An <code>optgroup</code> element</dt>
<dd>Append a submenu to the menu, using the value of the element's
<code title="">label</code> attribute as the label of the menu. The
submenu must be constructed by taking the element and creating a
new menu for it using the complete process described in this
section.</dd>
<dt>Any other node</dt>
<dd><a href="#ignored">Ignore</a> the node.</dd>
</dl>
<p class="issue">We should support <code>label</code> in the
algorithm above -- just iterate through the contents like with
<code><a href="#li">li</a></code> , to support <code>input</code>
elements in <code>label</code> elements. Also,
<code>optgroup</code> elements without labels should be ignored
(maybe? or at least should say they have no label so that they are
dropped below), and <code>select</code> elements inside
<code>label</code> elements may need special processing.</p>
<p>Once all the nodes have been processed as described above, the
user agent must the post-process the menu as follows:</p>
<ol>
<li>Any menu item with no label, or whose label is the empty
string, must be removed.</li>
<li>Any sequence of two or more separators in a row must be
collapsed to a single separator.</li>
<li>Any separator at the start or end of the menu must be
removed.</li>
</ol>
<h5 id="context"><span class="secno"><del class=
"diff-old">3.18.4.3.</del> <ins class=
"diff-chg">3.16.4.3.</ins></span> <dfn id="context2">Context
menus</dfn></h5>
<p>The <dfn id="contextmenu" title=
"attr-contextmenu"><code>contextmenu</code></dfn> attribute gives
the element's <a href="#context2" title="context menus">context
menu</a> . The value must be the ID of a <code><a href=
"#menu">menu</a></code> element in the DOM. If the node that would
be obtained by the invoking the <code>getElementById()</code>
method using the attribute's value as the only argument is null or
not a <code><a href="#menu">menu</a></code> element, then the
element has no assigned context menu. Otherwise, the element's
assigned context menu is the element so identified.</p>
<p>When an element's context menu is requested (e.g. by the user
right-clicking the element, or pressing a context menu key), the UA
must <a href="#firing1">fire a <code title="">contextmenu</code>
event</a> on the element for which the menu was requested.</p>
<p class="note">Typically, therefore, the firing of the
<code title="event-contextmenu">contextmenu</code> event will be
the default action of a <code title="mouseup">mouseup</code> or
<code title="event-keyup">keyup</code> event. The exact sequence of
events is UA-dependent, as it will vary based on platform
conventions.</p>
<p>The default action of the <code title=
"event-contextmenu">contextmenu</code> event depends on whether the
element has a context menu assigned (using the <code title=
"attr-contextmenu"><a href="#contextmenu">contextmenu</a></code>
attribute) or not. If it does not, the default action must be for
the user agent to show its default context menu, if it has one.</p>
<p class="big-issue"><ins class="diff-new">Context menus should
inherit (so clicking on a span in a paragraph with a context menu
should show the menu).</ins></p>
<p>If the element <em>does</em> have a context menu assigned, then
the user agent must <a href="#firing3">fire a <code title=
"">show</code> event</a> on the relevant <code><a href=
"#menu">menu</a></code> element.</p>
<p>The default action of <em>this</em> event is that the user agent
must show a context menu <a href="#building0" title=
"building menus and tool bars">built</a> from the <code><a href=
"#menu">menu</a></code> element.</p>
<p>The user agent may also provide access to its default context
menu, if any, with the context menu shown. For example, it could
merge the menu items from the two menus together, or provide the
page's context menu as a submenu of the default menu.</p>
<p>If the user dismisses the menu without making a selection,
nothing in particular happens.</p>
<p>If the user selects a menu item that represents a <span title=
"concept-commands">command</span> , then the UA must invoke that
command's <a href="#action" title="command-facet-Action">Action</a>
.</p>
<p>Context menus must not, while being shown, reflect changes in
the DOM; they are constructed as the default action of the
<code title="event-show">show</code> event and must remain like
that until dismissed.</p>
<p>User agents may provide means for bypassing the context menu
processing model, ensuring that the user can always access the UA's
default context menus. For example, the user agent could handle
right-clicks that have the Shift key depressed in such a way that
it does not fire the <code title=
"event-contextmenu">contextmenu</code> event and instead always
shows the default context menu.</p>
<p>The <dfn id="contextmenu0" title=
"dom-contextMenu"><code>contextMenu</code></dfn> attribute must
<a href="#reflect">reflect</a> the <code title=
"attr-contextmenu"><a href="#contextmenu">contextmenu</a></code>
content attribute.</p>
<h5 id="toolbars"><span class="secno"><del class=
"diff-old">3.18.4.4.</del> <ins class=
"diff-chg">3.16.4.4.</ins></span> Toolbars</h5>
<p><dfn id="toolbars0">Toolbars</dfn> are a kind of menu that is
always visible.</p>
<p>When a <code><a href="#menu">menu</a></code> element has a
<code title="attr-menu-type"><a href="#type15">type</a></code>
attribute with the value <code title="">toolbar</code> , then the
user agent must <a href="#building0" title=
"building menus and tool bars">build</a> the menu for that
<code><a href="#menu">menu</a></code> element and <span title=
"render-toolbar">render</span> it in the document in a position
appropriate for that <code><a href="#menu">menu</a></code>
element.</p>
<p>The user agent must reflect changes made to the <code><a href=
"#menu">menu</a></code> 's DOM immediately in the UI.</p>
<h4 id="commands"><span class="secno"><del class=
"diff-old">3.18.5.</del> <ins class="diff-chg">3.16.5</ins></span>
Commands</h4>
<p>A <dfn id="command1" title="concept-command">command</dfn> is
the abstraction behind menu items, buttons, and links. Once a
command is defined, other parts of the interface can refer to the
same command, allowing many access points to a single feature to
share aspects such as the disabled state.</p>
<p id="facets">Commands are defined to have the following
<em>facets</em> :</p>
<dl>
<dt><dfn id="type16" title="command-facet-Type">Type</dfn></dt>
<dd>The kind of command: "command", meaning it is a normal command;
"radio", meaning that triggering the command will, amongst other
things, set the <a href="#checked2" title=
"command-facet-CheckedState">Checked State</a> to true (and
probably uncheck some other commands); or "checkbox", meaning that
triggering the command will, amongst other things, toggle the value
of the <a href="#checked2" title=
"command-facet-CheckedState">Checked State</a> .</dd>
<dt><dfn id="id1" title="command-facet-ID">ID</dfn></dt>
<dd>The name of the command, for referring to the command from the
markup or from script. If a command has no ID, it is an <dfn id=
"anonymous">anonymous command</dfn> .</dd>
<dt><dfn id="label2" title="command-facet-Label">Label</dfn></dt>
<dd>The name of the command as seen by the user.</dd>
<dt><dfn id="hint" title="command-facet-Hint">Hint</dfn></dt>
<dd>A helpful or descriptive string that can be shown to the
user.</dd>
<dt><dfn id="icon1" title="command-facet-Icon">Icon</dfn></dt>
<dd>A graphical image that represents the action.</dd>
<dt><dfn id="hidden1" title="command-facet-HiddenState">Hidden
State</dfn></dt>
<dd>Whether the command is hidden or not (basically, whether it
should be shown in menus).</dd>
<dt><dfn id="disabled6" title=
"command-facet-DisabledState">Disabled State</dfn></dt>
<dd>Whether the command can be triggered or not. If the <a href=
"#hidden1" title="command-facet-HiddenState">Hidden State</a> is
true (hidden) then the <a href="#disabled6" title=
"command-facet-DisabledState">Disabled State</a> will be true
(disabled) regardless. <span class="issue">We could make this into
a string value that acts as a Hint for why the command is
disabled.</span></dd>
<dt><dfn id="checked2" title="command-facet-CheckedState">Checked
State</dfn></dt>
<dd>Whether the command is checked or not.</dd>
<dt><dfn id="action" title="command-facet-Action">Action</dfn></dt>
<dd>The actual effect that triggering the command will have. This
could be a scripted event handler, a URI to which to navigate, or a
form submission.</dd>
<dt><dfn id="triggers" title=
"command-facet-Triggers">Triggers</dfn></dt>
<dd>The list of elements that can trigger the command. The element
defining a command is always in the list of elements that can
trigger the command. For anonymous commands, only the element
defining the command is on the list, since other elements have no
way to refer to it.</dd>
</dl>
<p>Commands are represented by elements in the DOM. Any element
that can define a command also implements the <code title=
"command-ro"><a href="#command2">Command</a></code> interface:</p>
<p class="big-issue"><ins class="diff-new">Actually even better
would be to just mix it straight into those interfaces
somehow.</ins></p>
<pre>
<del class="diff-old"> class=idl>interface {
</del>
<ins class=
"diff-chg"> class=idl>[NoInterfaceObject] interface <dfn id=
"command2" title="command-ro">Command</dfn> {
</ins>
readonly attribute DOMString <a href="#commandtype" title=
"dom-command-ro-commandType">commandType</a>;
readonly attribute DOMString <a href="#id2" title=
"dom-command-ro-id">id</a>;
readonly attribute DOMString <a href="#label3" title=
"dom-command-ro-label">label</a>;
readonly attribute DOMString <a href="#title7" title=
"dom-command-ro-title">title</a>;
readonly attribute DOMString <a href="#icon2" title=
"dom-command-ro-icon">icon</a>;
readonly attribute boolean <a href="#hidden2" title=
"dom-command-ro-hidden">hidden</a>;
readonly attribute boolean <a href="#disabled7" title=
"dom-command-ro-disabled">disabled</a>;
readonly attribute boolean <a href="#checked3" title=
"dom-command-ro-checked">checked</a>;
void <a href="#click1" title="dom-command-ro-click">click</a>();
readonly attribute <a href=
"#htmlcollection0">HTMLCollection</a> <a href="#triggers0" title=
"dom-command-ro-triggers">triggers</a>;
readonly attribute <a href="#command0">Command</a> <span title=
"dom-command-ro-command">command</span>;
};
</pre>
<p>The <code title="command-ro"><a href=
"#command2">Command</a></code> interface is implemented by any
element capable of defining a command. (If an element can define a
command, its definition will list this interface explicitly.) All
the attributes of the <code title="command-ro"><a href=
"#command2">Command</a></code> interface are read-only. Elements
implementing this interface may implement other interfaces that
have attributes with identical names but that are mutable; in
bindings that <del class="diff-old">simply</del> flatten all
supported interfaces on the object, the mutable attributes must
shadow the readonly attributes defined in the <code title=
"command-ro"><a href="#command2">Command</a></code> interface.</p>
<p>The <dfn id="commandtype" title=
"dom-command-ro-commandType"><code>commandType</code></dfn>
attribute must return a string whose value is either " <code title=
"">command</code> ", " <code title="">radio</code> ", or "
<code title="">checked</code> ", depending on whether the <a href=
"#type16" title="command-facet-Type">Type</a> of the command
defined by the element is "command", "radio", or "checked"
respectively. If the element does not define a command, it must
return null.</p>
<p>The <dfn id="id2" title=
"dom-command-ro-id"><code>id</code></dfn> attribute must return the
command's <a href="#id1" title="command-facet-ID">ID</a> , or null
if the element does not define a command or defines an <a href=
"#anonymous">anonymous command</a> . This attribute will be
shadowed by the <code title="dom-id"><a href="#id0">id</a></code>
DOM attribute on the <code><a href=
"#htmlelement">HTMLElement</a></code> interface.</p>
<p>The <dfn id="label3" title=
"dom-command-ro-label"><code>label</code></dfn> attribute must
return the command's <a href="#label2" title=
"command-facet-Label">Label</a> , or null if the element does not
define a command or does not specify a <a href="#label2" title=
"command-facet-Label">Label</a> . This attribute will be shadowed
by the <code title="">label</code> DOM attribute on
<code>option</code> and <code><a href=
"#command0">command</a></code> elements.</p>
<p>The <dfn id="title7" title=
"dom-command-ro-title"><code>title</code></dfn> attribute must
return the command's <a href="#hint" title=
"command-facet-Hint">Hint</a> , or null if the element does not
define a command or does not specify a <a href="#hint" title=
"command-facet-Hint">Hint</a> . This attribute will be shadowed by
the <code title="dom-title"><a href="#title0">title</a></code> DOM
attribute on the <code><a href=
"#htmlelement">HTMLElement</a></code> interface.</p>
<p>The <dfn id="icon2" title=
"dom-command-ro-icon"><code>icon</code></dfn> attribute must return
an absolute URI to the command's <a href="#icon1" title=
"command-facet-Icon">Icon</a> . If the element does not specify an
icon, or if the element does not define a command, then the
attribute must return null. This attribute will be shadowed by the
<code title="dom-command-icon"><a href="#icon0">icon</a></code> DOM
attribute on <code><a href="#command0">command</a></code>
elements.</p>
<p>The <dfn id="hidden2" title=
"dom-command-ro-hidden"><code>hidden</code></dfn> attribute must
return true if the command's <a href="#hidden1" title=
"command-facet-HiddenState">Hidden State</a> is that the command is
hidden, and false if it is that the command is not hidden. If the
element does not define a command, the attribute must return false.
This attribute will be shadowed by the <code title=
"dom-command-hidden"><a href="#hidden0">hidden</a></code> DOM
attribute on <code><a href="#command0">command</a></code>
elements.</p>
<p>The <dfn id="disabled7" title=
"dom-command-ro-disabled"><code>disabled</code></dfn> attribute
must return true if the command's <a href="#disabled6" title=
"command-facet-DisabledState">Disabled State</a> is that the
command is disabled, and false if the command is not disabled. This
attribute is not affected by the command's <a href="#hidden1"
title="command-facet-HiddenState">Hidden State</a> . If the element
does not define a command, the attribute must return false. This
attribute will be shadowed by the <code title="">disabled</code>
attribute on <code>button</code> , <code>input</code> ,
<code>option</code> , and <code><a href=
"#command0">command</a></code> elements.</p>
<p>The <dfn id="checked3" title=
"dom-command-ro-checked"><code>checked</code></dfn> attribute must
return true if the command's <a href="#checked2" title=
"command-facet-CheckedState">Checked State</a> is that the command
is checked, and false if it is that the command is not checked. If
the element does not define a command, the attribute must return
false. This attribute will be shadowed by the <code title=
"">checked</code> attribute on <code>input</code> and
<code><a href="#command0">command</a></code> elements.</p>
<p>The <dfn id="click1" title=
"dom-command-ro-click"><code>click()</code></dfn> method must
trigger the <a href="#action" title=
"command-facet-Action">Action</a> for the command. If the element
does not define a command, this method must do nothing. This method
will be shadowed by the <code title="dom-click"><a href=
"#click">click()</a></code> method on <a href="#html-elements">HTML
elements</a> , and is included only for completeness.</p>
<p>The <dfn id="triggers0" title=
"dom-command-ro-triggers"><code>triggers</code></dfn> attribute
must return a list containing the elements that can trigger the
command (the command's <a href="#triggers" title=
"command-facet-Triggers">Triggers</a> ). The list must be <a href=
"#live">live</a> . While the element does not define a command, the
list must be empty.</p>
<p>The <dfn id="commands0" title=
"dom-document-commands"><code>commands</code></dfn> attribute of
the document's <code><a href=
"#htmldocument">HTMLDocument</a></code> interface must return an
<code><a href="#htmlcollection0">HTMLCollection</a></code> rooted
at the <code>Document</code> node, whose filter matches only
elements that define commands and have IDs.</p>
<p>The following elements can define commands: <code title=
"a-command"><a href="#using4">a</a></code> , <code title=
"button-command"><a href="#using5">button</a></code> , <code title=
"input-command"><a href="#using6">input</a></code> , <code title=
"option-command"><a href="#using7">option</a></code> , <code title=
"command-element"><a href="#command3">command</a></code> .</p>
<h5 id="using"><span class="secno"><del class=
"diff-old">3.18.5.1.</del> <ins class=
"diff-chg">3.16.5.1.</ins></span> <dfn id="using4" title=
"a-command">Using the <code>a</code> element to define a
command</dfn></h5>
<p>An <code><a href="#a">a</a></code> element with an <code title=
"attr-hyperlink-href"><a href="#href6">href</a></code> attribute
<a href="#command1" title="concept-command">defines a command</a>
.</p>
<p>The <a href="#type16" title="command-facet-Type">Type</a> of the
command is "command".</p>
<p>The <a href="#id1" title="command-facet-ID">ID</a> of the
command is the value of the <code title="attr-id"><a href=
"#id">id</a></code> attribute of the element, if the attribute is
present and not empty. Otherwise the command is an <a href=
"#anonymous">anonymous command</a> .</p>
<p>The <a href="#label2" title="command-facet-Label">Label</a> of
the command is the string given by the element's <code><a href=
"#textcontent">textContent</a></code> DOM attribute.</p>
<p>The <a href="#hint" title="command-facet-Hint">Hint</a> of the
command is the value of the <code title="attr-title"><a href=
"#title">title</a></code> attribute of the <code><a href=
"#a">a</a></code> element. If the attribute is not present, the
<a href="#hint" title="command-facet-Hint">Hint</a> is the empty
string.</p>
<p>The <a href="#icon1" title="command-facet-Icon">Icon</a> of the
command is the absolute URI of the first image in the element.
Specifically, in a depth-first search of the children of the
element, the first element that is <code><a href=
"#img">img</a></code> element with a <code>src</code> attribute is
the one that is used as the image. The URI must be taken from the
element's <code>src</code> attribute. Relative URIs must be
resolved relative to the <a href="#elements2" title=
"element's base URI">base URI</a> of the image element. If no image
is found, then the Icon facet is left blank.</p>
<p>The <a href="#hidden1" title="command-facet-HiddenState">Hidden
State</a> and <a href="#disabled6" title=
"command-facet-DisabledState">Disabled State</a> facets of the
command are always false. (The command is always enabled.)</p>
<p>The <a href="#checked2" title=
"command-facet-CheckedState">Checked State</a> of the command is
always false. (The command is never checked.)</p>
<p>The <a href="#action" title="command-facet-Action">Action</a> of
the command is to <a href="#firing" title="fire a click event">fire
a <code title="">click</code> event</a> at the element.</p>
<h5 id="using0"><span class="secno"><del class=
"diff-old">3.18.5.2.</del> <ins class=
"diff-chg">3.16.5.2.</ins></span> <dfn id="using5" title=
"button-command">Using the <code>button</code> element to define a
command</dfn></h5>
<p>A <code>button</code> element always <a href="#command1" title=
"concept-command">defines a command</a> .</p>
<p>The <a href="#type16" title="command-facet-Type">Type</a> ,
<a href="#id1" title="command-facet-ID">ID</a> , <a href="#label2"
title="command-facet-Label">Label</a> , <a href="#hint" title=
"command-facet-Hint">Hint</a> , <a href="#icon1" title=
"command-facet-Icon">Icon</a> , <a href="#hidden1" title=
"command-facet-HiddenState">Hidden State</a> , <a href="#checked2"
title="command-facet-CheckedState">Checked State</a> , and <a href=
"#action" title="command-facet-Action">Action</a> facets of the
command are determined <a href="#using4" title="a-command">as for
<code>a</code> elements</a> (see the previous section).</p>
<p>The <a href="#disabled6" title=
"command-facet-DisabledState">Disabled State</a> of the command
mirrors the disabled state of the button. Typically this is given
by the element's <code title="attr-button-disabled">disabled</code>
attribute, but certain button types become disabled at other times
too (for example, the <code>move-up</code> button type is disabled
when it would have no effect).</p>
<h5 id="using1"><span class="secno"><del class=
"diff-old">3.18.5.3.</del> <ins class=
"diff-chg">3.16.5.3.</ins></span> <dfn id="using6" title=
"input-command">Using the <code>input</code> element to define a
command</dfn></h5>
<p>An <code>input</code> element whose <code title=
"attr-input-type">type</code> attribute is one of
<code>submit</code> , <code>reset</code> , <code>button</code> ,
<code>radio</code> , <code>checkbox</code> , <code>move-up</code> ,
<code>move-down</code> , <code>add</code> , and <code>remove</code>
<a href="#command1" title="concept-command">defines a command</a>
.</p>
<p>The <a href="#type16" title="command-facet-Type">Type</a> of the
command is "radio" if the <code title="attr-input-type">type</code>
attribute has the value <code>radio</code> , "checkbox" if the
<code>type</code> attribute has the value <code>checkbox</code> ,
and "command" otherwise.</p>
<p>The <a href="#id1" title="command-facet-ID">ID</a> of the
command is the value of the <code title="attr-id"><a href=
"#id">id</a></code> attribute of the element, if the attribute is
present and not empty. Otherwise the command is an <a href=
"#anonymous">anonymous command</a> .</p>
<p>The <a href="#label2" title="command-facet-Label">Label</a> of
the command depends on the Type of the command:</p>
<p>If the <a href="#type16" title="command-facet-Type">Type</a> is
"command", then it is the string given by the <code title=
"attr-input-value">value</code> attribute, if any, and a
<span>UA-dependent value</span> that the UA uses to label the
button itself if the attribute is absent.</p>
<p>Otherwise, the <a href="#type16" title=
"command-facet-Type">Type</a> is "radio" or "checkbox". If the
element has a <code>label</code> element associated with it, the
<code><a href="#textcontent">textContent</a></code> of the first
such element is the <a href="#label2" title=
"command-facet-Label">Label</a> (in DOM terms, this the string
given by <code><var title="">element</var>
.labels[0].textContent</code> ). Otherwise, the value of the
<code>value</code> attribute, if present, is the <a href="#label2"
title="command-facet-Label">Label</a> . Otherwise, the <a href=
"#label2" title="command-facet-Label">Label</a> is the empty
string.</p>
<p>The <a href="#hint" title="command-facet-Hint">Hint</a> of the
command is the value of the <code title="attr-title"><a href=
"#title">title</a></code> attribute of the <code>input</code>
element. If the attribute is not present, the <a href="#hint"
title="command-facet-Hint">Hint</a> is the empty string.</p>
<p>There is no <a href="#icon1" title="command-facet-Icon">Icon</a>
for the command.</p>
<p>The <a href="#hidden1" title="command-facet-HiddenState">Hidden
State</a> of the command is always false. (The command is never
hidden.)</p>
<p>The <a href="#disabled6" title=
"command-facet-DisabledState">Disabled State</a> of the command
mirrors the disabled state of the control. Typically this is given
by the element's <code title="attr-input-disabled">disabled</code>
attribute, but certain input types become disabled at other times
too (for example, the <code>move-up</code> input type is disabled
when it would have no effect).</p>
<p>The <a href="#checked2" title=
"command-facet-CheckedState">Checked State</a> of the command is
true if the command is of <a href="#type16" title=
"command-facet-Type">Type</a> "radio" or "checkbox" and the element
has a <code title="attr-input-checked">checked</code> attribute,
and false otherwise.</p>
<p>The <a href="#action" title="command-facet-Action">Action</a> of
the command is to <a href="#firing" title="fire a click event">fire
a <code title="">click</code> event</a> at the element.</p>
<h5 id="using2"><span class="secno"><del class=
"diff-old">3.18.5.4.</del> <ins class=
"diff-chg">3.16.5.4.</ins></span> <dfn id="using7" title=
"option-command">Using the <code>option</code> element to define a
command</dfn></h5>
<p>An <code>option</code> element with an ancestor
<code>select</code> element and either no <code title=
"attr-option-value">value</code> attribute or a <code title=
"attr-option-value">value</code> attribute that is not the empty
string <a href="#command1" title="concept-command">defines a
command</a> .</p>
<p>The <a href="#type16" title="command-facet-Type">Type</a> of the
command is "radio" if the <code>option</code> 's nearest ancestor
<code>select</code> element has no <code title=
"attr-select-multiple">multiple</code> attribute, and "checkbox" if
it does.</p>
<p>The <a href="#id1" title="command-facet-ID">ID</a> of the
command is the value of the <code title="attr-id"><a href=
"#id">id</a></code> attribute of the element, if the attribute is
present and not empty. Otherwise the command is an <a href=
"#anonymous">anonymous command</a> .</p>
<p>The <a href="#label2" title="command-facet-Label">Label</a> of
the command is the value of the <code>option</code> element's
<code title="attr-option-label">label</code> attribute, if there is
one, or the value of the <code>option</code> element's
<code><a href="#textcontent">textContent</a></code> DOM attribute
if it doesn't.</p>
<p>The <a href="#hint" title="command-facet-Hint">Hint</a> of the
command is the string given by the element's <code title=
"attr-title"><a href="#title">title</a></code> attribute, if any,
and the empty string if the attribute is absent.</p>
<p>There is no <a href="#icon1" title="command-facet-Icon">Icon</a>
for the command.</p>
<p>The <a href="#hidden1" title="command-facet-HiddenState">Hidden
State</a> of the command is always false. (The command is never
hidden.)</p>
<p>The <a href="#disabled6" title=
"command-facet-DisabledState">Disabled State</a> of the command is
true (disabled) if the element has a <code title=
"attr-option-disabled">disabled</code> attribute, and false
otherwise.</p>
<p>The <a href="#checked2" title=
"command-facet-CheckedState">Checked State</a> of the command is
true (checked) if the element's <code title=
"dom-option-selected">selected</code> DOM attribute is true, and
false otherwise.</p>
<p>The <a href="#action" title="command-facet-Action">Action</a> of
the command depends on its <a href="#type16" title=
"command-facet-Type">Type</a> . If the command is of <a href=
"#type16" title="command-facet-Type">Type</a> "radio" then this
must set the <code title="dom-option-selected">selected</code> DOM
attribute of the <code>option</code> element to true, otherwise it
must toggle the state of the <code title=
"dom-option-selected">selected</code> DOM attribute (set it to true
if it is false and vice versa). Then <a href="#firing0" title=
"fire a change event">a <code title="">change</code> event must be
fired</a> on the <code>option</code> element's nearest ancestor
<code>select</code> element (if there is one), as if the selection
had been changed directly.</p>
<h5 id="using3"><span class="secno"><del class=
"diff-old">3.18.5.5.</del> <ins class=
"diff-chg">3.16.5.5.</ins></span> Using the <dfn id="command3"
title="command-element"><code>command</code></dfn> element to
define a command</h5>
<p>A <code><a href="#command0">command</a></code> element <a href=
"#command1" title="concept-command">defines a command</a> .</p>
<p>The <a href="#type16" title="command-facet-Type">Type</a> of the
command is "radio" if the <code><a href=
"#command0">command</a></code> 's <code title=
"attr-command-type"><a href="#type13">type</a></code> attribute is
" <code>radio</code> ", "checkbox" if the attribute's value is "
<code>checkbox</code> ", and "command" otherwise.</p>
<p>The <a href="#id1" title="command-facet-ID">ID</a> of the
command is the value of the <code title="attr-id"><a href=
"#id">id</a></code> attribute of the element, if the attribute is
present and not empty. Otherwise the command is an <a href=
"#anonymous">anonymous command</a> .</p>
<p>The <a href="#label2" title="command-facet-Label">Label</a> of
the command is the value of the element's <code title=
"attr-command-label"><a href="#label">label</a></code> attribute,
if there is one, or the empty string if it doesn't.</p>
<p>The <a href="#hint" title="command-facet-Hint">Hint</a> of the
command is the string given by the element's <code title=
"attr-command-title"><a href="#title6">title</a></code> attribute,
if any, and the empty string if the attribute is absent.</p>
<p>The <a href="#icon1" title="command-facet-Icon">Icon</a> for the
command is the absolute URI resulting from resolving the value of
the element's <code title="attr-command-icon"><a href=
"#icon">icon</a></code> attribute as a URI relative to the <a href=
"#elements2">element's base <del class="diff-old">URI.</del>
<ins class="diff-chg">URI</ins></a> . If the element has no
<code title="attr-command-icon"><a href="#icon">icon</a></code>
attribute then the command has no <a href="#icon1" title=
"command-facet-Icon">Icon</a> .</p>
<p>The <a href="#hidden1" title="command-facet-HiddenState">Hidden
State</a> of the command is true (hidden) if the element has a
<code title="attr-command-hidden"><a href=
"#hidden">hidden</a></code> attribute, and false otherwise.</p>
<p>The <a href="#disabled6" title=
"command-facet-DisabledState">Disabled State</a> of the command is
true (disabled) if the element has either a <code title=
"attr-command-disabled"><a href="#disabled4">disabled</a></code>
attribute or a <code title="attr-command-hidden"><a href=
"#hidden">hidden</a></code> attribute (or both), and false
otherwise.</p>
<p>The <a href="#checked2" title=
"command-facet-CheckedState">Checked State</a> of the command is
true (checked) if the element has a <code title=
"attr-command-checked"><a href="#checked0">checked</a></code>
attribute, and false otherwise.</p>
<p>The <a href="#action" title="command-facet-Action">Action</a> of
the command is to invoke the <del class="diff-old">behaviour</del>
<ins class="diff-chg">behavior</ins> described in the definition of
the <code title="dom-command-click"><a href=
"#click0">click()</a></code> method of the <code><a href=
"#htmlcommandelement">HTMLCommandElement</a></code> interface.</p>
<h3 id="datatemplate"><span class="secno"><del class=
"diff-old">3.19.</del> <ins class="diff-chg">3.17</ins></span> Data
Templates</h3>
<h4 id="introduction0"><span class="secno"><del class=
"diff-old">3.19.1.</del> <ins class="diff-chg">3.17.1</ins></span>
Introduction</h4>
<p><em><ins class="diff-new">This section is
non-normative.</ins></em></p>
<p class="big-issue">...examples...</p>
<h4 id="the-datatemplate"><span class="secno"><del class=
"diff-old">3.19.2.</del> <ins class="diff-chg">3.17.2</ins></span>
The <dfn id="datatemplate0"><code>datatemplate</code></dfn>
element</h4>
<dl class="element">
<dt>Categories</dt>
<dd><a href="#metadata0">Metadata content</a> .</dd>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>As the root element of an <a href="#xml-documents" title=
"xml documents">XML document</a> .</dd>
<dd>Where <a href="#metadata0">metadata content</a> is
expected.</dd>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd>Zero or more <code><a href="#rule">rule</a></code>
elements.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#datatemplate0">datatemplate</a></code>
element brings together the various rules that form a data
template. The element doesn't itself do anything exciting.</p>
<h4 id="the-rule"><span class="secno"><del class=
"diff-old">3.19.3.</del> <ins class="diff-chg">3.17.3</ins></span>
The <dfn id="rule"><code>rule</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>As a child of a <code><a href=
"#datatemplate0">datatemplate</a></code> element.</dd>
<dt>Content model:</dt>
<dd>Anything, regardless of the children's required contexts (but
see prose).</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-rule-condition"><a href=
"#condition">condition</a></code></dd>
<dd><code title="attr-rule-mode"><a href=
"#mode">mode</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlruleelement">HTMLRuleElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#condition0" title=
"dom-rule-condition">condition</a>;
attribute DOMString <a href="#mode0" title=
"dom-rule-mode">mode</a>;
readonly attribute DOMTokenString <a href="#modelist" title=
"dom-rule-modeList">modeList</a>;
};
</pre></dd>
</dl>
<p>The <code><a href="#rule">rule</a></code> element represents a
template of content that is to be used for elements when <a href=
"#update" title="datatemplate-regen">updating an element's
generated content</a> .</p>
<p>The <dfn id="condition" title=
"attr-rule-condition"><code>condition</code></dfn> attribute, if
specified, must contain a valid selector. It specifies which nodes
in the data tree will have the condition's template applied.
<a href="#references">[SELECTORS]</a></p>
<p>If the <code title="attr-rule-condition"><a href=
"#condition">condition</a></code> attribute is not specified, then
the condition applies to all elements, text nodes, CDATA nodes, and
processing instructions.</p>
<p>The <dfn id="mode" title=
"attr-rule-mode"><code>mode</code></dfn> attribute, if specified,
must have a value that is an <a href="#unordered">unordered set of
unique space-separated tokens</a> representing the various modes
for which the rule applies. When, and only when, the <code title=
"attr-rule-mode"><a href="#mode">mode</a></code> attribute is
omitted, the rule applies if and only if the mode is the empty
string. A mode is invoked by the <code><a href=
"#nest">nest</a></code> element; for the first node (the root node)
of the data tree, the mode is the empty string.</p>
<p>The contents of <code><a href="#rule">rule</a></code> elements
form a template, and may be anything that, when the parent
<code><a href="#datatemplate0">datatemplate</a></code> is applied
to some conforming data, results in a conforming DOM tree.</p>
<p>The <dfn id="condition0" title=
"dom-rule-condition"><code>condition</code></dfn> DOM attribute
must <a href="#reflect">reflect</a> the <code title=
"attr-rule-condition"><a href="#condition">condition</a></code>
content attribute.</p>
<p>The <dfn id="mode0" title=
"dom-rule-mode"><code>mode</code></dfn> and <dfn id="modelist"
title="dom-rule-modeList"><code>modeList</code></dfn> DOM
attributes must <a href="#reflect">reflect</a> the <code title=
"attr-rule-mode"><a href="#mode">mode</a></code> content
attribute.</p>
<h4 id="the-nest"><span class="secno"><del class=
"diff-old">3.19.4.</del> <ins class="diff-chg">3.17.4</ins></span>
The <dfn id="nest"><code>nest</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>As a child of a descendant of a <code><a href=
"#rule">rule</a></code> element, regardless of the element's
content model.</dd>
<dt>Content model:</dt>
<dd>Empty.</dd>
<dt>Element-specific attributes:</dt>
<dd><code title="attr-nest-filter"><a href=
"#filter">filter</a></code></dd>
<dd><code title="attr-nest-mode"><a href=
"#mode1">mode</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">
interface <dfn id=
"htmlnestelement">HTMLNestElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#filter0" title=
"dom-nest-filter">filter</a>;
attribute DOMString <a href="#mode2" title=
"dom-nest-mode">mode</a>;
};
</pre></dd>
</dl>
<p>The <code><a href="#nest">nest</a></code> element represents a
point in a template where the user agent should recurse and start
inserting the children of the data node that matches the
<code><a href="#rule">rule</a></code> in which the <code><a href=
"#nest">nest</a></code> element finds itself.</p>
<p>The <dfn id="filter" title=
"attr-nest-filter"><code>filter</code></dfn> attribute, if
specified, must contain a valid selector. It specifies which of the
child nodes in the data tree will be examined for further
processing at this point. <a href="#references">[SELECTORS]</a></p>
<p>If the <code title="attr-nest-filter"><a href=
"#filter">filter</a></code> attribute is not specified, then all
elements, text nodes, CDATA nodes, and processing instructions are
processed.</p>
<p>The <dfn id="mode1" title=
"attr-nest-mode"><code>mode</code></dfn> attribute, if specified,
must have a value that is a word token consisting of one or more
characters, none of which are <a href="#space" title=
"space character">space characters</a> . It gives the mode which
will be in effect when looking at the rules in the data
template.</p>
<p>The <dfn id="filter0" title=
"dom-nest-filter"><code>filter</code></dfn> DOM attribute must
<a href="#reflect">reflect</a> the <code title=
"attr-nest-filter"><a href="#filter">filter</a></code> content
attribute.</p>
<p>The <dfn id="mode2" title=
"dom-nest-mode"><code>mode</code></dfn> DOM attribute must <a href=
"#reflect">reflect</a> the <code title="attr-nest-mode"><a href=
"#mode1">mode</a></code> content attribute.</p>
<h4 id="global0"><span class="secno"><del class=
"diff-old">3.19.5.</del> <ins class="diff-chg">3.17.5</ins></span>
Global attributes for data templates</h4>
<p>The <dfn id="template" title=
"attr-template"><code>template</code></dfn> attribute may be added
to an element to indicate that the template processing model is to
be applied to that element.</p>
<p>The <code title="attr-template"><a href=
"#template">template</a></code> attribute, when specified, must be
a URI to an XML or HTML document, or a fragment identifier pointing
at another part of the document. If there is a fragment identifier
present, then the element with that ID in the target document must
be a <code><a href="#datatemplate0">datatemplate</a></code>
element, otherwise, the root element must be a <code><a href=
"#datatemplate0">datatemplate</a></code> element.</p>
<p>The <dfn id="template0" title=
"dom-template"><code>template</code></dfn> DOM attribute must
<a href="#reflect">reflect</a> the <code title=
"attr-template"><a href="#template">template</a></code> content
attribute.</p>
<p>The <dfn id="ref" title="attr-ref"><code>ref</code></dfn>
attribute may be specified on any element on which the <code title=
"attr-template"><a href="#template">template</a></code> attribute
is specified. If it is specified, it must be a URI to an XML or
HTML document, or a fragment identifier pointing at another part of
the document.</p>
<p>When an element has a <code title="attr-template"><a href=
"#template">template</a></code> attribute but no <code title=
"attr-ref"><a href="#ref">ref</a></code> attribute, the element
may, instead of its usual content model, have a single element of
any kind. That element is then used as the root node of the data
for the template.</p>
<p>The <dfn id="ref0" title="dom-ref"><code>ref</code></dfn> DOM
attribute must <a href="#reflect">reflect</a> the <code title=
"attr-ref"><a href="#ref">ref</a></code> content attribute.</p>
<p>The <dfn id="registrationmark" title=
"attr-registrationmark"><code>registrationmark</code></dfn>
attribute may be specified on any element that is a descendant of a
<code><a href="#rule">rule</a></code> element, except
<code><a href="#nest">nest</a></code> elements. Its value may be
any string, including the empty string (which is the value that is
assumed if the attribute is omitted). This attribute performs a
role similar to registration marks in printing presses: when the
generated content is regenerated, elements with the same
<code title="attr-registrationmark"><a href=
"#registrationmark">registrationmark</a></code> are lined up. This
allows the author to disambiguate how elements should be moved
around when generated content is regenerated in the face of changes
to the data tree.</p>
<p>The <dfn id="registrationmark0" title=
"dom-registrationMark"><code>registrationMark</code></dfn> DOM
attribute must <a href="#reflect">reflect</a> the <code title=
"attr-registrationmark"><a href=
"#registrationmark">registrationmark</a></code> content
attribute.</p>
<h4 id="processing1"><span class="secno"><del class=
"diff-old">3.19.6.</del> <ins class="diff-chg">3.17.6</ins></span>
Processing model</h4>
<h5 id="the-originalcontent"><span class="secno"><del class=
"diff-old">3.19.6.1.</del> <ins class=
"diff-chg">3.17.6.1.</ins></span> The <code title=
"dom-originalContent"><a href=
"#originalcontent">originalContent</a></code> DOM attribute</h5>
<p>The <dfn id="originalcontent" title=
"dom-originalContent"><code>originalContent</code></dfn> is set to
a <code>DocumentFragment</code> to hold the original children of an
element that has been replaced by content generated for a data
template. Initially, it must be null. Its value is set when the
<code title="attr-template"><a href="#template">template</a></code>
attribute is set to a usable value, and is unset when the attribute
is removed.</p>
<p class="note">The <code title="dom-originalContent"><a href=
"#originalcontent">originalContent</a></code> DOM attribute can
thus be used as an indicator of whether a template is currently
being applied, just as the <code title=
"dom-templateElement"><a href=
"#templateelement">templateElement</a></code> DOM attribute
can.</p>
<h5 id="the-template"><span class="secno"><del class=
"diff-old">3.19.6.2.</del> <ins class=
"diff-chg">3.17.6.2.</ins></span> The <code title=
"attr-template"><a href="#template">template</a></code>
attribute</h5>
<p><dfn id="setting" title=
"datatemplate-template-set">Setting</dfn> : When an <a href=
"#html-elements" title="HTML elements">HTML element</a> without a
<code title="attr-template"><a href="#template">template</a></code>
attribute has its <code title="attr-template"><a href=
"#template">template</a></code> attribute set, the user agent must
fetch the specified file and parse it (without a <a href=
"#browsing1">browsing context <del class="diff-old">, and with
scripting disabled</del></a> ) to obtain a DOM. If the URI is the
same as the URI of the current document, then the current
document's DOM must be assumed to be that parsed DOM. While this
loading and parsing is in progress, the element is said to be
<em>busy loading the template rules or data</em> .</p>
<p>If the resource specified by the <code title=
"attr-template"><a href="#template">template</a></code> attribute
is not the current document and does not have an XML MIME type, or
if an XML parse error is found while parsing the resource, then the
resource cannot be successfully parsed, and the user agent must
jump to the <a href="#failed" title=
"datatemplate-template-failed">failed to parse</a> steps below.</p>
<p>Once the DOM in question has been parsed, assuming that it
indeed can be parsed and does so successfully, the user agent must
wait for no scripts to be executing, and as soon as that
opportunity arises, run the following algorithm:</p>
<ol>
<li>
<p>If the <code title="attr-template"><a href=
"#template">template</a></code> attribute's value has a fragment
identifier, and, in the DOM in question, it identifies a
<code><a href="#datatemplate0">datatemplate</a></code> element,
then set the <code title="dom-templateElement"><a href=
"#templateelement">templateElement</a></code> DOM attribute to that
element.</p>
<p>Otherwise, if the <code title="attr-template"><a href=
"#template">template</a></code> attribute value does not have a
fragment identifier, and the root element of the DOM in question is
a <code><a href="#datatemplate0">datatemplate</a></code> element,
then set the <code title="dom-templateElement"><a href=
"#templateelement">templateElement</a></code> DOM attribute to that
element.</p>
<p>Otherwise, jump to the <a href="#failed" title=
"datatemplate-template-failed">failed to parse</a> steps below.</p>
</li>
<li>
<p>Create a new <code>DocumentFragment</code> and move all the
nodes that are children of the element to that
<code>DocumentFragment</code> object. Set the <code title=
"dom-originalContent"><a href=
"#originalcontent">originalContent</a></code> DOM attribute on the
element to this new <code>DocumentFragment</code> object.</p>
</li>
<li>
<p>Jump to the steps below for <a href="#update" title=
"datatemplate-regen">updating the generated content</a> .</p>
</li>
</ol>
<p>If the resource has <dfn id="failed" title=
"datatemplate-template-failed">failed to parse</dfn> , the user
agent must <a href="#firing2">fire a simple event</a> with the name
<code title="event-error"><a href="#error1">error</a></code> at the
element on which the <code title="attr-template"><a href=
"#template">template</a></code> attribute was found.</p>
<p><dfn id="unsetting" title=
"datatemplate-template-unset">Unsetting</dfn> : When an <a href=
"#html-elements" title="HTML elements">HTML element</a> with a
<code title="attr-template"><a href="#template">template</a></code>
attribute has its <code title="attr-template"><a href=
"#template">template</a></code> attribute removed or dynamically
changed from one value to another, the user agent must run the
following algorithm:</p>
<ol>
<li>
<p>Set the <code title="dom-templateElement"><a href=
"#templateelement">templateElement</a></code> DOM attribute to
null.</p>
</li>
<li>
<p>If the <code title="dom-originalContent"><a href=
"#originalcontent">originalContent</a></code> DOM attribute of the
element is not null, run these substeps:</p>
<ol>
<li>
<p>Remove all the nodes that are children of the element.</p>
</li>
<li>
<p>Append the nodes in the <code title=
"dom-originalContent"><a href=
"#originalcontent">originalContent</a></code>
<code>DocumentFragment</code> to the element.</p>
</li>
<li>
<p>Set <code title="dom-originalContent"><a href=
"#originalcontent">originalContent</a></code> to null.</p>
</li>
</ol>
<p>(If the <code title="dom-originalContent"><a href=
"#originalcontent">originalContent</a></code> DOM attribute of the
element is null, then either there was an error loading or parsing
the previous template, or the previous template never finished
loading; in either case, there is nothing to undo.)</p>
</li>
<li>
<p>If the <code title="attr-template"><a href=
"#template">template</a></code> attribute was changed (as opposed
to simply removed), then <a href="#setting" title=
"datatemplate-template-set">act as if it was now set to its new
value</a> (fetching the specified page, etc, as described
above).</p>
</li>
</ol>
<p>The <dfn id="templateelement" title=
"dom-templateElement"><code>templateElement</code></dfn> DOM
attribute is updated by the above algorithm to point to the
currently active <code><a href=
"#datatemplate0">datatemplate</a></code> element. Initially, the
attribute must have the value null.</p>
<h5 id="the-ref"><span class="secno"><del class=
"diff-old">3.19.6.3.</del> <ins class=
"diff-chg">3.17.6.3.</ins></span> The <code title=
"attr-ref"><a href="#ref">ref</a></code> attribute</h5>
<p><dfn id="setting0" title="datatemplate-ref-set">Setting</dfn> :
When an <a href="#html-elements" title="HTML elements">HTML
element</a> without a <code title="attr-ref"><a href=
"#ref">ref</a></code> attribute has its <code title=
"attr-ref"><a href="#ref">ref</a></code> attribute set, the user
agent must fetch the specified file and parse it (without a
<a href="#browsing1">browsing context <del class="diff-old">, and
with scripting disabled</del></a> ) to obtain a DOM. If the URI is
the same as the URI of the current <del class="diff-old">document
,</del> <ins class="diff-chg">document,</ins> then the current
document's DOM is assumed to be that parsed DOM. While this loading
and parsing is in progress, the element is said to be <em>busy
loading the template rules or data</em> .</p>
<p>If the resource specified by the <code title="attr-ref"><a href=
"#ref">ref</a></code> attribute is not the current document and
does not have an XML MIME type, or if an XML parse error is found
while parsing the resource, then the resource cannot be
successfully parsed, and the user agent must jump to the <a href=
"#failed0" title="datatemplate-ref-failed">failed to parse</a>
steps below.</p>
<p>Once the DOM in question has been parsed, assuming that it
indeed can be parsed and does so successfully, the user agent must
wait for no scripts to be executing, and as soon as that
opportunity arises, run the following algorithm:</p>
<ol>
<li>
<p>If the <code title="attr-ref"><a href="#ref">ref</a></code>
attribute value does not have a fragment identifier, then set the
<code title="dom-refNode"><a href="#refnode">refNode</a></code> DOM
attribute to the <code>Document</code> node of that DOM.</p>
<p>Otherwise, if the <code title="attr-ref"><a href=
"#ref">ref</a></code> attribute's value has a fragment identifier,
and, in the DOM in question, that fragment identifier identifies an
element, then set the <code title="dom-refNode"><a href=
"#refnode">refNode</a></code> DOM attribute to that element.</p>
<p>Otherwise, jump to the <a href="#failed0" title=
"datatemplate-ref-failed">failed to parse</a> steps below.</p>
</li>
<li>
<p>Jump to the steps below for <a href="#update" title=
"datatemplate-regen">updating the generated content</a> .</p>
</li>
</ol>
<p>If the resource has <dfn id="failed0" title=
"datatemplate-ref-failed">failed to parse</dfn> , the user agent
must <a href="#firing2">fire a simple event</a> with the name
<code title="event-error"><a href="#error1">error</a></code> at the
element on which the <code title="attr-ref"><a href=
"#ref">ref</a></code> attribute was found, and must then jump to
the steps below for <a href="#update" title=
"datatemplate-regen">updating the generated content</a> (the
contents of the element will be used instead of the specified
resource).</p>
<p><dfn id="unsetting0" title=
"datatemplate-ref-unset">Unsetting</dfn> : When an <a href=
"#html-elements" title="HTML elements">HTML element</a> with a
<code title="attr-ref"><a href="#ref">ref</a></code> attribute has
its <code title="attr-ref"><a href="#ref">ref</a></code> attribute
removed or dynamically changed from one value to another, the user
agent must run the following algorithm:</p>
<ol>
<li>
<p>Set the <code title="dom-refNode"><a href=
"#refnode">refNode</a></code> DOM attribute to null.</p>
</li>
<li>
<p>If the <code title="attr-ref"><a href="#ref">ref</a></code>
attribute was changed (as opposed to simply removed), then <a href=
"#setting0" title="datatemplate-ref-set">act as if it was now set
to its new value</a> (fetching the specified page, etc, as
described above). Otherwise, jump to the steps below for <a href=
"#update" title="datatemplate-regen">updating the generated
content</a> .</p>
</li>
</ol>
<p>The <dfn id="refnode" title=
"dom-refNode"><code>refNode</code></dfn> DOM attribute is updated
by the above algorithm to point to the current data tree, if one is
specified explicitly. If it is null, then the data tree is given by
the <code title="dom-originalContent"><a href=
"#originalcontent">originalContent</a></code> DOM attribute, unless
that is also null, in which case no template is currently being
applied. Initially, the attribute must have the value null.</p>
<h5 id="the-nodedatatemplate"><span class="secno"><del class=
"diff-old">3.19.6.4.</del> <ins class=
"diff-chg">3.17.6.4.</ins></span> The <code><a href=
"#nodedatatemplate">NodeDataTemplate</a></code> interface</h5>
<p>All objects that implement the <code>Node</code> interface must
also implement the <code><a href=
"#nodedatatemplate">NodeDataTemplate</a></code> interface, whose
members must be accessible using binding-specific casting
mechanisms.</p>
<pre class="idl">
interface <dfn id="nodedatatemplate">NodeDataTemplate</dfn> {
readonly attribute Node <a href="#datanode" title=
"dom-dataNode">dataNode</a>;
};
</pre>
<p>The <dfn id="datanode" title=
"dom-dataNode"><code>dataNode</code></dfn> DOM attribute returns
the node for which <em>this</em> node was generated. It must
initially be null. It is set on the nodes that form the content
generated during the <a href="#update" title=
"datatemplate-regen">algorithm for updating the generated
content</a> of elements that are using the data template
feature.</p>
<h5 id="mutations"><span class="secno"><del class=
"diff-old">3.19.6.5.</del> <ins class=
"diff-chg">3.17.6.5.</ins></span> Mutations</h5>
<p>An element with a non-null <code title=
"dom-templateElement"><a href=
"#templateelement">templateElement</a></code> is said to be a
<dfn id="data-tree">data tree user</dfn> of the node identified by
the element's <code title="dom-refNode"><a href=
"#refnode">refNode</a></code> attribute, as well as all of that
node's children, or, if that attribute is null, of the node
identified by the element's <code title=
"dom-originalContent"><a href=
"#originalcontent">originalContent</a></code> , as well as all
<em>that</em> node's children.</p>
<p>Nodes that have one or more <a href="#data-tree" title=
"data tree user">data tree users</a> associated with them (as per
the previous paragraph) are themselves termed <dfn id="data-tree0"
title="data tree component node">data tree component nodes</dfn>
.</p>
<p>Whenever a <a href="#data-tree0">data tree component node</a>
changes its name or value, or has one of its attributes change name
or value, or has an attribute added or removed, or has a child
added or removed, the user agent must <span>update the generated
content</span> of all of that node's <a href="#data-tree" title=
"data tree user">data tree users</a> .</p>
<p>An element with a non-null <code title=
"dom-templateElement"><a href=
"#templateelement">templateElement</a></code> is also said to be a
<dfn id="template1">template tree user</dfn> of the node identified
by the element's <code title="dom-templateElement"><a href=
"#templateelement">templateElement</a></code> attribute, as well as
all of that node's children.</p>
<p>Nodes that have one or more <a href="#template1" title=
"template tree user">template tree users</a> associated with them
(as per the previous paragraph) are themselves termed <dfn id=
"template2" title="template tree component node">template tree
component nodes</dfn> .</p>
<p>Whenever a <a href="#template2">template tree component node</a>
changes its name or value, or has one of its attributes change name
or value, or has an attribute added or removed, or has a child
added or removed, the user agent must <span>update the generated
content</span> of all of that node's <a href="#template1" title=
"template tree user">template tree users</a> .</p>
<p class="note">In other words, user agents update the content
generated from a template whenever either the backing data changes
or the template itself changes.</p>
<h5 id="updating0"><span class="secno"><del class=
"diff-old">3.19.6.6.</del> <ins class=
"diff-chg">3.17.6.6.</ins></span> Updating the generated
content</h5>
<p>When the user agent is to <dfn id="update" title=
"datatemplate-regen">update the generated content</dfn> of an
element that uses a template, the user agent must run the following
steps:</p>
<ol>
<li>
<p>Let <var title="">destination</var> be the element whose
generated content is being updated.</p>
</li>
<li>
<p>If the <var title="">destination</var> element is <em>busy
loading the template rules or data</em> , then abort these steps.
Either the steps will be invoked again once the loading has
completed, or the loading will fail and the generated content will
be removed at that point.</p>
</li>
<li>
<p>Let <var title="">template tree</var> be the element given by
<var title="">destination</var> 's <code title=
"dom-templateElement"><a href=
"#templateelement">templateElement</a></code> DOM attribute. If it
is null, then abort these steps. There are no rules to apply.</p>
</li>
<li>
<p>Let <var title="">data tree</var> be the node given by
<var title="">destination</var> 's <code title=
"dom-refNode"><a href="#refnode">refNode</a></code> DOM attribute.
If it is null, then let <var title="">data tree</var> be the node
given by the <code title="dom-originalContent"><a href=
"#originalcontent">originalContent</a></code> DOM node.</p>
</li>
<li>
<p>Let <var title="">existing nodes</var> be a set of ordered lists
of nodes, each list being identified by a tuple consisting of a
node, a node type and name, and a <a href="#registrationmark"
title="attr-registrationmark">registration mark</a> (a string).</p>
</li>
<li>
<p>For each node <var title="">node</var> that is a descendant of
<var title="">destination</var> , if any, add <var title=
"">node</var> to the list identified by the tuple given by:
<var title="">node</var> 's <code title="dom-dataNode"><a href=
"#datanode">dataNode</a></code> DOM attribute; the <var title=
"">node</var> 's node type and, if it's an element, its qualified
name (that is, its namespace and local name), or, if it's a
processing instruction, its target name , and the value of the
<var title="">node</var> 's <code title=
"attr-registrationmark"><a href=
"#registrationmark">registrationmark</a></code> attribute, if it
has one, or the empty string otherwise.</p>
</li>
<li>
<p>Remove all the child nodes of <var title="">destination</var> ,
so that its child node list is empty.</p>
</li>
<li>
<p>Run the <a href="#levenberg">Levenberg data node algorithm</a>
(described below) using <var title="">destination</var> as the
destination node, <var title="">data tree</var> as the source node,
<var title="">template tree</var> as the rule container, the empty
string as the mode, and the <var title="">existing nodes</var>
lists as the lists of existing nodes.</p>
</li>
</ol>
<p>The Levenberg algorithm consists of two algorithms that invoke
each other recursively, the <a href="#levenberg">Levenberg data
node algorithm</a> and the <a href="#levenberg0">Levenberg template
node algorithm</a> . These algorithms use the data structures
<del class="diff-old">initialised</del> <ins class=
"diff-chg">initialized</ins> by the set of steps described
above.</p>
<p>The <dfn id="levenberg">Levenberg data node algorithm</dfn> is
as follows. It is always invoked with three DOM nodes, one string,
and a set of lists as arguments: the <var title="">destination
node</var> , the <var title="">source node</var> , the <var title=
"">rule container</var> , the <var title="">mode string</var> , and
the <var title="">existing nodes lists</var> respectively.</p>
<ol>
<li>
<p>Let <var title="">condition</var> be the first <code><a href=
"#rule">rule</a></code> element child of the <var title="">rule
container</var> element, or null if there aren't any.</p>
</li>
<li>
<p>If <var title="">condition</var> is null, follow these
substeps:</p>
<ol>
<li>
<p>If the <var title="">source node</var> is an element, then, for
each child <var title="">child node</var> of the <var title=
"">source node</var> element, in tree order, invoke the <a href=
"#levenberg">Levenberg data node algorithm</a> recursively, with
<var title="">destination node</var> , <var title="">child
node</var> , <var title="">rule container</var> , the empty string,
and <var title="">existing nodes lists</var> as the five arguments
respectively.</p>
</li>
<li>
<p>Abort the current instance of the <a href="#levenberg">Levenberg
data node algorithm</a> , returning to whatever algorithm invoked
it.</p>
</li>
</ol>
</li>
<li>
<p>Let <var title="">matches</var> be a boolean with the value
true.</p>
</li>
<li>
<p>If the <var title="">condition</var> element has a <code title=
"attr-rule-mode"><a href="#mode">mode</a></code> attribute, but the
value of that attribute is not a <span>mode match</span> for the
current <span>mode string</span> , then let <var title=
"">matches</var> be false.</p>
</li>
<li>
<p>If the <var title="">condition</var> element has a <code title=
"attr-rule-condition"><a href="#condition">condition</a></code>
attribute, and the attribute's value, when <a href=
"#evaluated">evaluated as a selector</a> , does not match the
current <var title="">source node</var> , then let <var title=
"">matches</var> be false.</p>
</li>
<li>
<p>If <var title="">matches</var> is true, then follow these
substeps:</p>
<ol>
<li>
<p>For each child <var title="">child node</var> of the <var title=
"">condition</var> element, in tree order, invoke the <a href=
"#levenberg0">Levenberg template node algorithm</a> recursively,
with the five arguments being <var title="">destination node</var>
, <var title="">source node</var> , <var title="">rule
container</var> , <var title="">child node</var> , and <var title=
"">existing nodes lists</var> respectively.</p>
</li>
<li>
<p>Abort the current instance of the <a href="#levenberg">Levenberg
data node algorithm</a> , returning to whatever algorithm invoked
it.</p>
</li>
</ol>
</li>
<li>
<p>Let <var title="">condition</var> be the next <code><a href=
"#rule">rule</a></code> element that is a child of the <var title=
"">rule container</var> element, after the <var title=
"">condition</var> element itself, or null if there are no more
<code><a href="#rule">rule</a></code> elements.</p>
</li>
<li>
<p>Jump to step 2 in this set of steps.</p>
</li>
</ol>
<p>The <dfn id="levenberg0">Levenberg template node algorithm</dfn>
is as follows. It is always invoked with four DOM nodes and a set
of lists as arguments: the <var title="">destination node</var> ,
the <var title="">source node</var> , the <var title="">rule
container</var> , the <var title="">template node</var> , and the
<var title="">existing nodes lists</var> respectively.</p>
<ol>
<li>
<p>If <var title="">template node</var> is a comment node, abort
the current instance of the <a href="#levenberg0">Levenberg
template node algorithm</a> , returning to whatever algorithm
invoked it.</p>
</li>
<li>
<p>If <var title="">template node</var> is a <code><a href=
"#nest">nest</a></code> element, then run these substeps:</p>
<ol>
<li>
<p>If <var title="">source node</var> is not an element, then abort
the current instance of the <a href="#levenberg0">Levenberg
template node algorithm</a> , returning to whatever algorithm
invoked it.</p>
</li>
<li>
<p>If the <var title="">template node</var> has a <code title=
"attr-nest-mode"><a href="#mode1">mode</a></code> attribute, then
let <var title="">mode</var> be the value of that attribute;
otherwise, let <var title="">mode</var> be the empty string.</p>
</li>
<li>
<p>Let <var title="">child node</var> be the first child of the
<var title="">source node</var> element, or null if <var title=
"">source node</var> has no children.</p>
</li>
<li>
<p>If <var title="">child node</var> is null, abort the current
instance of the <a href="#levenberg0">Levenberg template node
algorithm</a> , returning to whatever algorithm invoked it.</p>
</li>
<li>
<p>If the <var title="">template node</var> element has a
<code title="attr-nest-filter"><a href="#filter">filter</a></code>
attribute, and the attribute's value, when <a href=
"#evaluated">evaluated as a selector</a> , matches <var title=
"">child node</var> , then invoke the <a href=
"#levenberg">Levenberg data node algorithm</a> recursively, with
<var title="">destination node</var> , <var title="">child
node</var> , <var title="">rule container</var> , <var title=
"">mode</var> , and <var title="">existing nodes lists</var> as the
five arguments respectively.</p>
</li>
<li>
<p>Let <var title="">child node</var> be <var title="">child
node</var> 's next sibling, or null if <var title="">child
node</var> was the last node of <var title="">source node</var>
.</p>
</li>
<li>
<p>Return to step 4 in this set of substeps.</p>
</li>
</ol>
</li>
<li>
<p>If <var title="">template node</var> is an element, and that
element has a <code title="attr-registrationmark"><a href=
"#registrationmark">registrationmark</a></code> attribute, then let
<var title="">registration mark</var> have the value of that
attribute. Otherwise, let <var title="">registration mark</var> be
the empty string.</p>
</li>
<li>
<p>If there is a list in the <var title="">existing nodes
lists</var> corresponding to the tuple ( <var title="">source
node</var> , the node type and name of <var title="">template
node</var> , <var title="">registration mark</var> ), and that list
is not empty, then run the following substeps. (For an element
node, the name of the node is its qualified tag name, i.e. its
namespace and local name. For a processing instruction, its name is
the target. For other types of nodes, there is no name.)</p>
<ol>
<li>
<p>Let <var title="">new node</var> be the first node in that
list.</p>
</li>
<li>
<p>Remove <var title="">new node</var> from that list.</p>
</li>
<li>
<p>If <var title="">new node</var> is an element, remove all the
child nodes of <var title="">new node</var> , so that its child
node list is empty.</p>
</li>
</ol>
<p>Otherwise, if there is no matching list, or there was, but it is
now empty, then run these steps instead:</p>
<ol>
<li>
<p>Let <var title="">new node</var> be a shallow clone of
<var title="">template node</var> .</p>
</li>
<li>
<p>Let <var title="">new node</var> 's <code title=
"dom-dataNode"><a href="#datanode">dataNode</a></code> DOM
attribute be <var title="">source node</var> .</p>
</li>
</ol>
</li>
<li>
<p>If <var title="">new node</var> is an element, run these
substeps:</p>
<ol>
<li>
<p>For each attribute on <var title="">new node</var> , if an
attribute with the same qualified name is not present on
<var title="">template node</var> , remove that attribute.</p>
</li>
<li>
<p>For each attribute <var title="">attribute</var> on <var title=
"">template node</var> , run these substeps:</p>
<ol>
<li>
<p>Let <var title="">expanded</var> be the result of passing the
value of <var title="">attribute</var> to the <a href=
"#text-expansion">text expansion algorithm for templates</a> along
with <var title="">source node</var> .</p>
</li>
<li>
<p>If an attribute with the same qualified name as <var title=
"">attribute</var> is already present on <var title="">new
node</var> , then: if its value is different from <var title=
"">expanded</var> , replace its value with <var title=
"">expanded</var> .</p>
</li>
<li>
<p>Otherwise, if there is no attribute with the same qualified name
as <var title="">attribute</var> on <var title="">new node</var> ,
then add an attribute with the same namespace, prefix, and local
name as <var title="">attribute</var> , with its value set to
<var title="">expanded</var> 's.</p>
</li>
</ol>
</li>
</ol>
<p>Otherwise, the <var title="">new node</var> is a text node,
CDATA block, or PI. Run these substeps instead:</p>
<ol>
<li>
<p>Let <var title="">expanded</var> be the result of passing the
node value of <var title="">template node</var> (the content of the
text node, CDATA block, or PI) to the <a href=
"#text-expansion">text expansion algorithm for templates</a> along
with <var title="">source node</var> .</p>
</li>
<li>
<p>If the value of the <var title="">new node</var> is different
from <var title="">expanded</var> , then set the value of
<var title="">new node</var> to <var title="">expanded</var> .</p>
</li>
</ol>
</li>
<li>
<p>Append <var title="">new node</var> to <var title=
"">destination</var> .</p>
</li>
<li>
<p>If <var title="">template node</var> is an element, then, for
each child <var title="">child node</var> of the <var title=
"">template node</var> element, in tree order, invoke the <a href=
"#levenberg0">Levenberg template node algorithm</a> recursively,
with the five arguments being <var title="">new child</var> ,
<var title="">source node</var> , <var title="">rule
container</var> , <var title="">child node</var> , and <var title=
"">existing nodes lists</var> respectively.</p>
</li>
</ol>
<p class="big-issue">Define: <dfn id="evaluated">evaluated as a
selector</dfn></p>
<p class="big-issue">Define: <dfn id="text-expansion">text
expansion algorithm for templates</dfn></p>
<h3 id="miscellaneous"><span class="secno"><del class=
"diff-old">3.20.</del> <ins class="diff-chg">3.18</ins></span>
Miscellaneous elements</h3>
<h4 id="the-legend"><span class="secno"><del class=
"diff-old">3.20.1.</del> <ins class="diff-chg">3.18.1</ins></span>
The <dfn id="legend"><code>legend</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>As the first child of a <code>fieldset</code> element.</dd>
<dd>As the first child of a <code><a href=
"#details">details</a></code> element.</dd>
<dd>As a child of a <code><a href="#figure">figure</a></code>
element, if there are no other <code><a href=
"#legend">legend</a></code> element children of that element.</dd>
<dt>Content model:</dt>
<dd><a href="#phrasing0">Phrasing content</a> .</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#legend">legend</a></code> element represents
a title or explanatory caption for the rest of the contents of the
<code><a href="#legend">legend</a></code> element's parent
element.</p>
<h4 id="the-div"><span class="secno"><del class=
"diff-old">3.20.2.</del> <ins class="diff-chg">3.18.2</ins></span>
The <dfn id="div"><code>div</code></dfn> element</h4>
<dl class="element">
<dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element may be used:</dt>
<dd>Where <del class="diff-old">prose</del> <a href=
"#flow-content0"><ins class="diff-chg">flow</ins> content</a> is
expected.</dd>
<dt>Content model:</dt>
<dd><del class="diff-old">Prose</del> <a href=
"#flow-content0"><ins class="diff-chg">Flow</ins> content</a>
.</dd>
<dt>Element-specific attributes:</dt>
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd><del class="diff-old">No difference from</del> <ins class=
"diff-chg">Uses</ins> <code><a href=
"#htmlelement">HTMLElement</a></code> .</dd>
</dl>
<p>The <code><a href="#div">div</a></code> element represents
nothing at all. It can be used with the <code title=
"attr-class"><a href="#class">class</a></code> , <code title=
"attr-lang"><a href="#lang">lang</a></code> / <code title=
"attr-xml-lang"><a href="#xmllang">xml:lang</a></code> , and
<code title="attr-title"><a href="#title">title</a></code>
attributes to mark up semantics common to a group of consecutive
elements.</p>
<p class="big-issue">Allowing <code><a href="#div">div</a></code>
elements to contain phrasing content makes it easy for authors to
abuse <code><a href="#div">div</a></code> , using it with the
<code>class=""</code> attribute to the point of not having any
other elements in the markup. This is a disaster from an
accessibility point of view, and it would be nice if we could
somehow make such pages non-compliant without preventing people
from using <code><a href="#div">div</a></code> s as the extension
mechanism that they are, to handle things the spec can't otherwise
do (like making new widgets).</p>
<h2 id="web-browsers"><span class="secno">4.</span> Web
browsers</h2>
<p>This section describes features that apply most directly to Web
browsers. Having said that, unless specified elsewhere, the
requirements defined in this section <em>do</em> apply to all user
agents, whether they are Web browsers or not.</p>
<h3 id="windows"><span class="secno"><del class=
"diff-old">4.1.</del> <ins class="diff-chg">4.1</ins></span>
Browsing contexts</h3>
<p>A <dfn id="browsing1">browsing context</dfn> is a collection of
one or more <code>Document</code> objects, and one or more <a href=
"#view" title="view">views</a> .</p>
<p>At any one time, one of the <code>Document</code> s in a
<a href="#browsing1">browsing context</a> is the <dfn id=
"active">active document</dfn> . The collection of
<code>Document</code> s is the <a href="#browsing1">browsing
context</a> 's <a href="#session">session history</a> .</p>
<p>A <dfn id="view">view</dfn> is a user agent interface tied to a
particular media used for the presentation of <code>Document</code>
objects in some media. A view may be interactive. Each view is
represented by an <code>AbstractView</code> object. Each view
belongs to a <a href="#browsing1">browsing context</a> . <a href=
"#references">[DOM2VIEWS]</a></p>
<p class="note">The <code title="">document</code> attribute of an
<code>AbstractView</code> object representing a <a href=
"#view">view</a> gives the <code>Document</code> object of the
view's <a href="#browsing1">browsing context</a> 's <a href=
"#active">active document</a> . <a href=
"#references">[DOM2VIEWS]</a></p>
<p class="note">Events that use the <code>UIEvent</code> interface
are related to a specific <a href="#view">view</a> (the view in
which the event happened); the <code>AbstractView</code> of that
view is given in the event object's <code title="">view</code>
attribute. <a href="#references">[DOM3EVENTS]</a></p>
<p class="note">A typical Web browser has one obvious <a href=
"#view">view</a> per <a href="#browsing1">browsing context</a> :
the browser's window (screen media). If a page is printed, however,
a second view becomes evident, that of the print media. The two
views always share the same underlying <code>Document</code> , but
they have a different presentation of that document. A speech
browser also establishes a browsing context, one with a view in the
speech media.</p>
<p class="note">A <code>Document</code> does not necessarily have a
<a href="#browsing1">browsing context</a> associated with it. In
particular, data mining tools are likely to never instantiate
browsing contexts.</p>
<p>The main <a href="#view">view</a> through which a user primarily
interacts with a user agent is the <dfn id="default3">default
view</dfn> .</p>
<p class="note">The <a href="#default3">default view</a> of a
<code>Document</code> is given by the <code title=
"">defaultView</code> attribute on the <code>Document</code>
object's <code>DocumentView</code> interface. <a href=
"#references">[DOM3VIEWS]</a></p>
<p>When a <a href="#browsing1">browsing context</a> is first
created, it must be created with a single <code>Document</code> in
its session history, whose <span title=
"the document's address">address</span> is <code>about:blank</code>
, which is marked as being an <a href="#html-" title=
"HTML documents">HTML <del class="diff-old">documents .</del>
<ins class="diff-chg">document</ins></a> ,<ins class="diff-chg">and
whose</ins> <a href="#character1" title=
"document's character encoding"><ins class="diff-chg">character
encoding</ins></a> <ins class="diff-chg">is UTF-8.</ins> The
<code>Document</code> must have a single child <code><a href=
"#html">html</a></code> node, which itself has a single child
<code><a href="#body0">body</a></code> node. If the <a href=
"#browsing1">browsing context</a> is created specifically to be
immediately navigated, then that initial navigation will have
<a href="#replacement">replacement enabled</a> .</p>
<p id="about-blank-origin"><ins class="diff-new">The</ins> <a href=
"#origin0"><ins class="diff-new">origin</ins></a> <ins class=
"diff-new">of the</ins> <code><ins class=
"diff-new">about:blank</ins></code> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">is set when
the</ins> <code><ins class="diff-new">Document</ins></code>
<ins class="diff-new">is created, in a manner dependent on whether
the</ins> <a href="#browsing1"><ins class="diff-new">browsing
context</ins></a> <ins class="diff-new">created is a</ins> <a href=
"#nested0"><ins class="diff-new">nested browsing context</ins></a>
,<ins class="diff-new">as follows:</ins></p>
<dl class="switch">
<dt><ins class="diff-new">If the new</ins> <a href=
"#browsing1"><ins class="diff-new">browsing context</ins></a>
<ins class="diff-new">is a</ins> <a href="#nested0"><ins class=
"diff-new">nested browsing context</ins></a></dt>
<dd><ins class="diff-new">The</ins> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> <ins class="diff-new">of the</ins>
<code><ins class="diff-new">about:blank</ins></code>
<code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">is the</ins> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> <ins class="diff-new">of the</ins>
<a href="#active"><ins class="diff-new">active document</ins></a>
<ins class="diff-new">of the new</ins> <a href=
"#browsing1"><ins class="diff-new">browsing context</ins></a>
<ins class="diff-new">'s</ins> <a href="#parent"><ins class=
"diff-new">parent browsing context</ins></a> <ins class=
"diff-new">at the time of its creation.</ins></dd>
<dt><ins class="diff-new">If the new</ins> <a href=
"#browsing1"><ins class="diff-new">browsing context</ins></a>
<ins class="diff-new">is an</ins> <a href="#auxiliary0"><ins class=
"diff-new">auxiliary browsing context</ins></a></dt>
<dd><ins class="diff-new">The</ins> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> <ins class="diff-new">of the</ins>
<code><ins class="diff-new">about:blank</ins></code>
<code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">is the</ins> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> <ins class="diff-new">of the</ins>
<a href="#active"><ins class="diff-new">active document</ins></a>
<ins class="diff-new">of the new</ins> <a href=
"#browsing1"><ins class="diff-new">browsing context</ins></a>
<ins class="diff-new">'s</ins> <a href="#opener"><ins class=
"diff-new">opener browsing context</ins></a> <ins class=
"diff-new">at the time of the new browsing context's
creation.</ins></dd>
<dt><ins class="diff-new">Otherwise</ins></dt>
<dd><ins class="diff-new">The</ins> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> <ins class="diff-new">of the</ins>
<code><ins class="diff-new">about:blank</ins></code>
<code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">is a globally unique identifier assigned when the
new</ins> <a href="#browsing1"><ins class="diff-new">browsing
context</ins></a> <ins class="diff-new">is created.</ins></dd>
</dl>
<h4 id="nested"><span class="secno"><del class=
"diff-old">4.1.1.</del> <ins class="diff-chg">4.1.1</ins></span>
Nested browsing contexts</h4>
<p>Certain elements (for example, <code><a href=
"#iframe">iframe</a></code> elements) can instantiate further
<a href="#browsing1" title="browsing context">browsing contexts</a>
. These are called <dfn id="nested0" title=
"nested browsing context">nested browsing contexts</dfn> . If a
browsing context <var title="">P</var> has an element in one of its
<code>Document</code> s <var title="">D</var> that nests another
browsing context <var title="">C</var> inside it, then <var title=
"">P</var> is said to be the <dfn id="parent">parent browsing
context</dfn> of <var title="">C</var> , <var title="">C</var> is
said to be a <dfn id="child">child browsing context</dfn> of
<var title="">P</var> , and <var title="">C</var> is said to be
<dfn id="nested1" title="browsing context nested through">nested
through</dfn> <var title="">D</var> .</p>
<p><ins class="diff-new">A browsing context</ins> <var title=
""><ins class="diff-new">A</ins></var> <ins class="diff-new">is
said to be an ancestor of a browsing context</ins> <var title=
""><ins class="diff-new">B</ins></var> <ins class="diff-new">if
there exists a browsing context</ins> <var title=""><ins class=
"diff-new">A'</ins></var> <ins class="diff-new">that is a</ins>
<a href="#child"><ins class="diff-new">child browsing
context</ins></a> <ins class="diff-new">of</ins> <var title=
""><ins class="diff-new">A</ins></var> <ins class="diff-new">and
that is itself an ancestor of</ins> <var title=""><ins class=
"diff-new">B</ins></var> ,<ins class="diff-new">or if there is a
browsing context</ins> <var title=""><ins class=
"diff-new">P</ins></var> <ins class="diff-new">that is a</ins>
<a href="#child"><ins class="diff-new">child browsing
context</ins></a> <ins class="diff-new">of</ins> <var title=
""><ins class="diff-new">A</ins></var> <ins class="diff-new">and
that is the</ins> <a href="#parent"><ins class="diff-new">parent
browsing context</ins></a> <ins class="diff-new">of</ins>
<var title=""><ins class="diff-new">B</ins></var> .</p>
<p>The browsing context with no <a href="#parent">parent browsing
context</a> is the <dfn id="top-level">top-level browsing
context</dfn> of all the browsing contexts <a href="#nested0"
title="nested browsing context">nested</a> within it (either
directly or indirectly through other nested browsing contexts).</p>
<p><ins class="diff-new">The transitive closure of</ins> <a href=
"#parent" title="parent browsing context"><ins class=
"diff-new">parent browsing contexts</ins></a> <ins class=
"diff-new">for a</ins> <a href="#nested0"><ins class=
"diff-new">nested browsing context</ins></a> <ins class=
"diff-new">gives the list of</ins> <dfn id="ancestor" title=
"ancestor browsing context"><ins class="diff-new">ancestor browsing
contexts</ins></dfn> .</p>
<p>A <code>Document</code> is said to be <dfn id="fully">fully
active</dfn> when it is the <a href="#active">active document</a>
of its <a href="#browsing1">browsing context</a> , and either its
browsing context is a <a href="#top-level">top-level browsing
context</a> , or the <code>Document</code> <a href="#nested1"
title="browsing context nested through">through which</a> that
browsing context is <a href="#nested0" title=
"nested browsing context">nested</a> is itself <a href=
"#fully">fully active</a> .</p>
<p>Because they are nested through an element, <a href="#child"
title="child browsing context">child browsing contexts</a> are
always tied to a specific <code>Document</code> in their <a href=
"#parent">parent browsing context</a> . User agents must not allow
the user to interact with <a href="#child" title=
"child browsing context">child browsing contexts</a> of elements
that are in <code>Document</code> s that are not themselves
<a href="#fully">fully active</a> .</p>
<p><ins class="diff-new">A</ins> <a href="#nested0"><ins class=
"diff-new">nested browsing context</ins></a> <ins class=
"diff-new">can have a</ins> <a href="#seamless0"><ins class=
"diff-new">seamless browsing context flag</ins></a> <ins class=
"diff-new">set, if it is embedded through an</ins> <code><a href=
"#iframe"><ins class="diff-new">iframe</ins></a></code> <ins class=
"diff-new">element with a</ins> <code title=
"attr-iframe-seamless"><a href="#seamless"><ins class=
"diff-new">seamless</ins></a></code> <ins class=
"diff-new">attribute.</ins></p>
<h4 id="auxiliary"><span class="secno"><del class=
"diff-old">4.1.2.</del> <ins class="diff-chg">4.1.2</ins></span>
Auxiliary browsing contexts</h4>
<p>It is possible to create new browsing contexts that are related
to a <span>top level browsing context</span> without being nested
through an element. Such browsing contexts are called <dfn id=
"auxiliary0" title="auxiliary browsing context">auxiliary browsing
contexts</dfn> . Auxiliary browsing contexts are always <a href=
"#top-level" title="top-level browsing context">top-level browsing
contexts</a> .</p>
<p>An <a href="#auxiliary0">auxiliary browsing context</a> has an
<dfn id="opener">opener browsing context</dfn> , which is the
<a href="#browsing1">browsing context</a> from which the <a href=
"#auxiliary0">auxiliary browsing context</a> was created, and it
has a <dfn id="furthest">furthest ancestor browsing context</dfn> ,
which is the <a href="#top-level">top-level browsing context</a> of
the <a href="#opener">opener browsing context</a> when the <a href=
"#auxiliary0">auxiliary browsing context</a> was created.</p>
<p>The <dfn id="opener0" title=
"dom-opener"><code>opener</code></dfn> DOM attribute on the
<code><a href="#window">Window</a></code> object must return the
<code><a href="#window">Window</a></code> object of the <a href=
"#browsing1">browsing context</a> from which the current browsing
context was created (its <a href="#opener">opener browsing
context</a> ), if there is one and it is still available.</p>
<h4 id="secondary"><span class="secno"><del class=
"diff-old">4.1.3.</del> <ins class="diff-chg">4.1.3</ins></span>
Secondary browsing contexts</h4>
<p>User agents may support <dfn id="secondary0" title=
"secondary browsing context">secondary browsing contexts</dfn> ,
which are <a href="#browsing1" title="browsing context">browsing
contexts</a> that form part of the user agent's interface, apart
from the main content area.</p>
<h4 id="security2"><span class="secno"><ins class=
"diff-new">4.1.4</ins></span> <ins class=
"diff-new">Security</ins></h4>
<p><ins class="diff-new">A</ins> <a href="#browsing1"><ins class=
"diff-new">browsing context</ins></a> <var title=""><ins class=
"diff-new">A</ins></var> <ins class="diff-new">is</ins> <dfn id=
"allowed"><ins class="diff-new">allowed to navigate</ins></dfn>
<ins class="diff-new">a second</ins> <a href=
"#browsing1"><ins class="diff-new">browsing context</ins></a>
<var title=""><ins class="diff-new">B</ins></var> <ins class=
"diff-new">if one of the following conditions is true:</ins></p>
<ul>
<li><ins class="diff-new">Either the</ins> <a href=
"#origin0"><ins class="diff-new">origin</ins></a> <ins class=
"diff-new">of the</ins> <a href="#active"><ins class=
"diff-new">active document</ins></a> <ins class="diff-new">of</ins>
<var title=""><ins class="diff-new">A</ins></var> <ins class=
"diff-new">is the</ins> <a href="#same-origin" title=
"same origin"><ins class="diff-new">same</ins></a> <ins class=
"diff-new">as the</ins> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> <ins class="diff-new">of the</ins>
<a href="#active"><ins class="diff-new">active document</ins></a>
<ins class="diff-new">of</ins> <var title=""><ins class=
"diff-new">B</ins></var> ,<ins class="diff-new">or</ins></li>
<li><ins class="diff-new">The browsing context</ins> <var title=
""><ins class="diff-new">B</ins></var> <ins class=
"diff-new">an</ins> <a href="#auxiliary0"><ins class=
"diff-new">auxiliary browsing context</ins></a> <ins class=
"diff-new">and either its</ins> <a href="#opener"><ins class=
"diff-new">opener browsing context</ins></a> <ins class=
"diff-new">is</ins> <var title=""><ins class=
"diff-new">A</ins></var> <ins class="diff-new">or</ins> <var title=
""><ins class="diff-new">A</ins></var> <ins class=
"diff-new">is</ins> <a href="#allowed"><ins class=
"diff-new">allowed to navigate</ins></a> <var title=""><ins class=
"diff-new">B</ins></var> <ins class="diff-new">'s</ins> <a href=
"#opener"><ins class="diff-new">opener browsing context</ins></a>
,<ins class="diff-new">or</ins></li>
<li><ins class="diff-new">The browsing context</ins> <var title=
""><ins class="diff-new">B</ins></var> <ins class="diff-new">is not
a</ins> <a href="#top-level"><ins class="diff-new">top-level
browsing context</ins></a> ,<ins class="diff-new">but there exists
an</ins> <a href="#ancestor"><ins class="diff-new">ancestor
browsing context</ins></a> <ins class="diff-new">of</ins>
<var title=""><ins class="diff-new">B</ins></var> <ins class=
"diff-new">whose</ins> <a href="#active"><ins class=
"diff-new">active document</ins></a> <ins class="diff-new">has
the</ins> <a href="#same-origin" title="same origin"><ins class=
"diff-new">same</ins></a> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> <ins class="diff-new">as the</ins>
<a href="#active"><ins class="diff-new">active document</ins></a>
<ins class="diff-new">of</ins> <var title=""><ins class=
"diff-new">A</ins></var> <ins class="diff-new">(possibly in fact
being</ins> <var title=""><ins class="diff-new">A</ins></var>
<ins class="diff-new">itself).</ins></li>
</ul>
<h4 id="threads"><span class="secno"><del class=
"diff-old">4.1.4.</del> <ins class="diff-chg">4.1.5</ins></span>
Threads</h4>
<p>Each <a href="#browsing1">browsing context</a> is defined as
having a list of zero or more <dfn id="directly">directly reachable
browsing contexts</dfn> . These are:</p>
<ul>
<li>All the <a href="#browsing1">browsing context</a> 's <a href=
"#child" title="child browsing context">child browsing contexts</a>
.</li>
<li>The <a href="#browsing1">browsing context</a> 's <a href=
"#parent">parent browsing context</a> .</li>
<li>All the <a href="#browsing1" title="browsing context">browsing
contexts</a> that have the <a href="#browsing1">browsing
context</a> as their <a href="#opener">opener browsing context</a>
.</li>
<li>The <a href="#browsing1">browsing context</a> 's <a href=
"#opener">opener browsing context</a> .</li>
</ul>
<p>The transitive closure of all the <a href="#browsing1" title=
"browsing context">browsing contexts</a> that are <a href=
"#directly">directly reachable browsing contexts</a> <del class=
"diff-old">consists of</del> <ins class="diff-chg">forms</ins> a
<dfn id="unit-of">unit of related browsing contexts</dfn> .</p>
<p>All the executable code in a <a href="#unit-of">unit of related
browsing contexts</a> must execute on a single conceptual thread.
The dispatch of events fired by the user agent (e.g. in response to
user actions or network activity) and the execution of any scripts
associated with timers must be <del class=
"diff-old">serialised</del> <ins class="diff-chg">serialized</ins>
so that for each <a href="#unit-of">unit of related browsing
contexts</a> there is only one script being executed at a time.</p>
<h4 id="browsing"><span class="secno"><del class=
"diff-old">4.1.5.</del> <ins class="diff-chg">4.1.6</ins></span>
Browsing context names</h4>
<p>Browsing contexts can have a <dfn id="browsing2">browsing
context name</dfn> . By default, a browsing context has no name
(its name is not set).</p>
<p>A <dfn id="valid8">valid browsing context name</dfn> is any
string <ins class="diff-new">with at least one character</ins> that
does not start with a U+005F LOW LINE <del class=
"diff-old">character, or, a</del> <ins class="diff-chg">character.
(Names starting with an underscore are reserved for special
keywords.)</ins></p>
<p><ins class="diff-chg">A</ins> <dfn id="valid9"><ins class=
"diff-chg">valid browsing context name or keyword</ins></dfn>
<ins class="diff-chg">is any</ins> string that <ins class=
"diff-new">is either a</ins> <a href="#valid8"><ins class=
"diff-new">valid browsing context name</ins></a> <ins class=
"diff-new">or that</ins> case-insensitively matches one of:
<code title=""><ins class="diff-new">_blank</ins></code>
,<code title="">_self</code> , <code title="">_parent</code> , or
<code title="">_top</code> . <del class="diff-old">(Names starting
with an underscore are reserved for special keywords.)</del></p>
<p><dfn id="the-rules">The rules for <del class=
"diff-old">chosing</del> <ins class="diff-chg">choosing</ins> a
browsing context given a browsing context name</dfn> are as
follows. The rules assume that they are being applied in the
context of a <a href="#browsing1">browsing context</a> .</p>
<ol>
<li>
<p>If the given browsing context name is the empty string or
<code title="">_self</code> , then the chosen browsing context must
be the current one.</p>
</li>
<li>
<p>If the given browsing context name is <code title=
"">_parent</code> , then the chosen browsing context must be the
<a href="#parent"><em>parent</em> browsing context</a> of the
current one, unless there isn't one, in which case the chosen
browsing context must be the current browsing context.</p>
</li>
<li>
<p>If the given browsing context name is <code title="">_top</code>
, then the chosen browsing context must be the most <a href=
"#top-level">top-level browsing context</a> of the current one.</p>
</li>
<li>
<p>If the given browsing context name is not <code title=
"">_blank</code> and there exists a browsing context whose <a href=
"#browsing2" title="browsing context name">name</a> is the same as
the given browsing context name, and <del class="diff-old">one of
the following is true: Either the origin of that browsing context's
active document is the same as the origin of</del> the current
browsing <del class="diff-old">context's active document , Or that
browsing</del> context is <del class="diff-old">an auxiliary
browsing context and its opener browsing context</del> <a href=
"#allowed"><ins class="diff-chg">allowed to navigate</ins></a>
<del class="diff-old">is either the current browsing context or a
browsing context</del> that <del class="diff-old">the user agent
considers is closely enough related to the current</del> browsing
context, <del class="diff-old">Or that browsing context is not a
top-level browsing context ,</del> and the <del class=
"diff-old">origin of the active document of the parent browsing
context of that browsing context is the same as the origin of the
current browsing context's active document , ...and the</del> user
agent determines that the two browsing contexts are related enough
that it is ok if they reach each other, then that browsing context
must be the chosen one. If there are multiple matching browsing
contexts, the user agent should select one in some arbitrary
consistent manner, such as the most recently opened, most recently
focused, or more closely related.</p>
</li>
<li>
<p>Otherwise, a new browsing context is being requested, and what
happens depends on the user agent's configuration and/or
abilities:</p>
<dl>
<dt id="sandboxWindowOpen"><ins class="diff-new">If the current
browsing context has the</ins> <a href="#sandboxed"><ins class=
"diff-new">sandboxed navigation browsing context flag</ins></a>
<ins class="diff-new">set.</ins></dt>
<dd><ins class="diff-new">The user agent may offer to create a
new</ins> <a href="#top-level"><ins class="diff-new">top-level
browsing context</ins></a> <ins class="diff-new">or reuse an
existing</ins> <a href="#top-level"><ins class="diff-new">top-level
browsing context</ins></a> .<ins class="diff-new">If the user picks
one of those options, then the designated browsing context must be
the chosen one (the browsing context's name isn't set to the given
browsing context name). Otherwise (if the user agent doesn't offer
the option to the user, or if the user declines to allow a browsing
context to be used) there must not be a chosen browsing
context.</ins></dd>
<dt>If the user agent has been configured such that in this
instance it will create a new browsing context</dt>
<dd>A new <a href="#auxiliary0">auxiliary browsing context</a> must
be created, with the <a href="#opener">opener browsing context</a>
being the current one. If the given browsing context name is not
<code title="">_blank</code> , then the new auxiliary browsing
context's name must be the given browsing context name (otherwise,
it has no name). The chosen browsing context must be this new
browsing context. If it is immediately <a href="#navigate" title=
"navigate">navigated</a> , then the navigation will be done with
<a href="#replacement">replacement enabled</a> .</dd>
<dt>If the user agent has been configured such that in this
instance it will reuse the current browsing context</dt>
<dd>The chosen browsing context is the current browsing
context.</dd>
<dt>If the user agent has been configured such that in this
instance it will not find a browsing context</dt>
<dd>There must not be a chosen browsing context.</dd>
</dl>
<p><ins class="diff-new">User agent implementors are encouraged to
provide a way for users to configure the user agent to always reuse
the current browsing context.</ins></p>
</li>
</ol>
<h3 id="the-default0"><span class="secno"><del class=
"diff-old">4.2.</del> <ins class="diff-chg">4.2</ins></span> The
default view</h3>
<p>The <code>AbstractView</code> object of <a href="#default3"
title="default view">default views</a> must also implement the
<code><a href="#window">Window</a></code> object. <del class=
"diff-old">{</del></p>
<pre class="idl">
[NoInterfaceObject] interface <dfn id="window">Window</dfn> {
// the current browsing context
readonly attribute <a href="#window">Window</a> <a href=
"#window0" title="dom-window">window</a>;
readonly attribute <a href="#window">Window</a> <a href="#self"
title="dom-self">self</a>;
<del class="diff-old"> attribute DOMString ;
readonly attribute ;
readonly attribute ;
</del>
<ins class="diff-chg"> attribute DOMString <a href=
"#name9" title="dom-name">name</a>;
[PutForwards=href] readonly attribute <a href=
"#location2">Location</a> <a href="#location0" title=
"dom-document-location">location</a>;
readonly attribute <a href="#history2">History</a> <a href=
"#history1" title="dom-history">history</a>;
</ins>
readonly attribute <a href=
"#undomanager">UndoManager</a> <a href="#undomanager0" title=
"dom-undoManager">undoManager</a>;
<a href="#selection1">Selection</a> <a href="#getselection"
title="dom-getSelection">getSelection</a>();
// the user agent
readonly attribute <a href=
"#clientinformation">ClientInformation</a> <a href="#navigator"
title="dom-navigator">navigator</a>;
readonly attribute <a href="#storage0">Storage</a> <a href=
"#sessionstorage" title="dom-sessionStorage">sessionStorage</a>;
<del class="diff-old"> readonly attribute ;
</del>
<ins class="diff-chg"> readonly attribute <a href=
"#storage0">Storage</a> <a href="#localstorage" title=
"dom-localStorage">localStorage</a>;
</ins>
<a href="#database0">Database</a> <a href="#opendatabase" title=
"dom-opendatabase">openDatabase</a>(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize);
<del class="diff-old"> // modal user prompts
</del>
<ins class="diff-chg"> // user prompts
</ins>
void <a href="#alert" title=
"dom-alert">alert</a>(in DOMString message);
boolean <a href="#confirm" title=
"dom-confirm">confirm</a>(in DOMString message);
DOMString <a href="#prompt" title=
"dom-prompt">prompt</a>(in DOMString message);
DOMString <a href="#prompt" title=
"dom-prompt">prompt</a>(in DOMString message, in DOMString default);
void <a href="#print" title="dom-print">print</a>();
<ins class="diff-new"> any <a href="#showmodaldialog" title=
"dom-showModalDialog">showModalDialog</a>(in DOMString url);
any <a href="#showmodaldialog" title=
"dom-showModalDialog">showModalDialog</a>(in DOMString url, in any arguments);
void <a href="#shownotification" title=
"dom-showNotification">showNotification</a>(in DOMString title, in DOMString subtitle, in DOMString description);
void <a href="#shownotification" title=
"dom-showNotification">showNotification</a>(in DOMString title, in DOMString subtitle, in DOMString description, in VoidCallback onclick);
</ins>
// other browsing contexts
readonly attribute <a href="#window">Window</a> <a href="#frames"
title="dom-frames">frames</a>;
<del class="diff-old"> readonly attribute unsigned long ;
</del>
<ins class="diff-chg"> readonly attribute unsigned long <a href=
"#length6" title="dom-length">length</a>;
[IndexGetter] <a href="#window">Window</a> <a href="#xxx4index"
title="dom-XXX4">XXX4</a>(in unsigned long index);
</ins>
readonly attribute <a href="#window">Window</a> <a href=
"#opener0" title="dom-opener">opener</a>;
<a href="#window">Window</a> <a href="#open2" title=
"dom-open">open</a>();
<a href="#window">Window</a> <a href="#open2" title=
"dom-open">open</a>(in DOMString url);
<a href="#window">Window</a> <a href="#open2" title=
"dom-open">open</a>(in DOMString url, in DOMString target);
<a href="#window">Window</a> <a href="#open2" title=
"dom-open">open</a>(in DOMString url, in DOMString target, in DOMString features);
<a href="#window">Window</a> <a href="#open2" title=
"dom-open">open</a>(in DOMString url, in DOMString target, in DOMString features, in DOMString replace);
// <a href="#cross-document">cross-document messaging</a>
<del class="diff-old"> void (in DOMString message);
</del>
<ins class="diff-chg"> void <a href="#postmessage" title=
"dom-window-postMessage">postMessage</a>(in DOMString message, in DOMString targetOrigin);
</ins>
<del class="diff-old"> //
</del>
<ins class="diff-chg"> // <a href=
"#event4">event handler DOM attributes</a>
</ins>
attribute <span>EventListener</span> <a href="#onabort"
title="handler-onabort">onabort</a>;
attribute <span>EventListener</span> <a href=
"#onbeforeunload" title=
"handler-onbeforeunload">onbeforeunload</a>;
attribute <span>EventListener</span> <a href="#onblur"
title="handler-onblur">onblur</a>;
attribute <span>EventListener</span> <a href="#onchange"
title="handler-onchange">onchange</a>;
attribute <span>EventListener</span> <a href="#onclick"
title="handler-onclick">onclick</a>;
attribute <span>EventListener</span> <a href=
"#oncontextmenu" title="handler-oncontextmenu">oncontextmenu</a>;
attribute <span>EventListener</span> <a href=
"#ondblclick" title="handler-ondblclick">ondblclick</a>;
attribute <span>EventListener</span> <a href="#ondrag"
title="handler-ondrag">ondrag</a>;
attribute <span>EventListener</span> <a href=
"#ondragend" title="handler-ondragend">ondragend</a>;
attribute <span>EventListener</span> <a href=
"#ondragenter" title="handler-ondragenter">ondragenter</a>;
attribute <span>EventListener</span> <a href=
"#ondragleave" title="handler-ondragleave">ondragleave</a>;
attribute <span>EventListener</span> <a href=
"#ondragover" title="handler-ondragover">ondragover</a>;
attribute <span>EventListener</span> <a href=
"#ondragstart" title="handler-ondragstart">ondragstart</a>;
attribute <span>EventListener</span> <a href="#ondrop"
title="handler-ondrop">ondrop</a>;
attribute <span>EventListener</span> <a href="#onerror"
title="handler-onerror">onerror</a>;
attribute <span>EventListener</span> <a href="#onfocus"
title="handler-onfocus">onfocus</a>;
attribute <span>EventListener</span> <a href=
"#onkeydown" title="handler-onkeydown">onkeydown</a>;
attribute <span>EventListener</span> <a href=
"#onkeypress" title="handler-onkeypress">onkeypress</a>;
attribute <span>EventListener</span> <a href="#onkeyup"
title="handler-onkeyup">onkeyup</a>;
attribute <span>EventListener</span> <a href="#onload"
title="handler-onload">onload</a>;
attribute <span>EventListener</span> <a href=
"#onmessage" title="handler-onmessage">onmessage</a>;
attribute <span>EventListener</span> <a href=
"#onmousedown" title="handler-onmousedown">onmousedown</a>;
attribute <span>EventListener</span> <a href=
"#onmousemove" title="handler-onmousemove">onmousemove</a>;
attribute <span>EventListener</span> <a href=
"#onmouseout" title="handler-onmouseout">onmouseout</a>;
attribute <span>EventListener</span> <a href=
"#onmouseover" title="handler-onmouseover">onmouseover</a>;
attribute <span>EventListener</span> <a href=
"#onmouseup" title="handler-onmouseup">onmouseup</a>;
attribute <span>EventListener</span> <a href=
"#onmousewheel" title="handler-onmousewheel">onmousewheel</a>;
attribute <span>EventListener</span> <a href="#onresize"
title="handler-onresize">onresize</a>;
attribute <span>EventListener</span> <a href="#onscroll"
title="handler-onscroll">onscroll</a>;
attribute <span>EventListener</span> <a href="#onselect"
title="handler-onselect">onselect</a>;
<ins class=
"diff-new"> attribute <span>EventListener</span> <a href=
"#onstorage" title="handler-onstorage">onstorage</a>;
</ins>
attribute <span>EventListener</span> <a href="#onsubmit"
title="handler-onsubmit">onsubmit</a>;
attribute <span>EventListener</span> <a href="#onunload"
title="handler-onunload">onunload</a>;
};
</pre>
<p>The <dfn id="window0" title=
"dom-window"><code>window</code></dfn> , <dfn id="frames" title=
"dom-frames"><code>frames</code></dfn> , and <dfn id="self" title=
"dom-self"><code>self</code></dfn> DOM attributes must all return
the <code><a href="#window">Window</a></code> object itself.</p>
<p>The <code><a href="#window">Window</a></code> object also
provides the scope for script execution. Each <code>Document</code>
in a <a href="#browsing1">browsing context</a> has an associated
<dfn id="list-of2">list of added properties</dfn> which, when a
document is <a href="#active" title="active document">active</a> ,
are available on the <code>Document</code> 's <a href=
"#default3">default view</a> <code><a href=
"#window">Window</a></code> object. A <code>Document</code>
object's <a href="#list-of2">list of added properties</a> must be
empty when the <code>Document</code> object is created.</p>
<p>Objects implementing the <code><a href=
"#window">Window</a></code> interface must also implement the
<code>EventTarget</code> interface.</p>
<p class="note"><code><a href="#window">Window</a></code> objects
also <span title="dom-item">have an implicit [[Get]] method</span>
which returns <span>nested browsing contexts</span> .</p>
<h4 id="security3"><span class="secno"><del class=
"diff-old">4.2.1.</del> <ins class="diff-chg">4.2.1</ins></span>
Security</h4>
<p>User agents must raise a <a href="#security9">security
exception</a> whenever any of the members of a <code><a href=
"#window">Window</a></code> object are accessed by scripts whose
<a href="#effective3"><ins class="diff-chg">effective script</ins>
origin</a> is not the same as the <code><a href=
"#window">Window</a></code> object's <a href="#browsing1">browsing
context</a> 's <a href="#active">active document</a> 's <del class=
"diff-old">origin,</del> <a href="#effective3"><ins class=
"diff-chg">effective script origin</ins></a> , with the following
exceptions:</p>
<ul>
<li>The <code title="dom-location"><a href=
"#location1">location</a></code> object</li>
<li>The <code title="dom-window-postMessage"><a href=
"#postmessage">postMessage()</a></code> method</li>
<li><ins class="diff-new">The</ins> <code title=
"dom-window-frames"><ins class="diff-new">frames</ins></code>
<ins class="diff-new">attribute</ins></li>
<li><ins class="diff-new">The</ins> <code title="dom-XXX4"><a href=
"#xxx4index"><ins class="diff-new">XXX4</ins></a></code>
<ins class="diff-new">method</ins></li>
</ul>
<p>User agents must not allow scripts to override the <code title=
"dom-location"><a href="#location1">location</a></code> object's
setter.</p>
<h4 id="constructors"><span class="secno"><del class=
"diff-old">4.2.2.</del> <ins class="diff-chg">4.2.2</ins></span>
Constructors</h4>
<p>All <code><a href="#window">Window</a></code> objects must
provide the following constructors:</p>
<dl>
<dt><dfn id="audio2" title=
"dom-audio"><code>Audio()</code></dfn></dt>
<dt><dfn id="audio3" title="dom-audio-s"><code>Audio( <var title=
"">src</var> )</code></dfn></dt>
<dd>
<p>When invoked as constructors, these must return a new
<code><a href="#htmlaudioelement">HTMLAudioElement</a></code>
object (a new <code><a href="#audio1">audio</a></code> element). If
the <var title="src">src</var> argument is present, the object
created must have its <code title="dom-media-src"><a href=
"#src8">src</a></code> content attribute set to the provided value,
and the user agent must invoke the <code title=
"dom-media-load"><a href="#load">load()</a></code> method on the
object before returning.</p>
</dd>
<dt><dfn id="image0" title=
"dom-image"><code>Image()</code></dfn></dt>
<dt><dfn id="imagein" title="dom-image-w"><code>Image(in unsigned
long <var title="">w</var> )</code></dfn></dt>
<dt><dfn id="imagein0" title="dom-image-wh"><code>Image(in unsigned
long <var title="">w</var> , in unsigned long <var title="">h</var>
)</code></dfn></dt>
<dd>
<p>When invoked as <del class="diff-old">corstructors,</del>
<ins class="diff-chg">constructors,</ins> these must return a new
<code><a href="#htmlimageelement">HTMLImageElement</a></code>
object (a new <code><a href="#img">img</a></code> element). If the
<var title="">h</var> argument is present, the new object's
<code title="attr-img-height">height</code> content attribute must
be set to <var title="">h</var> . If the <var title="">w</var>
argument is present, the new object's <code title=
"attr-img-width">width</code> content attribute must be set to
<var title="">w</var> .</p>
</dd>
<dt><dfn id="option" title=
"dom-option"><code>Option()</code></dfn></dt>
<dt><dfn id="optionin" title="dom-option-n"><code>Option(in
DOMString <var title="">name</var> )</code></dfn></dt>
<dt><dfn id="optionin0" title="dom-option-nv"><code>Option(in
DOMString <var title="">name</var> , in DOMString <var title=
"">value</var> )</code></dfn></dt>
<dd>
<p>When invoked as constructors, these must return a new
<code>HTMLOptionElement</code> object (a new <code>option</code>
element). <span class="big-issue">need to define argument
processing</span></p>
</dd>
</dl>
<p class="big-issue">And when constructors are invoked but without
using the constructor syntax...?</p>
<h4 id="apis-for"><span class="secno"><del class=
"diff-old">4.2.3.</del> <ins class="diff-chg">4.2.3</ins></span>
APIs for creating and navigating browsing contexts by name</h4>
<p>The <dfn id="open2" title="dom-open"><code>open()</code></dfn>
method on <code><a href="#window">Window</a></code> objects
provides a mechanism for <a href="#navigate" title=
"navigate">navigating</a> an existing <a href="#browsing1">browsing
context</a> or opening and navigating an <a href=
"#auxiliary0">auxiliary browsing context</a> .</p>
<p>The method has four arguments, though they are all optional.</p>
<p>The first argument, <var title="">url</var> , gives a URI (or
IRI) for a page to load in the browsing context. If no arguments
are provided, then the <var title="">url</var> argument defaults to
" <code>about:blank</code> ". The argument must be resolved to an
absolute URI by <span class="big-issue">...</span></p>
<p>The second argument, <var title="">target</var> , specifies the
<a href="#browsing2" title="browsing context name">name</a> of the
browsing context that is to be navigated. It must be a <a href=
"#valid9">valid browsing context name <ins class="diff-new">or
keyword</ins></a> . If fewer than two arguments are provided, then
the <var title="">name</var> argument defaults to the value "
<code>_blank</code> ".</p>
<p>The third argument, <var title="">features</var> , has no effect
and is supported for historical reasons only.</p>
<p>The fourth argument, <var title="">replace</var> , specifies
whether or not the new page will <a href="#replacement" title=
"replacement enabled">replace</a> the page currently loaded in the
browsing context, when <var title="">target</var> identifies an
existing browsing context (as opposed to leaving the current page
in the browsing context's <a href="#session">session history</a> ).
When three or fewer arguments are provided, <var title=
"">replace</var> defaults to false.</p>
<p>When the method is invoked, the user agent must first select a
<a href="#browsing1">browsing context</a> to navigate by applying
<a href="#the-rules">the rules for <del class=
"diff-old">chosing</del> <ins class="diff-chg">choosing</ins> a
browsing context given a browsing context name</a> using the
<var title="">target</var> argument as the name and the <a href=
"#browsing1">browsing context</a> of the script as the context in
which the algorithm is executed, unless the user has indicated a
preference, in which case the browsing context to navigate may
instead be the one indicated by the user.</p>
<p class="example">For example, suppose there is a user agent that
supports control-clicking a link to open it in a new tab. If a user
clicks in that user agent on an element whose <code title=
"handler-onclick"><a href="#onclick">onclick</a></code> handler
uses the <code title="dom-open"><a href=
"#open2">window.open()</a></code> API to open a page in an iframe,
but, while doing so, holds the control key down, the user agent
could override the selection of the target browsing context to
instead target a new tab.</p>
<p>Then, the user agent must <a href="#navigate">navigate</a> the
selected <a href="#browsing1">browsing context</a> to the URI given
in <var title="">url</var> . If the <var title="">replace</var> is
true, then <a href="#replacement" title=
"replacement enabled">replacement must be enabled</a> ; otherwise,
it must not be enabled unless the <a href="#browsing1">browsing
context</a> was just created as part of the <a href=
"#the-rules">the rules for <del class="diff-old">chosing</del>
<ins class="diff-chg">choosing</ins> a browsing context given a
browsing context name</a> . <ins class="diff-new">The navigation
must be done with the</ins> <a href="#browsing1"><ins class=
"diff-new">browsing context</ins></a> <ins class=
"diff-new">corresponding to the</ins> <code><a href=
"#window"><ins class="diff-new">Window</ins></a></code> <ins class=
"diff-new">object that is the</ins> <a href="#script2"><ins class=
"diff-new">script execution context</ins></a> <ins class=
"diff-new">of the script that invoked the method as the</ins>
<a href="#source0"><ins class="diff-new">source browsing
context</ins></a> .</p>
<p class="note"><ins class="diff-new">If the</ins> <a href=
"#script2"><ins class="diff-new">script execution context</ins></a>
<ins class="diff-new">of a script isn't a</ins> <code><a href=
"#window"><ins class="diff-new">Window</ins></a></code> <ins class=
"diff-new">object, then it can't ever get to a</ins> <code><a href=
"#window"><ins class="diff-new">Window</ins></a></code> <ins class=
"diff-new">object to call this method.</ins></p>
<p>The method must return the <code><a href=
"#window">Window</a></code> object of the default view of the
<a href="#browsing1">browsing context</a> that was navigated, or
null if no browsing context was navigated.</p>
<p>The <dfn id="name9" title="dom-name"><code>name</code></dfn>
attribute of the <code><a href="#window">Window</a></code> object
must, on getting, return the current name of the <a href=
"#browsing1">browsing context</a> , and, on setting, set the name
of the <a href="#browsing1">browsing context</a> to the new
value.</p>
<p class="note">The name <a href="#resetBCName">gets reset</a> when
the browsing context is navigated to another domain.</p>
<h4 id="accessing"><span class="secno"><del class=
"diff-old">4.2.4.</del> <ins class="diff-chg">4.2.4</ins></span>
Accessing other browsing contexts</h4>
<p><del class="diff-old">In ECMAScript implementations, objects
that implement</del> <ins class="diff-chg">The</ins> <dfn id=
"length6" title="dom-length"><code><ins class=
"diff-chg">length</ins></code></dfn> <ins class="diff-chg">DOM
attribute on</ins> the <code><a href="#window">Window</a></code>
interface must <del class="diff-old">have a [[Get]] method that,
when invoked with a property name that is a number i ,
returns</del> <ins class="diff-chg">return</ins> the <del class=
"diff-old">i th</del> <ins class="diff-chg">number of</ins>
<a href="#child" title="child browsing context">child browsing
<del class="diff-old">context</del> <ins class=
"diff-chg">contexts</ins></a> of the <a href="#active" title=
"active document">active</a> <code>Document <del class="diff-old">,
sorted in document order of the elements nesting those browsing
contexts.</del></code> .</p>
<p>The <dfn id="xxx4index" title="dom-XXX4"><code><del class=
"diff-old">length</del> <ins class="diff-chg">XXX4(</ins>
<var title=""><ins class="diff-chg">index</ins></var> <ins class=
"diff-chg">)</ins></code></dfn> <del class="diff-old">DOM attribute
on the Window interface</del> <ins class="diff-chg">method</ins>
must return the <del class="diff-old">number of</del> <var title=
""><ins class="diff-chg">index</ins></var> <ins class=
"diff-chg">th</ins> <a href="#child">child browsing <del class=
"diff-old">contexts</del> <ins class="diff-chg">context</ins></a>
of the <a href="#active" title="active document">active</a>
<code>Document <del class="diff-old">.</del></code> , <ins class=
"diff-chg">sorted in document order of the elements nesting those
browsing contexts.</ins></p>
<h3 id="origin"><span class="secno"><del class=
"diff-old">4.3.</del> <ins class="diff-chg">4.3</ins></span>
<del class="diff-old">Scripting</del> <ins class=
"diff-chg">Origin</ins></h3>
<del class="diff-old">4.3.1. Running executable code</del>
<p><del class="diff-old">Various mechanisms can cause
author-provided executable code to run in</del> <ins class=
"diff-chg">The</ins> <dfn id="origin0"><ins class=
"diff-chg">origin</ins></dfn> <ins class="diff-chg">of a resource
and</ins> the <del class="diff-old">context</del> <dfn id=
"effective3"><ins class="diff-chg">effective script
origin</ins></dfn> of a <del class="diff-old">document. These
mechanisms include, but</del> <ins class="diff-chg">resource</ins>
are <del class="diff-old">probably not limited to: Processing</del>
<ins class="diff-chg">both either opaque identifiers or tuples
consisting</ins> of <ins class="diff-chg">a scheme component, a
host component, and a port component.</ins></p>
<p><ins class="diff-chg">These characteristics are defined as
follows:</ins></p>
<dl>
<dt><ins class="diff-chg">For URIs</ins></dt>
<dd>
<p><ins class="diff-chg">The</ins> <a href="#origin0"><ins class=
"diff-chg">origin</ins></a> <ins class="diff-chg">and</ins>
<a href="#effective3"><ins class="diff-chg">effective</ins> script
<ins class="diff-new">origin</ins></a> <del class=
"diff-old">elements. Processing</del> of <del class=
"diff-old">inline javascript:</del> <ins class="diff-chg">the URI
is whatever is returned by the following algorithm:</ins></p>
<ol>
<li>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">uri</ins></var> <ins class="diff-chg">be the URI for
which the</ins> <a href="#origin0"><ins class=
"diff-chg">origin</ins></a> <del class="diff-old">URIs (e.g.</del>
<ins class="diff-chg">is being determined.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Parse</ins> <var title=""><ins class=
"diff-chg">uri</ins></var> <ins class="diff-chg">according to</ins>
the <del class="diff-old">src</del> <ins class="diff-chg">rules
described in RFC 3986 and RFC 3987.</ins> <a href=
"#references"><ins class="diff-chg">[RFC3986]</ins></a> <del class=
"diff-old">attribute of img</del> <a href="#references"><ins class=
"diff-chg">[RFC3987]</ins></a> <del class="diff-old">elements, or
an</del></p>
</li>
<li>
<p><ins class="diff-chg">If</ins> <var title=""><ins class=
"diff-chg">uri</ins></var> <ins class="diff-chg">does not use a
server-based naming authority, then return a new globally unique
identifier.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">scheme</ins></var> <ins class="diff-chg">be the
<scheme> component of the URI, converted to lowercase. If the
UA doesn't support the given protocol, then return a new globally
unique identifier.</ins></p>
</li>
<li>
<p><ins class="diff-chg">If the scheme is "</ins> <code title=
""><del class="diff-old">@import</del> <ins class=
"diff-chg">file</ins></code> <del class="diff-old">rule in</del>
<ins class="diff-chg">", then the user agent may return</ins> a
<del class="diff-old">CSS style element block).</del> <ins class=
"diff-chg">UA-specific value.</ins></p>
</li>
<li><del class="diff-old">Event handlers, whether registered
through</del>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">host</ins></var> <ins class="diff-chg">be</ins> the
<del class="diff-old">DOM using addEventListener() , by explicit
event handler content attributes , by event handler DOM attributes
, or otherwise.</del> <ins class=
"diff-chg"><host>/<ihost> component of the
URI.</ins></p>
</li>
<li><del class="diff-old">Processing</del>
<p><ins class="diff-chg">Apply the IDNA ToASCII algorithm to</ins>
<var title=""><ins class="diff-chg">host</ins></var> ,<ins class=
"diff-chg">with both the AllowUnassigned and UseSTD3ASCIIRules
flags set. Let</ins> <var title=""><ins class=
"diff-chg">host</ins></var> <ins class="diff-chg">be the
result</ins> of <del class="diff-old">technologies like XBL or SVG
that have their own scripting features.</del> <ins class=
"diff-chg">the ToASCII algorithm.</ins></p>
<p><del class="diff-old">User agents may provide a mechanism</del>
<ins class="diff-chg">If ToASCII fails</ins> to <del class=
"diff-old">enable or disable</del> <ins class="diff-chg">convert
one of</ins> the <del class="diff-old">execution</del> <ins class=
"diff-chg">components</ins> of <del class=
"diff-old">author-provided code. When</del> the <del class=
"diff-old">user agent</del> <ins class="diff-chg">string, e.g.
because it</ins> is <del class="diff-old">configured such that
author-provided code does not execute,</del> <ins class=
"diff-chg">too long</ins> or <del class="diff-old">if the user
agent is implemented so as to never execute author-provided
code,</del> <ins class="diff-chg">because</ins> it <del class=
"diff-old">is said that scripting is disabled . When
author-provided code does execute, scripting is enabled . A user
agent with scripting disabled is</del> <ins class=
"diff-chg">contains invalid characters, then return</ins> a
<del class="diff-old">user agent with no scripting support</del>
<ins class="diff-chg">new globally unique identifier.</ins>
<a href="#references"><ins class="diff-chg">[RFC3490]</ins></a>
<del class="diff-old">for the purposes of conformance.</del>
<del class="diff-old">4.3.2. Origin</del></p>
</li>
<li>
<p><del class="diff-old">Access</del> <ins class=
"diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">host</ins></var> <ins class="diff-chg">be the result of
converting</ins> <var title=""><ins class=
"diff-chg">host</ins></var> to <del class="diff-old">certain
APIs</del> <ins class="diff-chg">lowercase.</ins></p>
</li>
<li>
<p><ins class="diff-chg">If no port</ins> is <del class=
"diff-old">granted or denied to scripts based on</del> <ins class=
"diff-chg">explicitly listed, then let</ins> <var title=
""><ins class="diff-chg">port</ins></var> <ins class=
"diff-chg">be</ins> the <del class="diff-old">origin</del>
<ins class="diff-chg">default port for the protocol given by</ins>
<var title=""><ins class="diff-chg">scheme</ins></var> .<ins class=
"diff-chg">Otherwise, let</ins> <var title=""><ins class=
"diff-chg">port</ins></var> <ins class="diff-chg">be the
<port> component</ins> of the <del class="diff-old">script
and</del> <ins class="diff-chg">URI.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Return</ins> the <del class="diff-old">API
being accessed.</del> <ins class="diff-chg">tuple (</ins>
<var title=""><ins class="diff-chg">scheme</ins></var> ,<var title=
""><ins class="diff-chg">host</ins></var> ,<var title=
""><ins class="diff-chg">port</ins></var> <ins class=
"diff-chg">).</ins></p>
</li>
</ol>
</dd>
<dt><ins class="diff-chg">For scripts</ins></dt>
<dd>
<p>The <a href="#origin0"><ins class="diff-new">origin</ins></a>
<ins class="diff-new">and</ins> <a href="#effective3"><ins class=
"diff-new">effective script</ins> origin</a> of a script
<del class="diff-old">depends on</del> <ins class="diff-chg">are
determined from another resource, called</ins> the <del class=
"diff-old">context of that script:</del> <i><ins class=
"diff-chg">owner</ins></i> :</p>
<dl class="switch">
<dt>If a script is in a <code><a href="#script1">script</a></code>
element</dt>
<dd>The <del class="diff-old">origin of the script</del>
<ins class="diff-chg">owner</ins> is the <del class=
"diff-old">origin of the</del> <code>Document</code> to which the
<code><a href="#script1">script</a></code> element belongs.</dd>
<dt>If a script is a function or other code reference created by
another script</dt>
<dd>The <del class="diff-old">origin of</del> <ins class=
"diff-chg">owner is</ins> the script <ins class="diff-new">that
created it.</ins></dd>
<dt><ins class="diff-new">If a script</ins> is <ins class=
"diff-new">a</ins> <a href="#the-javascript" title=
"javascript protocol"><code title=""><ins class=
"diff-new">javascript:</ins></code> <ins class=
"diff-new">URI</ins></a> <ins class="diff-new">that was returned
as</ins> the <del class="diff-old">origin</del> <ins class=
"diff-chg">location</ins> of <ins class="diff-new">an HTTP redirect
(or equivalent in other protocols)</ins></dt>
<dd><ins class="diff-new">The owner is</ins> the <del class=
"diff-old">script</del> <ins class="diff-chg">URI</ins> that
<del class="diff-old">created it.</del> <ins class=
"diff-chg">redirected to the</ins> <a href="#the-javascript" title=
"javascript protocol"><code title=""><ins class=
"diff-chg">javascript:</ins></code> <ins class=
"diff-chg">URI</ins></a> .</dd>
<dt>If a script is a <a href="#the-javascript" title=
"javascript protocol"><code title="">javascript:</code> URI</a> in
an attribute</dt>
<dd>The <del class="diff-old">origin</del> <ins class=
"diff-chg">owner</ins> is the <del class="diff-old">origin of
the</del> <code>Document</code> of the element on which the
attribute is found.</dd>
<dt>If a script is a <a href="#the-javascript" title=
"javascript protocol"><code title="">javascript:</code> URI</a> in
a style sheet</dt>
<dd>The <del class="diff-old">origin</del> <ins class=
"diff-chg">owner</ins> is the <del class="diff-old">origin</del>
<ins class="diff-chg">URI</ins> of the <del class=
"diff-old">Document to which the</del> style <del class=
"diff-old">sheet applies.</del> <ins class=
"diff-chg">sheet.</ins></dd>
<dt>If a script is a <a href="#the-javascript" title=
"javascript protocol"><code title="">javascript:</code> URI</a> to
which a <a href="#browsing1">browsing context</a> is being <a href=
"#navigate" title="navigate">navigated</a> , the URI having been
provided by the user (e.g. by using a <i>bookmarklet</i> )</dt>
<dd>The <del class="diff-old">origin</del> <ins class=
"diff-chg">owner</ins> is the <del class="diff-old">origin of
the</del> <code>Document</code> of the <a href=
"#browsing1">browsing context</a> 's <a href="#active">active
document</a> .</dd>
<dt>If a script is a <a href="#the-javascript" title=
"javascript protocol"><code title="">javascript:</code> URI</a> to
which a <a href="#browsing1">browsing context</a> is being <a href=
"#navigate" title="navigate">navigated</a> , the URI having been
declared in markup</dt>
<dd>The <del class="diff-old">origin</del> <ins class=
"diff-chg">owner</ins> is the <del class="diff-old">origin of
the</del> <code>Document</code> of the element (e.g. an
<code><a href="#a">a</a></code> or <code><a href=
"#area">area</a></code> element) that declared the URI.</dd>
<dt>If a script is a <a href="#the-javascript" title=
"javascript protocol"><code title="">javascript:</code> URI</a> to
which a <a href="#browsing1">browsing context</a> is being <a href=
"#navigate" title="navigate">navigated</a> , the URI having been
provided by script</dt>
<dd>The <del class="diff-old">origin</del> <ins class=
"diff-chg">owner</ins> is the <del class="diff-old">origin of
the</del> script that provided the URI.</dd>
</dl>
<p>The <a href="#origin0">origin</a> of <del class=
"diff-old">scripts thus comes down</del> <ins class="diff-chg">the
script is then equal</ins> to <del class="diff-old">finding</del>
the <a href="#origin0"><ins class="diff-new">origin</ins></a>
<ins class="diff-new">of the owner, and the</ins> <a href=
"#effective3"><ins class="diff-new">effective script
origin</ins></a> <ins class="diff-new">of the script is equal to
the</ins> <a href="#effective3"><ins class="diff-new">effective
script</ins> origin</a> of <ins class="diff-new">the
owner.</ins></p>
</dd>
<dt><ins class="diff-new">For</ins> <code>Document</code>
<del class="diff-old">objects.</del> <ins class="diff-chg">objects
and images</ins></dt>
<dd>
<dl class="switch">
<dt id="sandboxOrigin"><ins class="diff-chg">If a</ins>
<code><ins class="diff-chg">Document</ins></code> <ins class=
"diff-chg">is in a</ins> <a href="#browsing1"><ins class=
"diff-chg">browsing context</ins></a> <ins class=
"diff-chg">whose</ins> <a href="#sandboxed2"><ins class=
"diff-chg">sandboxed origin browsing context flag</ins></a>
<ins class="diff-chg">is set</ins></dt>
<dd>The <a href="#origin0">origin</a> <ins class="diff-new">is a
globally unique identifier assigned when the</ins>
<code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">is created.</ins></dd>
<dt><ins class="diff-new">If a</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">or image was
returned by the</ins> <code><ins class=
"diff-new">XMLHttpRequest</ins></code> <ins class=
"diff-new">API</ins></dt>
<dd><ins class="diff-new">The</ins> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> <ins class="diff-new">and</ins>
<a href="#effective3"><ins class="diff-new">effective script
origin</ins></a> <ins class="diff-new">are equal to the</ins>
<a href="#origin0"><ins class="diff-new">origin</ins></a>
<ins class="diff-new">and</ins> <a href="#effective3"><ins class=
"diff-new">effective script origin</ins></a> <ins class=
"diff-new">of the</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">object that
was the</ins> <a href="#active"><ins class="diff-new">active
document</ins></a> of <ins class="diff-new">the</ins>
<code><a href="#window"><ins class=
"diff-new">Window</ins></a></code> <ins class="diff-new">object of
the browsing context from which the</ins> <code><ins class=
"diff-new">XMLHttpRequest</ins></code> <ins class=
"diff-new">constructor was invoked. (That is, they track the</ins>
<code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">to which the</ins> <code><ins class=
"diff-new">XMLHttpRequest</ins></code> <ins class=
"diff-new">object's</ins> <a href=
"http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#document-pointer">
<code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">pointer</ins></a> <ins class="diff-new">pointed when it
was created.)</ins> <a href="#references"><ins class=
"diff-new">[XHR]</ins></a></dd>
<dt><ins class="diff-new">If</ins> a <code>Document</code> or image
<ins class="diff-new">was generated from a</ins> <a href=
"#the-javascript" title="javascript protocol"><code><ins class=
"diff-new">javascript:</ins></code> <ins class=
"diff-new">URI</ins></a></dt>
<dd><ins class="diff-new">The</ins> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> <ins class="diff-new">is equal to
the</ins> <a href="#origin0"><ins class="diff-new">origin</ins></a>
<ins class="diff-new">of the script of</ins> that <a href=
"#the-javascript" title="javascript protocol"><code><ins class=
"diff-new">javascript:</ins></code> <ins class=
"diff-new">URI</ins></a> .</dd>
<dt><ins class="diff-new">If a</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">or
image</ins> was served over the network and <del class=
"diff-old">whose</del> <ins class="diff-chg">has an</ins> address
<ins class="diff-new">that</ins> uses a URI scheme with a
server-based naming authority</dt>
<dd><ins class="diff-new">The</ins> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> is the <del class="diff-old">tuple
consisting</del> <a href="#origin0"><ins class=
"diff-chg">origin</ins></a> of the <del class=
"diff-old"><scheme>, <host>/<ihost>, and
<port> parts</del> <ins class="diff-chg">full URI</ins> of
the <code>Document</code> <del class="diff-old">'s full URI.
[RFC3986] [RFC3987]</del> <ins class="diff-chg">or
image.</ins></dd>
<dt><ins class="diff-chg">If a</ins> <code><ins class=
"diff-chg">Document</ins></code> <ins class="diff-chg">or image was
generated from a</ins> <code title=""><ins class=
"diff-chg">data:</ins></code> <ins class="diff-chg">URI that was
returned as the location of an HTTP redirect (or equivalent in
other protocols)</ins></dt>
<dd>The <a href="#origin0">origin</a> <ins class="diff-new">is
the</ins> <a href="#origin0"><ins class="diff-new">origin</ins></a>
of <ins class="diff-new">the URI that redirected to the</ins>
<code title=""><ins class="diff-new">data:</ins></code> <ins class=
"diff-new">URI.</ins></dd>
<dt><ins class="diff-new">If</ins> a <code>Document</code> or image
<del class="diff-old">that</del> was generated from a <code title=
"">data:</code> URI found in another <code>Document</code> or in a
script</dt>
<dd><ins class="diff-new">The</ins> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> is the <a href="#origin0">origin</a> of
the <code>Document</code> or <del class="diff-old">script.</del>
<ins class="diff-chg">script in which the</ins> <code title=
""><ins class="diff-chg">data:</ins></code> <ins class=
"diff-chg">URI was found.</ins></dd>
<dt><ins class="diff-chg">If a</ins> <code><ins class=
"diff-chg">Document</ins></code> <ins class="diff-chg">has the URI
"</ins> <code><ins class="diff-chg">about:blank</ins></code>
<ins class="diff-chg">"</ins></dt>
<dd>The <a href="#origin0">origin</a> of <ins class=
"diff-new">the</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">is</ins>
<a href="#about-blank-origin"><ins class="diff-new">the</ins>
<span><ins class="diff-new">origin</ins></span> <ins class=
"diff-new">it was assigned when its browsing context was
created</ins></a> .</dd>
<dt><ins class="diff-new">If</ins> a <code>Document</code> or image
<del class="diff-old">that</del> was <del class=
"diff-old">generated from</del> <ins class="diff-chg">obtained in
some other manner (e.g. a</ins> <code title=""><ins class=
"diff-chg">data:</ins></code> <ins class="diff-chg">URI typed in by
the user,</ins> a <code><ins class="diff-new">Document</ins></code>
<ins class="diff-new">created using the</ins> <code title=
""><ins class="diff-new">createDocument()</ins></code> <ins class=
"diff-new">API, a</ins> <code title="">data:</code> URI <del class=
"diff-old">from another source</del> <ins class="diff-chg">returned
as the location of an HTTP redirect, etc)</ins></dt>
<dd><ins class="diff-chg">The</ins> <a href="#origin0"><ins class=
"diff-chg">origin</ins></a> is a globally unique identifier
assigned when the <del class="diff-old">document is created. The
origin of a</del> <code>Document</code> or image <del class=
"diff-old">that was generated from</del> <ins class="diff-chg">is
created.</ins></dd>
</dl>
<p><ins class="diff-chg">When</ins> a <code><del class=
"diff-old">javascript:</del> <ins class=
"diff-chg">Document</ins></code> <del class="diff-old">URI</del>
<ins class="diff-chg">is created, unless stated otherwise above,
its</ins> <a href="#effective3"><ins class="diff-chg">effective
script origin</ins></a> is <ins class="diff-new">initialized
to</ins> the <del class="diff-old">same as the</del> <a href=
"#origin0">origin</a> of <del class="diff-old">that</del>
<ins class="diff-chg">the</ins> <code><del class=
"diff-old">javascript:</del> <ins class=
"diff-chg">Document</ins></code> .<ins class="diff-chg">However,
the</ins> <code title="dom-document-domain"><a href=
"#domain"><ins class="diff-chg">document.domain</ins></a></code>
<del class="diff-old">URI.</del> <ins class="diff-chg">attribute
can be used to change it.</ins></p>
</dd>
</dl>
<p>The <dfn id="serialization0"><ins class="diff-new">serialization
of an origin</ins></dfn> <ins class="diff-new">is the</ins> string
<del class="diff-old">representing</del> <ins class=
"diff-chg">obtained by applying</ins> the <del class=
"diff-old">script's domain</del> <ins class="diff-chg">following
algorithm to the given</ins> <a href="#origin0"><ins class=
"diff-chg">origin</ins></a> :</p>
<ol>
<li><ins class="diff-chg">If the</ins> <a href=
"#origin0"><ins class="diff-chg">origin</ins></a> in <del class=
"diff-old">IDNA format</del> <ins class="diff-chg">question</ins>
is <del class="diff-old">obtained as follows: take</del>
<ins class="diff-chg">not a scheme/host/port tuple, then
return</ins> the <del class="diff-old">domain</del> <ins class=
"diff-chg">empty string.</ins></li>
<li><ins class="diff-chg">Otherwise, let</ins> <var title=
""><ins class="diff-chg">result</ins></var> <ins class=
"diff-chg">be the scheme</ins> part of the <del class=
"diff-old">script's</del> <a href="#origin0">origin</a> <del class=
"diff-old">tuple and apply</del> <ins class=
"diff-chg">tuple.</ins></li>
<li><ins class="diff-chg">Append</ins> the <del class=
"diff-old">IDNA ToASCII algorithm and then</del> <ins class=
"diff-chg">string "</ins> <code title="">://</code><ins class=
"diff-chg">" to</ins> <var title=""><ins class=
"diff-chg">result</ins></var> .</li>
<li><ins class="diff-chg">Apply</ins> the IDNA ToUnicode algorithm
to each component of the <del class="diff-old">domain name (with
both</del> <ins class="diff-chg">host part of</ins> the <del class=
"diff-old">AllowUnassigned and UseSTD3ASCIIRules flags set both
times). [RFC3490]</del> <a href="#origin0"><ins class=
"diff-chg">origin</ins></a> <del class="diff-old">If ToASCII
fails</del> <ins class="diff-chg">tuple, and append the results —
each component, in the same order, separated by U+002E FULL STOP
characters (".") —</ins> to <del class="diff-old">convert one
of</del> <var title=""><ins class="diff-chg">result</ins></var>
.</li>
<li><ins class="diff-chg">If</ins> the <del class=
"diff-old">components</del> <ins class="diff-chg">port part</ins>
of the <del class="diff-old">string, e.g. because it is too long or
because it contains invalid characters, or if the</del> <a href=
"#origin0">origin <del class="diff-old">of</del></a> <ins class=
"diff-chg">tuple gives a port that is different from</ins> the
<del class="diff-old">script has no domain part, then</del>
<ins class="diff-chg">default port for</ins> the <del class=
"diff-old">string representing</del> <ins class="diff-chg">protocol
given by</ins> the <del class="diff-old">script's domain in IDNA
format cannot be obtained. (ToUnicode is defined to never fail.)
It's been suggested that we should put IP addresses into</del>
<ins class="diff-chg">scheme part of</ins> the <a href=
"#origin0">origin</a> tuple, <del class="diff-old">to mitigate DNS
rebinding attacks. However that would kill multi-homed systems like
GMail. Should we do something like have</del> <ins class=
"diff-chg">then append</ins> a <del class="diff-old">DNS record say
whether or not to include</del> <ins class="diff-chg">U+003A COLON
character (":") and</ins> the <del class="diff-old">IP</del>
<ins class="diff-chg">given port,</ins> in <del class=
"diff-old">the origin for a host? 4.3.3. Unscripted same-origin
checks</del> <ins class="diff-chg">base ten, to</ins> <var title=
""><ins class="diff-chg">result</ins></var> .</li>
<li><ins class="diff-chg">Return</ins> <var title=""><ins class=
"diff-chg">result</ins></var> .</li>
</ol>
<p><del class="diff-old">When two URIs</del> <ins class=
"diff-chg">Two</ins> <a href="#origin0" title="origin"><ins class=
"diff-chg">origins</ins></a> are <ins class="diff-new">said</ins>
to be <del class="diff-old">compared to determine if they
have</del> the <dfn id="same-origin">same <del class=
"diff-old">scheme/host/port , it means that</del> <ins class=
"diff-chg">origin</ins></dfn> <ins class="diff-chg">if</ins> the
following algorithm <del class="diff-old">must be invoked, where
uri 1 and uri 2 are the two URIs.</del> <ins class=
"diff-chg">returns true:</ins></p>
<ol>
<li>
<p><del class="diff-old">First, both</del> <ins class=
"diff-chg">Let</ins> <var title=""><del class="diff-old">uri
1</del> <ins class="diff-chg">A</ins></var> <ins class=
"diff-new">be the first</ins> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> <ins class="diff-new">being
compared,</ins> and <var title=""><del class="diff-old">uri 2</del>
<ins class="diff-chg">B</ins></var> <del class=
"diff-old">must</del> be <del class="diff-old">normalized to
obtain</del> the <del class="diff-old">two tuples ( scheme 1 , host
1 ,</del> <ins class="diff-chg">second</ins> <a href=
"#origin0"><ins class="diff-chg">origin</ins></a> <ins class=
"diff-chg">being compared.</ins></p>
</li>
<li>
<p><ins class="diff-chg">If</ins> <var title=""><del class=
"diff-old">port 1</del> <ins class="diff-chg">A</ins></var>
<del class="diff-old">)</del> and <del class="diff-old">( scheme 2
,</del> <var title=""><del class="diff-old">host 2 , port 2</del>
<ins class="diff-chg">B</ins></var> <del class="diff-old">), by
applying the following subalgorithm to each URI:</del> <ins class=
"diff-chg">are both opaque identifiers, and their value is equal,
then return true.</ins></p>
</li>
<li>
<p><del class="diff-old">Let</del> <ins class="diff-chg">Otherwise,
if either</ins> <var title=""><del class="diff-old">uri</del>
<ins class="diff-chg">A</ins></var> <del class="diff-old">be the
URI being normalized.</del> <ins class="diff-chg">or</ins>
<var title=""><ins class="diff-chg">B</ins></var> <ins class=
"diff-chg">or both are opaque identifiers, return false.</ins></p>
</li>
<li>
<p><del class="diff-old">Parse</del> <ins class="diff-chg">If</ins>
<var title=""><del class="diff-old">uri</del> <ins class=
"diff-chg">A</ins></var> <del class="diff-old">according to the
rules described in RFC 3986</del> and <del class="diff-old">RFC
3987. [RFC3986] [RFC3987]</del> <var title=""><ins class=
"diff-chg">B</ins></var> <ins class="diff-chg">have scheme
components that are not identical, return false.</ins></p>
</li>
<li>
<p>If <var title=""><del class="diff-old">uri</del> <ins class=
"diff-chg">A</ins></var> <ins class="diff-chg">and</ins>
<var title=""><ins class="diff-chg">B</ins></var> <del class=
"diff-old">does not use a server-based naming authority, then fail
the overall algorithm — the two URIs do not</del> have <del class=
"diff-old">the same scheme/host/port.</del> <ins class=
"diff-chg">host components that are not identical, return
false.</ins></p>
</li>
<li>
<p><del class="diff-old">Let</del> <ins class="diff-chg">If</ins>
<var title=""><del class="diff-old">scheme</del> <ins class=
"diff-chg">A</ins></var> <del class="diff-old">be</del> <ins class=
"diff-chg">and</ins> <var title=""><ins class=
"diff-chg">B</ins></var> <ins class="diff-chg">have port components
that are not identical, return false.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Return true.</ins></p>
</li>
</ol>
<h4 id="relaxing"><span class="secno"><ins class=
"diff-chg">4.3.1</ins></span> <ins class="diff-chg">Relaxing</ins>
the <del class="diff-old"><scheme> component of</del>
<ins class="diff-chg">same-origin restriction</ins></h4>
<p><ins class="diff-chg">The</ins> <dfn id="domain" title=
"dom-document-domain"><code><ins class=
"diff-chg">domain</ins></code></dfn> <ins class=
"diff-chg">attribute on</ins> <code><ins class=
"diff-chg">Document</ins></code> <ins class="diff-chg">objects must
be initialized to</ins> <a href="#domain0">the <del class=
"diff-old">URI. If</del> <ins class="diff-chg">document's
domain</ins></a> ,<ins class="diff-chg">if it has one, and</ins>
the <del class="diff-old">UA doesn't support</del> <ins class=
"diff-chg">empty string otherwise. On getting,</ins> the
<del class="diff-old">given protocol, then fail</del> <ins class=
"diff-chg">attribute must return its current value, unless</ins>
the <del class="diff-old">overall algorithm —</del> <ins class=
"diff-chg">document was created by</ins> <code><ins class=
"diff-chg">XMLHttpRequest</ins></code> ,<ins class="diff-chg">in
which case it must throw an</ins> <code><ins class=
"diff-chg">INVALID_ACCESS_ERR</ins></code> <ins class=
"diff-chg">exception. On setting,</ins> the <del class=
"diff-old">two URIs do not have</del> <ins class="diff-chg">user
agent must run</ins> the <del class="diff-old">same
scheme/host/port .</del> <ins class="diff-chg">following
algorithm:</ins></p>
<ol>
<li>
<p><del class="diff-old">Let host be the <host>/<ihost>
component of</del> <ins class="diff-chg">If</ins> the <del class=
"diff-old">URI.</del> <ins class="diff-chg">document was created
by</ins> <code><ins class="diff-chg">XMLHttpRequest</ins></code>
,<ins class="diff-chg">throw an</ins> <code><ins class=
"diff-chg">INVALID_ACCESS_ERR</ins></code> <ins class=
"diff-chg">exception and abort these steps.</ins></p>
</li>
<li>
<p>Apply the IDNA ToASCII algorithm to <del class="diff-old">host
,</del> <ins class="diff-chg">the new value,</ins> with both the
AllowUnassigned and UseSTD3ASCIIRules flags set. Let <var title=
""><del class="diff-old">host</del> <ins class="diff-chg">new
value</ins></var> be the result of the ToASCII algorithm.</p>
<p>If ToASCII fails to convert one of the components of the string,
e.g. because it is too long or because it contains invalid
characters, then <del class="diff-old">fail the overall algorithm —
the two URIs do not have the same scheme/host/port.</del>
<ins class="diff-chg">throw a</ins> <a href=
"#security9"><ins class="diff-chg">security exception</ins></a>
<ins class="diff-chg">and abort these steps.</ins> <a href=
"#references">[RFC3490]</a></p>
</li>
<li>
<p>If <del class="diff-old">no port is explicitly listed, then
let</del> <var title=""><del class="diff-old">port</del>
<ins class="diff-chg">new value</ins></var> <del class=
"diff-old">be</del> <ins class="diff-chg">is not exactly equal
to</ins> the <del class="diff-old">default port for</del>
<ins class="diff-chg">current value of</ins> the <del class=
"diff-old">protocol given by scheme . Otherwise, let</del>
<code title="dom-document-domain"><a href="#domain"><ins class=
"diff-chg">document.domain</ins></a></code> <ins class=
"diff-chg">attribute, then run these substeps:</ins></p>
<ol>
<li>
<p><ins class="diff-chg">If the current value is an IP address,
throw a</ins> <a href="#security9"><ins class="diff-chg">security
exception</ins></a> <ins class="diff-chg">and abort these
steps.</ins></p>
</li>
<li>
<p><ins class="diff-chg">If</ins> <var title=""><del class=
"diff-old">port be</del> <ins class="diff-chg">new
value</ins></var> ,<ins class="diff-chg">prefixed by a U+002E FULL
STOP ("."), does not exactly match</ins> the <del class=
"diff-old"><port> component</del> <ins class=
"diff-chg">end</ins> of the <del class="diff-old">URI.</del>
<ins class="diff-chg">current value, throw a</ins> <a href=
"#security9"><ins class="diff-chg">security exception</ins></a>
<ins class="diff-chg">and abort these steps.</ins></p>
</li>
</ol>
</li>
<li>
<p><del class="diff-old">Return</del> <ins class=
"diff-chg">Set</ins> the <del class="diff-old">tuple ( scheme
,</del> <ins class="diff-chg">attribute's value to</ins>
<var title=""><ins class="diff-new">new value</ins></var> .</p>
</li>
<li>
<p><ins class="diff-new">Set the</ins> host <del class=
"diff-old">,</del> <ins class="diff-chg">part of the</ins> <a href=
"#effective3"><ins class="diff-chg">effective script
origin</ins></a> <ins class="diff-chg">tuple of the</ins>
<code><ins class="diff-chg">Document</ins></code> <ins class=
"diff-chg">to</ins> <var title=""><ins class="diff-new">new
value</ins></var> .</p>
</li>
<li>
<p><ins class="diff-new">Set the</ins> port <del class=
"diff-old">).</del> <ins class="diff-chg">part of the</ins>
<a href="#effective3"><ins class="diff-chg">effective script
origin</ins></a> <ins class="diff-chg">tuple of the</ins>
<code><ins class="diff-chg">Document</ins></code> <ins class=
"diff-chg">to "manual override" (a value that, for the purposes
of</ins> <a href="#same-origin" title="same origin"><ins class=
"diff-chg">comparing origins</ins></a> ,<ins class="diff-chg">is
identical to "manual override" but not identical to any other
value).</ins></p>
</li>
</ol>
<p><ins class="diff-new">The</ins> <dfn id="domain0" title=
"the document's domain"><ins class="diff-new">domain</ins></dfn>
<ins class="diff-new">of a</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">is the host
part of the document's</ins> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> ,<ins class="diff-new">if that is a
scheme/host/port tuple.</ins> If <del class="diff-old">scheme
1</del> <ins class="diff-chg">it isn't, then the document does not
have a domain.</ins></p>
<p class="note"><ins class="diff-chg">The</ins> <code title=
"dom-document-domain"><a href="#domain"><ins class=
"diff-chg">domain</ins></a></code> <ins class=
"diff-chg">attribute</ins> is <del class="diff-old">not
case-insensitively identical</del> <ins class="diff-chg">used</ins>
to <del class="diff-old">scheme 2</del> <ins class=
"diff-chg">enable pages on different hosts of a domain to access
each others' DOMs.</ins></p>
<h4 id="the-string"><del class="diff-old">,</del> <span class=
"secno"><ins class="diff-chg">4.3.2</ins></span> <ins class=
"diff-chg">The string representing the script's domain in IDNA
format</ins></h4>
<p><dfn id="the-string0"><ins class="diff-chg">The string
representing the script's domain in IDNA format</ins></dfn>
<ins class="diff-chg">is obtained as follows: take the host part of
the script's</ins> <a href="#origin0"><ins class=
"diff-chg">origin</ins></a> <ins class="diff-chg">tuple and apply
the IDNA ToASCII algorithm and then the IDNA ToUnicode algorithm to
each component of the domain name (with both the AllowUnassigned
and UseSTD3ASCIIRules flags set both times).</ins> <a href=
"#references"><ins class="diff-chg">[RFC3490]</ins></a></p>
<p><ins class="diff-chg">If ToASCII fails to convert one of the
components of the string, e.g. because it is too long or because it
contains invalid characters,</ins> or if <del class="diff-old">host
1</del> <ins class="diff-chg">the</ins> <a href=
"#origin0"><ins class="diff-chg">origin</ins></a> <ins class=
"diff-chg">of the script</ins> is not <del class=
"diff-old">case-insensitively identical</del> <ins class=
"diff-chg">a scheme/host/port tuple, then the string representing
the script's domain in IDNA format cannot be obtained. (ToUnicode
is defined</ins> to <del class="diff-old">host 2</del> <ins class=
"diff-chg">never fail.)</ins></p>
<h3 id="scripting"><del class="diff-old">,</del> <span class=
"secno"><ins class="diff-chg">4.4</ins></span> <ins class=
"diff-chg">Scripting</ins></h3>
<p><ins class="diff-chg">Various mechanisms can cause
author-provided executable code to run in the context of a
document. These mechanisms include, but are probably not limited
to:</ins></p>
<ul>
<li><ins class="diff-chg">Processing of</ins> <code><a href=
"#script1"><ins class="diff-chg">script</ins></a></code>
<ins class="diff-chg">elements.</ins></li>
<li><ins class="diff-chg">Processing of inline</ins> <code title=
"javascript protocol"><a href="#the-javascript"><ins class=
"diff-chg">javascript:</ins></a></code> <ins class="diff-chg">URIs
(e.g. the</ins> <code title="attr-img-src"><a href=
"#src"><ins class="diff-chg">src</ins></a></code> <ins class=
"diff-chg">attribute of</ins> <code><a href="#img"><ins class=
"diff-chg">img</ins></a></code> <ins class=
"diff-chg">elements,</ins> or <del class="diff-old">if port 1</del>
<ins class="diff-chg">an</ins> <code title=""><ins class=
"diff-chg">@import</ins></code> <ins class="diff-chg">rule in a
CSS</ins> <code><a href="#style1"><ins class=
"diff-chg">style</ins></a></code> <ins class="diff-chg">element
block).</ins></li>
<li><ins class="diff-chg">Event handlers, whether registered
through the DOM using</ins> <code title=""><ins class=
"diff-chg">addEventListener()</ins></code> ,<ins class=
"diff-chg">by explicit</ins> <a href="#event3"><ins class=
"diff-chg">event handler content attributes</ins></a> ,<ins class=
"diff-chg">by</ins> <a href="#event4"><ins class="diff-chg">event
handler DOM attributes</ins></a> ,<ins class="diff-chg">or
otherwise.</ins></li>
<li><ins class="diff-chg">Processing of technologies like XBL or
SVG that have their own scripting features.</ins></li>
</ul>
<h4 id="script0"><span class="secno"><ins class=
"diff-chg">4.4.1</ins></span> <ins class="diff-chg">Script
execution contexts</ins></h4>
<p><ins class="diff-chg">The</ins> <dfn id="script2"><ins class=
"diff-chg">script execution context</ins></dfn> <ins class=
"diff-chg">of a script</ins> is <ins class="diff-new">defined when
that script is created. It is typically a</ins> <code><a href=
"#window"><ins class="diff-new">Window</ins></a></code> <ins class=
"diff-new">object.</ins></p>
<p><ins class="diff-new">A</ins> <a href="#script2"><ins class=
"diff-new">script execution context</ins></a> <ins class=
"diff-new">always has an associated</ins> <a href=
"#browsing1"><ins class="diff-new">browsing context</ins></a>
.<ins class="diff-new">If the</ins> <a href="#script2"><ins class=
"diff-new">script execution context</ins></a> <ins class=
"diff-new">is a</ins> <code><a href="#window"><ins class=
"diff-new">Window</ins></a></code> <ins class="diff-new">object,
then that object's</ins> <a href="#browsing1"><ins class=
"diff-new">browsing context</ins></a> <ins class="diff-new">is it.
Otherwise, the</ins> <a href="#script2"><ins class=
"diff-new">script execution context</ins></a> <ins class=
"diff-new">is associated explicitly with a</ins> <a href=
"#browsing1"><ins class="diff-new">browsing context</ins></a>
<ins class="diff-new">when it is created.</ins></p>
<p><ins class="diff-new">It is said that</ins> <dfn id=
"scripting1"><ins class="diff-new">scripting is
disabled</ins></dfn> <ins class="diff-new">in a</ins> <a href=
"#script2"><ins class="diff-new">script execution context</ins></a>
<ins class="diff-new">when any of the following conditions are
true:</ins></p>
<ul>
<li><ins class="diff-new">The user agent does</ins> not <del class=
"diff-old">identical</del> <ins class="diff-chg">support
scripting.</ins></li>
<li><ins class="diff-chg">The user has disabled scripting for
this</ins> <a href="#script2"><ins class="diff-chg">script
execution context</ins></a> .<ins class="diff-chg">(User agents may
provide users with the option</ins> to <del class="diff-old">port
2</del> <ins class="diff-chg">disable scripting globally, on a
per-origin basis, or in other ways down to the granularity of
individual</ins> <a href="#script2" title=
"script execution context"><ins class="diff-chg">script execution
contexts</ins></a> .)</li>
<li id="designModeScriptBlocked"><ins class="diff-chg">The</ins>
<a href="#script2"><ins class="diff-chg">script execution
context</ins></a> <ins class="diff-chg">'s associated</ins>
<a href="#browsing1"><ins class="diff-chg">browsing
context</ins></a> <ins class="diff-chg">'s</ins> <a href=
"#active"><ins class="diff-chg">active document</ins></a>
<ins class="diff-chg">has</ins> <code title=
"dom-document-designMode"><del class="diff-old">, then fail</del>
<a href="#designMode"><ins class=
"diff-chg">designMode</ins></a></code> <ins class=
"diff-chg">enabled.</ins></li>
<li id="sandboxScriptBlocked"><ins class="diff-chg">The</ins>
<a href="#script2"><ins class="diff-chg">script execution
context</ins></a> <ins class="diff-chg">'s associated</ins>
<a href="#browsing1"><ins class="diff-chg">browsing
context</ins></a> <ins class="diff-chg">has</ins> the <del class=
"diff-old">overall algorithm —</del> <a href=
"#sandboxed4"><ins class="diff-chg">sandboxed scripts browsing
context flag</ins></a> <ins class="diff-chg">set.</ins></li>
</ul>
<p><ins class="diff-chg">A node is said to be</ins> <dfn id=
"without"><ins class="diff-chg">without script</ins></dfn>
<ins class="diff-chg">if either</ins> the <del class="diff-old">two
URIs do</del> <code><ins class="diff-chg">Document</ins></code>
<ins class="diff-chg">object of the node (the node itself, it is
itself a</ins> <code><ins class="diff-chg">Document</ins></code>
<ins class="diff-chg">object) does</ins> not have <del class=
"diff-old">the same scheme/host/port.</del> <ins class=
"diff-chg">an associated</ins> <a href="#browsing1"><ins class=
"diff-chg">browsing context</ins></a> ,<ins class=
"diff-chg">or</ins> <a href="#scripting1"><ins class=
"diff-chg">scripting is disabled</ins></a> <ins class="diff-chg">in
that</ins> <a href="#browsing1"><ins class="diff-chg">browsing
context</ins></a> .</p>
<p><del class="diff-old">Otherwise,</del> <ins class="diff-chg">A
node is said to be</ins> <dfn id="with-script"><ins class=
"diff-chg">with script</ins></dfn> <ins class="diff-chg">if it is
not</ins> <a href="#without"><ins class="diff-chg">without
script</ins></a> .</p>
<p class="big-issue"><ins class="diff-chg">If you can find a better
pair of terms than "with script" and "without script" let me know.
The only things I can find that are less confusing are also way,
way longer.</ins></p>
<p><ins class="diff-chg">When a script is to be executed in a</ins>
<a href="#script2"><ins class="diff-chg">script execution
context</ins></a> <ins class="diff-chg">in which</ins> <a href=
"#scripting1"><ins class="diff-chg">scripting is disabled</ins></a>
, the <del class="diff-old">two URIs</del> <ins class=
"diff-chg">script must</ins> do <del class="diff-old">have</del>
<ins class="diff-chg">nothing and return nothing (a void return
value).</ins></p>
<p class="note"><ins class="diff-chg">Thus, for instance,
enabling</ins> <code title="dom-document-designMode"><a href=
"#designMode"><ins class="diff-chg">designMode</ins></a></code>
<ins class="diff-chg">will disable any event handler attributes,
event listeners, timeouts, etc, that were set by scripts in</ins>
the <del class="diff-old">same scheme/host/port.</del> <ins class=
"diff-chg">document.</ins></p>
<h4 id="security4"><span class="secno"><del class=
"diff-old">4.3.4.</del> <ins class="diff-chg">4.4.2</ins></span>
Security exceptions</h4>
<p class="big-issue">Define <dfn id="security9">security
exception</dfn> .</p>
<h4 id="javascript-protocol"><span class="secno"><del class=
"diff-old">4.3.5.</del> <ins class="diff-chg">4.4.3</ins></span>
<dfn id="the-javascript" title="javascript protocol">The
<code title="">javascript:</code> protocol</dfn></h4>
<p>A URI using the <code title="">javascript:</code> protocol must,
if <del class="diff-old">evaluated,</del> <ins class="diff-chg">and
when dereferenced,</ins> be evaluated <ins class="diff-new">by
executing the script obtained</ins> using the <del class=
"diff-old">in-context evaluation</del> <ins class=
"diff-chg">content retrieval</ins> operation defined for
<code title="">javascript:</code> URIs. <a href=
"#references">[JSURI]</a></p>
<p>When a <a href="#browsing1">browsing context</a> is <a href=
"#navigate" title="navigate">navigated</a> to a
<code>javascript:</code> URI, and the <a href="#active">active
document</a> of that browsing context has the <a href=
"#same-origin">same origin</a> as the <ins class="diff-new">script
given by that</ins> URI, the <del class=
"diff-old">dereference</del> <a href="#script2"><ins class=
"diff-chg">script execution</ins> context</a> must be the
<code><a href="#window"><ins class=
"diff-chg">Window</ins></a></code> <ins class="diff-chg">object of
the</ins> <a href="#browsing1">browsing context</a> being
navigated.</p>
<p>When a browsing context is <a href="#navigate" title=
"navigate">navigated</a> to a <code>javascript:</code> URI, and the
<a href="#active">active document</a> of that browsing context has
<del class="diff-old">a different</del> <ins class=
"diff-chg">an</ins> <a href="#origin0">origin</a> <del class=
"diff-old">than</del> <ins class="diff-chg">that is</ins>
<em><ins class="diff-chg">not</ins></em> <ins class=
"diff-chg">the</ins> <a href="#same-origin" title=
"same origin"><ins class="diff-chg">same</ins></a> <ins class=
"diff-chg">as that of the script given by</ins> the URI, the
<del class="diff-old">dereference</del> <a href=
"#script2"><ins class="diff-chg">script execution</ins> context</a>
must be an empty <del class="diff-old">object.</del> <ins class=
"diff-chg">object, and the</ins> <a href="#script2"><ins class=
"diff-chg">script execution context</ins></a> <ins class=
"diff-chg">'s associated</ins> <a href="#browsing1"><ins class=
"diff-chg">browsing context</ins></a> <ins class="diff-chg">must be
the</ins> <a href="#browsing1"><ins class="diff-chg">browsing
context</ins></a> <ins class="diff-chg">being</ins> <a href=
"#navigate" title="navigate"><ins class=
"diff-chg">navigated</ins></a> .</p>
<p>Otherwise, the <del class="diff-old">dereference</del> <a href=
"#script2"><ins class="diff-chg">script execution</ins> context</a>
must <ins class="diff-new">be an empty object, and</ins> the
<a href="#script2"><ins class="diff-chg">script execution
context</ins></a> <ins class="diff-chg">'s associated</ins>
<a href="#browsing1"><ins class="diff-chg">browsing
context</ins></a> <ins class="diff-chg">must be the</ins> <a href=
"#browsing1">browsing context</a> of the <code>Document</code>
<del class="diff-old">to which belongs the element for which</del>
<ins class="diff-chg">object of</ins> the <del class="diff-old">URI
is being dereferenced,</del> <ins class="diff-chg">element,
attribute,</ins> or <del class="diff-old">to which the</del> style
sheet <del class="diff-old">for</del> <ins class=
"diff-chg">from</ins> which the <del class="diff-old">URI is being
dereferenced applies, whichever is appropriate. URIs using
the</del> <code>javascript:</code> <del class="diff-old">protocol
should be evaluated when the resource for that</del> URI
<del class="diff-old">is needed, unless scripting is disabled or
the Document corresponding to the dereference context (as defined
above), if any, has designMode enabled.</del> <ins class=
"diff-chg">was reached.</ins></p>
<p>If the <del class="diff-old">dereference by-product</del>
<ins class="diff-chg">result of executing the script</ins> is void
(there is no return value), then the URI must be treated in a
manner equivalent to an HTTP resource with an HTTP 204 No Content
response.</p>
<p>Otherwise, the URI must be treated in a manner equivalent to an
HTTP resource with a 200 OK response whose <a href="#content-type8"
title="Content-Type">Content-Type metadata</a> is <code title=
"">text/html</code> and whose response body is the <del class=
"diff-old">dereference by-product,</del> <ins class=
"diff-chg">return value</ins> converted to a string value.</p>
<p class="note">Certain contexts, in particular <code><a href=
"#img">img</a></code> elements, ignore the <a href="#content-type8"
title="Content-Type">Content-Type metadata</a> .</p>
<div class="example">
<p>So for example a <code title="">javascript:</code> URI for a
<code title="attr-img-src"><a href="#src">src</a></code> attribute
of an <code><a href="#img">img</a></code> element would be
evaluated in the context of <del class="diff-old">the page</del>
<ins class="diff-chg">an empty object</ins> as soon as the
attribute is set; it would then be sniffed to determine the image
type and decoded as an image.</p>
<p>A <code title="">javascript:</code> URI in an <code title=
"attr-a-href">href</code> attribute of an <code><a href=
"#a">a</a></code> element would only be evaluated when the link was
<a href="#following0" title="following hyperlinks">followed</a>
.</p>
<p>The <code title="attr-iframe-src"><a href="#src1">src</a></code>
attribute of an <code><a href="#iframe">iframe</a></code> element
would be evaluated in the context of the <code><a href=
"#iframe">iframe</a></code> 's own <a href="#browsing1">browsing
context</a> ; once evaluated, its return value (if it was not void)
would replace that <a href="#browsing1">browsing context</a> 's
document, thus changing the variables visible in that <a href=
"#browsing1">browsing context</a> .</p>
</div>
<p class="note"><ins class="diff-new">The rules for handling script
execution in a</ins> <a href="#script2"><ins class=
"diff-new">script execution context</ins></a> <ins class=
"diff-new">include making the script not execute (and just return
void) in certain cases, e.g. in a sandbox or when the user has
disabled scripting altogether.</ins></p>
<h4 id="events"><span class="secno"><del class=
"diff-old">4.3.6.</del> <ins class="diff-chg">4.4.4</ins></span>
Events</h4>
<p class="big-issue">We need to define how to handle events that
are to be fired on a Document that is no longer the active document
of its browsing context, and for Documents that have no browsing
context. Do the events fire? Do the handlers in that document not
fire? Do we just define scripting to be disabled when the document
isn't active, with events still running as is? See also the
<code><a href="#script1">script</a></code> element section, which
says scripts don't run when the document isn't active.</p>
<h5 id="event-handler-attributes"><span class="secno"><del class=
"diff-old">4.3.6.1.</del> <ins class=
"diff-chg">4.4.4.1.</ins></span> Event handler attributes</h5>
<p><a href="#html-elements">HTML elements</a> can have <dfn id=
"event2">event handler attributes</dfn> specified. These act as
bubbling event listeners for the element on which they are
specified.</p>
<p>Each event handler attribute has two parts, an <a href="#event3"
title="event handler content attributes">event handler content
attribute</a> and an <a href="#event4" title=
"event handler DOM attributes">event handler DOM attribute</a> .
Event handler attributes must initially be set to null. When their
value changes (through the changing of their event handler content
attribute or their event handler DOM attribute), they will either
be null, or have an <code>EventListener</code> object assigned to
them.</p>
<p>Objects other than <code>Element</code> objects, in particular
<code><a href="#window">Window</a></code> , only have <a href=
"#event4" title="event handler DOM attributes">event handler DOM
attribute</a> (since they have no content attributes).</p>
<p><dfn id="event3">Event handler content attributes</dfn> , when
specified, must contain valid ECMAScript code matching the
ECMAScript <code title="">FunctionBody</code> production. <a href=
"#references">[ECMA262]</a></p>
<p>When an event handler content attribute is set, its new value
must be interpreted as the body of an anonymous function with a
single argument called <code>event</code> , with the new function's
scope chain being linked from the activation object of the handler,
to the element, to the element's <code>form</code> element if it is
a form control, to the <code>Document</code> object, to the
<code><a href="#window"><ins class=
"diff-chg">Window</ins></a></code> <ins class="diff-chg">object of
the</ins> <a href="#browsing1">browsing context</a> of that
<code>Document</code> . The function's <code>this</code> parameter
must be the <code>Element</code> object representing the element.
The resulting function must then be set as the value of the
corresponding event handler attribute, and the new value must be
set as the value of the content attribute. If the given function
body fails to compile, then the corresponding event handler
attribute must be set to null instead (the content attribute must
still be updated to the new value, though).</p>
<p class="note">See ECMA262 Edition 3, sections 10.1.6 and 10.2.3,
for more details on activation objects. <a href=
"#references">[ECMA262]</a></p>
<p><ins class="diff-chg">The</ins> <a href="#script2"><ins class=
"diff-chg">script execution context</ins></a> <ins class=
"diff-chg">of the event handler must be the</ins> <code><a href=
"#window"><ins class="diff-chg">Window</ins></a></code> <ins class=
"diff-chg">object at the end of the scope chain.</ins></p>
<p class="big-issue">How do we allow non-JS event handlers?</p>
<p><dfn id="event4">Event handler DOM attributes</dfn> , on
setting, must set the corresponding event handler attribute to
their new value, and on getting, must return whatever the current
value of the corresponding event handler attribute is (possibly
null).</p>
<p>The following are the event handler attributes that must be
supported by all <a href="#html-elements">HTML elements</a> , as
both content attributes and DOM attributes, and on <code><a href=
"#window">Window</a></code> objects, as DOM attributes:</p>
<dl>
<dt><dfn id="onabort" title=
"handler-onabort"><code>onabort</code></dfn></dt>
<dd>
<p>Must be invoked whenever an <code title="event-abort"><a href=
"#abort">abort</a></code> event is targeted at or bubbles through
the element.</p>
</dd>
<dt><dfn id="onbeforeunload" title=
"handler-onbeforeunload"><code>onbeforeunload</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-beforeunload">beforeunload</code> event is targeted at or
bubbles through the element.</p>
</dd>
<dt><dfn id="onblur" title=
"handler-onblur"><code>onblur</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title="event-blur">blur</code>
event is targeted at or bubbles through the element.</p>
</dd>
<dt><dfn id="onchange" title=
"handler-onchange"><code>onchange</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-change">change</code> event is targeted at or bubbles
through the element.</p>
</dd>
<dt><dfn id="onclick" title=
"handler-onclick"><code>onclick</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-click">click</code> event is targeted at or bubbles through
the element.</p>
</dd>
<dt><dfn id="oncontextmenu" title=
"handler-oncontextmenu"><code>oncontextmenu</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-contextmenu">contextmenu</code> event is targeted at or
bubbles through the element.</p>
</dd>
<dt><dfn id="ondblclick" title=
"handler-ondblclick"><code>ondblclick</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-dblclick">dblclick</code> event is targeted at or bubbles
through the element.</p>
</dd>
<dt><dfn id="ondrag" title=
"handler-ondrag"><code>ondrag</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title="event-drag"><a href=
"#drag">drag</a></code> event is targeted at or bubbles through the
element.</p>
</dd>
<dt><dfn id="ondragend" title=
"handler-ondragend"><code>ondragend</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title="event-dragend"><a href=
"#dragend">dragend</a></code> event is targeted at or bubbles
through the element.</p>
</dd>
<dt><dfn id="ondragenter" title=
"handler-ondragenter"><code>ondragenter</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-dragenter"><a href="#dragenter">dragenter</a></code> event
is targeted at or bubbles through the element.</p>
</dd>
<dt><dfn id="ondragleave" title=
"handler-ondragleave"><code>ondragleave</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-dragleave"><a href="#dragleave">dragleave</a></code> event
is targeted at or bubbles through the element.</p>
</dd>
<dt><dfn id="ondragover" title=
"handler-ondragover"><code>ondragover</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title="event-dragover"><a href=
"#dragover">dragover</a></code> event is targeted at or bubbles
through the element.</p>
</dd>
<dt><dfn id="ondragstart" title=
"handler-ondragstart"><code>ondragstart</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-dragstart"><a href="#dragstart">dragstart</a></code> event
is targeted at or bubbles through the element.</p>
</dd>
<dt><dfn id="ondrop" title=
"handler-ondrop"><code>ondrop</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title="event-drop"><a href=
"#drop">drop</a></code> event is targeted at or bubbles through the
element.</p>
</dd>
<dt><dfn id="onerror" title=
"handler-onerror"><code>onerror</code></dfn></dt>
<dd>
<p>Must be invoked whenever an <code title="event-error"><a href=
"#error1">error</a></code> event is targeted at or bubbles through
the element.</p>
<p class="note">The <code title="handler-onerror"><a href=
"#onerror">onerror</a></code> handler is also used for <a href=
"#runtime-script-errors">reporting script errors</a> .</p>
</dd>
<dt><dfn id="onfocus" title=
"handler-onfocus"><code>onfocus</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-focus">focus</code> event is targeted at or bubbles through
the element.</p>
</dd>
<dt><dfn id="onkeydown" title=
"handler-onkeydown"><code>onkeydown</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-keydown">keydown</code> event is targeted at or bubbles
through the element.</p>
</dd>
<dt><dfn id="onkeypress" title=
"handler-onkeypress"><code>onkeypress</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-keypress">keypress</code> event is targeted at or bubbles
through the element.</p>
</dd>
<dt><dfn id="onkeyup" title=
"handler-onkeyup"><code>onkeyup</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-keyup">keyup</code> event is targeted at or bubbles through
the element.</p>
</dd>
<dt><dfn id="onload" title=
"handler-onload"><code>onload</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title="event-load"><a href=
"#load0">load</a></code> event is targeted at or bubbles through
the element.</p>
</dd>
<dt><dfn id="onmessage" title=
"handler-onmessage"><code>onmessage</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title="event-message"><a href=
"#message0">message</a></code> event is targeted at or bubbles
through the element.</p>
</dd>
<dt><dfn id="onmousedown" title=
"handler-onmousedown"><code>onmousedown</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-mousedown">mousedown</code> event is targeted at or bubbles
through the element.</p>
</dd>
<dt><dfn id="onmousemove" title=
"handler-onmousemove"><code>onmousemove</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-mousemove">mousemove</code> event is targeted at or bubbles
through the element.</p>
</dd>
<dt><dfn id="onmouseout" title=
"handler-onmouseout"><code>onmouseout</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-mouseout">mouseout</code> event is targeted at or bubbles
through the element.</p>
</dd>
<dt><dfn id="onmouseover" title=
"handler-onmouseover"><code>onmouseover</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-mouseover">mouseover</code> event is targeted at or bubbles
through the element.</p>
</dd>
<dt><dfn id="onmouseup" title=
"handler-onmouseup"><code>onmouseup</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-mouseup">mouseup</code> event is targeted at or bubbles
through the element.</p>
</dd>
<dt><dfn id="onmousewheel" title=
"handler-onmousewheel"><code>onmousewheel</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-mousewheel">mousewheel</code> event is targeted at or
bubbles through the element.</p>
</dd>
<dt><dfn id="onresize" title=
"handler-onresize"><code>onresize</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-resize">resize</code> event is targeted at or bubbles
through the element.</p>
</dd>
<dt><dfn id="onscroll" title=
"handler-onscroll"><code>onscroll</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-scroll">scroll</code> event is targeted at or bubbles
through the element.</p>
</dd>
<dt><dfn id="onselect" title=
"handler-onselect"><code>onselect</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title="event-select"><a href=
"#select">select</a></code> event is targeted at or bubbles through
the element.</p>
</dd>
<dt><dfn id="onstorage" title="handler-onstorage"><code><ins class=
"diff-new">onstorage</ins></code></dfn></dt>
<dd>
<p><ins class="diff-new">Must be invoked whenever a</ins>
<code title="event-storage"><a href="#storage1"><ins class=
"diff-new">storage</ins></a></code> <ins class="diff-new">event is
targeted at or bubbles through the element.</ins></p>
</dd>
<dt><dfn id="onsubmit" title=
"handler-onsubmit"><code>onsubmit</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-submit">submit</code> event is targeted at or bubbles
through the element.</p>
</dd>
<dt><dfn id="onunload" title=
"handler-onunload"><code>onunload</code></dfn></dt>
<dd>
<p>Must be invoked whenever an <code title=
"event-unload">unload</code> event is targeted at or bubbles
through the element.</p>
</dd>
</dl>
<p>When an event handler attribute is invoked, its argument must be
set to the <code>Event</code> object of the event in question. If
the function returns the exact boolean value false, the event's
<code>preventDefault()</code> method must then invoked. Exception:
for historical reasons, for the HTML <code>mouseover</code> event,
the <code>preventDefault()</code> method must be called when the
function returns true instead.</p>
<p><del class="diff-old">When scripting is disabled , event handler
attributes must do nothing. When scripting is enabled , all</del>
<ins class="diff-chg">All</ins> event handler attributes on an
element, whether set to null or to a function, must be registered
as event listeners on the element, as if the <code title=
"dom-EventTarget-addEventListenerNS">addEventListenerNS()</code>
method on the <code>Element</code> object's
<code>EventTarget</code> interface had been invoked when the
element was created, with the event type ( <var title=
"dom-event-type">type</var> argument) equal to the type described
for the event handler attribute in the list above, the namespace (
<var title="dom-event-namespaceURI">namespaceURI</var> argument)
set to null, the listener set to be a target and bubbling phase
listener ( <var title="dom-event-useCapture">useCapture</var>
argument set to false), the event group set to the default group (
<var title="dom-event-evtGroup">evtGroup</var> argument set to
null), and the event listener itself ( <var title=
"dom-event-listener">listener</var> argument) set to do nothing
while the event handler attribute is null, and set to invoke the
function associated with the event handler attribute otherwise.
<ins class="diff-new">(The</ins> <var title=
"dom-event-listener"><ins class="diff-new">listener</ins></var>
<ins class="diff-new">argument is emphatically</ins>
<em><ins class="diff-new">not</ins></em> <ins class="diff-new">the
event handler attribute itself.)</ins></p>
<h5 id="event"><span class="secno"><del class=
"diff-old">4.3.6.2.</del> <ins class=
"diff-chg">4.4.4.2.</ins></span> Event firing</h5>
<p class="big-issue">maybe this should be moved higher up
(terminology? conformance? DOM?) Also, the whole terminology thing
should be changed so that we don't define any specific events here,
we only define 'simple event', 'progress event', 'mouse event',
'key event', and the like, and have the actual dispatch use those
generic terms when firing events.</p>
<p>Certain operations and methods are defined as firing events on
elements. For example, the <code title="dom-click"><a href=
"#click">click()</a></code> method on the <code><a href=
"#htmlelement">HTMLElement</a></code> interface is defined as
firing a <code title="event-click">click</code> event on the
element. <a href="#references">[DOM3EVENTS]</a></p>
<p><dfn id="firing" title="fire a click event">Firing a
<code title="event-click">click</code> event</dfn> means that a
<a href=
"http://www.w3.org/TR/DOM-Level-3-Events/events.html#event-click"><code>
click</code></a> event with no namespace, which bubbles and is
cancelable, and which uses the <code>MouseEvent</code> interface,
must be dispatched at the given element. The event object must have
its <code title="">screenX</code> , <code title="">screenY</code> ,
<code title="">clientX</code> , <code title="">clientY</code> , and
<code title="">button</code> attributes set to 0, its <code title=
"">ctrlKey</code> , <code title="">shiftKey</code> , <code title=
"">altKey</code> , and <code title="">metaKey</code> attributes set
according to the current state of the key input device, if any
(false for any keys that are not available), its <code title=
"">detail</code> attribute set to 1, and its <code title=
"">relatedTarget</code> attribute set to null. The <code title=
"">getModifierState()</code> method on the object must return
values appropriately describing the state of the key input device
at the time the event is created.</p>
<p><dfn id="firing0" title="fire a change event">Firing a
<code title="event-change">change</code> event</dfn> means that a
<a href=
"http://www.w3.org/TR/DOM-Level-3-Events/events.html#event-change"><code>
change</code></a> event with no namespace, which bubbles but is not
cancelable, and which uses the <code>Event</code> interface, must
be dispatched at the given element. The event object must have its
<code title="">detail</code> attribute set to 0.</p>
<p><dfn id="firing1" title="fire a contextmenu event">Firing a
<code title="event-contextmenu">contextmenu</code> event</dfn>
means that a <code title="event-contextmenu">contextmenu</code>
event with no namespace, which bubbles and is cancelable, and which
uses the <code>Event</code> interface, must be dispatched at the
given element. The event object must have its <code title=
"">detail</code> attribute set to 0.</p>
<p><dfn id="firing2" title="fire a simple event">Firing a simple
event called <var title="">e</var></dfn> means that an event with
the name <var title="">e</var> , with no namespace, which does not
bubble but is <del class="diff-old">cancelable,</del> <ins class=
"diff-chg">cancelable (unless otherwise stated),</ins> and which
uses the <code>Event</code> interface, must be dispatched at the
given element.</p>
<p><dfn id="firing3" title="fire a show event">Firing a
<code title="event-show">show</code> event</dfn> means <a href=
"#firing2" title="fire a simple event">firing a simple event called
<code title="event-show">show</code></a> . <span title=
"big-issue">Actually this should fire an event that has modifier
information (shift/ctrl <del class="diff-old">etc).</del>
<ins class="diff-chg">etc), as well as having a pointer to the node
on which the menu was fired, and with which the menu was associated
(which could be an ancestor of the former).</ins></span></p>
<p><dfn id="firing4" title="fire a load event">Firing a
<code title="event-load">load</code> event</dfn> means <a href=
"#firing2" title="fire a simple event">firing a simple event called
<code title="event-load">load</code></a> . <dfn id="firing5" title=
"fire an error event">Firing an <code title=
"event-error">error</code> event</dfn> means <a href="#firing2"
title="fire a simple event">firing a simple event called
<code title="event-error">error</code></a> .</p>
<p class="big-issue"><dfn id="firing6" title=
"fire a progress event">Firing a progress event called <var title=
"">e</var></dfn> means something that hasn't yet been defined, in
the <a href="#references">[PROGRESS]</a> spec.</p>
<p>The default action of these event is to do nothing unless
otherwise stated.</p>
<p class="big-issue">If you dispatch a custom "click" event at an
element that would normally have default actions, should they get
triggered? If so, we need to go through the entire spec and make
sure that any default actions are defined in terms of <em>any</em>
event of the right type on that element, not those that are
dispatched in expected ways.</p>
<h5 id="events0"><span class="secno"><del class=
"diff-old">4.3.6.3.</del> <ins class=
"diff-chg">4.4.4.3.</ins></span> Events and the <code><a href=
"#window">Window</a></code> object</h5>
<p>When an event is dispatched at a DOM node in a
<code>Document</code> in a <a href="#browsing1">browsing
context</a> , if the event is not a <code title=
"event-load"><a href="#load0">load</a></code> event, the user agent
must also dispatch the event to the <code><a href=
"#window">Window</a></code> , as follows:</p>
<ol>
<li>In the capture phase, the event must be dispatched to the
<code><a href="#window">Window</a></code> object before being
dispatched to any of the nodes.</li>
<li>In the bubble phase, the event must be dispatched to the
<code><a href="#window">Window</a></code> object at the end of the
phase, unless bubbling has been prevented.</li>
</ol>
<h5 id="runtime-script-errors"><span class="secno"><del class=
"diff-old">4.3.6.4.</del> <ins class=
"diff-chg">4.4.4.4.</ins></span> Runtime script errors</h5>
<p><em>This section only applies to user agents that support
scripting in general and ECMAScript in particular.</em></p>
<p>Whenever a runtime script error occurs in one of the scripts
associated with the document, the value of the <code title=
"handler-onerror"><a href="#onerror">onerror</a></code> <span>event
handler DOM attribute</span> of the <code><a href=
"#window">Window</a></code> object must be processed, as
follows:</p>
<dl class="switch">
<dt>If the value is a function</dt>
<dd>
<p>The function referenced by the <code title=
"handler-onerror"><a href="#onerror">onerror</a></code> attribute
must be invoked with three arguments, before notifying the user of
the error.</p>
<p>The three arguments passed to the function are all
<code>DOMString</code> s; the first must give the message that the
UA is considering reporting, the second must give the URI to the
resource in which the error <del class="diff-old">occured,</del>
<ins class="diff-chg">occurred,</ins> and the third must give the
line number in that resource on which the error <del class=
"diff-old">occured.</del> <ins class="diff-chg">occurred.</ins></p>
<p>If the function returns false, then the error should not be
reported to the user. Otherwise, if the function returns another
value (or does not return at all), the error should be reported to
the user.</p>
<p>Any exceptions thrown or errors caused by this function must be
reported to the user immediately after the error that the function
was called for, without calling the function again.</p>
</dd>
<dt>If the value is <code>null</code></dt>
<dd>
<p>The error should not reported to the user.</p>
</dd>
<dt>If the value is anything else</dt>
<dd>
<p>The error should be reported to the user.</p>
</dd>
</dl>
<p>The initial value of <code title="handler-onerror"><a href=
"#onerror">onerror</a></code> must be <code>undefined</code> .</p>
<h3 id="user-prompts"><span class="secno"><del class=
"diff-old">4.4.</del> <ins class="diff-chg">4.5</ins></span> User
prompts</h3>
<h4 id="simple0"><span class="secno"><ins class=
"diff-new">4.5.1</ins></span> <ins class="diff-new">Simple
dialogs</ins></h4>
<p>The <dfn id="alert" title="dom-alert"><code>alert( <var title=
"">message</var> )</code></dfn> method, when invoked, must show the
given <var title="">message</var> to the user. The user agent may
make the method wait for the user to acknowledge the message before
returning; if so, the user agent must <a href="#pause">pause</a>
while the method is waiting.</p>
<p>The <dfn id="confirm" title="dom-confirm"><code>confirm(
<var title="">message</var> )</code></dfn> method, when invoked,
must show the given <var title="">message</var> to the user, and
ask the user to respond with a positive or negative response. The
user agent must then <a href="#pause">pause</a> as the <del class=
"diff-old">the</del> method waits for the user's response. If the
user responds positively, the method must return true, and if the
user responds negatively, the method must return false.</p>
<p>The <dfn id="prompt" title="dom-prompt"><code>prompt(
<var title="">message</var> , <var title="">default</var>
)</code></dfn> method, when invoked, must show the given
<var title="">message</var> to the user, and ask the user to either
respond with a string value or abort. The user agent must then
<a href="#pause">pause</a> as the <del class="diff-old">the</del>
method waits for the user's response. The second argument is
optional. If the second argument ( <var title="">default</var> ) is
present, then the response must be defaulted to the value given by
<var title="">default</var> . If the user aborts, then the method
must return null; otherwise, the method must return the string that
the user responded with.</p>
<h4 id="printing"><span class="secno"><ins class=
"diff-new">4.5.2</ins></span> <ins class=
"diff-new">Printing</ins></h4>
<p>The <dfn id="print" title="dom-print"><code>print()</code></dfn>
method, when invoked, <ins class="diff-new">must run the</ins>
<a href="#printing0"><ins class="diff-new">printing steps</ins></a>
.</p>
<p><ins class="diff-new">User agents should also run the</ins>
<a href="#printing0"><ins class="diff-new">printing steps</ins></a>
<ins class="diff-new">whenever the user attempts to obtain a
physical form (e.g. printed copy), or the representation of a
physical form (e.g. PDF copy), of a document.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="printing0"><ins class=
"diff-new">printing steps</ins></dfn> <ins class="diff-new">are as
follows:</ins></p>
<ol>
<li>
<p><ins class="diff-new">The user agent may display a message to
the user and/or may abort these steps.</ins></p>
<p class="example"><ins class="diff-new">For instance, a kiosk
browser could silently ignore any invocations of the</ins>
<code title="dom-print"><a href="#print"><ins class=
"diff-new">print()</ins></a></code> <ins class=
"diff-new">method.</ins></p>
<p class="example"><ins class="diff-new">For instance, a browser on
a mobile device could detect that there are no printers in the
vicinity and display a message saying so before continuing to offer
a "save to PDF" option.</ins></p>
</li>
<li>
<p><ins class="diff-new">The user agent must</ins> <a href=
"#firing2"><ins class="diff-new">fire a simple event</ins></a>
<ins class="diff-new">called</ins> <code title=
"event-beforeprint"><ins class="diff-new">beforeprint</ins></code>
<ins class="diff-new">at the</ins> <code><a href=
"#window"><ins class="diff-new">Window</ins></a></code> <ins class=
"diff-new">object of the browsing context of the</ins>
<code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">that is being printed, as well as any</ins> <a href=
"#nested0" title="nested browsing context"><ins class=
"diff-new">nested browsing contexts</ins></a> <ins class=
"diff-new">in it.</ins></p>
<p class="example"><ins class="diff-new">The</ins> <code title=
"event-beforeprint"><ins class="diff-new">beforeprint</ins></code>
<ins class="diff-new">event can be used to annotate the printed
copy, for instance adding the time at which the document was
printed.</ins></p>
</li>
<li>
<p><ins class="diff-new">The user agent</ins> should offer the user
the opportunity to <a href="#obtain">obtain a physical form</a>
<ins class="diff-new">(or the representation of a physical
form)</ins> of the document. The user agent may <del class=
"diff-old">make the method</del> wait for the user to either accept
or decline before returning; if so, the user agent must <a href=
"#pause">pause</a> while the method is waiting. <del class=
"diff-old">(This</del> <ins class="diff-chg">Even if the user agent
doesn't wait at this point, the user agent must use the state of
the relevant documents as they are at this point in the algorithm
if and when it eventually creates the alternate form.</ins></p>
</li>
<li>
<p><ins class="diff-chg">The user agent must</ins> <a href=
"#firing2"><ins class="diff-chg">fire a simple event</ins></a>
<ins class="diff-chg">called</ins> <code title=
"event-afterprint"><ins class="diff-chg">afterprint</ins></code>
<ins class="diff-chg">at the</ins> <code><a href=
"#window"><ins class="diff-chg">Window</ins></a></code> <ins class=
"diff-chg">object of the browsing context of the</ins>
<code><ins class="diff-chg">Document</ins></code> <ins class=
"diff-chg">that is being printed, as well as any</ins> <a href=
"#nested0" title="nested browsing context"><ins class=
"diff-chg">nested browsing contexts</ins></a> <ins class=
"diff-chg">in it.</ins></p>
<p class="example"><ins class="diff-chg">The</ins> <code title=
"event-afterprint"><ins class="diff-chg">afterprint</ins></code>
<ins class="diff-chg">event can be used to revert annotations added
in the earlier event, as well as showing post-printing UI. For
instance, if a page is walking the user through the steps of
applying for a home loan, the script could automatically advance to
the next step after having printed a form or other.</ins></p>
</li>
</ol>
<h4 id="dialogs"><span class="secno"><ins class=
"diff-chg">4.5.3</ins></span> <ins class="diff-chg">Dialogs
implemented using separate documents</ins></h4>
<p><ins class="diff-chg">The</ins> <dfn id="showmodaldialog" title=
"dom-showModalDialog"><code><ins class=
"diff-chg">showModalDialog(</ins> <var title=""><ins class=
"diff-chg">url</ins></var> ,<var title=""><ins class=
"diff-chg">arguments</ins></var> <ins class=
"diff-chg">)</ins></code></dfn> <ins class="diff-chg">method, when
invoked, must cause the user agent to run the following
steps:</ins></p>
<ol>
<li>
<p><ins class="diff-chg">If the user agent is configured such that
this invocation of</ins> <code title="dom-showModalDialog"><a href=
"#showmodaldialog"><ins class=
"diff-chg">showModalDialog()</ins></a></code> <ins class=
"diff-chg">is somehow disabled, then the method returns the empty
string; abort these steps.</ins></p>
<p class="note"><ins class="diff-chg">User agents are expected to
disable this method in certain cases to avoid user annoyance. For
instance, a user agent could require that a site be white-listed
before enabling this method, or the user agent could be configured
to only allow one modal dialog at a time.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">the list of background browsing contexts</ins></var>
<ins class="diff-chg">be a list of all the browsing contexts
that:</ins></p>
<ul>
<li><ins class="diff-chg">are part of the same</ins> <a href=
"#unit-of"><ins class="diff-chg">unit of related browsing
contexts</ins></a> <ins class="diff-chg">as the browsing context of
the</ins> <code><a href="#window"><ins class=
"diff-chg">Window</ins></a></code> <ins class="diff-chg">object on
which the</ins> <code title="dom-showModalDialog"><a href=
"#showmodaldialog"><ins class=
"diff-chg">showModalDialog()</ins></a></code> <ins class=
"diff-chg">method was called, and that</ins></li>
<li><ins class="diff-chg">have an</ins> <a href=
"#active"><ins class="diff-chg">active document</ins></a>
<ins class="diff-chg">whose</ins> <a href="#origin0"><ins class=
"diff-chg">origin</ins></a> <ins class="diff-chg">is the</ins>
<a href="#same-origin" title="same origin"><ins class=
"diff-chg">same</ins></a> <ins class="diff-chg">as the</ins>
<a href="#origin0"><ins class="diff-chg">origin</ins></a>
<ins class="diff-chg">of the script that called the</ins>
<code title="dom-showModalDialog"><a href=
"#showmodaldialog"><ins class=
"diff-chg">showModalDialog()</ins></a></code> <ins class=
"diff-chg">method at the time the method was called,</ins></li>
</ul>
<p>...as<ins class="diff-chg">well as any browsing contexts that
are nested inside any of the browsing contexts matching those
conditions.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Disable the user interface for all the
browsing contexts in</ins> <var title=""><ins class="diff-chg">the
list of background browsing contexts</ins></var> .<ins class=
"diff-chg">This should prevent the user from navigating those
browsing contexts, causing events to to be sent to those browsing
context, or editing any content in those browsing contexts.
However, it</ins> does <del class="diff-old">not,</del> <ins class=
"diff-chg">not prevent those browsing contexts from receiving
events from sources other than the user, from running scripts, from
running animations, and so forth.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Create a new</ins> <a href=
"#auxiliary0"><ins class="diff-chg">auxiliary browsing
context</ins></a> ,<ins class="diff-chg">with the</ins> <a href=
"#opener"><ins class="diff-chg">opener browsing context</ins></a>
<ins class="diff-chg">being the browsing context</ins> of
<del class="diff-old">course, preclude</del> the <code><a href=
"#window"><ins class="diff-new">Window</ins></a></code> <ins class=
"diff-new">object on which the</ins> <code title=
"dom-showModalDialog"><a href="#showmodaldialog"><ins class=
"diff-new">showModalDialog()</ins></a></code> <ins class=
"diff-new">method was called. The new auxiliary browsing context
has no name.</ins></p>
<p class="note"><ins class="diff-new">This browsing context
implements the</ins> <code><a href="#modalwindow"><ins class=
"diff-new">ModalWindow</ins></a></code> <ins class=
"diff-new">interface.</ins></p>
</li>
<li>
<p><ins class="diff-new">Let the</ins> <a href=
"#dialog0"><ins class="diff-new">dialog arguments</ins></a>
<ins class="diff-new">of the new browsing context be set to the
value of</ins> <var title=""><ins class=
"diff-new">arguments</ins></var> .</p>
</li>
<li>
<p><ins class="diff-new">Let the</ins> <a href=
"#dialog1"><ins class="diff-new">dialog arguments' origin</ins></a>
<ins class="diff-new">be the</ins> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> <ins class="diff-new">of the script
that called the</ins> <code title="dom-showModalDialog"><a href=
"#showmodaldialog"><ins class=
"diff-new">showModalDialog()</ins></a></code> <ins class=
"diff-new">method.</ins></p>
</li>
<li>
<p><a href="#navigate"><ins class="diff-new">Navigate</ins></a>
<ins class="diff-new">the new browsing context to</ins> <var title=
""><ins class="diff-new">url</ins></var> ,<ins class=
"diff-new">with</ins> <a href="#replacement"><ins class=
"diff-new">replacement enabled</ins></a> ,<ins class="diff-new">and
with the</ins> <a href="#browsing1"><ins class="diff-new">browsing
context</ins></a> <ins class="diff-new">of the</ins> <code><a href=
"#window"><ins class="diff-new">Window</ins></a></code> <ins class=
"diff-new">object that is the</ins> <a href="#script2"><ins class=
"diff-new">script execution context</ins></a> <ins class=
"diff-new">of the script that invoked the method as the</ins>
<a href="#source0"><ins class="diff-new">source browsing
context</ins></a> .</p>
<p class="note"><ins class="diff-new">If the</ins> <a href=
"#script2"><ins class="diff-new">script execution context</ins></a>
<ins class="diff-new">of a script isn't a</ins> <code><a href=
"#window"><ins class="diff-new">Window</ins></a></code> <ins class=
"diff-new">object, then it can't ever get to a</ins> <code><a href=
"#window"><ins class="diff-new">Window</ins></a></code> <ins class=
"diff-new">object to call this method.</ins></p>
</li>
<li>
<p><ins class="diff-new">Wait for the browsing context to be
closed. (The</ins> user agent <ins class="diff-new">must allow the
user to indicate that the browsing context is to be
closed.)</ins></p>
</li>
<li>
<p><ins class="diff-new">Reenable the user interface for all the
browsing contexts in</ins> <var title=""><ins class="diff-new">the
list of background browsing contexts</ins></var> .</p>
</li>
<li>
<p><ins class="diff-new">Return the</ins> <a href=
"#auxiliary0"><ins class="diff-new">auxiliary browsing
context</ins></a> <ins class="diff-new">'s</ins> <a href=
"#return"><ins class="diff-new">return value</ins></a> .</p>
</li>
</ol>
<p><ins class="diff-new">Browsing contexts created by the above
algorithm must implement the</ins> <code><a href=
"#modalwindow"><ins class="diff-new">ModalWindow</ins></a></code>
<ins class="diff-new">interface:</ins></p>
<pre class="idl">
[XXX] interface <dfn id=
"modalwindow">ModalWindow</dfn> {<ins class="diff-new">
readonly attribute any <a href="#dialogarguments" title=
"dom-modalWindow-dialogArguments">dialogArguments</a>;
attribute DOMString <a href="#returnvalue" title=
"dom-modalWindow-returnValue">returnValue</a>;
};
</ins>
</pre>
<p><ins class="diff-new">Such browsing contexts have
associated</ins> <dfn id="dialog0"><ins class="diff-new">dialog
arguments</ins></dfn> ,<ins class="diff-new">which are stored along
with the</ins> <dfn id="dialog1"><ins class="diff-new">dialog
arguments' origin</ins></dfn> .<ins class="diff-new">These values
are set by the</ins> <code title="dom-showModalDialog"><a href=
"#showmodaldialog"><ins class=
"diff-new">showModalDialog()</ins></a></code> <ins class=
"diff-new">method in the algorithm above, when the browsing context
is created, based on the arguments provided to the
method.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="dialogarguments" title=
"dom-modalWindow-dialogArguments"><code><ins class=
"diff-new">dialogArguments</ins></code></dfn> <ins class=
"diff-new">DOM attribute, on getting, must check whether its
browsing context's</ins> <a href="#active"><ins class=
"diff-new">active document</ins></a> <ins class="diff-new">'s</ins>
<a href="#origin0"><ins class="diff-new">origin</ins></a>
<ins class="diff-new">is the</ins> <a href="#same-origin" title=
"same origin"><ins class="diff-new">same</ins></a> <ins class=
"diff-new">as the</ins> <a href="#dialog1"><ins class=
"diff-new">dialog arguments' origin</ins></a> .<ins class=
"diff-new">If it is, then the browsing context's</ins> <a href=
"#dialog0"><ins class="diff-new">dialog arguments</ins></a>
<ins class="diff-new">must be returned unchanged. Otherwise, if
the</ins> <a href="#dialog0"><ins class="diff-new">dialog
arguments</ins></a> <ins class="diff-new">are an object, then the
empty string must be returned, and if the</ins> <a href=
"#dialog0"><ins class="diff-new">dialog arguments</ins></a>
<ins class="diff-new">are not an object, then the stringification
of the</ins> <a href="#dialog0"><ins class="diff-new">dialog
arguments</ins></a> <ins class="diff-new">must be
returned.</ins></p>
<p><ins class="diff-new">These browsing contexts also have an
associated</ins> <dfn id="return"><ins class="diff-new">return
value</ins></dfn> .<ins class="diff-new">The</ins> <a href=
"#return"><ins class="diff-new">return value</ins></a> <ins class=
"diff-new">of a browsing context must be initialized to the empty
string when the browsing context is created.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="returnvalue" title=
"dom-modalWindow-returnValue"><code><ins class=
"diff-new">returnValue</ins></code></dfn> <ins class="diff-new">DOM
attribute, on getting, must return the</ins> <a href=
"#return"><ins class="diff-new">return value</ins></a> <ins class=
"diff-new">of its browsing context, and on setting, must set
the</ins> <a href="#return"><ins class="diff-new">return
value</ins></a> <ins class="diff-new">to the given new
value.</ins></p>
<h4 id="notifications"><span class="secno"><ins class=
"diff-new">4.5.4</ins></span> <ins class=
"diff-new">Notifications</ins></h4>
<p><ins class="diff-new">Notifications are short, transient
messages that bring the user's attention to new information, or
remind the user of scheduled events.</ins></p>
<p><ins class="diff-new">Since notifications can be annoying if
abused, this specification defines a mechanism that scopes
notifications to a site's existing rendering area unless the user
explicitly indicates that the site can be trusted.</ins></p>
<p><ins class="diff-new">To this end, each</ins> <a href=
"#origin0"><ins class="diff-new">origin</ins></a> <ins class=
"diff-new">can be flagged as being a</ins> <dfn id=
"trusted"><ins class="diff-new">trusted notification
source</ins></dfn> .<ins class="diff-new">By default origins should
not be flagged as such, but user agents may allow users to
whitelist origins or groups of origins as being</ins> <a href=
"#trusted" title="trusted notification source"><ins class=
"diff-new">trusted notification sources</ins></a> .<ins class=
"diff-new">Only origins flagged as trusted in this way are allowed
to show notification UI outside of their tab.</ins></p>
<p class="example"><ins class="diff-new">For example, a user agent
could allow a user to mark all subdomains and ports of example.org
as trusted notification sources. Then, mail.example.org and
calendar.example.org would both be able to show notifications,
without the user having to flag them individually.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="shownotification"
title="dom-showNotification"><code><ins class=
"diff-new">showNotification(</ins> <var title=""><ins class=
"diff-new">title</ins></var> ,<var title=""><ins class=
"diff-new">subtitle</ins></var> ,<var title=""><ins class=
"diff-new">description</ins></var> ,<var title=""><ins class=
"diff-new">onclick</ins></var> <ins class=
"diff-new">)</ins></code></dfn> <ins class="diff-new">method, when
invoked, must cause the user agent to show a
notification.</ins></p>
<p id="sandboxNotifications"><ins class="diff-new">If the method
was invoked</ins> from <ins class="diff-new">a script whose</ins>
<a href="#script2"><ins class="diff-new">script execution
context</ins></a> <ins class="diff-new">'s associated</ins>
<a href="#browsing1"><ins class="diff-new">browsing
context</ins></a> <ins class="diff-new">has the</ins> <a href=
"#sandboxed1"><ins class="diff-new">sandboxed annoyances browsing
context flag</ins></a> <ins class="diff-new">set, then the
notification must be shown within that</ins> <a href=
"#browsing1"><ins class="diff-new">browsing context</ins></a>
.<ins class="diff-new">The notification is said to be a</ins>
<dfn id="sandboxed5"><ins class="diff-new">sandboxed
notification</ins></dfn> .</p>
<p><ins class="diff-new">Otherwise, if the</ins> <a href=
"#origin0"><ins class="diff-new">origin</ins></a> <ins class=
"diff-new">of the</ins> <a href="#browsing1"><ins class=
"diff-new">browsing context</ins></a> <ins class=
"diff-new">associated with the</ins> <a href="#script2"><ins class=
"diff-new">script execution context</ins></a> <ins class=
"diff-new">of the script that invoked the method is</ins>
<em><del class="diff-old">always</del> <ins class=
"diff-chg">not</ins></em> <del class="diff-old">offering</del>
<ins class="diff-chg">flagged as being a</ins> <a href=
"#trusted"><ins class="diff-chg">trusted notification
source</ins></a> ,<ins class="diff-chg">then the notification
should be rendered within the</ins> <a href=
"#top-level"><ins class="diff-chg">top-level browsing
context</ins></a> <ins class="diff-chg">of the</ins> <a href=
"#browsing1"><ins class="diff-chg">browsing context</ins></a>
<ins class="diff-chg">associated with the</ins> <a href=
"#script2"><ins class="diff-chg">script execution context</ins></a>
<ins class="diff-chg">of the script that invoked the method. The
notification is said to be a</ins> <dfn id="normal"><ins class=
"diff-chg">normal notification</ins></dfn> .<ins class=
"diff-chg">User agents should provide a way to set the
origin's</ins> <a href="#trusted"><ins class="diff-chg">trusted
notification source</ins></a> <ins class="diff-chg">flag from the
notification, so that the user can benefit from notifications even
when the user agent is not the active application.</ins></p>
<p><ins class="diff-chg">Otherwise, the</ins> <a href=
"#origin0"><ins class="diff-chg">origin</ins></a> <ins class=
"diff-chg">is flagged as a</ins> <a href="#trusted"><ins class=
"diff-chg">trusted notification source</ins></a> ,<ins class=
"diff-chg">and the notification should be shown using the platform
conventions for system-wide notifications. The notification is said
to be a</ins> <dfn id="trusted0"><ins class="diff-chg">trusted
notification</ins></dfn> .<ins class="diff-chg">User agents may
provide a way to unset the origin's</ins> <a href=
"#trusted"><ins class="diff-chg">trusted notification
source</ins></a> <ins class="diff-chg">flag from within the
notification, so as to allow users to easily disable notifications
from sites that abuse the privilege.</ins></p>
<div class="example">
<p><ins class="diff-chg">For example, if a site contains a gadget
of a mail application in a sandboxed</ins> <code><a href=
"#iframe"><ins class="diff-chg">iframe</ins></a></code> <ins class=
"diff-chg">and that frame triggers a notification upon the receipt
of a new e-mail message, that notification would be displayed on
top of the gadget only.</ins></p>
<p><ins class="diff-chg">However, if the user then goes to the main
site of that mail application, the notification would be displayed
over the entire rendering area of the tab for the site.</ins></p>
<p><ins class="diff-chg">The notification, in this case, would have
a button on it to let the user indicate that he trusts the site. If
the user clicked this button, the next notification would use the
system-wide notification system, appearing even if the tab for the
mail application was buried deep inside a minimised
window.</ins></p>
</div>
<div class="example">
<p><ins class="diff-chg">The style of notifications varies from
platform to platform. On some, it is typically displayed as a
"toast" window that slides in from the bottom right corner. In
others, notifications are shown as semi-transparent white-on-grey
overlays centered over the screen. Other schemes could include
simulated ticker tapes, and speech-synthesis playback.</ins></p>
</div>
<p><ins class="diff-chg">When a</ins> <a href="#normal"><ins class=
"diff-chg">normal notification</ins></a> <ins class="diff-chg">(but
not a</ins> <a href="#sandboxed5"><ins class="diff-chg">sandboxed
notification</ins></a> <ins class="diff-chg">) is shown,</ins> the
user <ins class="diff-new">agent may bring the user's attention to
the</ins> <a href="#top-level"><ins class="diff-new">top-level
browsing context</ins></a> <ins class="diff-new">of the</ins>
<a href="#browsing1"><ins class="diff-new">browsing
context</ins></a> <ins class="diff-new">associated</ins> with the
<del class="diff-old">opportunity</del> <a href=
"#script2"><ins class="diff-chg">script execution context</ins></a>
<ins class="diff-chg">of the script that invoked the method, if
that would be useful; but user agents should not use system-wide
notification mechanisms</ins> to <del class=
"diff-old">convert</del> <ins class="diff-chg">do so.</ins></p>
<p><ins class="diff-chg">When a</ins> <a href=
"#trusted0"><ins class="diff-chg">trusted notification</ins></a>
<ins class="diff-chg">is shown, the user agent should bring</ins>
the <ins class="diff-new">user's attention to the notification and
the</ins> <a href="#browsing1"><ins class="diff-new">browsing
context</ins></a> <ins class="diff-new">associated with the</ins>
<a href="#script2"><ins class="diff-new">script execution
context</ins></a> <ins class="diff-new">of the script that invoked
the method, as per the platform conventions for attracting the
user's attention to applications.</ins></p>
<div class="example">
<p><ins class="diff-new">In the case of</ins> <a href="#normal"
title="normal notification"><ins class="diff-new">normal
notifications</ins></a> ,<ins class="diff-new">typically the only
attention-grabbing device that would be employed would be something
like flashing the tab's caption, or making it bold, or some
such.</ins></p>
<p><ins class="diff-new">In addition, in the case of a</ins>
<a href="#trusted0"><ins class="diff-new">trusted
notification</ins></a> ,<ins class="diff-new">the entire window
could flash, or the browser's application icon could bounce or
flash briefly, or a short sound effect could be played.</ins></p>
</div>
<p><ins class="diff-new">Notifications should include the following
content:</ins></p>
<ul>
<li><ins class="diff-new">The</ins> <var title=""><ins class=
"diff-new">title</ins></var> ,<var title=""><ins class=
"diff-new">subtitle</ins></var> ,<ins class="diff-new">and</ins>
<var title=""><ins class="diff-new">description</ins></var>
<ins class="diff-new">strings passed to the method. They may be
truncated or abbreviated if necessary.</ins></li>
<li><ins class="diff-new">The</ins> <a href="#application-name"
title="meta-application-name"><ins class="diff-new">application
name</ins></a> ,<ins class="diff-new">if available, or else
the</ins> <a href="#document.title" title=
"dom-document-title"><ins class="diff-new">document title</ins></a>
,<ins class="diff-new">of the</ins> <a href="#active"><ins class=
"diff-new">active</ins> document</a> <ins class="diff-new">of
the</ins> <a href="#browsing1"><ins class="diff-new">browsing
context</ins></a> <ins class="diff-new">associated with the</ins>
<a href="#script2"><ins class="diff-new">script execution
context</ins></a> <ins class="diff-new">of the script that invoked
the method.</ins></li>
<li><ins class="diff-new">An icon chosen from the</ins> <a href=
"#links1" title="external resource link"><ins class=
"diff-new">external resource links</ins></a> <ins class=
"diff-new">of type</ins> <code title="rel-icon"><a href=
"#icon3"><ins class="diff-new">icon</ins></a></code> ,<ins class=
"diff-new">if any are available.</ins></li>
</ul>
<p><ins class="diff-new">If a new notification from one</ins>
<a href="#browsing1"><ins class="diff-new">browsing
context</ins></a> <ins class="diff-new">has</ins> <var title=
""><ins class="diff-new">title</ins></var> ,<var title=
""><ins class="diff-new">subtitle</ins></var> ,<ins class=
"diff-new">and</ins> <var title=""><ins class=
"diff-new">description</ins></var> <ins class="diff-new">strings
that are identical</ins> to <del class="diff-old">whatever
media</del> <ins class="diff-chg">the</ins> <var title=
""><ins class="diff-chg">title</ins></var> ,<var title=
""><ins class="diff-chg">subtitle</ins></var> ,<ins class=
"diff-chg">and</ins> <var title=""><ins class=
"diff-chg">description</ins></var> <ins class="diff-chg">strings of
an already-active notification from the same</ins> <a href=
"#browsing1"><ins class="diff-chg">browsing context</ins></a>
<ins class="diff-chg">or another</ins> <a href="#browsing1" title=
"browsing context"><ins class="diff-chg">browsing context</ins></a>
<ins class="diff-chg">with the same</ins> <a href=
"#origin0"><ins class="diff-chg">origin</ins></a> , the user
<del class="diff-old">might want.)</del> <ins class=
"diff-chg">agent should not display the new notification, but
should instead add an indicator to the already-active notification
that another identical notification would otherwise have been
shown.</ins></p>
<div class="example">
<p><ins class="diff-chg">For instance, if a user has his mail
application open in three windows, and thus the same "New Mail"
notification is fired three times each time a mail is received,
instead of displaying three identical notifications each time, the
user agent could just show one, with the title "New Mail
x3".</ins></p>
</div>
<p><ins class="diff-chg">Notifications should have a lifetime based
on the platform conventions for notifications. However, the
lifetime of a notification should not begin until the user has had
the opportunity to see it, so if a notification is spawned for
a</ins> <a href="#browsing1"><ins class="diff-chg">browsing
context</ins></a> <ins class="diff-chg">that is hidden, it should
be shown for its complete lifetime once the user brings that</ins>
<a href="#browsing1"><ins class="diff-chg">browsing
context</ins></a> <ins class="diff-chg">into view.</ins></p>
<p><ins class="diff-chg">User agents should support multiple
notifications at once.</ins></p>
<p><ins class="diff-chg">User agents should support user
interaction with notifications, if and as appropriate given the
platform conventions. If a user activates a notification, and
the</ins> <var title=""><ins class="diff-chg">onclick</ins></var>
<ins class="diff-chg">callback argument was present and is not
null, then the</ins> <a href="#browsing1"><ins class=
"diff-chg">browsing context</ins></a> <ins class=
"diff-chg">associated with the</ins> <a href="#script2"><ins class=
"diff-chg">script execution context</ins></a> <ins class=
"diff-chg">of the function given by</ins> <var title=""><ins class=
"diff-chg">onclick</ins></var> <ins class="diff-chg">should be
brought to the user's attention, and the</ins> <var title=
""><ins class="diff-chg">onclick</ins></var> <ins class=
"diff-chg">callback should then be invoked.</ins></p>
<h3 id="browser"><span class="secno"><del class=
"diff-old">4.5.</del> <ins class="diff-chg">4.6</ins></span>
Browser state</h3>
<p>The <dfn id="navigator" title=
"dom-navigator"><code>navigator</code></dfn> attribute of the
<code><a href="#window">Window</a></code> interface must return an
instance of the <code><a href=
"#clientinformation">ClientInformation</a></code> interface, which
represents the identity and state of the user agent (the client),
and allows Web pages to register themselves as potential protocol
and content handlers:</p>
<pre class="idl">
interface <dfn id="clientinformation">ClientInformation</dfn> {
readonly attribute boolean <a href="#navigator.online" title=
"dom-navigator-onLine">onLine</a>;
void <a href="#registerprotocolhandler" title=
"dom-navigator-registerProtocolHandler">registerProtocolHandler</a>(in DOMString protocol, in DOMString uri, in DOMString title);
void <a href="#registercontenthandler" title=
"dom-navigator-registerContentHandler">registerContentHandler</a>(in DOMString mimeType, in DOMString uri, in DOMString title);
};
</pre>
<h4 id="custom-handlers"><span class="secno"><del class=
"diff-old">4.5.1.</del> <ins class="diff-chg">4.6.1</ins></span>
Custom protocol and content handlers</h4>
<p>The <dfn id="registerprotocolhandler" title=
"dom-navigator-registerProtocolHandler"><code>registerProtocolHandler()</code></dfn>
method allows Web sites to register themselves as possible handlers
for particular protocols. For example, an online fax service could
register itself as a handler of the <code>fax:</code> protocol (
<a href="#references">[RFC2806]</a> ), so that if the user clicks
on such a link, he is given the opportunity to use that Web site.
Analogously, the <dfn id="registercontenthandler" title=
"dom-navigator-registerContentHandler"><code>registerContentHandler()</code></dfn>
method allows Web sites to register themselves as possible handlers
for content in a particular MIME type. For example, the same online
fax service could register itself as a handler for
<code>image/g3fax</code> files ( <a href=
"#references">[RFC1494]</a> ), so that if the user has no native
application capable of handling G3 Facsimile byte streams, his Web
browser can instead suggest he use that site to view the image.</p>
<p>User agents may, within the constraints described in this
section, do whatever they like when the methods are called. A UA
could, for instance, prompt the user and offer the user the
opportunity to add the site to a shortlist of handlers, or make the
handlers his default, or cancel the request. UAs could provide such
a UI through modal UI or through a non-modal transient notification
interface. UAs could also simply silently collect the information,
providing it only when relevant to the user.</p>
<p>There is <a href="#sample-handler-impl">an example of how these
methods could be presented to the user</a> below.</p>
<p>The arguments to the methods have the following meanings:</p>
<dl>
<dt><var title="">protocol</var> ( <code title=
"dom-navigator-registerProtocolHandler"><a href=
"#registerprotocolhandler">registerProtocolHandler()</a></code>
only)</dt>
<dd>
<p>A scheme, such as <code>ftp</code> or <code>fax</code> . The
scheme must be treated case-insensitively by user agents for the
purposes of comparing with the scheme part of URIs that they
consider against the list of registered handlers.</p>
<p>The <var title="">protocol</var> value, if it contains a colon
(as in " <code>ftp:</code> "), will never match anything, since
schemes don't contain colons.</p>
</dd>
<dt><var title="">mimeType</var> ( <code title=
"dom-navigator-registerContentHandler"><a href=
"#registercontenthandler">registerContentHandler()</a></code>
only)</dt>
<dd>
<p>A MIME type, such as <code>model/vrml</code> or
<code>text/richtext</code> . The MIME type must be treated
case-insensitively by user agents for the purposes of comparing
with MIME types of documents that they consider against the list of
registered handlers.</p>
<p>User agents must compare the given values only to the MIME
type/subtype parts of content types, not to the complete type
including parameters. Thus, if <var title="">mimeType</var> values
passed to this method include characters such as commas or
whitespace, or include MIME parameters, then the handler being
registered will never be used.</p>
</dd>
<dt><var title="">uri</var></dt>
<dd>
<p>The URI of the page that will handle the requests. When the user
agent uses this URI, it must replace the first occurrence of the
exact literal string " <code>%s</code> " with an escaped version of
the URI of the content in question (as defined below), and then
fetch the resulting URI using the GET method (or equivalent for
non-HTTP URIs).</p>
<p>To get the escaped version of the URI, first, the domain part of
the URI (if any) must be converted to its punycode representation,
and then, every character in the URI that is not in the ranges
given in the next paragraph must be replaced by its UTF-8 byte
representation, each byte being represented by a U+0025 (%)
character and two digits in the range U+0030 (0) to U+0039 (9) and
U+0041 (A) to U+0046 (F) giving the hexadecimal representation of
the byte.</p>
<p>The ranges of characters that must not be escaped are: U+002D
(-), U+002E (.), U+0030 (0) to U+0039 (9), U+0041 (A) to U+005A
(Z), U+005F (_), U+0061 (a) to U+007A (z), and U+007E (~).</p>
<div class="example">
<p>If the user had visited a site that made the following call:</p>
<pre>
navigator.registerContentHandler('application/x-soup',
'http://example.com/soup?url=%s',
'SoupWeb™')
</pre>
<p>...and then clicked on a link such as:</p>
<pre>
<a
href="http://www.example.net/chickenkïwi.soup">
Download
our
Chicken
Kiwi
soup!</a>
</pre>
<p>...then, assuming this <code>chickenkïwi.soup</code> file was
served with the MIME type <code>application/x-soup</code> , the UA
might navigate to the following URI:</p>
<pre>
http://example.com/soup?url=https%3A%2F%2F2.zoppoz.workers.dev%3A443%2Fhttp%2Fwww.example.net%2Fchickenk%C3%AFwi.soup
</pre>
<p>This site could then fetch the <code>chickenkïwi.soup</code>
file and do whatever it is that it does with soup <del class=
"diff-old">(synthesise</del> <ins class=
"diff-chg">(synthesize</ins> it and ship it to the user, or
whatever).</p>
</div>
</dd>
<dt><var title="">title</var></dt>
<dd>
<p>A descriptive title of the handler, which the UA might use to
remind the user what the site in question is.</p>
</dd>
</dl>
<p>User agents should raise <a href="#security9" title=
"security exception">security exceptions</a> if the methods are
called with <var title="">protocol</var> or <var title=
"">mimeType</var> values that the UA deems to be "privileged". For
example, a site attempting to register a handler for
<code>http</code> URIs or <code>text/html</code> content in a Web
browser would likely cause an exception to be raised.</p>
<p>User agents must raise a <code>SYNTAX_ERR</code> exception if
the <var title="">uri</var> argument passed to one of these methods
does not contain the exact literal string " <code>%s</code> ".</p>
<p>User agents must not raise any other exceptions (other than
binding-specific exceptions, such as for an incorrect number of
arguments in an ECMAScript implementation).</p>
<p>This section does not define how the pages registered by these
methods are used, beyond the requirements on how to process the
<var title="">uri</var> value (see above). To some extent, the
<a href="#navigate" title="navigate">processing model for
navigating across documents</a> defines some cases where these
methods are relevant, but in general UAs may use this information
wherever they would otherwise consider handing content to native
plugins or helper applications.</p>
<p>UAs must not use registered content handlers to handle content
that was returned as part of a non-GET transaction (or rather, as
part of any non-idempotent transaction), as the remote site would
not be able to fetch the same data.</p>
<h5 id="security5"><span class="secno"><del class=
"diff-old">4.5.1.1.</del> <ins class=
"diff-chg">4.6.1.1.</ins></span> Security and privacy</h5>
<p>These mechanisms can introduce a number of concerns, in
particular privacy concerns.</p>
<p><strong>Hijacking all Web usage.</strong> User agents should not
allow protocols that are key to its normal operation, such as
<code>http</code> or <code>https</code> , to be rerouted through
third-party sites. This would allow a user's activities to be
trivially tracked, and would allow user information, even in secure
connections, to be collected.</p>
<p><strong>Hijacking defaults.</strong> It is strongly recommended
that user agents do not automatically change any defaults, as this
could lead the user to send data to remote hosts that the user is
not expecting. New handlers registering themselves should never
automatically cause those sites to be used.</p>
<p><strong>Registration spamming.</strong> User agents should
consider the possibility that a site will attempt to register a
large number of handlers, possibly from multiple domains (e.g. by
redirecting through a series of pages each on a different domain,
and each registering a handler for <code>video/mpeg</code> —
analogous practices abusing other Web browser features have been
used by pornography Web sites for many years). User agents should
gracefully handle such hostile attempts, protecting the user.</p>
<p><strong>Misleading titles.</strong> User agents should not rely
<del class="diff-old">wholy</del> <ins class=
"diff-chg">wholly</ins> on the <var title="">title</var> argument
to the methods when presenting the registered handlers to the user,
since sites could easily lie. For example, a site
<code>hostile.example.net</code> could claim that it was
registering the "Cuddly Bear Happy Content Handler". User agents
should therefore use the handler's domain in any UI along with any
title.</p>
<p><strong>Hostile handler metadata.</strong> User agents should
protect against typical attacks against strings embedded in their
interface, for example ensuring that markup or escape characters in
such strings are not executed, that null bytes are properly
handled, that over-long strings do not cause crashes or buffer
overruns, and so forth.</p>
<p><strong>Leaking Intranet URIs.</strong> The mechanism described
in this section can result in secret Intranet URIs being leaked, in
the following manner:</p>
<ol>
<li>The user registers a third-party content handler as the default
handler for a content type.</li>
<li>The user then browses his corporate Intranet site and accesses
a document that uses that content type.</li>
<li>The user agent contacts the third party and hands the third
party the URI to the Intranet content.</li>
</ol>
<p>No actual confidential file data is leaked in this manner, but
the URIs themselves could contain confidential information. For
example, the URI could be
<code>https://www.corp.example.com/upcoming-aquisitions/samples.egf</code>
, which might tell the third party that Example Corporation is
intending to merge with Samples LLC. Implementors might wish to
consider allowing administrators to disable this feature for
certain subdomains, content types, or protocols.</p>
<p><strong>Leaking secure URIs.</strong> User agents should not
send HTTPS URIs to third-party sites registered as content
handlers, in the same way that user agents do not send
<code>Referer</code> headers from secure sites to third-party
sites.</p>
<p><strong>Leaking credentials.</strong> User agents must never
send username or password information in the URIs that are escaped
and included sent to the handler sites. User agents may even avoid
attempting to pass to Web-based handlers the URIs of resources that
are known to require authentication to access, as such sites would
be unable to access the resources in question without prompting the
user for credentials themselves (a practice that would require the
user to know whether to trust the third-party handler, a decision
many users are unable to make or even understand).</p>
<h5 id="sample-handler-impl"><span class="secno"><del class=
"diff-old">4.5.1.2.</del> <ins class=
"diff-chg">4.6.1.2.</ins></span> Sample user interface</h5>
<p><em>This section is non-normative.</em></p>
<p>A simple implementation of this feature for a desktop Web
browser might work as follows.</p>
<p>The <code title="dom-navigator-registerProtocolHandler"><a href=
"#registerprotocolhandler">registerProtocolHandler()</a></code>
method could display a modal dialog box:</p>
<pre>
||[ Protocol Handler Registration ]|||||||||||||||||||||||||||
| |
| This Web page: |
| |
| Kittens at work |
| http://kittens.example.org/ |
| |
| ...would like permission to handle the protocol "x-meow:" |
| using the following Web-based application: |
| |
| Kittens-at-work displayer |
| http://kittens.example.org/?show=%s |
| |
| Do you trust the administrators of the "kittens.example. |
| org" domain? |
| |
| ( Trust kittens.example.org ) (( Cancel )) |
|____________________________________________________________|
</pre>
<p>...where "Kittens at work" is the title of the page that invoked
the method, "http://kittens.example.org/" is the URI of that page,
"x-meow" is the string that was passed to the <code title=
"dom-navigator-registerProtocolHandler"><a href=
"#registerprotocolhandler">registerProtocolHandler()</a></code>
method as its first argument ( <var title="">protocol</var> ),
"http://kittens.example.org/?show=%s" was the second argument (
<var title="">uri</var> ), and "Kittens-at-work displayer" was the
third argument ( <var title="">title</var> ).</p>
<p>If the user clicks the Cancel button, then nothing further
happens. If the user clicks the "Trust" button, then the handler is
remembered.</p>
<p>When the user then attempts to fetch a URI that uses the
"x-meow:" scheme, then it might display a dialog as follows:</p>
<pre>
||[ Unknown Protocol ]||||||||||||||||||||||||||||||||||||||||
| |
| You have attempted to access: |
| |
| x-meow:S2l0dGVucyBhcmUgdGhlIGN1dGVzdCE%3D |
| |
| How would you like FerretBrowser to handle this resource? |
| |
| (o) Contact the FerretBrowser plugin registry to see if |
| there is an official way to handle this resource. |
| |
| ( ) Pass this URI to a local application: |
| [ /no application selected/ ] ( Choose ) |
| |
| ( ) Pass this URI to the "Kittens-at-work displayer" |
| application at "kittens.example.org". |
| |
| [ ] Always do this for resources using the "x-meow" |
| protocol in future. |
| |
| ( Ok ) (( Cancel )) |
|____________________________________________________________|
</pre>
<p>...where the third option is the one that was primed by the site
registering itself earlier.</p>
<p>If the user does select that option, then the browser, in
accordance with the requirements described in the previous two
sections, will redirect the user to
"http://kittens.example.org/?show=x-meow%3AS2l0dGVucyBhcmUgdGhlIGN1dGVzdCE%253D".</p>
<p>The <code title="dom-navigator-registerContentHandler"><a href=
"#registercontenthandler">registerContentHandler()</a></code>
method would work equivalently, but for unknown MIME types instead
of unknown protocols.</p>
<h3 id="offline"><span class="secno"><del class=
"diff-old">4.6.</del> <ins class="diff-chg">4.7</ins></span>
Offline Web applications</h3>
<h4 id="introduction1"><span class="secno"><del class=
"diff-old">4.6.1.</del> <ins class="diff-chg">4.7.1</ins></span>
Introduction</h4>
<p><em><ins class="diff-new">This section is
non-normative.</ins></em></p>
<p class="big-issue">...</p>
<h4 id="appcache"><span class="secno"><del class=
"diff-old">4.6.2.</del> <ins class="diff-chg">4.7.2</ins></span>
Application caches</h4>
<p>An <dfn id="application0">application cache</dfn> is a
collection of resources. An application cache is identified by the
URI of a resource manifest which is used to populate the cache.</p>
<p>Application caches are versioned, and there can be different
instances of caches for the same manifest URI, each having a
different version. A cache is newer than another if it was created
after the other (in other words, caches in a group have a
chronological order).</p>
<p>Each group of application caches for the same manifest URI have
a common <dfn id="update0" title="concept-appcache-status">update
status</dfn> , which is one of the following: <i>idle</i> ,
<i>checking</i> , <i>downloading</i> .</p>
<p id="appcache-history-1">A <a href="#browsing1">browsing
context</a> can be associated with an application cache. A <a href=
"#child">child browsing context</a> is always associated with the
same <del class="diff-old">browsing context</del> <ins class=
"diff-chg">application cache</ins> as its <a href="#parent">parent
browsing context</a> , if any. A <a href="#top-level">top-level
browsing context</a> is associated with the application cache
appropriate for its <a href="#active">active document</a> . (A
browsing context's associated cache thus can <a href=
"#appcache-history-2">change</a> during <a href="#traverse" title=
"traverse the history">session history traversal</a> .)</p>
<p>A <code>Document</code> initially has no appropriate cache, but
steps <a href="#parser-appcache">in the parser</a> and in the
<a href="#navigate" title="navigate">navigation</a> sections cause
<a href="#application2" title=
"concept-appcache-init-with-attribute">cache selection</a> to occur
early in the page load process.</p>
<p>An application cache consists of:</p>
<ul>
<li>
<p>One of more resources (including their out-of-band metadata,
such as HTTP headers, if any), identified by URIs, each falling
into one (or more) of the following categories:</p>
<dl>
<dt><dfn id="implicit" title="concept-appcache-implicit">Implicit
entries</dfn></dt>
<dd>Documents that were added to the cache because a <a href=
"#top-level">top-level browsing context</a> was <a href="#navigate"
title="navigate">navigated</a> to that document and the document
indicated that this was its cache, using the <code title=
"attr-html-manifest"><a href="#manifest">manifest</a></code>
attribute.</dd>
<dt><dfn id="the-manifest" title="concept-appcache-manifest">The
manifest</dfn></dt>
<dd>The resource corresponding to the URI that was given in an
implicit entry's <code><a href="#html">html</a></code> element's
<code title="attr-html-manifest"><a href=
"#manifest">manifest</a></code> attribute. The manifest is
downloaded and processed during the <a href=
"#application1">application cache update process</a> . All the
<a href="#implicit" title="concept-appcache-implicit">implicit
entries</a> have the <a href="#same-origin" title=
"same origin">same <del class="diff-old">scheme/host/port</del>
<ins class="diff-chg">origin</ins></a> as the manifest.</dd>
<dt><dfn id="explicit" title="concept-appcache-explicit">Explicit
entries</dfn></dt>
<dd>Resources that were listed in the cache's <a href=
"#the-manifest" title="concept-appcache-manifest">manifest</a> .
Explicit entries can also be marked as <dfn id="foreign" title=
"concept-appcache-foreign">foreign</dfn> , which means that they
have <del class="diff-old">an</del> <ins class="diff-chg">a</ins>
<code title="attr-html-manifest"><a href=
"#manifest">manifest</a></code> attribute but that it doesn't point
at this cache's <a href="#the-manifest" title=
"concept-appcache-manifest">manifest</a> .</dd>
<dt><dfn id="fallback0" title="concept-appcache-fallback">Fallback
entries</dfn></dt>
<dd>Resources that were listed in the cache's <a href=
"#the-manifest" title="concept-appcache-manifest">manifest</a> as
fallback entries.</dd>
<dt><dfn id="opportunistically" title=
"concept-appcache-oppcache">Opportunistically cached
entries</dfn></dt>
<dd>Resources whose URIs <a href="#matches" title=
"concept-appcache-matches-oppcache">matched</a> an <a href=
"#opportunistic" title="concept-appcache-oppcache-ns">opportunistic
caching namespace</a> when they were fetched, and were therefore
cached in the application cache.</dd>
<dt><dfn id="dynamic3" title="concept-appcache-dynamic">Dynamic
entries</dfn></dt>
<dd>Resources that were added to the cache by the <code title=
"dom-appcache-add"><a href="#adduri">add()</a></code> method.</dd>
</dl>
<p class="note">A URI in the list can be flagged with multiple
different types, and thus an entry can end up being <del class=
"diff-old">categorised</del> <ins class=
"diff-chg">categorized</ins> as multiple entries. For example, an
entry can be an explicit entry and a dynamic entry at the same
time.</p>
</li>
<li>Zero or more <dfn id="opportunistic" title=
"concept-appcache-oppcache-ns">opportunistic caching
namespaces</dfn> : URIs, used as <a href="#matches" title=
"concept-appcache-matches-oppcache">prefix match patterns</a> ,
each of which is mapped to a <a href="#fallback0" title=
"concept-appcache-fallback">fallback entry</a> . Each namespace URI
prefix, when parsed as a URI, has the <a href="#same-origin">same
<del class="diff-old">scheme/host/port</del> <ins class=
"diff-chg">origin</ins></a> as <a href="#the-manifest" title=
"concept-appcache-manifest">the manifest</a> .</li>
<li>Zero or more URIs that form the <dfn id="online" title=
"concept-appcache-onlinewhitelist">online whitelist</dfn> .</li>
</ul>
<p>Multiple application caches can contain the same resource, e.g.
if their manifests all reference that resource. If the user agent
is to <dfn id="select0" title="concept-appcache-selection">select
an application cache</dfn> from a list of caches that contain a
resource, that the user agent must use the application cache that
the user most likely wants to see the resource from, taking into
account the following:</p>
<ul>
<li>which application cache was most recently updated,</li>
<li>which application cache was being used to display the resource
from which the user decided to look at the new resource, and</li>
<li>which application cache the user prefers.</li>
</ul>
<h4 id="manifests"><span class="secno"><del class=
"diff-old">4.6.3.</del> <ins class="diff-chg">4.7.3</ins></span>
The cache manifest syntax</h4>
<h5 id="writing"><span class="secno"><del class=
"diff-old">4.6.3.1.</del> <ins class=
"diff-chg">4.7.3.1.</ins></span> Writing cache manifests</h5>
<p>Manifests must be served using the <code title=
"">text/cache-manifest</code> MIME type. All resources served using
the <code title="">text/cache-manifest</code> MIME type must follow
the syntax of application cache manifests, as described in this
section.</p>
<p>An application cache manifest is a text file, whose text is
encoded using UTF-8. Data in application cache manifests is
line-based. Newlines must be represented by U+000A LINE FEED (LF)
characters, U+000D CARRIAGE RETURN (CR) characters, or U+000D
CARRIAGE RETURN (CR) U+000A LINE FEED (LF) pairs.</p>
<p class="note">This is a willful double violation of RFC2046.
<a href="#references"><ins class="diff-new">[RFC2046]</ins></a></p>
<p>The first line of an application cache manifest must consist of
the string "CACHE", a single U+0020 SPACE character, the string
"MANIFEST", and zero or more U+0020 SPACE and U+0009 CHARACTER
TABULATION (tab) characters. <ins class="diff-new">The first line
may optionally be preceded by a U+FEFF BYTE ORDER MARK (BOM)
character.</ins> If any other text is found on the first line, the
user agent will ignore the entire file. <del class="diff-old">The
first line may optionally be preceded by a U+FEFF BYTE ORDER MARK
(BOM) character.</del></p>
<p>Subsequent lines, if any, must all be one of the following:</p>
<dl>
<dt>A blank line</dt>
<dd>
<p>Blank lines must consist of zero or more U+0020 SPACE and U+0009
CHARACTER TABULATION (tab) characters only.</p>
</dd>
<dt>A comment</dt>
<dd>
<p>Comment lines must consist of zero or more U+0020 SPACE and
U+0009 CHARACTER TABULATION (tab) characters, followed by a single
U+0023 NUMBER SIGN (#) character, followed by zero or more
characters other than U+000A LINE FEED (LF) and U+000D CARRIAGE
RETURN (CR) characters.</p>
<p class="note">Comments must be on a line on their own. If they
were to be included on a line with a URI, the "#" would be mistaken
for part of a fragment identifier.</p>
</dd>
<dt>A section header</dt>
<dd>
<p>Section headers change the current section. There are three
possible section headers:</p>
<dl>
<dt><code>CACHE:</code></dt>
<dd>Switches to the explicit section.</dd>
<dt><code>FALLBACK:</code></dt>
<dd>Switches to the fallback section.</dd>
<dt><code>NETWORK:</code></dt>
<dd>Switches to the online whitelist section.</dd>
</dl>
<p>Section header lines must consist of zero or more U+0020 SPACE
and U+0009 CHARACTER TABULATION (tab) characters, followed by one
of the names above (including the U+003A COLON (:) character)
followed by zero or more U+0020 SPACE and U+0009 CHARACTER
TABULATION (tab) characters.</p>
<p>Ironically, by default, the current section is the explicit
section.</p>
</dd>
<dt>Data for the current section</dt>
<dd>
<p>The format that data lines must take depends on the current
section.</p>
<p>When the current section is the explicit section or the online
whitelist section, data lines must consist of zero or more U+0020
SPACE and U+0009 CHARACTER TABULATION (tab) characters, a valid URI
reference or IRI <del class="diff-old">reference,</del> <ins class=
"diff-chg">reference to a resource other than the manifest
itself,</ins> and then zero or more U+0020 SPACE and U+0009
CHARACTER TABULATION (tab) characters. <a href=
"#references">[RFC3986]</a> <a href="#references">[RFC3987]</a></p>
<p>When the current section is the fallback section, data lines
must consist of zero or more U+0020 SPACE and U+0009 CHARACTER
TABULATION (tab) characters, a valid URI reference or IRI
<del class="diff-old">reference,</del> <ins class=
"diff-chg">reference to a resource other than the manifest
itself,</ins> one or more U+0020 SPACE and U+0009 CHARACTER
TABULATION (tab) characters, another valid URI reference or IRI
<del class="diff-old">reference,</del> <ins class=
"diff-chg">reference to a resource other than the manifest
itself,</ins> and then zero or more U+0020 SPACE and U+0009
CHARACTER TABULATION (tab) characters. <a href=
"#references">[RFC3986]</a> <a href="#references">[RFC3987]</a></p>
<p class="note"><ins class="diff-new">The URI or IRI references in
data lines can't be empty strings, since those would be relative
URIs to the manifest itself. Such lines would be confused with
blank or invalid lines, anyway.</ins></p>
</dd>
</dl>
<p>Manifests may contain sections more than once. Sections may be
empty.</p>
<p>URIs that are to be fallback pages associated with <a href=
"#opportunistic" title="concept-appcache-oppcache-ns">opportunistic
caching namespaces</a> , and those namespaces themselves, must be
given in fallback sections, with the namespace being the first URI
of the data line, and the corresponding fallback page being the
second URI. All the other pages to be cached must be listed in
explicit sections.</p>
<p><a href="#opportunistic" title=
"concept-appcache-oppcache-ns">Opportunistic caching namespaces</a>
must have the <a href="#same-origin">same <del class=
"diff-old">scheme/host/port</del> <ins class=
"diff-chg">origin</ins></a> as the manifest itself.</p>
<p>An opportunistic caching namespace must not be listed more than
once.</p>
<p>URIs that the user agent is to put into the <a href="#online"
title="concept-appcache-onlinewhitelist">online whitelist</a> must
all be specified in online whitelist sections. (This is needed for
any URI that the page is intending to use to communicate back to
the server.)</p>
<p>URIs in the online whitelist section must not also be listed in
explicit section, and must not be listed as fallback entries in the
fallback section. (URIs in the online whitelist section may match
opportunistic caching namespaces, however.)</p>
<p>Relative URIs must be given relative to the manifest's own
URI.</p>
<p>URIs in manifests must not have fragment identifiers.</p>
<h5 id="parsing0"><span class="secno"><del class=
"diff-old">4.6.3.2.</del> <ins class=
"diff-chg">4.7.3.2.</ins></span> Parsing cache manifests</h5>
<p>When a user agent is to <dfn id="parse0">parse a manifest</dfn>
, it means that the user agent must run the following steps:</p>
<ol>
<li>
<p>The user agent must decode the <del class=
"diff-old">bytestream</del> <ins class="diff-chg">byte stream</ins>
corresponding with the manifest to be parsed, treating it as UTF-8.
Bytes or sequences of bytes that are not valid UTF-8 sequences must
be interpreted as a U+FFFD REPLACEMENT CHARACTER. <del class=
"diff-old">All U+0000 NULL characters must be replaced by U+FFFD
REPLACEMENT CHARACTERs.</del></p>
</li>
<li>
<p>Let <var title="">explicit URIs</var> be an initially empty list
of <a href="#explicit" title="concept-appcache-explicit">explicit
entries</a> .</p>
</li>
<li>
<p>Let <var title="">fallback URIs</var> be an initially empty
mapping of <a href="#opportunistic" title=
"concept-appcache-oppcache-ns">opportunistic caching namespaces</a>
to <a href="#fallback0" title="concept-appcache-fallback">fallback
entries</a> .</p>
</li>
<li>
<p>Let <var title="">online whitelist URIs</var> be an initially
empty list of URIs for a <a href="#online" title=
"concept-appcache-onlinewhitelist">online whitelist</a> .</p>
</li>
<li>
<p>Let <var title="">input</var> be the decoded text of the
manifest's <del class="diff-old">bytestream.</del> <ins class=
"diff-chg">byte stream.</ins></p>
</li>
<li>
<p>Let <var title="">position</var> be a pointer into <var title=
"">input</var> , initially pointing at the first character.</p>
</li>
<li>
<p>If <var title="">position</var> is pointing at a U+FEFF BYTE
ORDER MARK (BOM) character, then advance <var title=
"">position</var> to the next character.</p>
</li>
<li>
<p>If the characters starting from <var title="">position</var> are
"CACHE", followed by a U+0020 SPACE character, followed by
"MANIFEST", then advance <var title="">position</var> to the next
character after those. Otherwise, this isn't a cache manifest;
abort this algorithm with a failure while checking for the magic
signature.</p>
</li>
<li>
<p><a href="#collect">Collect a sequence of characters</a> that are
U+0020 SPACE or U+0009 CHARACTER TABULATION (tab) characters.</p>
</li>
<li>
<p>If <var title="">position</var> is not past the end of
<var title="">input</var> and the character at <var title=
"">position</var> is neither a U+000A LINE FEED (LF) characters nor
a U+000D CARRIAGE RETURN (CR) character, then this isn't a cache
manifest; abort this algorithm with a failure while checking for
the magic signature.</p>
</li>
<li>
<p>This is a cache manifest. The algorithm cannot fail beyond this
point (though bogus lines can get ignored).</p>
</li>
<li>
<p>Let <var title="">mode</var> be "explicit".</p>
</li>
<li>
<p><em>Start of line</em> : If <var title="">position</var> is past
the end of <var title="">input</var> , then jump to the last step.
Otherwise, <a href="#collect">collect a sequence of characters</a>
that are U+000A LINE FEED (LF), U+000D CARRIAGE RETURN (CR), U+0020
SPACE, or U+0009 CHARACTER TABULATION (tab) characters.</p>
</li>
<li>
<p>Now, <a href="#collect">collect a sequence of characters</a>
that are <em>not</em> U+000A LINE FEED (LF) or U+000D CARRIAGE
RETURN (CR) characters, and let the result be <var title=
"">line</var> .</p>
</li>
<li>
<p><ins class="diff-new">Drop any trailing U+0020 SPACE, or U+0009
CHARACTER TABULATION (tab) characters at the end of</ins>
<var title=""><ins class="diff-new">line</ins></var> .</p>
</li>
<li>
<p><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">line</ins></var> <ins class="diff-new">is the empty
string, then jump back to the step labeled "start of
line".</ins></p>
</li>
<li>
<p>If the first character in <var title="">line</var> is a U+0023
NUMBER SIGN (#) character, then jump back to the step <del class=
"diff-old">labelled</del> <ins class="diff-chg">labeled</ins>
"start of line".</p>
</li>
<li>
<p><del class="diff-old">Drop any trailing U+0020 SPACE, or U+0009
CHARACTER TABULATION (tab) characters at the end of line .</del> If
<var title="">line</var> equals "CACHE:" (the word "CACHE" followed
by a U+003A COLON (:) character), then set <var title="">mode</var>
to "explicit" and jump back to the step <del class=
"diff-old">labelled</del> <ins class="diff-chg">labeled</ins>
"start of line".</p>
</li>
<li>
<p>If <var title="">line</var> equals "FALLBACK:" (the word
"FALLBACK" followed by a U+003A COLON (:) character), then set
<var title="">mode</var> to "fallback" and jump back to the step
<del class="diff-old">labelled</del> <ins class=
"diff-chg">labeled</ins> "start of line".</p>
</li>
<li>
<p>If <var title="">line</var> equals "NETWORK:" (the word
"NETWORK" followed by a U+003A COLON (:) character), then set
<var title="">mode</var> to "online whitelist" and jump back to the
step <del class="diff-old">labelled</del> <ins class=
"diff-chg">labeled</ins> "start of line".</p>
</li>
<li>
<p>This is either a data line or it is syntactically incorrect.</p>
<dl class="switch">
<dt>If <var title="">mode</var> is "explicit"</dt>
<dd>
<p>If <var title="">line</var> is not a syntactically <del class=
"diff-old">valid</del> <ins class="diff-chg">correct</ins> URI
reference or IRI reference, then jump back to the step <del class=
"diff-old">labelled</del> <ins class="diff-chg">labeled</ins>
"start of line".</p>
<p>Otherwise, resolve the URI reference or IRI reference to an
absolute URI or IRI, and drop the fragment identifier, if any.</p>
<p>Now, if the resource's URI has a different <scheme>
component than the manifest's <del class="diff-old">URI,</del>
<ins class="diff-chg">URI (compared case-insensitively),</ins> then
jump back to the step <del class="diff-old">labelled</del>
<ins class="diff-chg">labeled</ins> "start of line".</p>
<p>Otherwise, add this URI to the <var title="">explicit URIs</var>
.</p>
</dd>
<dt>If <var title="">mode</var> is "fallback"</dt>
<dd>
<p>If <var title="">line</var> does not contain at least one U+0020
SPACE or U+0009 CHARACTER TABULATION (tab) character, then jump
back to the step <del class="diff-old">labelled</del> <ins class=
"diff-chg">labeled</ins> "start of line".</p>
<p>Otherwise, let everything before the first U+0020 SPACE or
U+0009 CHARACTER TABULATION (tab) character in <var title=
"">line</var> be <var title="">part one</var> , and let everything
after the first U+0020 SPACE or U+0009 CHARACTER TABULATION (tab)
character in <var title="">line</var> be <var title="">part
two</var> .</p>
<p>Strip any leading U+0020 SPACE or U+0009 CHARACTER TABULATION
(tab) characters in <var title="">part two</var> .</p>
<p>If <var title="">part one</var> and <var title="">part two</var>
are not both syntactically <del class="diff-old">valid</del>
<ins class="diff-chg">correct</ins> URI or IRI references, then
jump back to the step <del class="diff-old">labelled</del>
<ins class="diff-chg">labeled</ins> "start of line".</p>
<p>Resolve the URI or IRI references in <var title="">part
one</var> and <var title="">part two</var> to absolute URIs or
<del class="diff-old">IRIs.</del> <ins class="diff-chg">IRIs, and
drop the fragment identifiers, if any.</ins></p>
<p>If the absolute URI or IRI corresponding to <var title="">part
one</var> is already in the <var title="">fallback URIs</var>
mapping as an <a href="#opportunistic" title=
"concept-appcache-oppcache-ns">opportunistic caching namespace</a>
, then jump back to the step <del class="diff-old">labelled</del>
<ins class="diff-chg">labeled</ins> "start of line".</p>
<p>If the absolute URI or IRI corresponding to <var title="">part
one</var> does not have the <a href="#same-origin">same <del class=
"diff-old">scheme/host/port</del> <ins class=
"diff-chg">origin</ins></a> as the manifest's URI, then jump back
to the step <del class="diff-old">labelled</del> <ins class=
"diff-chg">labeled</ins> "start of line".</p>
<p>If the absolute URI or IRI corresponding to <var title="">part
two</var> has a different <scheme> component than the
manifest's <del class="diff-old">URI,</del> <ins class=
"diff-chg">URI (compared case-insensitively ),</ins> then jump back
to the step <del class="diff-old">labelled</del> <ins class=
"diff-chg">labeled</ins> "start of line".</p>
<p>Otherwise, add the absolute URI or IRI corresponding to
<var title="">part one</var> to the <var title="">fallback
URIs</var> mapping as an <a href="#opportunistic" title=
"concept-appcache-oppcache-ns">opportunistic caching namespace</a>
, mapped to the absolute URI corresponding to <var title="">part
two</var> as the <a href="#fallback0" title=
"concept-appcache-fallback">fallback entry</a> .</p>
</dd>
<dt>If <var title="">mode</var> is "online whitelist"</dt>
<dd>
<p>If <var title="">line</var> is not a syntactically <del class=
"diff-old">valid</del> <ins class="diff-chg">correct</ins> URI
reference or IRI reference, then jump back to the step <del class=
"diff-old">labelled</del> <ins class="diff-chg">labeled</ins>
"start of line".</p>
<p>Otherwise, resolve the URI reference or IRI reference to an
absolute URI or IRI, and drop the fragment identifier, if any.</p>
<p>Now, if the resource's URI has a different <scheme>
component than the manifest's URI, then jump back to the step
<del class="diff-old">labelled</del> <ins class=
"diff-chg">labeled</ins> "start of line".</p>
<p>Otherwise, add this URI to the <var title="">online whitelist
URIs</var> .</p>
</dd>
</dl>
</li>
<li>
<p>Jump back to the step <del class="diff-old">labelled</del>
<ins class="diff-chg">labeled</ins> "start of line". (That step
jumps to the next, and last, step when the end of the file is
reached.)</p>
</li>
<li>
<p>Return the <var title="">explicit URIs</var> list, the
<var title="">fallback URIs</var> mapping, and the <var title=
"">online whitelist URIs</var> .</p>
</li>
</ol>
<p>Relative URI references and IRI references resolved to absolute
URIs or IRIs in the above algorithm must <del class=
"diff-old">use</del> <ins class="diff-chg">be resolved according to
section 5.1 of RFC3986 (i.e. relative to</ins> the <del class=
"diff-old">manifest's</del> <ins class="diff-chg">base</ins> URI
<del class="diff-old">as</del> <ins class="diff-chg">from the
encapsulating entity or</ins> the <del class="diff-old">Base</del>
URI <del class="diff-old">from</del> <ins class="diff-chg">used to
retrieve</ins> the <del class="diff-old">Retrieval</del>
<ins class="diff-chg">entity, since there is no way to embed a
base</ins> URI <del class="diff-old">for</del> <ins class=
"diff-chg">in</ins> the <del class="diff-old">purposes reference
resolution as defined by RFC 3986.</del> <ins class=
"diff-chg">manifest itself).</ins> <a href=
"#references">[RFC3986]</a></p>
<p class="note">If a resource is listed in both the online
whitelist and in the explicit section, then that resource will be
downloaded and cached, but when the page tries to use this
resource, the user agent will ignore the cached copy and attempt to
fetch the file from the network. Indeed, the cached copy will only
be used if it is opened from a top-level browsing context.</p>
<h4 id="updating1"><span class="secno"><del class=
"diff-old">4.6.4.</del> <ins class="diff-chg">4.7.4</ins></span>
Updating an application cache</h4>
<p>When the user agent is required (by other parts of this
specification) to start the <dfn id="application1">application
cache update process</dfn> , the user agent must run the following
steps:</p>
<p class="big-issue">the event stuff needs to be more consistent --
something about showing every step of the ui or no steps or
something; and we need to deal with showing ui for browsing
contexts that open when an update is already in progress, and we
may need to give applications control over the ui the first time
they cache themselves (right now the original cache is done without
notifications to the browsing contexts)</p>
<ol>
<li>
<p>Let <var title="">manifest URI</var> be the URI of the <a href=
"#the-manifest" title="concept-appcache-manifest">manifest</a> of
the cache to be updated.</p>
</li>
<li>
<p>Let <var title="">cache group</var> be the group of <a href=
"#application0" title="application cache">application caches</a>
identified by <var title="">manifest URI</var> .</p>
</li>
<li>
<p>Let <var title="">cache</var> be the most recently updated
<a href="#application0">application cache</a> identified by
<var title="">manifest URI</var> (that is, the newest version found
in <var title="">cache group</var> ).</p>
</li>
<li>
<p>If the <a href="#update0" title=
"concept-appcache-status">status</a> of the <var title="">cache
group</var> is either <i>checking</i> or <i>downloading</i> , then
abort these steps, as an update is already in progress for them.
Otherwise, set the <a href="#update0" title=
"concept-appcache-status">status</a> of this group of caches to
<i>checking</i> . This entire step must be performed as one atomic
operation so as to avoid race conditions.</p>
</li>
<li>
<p>If there is already a resource with the URI of <var title=
"">manifest URI</var> in <var title="">cache</var> , and that
resource is <del class="diff-old">categorised</del> <ins class=
"diff-chg">categorized</ins> as a <a href="#the-manifest" title=
"concept-appcache-manifest">manifest</a> , then this is an <dfn id=
"upgrade" title="concept-appcache-upgrade">upgrade attempt</dfn> .
Otherwise, this is a <dfn id="cache" title=
"concept-appcache-cache">cache attempt</dfn> .</p>
<p class="note">If this is a <a href="#cache" title=
"concept-appcache-cache">cache attempt</a> , then <var title=
"">cache</var> is forcibly the only application cache in
<var title="">cache group</var> , and it hasn't ever been populated
from its manifest (i.e. this update is an attempt to download the
application for the first time). It also can't have any browsing
contexts associated with it.</p>
</li>
<li>
<p><a href="#firing2">Fire a simple event</a> called <code title=
"event-checking">checking</code> at the <code><a href=
"#applicationcache">ApplicationCache</a></code> singleton of each
<a href="#top-level">top-level browsing context</a> that is
associated with a cache in <var title="">cache group</var> . The
default action of this event should be the display of some sort of
user interface indicating to the user that the user agent is
checking for the availability of updates.</p>
</li>
<li>
<p>Fetch the resource from <var title="">manifest URI</var> , and
let <var title="">manifest</var> be that resource.</p>
<p>If the resource is <del class="diff-old">labelled</del>
<ins class="diff-chg">labeled</ins> with the MIME type <code title=
"">text/cache-manifest</code> , parse <var title="">manifest</var>
according to the <a href="#parse0" title="parse a manifest">rules
for parsing manifests</a> , obtaining a list of <a href="#explicit"
title="concept-appcache-explicit">explicit entries</a> , <a href=
"#fallback0" title="concept-appcache-fallback">fallback entries</a>
and the <a href="#opportunistic" title=
"concept-appcache-oppcache-ns">opportunistic caching namespaces</a>
that map to them, and entries for the <a href="#online" title=
"concept-appcache-onlinewhitelist">online whitelist</a> .</p>
</li>
<li>
<p>If the previous step fails (e.g. the server returns a 4xx or 5xx
response or equivalent, or there is a DNS error, or the connection
times out, or the <ins class="diff-new">user cancels the download,
or the</ins> parser for manifests fails when checking the magic
signature), or if the resource is <del class=
"diff-old">labelled</del> <ins class="diff-chg">labeled</ins> with
a MIME type other than <code title="">text/cache-manifest</code> ,
then run <del class="diff-old">these substeps: Fire a simple event
called error at the ApplicationCache singleton of each top-level
browsing context that is associated with a cache in cache group .
The default action of this event should be the display of some sort
of user interface indicating to the user that the user agent failed
to save</del> the <del class="diff-old">application for offline
use. If this is a cache attempt , then discard</del> <a href=
"#cache0">cache <del class="diff-old">and abort the update process,
optionally alerting the user to the failure. Otherwise, jump to the
last step in the overall set of</del> <ins class=
"diff-chg">failure</ins> steps <del class="diff-old">of the update
process.</del></a> .</p>
</li>
<li>
<p>If this is an <a href="#upgrade" title=
"concept-appcache-upgrade">upgrade attempt</a> and the newly
downloaded <var title="">manifest</var> is byte-for-byte identical
to the manifest found in <var title="">cache</var> , or if the
server reported it as "304 Not Modified" or equivalent, then
<ins class="diff-new">run these substeps:</ins></p>
<ol>
<li>
<p><a href="#firing2"><del class="diff-old">fire</del> <ins class=
"diff-chg">Fire</ins> a simple event</a> called <code title=
"event-noupdate">noupdate</code> at the <code><a href=
"#applicationcache">ApplicationCache</a></code> singleton of each
<a href="#top-level">top-level browsing context</a> that is
associated with a cache in <var title="">cache group</var> . The
default action of this event should be the display of some sort of
user interface indicating to the user that the application is up to
date. <del class="diff-old">Then, jump</del></p>
</li>
<li>
<p><ins class="diff-chg">If there are any pending downloads
of</ins> <span title="implicit entry"><ins class=
"diff-chg">implicit entries</ins></span> <ins class="diff-chg">that
are being stored in the cache, then wait for all of them</ins> to
<ins class="diff-new">have completed. If any of these downloads
fail (e.g.</ins> the <del class="diff-old">last step</del>
<ins class="diff-chg">server returns a 4xx or 5xx response or
equivalent, or there is a DNS error, or the connection times out,
or the user cancels the download), then run the</ins> <a href=
"#cache0"><ins class="diff-chg">cache failure steps</ins></a> .</p>
</li>
<li>
<p><ins class="diff-chg">Let the</ins> <a href="#update0" title=
"concept-appcache-status"><ins class="diff-chg">status</ins></a> of
the <ins class="diff-new">group of caches to which</ins>
<var title=""><ins class="diff-new">cache</ins></var> <ins class=
"diff-new">belongs be</ins> <i><ins class="diff-new">idle</ins></i>
.<ins class="diff-new">If appropriate, remove any user interface
indicating that an update for this cache is in progress.</ins></p>
</li>
<li>
<p><ins class="diff-new">Abort the</ins> update process.</p>
</li>
</ol>
</li>
<li>
<p>Set the <a href="#update0" title=
"concept-appcache-status">status</a> of <var title="">cache
group</var> to <i>downloading</i> .</p>
</li>
<li>
<p><a href="#firing2">Fire a simple event</a> called <code title=
"event-downloading">downloading</code> at the <code><a href=
"#applicationcache">ApplicationCache</a></code> singleton of each
<a href="#top-level">top-level browsing context</a> that is
associated with a cache in <var title="">cache group</var> . The
default action of this event should be the display of some sort of
user interface indicating to the user that a new version is being
downloaded.</p>
</li>
<li>
<p>If this is an <a href="#upgrade" title=
"concept-appcache-upgrade">upgrade attempt</a> , then let
<var title="">new cache</var> be a newly created <a href=
"#application0">application cache</a> identified by <span title=
"">manifest URI</span> , being a new version in <var title="">cache
group</var> . Otherwise, let <var title="">new cache</var> and
<var title="">cache</var> be the same version of the application
cache.</p>
</li>
<li>
<p>Let <var title="">file list</var> be an empty list of URIs with
flags.</p>
</li>
<li>
<p>Add all the URIs in the list of <a href="#explicit" title=
"concept-appcache-explicit">explicit entries</a> obtained by
parsing <var title="">manifest</var> to <var title="">file
list</var> , each flagged with "explicit entry".</p>
</li>
<li>
<p>Add all the URIs in the list of <a href="#fallback0" title=
"concept-appcache-fallback">fallback entries</a> obtained by
parsing <var title="">manifest</var> to <var title="">file
list</var> , each flagged with "fallback entry".</p>
</li>
<li>
<p>If this is an <a href="#upgrade" title=
"concept-appcache-upgrade">upgrade attempt</a> , then add all the
URIs of <a href="#opportunistically" title=
"concept-appcache-oppcache">opportunistically cached entries</a> in
<var title="">cache</var> that <a href="#matches" title=
"concept-appcache-matches-oppcache">match</a> the <a href=
"#opportunistic" title="concept-appcache-oppcache-ns">opportunistic
caching namespaces</a> obtained by parsing <var title=
"">manifest</var> to <var title="">file list</var> , each flagged
with "opportunistic entry".</p>
</li>
<li>
<p>If this is an <a href="#upgrade" title=
"concept-appcache-upgrade">upgrade attempt</a> , then add all the
URIs of <a href="#implicit" title=
"concept-appcache-implicit">implicit entries</a> in <var title=
"">cache</var> to <var title="">file list</var> , each flagged with
"implicit entry".</p>
</li>
<li>
<p>If this is an <a href="#upgrade" title=
"concept-appcache-upgrade">upgrade attempt</a> , then add all the
URIs of <a href="#dynamic3" title=
"concept-appcache-dynamic">dynamic entries</a> in <var title=
"">cache</var> to <var title="">file list</var> , each flagged with
"dynamic entry".</p>
</li>
<li>
<p>If any URI is in <var title="">file list</var> more than once,
then merge the entries into one entry for that URI, that entry
having all the flags that the original entries had.</p>
</li>
<li>
<p>For each URI in <var title="">file list</var> , run the
following <del class="diff-old">steps:</del> <ins class=
"diff-chg">steps. These steps may be run in parallel for two or
more of the URIs at a time.</ins></p>
<ol>
<li>
<p><a href="#firing2">Fire a simple event</a> called <code title=
"event-progress"><a href="#progress0">progress</a></code> at the
<code><a href="#applicationcache">ApplicationCache</a></code>
singleton of each <a href="#top-level">top-level browsing
context</a> that is associated with a cache in <var title="">cache
group</var> . The default action of this event should be the
display of some sort of user interface indicating to the user that
a file is being downloaded in preparation for updating the
application.</p>
</li>
<li>
<p>Fetch the resource. If this is an <a href="#upgrade" title=
"concept-appcache-upgrade">upgrade attempt</a> , then use
<var title="">cache</var> as an HTTP cache, and <del class=
"diff-old">honour</del> <ins class="diff-chg">honor</ins> HTTP
caching semantics (such as expiration, ETags, and so forth) with
respect to that cache. User agents may also have other caches in
place that are also honored. <ins class="diff-new">If the resource
in question is already being downloaded for other reasons then the
existing download process may be used for the purposes of this
step.</ins></p>
<p class="example"><ins class="diff-new">An example of a resource
that might already be being downloaded is a large image on a Web
page that is being seen for the first time. The image would get
downloaded to satisfy the</ins> <code><a href="#img"><ins class=
"diff-new">img</ins></a></code> <ins class="diff-new">element on
the page, as well as being listed in the cache manifest. According
to the previous paragraph, that image only need be downloaded once,
and it can be used both for the cache and for the rendered Web
page.</ins></p>
</li>
<li>
<p>If the previous steps fails (e.g. the server returns a 4xx or
5xx response or equivalent, or there is a DNS error, or the
connection times <del class="diff-old">out), then run these
substeps: Fire a simple event called error at the ApplicationCache
singleton of each top-level browsing context that is associated
with a cache in cache group . The default action of this event
should be the display of some sort of user interface indicating to
the user that</del> <ins class="diff-chg">out, or</ins> the user
<del class="diff-old">agent failed to save</del> <ins class=
"diff-chg">cancels</ins> the <del class="diff-old">application for
offline use. If this is a cache attempt ,</del> <ins class=
"diff-chg">download),</ins> then <del class="diff-old">discard
cache and abort the update process, optionally alerting the user to
the failure. Otherwise, jump to the last step in</del> <ins class=
"diff-chg">run</ins> the <del class="diff-old">overall set of</del>
<a href="#cache0"><ins class="diff-chg">cache failure</ins> steps
<del class="diff-old">of the update process.</del></a> .</p>
</li>
<li>
<p>Otherwise, the fetching succeeded. Store the resource in the
<var title="">new cache</var> .</p>
</li>
<li>
<p>If the URI being processed was flagged as an "explicit entry" in
<var title="">file list</var> , then <del class=
"diff-old">categorise</del> <ins class="diff-chg">categorize</ins>
the entry as an <a href="#explicit" title=
"concept-appcache-explicit">explicit entry</a> .</p>
</li>
<li>
<p>If the URI being processed was flagged as a "fallback entry" in
<var title="">file list</var> , then <del class=
"diff-old">categorise</del> <ins class="diff-chg">categorize</ins>
the entry as a <a href="#fallback0" title=
"concept-appcache-fallback">fallback entry</a> .</p>
</li>
<li>
<p>If the URI being processed was flagged as a "opportunistic
entry" in <var title="">file list</var> , then <del class=
"diff-old">categorise</del> <ins class="diff-chg">categorize</ins>
the entry as an <a href="#opportunistically" title=
"concept-appcache-oppcache">opportunistically cached entry</a>
.</p>
</li>
<li>
<p>If the URI being processed was flagged as an "implicit entry" in
<var title="">file list</var> , then <del class=
"diff-old">categorise</del> <ins class="diff-chg">categorize</ins>
the entry as a <a href="#implicit" title=
"concept-appcache-implicit">implicit entry</a> .</p>
</li>
<li>
<p>If the URI being processed was flagged as an "dynamic entry" in
<var title="">file list</var> , then <del class=
"diff-old">categorise</del> <ins class="diff-chg">categorize</ins>
the entry as a <a href="#dynamic3" title=
"concept-appcache-dynamic">dynamic entry</a> .</p>
</li>
</ol>
</li>
<li>
<p>Store <var title="">manifest</var> in <var title="">new
cache</var> , if it's not there already, and <del class=
"diff-old">categorise</del> <ins class="diff-chg">categorize</ins>
this entry (whether newly added or not) as <a href="#the-manifest"
title="concept-appcache-manifest">the manifest</a> .</p>
</li>
<li>
<p>Store the list of <a href="#opportunistic" title=
"concept-appcache-oppcache-ns">opportunistic caching namespaces</a>
, and the URIs of the <a href="#fallback0" title=
"concept-appcache-fallback">fallback entries</a> that they map to,
in the new cache.</p>
</li>
<li>
<p>Store the URIs that form the new <a href="#online" title=
"concept-appcache-onlinewhitelist">online whitelist</a> in the new
cache.</p>
</li>
<li>
<p><ins class="diff-new">Wait for all pending downloads of</ins>
<span title="implicit entry"><ins class="diff-new">implicit
entries</ins></span> <ins class="diff-new">that are being stored in
the cache to have completed.</ins></p>
<p class="example"><ins class="diff-new">For example, if the</ins>
<a href="#top-level"><ins class="diff-new">top-level browsing
context</ins></a> <ins class="diff-new">'s</ins> <a href=
"#active"><ins class="diff-new">active document</ins></a>
<ins class="diff-new">isn't itself listed in the cache manifest,
then it might still be being downloaded.</ins></p>
<p><ins class="diff-new">If any of these downloads fail (e.g. the
server returns a 4xx or 5xx response or equivalent, or there is a
DNS error, or the connection times out, or the user cancels the
download), then run the</ins> <a href="#cache0"><ins class=
"diff-new">cache failure steps</ins></a> .</p>
</li>
<li>
<p>If this is a <a href="#cache" title=
"concept-appcache-cache">cache attempt</a> , then:</p>
<del class="diff-old">Set the status of cache group to idle .</del>
<p id="flagAsCandidateForCache-result">Associate any
<code>Document</code> objects that were <a href=
"#flagAsCandidateForCache">flagged as candidates</a> for this
manifest URI's caches with <var title="">cache</var> .</p>
<p><a href="#firing2">Fire a simple event</a> called <code title=
"event-cached">cached</code> at the <code><a href=
"#applicationcache">ApplicationCache</a></code> singleton of each
<a href="#top-level">top-level browsing context</a> that is
associated with a cache in <var title="">cache group</var> . The
default action of this event should be the display of some sort of
user interface indicating to the user that the application has been
cached and that they can now use it offline.</p>
<del class="diff-old">Otherwise, this is an upgrade attempt :</del>
<p>Set the <a href="#update0" title=
"concept-appcache-status">status</a> of <var title="">cache
group</var> to <i>idle</i> .</p>
</li>
<li>
<p><ins class="diff-new">Otherwise, this is an</ins> <a href=
"#upgrade" title="concept-appcache-upgrade"><ins class=
"diff-new">upgrade attempt</ins></a> :</p>
<p><a href="#firing2">Fire a simple event</a> called <code title=
"event-updateready">updateready</code> at the <code><a href=
"#applicationcache">ApplicationCache</a></code> singleton of each
<a href="#top-level">top-level browsing context</a> that is
associated with a cache in <var title="">cache group</var> . The
default action of this event should be the display of some sort of
user interface indicating to the user that a new version is
available and that they can activate it by reloading the page.</p>
<p><del class="diff-old">Abort these steps.</del> <ins class=
"diff-chg">Set the</ins> <a href="#update0" title=
"concept-appcache-status"><ins class="diff-chg">status</ins></a>
<ins class="diff-chg">of</ins> <var title=""><ins class=
"diff-chg">cache group</ins></var> <ins class="diff-chg">to</ins>
<i><ins class="diff-chg">idle</ins></i> .</p>
</li>
</ol>
<p>The <del class="diff-old">following step</del> <dfn id=
"cache0"><ins class="diff-chg">cache failure steps</ins></dfn>
<ins class="diff-chg">are as follows:</ins></p>
<ol>
<li>
<p><a href="#firing2"><ins class="diff-chg">Fire a simple
event</ins></a> <ins class="diff-chg">called</ins> <code title=
"event-error"><a href="#error1"><ins class=
"diff-chg">error</ins></a></code> <ins class="diff-chg">at
the</ins> <code><a href="#applicationcache"><ins class=
"diff-chg">ApplicationCache</ins></a></code> <ins class=
"diff-chg">singleton of each</ins> <a href="#top-level"><ins class=
"diff-chg">top-level browsing context</ins></a> <ins class=
"diff-chg">that</ins> is <del class="diff-old">jumped to by various
parts</del> <ins class="diff-chg">associated with a cache in</ins>
<var title=""><ins class="diff-chg">cache group</ins></var>
.<ins class="diff-chg">The default action</ins> of <ins class=
"diff-new">this event should be</ins> the <del class=
"diff-old">algorithm above when they have</del> <ins class=
"diff-chg">display of some sort of user interface indicating</ins>
to <del class="diff-old">cancel</del> the <del class=
"diff-old">update.</del> <ins class="diff-chg">user that the user
agent failed to save the application for offline use.</ins></p>
</li>
<li>
<p><del class="diff-old">Let</del> <ins class="diff-chg">If this is
a</ins> <a href="#cache" title="concept-appcache-cache"><ins class=
"diff-chg">cache attempt</ins></a> ,<ins class="diff-chg">then
discard</ins> <var title=""><ins class="diff-chg">cache</ins></var>
<ins class="diff-chg">and abort the update process.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Otherwise, let</ins> the <a href=
"#update0" title="concept-appcache-status">status</a> of the group
of caches to which <var title="">cache</var> belongs be <i>idle</i>
. If appropriate, remove any user interface indicating that an
update for this cache is in progress. <ins class="diff-new">Abort
the update process.</ins></p>
</li>
</ol>
<h4 id="processing2"><span class="secno"><del class=
"diff-old">4.6.5.</del> <ins class="diff-chg">4.7.5</ins></span>
Processing model</h4>
<p>The processing model of application caches for offline support
in Web applications is part of the <a href="#navigate" title=
"navigate">navigation</a> model, but references the algorithms
defined in this section.</p>
<p>A URI <dfn id="matches" title=
"concept-appcache-matches-oppcache">matches an opportunistic
caching namespace</dfn> if there exists an <a href=
"#application0">application cache</a> whose <a href="#the-manifest"
title="concept-appcache-manifest">manifest</a> 's URI has the
<a href="#same-origin">same <del class=
"diff-old">scheme/host/port</del> <ins class=
"diff-chg">origin</ins></a> as the URI in question, and if that
application cache has an <a href="#opportunistic" title=
"concept-appcache-oppcache-ns">opportunistic caching namespace</a>
with a <path> component that exactly matches the start of the
<path> component of the URI being examined. If multiple
opportunistic caching namespaces match the same URI, the one with
the longest <path> component is the one that matches. A URI
looking for an opportunistic caching namespace can match more than
one application cache at a time, but only matches one namespace in
each cache.</p>
<div class="example">
<p>If a manifest <code title=
"">http://example.com/app1/manifest</code> declares that
<code title="">http://example.com/resources/images</code> should be
opportunistically cached, and the user navigates to <code title=
"">http://example.com/resources/images/cat.png</code> , then the
user agent will decide that the application cache identified by
<code title="">http://example.com/app1/manifest</code> contains a
namespace with a match for that URI.</p>
</div>
<p>When the <dfn id="application2" title=
"concept-appcache-init-with-attribute">application cache selection
algorithm</dfn> algorithm is invoked with a manifest URI, the user
agent must run the first applicable set of steps from the following
list:</p>
<dl class="switch">
<dt>If the resource is not being loaded as part of navigation of a
<a href="#top-level">top-level browsing context</a></dt>
<dd>
<p>As an <del class="diff-old">optimisation,</del> <ins class=
"diff-chg">optimization,</ins> if the resource was loaded from an
<a href="#application0">application cache</a> , and the manifest
URI of that cache doesn't match the manifest URI with which the
algorithm was invoked, then the user agent should mark the entry in
that application cache corresponding to the resource that was just
loaded as being <a href="#foreign" title=
"concept-appcache-foreign">foreign</a> .</p>
<p>Other than that, nothing special happens with respect to
application caches.</p>
</dd>
<dt>If the resource being loaded was loaded from an application
cache and the URI of that application cache's manifest is the same
as the manifest URI with which the algorithm was invoked</dt>
<dd>
<p>Associate the <code>Document</code> with the cache from which it
was loaded. Invoke the <a href="#application1">application cache
update process</a> .</p>
</dd>
<dt>If the resource being loaded was loaded from an application
cache and the URI of that application cache's manifest is
<em>not</em> the same as the manifest URI with which the algorithm
was invoked</dt>
<dd>
<p>Mark the entry for this resource in the application cache from
which it was loaded as <a href="#foreign" title=
"concept-appcache-foreign">foreign</a> .</p>
<p>Restart the current navigation from the top of the <a href=
"#navigate" title="navigate">navigation algorithm</a> , undoing any
changes that were made as part of the initial load (changes can be
avoided by ensuring that the step to <a href="#update2">update the
session history with the new page</a> is only ever completed
<em>after</em> the application cache selection algorithm is run,
though this is not required).</p>
<p class="note">The navigation will not result in the same resource
being loaded, because "foreign" entries are never picked during
navigation.</p>
<p>User agents may notify the user of the inconsistency between the
cache manifest and the resource's own metadata, to aid in
application development.</p>
</dd>
<dt>If the resource being loaded was not loaded from an application
cache, but it was loaded using HTTP GET or equivalent</dt>
<dd>
<ol>
<li>
<p>If the manifest URI does not have the <a href=
"#same-origin">same <del class="diff-old">scheme/host/port</del>
<ins class="diff-chg">origin</ins></a> as the resource's own URI,
then invoke the <a href="#application3" title=
"concept-appcache-init-no-attribute">application cache selection
algorithm</a> again, but without a manifest, and abort these
steps.</p>
</li>
<li>
<p>If there is already an <a href="#application0">application
cache</a> identified by this manifest URI, and <ins class=
"diff-new">the most up to date version of</ins> that <a href=
"#application0">application cache</a> contains a resource with the
URI of the manifest, and that resource is <del class=
"diff-old">categorised</del> <ins class=
"diff-chg">categorized</ins> as a <a href="#the-manifest" title=
"concept-appcache-manifest">manifest</a> , then: store the resource
in the matching <del class="diff-old">cache with the most up to
date version, categorised</del> <ins class="diff-chg">cache,
categorized</ins> as an <a href="#implicit" title=
"concept-appcache-implicit">implicit entry</a> , associate the
<code>Document</code> with that cache, invoke the <a href=
"#application1">application cache update process</a> , and abort
these steps.</p>
</li>
<li id="flagAsCandidateForCache">
<p>Flag the resource's <code>Document</code> as a candidate for
this manifest URI's <del class="diff-old">caches.</del> <ins class=
"diff-chg">caches, so that it will be</ins> <a href=
"#flagAsCandidateForCache-result"><ins class="diff-chg">associated
with an application cache identified by this manifest URI</ins></a>
<ins class="diff-chg">later, when such an</ins> <a href=
"#application0"><ins class="diff-chg">application cache</ins></a>
<ins class="diff-chg">is ready.</ins></p>
</li>
<li>
<p>If there is already an <a href="#application0">application
cache</a> identified by this manifest URI, then <ins class=
"diff-new">the most up to date version of</ins> that <a href=
"#application0">application cache</a> does not yet contain a
resource with the URI of the manifest, or it does but that resource
is not yet <del class="diff-old">categorised</del> <ins class=
"diff-chg">categorized</ins> as a <a href="#the-manifest" title=
"concept-appcache-manifest">manifest</a> : store the resource in
that cache, <del class="diff-old">categorised</del> <ins class=
"diff-chg">categorized</ins> as an <a href="#implicit" title=
"concept-appcache-implicit">implicit entry</a> (replacing the
file's previous contents if it was already in the cache, but not
removing any other categories it might have), and abort these
steps. <ins class="diff-new">(An</ins> <a href=
"#application1"><ins class="diff-new">application cache update
process</ins></a> <ins class="diff-new">is already in
progress.)</ins></p>
</li>
<li>
<p>Otherwise, there is no matching <a href=
"#application0">application cache</a> : create a new application
cache identified by this manifest URI, store the resource in that
cache, <del class="diff-old">categorised</del> <ins class=
"diff-chg">categorized</ins> as an <a href="#implicit" title=
"concept-appcache-implicit">implicit entry</a> , and then invoke
the <a href="#application1">application cache update process</a>
.</p>
</li>
</ol>
</dd>
<dt>Otherwise</dt>
<dd>
<p>Invoke the <a href="#application3" title=
"concept-appcache-init-no-attribute">application cache selection
algorithm</a> again, but without a manifest.</p>
</dd>
</dl>
<p>When the <dfn id="application3" title=
"concept-appcache-init-no-attribute">application cache selection
algorithm</dfn> is invoked <em>without</em> a manifest, then: if
the resource is being loaded as part of navigation of a <a href=
"#top-level">top-level browsing context</a> , and the resource was
fetched from a particular <a href="#application0">application
cache</a> , then the user agent must associate the
<code>Document</code> with that application cache and invoke the
<a href="#application1">application cache update process</a> for
that cache; otherwise, nothing special happens with respect to
application caches.</p>
<h5 id="changes"><span class="secno"><del class=
"diff-old">4.6.5.1.</del> <ins class=
"diff-chg">4.7.5.1.</ins></span> Changes to the networking
model</h5>
<p>When a browsing context is associated with an <a href=
"#application0">application cache</a> , any and all resource loads
must go through the following steps instead of immediately invoking
the mechanisms appropriate to that resource's scheme:</p>
<ol>
<li>
<p>If the resource is not to be fetched using the HTTP GET
mechanism or equivalent, then fetch the resource normally and abort
these steps.</p>
</li>
<li>
<p>If the resource's URI, ignoring its fragment identifier if any,
is listed in the <a href="#application0">application cache</a> 's
<a href="#online" title="concept-appcache-onlinewhitelist">online
whitelist</a> , then fetch the resource normally and abort these
steps.</p>
</li>
<li>
<p>If the resource's URI is <a href="#implicit" title=
"concept-appcache-implicit">an implicit entry</a> , <a href=
"#the-manifest" title="concept-appcache-manifest">the manifest</a>
, <a href="#explicit" title="concept-appcache-explicit">an explicit
entry</a> , <a href="#fallback0" title=
"concept-appcache-fallback">a fallback entry</a> , <a href=
"#opportunistically" title="concept-appcache-oppcache">an
opportunistically cached entry</a> , or a <a href="#dynamic3"
title="concept-appcache-dynamic">dynamic entry</a> in the <a href=
"#application0">application cache</a> , then fetch the resource
from the cache and abort these steps.</p>
</li>
<li>
<p>If the resource's URI has the <a href="#same-origin">same
<del class="diff-old">scheme/host/port</del> <ins class=
"diff-chg">origin</ins></a> as the manifest's URI, and the start of
the resource's URI's <path> component is exactly matched by
the <path> component of an <a href="#opportunistic" title=
"concept-appcache-oppcache-ns">opportunistic caching namespace</a>
in the <a href="#application0">application cache</a> , then:</p>
<p>Fetch the resource normally. If this results 4xx or 5xx status
codes or equivalent, or if there were network <del class=
"diff-old">errors,</del> <ins class="diff-chg">errors (but not if
the user canceled the download),</ins> then instead fetch, from the
cache, the resource of the <a href="#fallback0" title=
"concept-appcache-fallback">fallback entry</a> corresponding to the
namespace with the longest matching <path> component. Abort
these steps.</p>
</li>
<li>
<p>Fail the resource load.</p>
</li>
</ol>
<p class="note">The above algorithm ensures that resources that are
not present in the manifest will always fail to load (at least,
after the cache has been primed the first time), making the testing
of offline applications simpler.</p>
<h4 id="application"><span class="secno"><del class=
"diff-old">4.6.6.</del> <ins class="diff-chg">4.7.6</ins></span>
Application cache API</h4>
<pre class="idl">
interface <dfn id="applicationcache">ApplicationCache</dfn> {
// <a href="#update0" title=
"concept-appcache-status">update status</a>
const unsigned short <a href="#uncached" title=
"dom-appcache-UNCACHED">UNCACHED</a> = 0;
const unsigned short <a href="#idle" title=
"dom-appcache-IDLE">IDLE</a> = 1;
const unsigned short <a href="#checking" title=
"dom-appcache-CHECKING">CHECKING</a> = 2;
const unsigned short <a href="#downloading" title=
"dom-appcache-DOWNLOADING">DOWNLOADING</a> = 3;
const unsigned short <a href="#updateready" title=
"dom-appcache-UPDATEREADY">UPDATEREADY</a> = 4;
readonly attribute unsigned short <a href="#status0" title=
"dom-appcache-status">status</a>;
// updates
void <a href="#update1" title="dom-appcache-update">update</a>();
void <a href="#swapcache" title=
"dom-appcache-swapCache">swapCache</a>();
// dynamic entries
<del class="diff-old"> readonly attribute unsigned long ;
</del>
<ins class="diff-chg"> readonly attribute unsigned long <a href=
"#length7" title="dom-appcache-length">length</a>;
</ins>
DOMString <a href="#itemindex4" title=
"dom-appcache-item">item</a>(in unsigned long index);
void <a href="#adduri" title=
"dom-appcache-add">add</a>(in DOMString uri);
void <a href="#remove1" title=
"dom-appcache-remove">remove</a>(in DOMString uri);
// events
attribute <span>EventListener</span> <a href=
"#onchecking" title="handler-appcache-onchecking">onchecking</a>;
attribute <span>EventListener</span> <a href="#onerror0"
title="handler-appcache-onerror">onerror</a>;
attribute <span>EventListener</span> <a href=
"#onnoupdate" title="handler-appcache-onnoupdate">onnoupdate</a>;
attribute <span>EventListener</span> <a href=
"#ondownloading" title=
"handler-appcache-ondownloading">ondownloading</a>;
attribute <span>EventListener</span> <a href=
"#onprogress" title="handler-appcache-onprogress">onprogress</a>;
attribute <span>EventListener</span> <a href=
"#onupdateready" title=
"handler-appcache-onupdateready">onupdateready</a>;
attribute <span>EventListener</span> <a href="#oncached"
title="handler-appcache-oncached">oncached</a>;
};
</pre>
<p>Objects implementing the <code><a href=
"#applicationcache">ApplicationCache</a></code> interface must also
implement the <code>EventTarget</code> interface.</p>
<p>There is a one-to-one mapping from <code>Document</code> objects
to <code><a href="#applicationcache">ApplicationCache</a></code>
objects. The <dfn id="applicationcache0" title=
"dom-applicationCache"><code>applicationCache</code></dfn>
attribute on <code><a href="#window">Window</a></code> objects must
return the <code><a href=
"#applicationcache">ApplicationCache</a></code> object associated
with the <a href="#active">active document</a> of the
<code><a href="#window">Window</a></code> 's <a href=
"#browsing1">browsing context</a> .</p>
<p>An <code><a href="#applicationcache">ApplicationCache</a></code>
object might be associated with an <a href=
"#application0">application cache</a> . When the
<code>Document</code> object that the <code><a href=
"#applicationcache">ApplicationCache</a></code> object maps to is
associated with an application cache, then that is the application
cache with which the <code><a href=
"#applicationcache">ApplicationCache</a></code> object is
associated. Otherwise, the <code><a href=
"#applicationcache">ApplicationCache</a></code> object is
associated with the application cache that the
<code>Document</code> object's <a href="#browsing1">browsing
context</a> is associated with, if any.</p>
<p>The <dfn id="status0" title=
"dom-appcache-status"><code>status</code></dfn> attribute, on
getting, must return the current state of the <a href=
"#application0">application cache</a> <code><a href=
"#applicationcache">ApplicationCache</a></code> object is
associated with, if any. This must be the appropriate value from
the following list:</p>
<dl>
<dt><dfn id="uncached" title=
"dom-appcache-UNCACHED"><code>UNCACHED</code></dfn> (numeric value
0)</dt>
<dd>
<p>The <code><a href=
"#applicationcache">ApplicationCache</a></code> object is not
associated with an <a href="#application0">application cache</a> at
this time.</p>
</dd>
<dt><dfn id="idle" title=
"dom-appcache-IDLE"><code>IDLE</code></dfn> (numeric value 1)</dt>
<dd>
<p>The <code><a href=
"#applicationcache">ApplicationCache</a></code> object is
associated with an <a href="#application0">application cache</a>
whose group is in the <i>idle</i> <span title=
"concept-appcache-states">update status</span> , and that
application cache is the newest cache in its group that contains a
resource <del class="diff-old">categorised</del> <ins class=
"diff-chg">categorized</ins> as a <a href="#the-manifest" title=
"concept-appcache-manifest">manifest</a> .</p>
</dd>
<dt><dfn id="checking" title=
"dom-appcache-CHECKING"><code>CHECKING</code></dfn> (numeric value
2)</dt>
<dd>
<p>The <code><a href=
"#applicationcache">ApplicationCache</a></code> object is
associated with an <a href="#application0">application cache</a>
whose group is in the <i>checking</i> <span title=
"concept-appcache-states">update status</span> .</p>
</dd>
<dt><dfn id="downloading" title=
"dom-appcache-DOWNLOADING"><code>DOWNLOADING</code></dfn> (numeric
value 3)</dt>
<dd>
<p>The <code><a href=
"#applicationcache">ApplicationCache</a></code> object is
associated with an <a href="#application0">application cache</a>
whose group is in the <i>downloading</i> <span title=
"concept-appcache-states">update status</span> .</p>
</dd>
<dt><dfn id="updateready" title=
"dom-appcache-UPDATEREADY"><code>UPDATEREADY</code></dfn> (numeric
value 4)</dt>
<dd>
<p>The <code><a href=
"#applicationcache">ApplicationCache</a></code> object is
associated with an <a href="#application0">application cache</a>
whose group is in the <i>idle</i> <span title=
"concept-appcache-states">update status</span> , but that
application cache is <em>not</em> the newest cache in its group
that contains a resource <del class="diff-old">categorised</del>
<ins class="diff-chg">categorized</ins> as a <a href=
"#the-manifest" title="concept-appcache-manifest">manifest</a>
.</p>
</dd>
</dl>
<p>The <dfn id="length7" title=
"dom-appcache-length"><code>length</code></dfn> attribute must
return the number of <a href="#dynamic3" title=
"concept-appcache-dynamic">dynamic entries</a> in the <a href=
"#application0">application cache</a> with which the <code><a href=
"#applicationcache">ApplicationCache</a></code> object is
associated, if any, and zero if the object is not associated with
any application cache.</p>
<p>The <a href="#dynamic3" title="concept-appcache-dynamic">dynamic
entries</a> in the <a href="#application0">application cache</a>
are ordered in the same order as they were added to the cache by
the <code title="dom-appcache-add"><a href=
"#adduri">add()</a></code> method, with the oldest entry being the
zeroth entry, and the most recently added entry having the index
<span><code title="dom-appcache-length"><a href=
"#length7">length</a></code> -1</span> .</p>
<p>The <dfn id="itemindex4" title="dom-appcache-item"><code>item(
<var title="">index</var> )</code></dfn> method must return the
<ins class="diff-new">absolute URI of the</ins> <a href="#dynamic3"
title="concept-appcache-dynamic">dynamic <del class=
"diff-old">entries</del> <ins class="diff-chg">entry</ins></a> with
index <var title="">index</var> from the <a href=
"#application0">application cache</a> , if one is associated with
the <code><a href="#applicationcache">ApplicationCache</a></code>
object. If the object is not associated with any application cache,
or if the <var title="">index</var> argument is lower than zero or
greater than <span><code title="dom-appcache-length"><a href=
"#length7">length</a></code> -1</span> , the method must instead
raise an <code>INDEX_SIZE_ERR</code> exception.</p>
<p>The <dfn id="adduri" title="dom-appcache-add"><code>add(
<var title="">uri</var> )</code></dfn> method must run the
following steps:</p>
<ol>
<li>
<p>If the <code><a href=
"#applicationcache">ApplicationCache</a></code> object is not
associated with any application cache, then raise an
<code>INVALID_STATE_ERR</code> exception and abort these steps.</p>
</li>
<li>
<p>If <var title=""><ins class="diff-new">uri</ins></var>
<ins class="diff-new">is not a valid URI reference, then raise
a</ins> <code><ins class="diff-new">SYNTAX_ERR</ins></code>
<ins class="diff-new">exception and abort these steps.</ins>
<a href="#references"><ins class="diff-new">[RFC3986]</ins></a>
<a href="#references"><ins class="diff-new">[RFC3987]</ins></a></p>
</li>
<li>
<p class="big-issue"><ins class="diff-new">resolve relative URIs;
on failure, raise a</ins> <code><ins class=
"diff-new">SYNTAX_ERR</ins></code> <ins class=
"diff-new">exception</ins></p>
</li>
<li>
<p><ins class="diff-new">If</ins> there is already a resource in in
the <a href="#application0">application cache</a> with which the
<code><a href="#applicationcache">ApplicationCache</a></code>
object is associated that has the address <var title="">uri</var> ,
then ensure that entry is <del class="diff-old">categorised</del>
<ins class="diff-chg">categorized</ins> as a <a href="#dynamic3"
title="concept-appcache-dynamic">dynamic entry</a> and return and
abort these steps.</p>
</li>
<li>
<p>If <var title="">uri</var> has a different <scheme>
component than the manifest's URI, then raise a <a href=
"#security9">security exception</a> .</p>
</li>
<li>
<p>Return, but do not abort these steps.</p>
</li>
<li>
<p>Fetch the resource referenced by <var title="">uri</var> .</p>
</li>
<li>
<p>If this results 4xx or 5xx status codes or equivalent, or if
there were network errors, <ins class="diff-new">or if the user
canceled the download,</ins> then abort these steps.</p>
</li>
<li>
<p>Wait for there to be no running scripts, or at least no running
scripts that can reach an <code><a href=
"#applicationcache">ApplicationCache</a></code> object associated
with the <a href="#application0">application cache</a> with which
this <code><a href="#applicationcache">ApplicationCache</a></code>
object is associated.</p>
<p>Add the fetched resource to the <a href=
"#application0">application cache</a> and <del class=
"diff-old">categorise</del> <ins class="diff-chg">categorize</ins>
it as a <a href="#dynamic3" title=
"concept-appcache-dynamic">dynamic entry</a> before letting any
such scripts resume.</p>
</li>
</ol>
<p class="big-issue">We can make the add() API more usable (i.e.
make it possible to detect progress and distinguish success from
errors without polling and timeouts) if we have the method return
an object that is a target of Progress Events, much like the
<a href=
"http://dev.w3.org/cvsweb/~checkout~/2006/webapi/XMLHttpRequest-2/Overview.html?content-type=text/html;%20charset=utf-8#xmlhttprequesteventtarget-interface">
XMLHttpRequestEventTarget</a> interface. This would also make this
far more complex to spec and implement.</p>
<p>The <dfn id="remove1" title="dom-appcache-remove"><code>remove(
<var title="">uri</var> )</code></dfn> method must remove the
<a href="#dynamic3" title="concept-appcache-dynamic">dynamic
entry</a> <del class="diff-old">categorisation</del> <ins class=
"diff-chg">categorization</ins> of any entry with the address
<var title="">uri</var> in the <a href="#application0">application
cache</a> with which the <code><a href=
"#applicationcache">ApplicationCache</a></code> object is
associated. <span class="big-issue"><ins class="diff-new">Resolve
relative URIs... (ignore syntax errors)</ins></span> If this
removes the last <del class="diff-old">categorisation</del>
<ins class="diff-chg">categorization</ins> of an entry in that
cache, then the entry must be removed entirely (such that if it is
re-added, it will be loaded from the network again). If the
<code><a href="#applicationcache">ApplicationCache</a></code>
object is not associated with any application cache, then the
method must raise an <code>INVALID_STATE_ERR</code> exception
instead.</p>
<p>If the <dfn id="update1" title=
"dom-appcache-update"><code>update()</code></dfn> method is
invoked, the user agent must invoke the <a href=
"#application1">application cache update process</a> , in the
background, for the <a href="#application0">application cache</a>
with which the <code><a href=
"#applicationcache">ApplicationCache</a></code> object is
associated. If there is no such application cache, then the method
must raise an <code>INVALID_STATE_ERR</code> exception instead.</p>
<p>If the <dfn id="swapcache" title=
"dom-appcache-swapCache"><code>swapCache()</code></dfn> method is
invoked, the user agent must run the following steps:</p>
<ol>
<li>
<p>Let <var title="">document</var> be the <code>Document</code>
with which the <code><a href=
"#applicationcache">ApplicationCache</a></code> object is
associated.</p>
</li>
<li>
<p>Check that <var title="">document</var> is associated with an
<a href="#application0">application cache</a> . If it is not, then
raise an <code>INVALID_STATE_ERR</code> exception and abort these
steps.</p>
<p class="note">This is not the same thing as the <code><a href=
"#applicationcache">ApplicationCache</a></code> object being itself
associated with an <a href="#application0">application cache</a> !
In particular, the <code>Document</code> with which the
<code><a href="#applicationcache">ApplicationCache</a></code>
object is associated can only itself be associated with an
application cache if it is in a <a href="#top-level">top-level
browsing context</a> .</p>
</li>
<li>
<p>Let <var title="">cache</var> be the <a href=
"#application0">application cache</a> with which the <code><a href=
"#applicationcache">ApplicationCache</a></code> object is
associated. (By definition, this is the same as the one that was
found in the previous step.)</p>
</li>
<li>
<p>Check that there is an application cache in the same group as
<var title="">cache</var> which has an entry <del class=
"diff-old">categorised</del> <ins class=
"diff-chg">categorized</ins> as a <a href="#the-manifest" title=
"concept-appcache-manifest">manifest</a> that has is newer than
<var title="">cache</var> . If there is not, then raise an
<code>INVALID_STATE_ERR</code> exception and abort these steps.</p>
</li>
<li>
<p>Let <var title="">new cache</var> be the newest <a href=
"#application0">application cache</a> in the same group as
<var title="">cache</var> which has an entry <del class=
"diff-old">categorised</del> <ins class=
"diff-chg">categorized</ins> as a <a href="#the-manifest" title=
"concept-appcache-manifest">manifest</a> .</p>
</li>
<li>
<p>Unassociate <var title="">document</var> from <var title=
"">cache</var> and instead associate it with <var title="">new
cache</var> .</p>
</li>
</ol>
<p>The following are the <a href="#event4">event handler DOM
attributes</a> that must be supported by objects implementing the
<code><a href="#applicationcache">ApplicationCache</a></code>
interface:</p>
<dl>
<dt><dfn id="onchecking" title=
"handler-appcache-onchecking"><code>onchecking</code></dfn></dt>
<dd>
<p>Must be invoked whenever an <code title=
"event-checking">checking</code> event is targeted at or bubbles
through the <code><a href=
"#applicationcache">ApplicationCache</a></code> object.</p>
</dd>
<dt><dfn id="onerror0" title=
"handler-appcache-onerror"><code>onerror</code></dfn></dt>
<dd>
<p>Must be invoked whenever an <code title="event-error"><a href=
"#error1">error</a></code> event is targeted at or bubbles through
the <code><a href="#applicationcache">ApplicationCache</a></code>
object.</p>
</dd>
<dt><dfn id="onnoupdate" title=
"handler-appcache-onnoupdate"><code>onnoupdate</code></dfn></dt>
<dd>
<p>Must be invoked whenever an <code title=
"event-noupdate">noupdate</code> event is targeted at or bubbles
through the <code><a href=
"#applicationcache">ApplicationCache</a></code> object.</p>
</dd>
<dt><dfn id="ondownloading" title=
"handler-appcache-ondownloading"><code>ondownloading</code></dfn></dt>
<dd>
<p>Must be invoked whenever an <code title=
"event-downloading">downloading</code> event is targeted at or
bubbles through the <code><a href=
"#applicationcache">ApplicationCache</a></code> object.</p>
</dd>
<dt><dfn id="onprogress" title=
"handler-appcache-onprogress"><code>onprogress</code></dfn></dt>
<dd>
<p>Must be invoked whenever an <code title=
"event-progress"><a href="#progress0">progress</a></code> event is
targeted at or bubbles through the <code><a href=
"#applicationcache">ApplicationCache</a></code> object.</p>
</dd>
<dt><dfn id="onupdateready" title=
"handler-appcache-onupdateready"><code>onupdateready</code></dfn></dt>
<dd>
<p>Must be invoked whenever an <code title=
"event-updateready">updateready</code> event is targeted at or
bubbles through the <code><a href=
"#applicationcache">ApplicationCache</a></code> object.</p>
</dd>
<dt><dfn id="oncached" title=
"handler-appcache-oncached"><code>oncached</code></dfn></dt>
<dd>
<p>Must be invoked whenever a <code title=
"event-cached">cached</code> event is targeted at or bubbles
through the <code><a href=
"#applicationcache">ApplicationCache</a></code> object.</p>
</dd>
</dl>
<h4 id="browser0"><span class="secno"><del class=
"diff-old">4.6.7.</del> <ins class="diff-chg">4.7.7</ins></span>
Browser state</h4>
<p>The <dfn id="navigator.online" title=
"dom-navigator-onLine"><code>navigator.onLine</code></dfn>
attribute must return false if the user agent will not contact the
network when the user follows links or when a script requests a
remote page (or knows that such an attempt would fail), and must
return true otherwise.</p>
<p>When the value that would be returned by the <code title=
"dom-navigator-onLine"><a href=
"#navigator.online">navigator.onLine</a></code> attribute of the
<code><a href="#window">Window</a></code> changes from true to
false, the user agent must <a href="#firing2">fire a simple
event</a> called <dfn id="offline0" title=
"event-offline"><code>offline</code></dfn> at <a href=
"#the-body1">the body element</a> .</p>
<p>On the other hand, when the value that would be returned by the
<code title="dom-navigator-onLine"><a href=
"#navigator.online">navigator.onLine</a></code> attribute of the
<code><a href="#window">Window</a></code> changes from false to
true, the user agent must <a href="#firing2">fire a simple
event</a> called <dfn id="online0" title=
"event-online"><code>online</code></dfn> at <a href=
"#the-body1">the body element</a> .</p>
<h3 id="history"><span class="secno"><del class=
"diff-old">4.7.</del> <ins class="diff-chg">4.8</ins></span>
Session history and navigation</h3>
<h4 id="the-session"><span class="secno"><del class=
"diff-old">4.7.1.</del> <ins class="diff-chg">4.8.1</ins></span>
The session history of browsing contexts</h4>
<p>The sequence of <code>Document</code> s in a <a href=
"#browsing1">browsing context</a> is its <dfn id="session">session
history</dfn> .</p>
<p><code><a href="#history2">History</a></code> objects provide a
representation of the pages in the session history of <a href=
"#browsing1" title="browsing context">browsing contexts</a> . Each
browsing context has a distinct session history.</p>
<p>Each <code>Document</code> object in a browsing context's
session history is associated with a unique instance of the
<code><a href="#history2">History</a></code> object, although they
all must model the same underlying session history.</p>
<p>The <dfn id="history1" title=
"dom-history"><code>history</code></dfn> attribute of the
<code><a href="#window">Window</a></code> interface must return the
object implementing the <code><a href=
"#history2">History</a></code> interface for that <code><a href=
"#window">Window</a></code> object's <a href="#active">active
document</a> .</p>
<p><code><a href="#history2">History</a></code> objects represent
their <a href="#browsing1">browsing context</a> 's session history
as a flat list of <a href="#session0" title=
"session history entry">session history entries</a> . Each <dfn id=
"session0">session history entry</dfn> consists of either a URI or
a <a href="#state">state object</a> , or both, and may in addition
have a title, a <code>Document</code> object, form data, a scroll
position, and other information associated with it.</p>
<p class="note">This does not imply that the user interface need be
linear. See the <a href="#history-notes">notes below</a> .</p>
<p>URIs without <del class="diff-old">assaciated</del> <ins class=
"diff-chg">associated</ins> <a href="#state" title=
"state object">state objects</a> are added to the session history
as the user (or script) navigates from page to page.</p>
<p>A <dfn id="state">state object</dfn> is an object representing a
user interface state.</p>
<p>Pages can <a href="#pushstate" title=
"dom-history-pushState">add</a> <a href="#state" title=
"state object">state objects</a> between their entry in the session
history and the next ("forward") entry. These are then <a href=
"#popstate" title="event-popstate">returned to the script</a> when
the user (or script) goes back in the history, thus enabling
authors to use the "navigation" metaphor even in one-page
applications.</p>
<p><ins class="diff-new">Every</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">in the
session history is defined to have a</ins> <dfn id=
"last-activated"><ins class="diff-new">last activated
entry</ins></dfn> ,<ins class="diff-new">which is the</ins>
<a href="#state"><ins class="diff-new">state object</ins></a>
<ins class="diff-new">entry associated with that</ins>
<code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">which was most recently activated. Initially, the</ins>
<a href="#last-activated"><ins class="diff-new">last activated
entry</ins></a> <ins class="diff-new">of a</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">must be the
first entry for the</ins> <code><ins class=
"diff-new">Document</ins></code> ,<ins class=
"diff-new">representing the fact that no</ins> <a href=
"#state"><ins class="diff-new">state object</ins></a> <ins class=
"diff-new">entry has yet been activated.</ins></p>
<p>At any point, one of the entries in the session history is the
<dfn id="current1">current entry</dfn> . This is the entry
representing the <a href="#active">active document</a> of the
<a href="#browsing1">browsing context</a> . The <a href=
"#current1">current entry</a> is usually an entry for the <a href=
"#href5" title="dom-location-href">location</a> of the
<code>Document</code> . However, it can also be one of the entries
for <a href="#state" title="state object">state objects</a> added
to the history by that document.</p>
<p>Entries that consist of <a href="#state" title=
"state object">state objects</a> share the same
<code>Document</code> as the entry for the page that was active
when they were added.</p>
<p>Contiguous entries that differ just by fragment identifier also
share the same <code>Document</code> .</p>
<p class="note">All entries that share the same
<code>Document</code> (and that are therefore merely different
states of one particular document) are contiguous by
definition.</p>
<p>User agents may <dfn id="discard">discard</dfn> the DOMs of
entries other than the <a href="#current1">current entry</a> that
are not referenced from any script, reloading the pages afresh when
the user or script navigates back to such pages. This specification
does not specify when user agents should discard pages' DOMs and
when they should cache them. See the section on the <code title=
"event-load"><a href="#load0">load</a></code> and <code title=
"event-unload">unload</code> events for more details.</p>
<p>Entries that have had their DOM discarded must, for the purposes
of the algorithms given below, act as if they had not. When the
user or script navigates back or forwards to a page which has no
in-memory DOM objects, any other entries that shared the same
<code>Document</code> object with it must share the new object as
well.</p>
<p>When state object entries are added, a URI can be provided. This
URI is used to replace the state object entry if the
<code>Document</code> is evicted.</p>
<p>When a user agent discards the DOM from an entry in the session
history, it must also discard all the entries that share that
<code>Document</code> but do not have an associated URI (i.e.
entries that only have a <a href="#state">state object</a> ).
Entries that shared that <code>Document</code> object but had a
state object and have a different URI must then have their
<em>state objects</em> removed. Removed entries are not recreated
if the user or script navigates back to the page. If there are no
state object entries for that <code>Document</code> object then no
entries are removed.</p>
<p class="big-issue"><ins class="diff-new">when an entry is
discarded, any frozen timers, intervals, XMLHttpRequests, database
transactions, etc, must be killed</ins></p>
<h4 id="the-history"><span class="secno"><del class=
"diff-old">4.7.2.</del> <ins class="diff-chg">4.8.2</ins></span>
The <code><a href="#history2">History</a></code> interface</h4>
<del class="diff-old">{ readonly attribute long ;</del>
<pre class="idl">
interface <dfn id="history2">History</dfn> {
<ins class="diff-chg"> readonly attribute long <a href="#length8"
title="dom-history-length">length</a>;
</ins>
void <a href="#godelta" title=
"dom-history-go">go</a>(in long delta);
void <a href="#go" title="dom-history-go-0">go</a>();
void <a href="#back" title="dom-history-back">back</a>();
void <a href="#forward" title=
"dom-history-forward">forward</a>();
void <a href="#pushstate" title=
"dom-history-pushState">pushState</a>(in DOMObject data, in DOMString title);
void <a href="#pushstate" title=
"dom-history-pushState">pushState</a>(in DOMObject data, in DOMString title, in DOMString url);
void <a href="#clearstate" title=
"dom-history-clearState">clearState</a>();
};
</pre>
<p>The <dfn id="length8" title=
"dom-history-length"><code>length</code></dfn> attribute of the
<code><a href="#history2">History</a></code> interface must return
the number of entries in this <a href="#session">session
history</a> .</p>
<p>The actual entries are not accessible from script.</p>
<p>The <dfn id="godelta" title="dom-history-go"><code>go(
<var title="">delta</var> )</code></dfn> method causes the UA to
move the number of steps specified by <var title="">delta</var> in
the session history.</p>
<p>If the index of the <a href="#current1">current entry</a> plus
<var title="">delta</var> is less than zero or greater than or
equal to the <a href="#length8" title="dom-history-length">number
of items in the session history</a> , then the user agent must do
nothing.</p>
<p>If the <var title="">delta</var> is zero, then the user agent
must act as if the <code title=
"dom-location-reload">location.reload()</code> method was called
instead.</p>
<p>Otherwise, the user agent must cause the current <a href=
"#browsing1">browsing context</a> to <a href="#traverse">traverse
the history</a> to the specified <del class="diff-old">entry, as
described below.</del> <ins class="diff-chg">entry.</ins> The
<i>specified entry</i> is the one whose index equals the index of
the <a href="#current1">current entry</a> plus <var title=
"">delta</var> .</p>
<p>When <del class="diff-old">a user agent is required to traverse
the history to a specified entry, the user agent must act as
follows: If there is no longer a Document object for the entry in
question, the user agent must navigate the browsing context to the
location for that entry to preform an entry update of that entry,
and abort these steps. The " navigate " algorithm reinvokes this
"traverse" algorithm to complete the traversal, at which point
there is a Document object and so this step gets skipped. If
appropriate, update the current entry in the browsing context 's
Document object's History object to reflect any state that the user
agent wishes to persist. For example, some user agents might want
to persist the scroll position, or the values of form controls. If
there are any entries with state objects between the current entry
and the specified entry (not inclusive), then the user agent must
iterate through every entry between the current entry and the
specified entry, starting with the entry closest to the current
entry, and ending with the one closest to the specified entry. For
each entry, if the entry is a state object, the user agent must
activate the state object . If the specified entry has a different
Document object than the current entry then the user agent must run
the following substeps: The user agent must move any properties
that have been added to the browsing context's default view's
Window object to the active document 's Document 's list of added
properties . If the browsing context is a top-level browsing
context (and not an auxiliary browsing context ), and the origin of
the Document of the specified entry is not the same as the origin
of the Document of the current entry , then the following
sub-sub-steps must be run: The current browsing context name must
be stored with all the entries in the history that are associated
with Document objects with the same origin as the active document
and that are contiguous with the current entry . The browsing
context's browsing context name must be unset. The user agent must
make the specified entry 's Document object the active document of
the browsing context . (If it is a top-level browsing context ,
this might change which application cache it is associated with.)
If the specified entry has a browsing context name stored with it,
then the following sub-sub-steps must be run: The browsing
context's browsing context name must be set to the name stored with
the specified entry. Any browsing context name stored with the
entries in the history that are associated with Document objects
with the same origin as the new active document , and that are
contiguous with the specified entry, must be cleared. The user
agent must move any properties that have been added to the active
document 's Document 's list of added properties to browsing
context's default view's Window object. If the specified entry is a
state object, the user agent must activate that state object . If
the specified entry has a URI that differs from the current entry
's only by its fragment identifier, and the two share the same
Document object, then fire a simple event with the name hashchanged
at the body element , and, if the new URI has a fragment
identifier, scroll to the fragment identifier . User agents may
also update other aspects of the document view when the location
changes in this way, for instance the scroll position, values of
form fields, etc. The current entry is now the specified entry .
how does the changing of the global attributes affect .watch() when
seen from other Windows? When</del> the user navigates through a
<a href="#browsing1">browsing context</a> , e.g. using a browser's
back and forward buttons, the user agent must translate this action
into the equivalent invocations of the <code title=
"dom-history-go"><a href="#godelta">history.go( <var title=
"">delta</var> )</a></code> method on the various affected
<code title="dom-window"><a href="#window0">window</a></code>
objects.</p>
<p>Some of the other members of the <code><a href=
"#history2">History</a></code> interface are defined in terms of
the <code title="dom-history-go"><a href="#godelta">go()</a></code>
method, as follows:</p>
<table>
<tbody>
<tr>
<th>Member</th>
<th>Definition</th>
</tr>
<tr>
<td><dfn id="go" title=
"dom-history-go-0"><code>go()</code></dfn></td>
<td>Must do the same as <code title="dom-history-go"><a href=
"#godelta">go(0)</a></code></td>
</tr>
<tr>
<td><dfn id="back" title=
"dom-history-back"><code>back()</code></dfn></td>
<td>Must do the same as <code title="dom-history-go"><a href=
"#godelta">go(-1)</a></code></td>
</tr>
<tr>
<td><dfn id="forward" title=
"dom-history-forward"><code>forward()</code></dfn></td>
<td>Must do the same as <code title="dom-history-go"><a href=
"#godelta">go(1)</a></code></td>
</tr>
</tbody>
</table>
<p>The <dfn id="pushstate" title=
"dom-history-pushState"><code>pushState( <var title="">data</var> ,
<var title="">title</var> , <var title="">url</var> )</code></dfn>
method adds a state object to the history.</p>
<p>When this method is invoked, the user agent must first check the
third argument. If a third argument is specified, then the user
agent must verify that the third argument is a valid URI or IRI (as
defined by RFC 3986 and 3987), and if so, that, after resolving it
to an absolute URI, it is either identical to the document's URI,
or that it differs from the document's URI only in the
<query>, <abs_path>, and/or <fragment> parts, as
applicable (the <query> and <abs_path> parts can only
be the same if the document's URI uses a hierarchical
<scheme>). If the verification fails (either because the
argument is syntactically incorrect, or differs in a way not
described as acceptable in the previous sentence) then the user
agent must raise a <a href="#security9">security exception</a> .
<a href="#references">[RFC3986]</a> <a href=
"#references">[RFC3987]</a></p>
<p>If the third argument passes its verification step, or if the
third argument was omitted, then the user agent must remove from
the <a href="#session">session history</a> any entries for that
<code>Document</code> from the entry after the <a href=
"#current1">current entry</a> up to the last entry in the session
history that references the same <code>Document</code> object, if
any. If the <a href="#current1">current entry</a> is the last entry
in the session history, or if there are no entries after the
<a href="#current1">current entry</a> that reference the same
<code>Document</code> object, then no entries are removed.</p>
<p>Then, the user agent must add a state object entry to the
session history, after the <a href="#current1">current entry</a> ,
with the specified <var title="">data</var> as the state object,
the given <var title="">title</var> as the title, and, if the third
argument is present, the given <var title="">url</var> as the URI
of the entry.</p>
<p><ins class="diff-new">Then, the user agent must set this new
entry as being the</ins> <a href="#last-activated"><ins class=
"diff-new">last activated entry</ins></a> <ins class="diff-new">for
the</ins> <code><ins class="diff-new">Document</ins></code> .</p>
<p>Finally, the user agent must update the <a href=
"#current1">current entry</a> to be the this newly added entry.</p>
<p class="note">The <var title="">title</var> is purely advisory.
User agents might use the title in the user interface.</p>
<p>User agents may limit the number of state objects added to the
session history per page. If a page hits the UA-defined limit, user
agents must remove the entry immediately after the first entry for
that <code>Document</code> object in the session history after
having added the new entry. (Thus the state history acts as a FIFO
buffer for eviction, but as a LIFO buffer for navigation.)</p>
<p>The <dfn id="clearstate" title=
"dom-history-clearState"><code>clearState()</code></dfn> method
removes all the state objects for the <code>Document</code> object
from the session history.</p>
<p>When this method is invoked, the user agent must remove from the
session history all the entries from the first state object entry
for that <code>Document</code> object up to the last entry that
references that same <code>Document</code> object, if any.</p>
<p>Then, if the <a href="#current1">current entry</a> was removed
in the previous step, the <a href="#current1">current entry</a>
must be set to the last entry for that <code>Document</code> object
in the session history.</p>
<h4 id="activating"><span class="secno"><del class=
"diff-old">4.7.3.</del> <ins class="diff-chg">4.8.3</ins></span>
<dfn id="activating0" title="activate the state object">Activating
state <del class="diff-old">objects</del> <ins class=
"diff-chg">object entries</ins></dfn></h4>
<p>When <del class="diff-old">a state object</del> <ins class=
"diff-chg">an entry</ins> in the session history is activated
(which happens <del class="diff-old">in the cases</del> <ins class=
"diff-chg">during</ins> <a href="#traverse" title=
"traverse the history"><ins class="diff-chg">session
traversal</ins></a> ,<ins class="diff-chg">as</ins> described
above), the user agent must <ins class="diff-new">run the following
steps:</ins></p>
<ol>
<li>
<p><ins class="diff-new">First, the user agent must set this new
entry as being the</ins> <a href="#last-activated"><ins class=
"diff-new">last activated entry</ins></a> <ins class="diff-new">for
the</ins> <code><ins class="diff-new">Document</ins></code>
<ins class="diff-new">to which the entry belongs.</ins></p>
</li>
<li>
<p><ins class="diff-new">If the entry is a</ins> <a href=
"#state"><ins class="diff-new">state object</ins></a> <ins class=
"diff-new">entry, let</ins> <var title=""><ins class=
"diff-new">state</ins></var> <ins class="diff-new">be that state
object. Otherwise, the entry is the first entry for the</ins>
<code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">; let</ins> <var title=""><ins class=
"diff-new">state</ins></var> <ins class="diff-new">be
null.</ins></p>
</li>
<li>
<p><ins class="diff-new">The user agent must then</ins> fire a
<dfn id="popstate" title=
"event-popstate"><code>popstate</code></dfn> event in no namespace
on <del class="diff-old">the</del> <a href="#the-body1">the body
element</a> using the <code><a href=
"#popstateevent">PopStateEvent</a></code> interface, with the
<del class="diff-old">state object in the</del> <code title=
"dom-PopStateEvent-state"><a href="#state0">state</a></code>
<del class="diff-old">attribute.</del> <ins class=
"diff-chg">attribute set to the value of</ins> <var title=
""><ins class="diff-chg">state</ins></var> . This event bubbles but
is not cancelable and has no default action.</p>
</li>
</ol>
<pre class="idl">
interface <dfn id="popstateevent">PopStateEvent</dfn> : Event {
readonly attribute DOMObject <a href="#state0" title=
"dom-PopStateEvent-state">state</a>;
<del class=
"diff-old"> void (in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMObject statetArg);
</del>
<ins class="diff-chg"> void <a href="#initpopstateevent" title=
"dom-PopStateEvent-initPopStateEvent">initPopStateEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMObject stateArg);
</ins>
void <a href="#initpopstateeventns" title=
"dom-PopStateEvent-initPopStateEventNS">initPopStateEventNS</a>(in DOMString namespaceURIArg, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMObject stateArg);
};
</pre>
<p>The <dfn id="initpopstateevent" title=
"dom-PopStateEvent-initPopStateEvent"><code>initPopStateEvent()</code></dfn>
and <dfn id="initpopstateeventns" title=
"dom-PopStateEvent-initPopStateEventNS"><code>initPopStateEventNS()</code></dfn>
methods must initialise the event in a manner analogous to the
similarly-named methods in the DOM3 Events interfaces. <a href=
"#references">[DOM3EVENTS]</a></p>
<p>The <dfn id="state0" title=
"dom-PopStateEvent-state"><code>state</code></dfn> attribute
represents the context information for the <del class=
"diff-old">event. Should we coalesce these events</del> <ins class=
"diff-chg">event, or null,</ins> if <del class="diff-old">they
occur while</del> the <del class="diff-old">page</del> <ins class=
"diff-chg">state represented</ins> is <del class="diff-old">away?
(e.g. during traversal -- see above)</del> <ins class=
"diff-chg">the initial state of the</ins> <code><ins class=
"diff-chg">Document</ins></code> .</p>
<h4 id="the-location"><span class="secno"><del class=
"diff-old">4.7.4.</del> <ins class="diff-chg">4.8.4</ins></span>
The <code><a href="#location2">Location</a></code> interface</h4>
<p>Each <code>Document</code> object in a browsing context's
session history is associated with a unique instance of a
<code><a href="#location2">Location</a></code> object.</p>
<p>The <dfn id="location0" title=
"dom-document-location"><code>location</code></dfn> attribute of
the <code><a href="#htmldocument">HTMLDocument</a></code> interface
must return the <code><a href="#location2">Location</a></code>
object for that <code>Document</code> object.</p>
<p>The <dfn id="location1" title=
"dom-location"><code>location</code></dfn> attribute of the
<code><a href="#window">Window</a></code> interface must return the
<code><a href="#location2">Location</a></code> object for that
<code><a href="#window">Window</a></code> object's <a href=
"#active">active document</a> .</p>
<p><code><a href="#location2">Location</a></code> objects provide a
representation of the URI of their document, and allow the <a href=
"#current1">current entry</a> of the <a href="#browsing1">browsing
context</a> 's session history to be changed, by adding or
replacing entries in the <code title="dom-history"><a href=
"#history1">history</a></code> object.</p>
<pre class="idl">
interface <dfn id="location2">Location</dfn> {
readonly attribute DOMString <a href="#href5" title=
"dom-location-href">href</a>;
void <a href="#assign" title=
"dom-location-assign">assign</a>(in DOMString url);
void <a href="#replace" title=
"dom-location-replace">replace</a>(in DOMString url);
void <span title="dom-location-reload">reload</span>();
// <a href="#uri-decomposition">URI decomposition attributes</a>
attribute DOMString <a href="#protocol" title=
"dom-location-protocol">protocol</a>;
attribute DOMString <a href="#host" title=
"dom-location-host">host</a>;
attribute DOMString <a href="#hostname" title=
"dom-location-hostname">hostname</a>;
attribute DOMString <a href="#port" title=
"dom-location-port">port</a>;
attribute DOMString <a href="#pathname" title=
"dom-location-pathname">pathname</a>;
attribute DOMString <a href="#search" title=
"dom-location-search">search</a>;
attribute DOMString <a href="#hash" title=
"dom-location-hash">hash</a>;
};
</pre>
<p><del class="diff-old">In the ECMAScript DOM binding, objects
implementing this interface must stringify to the same value as the
href attribute. In the ECMAScript DOM binding, the location members
of the HTMLDocument and Window interfaces behave as if they had a
setter: user agents must treats attempts to set these location
attribute as attempts at setting the href attribute of the relevant
Location object instead.</del> The <dfn id="href5" title=
"dom-location-href"><code>href</code></dfn> attribute returns the
address of the page represented by the associated
<code>Document</code> object, as an absolute IRI reference.</p>
<p>On setting, the user agent must act as if the <code title=
"dom-location-assign"><a href="#assign">assign()</a></code> method
had been called with the new value as its argument.</p>
<p>When the <dfn id="assign" title=
"dom-location-assign"><code>assign( <var title="">url</var>
)</code></dfn> method is invoked, the UA must <a href=
"#navigate">navigate</a> the <a href="#browsing1">browsing
context</a> to the specified <var title="">url</var> .</p>
<p>When the <dfn id="replace" title=
"dom-location-replace"><code>replace( <var title="">url</var>
)</code></dfn> method is invoked, the UA must <a href=
"#navigate">navigate</a> <ins class="diff-new">the</ins> <a href=
"#browsing1"><ins class="diff-new">browsing context</ins></a> to
the specified <var title="">url</var> with <a href=
"#replacement">replacement enabled</a> .</p>
<p><ins class="diff-new">Navigation for the</ins> <code title=
"dom-location-assign"><a href="#assign"><ins class=
"diff-new">assign()</ins></a></code> <ins class=
"diff-new">and</ins> <code title="dom-location-replace"><a href=
"#replace"><ins class="diff-new">replace()</ins></a></code>
<ins class="diff-new">methods must be done with the</ins> <a href=
"#browsing1"><ins class="diff-new">browsing context</ins></a>
<ins class="diff-new">of the</ins> <code><a href=
"#window"><ins class="diff-new">Window</ins></a></code> <ins class=
"diff-new">object that is the</ins> <a href="#script2"><ins class=
"diff-new">script execution context</ins></a> <ins class=
"diff-new">of the script that invoked the method as the</ins>
<a href="#source0"><ins class="diff-new">source browsing
context</ins></a> .</p>
<p class="note"><ins class="diff-new">If the</ins> <a href=
"#script2"><ins class="diff-new">script execution context</ins></a>
<ins class="diff-new">of a script isn't a</ins> <code><a href=
"#window"><ins class="diff-new">Window</ins></a></code> <ins class=
"diff-new">object, then it can't ever get to a</ins> <code><a href=
"#location2"><ins class="diff-new">Location</ins></a></code>
<ins class="diff-new">object to call these methods.</ins></p>
<p>Relative <var title="">url</var> arguments for <code title=
"dom-location-assign"><a href="#assign">assign()</a></code> and
<code title="dom-location-replace"><a href=
"#replace">replace()</a></code> must be resolved relative to the
<a href="#scripts0" title="script's base URI">base URI of the
script</a> that made the method call.</p>
<p>The <code><a href="#location2">Location</a></code> interface
also has the complement of <a href="#uri-decomposition">URI
decomposition attributes</a> , <dfn id="protocol" title=
"dom-location-protocol"><code>protocol</code></dfn> , <dfn id=
"host" title="dom-location-host"><code>host</code></dfn> , <dfn id=
"port" title="dom-location-port"><code>port</code></dfn> , <dfn id=
"hostname" title=
"dom-location-hostname"><code>hostname</code></dfn> , <dfn id=
"pathname" title=
"dom-location-pathname"><code>pathname</code></dfn> , <dfn id=
"search" title="dom-location-search"><code>search</code></dfn> ,
and <dfn id="hash" title=
"dom-location-hash"><code>hash</code></dfn> . These must follow the
rules given for URI decomposition attributes, with the <a href=
"#input" title="concept-uda-input">input</a> being the address of
the page represented by the associated <code>Document</code>
object, as an absolute IRI reference (same as the <code title=
"dom-location-href"><a href="#href5">href</a></code> attribute),
and the <a href="#common3" title="concept-uda-setter">common setter
action</a> being the same as setting the <code title=
"dom-location-href"><a href="#href5">href</a></code> attribute to
the new output value.</p>
<h5 id="security6"><span class="secno"><del class=
"diff-old">4.7.4.1.</del> <ins class=
"diff-chg">4.8.4.1.</ins></span> Security</h5>
<p>User agents must raise a <a href="#security9">security
exception</a> whenever any of the members of a <code><a href=
"#location2">Location</a></code> object are accessed by scripts
whose <a href="#effective3"><ins class="diff-chg">effective
script</ins> origin</a> is not the <a href="#same-origin" title=
"same origin">same</a> as the <code><a href=
"#location2">Location</a></code> object's associated
<code>Document</code> 's <del class="diff-old">origin,</del>
<a href="#effective3"><ins class="diff-chg">effective script
origin</ins></a> , with the following exceptions:</p>
<ul>
<li>The <code title="dom-location-href"><a href=
"#href5">href</a></code> <del class="diff-old">setter</del>
<ins class="diff-chg">setter, if the script is running in a</ins>
<a href="#browsing1"><ins class="diff-chg">browsing
context</ins></a> <ins class="diff-chg">that is</ins> <a href=
"#allowed"><ins class="diff-chg">allowed to navigate</ins></a>
<ins class="diff-chg">the browsing context with which the</ins>
<code><a href="#location2"><ins class=
"diff-chg">Location</ins></a></code> <ins class="diff-chg">object
is associated</ins></li>
</ul>
<p>User agents must not allow scripts to override the <code title=
"dom-location-href"><a href="#href5">href</a></code> attribute's
setter.</p>
<h4 id="history-notes"><span class="secno"><del class=
"diff-old">4.7.5.</del> <ins class="diff-chg">4.8.5</ins></span>
Implementation notes for session history</h4>
<p><em>This section is non-normative.</em></p>
<p>The <code><a href="#history2">History</a></code> interface is
not meant to place restrictions on how implementations represent
the session history to the user.</p>
<p>For example, session history could be implemented in a tree-like
manner, with each page having multiple "forward" pages. This
specification doesn't define how the linear list of pages in the
<code title="dom-history"><a href="#history1">history</a></code>
object are derived from the actual session history as seen from the
user's perspective.</p>
<p>Similarly, a page containing two <code><a href=
"#iframe">iframe</a></code> s has a <code title=
"dom-history"><a href="#history1">history</a></code> object
distinct from the <code><a href="#iframe">iframe</a></code> s'
<code title="dom-history"><a href="#history1">history</a></code>
objects, despite the fact that typical Web browsers present the
user with just one "Back" button, with a session history that
interleaves the navigation of the two inner frames and the outer
page.</p>
<p><strong>Security:</strong> It is suggested that to avoid letting
a page "hijack" the history navigation facilities of a UA by
abusing <code title="dom-history-pushState"><a href=
"#pushstate">pushState()</a></code> , the UA provide the user with
a way to jump back to the previous page (rather than just going
back to the previous state). For example, the back button could
have a drop down showing just the pages in the session history, and
not showing any of the states. Similarly, an aural browser could
have two "back" commands, one that goes back to the previous state,
and one that jumps straight back to the previous page.</p>
<p>In addition, a user agent could ignore calls to <code title=
"dom-history-pushState"><a href="#pushstate">pushState()</a></code>
that are invoked on a timer, or from event handlers that do not
represent a clear user action, or that are invoked in rapid
succession.</p>
<h3 id="browsing0"><span class="secno"><del class=
"diff-old">4.8.</del> <ins class="diff-chg">4.9</ins></span>
<ins class="diff-chg">Browsing the Web</ins></h3>
<h4 id="navigating"><span class="secno"><ins class=
"diff-chg">4.9.1</ins></span> Navigating across documents</h4>
<p>Certain actions cause the <a href="#browsing1">browsing
context</a> to <dfn id="navigate">navigate</dfn> . <ins class=
"diff-new">Navigation always involves a</ins> <dfn id=
"source0"><ins class="diff-new">source browsing context</ins></dfn>
,<ins class="diff-new">which is the browsing context which was
responsible for starting the navigation.</ins></p>
<p class="example">For example, <a href="#following0" title=
"following hyperlinks">following a hyperlink</a> , <span title=
"">form submission</span> , and the <code title="dom-open"><a href=
"#open2">window.open()</a></code> and <code title=
"dom-location-assign"><a href=
"#assign">location.assign()</a></code> methods can all cause a
browsing context to navigate.</p>
<p>A user agent may also provide various ways for the user to
explicitly cause a browsing context to navigate.</p>
<p>When a browsing context is navigated, the user agent must run
the following steps:</p>
<ol>
<li id="sandboxLinks">
<p><ins class="diff-new">If the</ins> <a href=
"#source0"><ins class="diff-new">source browsing context</ins></a>
<ins class="diff-new">is not the same as the</ins> <a href=
"#browsing1"><ins class="diff-new">browsing context</ins></a>
<ins class="diff-new">being navigated, and the</ins> <a href=
"#source0"><ins class="diff-new">source browsing context</ins></a>
<ins class="diff-new">is not one of the</ins> <a href="#ancestor"
title="ancestor browsing context"><ins class="diff-new">ancestor
browsing contexts</ins></a> <ins class="diff-new">of the</ins>
<a href="#browsing1"><ins class="diff-new">browsing
context</ins></a> <ins class="diff-new">being navigated, and
the</ins> <a href="#source0"><ins class="diff-new">source browsing
context</ins></a> <ins class="diff-new">has its</ins> <a href=
"#sandboxed"><ins class="diff-new">sandboxed navigation browsing
context flag</ins></a> <ins class="diff-new">set, then abort these
steps. The user agent may offer to open the specified resource in a
new</ins> <a href="#top-level"><ins class="diff-new">top-level
browsing context</ins></a> <ins class="diff-new">or in the</ins>
<a href="#top-level"><ins class="diff-new">top-level browsing
context</ins></a> <ins class="diff-new">of the</ins> <a href=
"#source0"><ins class="diff-new">source browsing context</ins></a>
,<ins class="diff-new">at the user's option, in which case the user
agent must</ins> <a href="#navigate"><ins class=
"diff-new">navigate</ins></a> <ins class="diff-new">that
designated</ins> <a href="#top-level"><ins class=
"diff-new">top-level browsing context</ins></a> <ins class=
"diff-new">to the specified resource as if the user had requested
it independently.</ins></p>
</li>
<li id="seamlessLinks">
<p><ins class="diff-new">If the</ins> <a href=
"#source0"><ins class="diff-new">source browsing context</ins></a>
<ins class="diff-new">is the same as the</ins> <a href=
"#browsing1"><ins class="diff-new">browsing context</ins></a>
<ins class="diff-new">being navigated, and this browsing context
has its</ins> <a href="#seamless0"><ins class="diff-new">seamless
browsing context flag</ins></a> <ins class="diff-new">set, then
find the nearest</ins> <a href="#ancestor"><ins class=
"diff-new">ancestor browsing context</ins></a> <ins class=
"diff-new">that does not have its</ins> <a href=
"#seamless0"><ins class="diff-new">seamless browsing context
flag</ins></a> <ins class="diff-new">set, and continue these steps
as if</ins> <em><ins class="diff-new">that</ins></em> <a href=
"#browsing1"><ins class="diff-new">browsing context</ins></a>
<ins class="diff-new">was the one that was going to be</ins>
<a href="#navigate" title="navigate"><ins class=
"diff-new">navigated</ins></a> <ins class=
"diff-new">instead.</ins></p>
</li>
<li>
<p>Cancel any preexisting attempt to navigate the browsing
context.</p>
</li>
<li>
<p>If the new resource is the same as the current resource, but a
fragment identifier has been specified, <ins class=
"diff-new">changed, or removed,</ins> then <a href="#navigating0"
title="navigate-fragid">navigate to that fragment identifier</a>
and abort these steps.</p>
</li>
<li>
<p>If the new resource is to be handled by displaying some sort of
inline content, e.g. an error message because the specified scheme
is not one of the supported protocols, or an inline prompt to allow
the user to select <a href="#registerprotocolhandler" title=
"dom-navigator-registerProtocolHandler">a registered handler</a>
for the given scheme, then <a href="#page-load4" title=
"navigate-ua-inline">display the inline content</a> and abort these
steps.</p>
</li>
<li>
<p>If the new resource is to be handled using a mechanism that does
not affect the browsing context, then abort these steps and proceed
with that mechanism instead.</p>
</li>
<li>
<p>If the new resource is to be fetched using HTTP GET or
equivalent, and if the browsing context being navigated is a
<a href="#top-level">top-level browsing context</a> , then check if
there are any <a href="#application0" title=
"application cache">application caches</a> that have a <a href=
"#the-manifest" title="concept-appcache-manifest">manifest</a> with
the <a href="#same-origin">same <del class=
"diff-old">scheme/host/port</del> <ins class=
"diff-chg">origin</ins></a> as the URI in question, and that have
this URI as one of their entries (excluding entries marked as
<a href="#foreign" title="concept-appcache-foreign"><del class=
"diff-old">manifest</del> <ins class="diff-chg">foreign</ins></a>
), and that already contain their manifest, <del class=
"diff-old">categorised</del> <ins class=
"diff-chg">categorized</ins> as a <a href="#the-manifest" title=
"concept-appcache-manifest">manifest</a> . If so, then the user
agent must then fetch the resource from the <a href="#select0"
title="concept-appcache-selection">most appropriate application
cache</a> of those that match.</p>
<p>Otherwise, start fetching the specified resource in the
appropriate manner (e.g. performing an HTTP GET or POST operation,
or reading the file from disk, or executing script in the case of a
<a href="#the-javascript" title="javascript protocol"><code title=
"">javascript:</code> URI</a> ). If this results in a redirect,
return to step 2 with the new resource.</p>
<p class="example">For example, imagine an HTML page with an
associated application cache displaying an image and a form, where
the image is also used by several other application caches. If the
user right-clicks on the image and chooses "View Image", then the
user agent could decide to show the image from any of those caches,
but it is likely that the most useful cache for the user would be
the one that was used for the aforementioned HTML page. On the
other hand, if the user submits the form, and the form does a POST
submission, then the user agent will not use an application cache
at all; the submission will be made to the network.</p>
</li>
<li>
<p>Wait for one or more bytes to be available or for the user agent
to establish that the resource in question is empty. During this
time, the user agent may allow the user to cancel this navigation
attempt or start other navigation attempts.</p>
</li>
<li>
<p>If the resource was not fetched from an <a href=
"#application0">application cache</a> , and was to be fetched using
HTTP GET or equivalent, and its URI <a href="#matches" title=
"concept-appcache-matches-oppcache">matches the opportunistic
caching namespace</a> of one or more application caches,
<ins class="diff-new">and the user didn't cancel the navigation
attempt during the previous step,</ins> then:</p>
<dl class="switch">
<dt>If the <del class="diff-old">file was successfully downloaded
The user agent must cache</del> <ins class="diff-chg">browsing
context being navigated is a</ins> <a href="#top-level"><ins class=
"diff-chg">top-level browsing context</ins></a> ,<ins class=
"diff-chg">and</ins> the <del class="diff-old">resource in all
those application caches, categorised as opportunistically cached
entries . If</del> <ins class="diff-chg">navigation attempt failed
(e.g.</ins> the server returned a 4xx or 5xx status code or
equivalent, or there <del class="diff-old">were network errors If
the browsing context being navigated is</del> <ins class=
"diff-chg">was</ins> a <del class="diff-old">top-level browsing
context , then the user agent must discard the failed load and
instead use</del> <ins class="diff-chg">DNS error)</ins></dt>
<dd>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">candidate</ins></var> <ins class="diff-chg">be</ins> the
<a href="#fallback0" title="concept-appcache-fallback">fallback
resource</a> specified for the opportunistic caching namespace in
question. If multiple application caches match, the user agent must
use the fallback of the <a href="#select0" title=
"concept-appcache-selection">most appropriate application cache</a>
of those that match.</p>
<p><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">candidate</ins></var> <ins class="diff-new">is not
marked as</ins> <a href="#foreign" title=
"concept-appcache-foreign"><ins class="diff-new">foreign</ins></a>
,<ins class="diff-new">then the user agent must discard the failed
load and instead continue along these steps using</ins> <var title=
""><ins class="diff-new">candidate</ins></var> <ins class=
"diff-new">as the resource.</ins></p>
<p>For the purposes of session history (and features that depend on
session history, e.g. bookmarking) the user agent must use the URI
of the resource that was requested (the one that matched the
opportunistic caching namespace), not the fallback resource.
However, the user agent may indicate to the user that the original
page load failed, that the page used was a fallback resource, and
what the URI of the fallback resource actually is.</p>
</dd>
<dt><ins class="diff-new">Otherwise</ins></dt>
<dd>
<p><ins class="diff-new">Once the download is complete, if there
were no errors and the user didn't cancel the request, the user
agent must cache the resource in all the application caches that
have a</ins> <a href="#matches" title=
"concept-appcache-matches-oppcache"><ins class="diff-new">matching
opportunistic caching namespace</ins></a> ,<ins class=
"diff-new">categorized as</ins> <a href="#opportunistically" title=
"concept-appcache-oppcache"><ins class="diff-new">opportunistically
cached entries</ins></a> .<ins class="diff-new">Meanwhile, the user
must continue along these steps.</ins></p>
</dd>
</dl>
</li>
<li>
<p>If the document's out-of-band metadata (e.g. HTTP headers), not
counting any <a href="#content-type8" title="Content-Type">type
information</a> (such as the Content-Type HTTP header), requires
some sort of processing that will not affect the browsing context,
then perform that processing and abort these steps.</p>
<div class="note">
<p>Such processing might be triggered by, amongst other things, the
following:</p>
<ul class="brief">
<li>HTTP status codes (e.g. 204 No Content or 205 Reset
Content)</li>
<li>HTTP Content-Disposition headers</li>
<li>Network errors</li>
</ul>
</div>
</li>
<li>
<p>Let <var title="">type</var> be <a href="#sniffed" title=
"Content-Type sniffing">the sniffed type of the resource</a> .</p>
</li>
<li>
<p>If the user agent has been configured to process resources of
the given <var title="">type</var> using some mechanism other than
rendering the content in a <a href="#browsing1">browsing
context</a> , then skip this step. Otherwise, if the <var title=
"">type</var> is one of the following types, jump to the
appropriate entry in the following list, and process the resource
as described there:</p>
<dl class="switch">
<dt>"text/html"</dt>
<dd>Follow the steps given in the <a href="#page-load" title=
"navigate-html">HTML document</a> section, and abort these
steps.</dd>
<dt>Any type ending in "+xml"</dt>
<dt>"application/xml"</dt>
<dt>"text/xml"</dt>
<dd>Follow the steps given in the <a href="#page-load0" title=
"navigate-xml">XML document</a> section. If that section determines
that the content is <em>not</em> to be displayed as a generic XML
document, then proceed to the next step in this overall set of
steps. Otherwise, abort these steps.</dd>
<dt>"text/plain"</dt>
<dd>Follow the steps given in the <a href="#page-load1" title=
"navigate-text">plain text file</a> section, and abort these
steps.</dd>
<dt>A supported image type</dt>
<dd>Follow the steps given in the <a href="#page-load2" title=
"navigate-image">image</a> section, and abort these steps.</dd>
<dt>A type that will use an external application to render the
content in the <a href="#browsing1">browsing context</a></dt>
<dd>Follow the steps given in the <a href="#page-load3" title=
"navigate-plugin">plugin</a> section, and abort these steps.</dd>
</dl>
</li>
<li id="navigate-non-Document">
<p>If, given <var title="">type</var> , the new resource is to be
handled by displaying some sort of inline content, e.g. a native
rendering of the content, an error message because the specified
type is not supported, or an inline prompt to allow the user to
select <a href="#registercontenthandler" title=
"dom-navigator-registerContentHandler">a registered handler</a> for
the given type, then <a href="#page-load4" title=
"navigate-ua-inline">display the inline content</a> and abort these
steps.</p>
</li>
<li>
<p>Otherwise, the document's <var title="">type</var> is such that
the resource will not affect the browsing context, e.g. because the
resource is to be handed to an external application. Process the
resource appropriately.</p>
</li>
</ol>
<p>Some of the sections below, to which the above algorithm defers
in certain cases, require the user agent to <dfn id=
"update2">update the session history with the new page</dfn> . When
a user agent is required to do this, it must follows the set of
steps given below that is appropriate for the situation at hand.
From the point of view of any script, these steps must occur
atomically.</p>
<ol>
<li>
<p class="big-issue">pause for scripts</p>
</li>
<li>
<p class="big-issue"><del class="diff-old">onbeforeunload</del>
<ins class="diff-chg">onbeforeunload, and if present set flag that
we will kill document</ins></p>
</li>
<li>
<p class="big-issue"><del class="diff-old">onunload</del>
<ins class="diff-chg">onunload, and if present set flag that we
will kill document</ins></p>
</li>
<li>
<p class="big-issue"><ins class="diff-chg">if flag is set: reset
timers, empty event queue, kill any pending transactions, kill
XMLHttpRequests, etc, and set things up so that the document will
be discarded asap</ins></p>
</li>
<li>
<dl>
<dt>If the navigation was initiated for <dfn id="entry">entry
update</dfn> of an entry</dt>
<dd>
<ol>
<li>
<p>Replace the entry being updated with a new entry representing
the new resource and its <code>Document</code> object and related
state. The user agent may propagate state from the old entry to the
new entry (e.g. scroll position).</p>
</li>
<li>
<p><a href="#traverse">Traverse the history</a> to the new
entry.</p>
</li>
</ol>
</dd>
<dt>Otherwise</dt>
<dd>
<ol>
<li>
<p>Remove all the entries after the <a href="#current1">current
entry</a> in the <a href="#browsing1">browsing context</a> 's
<code>Document</code> object's <code><a href=
"#history2">History</a></code> object.</p>
<p class="note">This <a href="#history-notes">doesn't necessarily
have to affect</a> the user agent's user interface.</p>
</li>
<li>
<p>Append a new entry at the end of the <code><a href=
"#history2">History</a></code> object representing the new resource
and its <code>Document</code> object and related state.</p>
</li>
<li>
<p><a href="#traverse">Traverse the history</a> to the new
entry.</p>
</li>
<li>
<p>If the navigation was initiated with <dfn id=
"replacement">replacement enabled</dfn> , remove the entry
immediately before the new <a href="#current1">current entry</a> in
the session history.</p>
</li>
</ol>
</dd>
</dl>
</li>
</ol>
<h4 id="read-html"><span class="secno"><del class=
"diff-old">4.8.1.</del> <ins class="diff-chg">4.9.2</ins></span>
<dfn id="page-load" title="navigate-html">Page load processing
model for HTML files</dfn></h4>
<p>When an HTML document is to be loaded in a <a href=
"#browsing1">browsing context</a> , the user agent must create a
<code>Document</code> object, mark it as being an <a href="#html-"
title="HTML documents">HTML document</a> , create an <a href=
"#html-0">HTML parser</a> , associate it with the document, and
begin to use the bytes provided for the document as the <a href=
"#input0">input stream</a> for that parser.</p>
<p class="note">The <a href="#input0">input stream</a> converts
bytes into characters for use in the <span>tokeniser</span> . This
process relies, in part, on character encoding information found in
the real <a href="#content-type8" title="Content-Type">Content-Type
metadata</a> of the resource; the "sniffed type" is not used for
this purpose.</p>
<p>When no more bytes are available, an EOF character is implied,
which eventually causes a <code title="event-load"><a href=
"#load0">load</a></code> event to be fired.</p>
<p>After creating the <code>Document</code> object, but potentially
before the page has finished parsing, the user agent must <a href=
"#update2">update the session history with the new page</a> .</p>
<p class="note"><a href="#application2" title=
"concept-appcache-init-with-attribute">Application cache
selection</a> happens <a href="#parser-appcache">in the HTML
parser</a> .</p>
<h4 id="read-xml"><span class="secno"><del class=
"diff-old">4.8.2.</del> <ins class="diff-chg">4.9.3</ins></span>
<dfn id="page-load0" title="navigate-xml">Page load processing
model for XML files</dfn></h4>
<p>When faced with displaying an XML file inline, user agents must
first create a <code>Document</code> object, following the
requirements of the XML and Namespaces in XML recommendations, RFC
3023, DOM3 Core, and other relevant specifications. <a href=
"#references">[XML]</a> <a href="#references">[XMLNS]</a> <a href=
"#references">[RFC3023]</a> <a href=
"#references">[DOM3CORE]</a></p>
<p>The actual HTTP headers and other metadata, not the headers as
mutated or implied by the algorithms given in this specification,
are the ones that must be used when determining the character
encoding according to the rules given in the above specifications.
<ins class="diff-new">Once the character encoding is established,
the</ins> <a href="#character1"><ins class="diff-new">document's
character encoding</ins></a> <ins class="diff-new">must be set to
that character encoding.</ins></p>
<p>If the root element, as parsed according to the XML
specifications cited above, is found to be an <code><a href=
"#html">html</a></code> element with an attribute <code title=
"attr-html-manifest"><a href="#manifest">manifest</a></code> ,
then, as soon as the element is inserted into the DOM, the user
agent must run the <a href="#application2" title=
"concept-appcache-init-with-attribute">application cache selection
algorithm</a> with the value of that <del class=
"diff-old">attribute</del> <ins class="diff-chg">attribute,
resolved relative to the</ins> <a href="#elements2"><ins class=
"diff-chg">element's base URI</ins></a> , as the manifest URI.
Otherwise, as soon as the root element is inserted into the DOM,
the user agent must run the <a href="#application3" title=
"concept-appcache-init-no-attribute">application cache selection
algorithm</a> with no manifest.</p>
<p class="note">Because the processing of the <code title=
"attr-html-manifest"><a href="#manifest">manifest</a></code>
attribute happens only once the root element is parsed, any URIs
referenced by processing instructions before the root element (such
as <code title=""><?xml-styleesheet?></code> and <code title=
""><?xbl?></code> PIs) will be fetched from the network and
cannot be cached.</p>
<p>User agents may examine the namespace of the root
<code>Element</code> node of this <code>Document</code> object to
perform namespace-based dispatch to alternative processing tools,
e.g. determining that the content is actually a syndication feed
and passing it to a feed handler. If such processing is to take
place, abort the steps in this section, and jump to <a href=
"#navigate-non-Document">step 10</a> in the <a href=
"#navigate">navigate</a> steps above.</p>
<p>Otherwise, then, with the newly created <code>Document</code> ,
the user agents must <a href="#update2">update the session history
with the new page</a> . User agents may do this before the complete
document has been parsed (thus achieving <i>incremental
rendering</i> ).</p>
<p>Error messages from the parse process (e.g. namespace
well-formedness errors) may be reported inline by mutating the
<code>Document</code> .</p>
<h4 id="read-text"><span class="secno"><del class=
"diff-old">4.8.3.</del> <ins class="diff-chg">4.9.4</ins></span>
<dfn id="page-load1" title="navigate-text">Page load processing
model for text files</dfn></h4>
<p>When a plain text document is to be loaded in a <a href=
"#browsing1">browsing context</a> , the user agent should create a
<code>Document</code> object, mark it as being an <a href="#html-"
title="HTML documents">HTML document</a> , create an <a href=
"#html-0">HTML parser</a> , associate it with the document, act as
if the tokeniser had emitted a start tag token with the tag name
"pre", set the <a href="#tokenisation0">tokenisation</a> stage's
<a href="#content2">content model flag</a> to <i>PLAINTEXT</i> ,
and begin to pass the stream of characters in the plain text
document to that tokeniser.</p>
<p>The rules for how to convert the bytes of the plain text
document into actual characters are defined in RFC 2046, RFC 2646,
and subsequent versions thereof. <a href=
"#references">[RFC2046]</a> <a href="#references">[RFC2646]</a></p>
<p><ins class="diff-new">The</ins> <a href=
"#character1"><ins class="diff-new">document's character
encoding</ins></a> <ins class="diff-new">must be set to the
character encoding used to decode the document.</ins></p>
<p>Upon creation of the <code>Document</code> object, the user
agent must run the <a href="#application3" title=
"concept-appcache-init-no-attribute">application cache selection
algorithm</a> with no manifest.</p>
<p>When no more character are available, an EOF character is
implied, which eventually causes a <code title=
"event-load"><a href="#load0">load</a></code> event to be
fired.</p>
<p>After creating the <code>Document</code> object, but potentially
before the page has finished parsing, the user agent must <a href=
"#update2">update the session history with the new page</a> .</p>
<p>User agents may add content to the <code><a href=
"#head">head</a></code> element of the <code>Document</code> , e.g.
linking to stylesheet or an XBL binding, providing script, giving
the document a <code><a href="#title1">title</a></code> , etc.</p>
<h4 id="read-image"><span class="secno"><del class=
"diff-old">4.8.4.</del> <ins class="diff-chg">4.9.5</ins></span>
<dfn id="page-load2" title="navigate-image">Page load processing
model for images</dfn></h4>
<p>When an image resource is to be loaded in a <a href=
"#browsing1">browsing context</a> , the user agent should create a
<code>Document</code> object, mark it as being an <a href="#html-"
title="HTML documents">HTML document</a> , append an <code><a href=
"#html">html</a></code> element to the <code>Document</code> ,
append a <code><a href="#head">head</a></code> element and a
<code><a href="#body0">body</a></code> element to the
<code><a href="#html">html</a></code> element, append an
<code><a href="#img">img</a></code> to the <code><a href=
"#body0">body</a></code> element, and set the <code title=
"attr-img-src"><a href="#src">src</a></code> attribute of the
<code><a href="#img">img</a></code> element to the address of the
image.</p>
<p>Then, the user agent must act as if it had <a href="#stops"
title="stop parsing">stopped parsing</a> .</p>
<p>Upon creation of the <code>Document</code> object, the user
agent must run the <a href="#application3" title=
"concept-appcache-init-no-attribute">application cache selection
algorithm</a> with no manifest.</p>
<p>After creating the <code>Document</code> object, but potentially
before the page has finished fully loading, the user agent must
<a href="#update2">update the session history with the new page</a>
.</p>
<p>User agents may add content to the <code><a href=
"#head">head</a></code> element of the <code>Document</code> , or
attributes to the <code><a href="#img">img</a></code> element, e.g.
to link to stylesheet or an XBL binding, to provide a script, to
give the document a <code><a href="#title1">title</a></code> ,
etc.</p>
<h4 id="read-plugin"><span class="secno"><del class=
"diff-old">4.8.5.</del> <ins class="diff-chg">4.9.6</ins></span>
<dfn id="page-load3" title="navigate-plugin">Page load processing
model for content that uses plugins</dfn></h4>
<p>When a resource that requires an external resource to be
rendered is to be loaded in a <a href="#browsing1">browsing
context</a> , the user agent should create a <code>Document</code>
object, mark it as being an <a href="#html-" title=
"HTML documents">HTML document</a> , append an <code><a href=
"#html">html</a></code> element to the <code>Document</code> ,
append a <code><a href="#head">head</a></code> element and a
<code><a href="#body0">body</a></code> element to the
<code><a href="#html">html</a></code> element, append an
<code><a href="#embed">embed</a></code> to the <code><a href=
"#body0">body</a></code> element, and set the <code title=
"attr-img-src"><a href="#src">src</a></code> attribute of the
<code><a href="#img">img</a></code> element to the address of the
image.</p>
<p>Then, the user agent must act as if it had <a href="#stops"
title="stop parsing">stopped parsing</a> .</p>
<p>Upon creation of the <code>Document</code> object, the user
agent must run the <a href="#application3" title=
"concept-appcache-init-no-attribute">application cache selection
algorithm</a> with no manifest.</p>
<p>After creating the <code>Document</code> object, but potentially
before the page has finished fully loading, the user agent must
<a href="#update2">update the session history with the new page</a>
.</p>
<p>User agents may add content to the <code><a href=
"#head">head</a></code> element of the <code>Document</code> , or
attributes to the <code><a href="#embed">embed</a></code> element,
e.g. to link to stylesheet or an XBL binding, or to give the
document a <code><a href="#title1">title</a></code> .</p>
<p class="note" id="sandboxPluginNavigate"><ins class="diff-new">If
the</ins> <a href="#sandboxed0"><ins class="diff-new">sandboxed
plugins browsing context flag</ins></a> <ins class="diff-new">is
set on the</ins> <a href="#browsing1"><ins class=
"diff-new">browsing context</ins></a> ,<ins class="diff-new">the
synthesized</ins> <code><a href="#embed"><ins class=
"diff-new">embed</ins></a></code> <ins class="diff-new">element
will</ins> <a href="#sandboxPluginEmbed"><ins class="diff-new">fail
to render the content</ins></a> .</p>
<h4 id="read-ua-inline"><span class="secno"><del class=
"diff-old">4.8.6.</del> <ins class="diff-chg">4.9.7</ins></span>
<dfn id="page-load4" title="navigate-ua-inline">Page load
processing model for inline content that doesn't have a
DOM</dfn></h4>
<p>When the user agent is to display a user agent page inline in a
<a href="#browsing1">browsing context</a> , the user agent should
create a <code>Document</code> object, mark it as being an <a href=
"#html-" title="HTML documents">HTML document</a> , and then either
associate that <code>Document</code> with a custom rendering that
is not rendered using the normal <code>Document</code> rendering
rules, or mutate that <code>Document</code> until it represents the
content the user agent wants to render.</p>
<p>Once the page has been set up, the user agent must act as if it
had <a href="#stops" title="stop parsing">stopped parsing</a> .</p>
<p>Upon creation of the <code>Document</code> object, the user
agent must run the <a href="#application3" title=
"concept-appcache-init-no-attribute">application cache selection
algorithm</a> with no manifest.</p>
<p>After creating the <code>Document</code> object, but potentially
before the page has been completely set up, the user agent must
<a href="#update2">update the session history with the new page</a>
.</p>
<h4 id="scroll-to-fragid"><span class="secno"><del class=
"diff-old">4.8.7.</del> <ins class="diff-chg">4.9.8</ins></span>
<dfn id="navigating0" title="navigate-fragid">Navigating to a
fragment identifier</dfn></h4>
<p>When a user agent is supposed to navigate to a fragment
identifier, then the user agent must <a href="#update2">update the
session history with the new page</a> , where "the new page" has
the same <code>Document</code> as before but with the URI having
the newly specified fragment identifier.</p>
<p>Part of that algorithm involves the user agent having to
<a href="#scroll">scroll to the fragment identifier</a> , which is
the important part for this step.</p>
<p>When the user agent is required to <dfn id="scroll">scroll to
the fragment identifier</dfn> , it must change the scrolling
position of the document, or perform some other action, such that
<a href="#the-indicated">the indicated part of the document</a> is
brought to the user's attention. If there is no indicated part,
then the user agent must not scroll anywhere.</p>
<p>The <dfn id="the-indicated">the indicated part of the
document</dfn> is the one that the fragment <del class=
"diff-old">identifier</del> <ins class="diff-chg">identifier, if
any,</ins> identifies. The semantics of the fragment identifier in
terms of mapping it to a specific DOM Node is defined by the MIME
type specification of the document's MIME Type (for example, the
processing of fragment identifiers for XML MIME types is the
responsibility of RFC3023).</p>
<p>For HTML documents (and the <code>text/html</code> MIME type),
the following processing model must be followed to determine what
<a href="#the-indicated">the indicated part of the document</a>
is.</p>
<ol>
<li>
<p>Let <i>fragid</i> be the <fragment> part of the URI.
<a href="#references">[RFC3987]</a></p>
</li>
<li>
<p>If <i>fragid</i> is the empty string, then the <del class=
"diff-old">the</del> indicated part of the document is the top of
the document.</p>
</li>
<li>
<p>If there is an element in the DOM that has an ID exactly equal
to <i>fragid</i> , then the first such element in tree order is
<a href="#the-indicated">the indicated part of the document</a> ;
stop the algorithm here.</p>
</li>
<li>
<p>If there is an <code><a href="#a">a</a></code> element in the
DOM that has a <code title="attr-a-name">name</code> attribute
whose value is exactly equal to <i>fragid</i> , then the first such
element in tree order is <a href="#the-indicated">the indicated
part of the document</a> ; stop the algorithm here.</p>
</li>
<li>
<p>Otherwise, there is no indicated part of the document.</p>
</li>
</ol>
<p>For the purposes of the interaction of HTML with Selectors'
<del class="diff-old">:target</del> <code title="">:target</code>
pseudo-class, the <i>target element</i> is <a href=
"#the-indicated">the indicated part of the document</a> , if that
is an element; otherwise there is no <i>target element</i> .
<a href="#references">[SELECTORS]</a></p>
<h4 id="history0"><span class="secno"><ins class=
"diff-new">4.9.9</ins></span> <ins class="diff-new">History
traversal</ins></h4>
<p><ins class="diff-new">When a user agent is required to</ins>
<dfn id="traverse"><ins class="diff-new">traverse the
history</ins></dfn> <ins class="diff-new">to a</ins> <i><ins class=
"diff-new">specified entry</ins></i> ,<ins class="diff-new">the
user agent must act as follows:</ins></p>
<ol>
<li>
<p><ins class="diff-new">If there is no longer a</ins>
<code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">object for the entry in question, the user agent
must</ins> <a href="#navigate"><ins class=
"diff-new">navigate</ins></a> <ins class="diff-new">the browsing
context to the location for that entry to perform an</ins> <a href=
"#entry"><ins class="diff-new">entry update</ins></a> <ins class=
"diff-new">of that entry, and abort these steps. The "</ins>
<a href="#navigate"><ins class="diff-new">navigate</ins></a>
<ins class="diff-new">" algorithm reinvokes this "traverse"
algorithm to complete the traversal, at which point there</ins>
<em><ins class="diff-new">is</ins></em> <ins class=
"diff-new">a</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">object and
so this step gets skipped. The navigation must be done using the
same</ins> <a href="#source0"><ins class="diff-new">source browsing
context</ins></a> <ins class="diff-new">as was used the first time
this entry was created.</ins></p>
</li>
<li>
<p><ins class="diff-new">If appropriate, update the</ins> <a href=
"#current1"><ins class="diff-new">current entry</ins></a>
<ins class="diff-new">in the</ins> <a href="#browsing1"><ins class=
"diff-new">browsing context</ins></a> <ins class=
"diff-new">'s</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class=
"diff-new">object's</ins> <code><a href="#history2"><ins class=
"diff-new">History</ins></a></code> <ins class="diff-new">object to
reflect any state that the user agent wishes to persist.</ins></p>
<p class="example"><ins class="diff-new">For example, some user
agents might want to persist the scroll position, or the values of
form controls.</ins></p>
</li>
<li>
<p><ins class="diff-new">If the</ins> <i><ins class=
"diff-new">specified entry</ins></i> <ins class="diff-new">has a
different</ins> <code><ins class="diff-new">Document</ins></code>
<ins class="diff-new">object than the</ins> <a href=
"#current1"><ins class="diff-new">current entry</ins></a>
<ins class="diff-new">then the user agent must run the following
substeps:</ins></p>
<ol>
<li class="big-issue"><ins class="diff-new">freeze any timers,
intervals, XMLHttpRequests, database transactions, etc</ins></li>
<li><ins class="diff-new">The user agent must move any properties
that have been added to the browsing context's default view's</ins>
<code><a href="#window"><ins class=
"diff-new">Window</ins></a></code> <ins class="diff-new">object to
the</ins> <a href="#active"><ins class="diff-new">active
document</ins></a> <ins class="diff-new">'s</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">'s</ins>
<a href="#list-of2"><ins class="diff-new">list of added
properties</ins></a> .</li>
<li><ins class="diff-new">If the browsing context is a</ins>
<a href="#top-level"><ins class="diff-new">top-level browsing
context</ins></a> <ins class="diff-new">(and not an</ins> <a href=
"#auxiliary0"><ins class="diff-new">auxiliary browsing
context</ins></a> <ins class="diff-new">), and the</ins> <a href=
"#origin0"><ins class="diff-new">origin</ins></a> <ins class=
"diff-new">of the</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">of the</ins>
<i><ins class="diff-new">specified entry</ins></i> <ins class=
"diff-new">is not the</ins> <a href="#same-origin" title=
"same origin"><ins class="diff-new">same</ins></a> <ins class=
"diff-new">as the</ins> <a href="#origin0"><ins class=
"diff-new">origin</ins></a> <ins class="diff-new">of the</ins>
<code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">of the</ins> <a href="#current1"><ins class=
"diff-new">current entry</ins></a> ,<ins class="diff-new">then the
following sub-sub-steps must be run:</ins>
<ol>
<li><ins class="diff-new">The current</ins> <a href=
"#browsing2"><ins class="diff-new">browsing context name</ins></a>
<ins class="diff-new">must be stored with all the entries in the
history that are associated with</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">objects with
the</ins> <a href="#same-origin"><ins class="diff-new">same
origin</ins></a> <ins class="diff-new">as the</ins> <a href=
"#active"><ins class="diff-new">active document</ins></a>
<em><ins class="diff-new">and</ins></em> <ins class="diff-new">that
are contiguous with the</ins> <a href="#current1"><ins class=
"diff-new">current entry</ins></a> .</li>
<li id="resetBCName"><ins class="diff-new">The browsing
context's</ins> <a href="#browsing2"><ins class="diff-new">browsing
context name</ins></a> <ins class="diff-new">must be
unset.</ins></li>
</ol>
</li>
<li id="appcache-history-2"><ins class="diff-new">The user agent
must make the</ins> <i><ins class="diff-new">specified
entry</ins></i> <ins class="diff-new">'s</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">object
the</ins> <a href="#active"><ins class="diff-new">active
document</ins></a> <ins class="diff-new">of the</ins> <a href=
"#browsing1"><ins class="diff-new">browsing context</ins></a>
.<ins class="diff-new">(If it is a</ins> <a href=
"#top-level"><ins class="diff-new">top-level browsing
context</ins></a> ,<ins class="diff-new">this might</ins> <a href=
"#appcache-history-1"><ins class="diff-new">change</ins></a>
<ins class="diff-new">which</ins> <a href=
"#application0"><ins class="diff-new">application cache</ins></a>
<ins class="diff-new">it is associated with.)</ins></li>
<li><ins class="diff-new">If the</ins> <i><ins class=
"diff-new">specified entry</ins></i> <ins class="diff-new">has
a</ins> <a href="#browsing2"><ins class="diff-new">browsing context
name</ins></a> <ins class="diff-new">stored with it, then the
following sub-sub-steps must be run:</ins>
<ol>
<li><ins class="diff-new">The browsing context's</ins> <a href=
"#browsing2"><ins class="diff-new">browsing context name</ins></a>
<ins class="diff-new">must be set to the name stored with the
specified entry.</ins></li>
<li><ins class="diff-new">Any</ins> <a href=
"#browsing2"><ins class="diff-new">browsing context name</ins></a>
<ins class="diff-new">stored with the entries in the history that
are associated with</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">objects with
the</ins> <a href="#same-origin"><ins class="diff-new">same
origin</ins></a> <ins class="diff-new">as the new</ins> <a href=
"#active"><ins class="diff-new">active document</ins></a>
,<ins class="diff-new">and that are contiguous with the specified
entry, must be cleared.</ins></li>
</ol>
</li>
<li><ins class="diff-new">The user agent must move any properties
that have been added to the</ins> <a href="#active"><ins class=
"diff-new">active document</ins></a> <ins class="diff-new">'s</ins>
<code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">'s</ins> <a href="#list-of2"><ins class="diff-new">list
of added properties</ins></a> <ins class="diff-new">to browsing
context's default view's</ins> <code><a href="#window"><ins class=
"diff-new">Window</ins></a></code> <ins class=
"diff-new">object.</ins></li>
<li class="big-issue"><ins class="diff-new">unfreeze any timers,
intervals, XMLHttpRequests, database transactions, etc</ins></li>
</ol>
</li>
<li>
<p><ins class="diff-new">If there are any entries with state
objects between the</ins> <a href="#last-activated"><ins class=
"diff-new">last activated entry</ins></a> <ins class="diff-new">for
the</ins> <code><ins class="diff-new">Document</ins></code>
<ins class="diff-new">of the</ins> <i><ins class=
"diff-new">specified entry</ins></i> <ins class="diff-new">and
the</ins> <i><ins class="diff-new">specified entry</ins></i>
<ins class="diff-new">itself (not inclusive), then the user agent
must iterate through every entry between that</ins> <a href=
"#last-activated"><ins class="diff-new">last activated
entry</ins></a> <ins class="diff-new">and the</ins> <i><ins class=
"diff-new">specified entry</ins></i> ,<ins class=
"diff-new">starting with the entry closest to the</ins> <a href=
"#current1"><ins class="diff-new">current entry</ins></a>
,<ins class="diff-new">and ending with the one closest to the</ins>
<i><ins class="diff-new">specified entry</ins></i> .<ins class=
"diff-new">For each entry, if the entry is a state object, the user
agent must</ins> <a href="#activating0"><ins class=
"diff-new">activate the state object</ins></a> .</p>
</li>
<li>
<p><ins class="diff-new">If the</ins> <i><ins class=
"diff-new">specified entry</ins></i> <ins class="diff-new">is a
state object or the first entry for a</ins> <code><ins class=
"diff-new">Document</ins></code> ,<ins class="diff-new">the user
agent must</ins> <a href="#activating0" title=
"activate the state object"><ins class="diff-new">activate that
entry</ins></a> .</p>
</li>
<li>
<p><ins class="diff-new">If the</ins> <i><ins class=
"diff-new">specified entry</ins></i> <ins class="diff-new">has a
URI that differs from the</ins> <a href="#current1"><ins class=
"diff-new">current entry</ins></a> <ins class="diff-new">'s only by
its fragment identifier, and the two share the same</ins>
<code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">object, then</ins> <a href="#firing2"><ins class=
"diff-new">fire a simple event</ins></a> <ins class="diff-new">with
the name</ins> <code><ins class="diff-new">hashchanged</ins></code>
<ins class="diff-new">at</ins> <a href="#the-body1"><ins class=
"diff-new">the</ins> <code><ins class="diff-new">body</ins></code>
<ins class="diff-new">element</ins></a> ,<ins class="diff-new">and,
if the new URI has a fragment identifier,</ins> <a href=
"#scroll"><ins class="diff-new">scroll to the fragment
identifier</ins></a> .</p>
</li>
<li>
<p><ins class="diff-new">User agents may also update other aspects
of the document view when the location changes in this way, for
instance the scroll position, values of form fields, etc.</ins></p>
</li>
<li>
<p><ins class="diff-new">The</ins> <a href="#current1"><ins class=
"diff-new">current entry</ins></a> <ins class="diff-new">is now
the</ins> <i><ins class="diff-new">specified entry</ins></i> .</p>
</li>
</ol>
<p class="big-issue"><ins class="diff-new">how does the changing of
the global attributes affect .watch() when seen from other
Windows?</ins></p>
<h3 id="content-type-sniffing"><span class="secno"><del class=
"diff-old">4.9.</del> <ins class="diff-chg">4.10</ins></span>
Determining the type of a new resource in a browsing context</h3>
<p class="warning">It is imperative that the rules in this section
be followed exactly. When <del class="diff-old">two</del>
<ins class="diff-chg">a</ins> user <del class="diff-old">agents
use</del> <ins class="diff-chg">agent uses</ins> different
heuristics for content type <del class="diff-old">detection,</del>
<ins class="diff-chg">detection than the server expects,</ins>
security problems can occur. For example, if a server believes
<ins class="diff-new">that the client will treat</ins> a
contributed file <del class="diff-old">to be</del> <ins class=
"diff-chg">as</ins> an image (and thus <ins class="diff-new">treat
it as</ins> benign), but a Web browser believes the content to be
HTML (and thus <del class="diff-old">capable of executing
script),</del> <ins class="diff-chg">execute any scripts contained
therein),</ins> the end user can be exposed to malicious content,
making the user vulnerable to cookie theft attacks and other
cross-site scripting attacks.</p>
<p>The <dfn id="sniffed" title="Content-Type sniffing">sniffed type
of a resource</dfn> must be found as follows:</p>
<ol>
<li>
<p><ins class="diff-new">Let</ins> <var title=""><ins class=
"diff-new">official type</ins></var> <ins class="diff-new">be the
type given by the</ins> <a href="#content-type8" title=
"Content-Type"><ins class="diff-new">Content-Type
metadata</ins></a> <ins class="diff-new">for the resource (in
lowercase, ignoring any parameters). If there is no such type, jump
to the</ins> <em title=
"content-type sniffing: unknown type"><a href=
"#content-type5"><ins class="diff-new">unknown type</ins></a></em>
<ins class="diff-new">step below.</ins></p>
</li>
<li>
<p><ins class="diff-new">If the user agent is configured to
strictly obey Content-Type headers for this resource, then jump to
the last step in this set of steps.</ins></p>
</li>
<li>
<p>If the resource was fetched over an HTTP <del class=
"diff-old">protocol,</del> <ins class="diff-chg">protocol</ins> and
there is <del class="diff-old">no HTTP Content-Encoding header, but
there is</del> an HTTP Content-Type header and <del class=
"diff-old">it has a</del> <ins class="diff-chg">the</ins> value
<del class="diff-old">whose</del> <ins class="diff-chg">of the
first such header has</ins> bytes <ins class="diff-new">that</ins>
exactly match one of the following <del class=
"diff-old">three</del> lines:</p>
<table>
<thead>
<tr>
<th>Bytes in Hexadecimal</th>
<th>Textual representation</th>
</tr>
</thead>
<tbody>
<tr>
<td>74 65 78 74 2f 70 6c 61 69 6e</td>
<td><code title="">text/plain</code></td>
</tr>
<tr>
<td>74 65 78 74 2f 70 6c 61 69 6e 3b 20 63 68 61 72 73 65 74 3d 49
53 4f 2d 38 38 35 39 2d 31</td>
<td><code title="">text/plain; charset=ISO-8859-1</code></td>
</tr>
<tr>
<td>74 65 78 74 2f 70 6c 61 69 6e 3b 20 63 68 61 72 73 65 74 3d 69
73 6f 2d 38 38 35 39 2d 31</td>
<td><code title="">text/plain; charset=iso-8859-1</code></td>
</tr>
<tr>
<td><ins class="diff-new">74 65 78 74 2f 70 6c 61 69 6e 3b 20 63 68
61 72 73 65 74 3d 55 54 46 2d 38</ins></td>
<td><code title=""><ins class=
"diff-new">text/plain; charset=UTF-8</ins></code></td>
</tr>
</tbody>
</table>
<p>...then jump to the <em title=
"content-type sniffing: text or binary"><a href=
"#content-type4">text or binary</a></em> section below.</p>
</li>
<li>
<p><del class="diff-old">Let official type be the type given by the
Content-Type metadata for the resource (in lowercase, ignoring any
parameters). If there is no such type, jump to the unknown type
step below.</del> If <var title="">official type</var> is
"unknown/unknown" or "application/unknown", jump to the <em title=
"content-type sniffing: unknown type"><a href=
"#content-type5">unknown type</a></em> step below.</p>
</li>
<li>
<p>If <var title="">official type</var> ends in "+xml", or if it is
either "text/xml" or "application/xml", then the <del class=
"diff-old">the</del> sniffed type of the resource is <var title=
"">official type</var> ; return that and abort these steps.</p>
</li>
<li>
<p>If <var title="">official type</var> is an image type supported
by the user agent (e.g. "image/png", "image/gif", "image/jpeg",
etc), then jump to the <em title=
"content-type sniffing: image"><a href=
"#content-type6">images</a></em> section below.</p>
</li>
<li>
<p>If <var title="">official type</var> is "text/html", then jump
to the <em title="content-type sniffing: feed or html"><a href=
"#content-type7">feed or HTML</a></em> section below.</p>
</li>
<li>
<p><del class="diff-old">Otherwise, the</del> <ins class=
"diff-chg">The</ins> sniffed type of the resource is <var title=
"">official type</var> .</p>
</li>
</ol>
<h4 id="content-type0"><span class="secno"><del class=
"diff-old">4.9.1.</del> <ins class="diff-chg">4.10.1</ins></span>
<dfn id="content-type4">Content-Type sniffing: text or
binary</dfn></h4>
<ol>
<li>
<p>The user agent may wait for 512 or more bytes of the resource to
be available.</p>
</li>
<li>
<p>Let <var title="">n</var> be the smaller of either 512 or the
number of bytes already available.</p>
</li>
<li>
<p>If <var title="">n</var> is 4 or more, and the first bytes of
the file match one of the following byte sets:</p>
<table>
<thead>
<tr>
<th>Bytes in Hexadecimal</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>FE FF</td>
<td>UTF-16BE BOM <del class="diff-old">or UTF-32LE BOM</del></td>
</tr>
<tr>
<td>FF FE</td>
<td>UTF-16LE BOM</td>
</tr>
<tr>
<td><del class="diff-old">00 00 FE FF UTF-32BE BOM</del> EF BB
BF</td>
<td>UTF-8 BOM</td>
</tr>
</tbody>
</table>
<p>...then the sniffed type of the resource is "text/plain".
<del class="diff-old">Should we remove UTF-32 from the
above?</del></p>
</li>
<li>
<p>Otherwise, if any of the first <var title="">n</var> bytes of
the resource are in one of the following byte ranges:</p>
<ul class="brief">
<li>0x00 - 0x08</li>
<li>0x0E - 0x1A</li>
<li>0x1C - 0x1F</li>
</ul>
<p>...then the sniffed type of the resource is
"application/octet-stream".</p>
<p class="big-issue">maybe we should invoke the "Content-Type
sniffing: image" section now, falling back on
"application/octet-stream".</p>
</li>
<li>
<p>Otherwise, the sniffed type of the resource is "text/plain".</p>
</li>
</ol>
<h4 id="content-type1"><span class="secno"><del class=
"diff-old">4.9.2.</del> <ins class="diff-chg">4.10.2</ins></span>
<dfn id="content-type5">Content-Type sniffing: unknown
type</dfn></h4>
<ol>
<li>
<p>The user agent may wait for 512 or more bytes of the resource to
be available.</p>
</li>
<li>
<p>Let <var title="">stream length</var> be the smaller of either
512 or the number of bytes already available.</p>
</li>
<li>
<p>For each row in the table below:</p>
<dl class="switch">
<dt>If the row has no " <em>WS</em> " bytes:</dt>
<dd>
<ol>
<li>Let <var title="">pattern length</var> be the length of the
pattern (number of bytes described by the cell in the second column
of the row).</li>
<li>If <var title="">pattern length</var> is smaller than
<var title="">stream length</var> then skip this row.</li>
<li>Apply the "and" operator to the first <var title="">pattern
length</var> bytes of the resource and the given mask (the bytes in
the cell of first column of that row), and let the result be the
<var title="">data</var> .</li>
<li>If the bytes of the <var title="">data</var> matches the given
pattern bytes exactly, then the sniffed type of the resource is the
type given in the cell of the third column in that row; abort these
steps.</li>
</ol>
</dd>
<dt>If the row has a " <em>WS</em> " byte:</dt>
<dd>
<ol>
<li>
<p>Let <var title="">index <sub>pattern</sub></var> be an index
into the mask and pattern byte strings of the row.</p>
</li>
<li>
<p>Let <var title="">index <sub>stream</sub></var> be an index into
the byte stream being examined.</p>
</li>
<li>
<p><em>Loop</em> : If <var title="">index <sub>stream</sub></var>
points beyond the end of the byte stream, then this row doesn't
match, skip this row.</p>
</li>
<li>
<p>Examine the <var title="">index <sub>stream</sub></var> th byte
of the byte stream as follows:</p>
<dl class="switch">
<dt>If the <var title="">index <sub>stream</sub></var> th byte of
the pattern is a normal hexadecimal byte and not a " <em>WS</em> "
byte:</dt>
<dd>
<p>If the "and" operator, applied to the <var title="">index
<sub>stream</sub></var> th byte of the stream and the <var title=
"">index <sub>pattern</sub></var> th byte of the mask, yield a
value different that the <var title="">index
<sub>pattern</sub></var> th byte of the pattern, then skip this
row.</p>
<p>Otherwise, increment <var title="">index
<sub>pattern</sub></var> to the next byte in the mask and pattern
and <var title="">index <sub>stream</sub></var> to the next byte in
the byte stream.</p>
</dd>
<dt><del class="diff-old">Otherwies,</del> <ins class=
"diff-chg">Otherwise,</ins> if the <var title="">index
<sub>stream</sub></var> th byte of the pattern is a " <em>WS</em> "
byte:</dt>
<dd>
<p>" <em>WS</em> " means "whitespace", and allows insignificant
whitespace to be skipped when sniffing for a type signature.</p>
<p>If the <var title="">index <sub>stream</sub></var> th byte of
the stream is one of 0x09 (ASCII TAB), 0x0A (ASCII LF), 0x0B (ASCII
VT), 0x0C (ASCII FF), 0x0D (ASCII CR), or 0x20 (ASCII space), then
increment only the <var title="">index <sub>stream</sub></var> to
the next byte in the byte stream.</p>
<p>Otherwise, increment only the <var title="">index
<sub>pattern</sub></var> to the next byte in the mask and
pattern.</p>
</dd>
</dl>
</li>
<li>
<p>If <var title="">index <sub>pattern</sub></var> does not point
beyond the end of the mask and pattern byte strings, then jump back
to the <em>loop</em> step in this algorithm.</p>
</li>
<li>
<p>Otherwise, the sniffed type of the resource is the type given in
the cell of the third column in that row; abort these steps.</p>
</li>
</ol>
</dd>
</dl>
</li>
<li>
<p>As a last-ditch effort, jump to the <a href="#content-type4"
title="content-type sniffing: text or binary">text or binary</a>
section.</p>
</li>
</ol>
<table>
<thead>
<tr>
<th colspan="2">Bytes in Hexadecimal</th>
<th rowspan="2">Sniffed type</th>
<th rowspan="2">Comment</th>
</tr>
<tr>
<th>Mask</th>
<th>Pattern</th>
</tr>
</thead>
<tbody>
<tr>
<td>FF FF DF DF DF DF DF DF DF FF DF DF DF DF</td>
<td>3C 21 44 4F 43 54 59 50 45 20 48 54 4D 4C</td>
<td>text/html</td>
<td>The string " <code title=""><!DOCTYPE HTML</code> " in
US-ASCII or compatible encodings, case-insensitively.</td>
</tr>
<tr>
<td>FF FF DF DF DF DF</td>
<td><em>WS</em> 3C 48 54 4D 4C</td>
<td>text/html</td>
<td>The string " <code title=""><HTML</code> " in US-ASCII or
compatible encodings, case-insensitively, possibly with leading
spaces.</td>
</tr>
<tr>
<td>FF FF DF DF DF DF</td>
<td><em>WS</em> 3C 48 45 41 44</td>
<td>text/html</td>
<td>The string " <code title=""><HEAD</code> " in US-ASCII or
compatible encodings, case-insensitively, possibly with leading
spaces.</td>
</tr>
<tr>
<td>FF FF DF DF DF DF DF DF</td>
<td><em>WS</em> 3C 53 43 52 49 50 54</td>
<td>text/html</td>
<td>The string " <code title=""><SCRIPT</code> " in US-ASCII or
compatible encodings, case-insensitively, possibly with leading
spaces.</td>
</tr>
<tr>
<td>FF FF FF FF FF</td>
<td>25 50 44 46 2D</td>
<td>application/pdf</td>
<td>The string " <code title="">%PDF-</code> ", the PDF
signature.</td>
</tr>
<tr>
<td>FF FF FF FF FF FF FF FF FF FF FF</td>
<td>25 21 50 53 2D 41 64 6F 62 65 2D</td>
<td>application/postscript</td>
<td>The string " <code title="">%!PS-Adobe-</code> ", the
PostScript signature.</td>
</tr>
</tbody>
<tbody>
<tr>
<td>FF FF FF FF FF FF</td>
<td>47 49 46 38 37 61</td>
<td>image/gif</td>
<td>The string " <code title="">GIF87a</code> ", a GIF
signature.</td>
</tr>
<tr>
<td>FF FF FF FF FF FF</td>
<td>47 49 46 38 39 61</td>
<td>image/gif</td>
<td>The string " <code title="">GIF89a</code> ", a GIF
signature.</td>
</tr>
<tr>
<td>FF FF FF FF FF FF FF FF</td>
<td>89 50 4E 47 0D 0A 1A 0A</td>
<td>image/png</td>
<td>The PNG signature.</td>
</tr>
<tr>
<td>FF FF FF</td>
<td>FF D8 FF</td>
<td>image/jpeg</td>
<td>A JPEG SOI marker followed by the first byte of another
marker.</td>
</tr>
<tr>
<td>FF FF</td>
<td>42 4D</td>
<td>image/bmp</td>
<td>The string " <code title="">BM</code> ", a BMP signature.</td>
</tr>
<tr>
<td><ins class="diff-new">FF FF FF FF</ins></td>
<td><ins class="diff-new">00 00 01 00</ins></td>
<td><ins class="diff-new">image/vnd.microsoft.icon</ins></td>
<td><ins class="diff-new">A 0 word following by a 1 word, a Windows
Icon file format signature.</ins></td>
</tr>
</tbody>
</table>
<p>User agents may support further types if desired, by implicitly
adding to the above table. However, user agents should not use any
other patterns for types already mentioned in the table above, as
this could then be used for privilege escalation (where, e.g., a
server uses the above table to determine that content is not HTML
and thus safe from XSS attacks, but then a user agent detects it as
HTML anyway and allows script to execute).</p>
<h4 id="content-type2"><span class="secno"><del class=
"diff-old">4.9.3.</del> <ins class="diff-chg">4.10.3</ins></span>
<dfn id="content-type6">Content-Type sniffing: image</dfn></h4>
<p>If the first bytes of the file match one of the byte sequences
in the first columns of the following table, then the sniffed type
of the resource is the type given in the corresponding cell in the
second column on the same row:</p>
<table>
<thead>
<tr>
<th>Bytes in Hexadecimal</th>
<th>Sniffed type</th>
<th>Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>47 49 46 38 37 61</td>
<td>image/gif</td>
<td>The string " <code title="">GIF87a</code> ", a GIF
signature.</td>
</tr>
<tr>
<td>47 49 46 38 39 61</td>
<td>image/gif</td>
<td>The string " <code title="">GIF89a</code> ", a GIF
signature.</td>
</tr>
<tr>
<td>89 50 4E 47 0D 0A 1A 0A</td>
<td>image/png</td>
<td>The PNG signature.</td>
</tr>
<tr>
<td>FF D8 FF</td>
<td>image/jpeg</td>
<td>A JPEG SOI marker followed by the first byte of another
marker.</td>
</tr>
<tr>
<td>42 4D</td>
<td>image/bmp</td>
<td>The string " <code title="">BM</code> ", a BMP signature.</td>
</tr>
<tr>
<td><ins class="diff-new">00 00 01 00</ins></td>
<td><ins class="diff-new">image/vnd.microsoft.icon</ins></td>
<td><ins class="diff-new">A 0 word following by a 1 word, a Windows
Icon file format signature.</ins></td>
</tr>
</tbody>
</table>
<p>User agents must ignore any rows for image types that they do
not support.</p>
<p>Otherwise, the <i>sniffed type</i> of the resource is the same
as its <var title="">official type</var> .</p>
<h4 id="content-type3"><span class="secno"><del class=
"diff-old">4.9.4.</del> <ins class="diff-chg">4.10.4</ins></span>
<dfn id="content-type7">Content-Type sniffing: feed or
HTML</dfn></h4>
<ol>
<li>
<p>The user agent may wait for 512 or more bytes of the resource to
be available.</p>
</li>
<li>
<p>Let <var title="">s</var> be the stream of bytes, and let
<span><var title="">s</var> [ <var title="">i</var> ]</span>
represent the byte in <var title="">s</var> with position
<var title="">i</var> , treating <var title="">s</var> as
zero-indexed (so the first byte is at <span><var title="">i</var>
=0</span> ).</p>
</li>
<li>
<p>If at any point this algorithm requires the user agent to
determine the value of a byte in <var title="">s</var> which is not
yet available, or which is past the first 512 bytes of the
resource, or which is beyond the end of the resource, the user
agent must stop this algorithm, and assume that the sniffed type of
the resource is "text/html".</p>
<p class="note">User agents are allowed, by the first step of this
algorithm, to wait until the first 512 bytes of the resource are
available.</p>
</li>
<li>
<p>Initialise <var title="">pos</var> to 0.</p>
</li>
<li>
<p><ins class="diff-new">If</ins> <span><var title=""><ins class=
"diff-new">s</ins></var> <ins class="diff-new">[0]</ins></span>
<ins class="diff-new">is 0xEF,</ins> <span><var title=
""><ins class="diff-new">s</ins></var> <ins class=
"diff-new">[1]</ins></span> <ins class="diff-new">is 0xBB,
and</ins> <span><var title=""><ins class="diff-new">s</ins></var>
<ins class="diff-new">[2]</ins></span> <ins class="diff-new">is
0xBF, then set</ins> <var title=""><ins class=
"diff-new">pos</ins></var> <ins class="diff-new">to 3. (This skips
over a leading UTF-8 BOM, if any.)</ins></p>
</li>
<li>
<p><i><ins class="diff-new">Loop start:</ins></i> Examine
<span><var title="">s</var> [ <var title="">pos</var> ]</span>
.</p>
<dl class="switch">
<dt>If it is 0x09 (ASCII tab), 0x20 (ASCII space), 0x0A (ASCII LF),
or 0x0D (ASCII CR)</dt>
<dd>Increase <var title="">pos</var> by 1 and repeat this
step.</dd>
<dt>If it is 0x3C (ASCII " <code title=""><</code> ")</dt>
<dd>Increase <var title="">pos</var> by 1 and go to the next
step.</dd>
<dt>If it is anything else</dt>
<dd>The sniffed type of the resource is "text/html". Abort these
steps.</dd>
</dl>
</li>
<li>
<p>If the bytes with positions <var title="">pos</var> to
<span><var title="">pos</var> +2</span> in <var title="">s</var>
are exactly equal to 0x21, 0x2D, 0x2D respectively (ASCII for "
<code title="">!--</code> "), then:</p>
<ol>
<li>Increase <var title="">pos</var> by 3.</li>
<li>If the bytes with positions <span><var title=
"">pos</var></span> to <span><var title="">pos</var> +2</span> in
<var title="">s</var> are exactly equal to 0x2D, 0x2D, 0x3E
respectively (ASCII for " <code title="">--></code> "), then
increase <var title="">pos</var> by 3 and jump back to the previous
step <del class="diff-old">(step 5)</del> <ins class=
"diff-chg">(the step labeled</ins> <i><ins class="diff-chg">loop
start</ins></i> <ins class="diff-chg">)</ins> in the overall
algorithm in this section.</li>
<li>Otherwise, increase <var title="">pos</var> by 1.</li>
<li><del class="diff-old">Otherwise, return</del> <ins class=
"diff-chg">Return</ins> to step 2 in these substeps.</li>
</ol>
</li>
<li>
<p>If <span><var title="">s</var> [ <var title="">pos</var>
]</span> is 0x21 (ASCII " <code title="">!</code> "):</p>
<ol>
<li>Increase <var title="">pos</var> by 1.</li>
<li>If <span><var title="">s</var> [ <var title="">pos</var>
]</span> equal 0x3E, then increase <var title="">pos</var> by 1 and
jump back to <ins class="diff-new">the</ins> step <del class=
"diff-old">5</del> <ins class="diff-chg">labeled</ins>
<i><ins class="diff-chg">loop start</ins></i> in the overall
algorithm in this section.</li>
<li>Otherwise, return to step 1 in these substeps.</li>
</ol>
</li>
<li>
<p>If <span><var title="">s</var> [ <var title="">pos</var>
]</span> is 0x3F (ASCII " <code title="">?</code> "):</p>
<ol>
<li>Increase <var title="">pos</var> by 1.</li>
<li>If <span><var title="">s</var> [ <var title="">pos</var>
]</span> and <span><var title="">s</var> [ <var title="">pos</var>
+1]</span> equal 0x3F and 0x3E respectively, then increase
<var title="">pos</var> by 1 and jump back to <ins class=
"diff-new">the</ins> step <del class="diff-old">5</del> <ins class=
"diff-chg">labeled</ins> <i><ins class="diff-chg">loop
start</ins></i> in the overall algorithm in this section.</li>
<li>Otherwise, return to step 1 in these substeps.</li>
</ol>
</li>
<li>
<p>Otherwise, if the bytes in <var title="">s</var> starting at
<var title="">pos</var> match any of the sequences of bytes in the
first column of the following table, then the user agent must
follow the steps given in the corresponding cell in the second
column of the same row.</p>
<table>
<thead>
<tr>
<th>Bytes in Hexadecimal</th>
<th>Requirement</th>
<th>Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>72 73 73</td>
<td>The sniffed type of the resource is "application/rss+xml";
abort these steps</td>
<td>The three ASCII characters " <code title="">rss</code> "</td>
</tr>
<tr>
<td>66 65 65 64</td>
<td>The sniffed type of the resource is "application/atom+xml";
abort these steps</td>
<td>The four ASCII characters " <code title="">feed</code> "</td>
</tr>
<tr>
<td>72 64 66 3A 52 44 46</td>
<td>Continue to the next step in this algorithm</td>
<td>The ASCII characters " <code title="">rdf:RDF</code> "</td>
</tr>
</tbody>
</table>
<p>If none of the byte sequences above match the bytes in
<var title="">s</var> starting at <var title="">pos</var> , then
the sniffed type of the resource is "text/html". Abort these
steps.</p>
</li>
<li>
<p class="big-issue">If, before the next "> ", you find two
xmlns* attributes with http://www.w3.org/1999/02/22-rdf-syntax-ns#
and http://purl.org/rss/1.0/ as the namespaces, then the sniffed
type of the resource is "application/rss+xml", abort these steps.
(maybe we only need to check for http://purl.org/rss/1.0/
actually)</p>
</li>
<li>
<p>Otherwise, the sniffed type of the resource is "text/html".</p>
</li>
</ol>
<p class="note">For efficiency <del class="diff-old">reaons,</del>
<ins class="diff-chg">reasons,</ins> implementations may wish to
implement this algorithm and the algorithm for detecting the
character encoding of HTML documents in parallel.</p>
<h4 id="content-type"><span class="secno"><del class=
"diff-old">4.9.5.</del> <ins class="diff-chg">4.10.5</ins></span>
Content-Type metadata</h4>
<p>What explicit <dfn id="content-type8" title=
"Content-Type">Content-Type metadata</dfn> is associated with the
resource (the resource's type information) depends on the protocol
that was used to fetch the resource.</p>
<p>For HTTP resources, only the <ins class="diff-new">first</ins>
Content-Type HTTP <del class="diff-old">header</del> <ins class=
"diff-chg">header, if any,</ins> contributes any <del class=
"diff-old">data;</del> <ins class="diff-chg">type
information;</ins> the explicit type of the resource is then the
value of that header, interpreted as described by the HTTP
specifications. If the Content-Type HTTP header is present but
<del class="diff-old">it</del> <ins class="diff-chg">the value of
the first such header</ins> cannot be interpreted as described by
the HTTP specifications (e.g. because its value doesn't contain a
U+002F SOLIDUS ('/') character), then the resource has no type
<del class="diff-old">information.</del> <ins class=
"diff-chg">information (even if there are multiple Content-Type
HTTP headers and one of the other ones is syntactically
correct).</ins> <a href="#references">[HTTP]</a></p>
<p>For resources fetched from the <del class=
"diff-old">filesystem,</del> <ins class="diff-chg">file
system,</ins> user agents should use platform-specific conventions,
e.g. operating system extension/type mappings.</p>
<p>Extensions must not be used for determining resource types for
resources fetched over HTTP.</p>
<p>For resources fetched over most other protocols, e.g. FTP, there
is no type information.</p>
<p>The <dfn id="algorithm4">algorithm for extracting an encoding
from a Content-Type</dfn> , given a string <var title="">s</var> ,
is as follows. It either returns <del class="diff-old">a</del>
<ins class="diff-chg">an</ins> encoding or nothing.</p>
<ol>
<li>
<p><del class="diff-old">Skip</del> <ins class="diff-chg">Find the
first seven</ins> characters in <var title="">s</var> <del class=
"diff-old">up to and including the first U+003B SEMICOLON ( ; )
character. Skip any U+0009, U+000A, U+000B, U+000C, U+000D, or
U+0020 characters (i.e. spaces)</del> that <del class=
"diff-old">immediately follow</del> <ins class="diff-chg">are a
case-insensitive match for</ins> the <del class=
"diff-old">semicolon.</del> <ins class="diff-chg">word
'charset'.</ins> If <del class="diff-old">the next six characters
are not 'charset',</del> <ins class="diff-chg">no such match is
found,</ins> return nothing.</p>
</li>
<li>
<p>Skip any U+0009, U+000A, U+000B, U+000C, U+000D, or U+0020
characters that immediately follow the word 'charset' (there might
not be any).</p>
</li>
<li>
<p>If the next character is not a U+003D EQUALS SIGN ('='), return
nothing.</p>
</li>
<li>
<p>Skip any U+0009, U+000A, U+000B, U+000C, U+000D, or U+0020
characters that immediately follow the <del class=
"diff-old">word</del> equals sign (there might not be any).</p>
</li>
<li>
<p>Process the next character as follows:</p>
<dl class="switch">
<dt>If it is a U+0022 QUOTATION MARK ('"') and there is a later
U+0022 QUOTATION MARK ('"') in <var title="">s</var> <del class=
"diff-old">Return string between the two quotation
marks.</del></dt>
<dt>If it is a U+0027 APOSTROPHE ("'") and there is a later U+0027
APOSTROPHE ("'") in <var title="">s</var></dt>
<dd>
<p>Return the string between <ins class="diff-new">this character
and</ins> the <del class="diff-old">two apostrophes.</del>
<ins class="diff-chg">next earliest occurrence of this
character.</ins></p>
</dd>
<dt>If it is an unmatched U+0022 QUOTATION MARK ('"')</dt>
<dt>If it is an unmatched U+0027 APOSTROPHE ("'")</dt>
<dt><ins class="diff-new">If there is no next character</ins></dt>
<dd>
<p>Return nothing.</p>
</dd>
<dt>Otherwise</dt>
<dd>
<p>Return the string from this character to the first U+0009,
U+000A, U+000B, U+000C, U+000D, <ins class="diff-new">U+0020,</ins>
or <del class="diff-old">U+0020</del> <ins class=
"diff-chg">U+003B</ins> character or the end of <var title=
"">s</var> , whichever comes first.</p>
</dd>
</dl>
</li>
</ol>
<p class="note"><ins class="diff-chg">The above algorithm is a
willful violation of the HTTP specification.</ins> <a href=
"#references"><ins class="diff-chg">[RFC2616]</ins></a></p>
<h3 id="structured"><span class="secno"><del class=
"diff-old">4.10.</del> <ins class="diff-chg">4.11</ins></span>
<del class="diff-old">Client-side session and persistent</del>
<ins class="diff-chg">Structured client-side</ins> storage
<del class="diff-old">of</del></h3>
<h4 id="storage"><span class="secno"><ins class=
"diff-chg">4.11.1</ins></span> <ins class="diff-chg">Storing</ins>
name/value pairs</h4>
<h5 id="introduction2"><span class="secno"><del class=
"diff-old">4.10.1.</del> <ins class=
"diff-chg">4.11.1.1.</ins></span> Introduction</h5>
<p><em>This section is non-normative.</em></p>
<p>This specification introduces two related mechanisms, similar to
HTTP session cookies <a href="#references">[RFC2965]</a> , for
storing structured data on the client side.</p>
<p>The first is designed for scenarios where the user is carrying
out a single transaction, but could be carrying out multiple
transactions in different windows at the same time.</p>
<p>Cookies don't really handle this case well. For example, a user
could be buying plane tickets in two different windows, using the
same site. If the site used cookies to keep track of which ticket
the user was buying, then as the user clicked from page to page in
both windows, the ticket currently being purchased would "leak"
from one window to the other, potentially causing the user to buy
two tickets for the same flight without really noticing.</p>
<p>To address this, this specification introduces the <code title=
"dom-sessionStorage"><a href=
"#sessionstorage">sessionStorage</a></code> DOM attribute. Sites
can add data to the session storage, and it will be accessible to
any page from <del class="diff-old">that origin</del> <ins class=
"diff-chg">the same site</ins> opened in that window.</p>
<div class="example">
<p>For example, a page could have a checkbox that the user ticks to
indicate that he wants insurance:</p>
<pre>
<label>
<input type="checkbox" onchange="sessionStorage.insurance = checked">
I want insurance on this trip.
</label>
</pre>
<p>A later page could then check, from script, whether the user had
checked the checkbox or not:</p>
<pre>
if
(sessionStorage.insurance)
{
...
}
</pre>
<p>If the user had multiple windows opened on the site, each one
would have its own individual copy of the session storage
object.</p>
</div>
<p>The second storage mechanism is designed for storage that spans
multiple windows, and lasts beyond the current session. In
particular, Web applications may wish to store megabytes of user
data, such as entire user-authored documents or a user's mailbox,
on the <del class="diff-old">clientside</del> <ins class=
"diff-chg">client side</ins> for performance reasons.</p>
<p>Again, cookies do not handle this case well, because they are
transmitted with every request.</p>
<p>The <code title="dom-localStorage"><del class=
"diff-old">globalStorage</del> <a href="#localstorage"><ins class=
"diff-chg">localStorage</ins></a></code> DOM attribute is used to
access a page's <del class="diff-old">global</del> <ins class=
"diff-chg">local</ins> storage area.</p>
<div class="example">
<p>The site at example.com can display a count of how many times
the user has loaded its page by putting the following at the bottom
of its page:</p>
<pre>
<p>
You have viewed this page
<span id="count">an untold number of</span>
time(s).
</p>
<script>
<del class="diff-old"> if (!globalStorage.pageLoadCount)
globalStorage.pageLoadCount = 0;
globalStorage.pageLoadCount = parseInt(globalStorage.pageLoadCount, 10) + 1;
document.getElementById('count').textContent = globalStorage.pageLoadCount;
</del>
<ins class="diff-chg"> if (!localStorage.pageLoadCount)
localStorage.pageLoadCount = 0;
localStorage.pageLoadCount = parseInt(localStorage.pageLoadCount, 10) + 1;
document.getElementById('count').textContent = localStorage.pageLoadCount;
</ins>
</script>
</pre></div>
<p>Each <del class="diff-old">origin</del> <ins class=
"diff-chg">site</ins> has its own separate storage area.</p>
<p>Storage areas (both session storage and <del class=
"diff-old">global</del> <ins class="diff-chg">local</ins> storage)
store strings. To store structured data in a storage area, you must
first convert it to a string.</p>
<h5 id="the-storage"><span class="secno"><del class=
"diff-old">4.10.2.</del> <ins class=
"diff-chg">4.11.1.2.</ins></span> The <code><a href=
"#storage0">Storage</a></code> interface <del class=
"diff-old">interface { readonly attribute unsigned long ; DOMString
(in unsigned long index); DOMString (in DOMString key); void (in
DOMString key, in DOMString data); void (in DOMString
key);</del></h5>
<pre class="idl">
interface <dfn id="storage0">Storage</dfn> {
<ins class="diff-chg"> readonly attribute unsigned long <a href=
"#length9" title="dom-Storage-length">length</a>;
[IndexGetter] DOMString <a href="#keyn" title=
"dom-Storage-key">key</a>(in unsigned long index);
[NameGetter] DOMString <a href="#getitem" title=
"dom-Storage-getItem">getItem</a>(in DOMString key);
[NameSetter] void <a href="#setitem" title=
"dom-Storage-setItem">setItem</a>(in DOMString key, in DOMString data);
[XXX] void <a href="#removeitem" title=
"dom-Storage-removeItem">removeItem</a>(in DOMString key);
void <a href="#clear0" title="dom-Storage-clear">clear</a>();
</ins>
};
</pre>
<p>Each <code><a href="#storage0">Storage</a></code> object
provides access to a list of key/value pairs, which are sometimes
called items. Keys and values are strings. Any string (including
the empty string) is a valid key.</p>
<p class="note">To store more structured data, authors may consider
using the <a href="#sql">SQL interfaces</a> instead.</p>
<p>Each <code><a href="#storage0">Storage</a></code> object is
associated with a list of key/value pairs when it is created, as
defined in the sections on the <code title=
"dom-sessionStorage"><a href=
"#sessionstorage">sessionStorage</a></code> and <code title=
"dom-localStorage"><del class="diff-old">globalStorage</del>
<a href="#localstorage"><ins class=
"diff-chg">localStorage</ins></a></code> attributes. Multiple
separate objects implementing the <code><a href=
"#storage0">Storage</a></code> interface can all be associated with
the same list of key/value pairs simultaneously.</p>
<p>The <dfn id="length9" title=
"dom-Storage-length"><code>length</code></dfn> attribute must
return the number of key/value pairs currently present in the list
associated with the object.</p>
<p>The <dfn id="keyn" title="dom-Storage-key"><code>key(
<var title="">n</var> )</code></dfn> method must return the name of
the <var title="">n</var> th key in the list. The order of keys is
user-agent defined, but must be consistent within an object between
changes to the number of keys. (Thus, <a href="#setitem" title=
"dom-Storage-setItem">adding</a> or <a href="#removeitem" title=
"dom-Storage-removeItem">removing</a> a key may change the order of
the keys, but merely changing the value of an existing key must
not.) If <var title="">n</var> is less than zero or greater than or
equal to the number of key/value pairs in the object, then this
method must raise an <code>INDEX_SIZE_ERR</code> exception.</p>
<p>The <dfn id="getitem" title="dom-Storage-getItem"><code>getItem(
<var title="">key</var> )</code></dfn> method must return the
current value associated with the given <var title="">key</var> .
If the given <var title="">key</var> does not exist in the list
associated with the object then this method must return null.</p>
<p>The <dfn id="setitem" title="dom-Storage-setItem"><code>setItem(
<var title="">key</var> , <var title="">value</var> )</code></dfn>
method must first check if a key/value pair with the given
<var title="">key</var> already exists in the list associated with
the object.</p>
<p>If it does not, then a new key/value pair must be added to the
list, with the given <var title="">key</var> and <var title=
"">value</var> .</p>
<p>If the given <var title="">key</var> <em>does</em> exist in the
list, then it must have its value updated to the value given in the
<var title="">value</var> argument.</p>
<p><del class="diff-old">When</del> <ins class="diff-chg">If it
couldn't set the new value,</ins> the <del class=
"diff-old">setItem()</del> method <del class="diff-old">is invoked,
events are fired on other</del> <ins class="diff-chg">must raise
an</ins> <code><del class="diff-old">HTMLDocument</del> <ins class=
"diff-chg">INVALID_ACCESS_ERR</ins></code> <del class=
"diff-old">objects that can access</del> <ins class=
"diff-chg">exception. (Setting could fail if, e.g.,</ins> the
<del class="diff-old">newly stored data, as defined in</del>
<ins class="diff-chg">user has disabled storage for</ins> the
<del class="diff-old">sections on</del> <ins class=
"diff-chg">domain, or if</ins> the <del class=
"diff-old">sessionStorage and globalStorage attributes.</del>
<ins class="diff-chg">quota has been exceeded.)</ins></p>
<p>The <dfn id="removeitem" title=
"dom-Storage-removeItem"><code>removeItem( <var title="">key</var>
)</code></dfn> method must cause the key/value pair with the given
<var title="">key</var> to be removed from the list associated with
the object, if it exists. If no item with that key exists, the
method must do nothing.</p>
<p>The <code title="dom-Storage-setItem"><a href=
"#setitem">setItem()</a></code> and <code title=
"dom-Storage-removeItem"><a href=
"#removeitem">removeItem()</a></code> methods must be atomic with
respect to failure. That is, changes to the data storage area must
either be successful, or the data storage area must not be changed
at all.</p>
<p><del class="diff-old">In the ECMAScript DOM binding, enumerating
a Storage</del> <ins class="diff-chg">The</ins> <dfn id="clear0"
title="dom-Storage-clear"><code><ins class=
"diff-new">clear()</ins></code> <del class=
"diff-old">object</del></dfn> <ins class="diff-chg">method</ins>
must <del class="diff-old">enumerate through the currently stored
keys in</del> <ins class="diff-chg">atomically cause</ins> the list
<del class="diff-old">the object is</del> associated <del class=
"diff-old">with. (It must not enumerate the values or</del>
<ins class="diff-chg">with</ins> the <del class="diff-old">actual
members</del> <ins class="diff-chg">object to be emptied</ins> of
<ins class="diff-new">all key/value pairs.</ins></p>
<p><ins class="diff-new">When</ins> the <del class=
"diff-old">interface). In the ECMAScript DOM binding,</del>
<code title="dom-Storage-setItem"><del class=
"diff-old">Storage</del> <a href="#setitem"><ins class=
"diff-chg">setItem()</ins></a> <del class="diff-old">objects must
support dereferencing such that getting a property that is not a
member of the object (i.e. is neither a member of the</del></code>
, <code title="dom-Storage-removeItem"><del class=
"diff-old">Storage</del> <a href="#removeitem"><ins class=
"diff-chg">removeItem()</ins></a></code> ,<ins class=
"diff-chg">and</ins> <code title="dom-Storage-clear"><a href=
"#clear0"><ins class="diff-chg">clear()</ins></a></code>
<del class="diff-old">interface nor of Object ) must invoke
the</del> <ins class="diff-chg">methods are invoked, events are
fired on other</ins> <code><del class="diff-old">getItem()</del>
<a href="#htmldocument"><ins class=
"diff-chg">HTMLDocument</ins></a></code> <del class=
"diff-old">method with</del> <ins class="diff-chg">objects that can
access</ins> the <del class="diff-old">property's name</del>
<ins class="diff-chg">newly stored or removed data,</ins> as
<ins class="diff-new">defined in</ins> the <del class=
"diff-old">argument, and setting such a property must invoke</del>
<ins class="diff-chg">sections on</ins> the <code title=
"dom-sessionStorage"><del class="diff-old">setItem()</del> <a href=
"#sessionstorage"><ins class=
"diff-chg">sessionStorage</ins></a></code> <del class=
"diff-old">method with the property's name as the first
argument</del> and <del class="diff-old">the given value as the
second argument.</del> <code title="dom-localStorage"><a href=
"#localstorage"><ins class="diff-chg">localStorage</ins></a></code>
<ins class="diff-chg">attributes.</ins></p>
<h5 id="the-sessionstorage"><span class="secno"><del class=
"diff-old">4.10.3.</del> <ins class=
"diff-chg">4.11.1.3.</ins></span> The <code title=
"dom-sessionStorage"><a href=
"#sessionstorage">sessionStorage</a></code> attribute</h5>
<p>The <dfn id="sessionstorage" title=
"dom-sessionStorage"><code>sessionStorage</code></dfn> attribute
represents the set of storage areas specific to the current
<a href="#top-level">top-level browsing context</a> .</p>
<p>Each <a href="#top-level">top-level browsing context</a> has a
unique set of session storage areas, one for each <a href=
"#origin0">origin</a> .</p>
<p>User agents should not expire data from a browsing context's
session storage areas, but may do so when the user requests that
such data be deleted, or when the UA detects that it has limited
storage space, or for security reasons. User agents should always
avoid deleting data while a script that could access that data is
running. When a top-level browsing context is destroyed (and
therefore permanently inaccessible to the user) the data stored in
its session storage areas can be discarded with it, as the API
described in this specification provides no way for that data to
ever be subsequently retrieved.</p>
<p class="note">The lifetime of a browsing context can be unrelated
to the lifetime of the actual user agent process itself, as the
user agent may support resuming sessions after a restart.</p>
<p>When a new <code><a href="#htmldocument">HTMLDocument</a></code>
is created, the user agent must check to see if the document's
<a href="#top-level">top-level browsing context</a> has allocated a
session storage area for that document's <a href=
"#origin0">origin</a> . If it has not, a new storage area for that
document's <a href="#origin0">origin</a> must be created.</p>
<p>The <code><a href="#storage0">Storage</a></code> object for the
document's associated <code><a href="#window">Window</a></code>
object's <code title="dom-sessionStorage"><a href=
"#sessionstorage">sessionStorage</a></code> attribute must then be
associated with that <a href="#origin0">origin</a> 's session
storage area for that <a href="#top-level">top-level browsing
context</a> .</p>
<p>When a new <a href="#top-level">top-level browsing context</a>
is created by cloning an existing <a href="#browsing1">browsing
context</a> , the new browsing context must start with the same
session storage areas as the original, but the two sets must from
that point on be considered separate, not affecting each other in
any way.</p>
<p>When a new <a href="#top-level">top-level browsing context</a>
is created by a script in an existing <a href="#browsing1">browsing
context</a> , or by the user following a link in an existing
browsing context, or in some other way related to a specific
<code><a href="#htmldocument">HTMLDocument</a></code> , then the
session storage area of the <a href="#origin0">origin</a> of that
<code><a href="#htmldocument">HTMLDocument</a></code> must be
copied into the new browsing context when it is created. From that
point on, however, the two session storage areas must be considered
separate, not affecting each other in any way.</p>
<p id="sessionStorageEvent">When the <code title=
"dom-Storage-setItem"><a href="#setitem">setItem()</a></code> ,
<code title="dom-Storage-removeItem"><a href=
"#removeitem"><ins class="diff-new">removeItem()</ins></a></code>
,<ins class="diff-new">and</ins> <code title=
"dom-Storage-clear"><a href="#clear0"><ins class=
"diff-new">clear()</ins></a></code> <del class="diff-old">method
is</del> <ins class="diff-chg">methods are</ins> called on a
<code><a href="#storage0">Storage</a></code> object <var title=
"">x</var> that is associated with a session storage area, then in
every <code><a href="#htmldocument">HTMLDocument</a></code> object
whose <code><a href="#window">Window</a></code> object's
<code title="dom-sessionStorage"><a href=
"#sessionstorage">sessionStorage</a></code> attribute's
<code><a href="#storage0">Storage</a></code> object is associated
with the same storage area, other than <var title="">x</var> , a
<code title="event-storage"><a href="#storage1">storage</a></code>
event must be fired, as <a href="#storage1" title=
"event-storage">described below</a> .</p>
<h5 id="the-localstorage"><span class="secno"><del class=
"diff-old">4.10.4.</del> <ins class=
"diff-chg">4.11.1.4.</ins></span> The <code title=
"dom-localStorage"><del class="diff-old">globalStorage</del>
<a href="#localstorage"><ins class=
"diff-chg">localStorage</ins></a></code> attribute</h5>
<p>The <dfn id="localstorage" title=
"dom-localStorage"><code><del class="diff-old">globalStorage</del>
<ins class="diff-chg">localStorage</ins></code></dfn> object
provides a <code><a href="#storage0">Storage</a></code> object for
<ins class="diff-new">an</ins> <a href="#origin0">origin</a> .</p>
<p>User agents must have a set of <del class=
"diff-old">global</del> <ins class="diff-chg">local</ins> storage
areas, one for each <a href="#origin0">origin</a> .</p>
<p>User agents should <del class="diff-old">only</del> expire data
from the <del class="diff-old">global</del> <ins class=
"diff-chg">local</ins> storage areas <ins class=
"diff-new">only</ins> for security reasons or when requested to do
so by the user. User agents should always avoid deleting data while
a script that could access that data is running. Data stored in
<del class="diff-old">global</del> <ins class=
"diff-chg">local</ins> storage areas should be considered
potentially user-critical. It is expected that Web applications
will use the <del class="diff-old">global</del> <ins class=
"diff-chg">local</ins> storage areas for storing user-written
documents.</p>
<p>When the <code title="dom-localStorage"><del class=
"diff-old">globalStorage</del> <a href="#localstorage"><ins class=
"diff-chg">localStorage</ins></a></code> attribute is accessed, the
user agent must check to see if it has allocated <del class=
"diff-old">global</del> <ins class="diff-chg">local</ins> storage
area for the <a href="#origin0">origin</a> of the <a href=
"#browsing1">browsing context</a> within which the script is
running. If it has not, a new storage area for that <a href=
"#origin0">origin</a> must be created.</p>
<p>The user agent must then create a <code><a href=
"#storage0">Storage</a></code> object associated with that origin's
<del class="diff-old">global</del> <ins class=
"diff-chg">local</ins> storage area, and return it.</p>
<p id="localStorageEvent">When the <code title=
"dom-Storage-setItem"><a href="#setitem">setItem()</a></code> ,
<code title="dom-Storage-removeItem"><a href=
"#removeitem"><ins class="diff-new">removeItem()</ins></a></code>
,<ins class="diff-new">and</ins> <code title=
"dom-Storage-clear"><a href="#clear0"><ins class=
"diff-new">clear()</ins></a></code> <del class="diff-old">method
is</del> <ins class="diff-chg">methods are</ins> called on a
<code><a href="#storage0">Storage</a></code> object <var title=
"">x</var> that is associated with a <del class=
"diff-old">global</del> <ins class="diff-chg">local</ins> storage
area, then in every <code><a href=
"#htmldocument">HTMLDocument</a></code> object whose <code><a href=
"#window">Window</a></code> object's <code title=
"dom-localStorage"><del class="diff-old">globalStorage</del>
<a href="#localstorage"><ins class=
"diff-chg">localStorage</ins></a></code> attribute's <code><a href=
"#storage0">Storage</a></code> object is associated with the same
storage area, other than <var title="">x</var> , a <code title=
"event-storage"><a href="#storage1">storage</a></code> event must
be fired, as <a href="#storage1" title="event-storage">described
below</a> .</p>
<h5 id="the-storage0"><span class="secno"><del class=
"diff-old">4.10.5.</del> <ins class=
"diff-chg">4.11.1.5.</ins></span> The <code title=
"event-storage"><a href="#storage1">storage</a></code> event</h5>
<p>The <dfn id="storage1" title=
"event-storage"><code>storage</code></dfn> event is fired in an
<code><a href="#htmldocument">HTMLDocument</a></code> when a
storage area changes, as described in the previous two sections (
<a href="#sessionStorageEvent">for session storage</a> , <a href=
"#localStorageEvent">for <del class="diff-old">global</del>
<ins class="diff-chg">local</ins> storage</a> ).</p>
<p>When this happens, the user agent must <del class=
"diff-old">fire a simple</del> <ins class="diff-chg">dispatch
an</ins> event <del class="diff-old">called</del> <ins class=
"diff-chg">with the name</ins> <code><a href=
"#storage0">storage</a> <del class="diff-old">on</del></code> ,
<ins class="diff-chg">with no namespace, which does not bubble but
is cancelable, and which uses the</ins> <code><a href=
"#storageevent"><ins class="diff-chg">StorageEvent</ins></a></code>
,<ins class="diff-chg">at</ins> <a href="#the-body1">the body
element <del class="diff-old">. However, it is possible (indeed,
for session storage areas, likely) that the target's</del></a>
<ins class="diff-chg">of each</ins> <a href="#active" title=
"active document"><ins class="diff-chg">active</ins></a>
<code><a href="#htmldocument">HTMLDocument</a></code> object
<ins class="diff-new">affected.</ins></p>
<p><ins class="diff-new">If the event</ins> is <del class=
"diff-old">not</del> <ins class="diff-chg">being fired due to</ins>
an <del class="diff-old">active document</del> <ins class=
"diff-chg">invocation of the</ins> <code title=
"dom-Storage-setItem"><a href="#setitem"><ins class=
"diff-chg">setItem()</ins></a> <del class="diff-old">at that time.
In such cases,</del></code> <ins class="diff-chg">or</ins>
<code title="dom-Storage-removeItem"><a href=
"#removeitem"><ins class="diff-chg">removeItem()</ins></a></code>
<ins class="diff-chg">methods,</ins> the <del class="diff-old">user
agent</del> <ins class="diff-chg">event</ins> must <del class=
"diff-old">instead delay</del> <ins class="diff-chg">have its</ins>
<code title="dom-StorageEvent-key"><a href="#key"><ins class=
"diff-chg">key</ins></a></code> <ins class="diff-chg">attribute set
to</ins> the <del class="diff-old">firing</del> <ins class=
"diff-chg">name</ins> of the <del class="diff-old">event until such
time as the</del> <ins class="diff-chg">key in question, its</ins>
<code title="dom-StorageEvent-oldValue"><del class=
"diff-old">HTMLDocument</del> <a href="#oldvalue"><ins class=
"diff-chg">oldValue</ins></a></code> <del class=
"diff-old">object</del> <ins class="diff-chg">attribute set to the
old value of the key</ins> in <del class="diff-old">question
becomes an active document again.</del> <ins class=
"diff-chg">question, or null if the key is newly added, and
its</ins> <code title="dom-StorageEvent-newValue"><ins class=
"diff-chg">newValue</ins></code> <ins class="diff-chg">attribute
set to the new value of the key in question, or null if the key was
removed.</ins></p>
<p><del class="diff-old">When there are multiple delayed</del>
<ins class="diff-chg">Otherwise, if the event is being fired due to
an invocation of the</ins> <code title=
"dom-Storage-clear"><del class="diff-old">storage</del> <a href=
"#clear0"><ins class="diff-chg">clear()</ins></a></code>
<del class="diff-old">events for</del> <ins class=
"diff-chg">method,</ins> the <del class="diff-old">same</del>
<ins class="diff-chg">event must have its</ins> <code title=
"dom-StorageEvent-key"><del class="diff-old">HTMLDocument</del>
<a href="#key"><ins class="diff-chg">key</ins></a></code> ,
<code title="dom-StorageEvent-oldValue"><a href=
"#oldvalue"><ins class="diff-new">oldValue</ins></a></code>
,<ins class="diff-new">and</ins> <code title=
"dom-StorageEvent-newValue"><ins class=
"diff-new">newValue</ins></code> <del class="diff-old">object, user
agents must coalesce those events such that only one event fires
when the document becomes active again.</del> <ins class=
"diff-chg">attributes set to null.</ins></p>
<p><del class="diff-old">If</del> <ins class="diff-chg">In
addition,</ins> the <del class="diff-old">DOM</del> <ins class=
"diff-chg">event must have its</ins> <code title=
"dom-StorageEvent-uri"><a href="#uri"><ins class=
"diff-chg">uri</ins></a></code> <ins class="diff-chg">attribute set
to the address</ins> of <del class="diff-old">a</del> <ins class=
"diff-chg">the</ins> page <del class="diff-old">that has
delayed</del> <ins class="diff-chg">whose</ins> <code><a href=
"#storage0"><del class="diff-old">storage</del> <ins class=
"diff-chg">Storage</ins></a></code> <del class="diff-old">events
queued up</del> <ins class="diff-chg">object was affected, and
its</ins> <code title="dom-StorageEvent-source"><a href=
"#source1"><ins class="diff-chg">source</ins></a></code>
<ins class="diff-chg">attribute set to the</ins> <code><a href=
"#window"><ins class="diff-chg">Window</ins></a></code> <ins class=
"diff-chg">object of the</ins> <a href="#browsing1"><ins class=
"diff-chg">browsing context</ins></a> <ins class="diff-chg">that
that document</ins> is <del class="diff-old">discarded , then</del>
<ins class="diff-chg">in, if</ins> the <del class=
"diff-old">delayed events</del> <ins class="diff-chg">two
documents</ins> are <del class="diff-old">dropped as well. 4.10.6.
Miscellaneous implementation requirements for storage areas</del>
<ins class="diff-chg">in the same</ins> <a href=
"#unit-of"><ins class="diff-chg">unit of related browsing
contexts</ins></a> ,<ins class="diff-chg">or null
otherwise.</ins></p>
<h6 id="event0"><span class="secno"><del class=
"diff-old">4.10.6.1.</del> <ins class=
"diff-chg">4.11.1.5.1.</ins></span> <del class="diff-old">Disk
space</del> <ins class="diff-chg">Event definition</ins></h6>
<pre class="idl">
interface <dfn id=
"storageevent">StorageEvent</dfn> : Event {<ins class="diff-chg">
readonly attribute DOMString <a href="#key" title=
"dom-StorageEvent-key">key</a>;
readonly attribute DOMString <a href="#oldvalue" title=
"dom-StorageEvent-oldValue">oldValue</a>;
readonly attribute DOMString <span title=
"dom-StorageEvent-newValue">newValue</span>;
readonly attribute DOMString <a href="#uri" title=
"dom-StorageEvent-uri">uri</a>;
readonly attribute <a href="#window">Window</a> <a href=
"#source1" title="dom-StorageEvent-source">source</a>;
void <a href="#initstorageevent" title=
"dom-StorageEvent-initStorageEvent">initStorageEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString keyArg, in DOMString oldValueArg, in DOMString newValueArg, in DOMString uriArg, in Window sourceArg);
void <a href="#initstorageeventns" title=
"dom-StorageEvent-initStorageEventNS">initStorageEventNS</a>(in DOMString namespaceURI, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString keyArg, in DOMString oldValueArg, in DOMString newValueArg, in DOMString uriArg, in Window sourceArg);
};
</ins>
</pre>
<p><del class="diff-old">User agents should limit</del> <ins class=
"diff-chg">The</ins> <dfn id="initstorageevent" title=
"dom-StorageEvent-initStorageEvent"><code><ins class=
"diff-chg">initStorageEvent()</ins></code></dfn> <ins class=
"diff-chg">and</ins> <dfn id="initstorageeventns" title=
"dom-StorageEvent-initStorageEventNS"><code><ins class=
"diff-chg">initStorageEventNS()</ins></code></dfn> <ins class=
"diff-chg">methods must initialise</ins> the <del class=
"diff-old">total amount of space allowed for</del> <ins class=
"diff-chg">event in</ins> a <del class="diff-old">storage area
based on</del> <ins class="diff-chg">manner analogous to</ins> the
<del class="diff-old">domain of</del> <ins class=
"diff-chg">similarly-named methods in</ins> the <del class=
"diff-old">page setting</del> <ins class="diff-chg">DOM3 Events
interfaces.</ins> <a href="#references"><ins class=
"diff-chg">[DOM3EVENTS]</ins></a></p>
<p><ins class="diff-chg">The</ins> <dfn id="key" title=
"dom-StorageEvent-key"><code><ins class=
"diff-chg">key</ins></code></dfn> <ins class="diff-chg">attribute
represents</ins> the <del class="diff-old">value.</del> <ins class=
"diff-chg">key being changed.</ins></p>
<p><del class="diff-old">User agents should not limit</del>
<ins class="diff-chg">The</ins> <dfn id="oldvalue" title=
"dom-StorageEvent-oldValue"><code><ins class=
"diff-chg">oldValue</ins></code></dfn> <ins class=
"diff-chg">attribute represents</ins> the <del class=
"diff-old">total amount</del> <ins class="diff-chg">old value</ins>
of <del class="diff-old">space allowed on a per-storage-area basis,
otherwise a site could just store data in any number</del>
<ins class="diff-chg">the key being changed.</ins></p>
<p><ins class="diff-chg">The</ins> <dfn id="newvalue" title=
"dom-StorageEvent-vnewValue"><code><ins class=
"diff-chg">newValue</ins></code></dfn> <ins class=
"diff-chg">attribute represents the new value</ins> of <del class=
"diff-old">subdomains or ports, e.g. storing up to</del> the
<del class="diff-old">limit in a1.example.com, a2.example.com,
a3.example.com, etc, circumventing per-domain limits.</del>
<ins class="diff-chg">key being changed.</ins></p>
<p><del class="diff-old">User agents may prompt</del> <ins class=
"diff-chg">The</ins> <dfn id="uri" title=
"dom-StorageEvent-uri"><code><ins class=
"diff-chg">uri</ins></code></dfn> <ins class="diff-chg">attribute
represents</ins> the <del class="diff-old">user when per-domain
space quotas are reached, allowing</del> <ins class=
"diff-chg">address of</ins> the <del class="diff-old">user to grant
a site more space. This enables sites to store many user-created
documents on</del> <ins class="diff-chg">document that
changed</ins> the <del class="diff-old">user's computer, for
instance. User agents should allow users to see how much space each
domain is using.</del> <ins class="diff-chg">key.</ins></p>
<p><del class="diff-old">If</del> <ins class="diff-chg">The</ins>
<dfn id="source1" title="dom-StorageEvent-source"><code><ins class=
"diff-chg">source</ins></code></dfn> <ins class=
"diff-chg">attribute represents</ins> the <del class=
"diff-old">storage area space limit is reached during a</del>
<code><del class="diff-old">setItem()</del> <a href=
"#window"><ins class="diff-chg">Window</ins></a></code> <del class=
"diff-old">call,</del> <ins class="diff-chg">that changed</ins> the
<del class="diff-old">user agent must raise an INVALID_ACCESS_ERR
exception. A mostly arbitrary limit of five megabytes per domain is
recommended. Implementation feedback is welcome and will be used to
update this suggestion in future.</del> <ins class=
"diff-chg">key.</ins></p>
<h5 id="threads0"><span class="secno"><del class=
"diff-old">4.10.6.2.</del> <ins class=
"diff-chg">4.11.1.6.</ins></span> Threads</h5>
<p>Multiple browsing contexts must be able to access the
<del class="diff-old">global</del> <ins class=
"diff-chg">local</ins> storage areas simultaneously in a
predictable manner. Scripts must not be able to detect any
concurrent script execution.</p>
<p>This is required to <del class="diff-old">guarentee</del>
<ins class="diff-chg">guarantee</ins> that the <code title=
"dom-Storage-length"><a href="#length9">length</a></code> attribute
of a <code><a href="#storage0">Storage</a></code> object never
changes while a script is executing, other than in a way that is
predictable by the script itself.</p>
<p>There are various ways of implementing this requirement. One is
that if a script running in one browsing context accesses a
<del class="diff-old">global</del> <ins class=
"diff-chg">local</ins> storage area, the UA blocks scripts in other
browsing contexts when they try to access the <del class=
"diff-old">global</del> <ins class="diff-chg">local</ins> storage
area for the <a href="#same-origin">same origin</a> until the first
script has executed to completion. (Similarly, when a script in one
browsing context accesses its session storage area, any scripts
that have the same top level browsing context and the <a href=
"#same-origin">same origin</a> would block when accessing their
session storage area until the first script has executed to
completion.) Another (potentially more efficient but probably more
complex) implementation strategy is to use optimistic transactional
script execution. This specification does not require any
particular implementation strategy, so long as the requirement
above is met. <del class="diff-old">4.10.7. Security and privacy
4.10.7.1. User tracking A third-party advertiser (or any entity
capable of getting content distributed to multiple sites) could use
a unique identifier stored in its global storage area to track a
user across multiple sessions, building a profile of the user's
interests to allow for highly targeted advertising. In conjunction
with a site that is aware of the user's real identity (for example
an e-commerce site that requires authenticated credentials), this
could allow oppressive groups to target individuals with greater
accuracy than in a world with purely anonymous Web usage. There are
a number of techniques that can be used to mitigate the risk of
user tracking: Blocking third-party storage: user agents may
restrict access to the globalStorage object to scripts originating
at the domain of the top-level document of the browsing context .
Expiring stored data: user agents may automatically delete stored
data after a period of time. For example, a user agent could treat
third-party global storage areas as session-only storage, deleting
the data once the user had closed all the browsing contexts that
could access it. This can restrict the ability of a site to track a
user, as the site would then only be able to track the user across
multiple sessions when he authenticates with the site itself (e.g.
by making a purchase or logging in to a service). However, this
also puts the user's data at risk. Treating persistent storage as
cookies: user agents may present the persistent storage feature to
the user in a way that does not distinguish it from HTTP session
cookies. [RFC2965] This might encourage users to view persistent
storage with healthy suspicion. Site-specific white-listing of
access to global storage areas: user agents may allow sites to
access session storage areas in an unrestricted manner, but require
the user to authorise access to global storage areas.
Origin-tracking of persistent storage data: user agents may record
the origins of sites that contained content from third-party
origins that caused data to be stored. If this information is then
used to present the view of data currently in persistent storage,
it would allow the user to make informed decisions about which
parts of the persistent storage to prune. Combined with a blacklist
("delete this data and prevent this domain from ever storing data
again"), the user can restrict the use of persistent storage to
sites that he trusts. Shared blacklists: user agents may allow
users to share their persistent storage domain blacklists. This
would allow communities to act together to protect their privacy.
While these suggestions prevent trivial use of this API for user
tracking, they do not block it altogether. Within a single domain,
a site can continue to track the user during a session, and can
then pass all this information to the third party along with any
identifying information (names, credit card numbers, addresses)
obtained by the site. If a third party cooperates with multiple
sites to obtain such information, a profile can still be created.
However, user tracking is to some extent possible even with no
cooperation from the user agent whatsoever, for instance by using
session identifiers in URIs, a technique already commonly used for
innocuous purposes but easily repurposed for user tracking (even
retroactively). This information can then be shared with other
sites, using using visitors' IP addresses and other user-specific
data (e.g. user-agent headers and configuration settings) to
combine separate sessions into coherent user profiles. 4.10.7.2.
Cookie resurrection If the user interface for persistent storage
presents data in the persistent storage feature separately from
data in HTTP session cookies, then users are likely to delete data
in one and not the other. This would allow sites to use the two
features as redundant backup for each other, defeating a user's
attempts to protect his privacy.</del></p>
<h4 id="sql"><span class="secno"><del class=
"diff-old">4.10.7.3.</del> <ins class=
"diff-chg">4.11.2</ins></span> <del class="diff-old">DNS spoofing
attacks Because of the potential for DNS spoofing attacks, one
cannot guarentee that a host claiming to be in a certain domain
really is from that domain. To mitigate this, pages can use SSL.
Pages using SSL can be sure that only pages using SSL that have
certificates identifying them as being from the same domain can
access their global</del> <ins class="diff-chg">Database</ins>
storage <del class="diff-old">areas.</del></h4>
<h5 id="introduction3"><span class="secno"><del class=
"diff-old">4.10.7.4.</del> <ins class=
"diff-chg">4.11.2.1.</ins></span> <del class=
"diff-old">Cross-directory attacks</del> <ins class=
"diff-chg">Introduction</ins></h5>
<p><del class="diff-old">Different authors sharing one host name,
for example users hosting content on geocities.com , all share one
persistent storage object. There is no feature to restrict the
access by pathname. Authors on shared hosts are therefore
recommended to avoid using the persistent storage feature, as it
would be trivial for other authors to read from and write to the
same storage area. Even if a path-restriction feature was made
available, the usual DOM scripting security model would make it
trivial to bypass this protection and access the data from any
path.</del> <del class="diff-old">4.10.7.5. Implementation risks
The two primary risks when implementing this persistent storage
feature are letting hostile sites read information from other
domains, and letting hostile sites write information that is then
read from other domains. Letting third-party sites read data that
is not supposed to be read from their domain causes</del>
<em><del class="diff-old">information leakage , For example, a
user's shopping wishlist on one domain could be used by another
domain for targeted advertising; or a user's work-in-progress
confidential documents stored by a word-processing site could be
examined by the site of a competing company. Letting third-party
sites write data to the storage areas of other domains can result
in information spoofing , which is equally dangerous. For example,
a hostile site could add items to a user's wishlist; or a hostile
site could set a user's session identifier to a known ID that the
hostile site can then use to track the user's actions on the victim
site. Thus, strictly following the model described in this
specification</del> <ins class="diff-chg">This section</ins> is
<del class="diff-old">important for user security. 4.11.
Client-side database storage 4.11.1. Introduction</del> <ins class=
"diff-chg">non-normative.</ins></em></p>
<p class="big-issue">...</p>
<h5 id="databases"><span class="secno"><del class=
"diff-old">4.11.2.</del> <ins class=
"diff-chg">4.11.2.2.</ins></span> Databases</h5>
<p>Each <i><a href="#origin0">origin</a></i> has an associated set
of databases. Each database has a name and a current version. There
is no way to enumerate or delete the databases available for a
domain from this API.</p>
<p class="note">Each database has one version at a time, a database
can't exist in multiple versions at once. Versions are intended to
allow authors to manage schema changes incrementally and
non-destructively, and without running the risk of old code (e.g.
in another browser window) trying to write to a database with
incorrect assumptions.</p>
<p>The <dfn id="opendatabase" title=
"dom-opendatabase"><code>openDatabase()</code></dfn> method returns
a <code><a href="#database0">Database</a></code> object. The method
takes four arguments: a database name, a database version, a
display name, and an estimated size, in bytes, of the data that
will be stored in the database.</p>
<p><ins class="diff-new">The</ins> <code title=
"dom-opendatabase"><a href="#opendatabase"><ins class=
"diff-new">openDatabase()</ins></a></code> <ins class=
"diff-new">method must use and create databases from the</ins>
<a href="#origin0"><ins class="diff-new">origin</ins></a>
<ins class="diff-new">of the</ins> <a href="#active"><ins class=
"diff-new">active document</ins></a> <ins class="diff-new">of
the</ins> <code><a href="#window"><ins class=
"diff-new">Window</ins></a></code> <ins class="diff-new">object on
which the method was invoked.</ins></p>
<p>If the database version provided is not the empty string, and
the database already exists but has a different version, then the
method must raise an <code>INVALID_STATE_ERR</code> exception.</p>
<p><ins class="diff-new">The user agent may also raise a</ins>
<a href="#security9"><ins class="diff-new">security
exception</ins></a> <ins class="diff-new">in case the request
violates a policy decision (e.g. if the user agent is configured to
not allow the page to open databases).</ins></p>
<p>Otherwise, if the database <ins class="diff-new">version</ins>
provided is the empty string, or if the database doesn't yet exist,
or if the database exists and the version provided to the
<code title="dom-opendatabase"><a href=
"#opendatabase">openDatabase()</a></code> method is the same as the
current version associated with the database, then the method must
return a <code><a href="#database0">Database</a></code> object
representing the database <del class="diff-old">associated with the
origin of the active document of the browsing context of the Window
object on which the method was called</del> that has the name that
was given. If no such database exists, it must be created
first.</p>
<p>All strings including the empty string are valid database names.
Database names are case-sensitive.</p>
<p class="note">Implementations can support this even in
environments that only support a subset of all strings as database
names by mapping database names (e.g. using a hashing algorithm) to
the supported set of names.</p>
<p>User agents are expected to use the display name and the
estimated database size to <del class="diff-old">optimise</del>
<ins class="diff-chg">optimize</ins> the user experience. For
example, a user agent could use the estimated size to suggest an
initial quota to the user. This allows a site that is aware that it
will try to use hundreds of megabytes to declare this upfront,
instead of the user agent prompting the user for permission to
increase the quota every five megabytes.</p>
<pre class="idl">
interface <dfn id="database0">Database</dfn> {
void <a href="#transaction" title=
"dom-database-transaction">transaction</a>(in <a href=
"#sqltransactioncallback">SQLTransactionCallback</a> callback);
void <a href="#transaction" title=
"dom-database-transaction">transaction</a>(in <a href=
"#sqltransactioncallback">SQLTransactionCallback</a> callback, in <a href="#sqltransactionerrorcallback">SQLTransactionErrorCallback</a> errorCallback);
void <a href="#transaction" title=
"dom-database-transaction">transaction</a>(in <a href=
"#sqltransactioncallback">SQLTransactionCallback</a> callback, in <a href="#sqltransactionerrorcallback">SQLTransactionErrorCallback</a> errorCallback, in <a href="#voidcallback">VoidCallback</a> successCallback);
readonly attribute DOMString <a href="#version" title=
"dom-database-version">version</a>;
void <a href="#changeversion" title=
"dom-database-changeVersion">changeVersion</a>(in DOMString oldVersion, in DOMString newVersion, in <a href="#sqltransactioncallback">SQLTransactionCallback</a> callback, in <a href="#sqltransactionerrorcallback">SQLTransactionErrorCallback</a> errorCallback, in <a href="#voidcallback">VoidCallback</a> successCallback);
};
interface <dfn id=
"sqltransactioncallback">SQLTransactionCallback</dfn> {
void <span title=
"dom-sqltransactioncallback-handleEvent">handleEvent</span>(in <a href="#sqltransaction">SQLTransaction</a> transaction);
};
interface <dfn id=
"sqltransactionerrorcallback">SQLTransactionErrorCallback</dfn> {
<del class="diff-old"> boolean error);
</del>
<ins class="diff-chg"> void <span title=
"dom-sqltransactionerrorcallback-handleEvent">handleEvent</span>(in <a href="#sqlerror">SQLError</a> error);
</ins>
};
</pre>
<p>The <dfn id="transaction" title=
"dom-database-transaction"><code>transaction()</code></dfn> method
takes one or two arguments. When called, the method must
immediately return and then asynchronously run the <a href=
"#transaction0">transaction steps</a> with the <i>transaction
callback</i> being the first argument, the <i>error callback</i>
being the second argument, if any, the <i>success callback</i>
being the third argument, if any, and with no <i>preflight
operation</i> or <i>postflight operation</i> .</p>
<p>The version that the database was opened with is the <dfn id=
"expected" title="concept-database-expected-version">expected
version</dfn> of this <code><a href=
"#database0">Database</a></code> object. It can be the empty
string, in which case there is no expected version — any version is
fine.</p>
<p>On getting, the <dfn id="version" title=
"dom-database-version"><code>version</code></dfn> attribute must
return the current version of the database (as opposed to the
<a href="#expected" title=
"concept-database-expected-version">expected version</a> of the
<code><a href="#database0">Database</a></code> object).</p>
<p>The <dfn id="changeversion" title=
"dom-database-changeVersion"><code>changeVersion()</code></dfn>
method allows scripts to atomically verify the version number and
change it at the same time as doing a schema update. When the
method is invoked, it must immediately return, and then
asynchronously run the <a href="#transaction0">transaction
steps</a> with the <i>transaction callback</i> being the third
argument, the <i>error callback</i> being the fourth argument, the
<i>success callback</i> being the fifth argument, the <i>preflight
operation</i> being the following:</p>
<ol>
<li>
<p>Check that the value of the first argument to the <code title=
"dom-database-changeVersion"><a href=
"#changeversion">changeVersion()</a></code> method exactly matches
the database's actual version. If it does not, then the
<i>preflight operation</i> fails.</p>
</li>
</ol>
<p>...and the <i>postflight operation</i> being the following:</p>
<ol>
<li>Change the database's actual version to the value of the second
argument to the <code title="dom-database-changeVersion"><a href=
"#changeversion">changeVersion()</a></code> method.</li>
<li>Change the <code><a href="#database0">Database</a></code>
object's expected version to the value of the second argument to
the <code title="dom-database-changeVersion"><a href=
"#changeversion">changeVersion()</a></code> method.</li>
</ol>
<h5 id="executing"><span class="secno"><del class=
"diff-old">4.11.3.</del> <ins class=
"diff-chg">4.11.2.3.</ins></span> Executing SQL statements</h5>
<p>The <code title="dom-database-transaction"><a href=
"#transaction">transaction()</a></code> and <code title=
"dom-database-changeVersion"><a href=
"#changeversion">changeVersion()</a></code> methods invoke
callbacks with <code><a href=
"#sqltransaction">SQLTransaction</a></code> objects.</p>
<pre class="idl">
typedef sequence<Object> <dfn id=
"objectarray">ObjectArray</dfn>;
interface <dfn id="sqltransaction">SQLTransaction</dfn> {
<del class="diff-old"> void (in DOMString sqlStatement);
void arguments);
void callback);
void errorCallback);
</del>
<ins class="diff-chg"> void <a href="#executesql" title=
"dom-sqltransaction-executeSql">executeSql</a>(in DOMString sqlStatement);
void <a href="#executesql" title=
"dom-sqltransaction-executeSql">executeSql</a>(in DOMString sqlStatement, in <a href="#objectarray">ObjectArray</a> arguments);
void <a href="#executesql" title=
"dom-sqltransaction-executeSql">executeSql</a>(in DOMString sqlStatement, in <a href="#objectarray">ObjectArray</a> arguments, in <a href="#sqlstatementcallback">SQLStatementCallback</a> callback);
void <a href="#executesql" title=
"dom-sqltransaction-executeSql">executeSql</a>(in DOMString sqlStatement, in <a href="#objectarray">ObjectArray</a> arguments, in <a href="#sqlstatementcallback">SQLStatementCallback</a> callback, in <a href="#sqlstatementerrorcallback">SQLStatementErrorCallback</a> errorCallback);
</ins>
};
interface <dfn id=
"sqlstatementcallback">SQLStatementCallback</dfn> {
void <span title=
"dom-sqlstatementcallback-handleEvent">handleEvent</span>(in <a href="#sqltransaction">SQLTransaction</a> transaction, in <a href="#sqlresultset">SQLResultSet</a> resultSet);
};
interface <dfn id=
"sqlstatementerrorcallback">SQLStatementErrorCallback</dfn> {
boolean <span title=
"dom-sqlstatementerrorcallback-handleEvent">handleEvent</span>(in <a href="#sqltransaction">SQLTransaction</a> transaction, in <a href="#sqlerror">SQLError</a> error);<span class="issue">Or should these arguments be the other way around? Either way we're inconsistent with _something_. What should we be consistent with?</span>
};
</pre>
<p>When the <dfn id="executesql" title=
"dom-sqltransaction-executeSql"><code>executeSql( <var title=
"">sqlStatement</var> , <var title="">arguments</var> , <var title=
"">callback</var> , <var title="">errorCallback</var>
)</code></dfn> method is invoked, the user agent must run the
following algorithm. (This algorithm is relatively simple and
doesn't actually execute any SQL — the bulk of the work is actually
done as part of the <a href="#transaction0">transaction steps</a>
.)</p>
<ol>
<li>
<p>If the method was not invoked during the execution of a
<code><a href=
"#sqltransactioncallback">SQLTransactionCallback</a></code> ,
<code><a href=
"#sqlstatementcallback">SQLStatementCallback</a></code> , or
<code><a href=
"#sqlstatementerrorcallback">SQLStatementErrorCallback</a></code>
then raise an <code>INVALID_STATE_ERR</code> exception. (Calls from
inside a <code><a href=
"#sqltransactionerrorcallback">SQLTransactionErrorCallback</a></code>
thus raise an exception. The <code><a href=
"#sqltransactionerrorcallback">SQLTransactionErrorCallback</a></code>
handler is only called once a transaction has failed, and no SQL
statements can be added to a failed transaction.)</p>
</li>
<li>
<p>Parse the first argument to the method ( <var title=
"">sqlStatement</var> ) as an SQL statement, with the exception
that <code title="">?</code> characters can be used in place of
literals in the statement. <a href="#references">[SQL]</a></p>
</li>
<li>
<p>Replace each <code title="">?</code> placeholder with the value
of the argument in the <var title="">arguments</var> array with the
same position. (So the first <code title="">?</code> placeholder
gets replaced by the first value in the <var title=
"">arguments</var> array, and generally the <var title="">n</var>
th <code title="">?</code> placeholder gets replaced by the
<var title="">n</var> th value in the <var title="">arguments</var>
array.)</p>
<p>If the second argument is <del class="diff-old">ommitted</del>
<ins class="diff-chg">omitted</ins> or null, then treat the
<var title="">arguments</var> array as empty.</p>
<p>The result is <i>the statement</i> .</p>
<p class="big-issue"><ins class="diff-new">Implementation feedback
is requested on what to do with arguments that are of types that
are not supported by the underlying SQL backend. For example,
SQLite doesn't support booleans, so what should the UA do if passed
a boolean? The Gears team suggests failing, not silently converting
types.</ins></p>
</li>
<li>
<p>If the syntax of <var title="">sqlStatement</var> is not valid
(except for the use of <code title="">?</code> characters in the
place of literals), or the statement uses features that are not
supported (e.g. due to security reasons), or the number of items in
the <var title="">arguments</var> array is not equal to the number
of <code title="">?</code> placeholders in the statement, or the
statement cannot be parsed for some other reason, then mark <i>the
statement</i> as bogus.</p>
</li>
<li>
<p>If the <code><a href="#database0">Database</a></code> object
that the <code><a href="#sqltransaction">SQLTransaction</a></code>
object was created from has an <a href="#expected" title=
"concept-database-expected-version">expected version</a> that is
neither the empty string nor the actual version of the database,
then mark <i>the statement</i> as bogus. ( <a href="#x1" title=
"dom-sqlerror-code-2">Error code 2</a> .)</p>
</li>
<li>
<p>Queue up <i>the statement</i> in the transaction, along with the
third argument (if any) as the statement's result set callback and
the fourth argument (if any) as the error callback.</p>
</li>
</ol>
<p>The user agent must act as if the database was hosted in an
otherwise completely empty environment with no resources. For
example, attempts to read from or write to the <del class=
"diff-old">filesystem</del> <ins class="diff-chg">file system</ins>
will fail.</p>
<p><del class="diff-old">User agents should limit the total amount
of space allowed for each origin, but may prompt the user and
extend the limit if a database is reaching its quota. User agents
should allow users to see how much space each database is using. A
mostly arbitrary limit of five megabytes per origin is recommended.
Implementation feedback is welcome and will be used to update this
suggestion in future.</del> SQL inherently supports multiple
concurrent connections. Authors should make appropriate use of the
transaction features to handle the case of multiple scripts
interacting with the same database simultaneously (as could happen
if the same page was opened in two different <a href="#browsing1"
title="browsing context">browsing contexts</a> ).</p>
<p>User agents must consider statements that use the <code title=
"">BEGIN</code> , <code title="">COMMIT</code> , and <code title=
"">ROLLBACK</code> SQL features as being unsupported (and thus will
mark them as bogus), so as to not let these statements interfere
with the explicit transactions managed by the database API
itself.</p>
<p class="note">A future version of this specification will
probably define the exact SQL subset required in more detail.</p>
<h5 id="database"><span class="secno"><del class=
"diff-old">4.11.4.</del> <ins class=
"diff-chg">4.11.2.4.</ins></span> Database query results</h5>
<p>The <code title="dom-transaction-executeSql">executeSql()</code>
method invokes its callback with a <code><a href=
"#sqlresultset">SQLResultSet</a></code> object as an argument.</p>
<pre class="idl">
interface <dfn id="sqlresultset">SQLResultSet</dfn> {
readonly attribute int <a href="#insertid" title=
"dom-SQLResultSet-insertId">insertId</a>;
readonly attribute int <a href="#rowsaffected" title=
"dom-SQLResultSet-rowsAffected">rowsAffected</a>;
readonly attribute <a href=
"#sqlresultsetrowlist">SQLResultSetRowList</a> <a href="#rows1"
title="dom-SQLResultSet-rows">rows</a>;
};
</pre>
<p>The <dfn id="insertid" title=
"dom-SQLResultSet-insertId"><code>insertId</code></dfn> attribute
must return the row ID of the row that the <code><a href=
"#sqlresultset">SQLResultSet</a></code> object's SQL statement
inserted into the database, if the statement inserted a row. If the
statement inserted multiple rows, the ID of the last row must be
the one returned. If the statement did not insert a row, then the
attribute must instead raise an <code>INVALID_ACCESS_ERR</code>
exception.</p>
<p>The <dfn id="rowsaffected" title=
"dom-SQLResultSet-rowsAffected"><code>rowsAffected</code></dfn>
attribute must return the number of rows that were affected by the
SQL statement. If the statement did not affected any rows, then the
attribute must return zero. For "SELECT" statements, this returns
zero (querying the database doesn't affect any rows).</p>
<p>The <dfn id="rows1" title=
"dom-SQLResultSet-rows"><code>rows</code></dfn> attribute must
return a <code><a href=
"#sqlresultsetrowlist">SQLResultSetRowList</a></code> representing
the rows returned, in the order returned by the database. If no
rows were returned, then the object will be <del class=
"diff-old">empty.</del> <ins class="diff-chg">empty (its</ins>
<code title="dom-SQLResultSetRowList-length"><a href=
"#length10"><ins class="diff-chg">length</ins></a></code>
<ins class="diff-chg">will be zero).</ins></p>
<pre class="idl">
interface <dfn id="sqlresultsetrowlist">SQLResultSetRowList</dfn> {
<del class="diff-old"> readonly attribute unsigned long ;
(in unsigned long index);
</del>
<ins class="diff-chg"> readonly attribute unsigned long <a href=
"#length10" title="dom-SQLResultSetRowList-length">length</a>;
[IndexGetter] <span>DOMObject</span> <a href="#itemindex5" title=
"dom-SQLResultSetRowList-item">item</a>(in unsigned long index);
</ins>
};
</pre>
<p><code><a href=
"#sqlresultsetrowlist">SQLResultSetRowList</a></code> objects have
a <dfn id="length10" title=
"dom-SQLResultSetRowList-length"><code>length</code></dfn>
attribute that must return the number of rows it represents (the
number of rows returned by the database).</p>
<p>The <dfn id="itemindex5" title=
"dom-SQLResultSetRowList-item"><code>item( <var title=
"">index</var> )</code></dfn> attribute must return the row with
the given index <var title="">index</var> . If there is no such
row, then the method must raise an <code>INDEX_SIZE_ERR</code>
exception.</p>
<p>Each row must be represented by a native ordered dictionary data
type. In the ECMAScript binding, this must be <code><a href=
"#object">Object</a></code> . Each row object must have one
property (or dictionary entry) per column, with those properties
enumerating in the order that these columns were returned by the
database. Each property must have the name of the column and the
value of the cell, as they were returned by the database.</p>
<h5 id="errors"><span class="secno"><del class=
"diff-old">4.11.5.</del> <ins class=
"diff-chg">4.11.2.5.</ins></span> Errors</h5>
<p>Errors in the database API are reported using callbacks that
have a <code><a href="#sqlerror">SQLError</a></code> object as one
of their arguments.</p>
<pre class="idl">
interface <dfn id="sqlerror">SQLError</dfn> {
readonly attribute unsigned int <a href="#code1" title=
"dom-SQLError-code">code</a>;
readonly attribute DOMString <a href="#message" title=
"dom-SQLError-message">message</a>;
};
</pre>
<p>The <dfn id="code1" title=
"dom-SQLError-code"><code>code</code></dfn> DOM attribute must
return the most appropriate code from the following table:</p>
<table>
<thead>
<tr>
<th>Code</th>
<th>Situation</th>
</tr>
</thead>
<tbody>
<tr>
<td><dfn id="x" title="dom-sqlerror-code-0">0</dfn></td>
<td>The transaction failed for reasons unrelated to the database
itself and not covered by any other error code.</td>
</tr>
<tr>
<td><dfn id="x0" title="dom-sqlerror-code-1">1</dfn></td>
<td>The statement failed for database reasons not covered by any
other error code.</td>
</tr>
<tr>
<td><dfn id="x1" title="dom-sqlerror-code-2">2</dfn></td>
<td>The statement failed because the <a href="#expected" title=
"concept-database-expected-version">expected version</a> of the
database didn't match the actual database version.</td>
</tr>
<tr>
<td><dfn id="x2" title="dom-sqlerror-code-3">3</dfn></td>
<td>The statement failed because the data returned from the
database was too large. The SQL "LIMIT" modifier might be useful to
reduce the size of the result set.</td>
</tr>
<tr>
<td><dfn id="x3" title="dom-sqlerror-code-4">4</dfn></td>
<td>The statement failed because there was not enough remaining
storage space, or the storage quota was reached and the user
declined to give more space to the database.</td>
</tr>
<tr>
<td><dfn id="x4" title="dom-sqlerror-code-5">5</dfn></td>
<td>The statement failed because the transaction's first statement
was a read-only statement, and a subsequent statement in the same
transaction tried to modify the database, but the transaction
failed to obtain a write lock before another transaction obtained a
write lock and changed a part of the database that the former
transaction was <del class="diff-old">dependending</del>
<ins class="diff-chg">depending</ins> upon.</td>
</tr>
<tr>
<td><dfn id="x5" title="dom-sqlerror-code-6">6</dfn></td>
<td>An <code title="">INSERT</code> , <code title="">UPDATE</code>
, or <code title="">REPLACE</code> statement failed due to a
constraint failure. For example, because a row was being inserted
and the value given for the primary key column duplicated the value
of an existing row.</td>
</tr>
</tbody>
</table>
<p class="big-issue">We should define a more thorough list of
codes. Implementation feedback is requested to determine what codes
are needed.</p>
<p>The <dfn id="message" title=
"dom-SQLError-message"><code>message</code></dfn> DOM attribute
must return an error message describing the error encountered. The
message should be <del class="diff-old">localised</del> <ins class=
"diff-chg">localized</ins> to the user's language.</p>
<h5 id="processing3"><span class="secno"><del class=
"diff-old">4.11.6.</del> <ins class=
"diff-chg">4.11.2.6.</ins></span> Processing model</h5>
<p>The <dfn id="transaction0">transaction steps</dfn> are as
follows. These steps must be run asynchronously. These steps are
invoked with a <i>transaction callback</i> , optionally an <i>error
callback</i> , optionally a <i>success callback</i> , optionally a
<i>preflight operation</i> , and optionally a <i>postflight
operation</i> .</p>
<ol>
<li>
<p>Open a new SQL transaction to the database, and create a
<code><a href="#sqltransaction">SQLTransaction</a></code> object
that represents that transaction.</p>
</li>
<li>
<p>If an error <del class="diff-old">occured</del> <ins class=
"diff-chg">occurred</ins> in the opening of the transaction, jump
to the last step.</p>
</li>
<li>
<p>If a <i>preflight operation</i> was defined for this instance of
the transaction steps, run that. If it fails, then jump to the last
step. (This is basically a hook for the <code title=
"dom-database-changeVersion"><a href=
"#changeversion">changeVersion()</a></code> method.)</p>
</li>
<li>
<p>Invoke the <i>transaction callback</i> with the aforementioned
<code><a href="#sqltransaction">SQLTransaction</a></code> object as
its only argument.</p>
</li>
<li>
<p>If the callback couldn't be called (e.g. it was null), or if the
callback was invoked and raised an exception, jump to the last
step.</p>
</li>
<li>
<p>While there are any statements queued up in the transaction,
perform the following steps for each queued up statement in the
transaction, oldest first. Each statement has a statement,
<ins class="diff-new">optionally</ins> a result set callback, and
optionally an error callback.</p>
<ol>
<li>
<p>If the statement is marked as bogus, jump to the "in case of
error" steps below.</p>
</li>
<li>
<p>Execute the statement in the context of the transaction.
<a href="#references">[SQL]</a></p>
</li>
<li>
<p>If the statement failed, jump to the "in case of error" steps
below.</p>
</li>
<li>
<p>Create a <code><a href="#sqlresultset">SQLResultSet</a></code>
object that represents the result of the statement.</p>
</li>
<li>
<p><del class="diff-old">Invoke</del> <ins class=
"diff-chg">If</ins> the <del class="diff-old">statement's</del>
<ins class="diff-chg">statement has a</ins> result set <del class=
"diff-old">callback</del> <ins class="diff-chg">callback, invoke
it</ins> with the <code><a href=
"#sqltransaction">SQLTransaction</a></code> object as its first
argument and the new <code><a href=
"#sqlresultset">SQLResultSet</a></code> object as its second
argument.</p>
</li>
<li>
<p>If the callback was invoked and raised an exception, jump to the
last step in the overall steps.</p>
</li>
<li>
<p>Move on to the next statement, if any, or onto the next overall
step otherwise.</p>
</li>
</ol>
<p>In case of error (or more specifically, if the above substeps
say to jump to the "in case of error" steps), run the following
substeps:</p>
<ol>
<li>
<p>If the statement had an associated error callback, then invoke
that error callback with the <code><a href=
"#sqltransaction">SQLTransaction</a></code> object and a newly
constructed <code><a href="#sqlerror">SQLError</a></code> object
that represents the error that caused these substeps to be run as
the two arguments, respectively.</p>
</li>
<li>
<p>If the error callback returns false, then move on to the next
statement, if any, or onto the next overall step otherwise.</p>
</li>
<li>
<p>Otherwise, the error callback did not return false, or there was
no error callback. Jump to the last step in the overall steps.</p>
</li>
</ol>
</li>
<li>
<p>If a <i>postflight operation</i> was defined for <del class=
"diff-old">his</del> <ins class="diff-chg">this</ins> instance of
the transaction steps, run that. If it fails, then jump to the last
step. (This is basically a hook for the <code title=
"dom-database-changeVersion"><a href=
"#changeversion">changeVersion()</a></code> method.)</p>
</li>
<li>
<p>Commit the transaction.</p>
</li>
<li>
<p>If an error <del class="diff-old">occured</del> <ins class=
"diff-chg">occurred</ins> in the committing of the transaction,
jump to the last step.</p>
</li>
<li>
<p>Invoke the <i>success callback</i> .</p>
</li>
<li>
<p>End these steps. The next step is only used when something goes
wrong.</p>
</li>
<li>
<p>Call the <i>error callback</i> with a newly constructed
<code><a href="#sqlerror">SQLError</a></code> object that
represents the last error to have <del class=
"diff-old">occured</del> <ins class="diff-chg">occurred</ins> in
this transaction. <del class="diff-old">If the error callback
returned false, and the last error wasn't itself a failure when
committing the transaction, then try to commit the transaction. If
that fails, or if the callback couldn't be called (e.g. the method
was called with only one argument), or if it didn't return false,
then rollback</del> <ins class="diff-chg">Rollback</ins> the
transaction. Any still-pending statements in the transaction are
discarded.</p>
</li>
</ol>
<h4 id="disk-space"><span class="secno"><ins class=
"diff-new">4.11.3</ins></span> <ins class="diff-new">Disk
space</ins></h4>
<p><ins class="diff-new">User agents should limit the total amount
of space allowed for storage areas and databases.</ins></p>
<p><ins class="diff-new">User agents should guard against sites
storing data in the storage areas or databases of subdomains, e.g.
storing up to the limit in a1.example.com, a2.example.com,
a3.example.com, etc, circumventing the main example.com storage
limit.</ins></p>
<p><ins class="diff-new">User agents may prompt the user when
quotas are reached, allowing the user to grant a site more space.
This enables sites to store many user-created documents on the
user's computer, for instance.</ins></p>
<p><ins class="diff-new">User agents should allow users to see how
much space each domain is using.</ins></p>
<p><ins class="diff-new">A mostly arbitrary limit of five megabytes
per domain is recommended. Implementation feedback is welcome and
will be used to update this suggestion in future.</ins></p>
<h4 id="privacy"><span class="secno"><del class=
"diff-old">4.11.7.</del> <ins class="diff-chg">4.11.4</ins></span>
Privacy</h4>
<h5 id="user-tracking"><span class="secno"><ins class=
"diff-new">4.11.4.1.</ins></span> <ins class="diff-new">User
tracking</ins></h5>
<p><ins class="diff-new">A third-party advertiser (or any entity
capable of getting content distributed to multiple sites) could use
a unique identifier stored in its local storage area or in its
client-side database to track a user across multiple sessions,
building a profile of the user's interests to allow for highly
targeted advertising.</ins> In <del class="diff-old">contrast</del>
<ins class="diff-chg">conjunction</ins> with <ins class=
"diff-new">a site that is aware of</ins> the <ins class=
"diff-chg">user's real identity (for example an e-commerce site
that requires authenticated credentials), this could allow
oppressive groups to target individuals with greater accuracy than
in a world with purely anonymous Web usage.</ins></p>
<p><ins class="diff-chg">There are a number of techniques that can
be used to mitigate the risk of user tracking:</ins></p>
<ul>
<li>
<p><ins class="diff-chg">Blocking third-party storage: user agents
may restrict access to the</ins> <code title=
"dom-localStorage"><del class="diff-old">globalStorage</del>
<a href="#localstorage"><ins class=
"diff-chg">localStorage</ins></a></code> <del class=
"diff-old">feature, which intentionally allows</del> <ins class=
"diff-chg">and database objects to scripts originating at the
domain of the top-level document of the</ins> <a href=
"#browsing1"><ins class="diff-chg">browsing context</ins></a>
,<ins class="diff-chg">for instance denying access to the API for
pages from other domains running in</ins> <code><a href=
"#iframe"><ins class="diff-chg">iframe</ins></a></code> <ins class=
"diff-chg">s.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Expiring stored data: user agents may
automatically delete stored data after a period of time.</ins></p>
<p><ins class="diff-chg">For example, a user agent could treat
third-party local storage areas as session-only storage, deleting
the</ins> data <ins class="diff-new">once the user had closed all
the</ins> <span><ins class="diff-new">browsing
contexts</ins></span> <ins class="diff-new">that could access
it.</ins></p>
<p><ins class="diff-new">This can restrict the ability of a
site</ins> to <ins class="diff-new">track a user, as the site would
then only</ins> be <del class="diff-old">accessed</del> <ins class=
"diff-chg">able to track the user</ins> across multiple <del class=
"diff-old">domains, protocols, and ports (albeit</del> <ins class=
"diff-chg">sessions when he authenticates with the site itself
(e.g. by making a purchase or logging</ins> in <ins class=
"diff-new">to</ins> a <del class="diff-old">controlled
fashion),</del> <ins class="diff-chg">service).</ins></p>
<p><ins class="diff-chg">However,</ins> this <ins class=
"diff-new">also puts the user's data at risk.</ins></p>
</li>
<li>
<p><ins class="diff-new">Treating persistent storage as cookies:
user agents should present the persistent storage and</ins>
database <del class="diff-old">feature is limited</del> <ins class=
"diff-chg">features</ins> to <del class="diff-old">scripts
running</del> <ins class="diff-chg">the user in a way that does not
distinguish them from HTTP session cookies.</ins> <a href=
"#references"><ins class="diff-chg">[RFC2965]</ins></a></p>
<p><ins class="diff-chg">This might encourage users to view
persistent storage</ins> with <ins class="diff-new">healthy
suspicion.</ins></p>
</li>
<li>
<p><ins class="diff-new">Site-specific white-listing of access to
local storage areas and databases: user agents may allow sites to
access session storage areas in an unrestricted manner, but
require</ins> the <del class="diff-old">same</del> <ins class=
"diff-chg">user to authorize access to local storage areas and
databases.</ins></p>
</li>
<li>
<p><a href="#origin0"><del class="diff-old">origin</del>
<ins class="diff-chg">Origin</ins></a> <del class=
"diff-old">as</del> <ins class="diff-chg">-tracking of persistent
storage data: user agents may record</ins> the <del class=
"diff-old">database. Thus, it is expected</del> <ins class=
"diff-chg">origins of sites</ins> that <del class="diff-old">the
privacy implications</del> <ins class="diff-chg">contained content
from third-party origins that caused data to</ins> be <del class=
"diff-old">equivalent</del> <ins class="diff-chg">stored.</ins></p>
<p><ins class="diff-chg">If this information is then used</ins> to
<del class="diff-old">those already</del> present <ins class=
"diff-new">the view of data currently</ins> in <del class=
"diff-old">allowing scripts</del> <ins class="diff-chg">persistent
storage, it would allow the user</ins> to <del class=
"diff-old">communicate</del> <ins class="diff-chg">make informed
decisions about which parts of the persistent storage to prune.
Combined</ins> with <del class="diff-old">their originating
host.</del> <ins class="diff-chg">a blacklist ("delete this data
and prevent this domain from ever storing data again"), the user
can restrict the use of persistent storage to sites that he
trusts.</ins></p>
</li>
<li>
<p><del class="diff-old">User</del> <ins class="diff-chg">Shared
blacklists: user</ins> agents <del class="diff-old">are
encouraged</del> <ins class="diff-chg">may allow users</ins> to
<del class="diff-old">treat</del> <ins class="diff-chg">share their
persistent storage domain blacklists.</ins></p>
<p><ins class="diff-chg">This would allow communities to act
together to protect their privacy.</ins></p>
</li>
</ul>
<p><ins class="diff-chg">While these suggestions prevent trivial
use of these APIs for user tracking, they do not block it
altogether. Within a single domain, a site can continue to track
the user during a session, and can then pass all this information
to the third party along with any identifying information (names,
credit card numbers, addresses) obtained by the site. If a third
party cooperates with multiple sites to obtain such information, a
profile can still be created.</ins></p>
<p><ins class="diff-chg">However, user tracking is to some extent
possible even with no cooperation from the user agent whatsoever,
for instance by using session identifiers in URIs, a technique
already commonly used for innocuous purposes but easily repurposed
for user tracking (even retroactively). This information can then
be shared with other sites, using using visitors' IP addresses and
other user-specific data (e.g. user-agent headers and configuration
settings) to combine separate sessions into coherent user
profiles.</ins></p>
<h5 id="cookie"><span class="secno"><ins class=
"diff-chg">4.11.4.2.</ins></span> <ins class="diff-chg">Cookie
resurrection</ins></h5>
<p><ins class="diff-chg">If the user interface for persistent
storage presents</ins> data <del class="diff-old">stored</del> in
<del class="diff-old">databases</del> <ins class="diff-chg">the
persistent storage features separately from data</ins> in
<ins class="diff-new">HTTP session cookies, then users are likely
to delete data in one and not</ins> the <del class="diff-old">same
way</del> <ins class="diff-chg">other. This would allow sites to
use the two features</ins> as <del class="diff-old">cookies</del>
<ins class="diff-chg">redundant backup</ins> for <del class=
"diff-old">the purposes</del> <ins class="diff-chg">each other,
defeating a user's attempts to protect his privacy.</ins></p>
<h4 id="security7"><span class="secno"><ins class=
"diff-chg">4.11.5</ins></span> <ins class=
"diff-chg">Security</ins></h4>
<h5 id="dns-spoofing"><span class="secno"><ins class=
"diff-chg">4.11.5.1.</ins></span> <ins class="diff-chg">DNS
spoofing attacks</ins></h5>
<p><ins class="diff-chg">Because</ins> of <del class=
"diff-old">user interfaces,</del> <ins class="diff-chg">the
potential for DNS spoofing attacks, one cannot guarantee that a
host claiming</ins> to <del class="diff-old">reduce</del>
<ins class="diff-chg">be in a certain domain really is from that
domain. To mitigate this, pages can use SSL. Pages using SSL can be
sure that only pages using SSL that have certificates identifying
them as being from</ins> the <del class="diff-old">risk</del>
<ins class="diff-chg">same domain can access their local storage
areas and databases.</ins></p>
<h5 id="cross-directory"><span class="secno"><ins class=
"diff-chg">4.11.5.2.</ins></span> <ins class=
"diff-chg">Cross-directory attacks</ins></h5>
<p><ins class="diff-chg">Different authors sharing one host name,
for example users hosting content on</ins> <code><ins class=
"diff-chg">geocities.com</ins></code> ,<ins class="diff-chg">all
share one persistent storage object and one set</ins> of
<del class="diff-old">using this</del> <ins class=
"diff-chg">databases. There is no</ins> feature <ins class=
"diff-new">to restrict the access by pathname. Authors on shared
hosts are therefore recommended to avoid using the persistent
storage features, as it would be trivial</ins> for <del class=
"diff-old">cookie resurrection.</del> <ins class="diff-chg">other
authors to read from and write to the same storage area or
database.</ins></p>
<p class="note"><ins class="diff-chg">Even if a path-restriction
feature was made available, the usual DOM scripting security model
would make it trivial to bypass this protection and access the data
from any path.</ins></p>
<h5 id="implementation"><span class="secno"><del class=
"diff-old">4.11.8.</del> <ins class=
"diff-chg">4.11.5.3.</ins></span> <del class=
"diff-old">Security</del> <ins class="diff-chg">Implementation
risks</ins></h5>
<p><ins class="diff-chg">The two primary risks when implementing
these persistent storage features are letting hostile sites read
information from other domains, and letting hostile sites write
information that is then read from other domains.</ins></p>
<p><ins class="diff-chg">Letting third-party sites read data that
is not supposed to be read from their domain causes</ins>
<em><ins class="diff-chg">information leakage</ins></em>
,<ins class="diff-chg">For example, a user's shopping wishlist on
one domain could be used by another domain for targeted
advertising; or a user's work-in-progress confidential documents
stored by a word-processing site could be examined by the site of a
competing company.</ins></p>
<p><ins class="diff-chg">Letting third-party sites write data to
the storage areas of other domains can result in</ins>
<em><ins class="diff-chg">information spoofing</ins></em>
,<ins class="diff-chg">which is equally dangerous. For example, a
hostile site could add items to a user's wishlist; or a hostile
site could set a user's session identifier to a known ID that the
hostile site can then use to track the user's actions on the victim
site.</ins></p>
<p><ins class="diff-chg">Thus, strictly following the</ins>
<a href="#origin0"><ins class="diff-chg">origin</ins></a>
<ins class="diff-chg">model described in this specification is
important for user security.</ins></p>
<h5 id="sql-and"><span class="secno"><del class=
"diff-old">4.11.8.1.</del> <ins class=
"diff-chg">4.11.5.4.</ins></span> <del class="diff-old">User</del>
<ins class="diff-chg">SQL and user</ins> agents</h5>
<p>User agent implementors are strongly encouraged to audit all
their supported SQL statements for security implications. For
example, <code title="">LOAD DATA INFILE</code> is likely to pose
security risks and there is little reason to support it.</p>
<p>In general, it is recommended that user agents not support
features that control how databases are stored on disk. For
example, there is little reason to allow Web authors to control the
character encoding used in the disk representation of the data, as
all data in ECMAScript is implicitly UTF-16.</p>
<h5 id="sql-injection"><span class="secno"><del class=
"diff-old">4.11.8.2.</del> <ins class=
"diff-chg">4.11.5.5.</ins></span> SQL injection</h5>
<p>Authors are strongly recommended to make use of the <code title=
"">?</code> placeholder feature of the <code title=
"dom-sqltransaction-executeSql"><a href=
"#executesql">executeSql()</a></code> method, and to never
construct SQL statements on the fly.</p>
<h3 id="links"><span class="secno"><del class=
"diff-old">4.12.</del> <ins class="diff-chg">4.12</ins></span>
Links</h3>
<h4 id="hyperlink"><span class="secno"><del class=
"diff-old">4.12.1.</del> <ins class="diff-chg">4.12.1</ins></span>
Hyperlink elements</h4>
<p>The <code><a href="#a">a</a></code> , <code><a href=
"#area">area</a></code> , and <code><a href="#link">link</a></code>
elements can, in certain situations described in the definitions of
those elements, represent <dfn id="hyperlinks" title=
"hyperlink">hyperlinks</dfn> .</p>
<p>The <dfn id="href6" title=
"attr-hyperlink-href"><code>href</code></dfn> attribute on a
hyperlink element must have a value that is a URI (or IRI). This
URI is the <em>destination resource</em> of the hyperlink.</p>
<div class="note">
<p>The <code title="attr-hyperlink-href"><a href=
"#href6">href</a></code> attribute on <code><a href=
"#a">a</a></code> and <code><a href="#area">area</a></code>
elements is not required; when those elements do not have
<code title="attr-hyperlink-href"><a href="#href6">href</a></code>
attributes they do not represent hyperlinks.</p>
<p>The <code title="attr-link-href"><a href=
"#href1">href</a></code> attribute on the <code><a href=
"#link">link</a></code> element <em>is</em> required, but whether a
<code><a href="#link">link</a></code> element represents a
hyperlink or not depends on the value of the <code title=
"attr-link-rel"><a href="#rel">rel</a></code> attribute of that
element.</p>
</div>
<p>The <dfn id="target3" title=
"attr-hyperlink-target"><code>target</code></dfn> attribute, if
present, must be a <a href="#valid9">valid browsing context name
<ins class="diff-new">or keyword</ins></a> . User agents use this
name when <a href="#following0">following hyperlinks</a> .</p>
<p>The <dfn id="ping" title=
"attr-hyperlink-ping"><code>ping</code></dfn> attribute, if
present, gives the URIs of the resources that are interested in
being notified if the user follows the hyperlink. The value must be
a space separated list of one or more URIs (or IRIs). The value is
used by the user agent when <a href="#following0">following
hyperlinks</a> .</p>
<p>For <code><a href="#a">a</a></code> and <code><a href=
"#area">area</a></code> elements that represent hyperlinks, the
relationship between the document containing the hyperlink and the
destination resource indicated by the hyperlink is given by the
value of the element's <dfn id="rel3" title=
"attr-hyperlink-rel"><code>rel</code></dfn> attribute, which must
be a <a href="#set-of">set of space-separated tokens</a> . The
<a href="#linkTypes">allowed values and their meanings</a> are
defined below. The <code title="attr-hyperlink-rel"><a href=
"#rel3">rel</a></code> attribute has no default value. If the
attribute is omitted or if none of the values in the attribute are
<del class="diff-old">recognised</del> <ins class=
"diff-chg">recognized</ins> by the UA, then the document has no
particular relationship with the destination resource other than
there being a hyperlink between the two.</p>
<p>The <dfn id="media12" title=
"attr-hyperlink-media"><code>media</code></dfn> attribute describes
for which media the target document was designed. It is purely
advisory. The value must be a valid <a href="#mq">media <del class=
"diff-old">query.</del> <ins class="diff-chg">query</ins></a> .
<a href="#references">[MQ]</a> The default, if the <code title=
"attr-hyperlink-media"><a href="#media12">media</a></code>
attribute is omitted, is <code>all</code> .</p>
<p>The <dfn id="hreflang3" title=
"attr-hyperlink-hreflang"><code>hreflang</code></dfn> attribute on
hyperlink elements, if present, gives the language of the linked
resource. It is purely advisory. The value must be a valid RFC 3066
language code. <a href="#references">[RFC3066]</a> User agents must
not consider this attribute authoritative — upon fetching the
resource, user agents must <del class="diff-old">only</del> use
<ins class="diff-new">only</ins> language information associated
with the resource to determine its language, not metadata included
in the link to the resource.</p>
<p>The <dfn id="type17" title=
"attr-hyperlink-type"><code>type</code></dfn> attribute, if
present, gives the MIME type of the linked resource. It is purely
advisory. The value must be a valid MIME type, optionally with
parameters. <a href="#references">[RFC2046]</a> User agents must
not consider the <code title="attr-hyperlink-type"><a href=
"#type17">type</a></code> attribute authoritative — upon fetching
the resource, user agents must not use metadata included in the
link to the resource to determine its type.</p>
<h4 id="following"><span class="secno"><del class=
"diff-old">4.12.2.</del> <ins class="diff-chg">4.12.2</ins></span>
<dfn id="following0">Following hyperlinks</dfn></h4>
<p>When a user <em>follows a hyperlink</em> , the user agent must
<a href="#navigate">navigate</a> a <a href="#browsing1">browsing
context</a> to the URI of the hyperlink.</p>
<p>The URI of the hyperlink is URI given by resolving the
<del class="diff-old">the</del> <code title=
"attr-hyperlink-href"><a href="#href6">href</a></code> attribute of
that hyperlink relative to the hyperlink's element. In the case of
server-side image maps, the URI of the hyperlink must further have
its <var><a href="#hyperlink2">hyperlink suffix</a></var> appended
to it.</p>
<p>If the user indicated a specific browsing context when following
the hyperlink, or if the user agent is configured to follow
hyperlinks by navigating a particular browsing context, then that
must be the browsing context that is navigated.</p>
<p>Otherwise, if the hyperlink element is an <code><a href=
"#a">a</a></code> or <code><a href="#area">area</a></code> element
that has a <code title="attr-hyperlink-target"><a href=
"#target3">target</a></code> attribute, then the browsing context
that is navigated must be chosen by applying <a href=
"#the-rules">the rules for <del class="diff-old">chosing</del>
<ins class="diff-chg">choosing</ins> a browsing context given a
browsing context name</a> , using the value of the <code title=
"attr-hyperlink-target"><a href="#target3">target</a></code>
attribute as the browsing context name. If these rules result in
the creation of a new <a href="#browsing1">browsing context</a> ,
it must be navigated with <a href="#replacement">replacement
enabled</a> .</p>
<p>Otherwise, if the hyperlink element is a <a href="#sidebar0"
title="rel-sidebar-hyperlink">sidebar hyperlink</a> and the user
agent implements a feature that can be considered a secondary
browsing context, such a secondary browsing context may be selected
as the browsing context to be navigated.</p>
<p>Otherwise, if the hyperlink element is an <code><a href=
"#a">a</a></code> or <code><a href="#area">area</a></code> element
with no <code title="attr-hyperlink-target"><a href=
"#target3">target</a></code> attribute, but one of the child nodes
of <a href="#the-head0">the <code>head</code> element</a> is a
<code><a href="#base">base</a></code> element with a <code title=
"attr-base-target"><a href="#target">target</a></code> attribute,
then the browsing context that is navigated must be chosen by
applying <a href="#the-rules">the rules for <del class=
"diff-old">chosing</del> <ins class="diff-chg">choosing</ins> a
browsing context given a browsing context name</a> , using the
value of the <code title="attr-base-target"><a href=
"#target">target</a></code> attribute of the first such
<code><a href="#base">base</a></code> element as the browsing
context name. If these rules result in the creation of a new
<a href="#browsing1">browsing context</a> , it must be navigated
with <a href="#replacement">replacement enabled</a> .</p>
<p>Otherwise, the browsing context that must be navigated is the
same browsing context as the one which the hyperlink element itself
is in.</p>
<p><ins class="diff-new">The navigation must be done with the</ins>
<a href="#browsing1"><ins class="diff-new">browsing
context</ins></a> <ins class="diff-new">that contains the</ins>
<code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">object with which the hyperlink's element in question is
associated as the</ins> <a href="#source0"><ins class=
"diff-new">source browsing context</ins></a> .</p>
<h5 id="hyperlink0"><span class="secno">4.12.2.1.</span> Hyperlink
auditing</h5>
<p>If an <code><a href="#a">a</a></code> or <code><a href=
"#area">area</a></code> hyperlink element has a <code title=
"attr-hyperlink-ping"><a href="#ping">ping</a></code> attribute and
the user follows the hyperlink, the user agent must take the
<code title="attr-hyperlink-ping"><a href="#ping">ping</a></code>
attribute's value, <span title="split the string on spaces">split
that string on spaces</span> , treat each resulting token as a URI
(resolving relative URIs according to <a href=
"#elements2">element's base <del class="diff-old">URI)</del>
<ins class="diff-chg">URI</ins></a> <ins class="diff-chg">)</ins>
and then should send a request <ins class="diff-new">(as described
below)</ins> to each of the resulting URIs. This may be done in
parallel with the primary request, and is independent of the result
of that request.</p>
<p>User agents should allow the user to adjust this <del class=
"diff-old">behaviour,</del> <ins class="diff-chg">behavior,</ins>
for example in conjunction with a setting that disables the sending
of HTTP <code title="">Referer</code> headers. Based on the user's
preferences, UAs may either <a href="#ignored">ignore</a> the
<code title="attr-hyperlink-ping"><a href="#ping">ping</a></code>
attribute altogether, or selectively ignore URIs in the list (e.g.
ignoring any third-party URIs).</p>
<p>For URIs that are HTTP URIs, the requests must be performed
using the POST method (with an empty entity body in the request).
<ins class="diff-new">All relevant cookie and HTTP authentication
headers must be included in the request. Which other headers are
required depends on the URIs involved.</ins></p>
<dl class="switch">
<dt><ins class="diff-new">If both the URI of the</ins>
<code><ins class="diff-new">Document</ins></code> <ins class=
"diff-new">object containing the hyperlink being audited and the
ping URI have the</ins> <a href="#same-origin"><ins class=
"diff-new">same origin</ins></a></dt>
<dd><ins class="diff-new">The request must include a</ins>
<code title=""><ins class="diff-new">Ping-From</ins></code>
<ins class="diff-new">HTTP header with, as its value, the location
of the document containing the hyperlink, and a</ins> <code title=
""><ins class="diff-new">Ping-To</ins></code> <ins class=
"diff-new">HTTP header with, as its value, the address of the
target of the hyperlink. The request must not include a</ins>
<code title=""><ins class="diff-new">Referer</ins></code>
<ins class="diff-new">HTTP header.</ins></dd>
<dt><ins class="diff-new">Otherwise, if the origins are different,
but the document containing the hyperlink being audited was not
retrieved over an encrypted connection</ins></dt>
<dd><ins class="diff-new">The request must include a</ins>
<code title=""><ins class="diff-new">Referer</ins></code>
<ins class="diff-new">HTTP header [sic] with, as its value, the
location of the document containing the hyperlink, a</ins>
<code title=""><ins class="diff-new">Ping-From</ins></code>
<ins class="diff-new">HTTP header with the same value, and a</ins>
<code title=""><ins class="diff-new">Ping-To</ins></code>
<ins class="diff-new">HTTP header with, as its value, the address
of the target of the hyperlink.</ins></dd>
<dt><ins class="diff-new">Otherwise, the origins are different and
the document containing the hyperlink being audited was retrieved
over an encrypted connection</ins></dt>
<dd><ins class="diff-new">The request must include a</ins>
<code title=""><ins class="diff-new">Ping-To</ins></code>
<ins class="diff-new">HTTP header with, as its value, the address
of the target of the hyperlink. The request must neither include
a</ins> <code title=""><ins class="diff-new">Referer</ins></code>
<ins class="diff-new">HTTP header nor include a</ins> <code title=
""><ins class="diff-new">Ping-From</ins></code> <ins class=
"diff-new">HTTP header.</ins></dd>
</dl>
<p class="note"><ins class="diff-new">To save bandwidth,
implementors might also wish to consider omitting optional headers
such as</ins> <code><ins class="diff-new">Accept</ins></code>
<ins class="diff-new">from these requests.</ins></p>
<p>User agents must ignore any entity bodies returned in the
responses, but must, unless otherwise specified by the user,
<del class="diff-old">honour</del> <ins class=
"diff-chg">honor</ins> the HTTP headers <del class=
"diff-old">—</del> <ins class="diff-chg">(including,</ins> in
particular, <ins class="diff-new">redirects and</ins> HTTP cookie
<del class="diff-old">headers.</del> <ins class=
"diff-chg">headers).</ins> <a href="#references">[RFC2965]</a>
<del class="diff-old">To save bandwidth, implementors might wish to
consider omitting optional headers such as Accept from these
requests.</del></p>
<p>When the <code title="attr-hyperlink-ping"><a href=
"#ping">ping</a></code> attribute is present, user agents should
clearly indicate to the user that following the hyperlink will also
cause secondary requests to be sent in the background, possibly
including listing the actual target URIs.</p>
<div class="note">
<p>The <code title="attr-hyperlink-ping"><a href=
"#ping">ping</a></code> attribute is redundant with pre-existing
technologies like HTTP redirects and JavaScript in allowing Web
pages to track which off-site links are most popular or allowing
advertisers to track click-through rates.</p>
<p>However, the <code title="attr-hyperlink-ping"><a href=
"#ping">ping</a></code> attribute provides these advantages to the
user over those alternatives:</p>
<ul>
<li>It allows the user to see the final target URI unobscured.</li>
<li>It allows the UA to inform the user about the out-of-band
notifications.</li>
<li>It allows the paranoid user to disable the notifications
without losing the underlying link functionality.</li>
<li>It allows the UA to <del class="diff-old">optimise</del>
<ins class="diff-chg">optimize</ins> the use of available network
bandwidth so that the target page loads faster.</li>
</ul>
<p>Thus, while it is possible to track users without this feature,
authors are encouraged to use the <code title=
"attr-hyperlink-ping"><a href="#ping">ping</a></code> attribute so
that the user agent can improve the user experience.</p>
</div>
<h4 id="linkTypes"><span class="secno"><del class=
"diff-old">4.12.3.</del> <ins class="diff-chg">4.12.3</ins></span>
Link types</h4>
<p>The following table <del class="diff-old">summarises</del>
<ins class="diff-chg">summarizes</ins> the link types that are
defined by this specification. This table is non-normative; the
actual definitions for the link types are given in the next few
sections.</p>
<p>In this section, the term <em>referenced document</em> refers to
the resource identified by the element representing the link, and
the term <em>current document</em> refers to the resource within
which the element representing the link finds itself.</p>
<p>To determine which link types apply to a <code><a href=
"#link">link</a></code> , <code><a href="#a">a</a></code> , or
<code><a href="#area">area</a></code> element, the element's
<code title="">rel</code> attribute must be <a href="#split" title=
"split a string on spaces">split on spaces</a> . The resulting
tokens are the link types that apply to that element.</p>
<p>Unless otherwise specified, a keyword must not be specified more
than once per <code title="attr-rel-hyperlink">rel</code>
attribute.</p>
<table>
<thead>
<tr>
<th rowspan="2">Link type</th>
<th colspan="2">Effect on...</th>
<th rowspan="2">Brief description</th>
</tr>
<tr>
<th><code><a href="#link">link</a></code></th>
<th><code><a href="#a">a</a></code> and <code><a href=
"#area">area</a></code></th>
</tr>
</thead>
<tbody>
<tr>
<td><code title="rel-alternate"><a href=
"#alternate">alternate</a></code></td>
<td><a href="#hyperlink1" title="hyperlink link">Hyperlink</a></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Gives alternate representations of the current document.</td>
</tr>
<tr>
<td><code title="rel-archives"><a href=
"#archives">archives</a></code></td>
<td><a href="#hyperlink1" title="hyperlink link">Hyperlink</a></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Provides a link to a collection of records, documents, or other
materials of historical interest.</td>
</tr>
<tr>
<td><code title="rel-author"><a href=
"#author">author</a></code></td>
<td><a href="#hyperlink1" title="hyperlink link">Hyperlink</a></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Gives a link to the current document's author.</td>
</tr>
<tr>
<td><code title="rel-bookmark"><a href=
"#bookmark">bookmark</a></code></td>
<td><em>not allowed</em></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Gives the permalink for the nearest ancestor section.
<del class="diff-old">contact Hyperlink Hyperlink Gives a link to
contact information for the current document.</del></td>
</tr>
<tr>
<td><code title="rel-external"><a href=
"#external">external</a></code></td>
<td><em>not allowed</em></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Indicates that the referenced document is not part of the same
site as the current document.</td>
</tr>
<tr>
<td><code title="rel-feed"><a href="#feed">feed</a></code></td>
<td><a href="#hyperlink1" title="hyperlink link">Hyperlink</a></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Gives the address of a syndication feed for the current
document.</td>
</tr>
<tr>
<td><code title="rel-first"><a href="#first">first</a></code></td>
<td><a href="#hyperlink1" title="hyperlink link">Hyperlink</a></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Indicates that the current document is a part of a series, and
that the first document in the series is the referenced
document.</td>
</tr>
<tr>
<td><code title="rel-help"><a href="#help">help</a></code></td>
<td><a href="#hyperlink1" title="hyperlink link">Hyperlink</a></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Provides a link to context-sensitive help.</td>
</tr>
<tr>
<td><code title="rel-icon"><a href="#icon3">icon</a></code></td>
<td><a href="#links1" title="external resource link">External
Resource</a></td>
<td><em>not allowed</em></td>
<td>Imports an icon to represent the current document.</td>
</tr>
<tr>
<td><code title="rel-index"><a href="#index0">index</a></code></td>
<td><a href="#hyperlink1" title="hyperlink link">Hyperlink</a></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Gives a link to the document that provides a table of contents
or index listing the current document.</td>
</tr>
<tr>
<td><code title="rel-last"><a href="#last">last</a></code></td>
<td><a href="#hyperlink1" title="hyperlink link">Hyperlink</a></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Indicates that the current document is a part of a series, and
that the last document in the series is the referenced
document.</td>
</tr>
<tr>
<td><code title="rel-license"><a href=
"#license">license</a></code></td>
<td><a href="#hyperlink1" title="hyperlink link">Hyperlink</a></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Indicates that the current document is covered by the copyright
license described by the referenced document.</td>
</tr>
<tr>
<td><code title="rel-next"><a href="#next">next</a></code></td>
<td><a href="#hyperlink1" title="hyperlink link">Hyperlink</a></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Indicates that the current document is a part of a series, and
that the next document in the series is the referenced
document.</td>
</tr>
<tr>
<td><code title="rel-nofollow"><a href=
"#nofollow">nofollow</a></code></td>
<td><em>not allowed</em></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Indicates that the current document's original author or
publisher does not endorse the referenced document.</td>
</tr>
<tr>
<td><code title="rel-noreferrer"><a href=
"#noreferrer">noreferrer</a></code></td>
<td><em>not allowed</em></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Requires that the user agent not send an HTTP <code title=
"">Referer</code> header if the user follows the hyperlink.</td>
</tr>
<tr>
<td><code title="rel-pingback"><a href=
"#pingback">pingback</a></code></td>
<td><a href="#links1" title="external resource link">External
Resource</a></td>
<td><em>not allowed</em></td>
<td>Gives the address of the pingback server that handles pingbacks
to the current document.</td>
</tr>
<tr>
<td><code title="rel-prefetch"><a href=
"#prefetch">prefetch</a></code></td>
<td><a href="#links1" title="external resource link">External
Resource</a></td>
<td><em>not allowed</em></td>
<td>Specifies that the target resource should be <del class=
"diff-old">pre-emptively</del> <ins class=
"diff-chg">preemptively</ins> cached.</td>
</tr>
<tr>
<td><code title="rel-prev"><a href="#prev">prev</a></code></td>
<td><a href="#hyperlink1" title="hyperlink link">Hyperlink</a></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Indicates that the current document is a part of a series, and
that the previous document in the series is the referenced
document.</td>
</tr>
<tr>
<td><code title="rel-search"><a href=
"#search0">search</a></code></td>
<td><a href="#hyperlink1" title="hyperlink link">Hyperlink</a></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Gives a link to a resource that can be used to search through
the current document and its related pages.</td>
</tr>
<tr>
<td><code title="rel-stylesheet"><a href=
"#stylesheet">stylesheet</a></code></td>
<td><a href="#links1" title="external resource link">External
Resource</a></td>
<td><em>not allowed</em></td>
<td>Imports a stylesheet.</td>
</tr>
<tr>
<td><code title="rel-sidebar"><a href=
"#sidebar">sidebar</a></code></td>
<td><a href="#hyperlink1" title="hyperlink link">Hyperlink</a></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Specifies that the referenced document, if retrieved, is
intended to be shown in the browser's sidebar (if it has one).</td>
</tr>
<tr>
<td><code title="rel-tag"><a href="#tag">tag</a></code></td>
<td><a href="#hyperlink1" title="hyperlink link">Hyperlink</a></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Gives a tag (identified by the given address) that applies to
the current document.</td>
</tr>
<tr>
<td><code title="rel-up"><a href="#up">up</a></code></td>
<td><a href="#hyperlink1" title="hyperlink link">Hyperlink</a></td>
<td><a href="#hyperlinks">Hyperlink</a></td>
<td>Provides a link to a document giving the context for the
current document.</td>
</tr>
</tbody>
</table>
<p>Some of the types described below list synonyms for these
values. These are to be handled as specified by user agents, but
must not be used in documents.</p>
<h5 id="link-type"><span class="secno">4.12.3.1.</span> Link type "
<dfn id="alternate" title=
"rel-alternate"><code>alternate</code></dfn> "</h5>
<p>The <code title="rel-alternate"><a href=
"#alternate">alternate</a></code> keyword may be used with
<code><a href="#link">link</a></code> , <code><a href=
"#a">a</a></code> , and <code><a href="#area">area</a></code>
elements. For <code><a href="#link">link</a></code> elements, if
the <code title="attr-link-rel"><a href="#rel">rel</a></code>
attribute does not also contain the keyword <code title=
"rel-stylesheet"><a href="#stylesheet">stylesheet</a></code> , it
creates a <a href="#hyperlink1" title=
"hyperlink link">hyperlink</a> ; but if it <em>does</em> also
<del class="diff-old">contains</del> <ins class=
"diff-chg">contain</ins> the keyword <code title=
"rel-stylesheet"><a href="#stylesheet">stylesheet</a></code> , the
<code title="rel-alternate"><a href=
"#alternate">alternate</a></code> keyword instead modifies the
meaning of the <code title="rel-stylesheet"><a href=
"#stylesheet">stylesheet</a></code> keyword in the way described
for that keyword, and the rest of this subsection doesn't
apply.</p>
<p>The <code title="rel-alternate"><a href=
"#alternate">alternate</a></code> keyword indicates that the
referenced document is an alternate representation of the current
document.</p>
<p>The nature of the referenced document is given by the
<code title="attr-hyperlink-media"><a href=
"#media12">media</a></code> , <code title=
"attr-hyperlink-hreflang"><a href="#hreflang3">hreflang</a></code>
, and <code title="attr-hyperlink-type"><a href=
"#type17">type</a></code> attributes.</p>
<p>If the <code title="rel-alternate"><a href=
"#alternate">alternate</a></code> keyword is used with the
<code title="attr-hyperlink-media"><a href=
"#media12">media</a></code> attribute, it indicates that the
referenced document is intended for use with the media
specified.</p>
<p>If the <code title="rel-alternate"><a href=
"#alternate">alternate</a></code> keyword is used with the
<code title="attr-hyperlink-hreflang"><a href=
"#hreflang3">hreflang</a></code> attribute, and that attribute's
value differs from the <a href="#root-element">root element</a> 's
<a href="#language">language</a> , it indicates that the referenced
document is a translation.</p>
<p>If the <code title="rel-alternate"><a href=
"#alternate">alternate</a></code> keyword is used with the
<code title="attr-hyperlink-type"><a href="#type17">type</a></code>
attribute, it indicates that the referenced document is a
reformulation of the current document in the specified format.</p>
<p>The <code title="attr-hyperlink-media"><a href=
"#media12">media</a></code> , <code title=
"attr-hyperlink-hreflang"><a href="#hreflang3">hreflang</a></code>
, and <code title="attr-hyperlink-type"><a href=
"#type17">type</a></code> attributes can be combined when specified
with the <code title="rel-alternate"><a href=
"#alternate">alternate</a></code> keyword.</p>
<div class="example">
<p>For example, the following link is a French translation that
uses the PDF format:</p>
<pre>
<link
rel=alternate
type=application/pdf
hreflang=fr
href=manual-fr>
</pre></div>
<p>If the <code title="rel-alternate"><a href=
"#alternate">alternate</a></code> keyword is used with the
<code title="attr-hyperlink-type"><a href="#type17">type</a></code>
attribute set to the value <code title=
"">application/rss+xml</code> or the value <code title=
"">application/atom+xml</code> , then the user agent must treat the
link as it would if it had the <code title="rel-feed"><a href=
"#feed">feed</a></code> keyword specified as well.</p>
<p>The <code title="rel-alternate"><a href=
"#alternate">alternate</a></code> link relationship is transitive —
that is, if a document links to two other documents with the link
type " <code title="rel-alternate"><a href=
"#alternate">alternate</a></code> ", then, in addition to implying
that those documents are alternative representations of the first
document, it is also implying that those two documents are
alternative representations of each other.</p>
<h5 id="link-type0"><span class="secno">4.12.3.2.</span> Link type
" <dfn id="archives" title=
"rel-archives"><code>archives</code></dfn> "</h5>
<p>The <code title="rel-archives"><a href=
"#archives">archives</a></code> keyword may be used with
<code><a href="#link">link</a></code> , <code><a href=
"#a">a</a></code> , and <code><a href="#area">area</a></code>
elements. For <code><a href="#link">link</a></code> elements, it
creates a <a href="#hyperlink1" title=
"hyperlink link">hyperlink</a> .</p>
<p>The <code title="rel-archives"><a href=
"#archives">archives</a></code> keyword indicates that the
referenced document describes a collection of records, documents,
or other materials of historical interest.</p>
<p class="example">A blog's index page could link to an index of
the blog's past posts with <code title="">rel="archives"</code>
.</p>
<p><strong>Synonyms</strong> : For historical reasons, user agents
must also treat the keyword " <code title="">archive</code> " like
the <code title="rel-archives"><a href=
"#archives">archives</a></code> keyword.</p>
<h5 id="link-type1"><span class="secno">4.12.3.3.</span> Link type
" <dfn id="author" title="rel-author"><code>author</code></dfn>
"</h5>
<p>The <code title="rel-author"><a href="#author">author</a></code>
keyword may be used with <code><a href="#link">link</a></code> ,
<code><a href="#a">a</a></code> , and <code><a href=
"#area">area</a></code> elements. For <code><a href=
"#link">link</a></code> elements, it creates a <a href=
"#hyperlink1" title="hyperlink link">hyperlink</a> .</p>
<p>For <code><a href="#a">a</a></code> and <code><a href=
"#area">area</a></code> elements, the <code title=
"rel-author"><a href="#author">author</a></code> keyword indicates
that the referenced document provides further information about the
author of the section that the element defining the hyperlink
<a href="#applyToSection">applies</a> to.</p>
<p>For <code><a href="#link">link</a></code> elements, the
<code title="rel-author"><a href="#author">author</a></code>
keyword indicates that the referenced document provides further
information about the author for the page as a whole.</p>
<p class="note">The "referenced document" can be, and often is, a
<code title="">mailto:</code> URI giving the e-mail address of the
author. <a href="#references">[MAILTO]</a></p>
<p><strong>Synonyms</strong> : For historical reasons, user agents
must also treat <code><a href="#link">link</a></code> ,
<code><a href="#a">a</a></code> , and <code><a href=
"#area">area</a></code> elements that have a <code title=
"">rev</code> attribute with the value " <code>made</code> " as
having the <code title="rel-author"><a href=
"#author">author</a></code> keyword specified as a link
relationship.</p>
<h5 id="link-type2"><span class="secno">4.12.3.4.</span> Link type
" <dfn id="bookmark" title=
"rel-bookmark"><code>bookmark</code></dfn> "</h5>
<p>The <code title="rel-bookmark"><a href=
"#bookmark">bookmark</a></code> keyword may be used with
<code><a href="#a">a</a></code> and <code><a href=
"#area">area</a></code> elements.</p>
<p>The <code title="rel-bookmark"><a href=
"#bookmark">bookmark</a></code> keyword gives a permalink for the
nearest ancestor <code><a href="#article">article</a></code>
element of the linking element in question, or of <a href=
"#associatedSection">the section the linking element is most
closely associated with</a> , if there are no ancestor
<code><a href="#article">article</a></code> elements.</p>
<div class="example">
<p>The following snippet has three permalinks. A user agent could
determine which permalink applies to which part of the spec by
looking at where the permalinks are given.</p>
<pre>
...
<body>
<h1>Example of permalinks</h1>
<div id="a">
<h2>First example</h2>
<p><a href="a.html" rel="bookmark">This</a> permalink applies to
only the content from the first H2 to the second H2. The DIV isn't
exactly that section, but it roughly corresponds to it.</p>
</div>
<h2>Second example</h2>
<article id="b">
<p><a href="b.html" rel="bookmark">This</a> permalink applies to
the outer ARTICLE element (which could be, e.g., a blog post).</p>
<article id="c">
<p><a href="c.html" rel="bookmark">This</a> permalink applies to
the inner ARTICLE element (which could be, e.g., a blog comment).</p>
</article>
</article>
</body>
...
</pre></div>
<h5 id="link-type3"><span class="secno">4.12.3.5.</span> Link type
" <del class="diff-old">contact " The contact keyword may be used
with link , a , and area elements. For link elements, it creates a
hyperlink . For a and area elements, the contact keyword indicates
that the referenced document provides further contact information
for the section that the element defining the hyperlink applies to.
User agents must treat any hyperlink in an address element as
having the contact link type specified. For link elements, the
contact keyword indicates that the referenced document provides
further contact information for the page as a whole. 4.12.3.6. Link
type "</del> <dfn id="external" title=
"rel-external"><code>external</code></dfn> "</h5>
<p>The <code title="rel-external"><a href=
"#external">external</a></code> keyword may be used with
<code><a href="#a">a</a></code> and <code><a href=
"#area">area</a></code> elements.</p>
<p>The <code title="rel-external"><a href=
"#external">external</a></code> keyword indicates that the link is
leading to a document that is not part of the site that the current
document forms a part of.</p>
<h5 id="link-type4"><span class="secno"><del class=
"diff-old">4.12.3.7.</del> <ins class=
"diff-chg">4.12.3.6.</ins></span> Link type " <dfn id="feed" title=
"rel-feed"><code>feed</code></dfn> "</h5>
<p>The <code title="rel-feed"><a href="#feed">feed</a></code>
keyword may be used with <code><a href="#link">link</a></code> ,
<code><a href="#a">a</a></code> , and <code><a href=
"#area">area</a></code> elements. For <code><a href=
"#link">link</a></code> elements, it creates a <a href=
"#hyperlink1" title="hyperlink link">hyperlink</a> .</p>
<p>The <code title="rel-feed"><a href="#feed">feed</a></code>
keyword indicates that the referenced document is a syndication
feed. If the <code title="rel-alternate"><a href=
"#alternate">alternate</a></code> link type is also specified, then
the feed is specifically the feed for the current document;
otherwise, the feed is just a syndication feed, not necessarily
associated with a particular Web page.</p>
<p>The first <code><a href="#link">link</a></code> , <code><a href=
"#a">a</a></code> , or <code><a href="#area">area</a></code>
element in the document (in tree order) that creates a hyperlink
with the link type <code title="rel-feed"><a href=
"#feed">feed</a></code> must be treated as the default syndication
feed for the purposes of feed autodiscovery.</p>
<p class="note">The <code title="rel-feed"><a href=
"#feed">feed</a></code> keyword is implied by the <code title=
"rel-alternate"><a href="#alternate">alternate</a></code> link type
in certain cases (q.v.).</p>
<div class="example">
<p>The following two <code><a href="#link">link</a></code> elements
are equivalent: both give the syndication feed for the current
page:</p>
<pre>
<link
rel="alternate"
type="application/atom+xml"
href="data.xml">
</pre>
<pre>
<link
rel="feed
alternate"
href="data.xml">
</pre>
<p>The following extract offers various different syndication
feeds:</p>
<pre>
<p>You can access the planets database using Atom feeds:</p>
<ul>
<li><a href="recently-visited-planets.xml" rel="feed">Recently Visited Planets</a></li>
<li><a href="known-bad-planets.xml" rel="feed">Known Bad Planets</a></li>
<li><a href="unexplored-planets.xml" rel="feed">Unexplored Planets</a></li>
</ul>
</pre></div>
<h5 id="link-type5"><span class="secno"><del class=
"diff-old">4.12.3.8.</del> <ins class=
"diff-chg">4.12.3.7.</ins></span> Link type " <dfn id="help" title=
"rel-help"><code>help</code></dfn> "</h5>
<p>The <code title="rel-help"><a href="#help">help</a></code>
keyword may be used with <code><a href="#link">link</a></code> ,
<code><a href="#a">a</a></code> , and <code><a href=
"#area">area</a></code> elements. For <code><a href=
"#link">link</a></code> elements, it creates a <a href=
"#hyperlink1" title="hyperlink link">hyperlink</a> .</p>
<p>For <code><a href="#a">a</a></code> and <code><a href=
"#area">area</a></code> elements, the <code title=
"rel-help"><a href="#help">help</a></code> keyword indicates that
the referenced document provides further help information for the
parent of the element defining the hyperlink, and its children.</p>
<div class="example">
<p>In the following example, the form control has associated
context-sensitive help. The user agent could use this information,
for example, displaying the referenced document if the user presses
the "Help" or "F1" key.</p>
<pre>
<p>
<label>
Topic:
<input
name=topic>
<a
href="help/topic.html"
rel="help">
(Help)</a>
</label>
</p>
</pre></div>
<p>For <code><a href="#link">link</a></code> elements, the
<code title="rel-help"><a href="#help">help</a></code> keyword
indicates that the referenced document provides help for the page
as a whole.</p>
<h5 id="rel-icon"><span class="secno"><del class=
"diff-old">4.12.3.9.</del> <ins class=
"diff-chg">4.12.3.8.</ins></span> Link type " <dfn id="icon3"
title="rel-icon"><code>icon</code></dfn> "</h5>
<p>The <code title="rel-icon"><a href="#icon3">icon</a></code>
keyword may be used with <code><a href="#link">link</a></code>
elements, for which it creates an <a href="#links1" title=
"external resource link">external resource link</a> .</p>
<p>The specified resource is an icon representing the page or site,
and should be used by the user agent when representing the page in
the user interface.</p>
<p>Icons could be auditory icons, visual icons, or other kinds of
icons. If multiple icons are provided, the user agent must select
the most appropriate icon according to the <code title=
"attr-link-type"><a href="#type"><ins class=
"diff-new">type</ins></a></code> , <code title=
"attr-link-media"><a href="#media0">media</a></code> , <ins class=
"diff-new">and</ins> <code title="attr-link-sizes"><a href=
"#sizes0"><ins class="diff-new">sizes</ins></a></code> <ins class=
"diff-new">attributes. If there are multiple equally appropriate
icons, user agents must use the last one declared in</ins> <a href=
"#tree-order"><ins class="diff-new">tree order</ins></a>
.<ins class="diff-new">If the user agent tries to use an icon but
that icon is determined, upon closer examination, to in fact be
inappropriate (e.g. because it uses an unsupported format), then
the user agent must try the next-most-appropriate icon as
determined by the attributes.</ins></p>
<p><ins class="diff-new">There is no default type for resources
given by the</ins> <code title="rel-icon"><a href=
"#icon3"><ins class="diff-new">icon</ins></a></code> <ins class=
"diff-new">keyword.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="sizes0" title=
"attr-link-sizes"><code><ins class=
"diff-new">sizes</ins></code></dfn> <ins class="diff-new">attribute
gives the sizes of icons for visual media.</ins></p>
<p><ins class="diff-new">If specified, the attribute must have a
value that is an</ins> <a href="#unordered"><ins class=
"diff-new">unordered set of unique space-separated tokens</ins></a>
.<ins class="diff-new">The values must all be either</ins>
<code title="attr-link-sizes-any"><a href="#any"><ins class=
"diff-new">any</ins></a></code> <ins class="diff-new">or a value
that consists of two</ins> <a href="#valid" title=
"valid non-negative integer"><ins class="diff-new">valid
non-negative integers</ins></a> <ins class="diff-new">that do not
have a leading U+0030 DIGIT ZERO (0) character and that are
separated by a single U+0078 LATIN SMALL LETTER X
character.</ins></p>
<p><ins class="diff-new">The keywords represent icon
sizes.</ins></p>
<p><ins class="diff-new">To parse and process the attribute's
value, the user agent must first</ins> <a href="#split" title=
"split a string on spaces"><ins class="diff-new">split the
attribute's value on spaces</ins></a> ,<ins class="diff-new">and
must then parse each resulting keyword to determine what it
represents.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="any" title=
"attr-link-sizes-any"><code><ins class="diff-new">any</ins></code>
<del class="diff-old">attribute.</del></dfn> <ins class=
"diff-chg">keyword represents that the resource contains a scalable
icon, e.g. as provided by an SVG image.</ins></p>
<p><ins class="diff-chg">Other keywords must be further parsed as
follows to determine what they represent:</ins></p>
<ul>
<li>
<p><ins class="diff-chg">If the keyword doesn't contain exactly one
U+0078 LATIN SMALL LETTER X character, then this keyword doesn't
represent anything. Abort these steps for that keyword.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">width string</ins></var> <ins class="diff-chg">be the
string before the "</ins> <code title=""><ins class=
"diff-chg">x</ins></code> <ins class="diff-chg">".</ins></p>
</li>
<li>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">height string</ins></var> <ins class="diff-chg">be the
string after the "</ins> <code title=""><ins class=
"diff-chg">x</ins></code> <ins class="diff-chg">".</ins></p>
</li>
<li>
<p><ins class="diff-chg">If either</ins> <var title=""><ins class=
"diff-chg">width string</ins></var> <ins class="diff-chg">or</ins>
<var title=""><ins class="diff-chg">height string</ins></var>
<ins class="diff-chg">start with a U+0030 DIGIT ZERO (0) character
or contain any characters other than characters in the range U+0030
DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then this keyword doesn't
represent anything. Abort these steps for that keyword.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Apply the</ins> <a href=
"#rules"><ins class="diff-chg">rules for parsing non-negative
integers</ins></a> <ins class="diff-chg">to</ins> <var title=
""><ins class="diff-chg">width string</ins></var> <ins class=
"diff-chg">to obtain</ins> <var title=""><ins class=
"diff-chg">width</ins></var> .</p>
</li>
<li>
<p><ins class="diff-chg">Apply the</ins> <a href=
"#rules"><ins class="diff-chg">rules for parsing non-negative
integers</ins></a> <ins class="diff-chg">to</ins> <var title=
""><ins class="diff-chg">height string</ins></var> <ins class=
"diff-chg">to obtain</ins> <var title=""><ins class=
"diff-chg">height</ins></var> .</p>
</li>
<li>
<p><ins class="diff-chg">The keyword represents that the resource
contains a bitmap icon with a width of</ins> <var title=
""><ins class="diff-chg">width</ins></var> <ins class=
"diff-chg">device pixels and a height of</ins> <var title=
""><ins class="diff-chg">height</ins></var> <ins class=
"diff-chg">device pixels.</ins></p>
</li>
</ul>
<p><ins class="diff-chg">The keywords specified on the</ins>
<code title="attr-link-sizes"><a href="#sizes0"><ins class=
"diff-chg">sizes</ins></a></code> <ins class="diff-chg">attribute
must not represent icon sizes that are not actually available in
the linked resource.</ins></p>
<p><ins class="diff-chg">If the attribute is not specified, then
the user agent must assume that the given icon is appropriate, but
less appropriate than an icon of a known and appropriate
size.</ins></p>
<div class="example">
<p><ins class="diff-chg">The following snippet shows the top part
of an application with several icons.</ins></p>
<pre>
<!DOCTYPE HTML><ins class="diff-chg">
<html>
<head>
<title>lsForums — Inbox</title>
<link rel=icon href=favicon.png sizes="16x16">
<link rel=icon href=windows.ico sizes="32x32 48x48">
<link rel=icon href=mac.icns sizes="128x128 512x512 8192x8192 32768x32768">
<link rel=icon href=iphone.png sizes="59x60">
<link rel=icon href=gnome.svg sizes="any">
<link rel=stylesheet href=lsforums.css>
<script src=lsforums.js></script>
<meta name=application-name content="lsForums">
</head>
<body>
...
</ins>
</pre></div>
<h5 id="link-type6"><span class="secno"><del class=
"diff-old">4.12.3.10.</del> <ins class=
"diff-chg">4.12.3.9.</ins></span> Link type " <dfn id="license"
title="rel-license"><code>license</code></dfn> "</h5>
<p>The <code title="rel-license"><a href=
"#license">license</a></code> keyword may be used with
<code><a href="#link">link</a></code> , <code><a href=
"#a">a</a></code> , and <code><a href="#area">area</a></code>
elements. For <code><a href="#link">link</a></code> elements, it
creates a <a href="#hyperlink1" title=
"hyperlink link">hyperlink</a> .</p>
<p>The <code title="rel-license"><a href=
"#license">license</a></code> keyword indicates that the referenced
document provides the copyright license terms under which the
current document is provided.</p>
<p><strong>Synonyms</strong> : For historical reasons, user agents
must also treat the keyword " <code title="">copyright</code> "
like the <code title="rel-license"><a href=
"#license">license</a></code> keyword.</p>
<h5 id="link-type7"><span class="secno"><del class=
"diff-old">4.12.3.11.</del> <ins class=
"diff-chg">4.12.3.10.</ins></span> Link type " <dfn id="nofollow"
title="rel-nofollow"><code>nofollow</code></dfn> "</h5>
<p>The <code title="rel-nofollow"><a href=
"#nofollow">nofollow</a></code> keyword may be used with
<code><a href="#a">a</a></code> and <code><a href=
"#area">area</a></code> elements.</p>
<p>The <code title="rel-nofollow"><a href=
"#nofollow">nofollow</a></code> keyword indicates that the link is
not endorsed by the original author or publisher of the <del class=
"diff-old">page.</del> <ins class="diff-chg">page, or that the link
to the referenced document was included primarily because of a
commercial relationship between people affiliated with the two
pages.</ins></p>
<h5 id="link-type8"><span class="secno"><del class=
"diff-old">4.12.3.12.</del> <ins class=
"diff-chg">4.12.3.11.</ins></span> Link type " <dfn id="noreferrer"
title="rel-noreferrer"><code>noreferrer</code></dfn> "</h5>
<p>The <code title="rel-noreferrer"><a href=
"#noreferrer">noreferrer</a></code> keyword may be used with
<code><a href="#a">a</a></code> and <code><a href=
"#area">area</a></code> elements.</p>
<p>If a user agent follows a link defined by an <code><a href=
"#a">a</a></code> or <code><a href="#area">area</a></code> element
that has the <code title="rel-noreferrer"><a href=
"#noreferrer">noreferrer</a></code> keyword, the user agent must
not include a <code title="">Referer</code> HTTP header (or
equivalent for other protocols) in the request.</p>
<h5 id="link-type9"><span class="secno"><del class=
"diff-old">4.12.3.13.</del> <ins class=
"diff-chg">4.12.3.12.</ins></span> Link type " <dfn id="pingback"
title="rel-pingback"><code>pingback</code></dfn> "</h5>
<p>The <code title="rel-pingback"><a href=
"#pingback">pingback</a></code> keyword may be used with
<code><a href="#link">link</a></code> elements, for which it
creates an <a href="#links1" title=
"external resource link">external resource link</a> .</p>
<p>For the semantics of the <code title="rel-pingback"><a href=
"#pingback">pingback</a></code> keyword, see the Pingback 1.0
specification. <a href="#references">[PINGBACK]</a></p>
<h5 id="link-type10"><span class="secno"><del class=
"diff-old">4.12.3.14.</del> <ins class=
"diff-chg">4.12.3.13.</ins></span> Link type " <dfn id="prefetch"
title="rel-prefetch"><code>prefetch</code></dfn> "</h5>
<p>The <code title="rel-prefetch"><a href=
"#prefetch">prefetch</a></code> keyword may be used with
<code><a href="#link">link</a></code> elements, for which it
creates an <a href="#links1" title=
"external resource link">external resource link</a> .</p>
<p>The <code title="rel-prefetch"><a href=
"#prefetch">prefetch</a></code> keyword indicates that preemptively
fetching and caching the specified resource is likely to be
beneficial, as it is highly likely that the user will require this
resource.</p>
<p><ins class="diff-chg">There is no default type for resources
given by the</ins> <code title="rel-prefetch"><a href=
"#prefetch"><ins class="diff-chg">prefetch</ins></a></code>
<ins class="diff-chg">keyword.</ins></p>
<h5 id="link-type11"><span class="secno"><del class=
"diff-old">4.12.3.15.</del> <ins class=
"diff-chg">4.12.3.14.</ins></span> Link type " <dfn id="search0"
title="rel-search"><code>search</code></dfn> "</h5>
<p>The <code title="rel-search"><a href=
"#search0">search</a></code> keyword may be used with
<code><a href="#link">link</a></code> , <code><a href=
"#a">a</a></code> , and <code><a href="#area">area</a></code>
elements. For <code><a href="#link">link</a></code> elements, it
creates a <a href="#hyperlink1" title=
"hyperlink link">hyperlink</a> .</p>
<p>The <code title="rel-search"><a href=
"#search0">search</a></code> keyword indicates that the referenced
document provides an interface specifically for searching the
document and its related resources.</p>
<p class="note">OpenSearch description documents can be used with
<code><a href="#link">link</a></code> elements and the <code title=
"rel-search"><a href="#search0">search</a></code> link type to
enable user agents to autodiscover search interfaces. <a href=
"#references">[OPENSEARCH]</a></p>
<h5 id="link-type12"><span class="secno"><del class=
"diff-old">4.12.3.16.</del> <ins class=
"diff-chg">4.12.3.15.</ins></span> Link type " <dfn id="stylesheet"
title="rel-stylesheet"><code>stylesheet</code></dfn> "</h5>
<p>The <code title="rel-stylesheet"><a href=
"#stylesheet">stylesheet</a></code> keyword may be used with
<code><a href="#link">link</a></code> elements, for which it
creates an <a href="#links1" title=
"external resource link">external resource link</a> that
contributes to the <a href="#styling0">styling processing model</a>
.</p>
<p>The specified resource is a resource that describes how to
present the document. Exactly how the resource is to be processed
depends on the actual type of the resource.</p>
<p>If the <code title="rel-alternate"><a href=
"#alternate">alternate</a></code> keyword is also specified on the
<code><a href="#link">link</a></code> element, then the link is an
alternative stylesheet.</p>
<p><ins class="diff-chg">The default type for resources given by
the</ins> <code title="rel-stylesheet"><a href=
"#stylesheet"><ins class="diff-chg">stylesheet</ins></a></code>
<ins class="diff-chg">keyword is</ins> <code title=""><ins class=
"diff-chg">text/css</ins></code> .</p>
<p><strong><ins class="diff-chg">Quirk:</ins></strong> <ins class=
"diff-chg">If the document has been set to</ins> <a href=
"#quirks"><ins class="diff-chg">quirks mode</ins></a> <ins class=
"diff-chg">and the</ins> <a href="#content-type8" title=
"Content-Type"><ins class="diff-chg">Content-Type
metadata</ins></a> <ins class="diff-chg">of the external resource
is not a supported style sheet type, the user agent must instead
assume it to be</ins> <code title=""><ins class=
"diff-chg">text/css</ins></code> .</p>
<h5 id="link-type13"><span class="secno"><del class=
"diff-old">4.12.3.17.</del> <ins class=
"diff-chg">4.12.3.16.</ins></span> Link type " <dfn id="sidebar"
title="rel-sidebar"><code>sidebar</code></dfn> "</h5>
<p>The <code title="rel-sidebar"><a href=
"#sidebar">sidebar</a></code> keyword may be used with
<code><a href="#link">link</a></code> , <code><a href=
"#a">a</a></code> , and <code><a href="#area">area</a></code>
elements. For <code><a href="#link">link</a></code> elements, it
creates a <a href="#hyperlink1" title=
"hyperlink link">hyperlink</a> .</p>
<p>The <code title="rel-sidebar"><a href=
"#sidebar">sidebar</a></code> keyword indicates that the referenced
document, if retrieved, is intended to be shown in a <a href=
"#secondary0">secondary browsing context</a> (if possible), instead
of in the current <a href="#browsing1">browsing context</a> .</p>
<p>A <a href="#hyperlinks" title="hyperlink">hyperlink element</a>
with with the <code title="rel-sidebar"><a href=
"#sidebar">sidebar</a></code> keyword specified is a <dfn id=
"sidebar0" title="rel-sidebar-hyperlink">sidebar hyperlink</dfn>
.</p>
<h5 id="link-type14"><span class="secno"><del class=
"diff-old">4.12.3.18.</del> <ins class=
"diff-chg">4.12.3.17.</ins></span> Link type " <dfn id="tag" title=
"rel-tag"><code>tag</code></dfn> "</h5>
<p>The <code title="rel-tag"><a href="#tag">tag</a></code> keyword
may be used with <code><a href="#link">link</a></code> ,
<code><a href="#a">a</a></code> , and <code><a href=
"#area">area</a></code> elements. For <code><a href=
"#link">link</a></code> elements, it creates a <a href=
"#hyperlink1" title="hyperlink link">hyperlink</a> .</p>
<p>The <code title="rel-tag"><a href="#tag">tag</a></code> keyword
indicates that the <em>tag</em> that the referenced document
represents applies to the current document.</p>
<h5 id="hierarchical"><span class="secno"><del class=
"diff-old">4.12.3.19.</del> <ins class=
"diff-chg">4.12.3.18.</ins></span> Hierarchical link types</h5>
<p>Some documents form part of a hierarchical structure of
documents.</p>
<p>A hierarchical structure of documents is one where each document
can have various subdocuments. The document of which a document is
a subdocument is said to be the document's <em>parent</em> . A
document with no parent forms the top of the hierarchy.</p>
<p>A document may be part of multiple hierarchies.</p>
<h6 id="link-type15"><span class="secno"><del class=
"diff-old">4.12.3.19.1.</del> <ins class=
"diff-chg">4.12.3.18.1.</ins></span> Link type " <dfn id="index0"
title="rel-index"><code>index</code></dfn> "</h6>
<p>The <code title="rel-index"><a href="#index0">index</a></code>
keyword may be used with <code><a href="#link">link</a></code> ,
<code><a href="#a">a</a></code> , and <code><a href=
"#area">area</a></code> elements. For <code><a href=
"#link">link</a></code> elements, it creates a <a href=
"#hyperlink1" title="hyperlink link">hyperlink</a> .</p>
<p>The <code title="rel-index"><a href="#index0">index</a></code>
keyword indicates that the document is part of a hierarchical
structure, and that the link is leading to the document that is the
top of the hierarchy. It conveys more information when used with
the <code title="rel-up"><a href="#up">up</a></code> keyword
(q.v.).</p>
<p><strong>Synonyms</strong> : For historical reasons, user agents
must also treat the keywords " <code title="">top</code> ", "
<code title="">contents</code> ", and " <code title="">toc</code> "
like the <code title="rel-index"><a href="#index0">index</a></code>
keyword.</p>
<h6 id="link-type16"><span class="secno"><del class=
"diff-old">4.12.3.19.2.</del> <ins class=
"diff-chg">4.12.3.18.2.</ins></span> Link type " <dfn id="up"
title="rel-up"><code>up</code></dfn> "</h6>
<p>The <code title="rel-up"><a href="#up">up</a></code> keyword may
be used with <code><a href="#link">link</a></code> , <code><a href=
"#a">a</a></code> , and <code><a href="#area">area</a></code>
elements. For <code><a href="#link">link</a></code> elements, it
creates a <a href="#hyperlink1" title=
"hyperlink link">hyperlink</a> .</p>
<p>The <code title="rel-up"><a href="#up">up</a></code> keyword
indicates that the document is part of a hierarchical structure,
and that the link is leading to the document that is the parent of
the current document.</p>
<p>The <code title="rel-up"><a href="#up">up</a></code> keyword may
be repeated within a <code title="attr-hyperlink-rel"><a href=
"#rel3">rel</a></code> attribute to indicate the hierarchical
distance from the current document to the referenced document. Each
<del class="diff-old">occurance</del> <ins class=
"diff-chg">occurrence</ins> of the keyword represents one further
level. If the <code title="rel-index"><a href=
"#index0">index</a></code> keyword is also present, then the number
of <code title="rel-up"><a href="#up">up</a></code> keywords is the
depth of the current page relative to the top of the hierarchy.
<ins class="diff-new">Only one link is created for the set of one
or more</ins> <code title="rel-up"><a href="#up"><ins class=
"diff-new">up</ins></a></code> <ins class="diff-new">keywords and,
if present, the</ins> <code title="rel-index"><a href=
"#index0"><ins class="diff-new">index</ins></a></code> <ins class=
"diff-new">keyword.</ins></p>
<p>If the page is part of multiple hierarchies, then they should be
described in different <a href="#paragraph" title=
"paragraph">paragraphs</a> . User agents must scope any
interpretation of the <code title="rel-up"><a href=
"#up">up</a></code> and <code title="rel-index"><a href=
"#index0">index</a></code> keywords together indicating the depth
of the hierarchy to the <a href="#paragraph">paragraph</a> in which
the link finds itself, if any, or to the document otherwise.</p>
<p>When two links have both the <code title="rel-up"><a href=
"#up">up</a></code> and <code title="rel-index"><a href=
"#index0">index</a></code> keywords specified together in the same
scope and contradict each other by having a different number of
<code title="rel-up"><a href="#up">up</a></code> keywords, the link
with the greater number of <code title="rel-up"><a href=
"#up">up</a></code> keywords must be taken as giving the depth of
the document.</p>
<div class="example">
<p>This can be used to mark up a navigation style sometimes known
as <del class="diff-old">breadcrumbs.</del> <ins class=
"diff-chg">bread crumbs.</ins> In the following example, the
current page can be reached via two paths.</p>
<pre>
<nav>
<p>
<a href="/" rel="index up up up">Main</a> >
<a href="/products/" rel="up up">Products</a> >
<a href="/products/dishwashers/" rel="up">Dishwashers</a> >
<a>Second hand</a>
</p>
<p>
<a href="/" rel="index up up">Main</a> >
<a href="/second-hand/" rel="up">Second hand</a> >
<a>Dishwashers</a>
</p>
</nav>
</pre></div>
<p class="note">The <code title="dom-a-relList"><a href=
"#rellist0">relList</a></code> DOM attribute (e.g. on the
<code><a href="#a">a</a></code> element) does not currently
represent multiple <code title="rel-up"><a href="#up">up</a></code>
keywords (the interface hides duplicates).</p>
<h5 id="sequential0"><span class="secno"><del class=
"diff-old">4.12.3.20.</del> <ins class=
"diff-chg">4.12.3.19.</ins></span> Sequential link types</h5>
<p>Some documents form part of a sequence of documents.</p>
<p>A sequence of documents is one where each document can have a
<em>previous sibling</em> and a <em>next sibling</em> . A document
with no previous sibling is the start of its sequence, a document
with no next sibling is the end of its sequence.</p>
<p>A document may be part of multiple sequences.</p>
<h6 id="link-type17"><span class="secno"><del class=
"diff-old">4.12.3.20.1.</del> <ins class=
"diff-chg">4.12.3.19.1.</ins></span> Link type " <dfn id="first"
title="rel-first"><code>first</code></dfn> "</h6>
<p>The <code title="rel-first"><a href="#first">first</a></code>
keyword may be used with <code><a href="#link">link</a></code> ,
<code><a href="#a">a</a></code> , and <code><a href=
"#area">area</a></code> elements. For <code><a href=
"#link">link</a></code> elements, it creates a <a href=
"#hyperlink1" title="hyperlink link">hyperlink</a> .</p>
<p>The <code title="rel-first"><a href="#first">first</a></code>
keyword indicates that the document is part of a sequence, and that
the link is leading to the document that is the first logical
document in the sequence.</p>
<p><strong>Synonyms</strong> : For historical reasons, user agents
must also treat the keywords " <code title="">begin</code> " and "
<code title="">start</code> " like the <code title=
"rel-first"><a href="#first">first</a></code> keyword.</p>
<h6 id="link-type18"><span class="secno"><del class=
"diff-old">4.12.3.20.2.</del> <ins class=
"diff-chg">4.12.3.19.2.</ins></span> Link type " <dfn id="last"
title="rel-last"><code>last</code></dfn> "</h6>
<p>The <code title="rel-last"><a href="#last">last</a></code>
keyword may be used with <code><a href="#link">link</a></code> ,
<code><a href="#a">a</a></code> , and <code><a href=
"#area">area</a></code> elements. For <code><a href=
"#link">link</a></code> elements, it creates a <a href=
"#hyperlink1" title="hyperlink link">hyperlink</a> .</p>
<p>The <code title="rel-last"><a href="#last">last</a></code>
keyword indicates that the document is part of a sequence, and that
the link is leading to the document that is the last logical
document in the sequence.</p>
<p><strong>Synonyms</strong> : For historical reasons, user agents
must also treat the keyword " <code title="">end</code> " like the
<code title="rel-last"><a href="#last">last</a></code> keyword.</p>
<h6 id="link-type19"><span class="secno"><del class=
"diff-old">4.12.3.20.3.</del> <ins class=
"diff-chg">4.12.3.19.3.</ins></span> Link type " <dfn id="next"
title="rel-next"><code>next</code></dfn> "</h6>
<p>The <code title="rel-next"><a href="#next">next</a></code>
keyword may be used with <code><a href="#link">link</a></code> ,
<code><a href="#a">a</a></code> , and <code><a href=
"#area">area</a></code> elements. For <code><a href=
"#link">link</a></code> elements, it creates a <a href=
"#hyperlink1" title="hyperlink link">hyperlink</a> .</p>
<p>The <code title="rel-next"><a href="#next">next</a></code>
keyword indicates that the document is part of a sequence, and that
the link is leading to the document that is the next logical
document in the sequence.</p>
<h6 id="link-type20"><span class="secno"><del class=
"diff-old">4.12.3.20.4.</del> <ins class=
"diff-chg">4.12.3.19.4.</ins></span> Link type " <dfn id="prev"
title="rel-prev"><code>prev</code></dfn> "</h6>
<p>The <code title="rel-prev"><a href="#prev">prev</a></code>
keyword may be used with <code><a href="#link">link</a></code> ,
<code><a href="#a">a</a></code> , and <code><a href=
"#area">area</a></code> elements. For <code><a href=
"#link">link</a></code> elements, it creates a <a href=
"#hyperlink1" title="hyperlink link">hyperlink</a> .</p>
<p>The <code title="rel-prev"><a href="#prev">prev</a></code>
keyword indicates that the document is part of a sequence, and that
the link is leading to the document that is the previous logical
document in the sequence.</p>
<p><strong>Synonyms</strong> : For historical reasons, user agents
must also treat the keyword " <code title="">previous</code> " like
the <code title="rel-prev"><a href="#prev">prev</a></code>
keyword.</p>
<h5 id="other0"><span class="secno"><del class=
"diff-old">4.12.3.21.</del> <ins class=
"diff-chg">4.12.3.20.</ins></span> Other link types</h5>
<p>Other than the types defined above, only types defined as
extensions in the <a href=
"http://wiki.whatwg.org/wiki/RelExtensions">WHATWG Wiki
RelExtensions page</a> may be used with the <code title=
"">rel</code> attribute on <code><a href="#link">link</a></code> ,
<code><a href="#a">a</a></code> , and <code><a href=
"#area">area</a></code> elements. <a href=
"#references">[WHATWGWIKI]</a></p>
<p>Anyone is free to edit the WHATWG Wiki RelExtensions page at any
time to add a type. Extension types must be specified with the
following information:</p>
<dl>
<dt>Keyword</dt>
<dd>
<p>The actual value being defined. The value should not be
confusingly similar to any other defined value (e.g. differing only
in case).</p>
</dd>
<dt>Effect on... <code><a href="#link">link</a></code></dt>
<dd>
<p>One of the following:</p>
<dl>
<dt>not allowed</dt>
<dd>The keyword is not allowed to be specified on <code><a href=
"#link">link</a></code> elements.</dd>
<dt>Hyperlink</dt>
<dd>The keyword may be specified on a <code><a href=
"#link">link</a></code> element; it creates a <a href="#hyperlink1"
title="hyperlink link">hyperlink link</a> .</dd>
<dt>External Resource</dt>
<dd>The keyword may be specified on a <code><a href=
"#link">link</a></code> element; it creates a <a href="#links1"
title="external resource link">external resource link</a> .</dd>
</dl>
</dd>
<dt>Effect on... <code><a href="#a">a</a></code> and <code><a href=
"#area">area</a></code></dt>
<dd>
<p>One of the following:</p>
<dl>
<dt>not allowed</dt>
<dd>The keyword is not allowed to be specified on <code><a href=
"#a">a</a></code> and <code><a href="#area">area</a></code>
elements.</dd>
<dt>Hyperlink</dt>
<dd>The keyword may be specified on <code><a href="#a">a</a></code>
and <code><a href="#area">area</a></code> elements.</dd>
</dl>
</dd>
<dt>Brief description</dt>
<dd>
<p>A short description of what the keyword's meaning is.</p>
</dd>
<dt>Link to more details</dt>
<dd>
<p>A link to a more detailed description of the keyword's semantics
and requirements. It could be another page on the Wiki, or a link
to an external page.</p>
</dd>
<dt>Synonyms</dt>
<dd>
<p>A list of other keyword values that have exactly the same
processing requirements. Authors must not use the values defined to
be synonyms, they are only intended to allow user agents to support
legacy content.</p>
</dd>
<dt>Status</dt>
<dd>
<p>One of the following:</p>
<dl>
<dt>Proposal</dt>
<dd>The keyword has not received wide peer review and approval. It
is included for completeness because pages use the keyword. Pages
should not use the keyword.</dd>
<dt>Accepted</dt>
<dd>The keyword has received wide peer review and approval. It has
a specification that unambiguously defines how to handle pages that
use the keyword, including when they use them in incorrect ways.
Pages may use the keyword.</dd>
<dt>Rejected</dt>
<dd>The keyword has received wide peer review and it has been found
to have significant problems. Pages must not use the keyword. When
a keyword has this status, the "Effect on... <code><a href=
"#link">link</a></code> " and "Effect on... <code><a href=
"#a">a</a></code> and <code><a href="#area">area</a></code> "
information should be set to "not allowed".</dd>
</dl>
<p>If a keyword is added with the "proposal" status and found to be
redundant with existing values, it should be removed and listed as
a synonym for the existing value. If a keyword is added with the
"proposal" status and found to be harmful, then it should be
changed to "rejected" status, and its "Effect on..." information
should be changed accordingly.</p>
</dd>
</dl>
<p>Conformance checkers must use the information given on the
WHATWG Wiki RelExtensions page to establish if a value not
explicitly defined in this specification is allowed or not. When an
author uses a new type not defined by either this specification or
the Wiki page, conformance checkers should offer to add the value
to the Wiki, with the details described above, with the "proposal"
status.</p>
<p>This specification does not define how new values will get
approved. It is expected that the Wiki will have a community that
addresses this.</p>
<h3 id="interfaces"><span class="secno"><del class=
"diff-old">4.13.</del> <ins class="diff-chg">4.13</ins></span>
Interfaces for URI manipulation</h3>
<p>An interface that has a complement of <dfn id=
"uri-decomposition">URI decomposition attributes</dfn> will have
seven attributes with the following definitions:</p>
<pre class="idl">
attribute DOMString <a href="#protocol0" title=
"dom-uda-protocol">protocol</a>;
attribute DOMString <a href="#host0" title=
"dom-uda-host">host</a>;
attribute DOMString <a href="#hostname0" title=
"dom-uda-hostname">hostname</a>;
attribute DOMString <a href="#port0" title=
"dom-uda-port">port</a>;
attribute DOMString <a href="#pathname0" title=
"dom-uda-pathname">pathname</a>;
attribute DOMString <a href="#search1" title=
"dom-uda-search">search</a>;
attribute DOMString <a href="#hash0" title=
"dom-uda-hash">hash</a>;
</pre>
<p>The attributes defined to be URI decomposition attributes must
act as described for the attributes with the same corresponding
names in this section.</p>
<p>In addition, an interface with a complement of URI decomposition
attributes will define an <dfn id="input" title=
"concept-uda-input">input</dfn> , which is a URI that the
attributes act on, and a <dfn id="common3" title=
"concept-uda-setter">common setter action</dfn> , which is a set of
steps invoked when any of the attributes' setters are invoked.</p>
<p>The seven URI decomposition attributes have similar
requirements.</p>
<p>On getting, if the <a href="#input" title=
"concept-uda-input">input</a> fulfills the condition given in the
"getter condition" column corresponding to the attribute in the
table below, the user agent must return the part of the <a href=
"#input" title="concept-uda-input">input</a> URI given in the
"component" column, with any prefixes specified in the "prefix"
column appropriately added to the start of the string and any
suffixes specified in the "suffix" column appropriately added to
the end of the string. Otherwise, the attribute must return the
empty string.</p>
<p>On setting, the new value must first be mutated as described by
the "setter preprocessor" column, then mutated by %-escaping any
characters in the new value that are not valid in the relevant
component as given by the "component" column. Then, if the
resulting new value fulfills the condition given in the "setter
condition" column, the user agent must make a new string
<var title="">output</var> by replacing the component of the URI
given by the "component" column in the <a href="#input" title=
"concept-uda-input">input</a> URI with the new value; otherwise,
the user agent must let <var title="">output</var> be equal to the
<a href="#input" title="concept-uda-input">input</a> . Finally, the
user agent must invoke the <a href="#common3" title=
"concept-uda-setter">common setter action</a> with the value of
<var title="">output</var> .</p>
<p><ins class="diff-new">When replacing a component in the URI, if
the component is part of an optional group in the URI syntax
consisting of a character followed by the component, the component
(including its prefix character) must be included even if the new
value is the empty string.</ins></p>
<p class="note"><ins class="diff-new">The previous paragraph
applies in particular to the "</ins> <code title=
"">:</code><ins class="diff-new">" before a <port> component,
the "</ins> <code title=""><ins class="diff-new">?</ins></code>
<ins class="diff-new">" before a <query> component, and the
"</ins> <code title=""><ins class="diff-new">#</ins></code>
<ins class="diff-new">" before a <fragment>
component.</ins></p>
<p>The rules for parsing and constructing URIs are described in RFC
3986 and RFC 3987. <a href="#references">[RFC3986]</a> <a href=
"#references">[RFC3987]</a></p>
<table>
<thead>
<tr>
<th>Attribute</th>
<th>Component</th>
<th>Getter Condition</th>
<th>Prefix</th>
<th>Suffix</th>
<th>Setter Preprocessor</th>
<th>Setter Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><dfn id="protocol0" title=
"dom-uda-protocol"><code>protocol</code></dfn></td>
<td><scheme></td>
<td>—</td>
<td>—</td>
<td>U+003A COLON (" <code title="">:</code> ")</td>
<td>Remove all trailing U+003A COLON (" <code title="">:</code> ")
characters</td>
<td>The new value is not the empty string</td>
</tr>
<tr>
<td><dfn id="host0" title=
"dom-uda-host"><code>host</code></dfn></td>
<td><a href="#lthostportgt"><hostport></a></td>
<td><a href="#input" title="concept-uda-input">input</a> is
hierarchical and uses a server-based naming authority</td>
<td>—</td>
<td>—</td>
<td>—</td>
<td>—</td>
</tr>
<tr>
<td><dfn id="hostname0" title=
"dom-uda-hostname"><code>hostname</code></dfn></td>
<td><host>/<ihost></td>
<td><a href="#input" title="concept-uda-input">input</a> is
hierarchical and uses a server-based naming authority</td>
<td>—</td>
<td>—</td>
<td>Remove all leading U+002F SOLIDUS (" <code title="">/</code> ")
characters</td>
<td>—</td>
</tr>
<tr>
<td><dfn id="port0" title=
"dom-uda-port"><code>port</code></dfn></td>
<td><port></td>
<td><a href="#input" title="concept-uda-input">input</a> is
hierarchical and uses a server-based naming authority</td>
<td>—</td>
<td>—</td>
<td>Remove any characters in the new value that are not in the
range U+0030 DIGIT ZERO .. U+0039 DIGIT <del class="diff-old">NINE
The new value is not</del> <ins class="diff-chg">NINE. If</ins> the
<del class="diff-old">empty</del> <ins class=
"diff-chg">resulting</ins> string <ins class="diff-new">is empty,
set it to a single U+0030 DIGIT ZERO character ('0').</ins></td>
<td><ins class="diff-new">—</ins></td>
</tr>
<tr>
<td><dfn id="pathname0" title=
"dom-uda-pathname"><code>pathname</code></dfn></td>
<td><abs_path></td>
<td><a href="#input" title="concept-uda-input">input</a> is
hierarchical</td>
<td>—</td>
<td>—</td>
<td>If it has no leading U+002F SOLIDUS (" <code title="">/</code>
") character, prepend a U+002F SOLIDUS (" <code title="">/</code>
") character to the new value</td>
<td>—</td>
</tr>
<tr>
<td><dfn id="search1" title=
"dom-uda-search"><code>search</code></dfn></td>
<td><query></td>
<td><a href="#input" title="concept-uda-input">input</a> is
hierarchical</td>
<td>U+003F QUESTION MARK (" <code title="">?</code> ")</td>
<td>—</td>
<td>Remove one leading U+003F QUESTION MARK (" <code title=
"">?</code> ") character, if any</td>
<td>—</td>
</tr>
<tr>
<td><dfn id="hash0" title=
"dom-uda-hash"><code>hash</code></dfn></td>
<td><fragment></td>
<td>Fragment identifier is longer than zero characters</td>
<td>U+0023 NUMBER SIGN (" <code title="">#</code> ")</td>
<td>—</td>
<td>Remove one leading U+0023 NUMBER SIGN (" <code title=
"">#</code> ") character, if any</td>
<td>—</td>
</tr>
</tbody>
</table>
<p>The <dfn id="lthostportgt"><hostport></dfn> component is
defined as being the <host>/<ihost> component, followed
by a colon and the <port> component, but with the colon and
<port> component omitted if the given port matches the
default port for the protocol given by the <scheme>
component.</p>
<h2 id="editing"><span class="secno">5.</span> <dfn id=
"editing0">Editing</dfn></h2>
<p>This section describes various features that allow authors to
enable users to edit documents and parts of documents
interactively.</p>
<h3 id="editing-intro"><span class="secno"><del class=
"diff-old">5.1.</del> <ins class="diff-chg">5.1</ins></span>
Introduction</h3>
<p><em>This section is non-normative.</em></p>
<p class="big-issue">Would be nice to explain how these features
work together.</p>
<h3 id="contenteditable"><span class="secno"><del class=
"diff-old">5.2.</del> <ins class="diff-chg">5.2</ins></span> The
<code title="attr-contenteditable"><a href=
"#contenteditable0">contenteditable</a></code> attribute</h3>
<p>The <dfn id="contenteditable0" title=
"attr-contenteditable"><code>contenteditable</code></dfn> attribute
is a common attribute. User agents must support this attribute on
all <a href="#html-elements">HTML elements</a> .</p>
<p>The <code title="attr-contenteditable"><a href=
"#contenteditable0">contenteditable</a></code> attribute is an
<a href="#enumerated">enumerated attribute</a> whose keywords are
the empty string, <code title="">true</code> , and <code title=
"">false</code> . The empty string and the <code title=
"">true</code> keyword map to the <em>true</em> state. The
<code title="">false</code> keyword maps to the <em>false</em>
<ins class="diff-new">state. In addition, there is a third state,
the</ins> <em><ins class="diff-new">inherit</ins></em> state, which
is <del class="diff-old">also</del> the <em><del class=
"diff-old">invalid</del> <ins class="diff-chg">missing</ins> value
default <del class="diff-old">. There is no</del></em> <ins class=
"diff-chg">(and the</ins> <em><del class="diff-old">missing</del>
<ins class="diff-chg">invalid</ins> value default <del class=
"diff-old">.</del></em> <ins class="diff-chg">).</ins></p>
<p>If an <a href="#html-elements" title="HTML elements">HTML
element</a> has a <code title="attr-contenteditable"><a href=
"#contenteditable0">contenteditable</a></code> attribute set to the
true state, or <ins class="diff-new">it has its</ins> <code title=
"attr-contenteditable"><a href="#contenteditable0"><ins class=
"diff-new">contenteditable</ins></a></code> <ins class=
"diff-new">attribute set to the inherit state and</ins> if its
nearest ancestor <a href="#html-elements" title=
"HTML elements">HTML element</a> with the <code title=
"attr-contenteditable"><a href=
"#contenteditable0">contenteditable</a></code> attribute set
<ins class="diff-new">to a state other than the inherit state</ins>
has its attribute set to the true state, or if it <del class=
"diff-old">has no</del> <ins class="diff-chg">and its</ins>
ancestors <del class="diff-old">with the</del> <ins class=
"diff-chg">all have their</ins> <code title=
"attr-contenteditable"><a href=
"#contenteditable0">contenteditable</a></code> attribute set
<ins class="diff-new">to the inherit state</ins> but the
<code>Document</code> has <code title=
"dom-document-designMode"><a href=
"#designMode">designMode</a></code> enabled, then the UA must treat
the element as <dfn id="editable0">editable</dfn> (as described
below).</p>
<p>Otherwise, either the <a href="#html-elements" title=
"HTML elements">HTML element</a> has a <code title=
"attr-contenteditable"><a href=
"#contenteditable0">contenteditable</a></code> attribute set to the
false state, or its <code title="attr-contenteditable"><a href=
"#contenteditable0"><ins class=
"diff-new">contenteditable</ins></a></code> <ins class=
"diff-new">attribute is set to the inherit state and its</ins>
nearest ancestor <a href="#html-elements" title=
"HTML elements">HTML element</a> with the <code title=
"attr-contenteditable"><a href=
"#contenteditable0">contenteditable</a></code> attribute set
<del class="diff-old">is not editable , or it</del> <ins class=
"diff-chg">to a state other than the inherit state</ins> has
<del class="diff-old">no ancestor with</del> <ins class=
"diff-chg">its attribute set to</ins> the <ins class=
"diff-new">false state, or all its ancestors have their</ins>
<code title="attr-contenteditable"><a href=
"#contenteditable0">contenteditable</a></code> attribute set
<ins class="diff-new">to the inherit state</ins> and the
<code>Document</code> itself has <code title=
"dom-document-designMode"><a href=
"#designMode">designMode</a></code> <del class="diff-old">disabled,
and</del> <ins class="diff-chg">disabled; either way,</ins> the
element is <del class="diff-old">thus</del> not editable.</p>
<p>The <dfn id="contenteditable1" title=
"dom-contentEditable"><code>contentEditable</code></dfn> DOM
attribute, on getting, must return the string " <code title=
""><del class="diff-old">inherit</del> <ins class=
"diff-chg">true</ins></code> " if the content attribute <del class=
"diff-old">isn't set, "</del> <ins class="diff-chg">is set to
the</ins> true <ins class="diff-new">state,</ins> <code title=
""><ins class="diff-new">false</ins></code> " if the <ins class=
"diff-new">content</ins> attribute is set <del class="diff-old">and
has</del> <ins class="diff-chg">to</ins> the <del class=
"diff-old">true</del> <ins class="diff-chg">false</ins> state, and
" <code title=""><del class="diff-old">false</del> <ins class=
"diff-chg">inherit</ins></code> " otherwise. On setting, if the new
value is case-insensitively equal to the string " <code title=
"">inherit</code> " then the content attribute must be removed, if
the new value is case-insensitively equal to the string "
<code title="">true</code> <ins class="diff-new">"</ins> then the
content attribute must be set to the string " <code title="">true
<del class="diff-old">,</del></code> <ins class="diff-chg">",</ins>
if the new value is case-insensitively equal to the string "
<code title="">false</code> <ins class="diff-new">"</ins> then the
content attribute must be set to the string " <code title="">false
<del class="diff-old">,</del></code> <ins class="diff-chg">",</ins>
and otherwise the attribute setter must raise a
<code>SYNTAX_ERR</code> exception.</p>
<p><ins class="diff-new">The</ins> <dfn id="iscontenteditable"
title="dom-isContentEditable"><code><ins class=
"diff-new">isContentEditable</ins></code></dfn> <ins class=
"diff-new">DOM attribute, on getting, must return true if the
element is</ins> <a href="#editable0"><ins class=
"diff-new">editable</ins></a> ,<ins class="diff-new">and false
otherwise.</ins></p>
<p>If an element is <a href="#editable0">editable</a> and its
parent element is not, or if an element is <a href=
"#editable0">editable</a> and it has no parent element, then the
element is an <dfn id="editing1">editing host</dfn> . Editable
elements can be nested. User agents must make editing hosts
focusable (which <del class="diff-old">typicially</del> <ins class=
"diff-chg">typically</ins> means they enter the <a href="#tabindex"
title="attr-tabindex">tab order</a> ). An editing host can contain
non-editable sections, these are handled as described below. An
editing host can contain non-editable sections that contain further
editing hosts.</p>
<p>When an editing host has focus, it must have a <dfn id=
"caret">caret position</dfn> that specifies where the current
editing position is. It may also have a <a href="#a-selection"
title="the selection">selection</a> .</p>
<p class="note">How the caret and selection are represented depends
entirely on the UA.</p>
<h4 id="user-editing"><span class="secno"><del class=
"diff-old">5.2.1.</del> <ins class="diff-chg">5.2.1</ins></span>
User editing actions</h4>
<p>There are several actions that the user agent should allow the
user to perform while the user is interacting with an editing host.
How exactly each action is triggered is not defined for every
action, but when it is not defined, suggested key bindings are
provided to guide implementors.</p>
<dl>
<dt>Move the caret</dt>
<dd>
<p>User agents must allow users to move the caret to any position
within an editing host, even into nested editable elements. This
could be triggered as the default action of <code title=
"event-keydown">keydown</code> events with various key identifiers
and as the default action of <code title=
"event-mousedown">mousedown</code> events.</p>
</dd>
<dt>Change the selection</dt>
<dd>
<p>User agents must allow users to change <a href=
"#a-selection">the selection</a> within an editing host, even into
nested editable elements. <ins class="diff-new">User agents may
prevent selections from being made in ways that cross from editable
elements into non-editable elements (e.g. by making each
non-editable descendant atomically selectable, but not allowing
text selection within them).</ins> This could be triggered as the
default action of <code title="event-keydown">keydown</code> events
with various key identifiers and as the default action of
<code title="event-mousedown">mousedown</code> events.</p>
</dd>
<dt id="contenteditable-insertText">Insert text</dt>
<dd>
<p>This action must be triggered as the default action of a
<code title="event-textInput">textInput</code> event, and may be
triggered by other commands as well. It must cause the user agent
to insert the specified text (given by the event object's
<code title="">data</code> attribute in the case of the
<code title="event-textInput">textInput</code> event) at the
caret.</p>
<p>If the caret is positioned somewhere where <a href=
"#phrasing0">phrasing content</a> is not allowed (e.g. inside an
empty <code><a href="#ol">ol</a></code> element), then the user
agent must not insert the text directly at the caret position. In
such cases the <del class="diff-old">behaviour</del> <ins class=
"diff-chg">behavior</ins> is UA-dependent, but user agents must
not, in response to a request to insert text, generate a DOM that
is less conformant than the DOM prior to the request.</p>
<p>User agents should allow users to insert new paragraphs into
elements that contains only content other than paragraphs.</p>
<div class="example">
<p>For example, given the markup:</p>
<pre>
<section>
<dl>
<dt> Ben </dt>
<dd> Goat </dd>
</dl>
</section>
</pre>
<p>...the user agent should allow the user to insert <code><a href=
"#p">p</a></code> elements before and after the <code><a href=
"#dl">dl</a></code> element, as children of the <code><a href=
"#section">section</a></code> element.</p>
</div>
</dd>
<dt id="contenteditable-breakBlock">Break block</dt>
<dd>
<p>UAs should offer a way for the user to request that the current
paragraph be broken at the caret, e.g. as the default action of a
<code title="event-keydown">keydown</code> event whose identifier
is the "Enter" key and that has no modifiers set.</p>
<p>The exact <del class="diff-old">behaviour</del> <ins class=
"diff-chg">behavior</ins> is UA-dependent, but user agents must
not, in response to a request to break a paragraph, generate a DOM
that is less conformant than the DOM prior to the request.</p>
</dd>
<dt id="contenteditable-br">Insert a line separator</dt>
<dd>
<p>UAs should offer a way for the user to request an explicit line
break at the caret position without breaking the paragraph, e.g. as
the default action of a <code title="event-keydown">keydown</code>
event whose identifier is the "Enter" key and that has a shift
modifier set. Line separators are typically found within a poem
verse or an address. To insert a line break, the user agent must
insert a <code><a href="#br">br</a></code> element.</p>
<p>If the caret is positioned somewhere where <a href=
"#phrasing0">phrasing content</a> is not allowed (e.g. in an empty
<code><a href="#ol">ol</a></code> element), then the user agent
must not insert the <code><a href="#br">br</a></code> element
directly at the caret position. In such cases the <del class=
"diff-old">behaviour</del> <ins class="diff-chg">behavior</ins> is
UA-dependent, but user agents must not, in response to a request to
insert a line separator, generate a DOM that is less conformant
than the DOM prior to the request.</p>
</dd>
<dt id="contenteditable-delete">Delete</dt>
<dd>
<p>UAs should offer a way for the user to delete text and elements,
<ins class="diff-new">including non-editable descendants,</ins>
e.g. as the default action of <code title=
"event-keydown">keydown</code> events whose identifiers are
"U+0008" or "U+007F".</p>
<p>Five edge cases in particular need to be considered carefully
when implementing this feature: backspacing at the start of an
element, backspacing when the caret is immediately after an
element, forward-deleting at the end of an element,
forward-deleting when the caret is immediately before an element,
and deleting a <a href="#a-selection" title=
"the selection">selection</a> whose start and end points do not
share a common parent node.</p>
<p>In any case, the exact <del class="diff-old">behaviour</del>
<ins class="diff-chg">behavior</ins> is UA-dependent, but user
agents must not, in response to a request to delete text or an
element, generate a DOM that is less conformant than the DOM prior
to the request.</p>
</dd>
<dt id="contenteditable-wrapSemantic">Insert, and wrap text in,
semantic elements</dt>
<dd>
<p>UAs should offer <del class="diff-old">a way for the user to
mark text as having stress emphasis and as being important , and
may offer</del> the user the ability to mark text and paragraphs
with <del class="diff-old">other semantics.</del> <ins class=
"diff-chg">semantics that HTML can express.</ins></p>
<p>UAs should similarly offer a way for the user to insert empty
semantic elements <del class="diff-old">(such as, again, em ,
strong , and others)</del> to subsequently fill by entering text
manually.</p>
<p>UAs should also offer a way to remove those semantics from
marked up text, and to remove empty semantic element that have been
inserted.</p>
<p><ins class="diff-new">In response to a request from a user to
mark text up in italics, user agents should use the</ins>
<code><a href="#i"><ins class="diff-new">i</ins></a></code>
<ins class="diff-new">element to represent the semantic. The</ins>
<code><a href="#em"><ins class="diff-new">em</ins></a></code>
<ins class="diff-new">element should be used only if the user agent
is sure that the user means to indicate stress emphasis.</ins></p>
<p><ins class="diff-new">In response to a request from a user to
mark text up in bold, user agents should use the</ins>
<code><a href="#b"><ins class="diff-new">b</ins></a></code>
<ins class="diff-new">element to represent the semantic. The</ins>
<code><a href="#strong"><ins class=
"diff-new">strong</ins></a></code> <ins class="diff-new">element
should be used only if the user agent is sure that the user means
to indicate importance.</ins></p>
<p>The exact <del class="diff-old">behaviour</del> <ins class=
"diff-chg">behavior</ins> is UA-dependent, but user agents must
not, in response to a request to wrap semantics around some text or
to insert or remove a semantic element, generate a DOM that is less
conformant than the DOM prior to the request.</p>
</dd>
<dt>Select and move non-editable elements nested inside editing
hosts</dt>
<dd>
<p>UAs should offer a way for the user to move images and other
non-editable parts around the content within an editing host. This
may be done using the <a href="#drag-and">drag and drop</a>
mechanism. User agents must not, in response to a request to move
non-editable elements nested inside editing hosts, generate a DOM
that is less conformant than the DOM prior to the request.</p>
</dd>
<dt>Edit form controls nested inside editing hosts</dt>
<dd>
<p>When an <a href="#editable0">editable</a> form control is
edited, the changes must be reflected in both its current value
<em>and</em> its default value. For <code>input</code> elements
this means updating the <code title=
"dom-input-defaultValue">defaultValue</code> DOM attribute as well
as the <code title="dom-input-value">value</code> DOM attribute;
for <code>select</code> elements it means updating the
<code>option</code> elements' <code title=
"dom-option-defaultSelected">defaultSelected</code> DOM attribute
as well as the <code title="dom-option-selected">selected</code>
DOM attribute; for <code>textarea</code> elements this means
updating the <code title=
"dom-textarea-defaultValue">defaultValue</code> DOM attribute as
well as the <code title="dom-textarea-value">value</code> DOM
attribute. (Updating the <code title="">default*</code> DOM
attributes causes content attributes to be updated as well.)</p>
</dd>
</dl>
<p>User agents may perform several commands per user request; for
example if the user selects a block of text and hits
<kbd><kbd>Enter</kbd></kbd> , the UA might interpret that as a
request to delete the content of <a href="#a-selection">the
selection</a> followed by a request to break the paragraph at that
position.</p>
<h4 id="making"><span class="secno"><del class=
"diff-old">5.2.2.</del> <ins class="diff-chg">5.2.2</ins></span>
Making entire documents editable</h4>
<p>Documents have a <dfn id="designMode" title=
"dom-document-designMode"><code>designMode</code></dfn> , which can
be either enabled or disabled.</p>
<p>The <code title="dom-document-designMode"><a href=
"#designMode">designMode</a></code> DOM attribute on the
<code>Document</code> object takes <del class=
"diff-old">takes</del> two values, " <code title="">on</code> " and
" <code title="">off</code> ". When it is set, the new value must
be case-insensitively compared to these two values. If it matches
the " <code title="">on</code> " value, then <code title=
"dom-document-designMode"><a href=
"#designMode">designMode</a></code> must be enabled, and if it
matches the " <code title="">off</code> " value, then <code title=
"dom-document-designMode"><a href=
"#designMode">designMode</a></code> must be disabled. Other values
must be ignored.</p>
<p>When <code title="dom-document-designMode"><a href=
"#designMode">designMode</a></code> is enabled, the DOM attribute
must return the value " <code title="">on</code> ", and when it is
disabled, it must return the value " <code title="">off</code>
".</p>
<p>The last state set must persist until the document is destroyed
or the state is changed. Initially, documents must have their
<code title="dom-document-designMode"><a href=
"#designMode">designMode</a></code> disabled.</p>
<p>Enabling <code title="dom-document-designMode"><a href=
"#designMode">designMode</a></code> <a href=
"#designModeScriptBlocked">causes scripts in general to be
disabled</a> and the document to become editable. <del class=
"diff-old">When the Document has designMode enabled, event
listeners registered on the document or any elements owned by the
document must do nothing.</del></p>
<h3 id="dnd"><span class="secno"><del class="diff-old">5.3.</del>
<ins class="diff-chg">5.3</ins></span> <dfn id="drag-and">Drag and
drop</dfn></h3>
<p>This section defines an event-based drag-and-drop mechanism.</p>
<p>This specification does not define exactly what a
<em>drag-and-drop operation</em> actually is.</p>
<p>On a visual medium with a pointing device, a drag operation
could be the default action of a <code title=
"event-mousedown">mousedown</code> event that is followed by a
series of <code title="event-mousemove">mousemove</code> events,
and the drop could be triggered by the mouse being released.</p>
<p>On media without a pointing device, the user would probably have
to explicitly indicate his intention to perform a drag-and-drop
operation, stating what he wishes to drag and what he wishes to
drop, respectively.</p>
<p>However it is implemented, drag-and-drop operations must have a
starting point (e.g. where the mouse was clicked, or the start of
<a href="#a-selection">the selection</a> or element that was
selected for the drag), may have any number of intermediate steps
(elements that the mouse moves over during a drag, or elements that
the user picks as possible drop points as he cycles through
possibilities), and must either have an end point (the element
above which the mouse button was released, or the element that was
finally selected), or be canceled. The end point must be the last
element selected as a possible drop point before the drop occurs
(so if the operation is not canceled, there must be at least one
element in the middle step).</p>
<h4 id="introduction4"><span class="secno"><ins class=
"diff-new">5.3.1</ins></span> <ins class=
"diff-new">Introduction</ins></h4>
<p><em><ins class="diff-new">This section is
non-normative.</ins></em></p>
<p class="big-issue"><ins class="diff-new">It's also currently
non-existent.</ins></p>
<h4 id="the-dragevent"><span class="secno"><del class=
"diff-old">5.3.1.</del> <ins class="diff-chg">5.3.2</ins></span>
The <code><a href="#dragevent">DragEvent</a></code> and
<code><a href="#datatransfer0">DataTransfer</a></code>
interfaces</h4>
<p>The drag-and-drop processing model involves several events. They
all use the <code><a href="#dragevent">DragEvent</a></code>
interface.</p>
<pre class="idl">
interface <dfn id="dragevent">DragEvent</dfn> : UIEvent {
readonly attribute <a href=
"#datatransfer0">DataTransfer</a> <a href="#datatransfer" title=
"dom-DragEvent-dataTransfer">dataTransfer</a>;
void <a href="#initdragevent" title=
"dom-DragEvent-initDragEvent">initDragEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in AbstractView viewArg, in long detailArg, in <a href="#datatransfer0">DataTransfer</a> dataTransferArg);
void <a href="#initdrageventns" title=
"dom-DragEvent-initDragEventNS">initDragEventNS</a>(in DOMString namespaceURIArg, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in AbstractView viewArg, in long detailArg, in <a href="#datatransfer0">DataTransfer</a> dataTransferArg);
};
</pre>
<p class="issue">We should have modifier key information in here
too (shift/ctrl, etc), like with mouse events and like with the
context menu event.</p>
<p>The <dfn id="initdragevent" title=
"dom-DragEvent-initDragEvent"><code>initDragEvent()</code></dfn>
and <dfn id="initdrageventns" title=
"dom-DragEvent-initDragEventNS"><code>initDragEventNS()</code></dfn>
methods must initialise the event in a manner analogous to the
similarly-named methods in the DOM3 Events interfaces. <a href=
"#references">[DOM3EVENTS]</a></p>
<p>The <dfn id="datatransfer" title=
"dom-DragEvent-dataTransfer"><code>dataTransfer</code></dfn>
attribute of the <code><a href="#dragevent">DragEvent</a></code>
interface represents the context information for the event.
<del class="diff-old">When a DragEvent object is created, a new
DataTransfer object must be created and assigned to the
dataTransfer context information field of the event
object.</del></p>
<pre class="idl">
interface <dfn id="datatransfer0">DataTransfer</dfn> {
attribute DOMString <a href="#dropeffect" title=
"dom-DataTransfer-dropEffect">dropEffect</a>;
attribute DOMString <a href="#effectallowed" title=
"dom-DataTransfer-effectAllowed">effectAllowed</a>;
<ins class="diff-new"> readonly attribute DOMStringList <a href=
"#types" title="dom-DataTransfer-types">types</a>;
</ins>
void <a href="#cleardata" title=
"dom-DataTransfer-clearData">clearData</a>(in DOMString format);
void <a href="#setdata" title=
"dom-DataTransfer-setData">setData</a>(in DOMString format, in DOMString data);
DOMString <a href="#getdata" title=
"dom-DataTransfer-getData">getData</a>(in DOMString format);
void <a href="#setdragimage" title=
"dom-DataTransfer-setDragImage">setDragImage</a>(in Element image, in long x, in long y);
void <a href="#addelement" title=
"dom-DataTransfer-addElement">addElement</a>(in Element element);
};
</pre>
<p><code><a href="#datatransfer0">DataTransfer</a></code> objects
can conceptually contain various kinds of data.</p>
<p>When a <code><del class="diff-old">DragEvent event object is
initialised, the</del> <a href=
"#datatransfer0">DataTransfer</a></code> object <del class=
"diff-old">created for the event's dataTransfer member</del>
<ins class="diff-chg">is created, it</ins> must be <del class=
"diff-old">initialised</del> <ins class=
"diff-chg">initialized</ins> as follows:</p>
<ul>
<li>The <code><a href="#datatransfer0">DataTransfer</a></code>
object must initially contain no data, no elements, and have no
associated image.</li>
<li>The <code><a href="#datatransfer0">DataTransfer</a></code>
object's <code title="dom-DataTransfer-effectAllowed"><a href=
"#effectallowed">effectAllowed</a></code> attribute must be set to
" <code title="">uninitialized</code> ".</li>
<li>The <code title="dom-DataTransfer-dropEffect"><a href=
"#dropeffect">dropEffect</a></code> attribute must be set to "
<code title="">none</code> ".</li>
</ul>
<p>The <dfn id="dropeffect" title=
"dom-DataTransfer-dropEffect"><code>dropEffect</code></dfn>
attribute controls the drag-and-drop feedback that the user is
given during a drag-and-drop operation.</p>
<p>The attribute must ignore any attempts to set it to a value
other than <code title="">none</code> , <code title="">copy</code>
, <code title="">link</code> , and <code title="">move</code> . On
getting, the attribute must return the last of those four values
that it was set to.</p>
<p>The <dfn id="effectallowed" title=
"dom-DataTransfer-effectAllowed"><code>effectAllowed</code></dfn>
attribute is used in the drag-and-drop processing model to
initialise the <code title="dom-DataTransfer-dropEffect"><a href=
"#dropeffect">dropEffect</a></code> attribute during the
<code title="event-dragenter"><a href=
"#dragenter">dragenter</a></code> and <code title=
"event-dragover"><a href="#dragover">dragover</a></code>
events.</p>
<p>The attribute must ignore any attempts to set it to a value
other than <code title="">none</code> , <code title="">copy</code>
, <code title="">copyLink</code> , <code title="">copyMove</code> ,
<code title="">link</code> , <code title="">linkMove</code> ,
<code title="">move</code> , <code title="">all</code> , and
<code title="">uninitialized</code> . On getting, the attribute
must return the last of those values that it was set to.</p>
<p><code><a href="#datatransfer0">DataTransfer</a></code> objects
can hold pieces of data, each associated with a unique format.
Formats are generally given by MIME types, with some values
special-cased for legacy reasons.</p>
<p>The <dfn id="cleardata" title=
"dom-DataTransfer-clearData"><code>clearData( <var title=
"">format</var> )</code></dfn> method must clear the <code><a href=
"#datatransfer0">DataTransfer</a></code> object of any data
associated with the given <var title="">format</var> . If
<var title="">format</var> is the value " <code title=
"">Text</code> ", then it must be treated as " <code title=
"">text/plain</code> ". If the <var title="">format</var> is "
<code title="">URL</code> ", then it must be treated as "
<code title="">text/uri-list</code> ".</p>
<p>The <dfn id="setdata" title=
"dom-DataTransfer-setData"><code>setData( <var title=
"">format</var> , <var title="">data</var> )</code></dfn> method
must add <var title="">data</var> to the data stored in the
<code><a href="#datatransfer0">DataTransfer</a></code> object,
<del class="diff-old">labelled</del> <ins class=
"diff-chg">labeled</ins> as being of the type <var title=
"">format</var> . This must replace any previous data that had been
set for that format. If <var title="">format</var> is the value "
<code title="">Text</code> ", then it must be treated as "
<code title="">text/plain</code> ". If the <var title=
"">format</var> is " <code title="">URL</code> ", then it must be
treated as " <code title="">text/uri-list</code> ".</p>
<p>The <dfn id="getdata" title=
"dom-DataTransfer-getData"><code>getData( <var title=
"">format</var> )</code></dfn> method must return the data that is
associated with the type <var title="">format</var> , if any, and
must return the empty string otherwise. If <var title=
"">format</var> is the value " <code title="">Text</code> ", then
it must be treated as " <code title="">text/plain</code> ". If the
<var title="">format</var> is " <code title="">URL</code> ", then
the data associated with the " <code title="">text/uri-list</code>
" format must be parsed as appropriate for <code title=
"">text/uri-list</code> data, and the first URI from the list must
be returned. If there is no data with that format, or if there is
but it has no URIs, then the method must return the empty string.
<a href="#references">[RFC2483]</a></p>
<p>The <dfn id="types" title=
"dom-DataTransfer-types"><code><ins class=
"diff-new">types</ins></code></dfn> <ins class="diff-new">attribute
must return a live</ins> <code><ins class=
"diff-new">DOMStringList</ins></code> <ins class="diff-new">that
contains the list of formats that are stored in the</ins>
<code><a href="#datatransfer0"><ins class=
"diff-new">DataTransfer</ins></a></code> <ins class=
"diff-new">object.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="setdragimage" title=
"dom-DataTransfer-setDragImage"><code>setDragImage( <var title=
"">element</var> , <var title="">x</var> , <var title="">y</var>
)</code></dfn> method sets which element to use <a href=
"#base-dnd-feedback">to generate the drag feedback</a> . The
<var title="">element</var> argument can be any
<code>Element</code> ; if it is an <code><a href=
"#img">img</a></code> element, then the user agent should use the
element's image (at its intrinsic size) to generate the feedback,
otherwise the user agent should base the feedback on the given
element (but the exact mechanism for doing so is not
specified).</p>
<p>The <dfn id="addelement" title=
"dom-DataTransfer-addElement"><code>addElement( <var title=
"">element</var> )</code></dfn> method is an alternative way of
specifying how the user agent is to <a href=
"#base-dnd-feedback">render the drag feedback</a> . It adds an
element to the <code><a href=
"#datatransfer0">DataTransfer</a></code> object.</p>
<h4 id="events1"><span class="secno"><del class=
"diff-old">5.3.2.</del> <ins class="diff-chg">5.3.3</ins></span>
Events fired during a drag-and-drop action</h4>
<p>The following events are involved in the drag-and-drop model.
Whenever the processing model described below causes one of these
events to be fired, the event fired must use the <code><a href=
"#dragevent">DragEvent</a></code> interface defined above, must
have the bubbling and cancelable <del class=
"diff-old">behaviours</del> <ins class="diff-chg">behaviors</ins>
given in the table below, and must have the context information set
up as described after the table, with the <code title=
"dom-UIEvent-view">view</code> attribute set to the view with which
the user interacted to trigger the drag-and-drop event, and the
<code title="dom-UIEvent-detail">detail</code> attribute set to
zero.</p>
<table>
<thead>
<tr>
<th>Event Name</th>
<th>Target</th>
<th>Bubbles?</th>
<th>Cancelable?</th>
<th><code title="dom-DataTransfer-addElement"><a href=
"#addelement">dataTransfer</a></code></th>
<th><code title="dom-DataTransfer-effectAllowed"><a href=
"#effectallowed">effectAllowed</a></code></th>
<th><code title="dom-DataTransfer-dropEffect"><a href=
"#dropeffect">dropEffect</a></code></th>
<th>Default Action</th>
</tr>
</thead>
<tbody>
<tr>
<td><dfn id="dragstart" title=
"event-dragstart"><code>dragstart</code></dfn></td>
<td><a href="#source2">Source node</a></td>
<td>✓ Bubbles</td>
<td>✓ Cancelable</td>
<td>Contains <a href="#source2">source node</a> unless a selection
is being dragged, in which case it is empty</td>
<td><code title="">uninitialized</code></td>
<td><code title="">none</code></td>
<td>Initiate the drag-and-drop operation</td>
</tr>
<tr>
<td><dfn id="drag" title="event-drag"><code>drag</code></dfn></td>
<td><a href="#source2">Source node</a></td>
<td>✓ Bubbles</td>
<td>✓ Cancelable</td>
<td>Empty</td>
<td><a href="#effectAllowed-initialization">Same as last
event</a></td>
<td><code title="">none</code></td>
<td>Continue the drag-and-drop operation</td>
</tr>
<tr>
<td><dfn id="dragenter" title=
"event-dragenter"><code>dragenter</code></dfn></td>
<td><a href="#immediate">Immediate user selection</a> or <a href=
"#the-body1">the body element</a></td>
<td>✓ Bubbles</td>
<td>✓ Cancelable</td>
<td>Empty</td>
<td><a href="#effectAllowed-initialization">Same as last
event</a></td>
<td><a href="#dropEffect-initialization">Based on
<code>effectAllowed</code> value</a></td>
<td>Reject <a href="#immediate">immediate user selection</a> as
potential <a href="#current2" title="current target element">target
element</a></td>
</tr>
<tr>
<td><dfn id="dragleave" title=
"event-dragleave"><code>dragleave</code></dfn></td>
<td><a href="#current2" title="current target element">Previous
target element</a></td>
<td>✓ Bubbles</td>
<td>—</td>
<td>Empty</td>
<td><a href="#effectAllowed-initialization">Same as last
event</a></td>
<td><code title="">none</code></td>
<td>None</td>
</tr>
<tr>
<td><dfn id="dragover" title=
"event-dragover"><code>dragover</code></dfn></td>
<td><a href="#current2">Current target element</a></td>
<td>✓ Bubbles</td>
<td>✓ Cancelable</td>
<td>Empty</td>
<td><a href="#effectAllowed-initialization">Same as last
event</a></td>
<td><a href="#dropEffect-initialization">Based on
<code>effectAllowed</code> value</a></td>
<td>Reset the <a href="#current3">current drag operation</a> to
"none"</td>
</tr>
<tr>
<td><dfn id="drop" title="event-drop"><code>drop</code></dfn></td>
<td><a href="#current2">Current target element</a></td>
<td>✓ Bubbles</td>
<td>✓ Cancelable</td>
<td><code>getData()</code> returns data set in <code title=
"dom-dragstart">dragstart</code> event</td>
<td><a href="#effectAllowed-initialization">Same as last
event</a></td>
<td><a href="#current3">Current drag operation</a></td>
<td>Varies</td>
</tr>
<tr>
<td><dfn id="dragend" title=
"event-dragend"><code>dragend</code></dfn></td>
<td><a href="#source2">Source node</a></td>
<td>✓ Bubbles</td>
<td>—</td>
<td>Empty</td>
<td><a href="#effectAllowed-initialization">Same as last
event</a></td>
<td><a href="#current3">Current drag operation</a></td>
<td>Varies</td>
</tr>
</tbody>
</table>
<p>The <code title="dom-DragEvent-dataTransfer"><a href=
"#datatransfer">dataTransfer</a></code> object's contents are empty
except for <code title="event-dragstart"><a href=
"#dragstart">dragstart</a></code> events and <code title=
"event-drop"><a href="#drop">drop</a></code> events, for which the
contents are set as described in the processing model, below.</p>
<p id="effectAllowed-initialization">The <code title=
"dom-DataTransfer-effectAllowed"><a href=
"#effectallowed">effectAllowed</a></code> attribute must be set to
" <code title="">uninitialized</code> " for <code title=
"event-dragstart"><a href="#dragstart">dragstart</a></code> events,
and to whatever value the field had after the last drag-and-drop
event was fired for all other events (only counting events fired by
the user agent for the purposes of the drag-and-drop model
described below).</p>
<p id="dropEffect-initialization">The <code title=
"dom-DataTransfer-dropEffect"><a href=
"#dropeffect">dropEffect</a></code> attribute must be set to "
<code title="">none</code> " for <code title=
"event-dragstart"><a href="#dragstart">dragstart</a></code> ,
<code title="event-drag"><a href="#drag">drag</a></code> , and
<code title="event-dragleave"><a href=
"#dragleave">dragleave</a></code> events (except when stated
otherwise in the algorithms given in the sections below), to the
value corresponding to the <a href="#current3">current drag
operation</a> for <code title="event-drop"><a href=
"#drop">drop</a></code> and <code title="event-dragend"><a href=
"#dragend">dragend</a></code> events, and to a value based on the
<code title="dom-DataTransfer-effectAllowed"><a href=
"#effectallowed">effectAllowed</a></code> attribute's value and to
the drag-and-drop source, as given by the following table, for the
remaining events ( <code title="event-dragenter"><a href=
"#dragenter">dragenter</a></code> and <code title=
"event-dragover"><a href="#dragover">dragover</a></code> ):</p>
<table>
<thead>
<tr>
<th><code title="dom-DataTransfer-effectAllowed"><a href=
"#effectallowed">effectAllowed</a></code></th>
<th><code title="dom-DataTransfer-dropEffect"><a href=
"#dropeffect">dropEffect</a></code></th>
</tr>
</thead>
<tbody>
<tr>
<td><code title="">none</code></td>
<td><code title="">none</code></td>
</tr>
<tr>
<td><code title="">copy</code> , <code title="">copyLink</code> ,
<code title="">copyMove</code> , <code title="">all</code></td>
<td><code title="">copy</code></td>
</tr>
<tr>
<td><code title="">link</code> , <code title=
"">linkMove</code></td>
<td><code title="">link</code></td>
</tr>
<tr>
<td><code title="">move</code></td>
<td><code title="">move</code></td>
</tr>
<tr>
<td><code title="">uninitialized</code> when what is being dragged
is a selection from a text field</td>
<td><code title="">move</code></td>
</tr>
<tr>
<td><code title="">uninitialized</code> when what is being dragged
is a selection</td>
<td><code title="">copy</code></td>
</tr>
<tr>
<td><code title="">uninitialized</code> when what is being dragged
is an <code><a href="#a">a</a></code> element with an
<code>href</code> attribute</td>
<td><code title="">link</code></td>
</tr>
<tr>
<td>Any other case</td>
<td><code title="">copy</code></td>
</tr>
</tbody>
</table>
<h4 id="drag-and-drop"><span class="secno"><del class=
"diff-old">5.3.3.</del> <ins class="diff-chg">5.3.4</ins></span>
Drag-and-drop processing model</h4>
<p>When the user attempts to begin a drag operation, the user agent
must first determine what is being dragged. If the drag operation
was invoked on a selection, then it is the selection that is being
dragged. Otherwise, it is the first element, going up the ancestor
chain, starting at the node that the user tried to drag, that has
the DOM attribute <code title="dom-draggable"><a href=
"#draggable0">draggable</a></code> set to true. If there is no such
element, then nothing is being dragged, the drag-and-drop operation
is never started, and the user agent must not continue with this
algorithm.</p>
<p class="note"><code><a href="#img">img</a></code> elements and
<code><a href="#a">a</a></code> elements with an <code title=
"attr-hyperlink-href"><a href="#href6">href</a></code> attribute
have their <code title="dom-draggable"><a href=
"#draggable0">draggable</a></code> attribute set to true by
default.</p>
<p>If the user agent determines that something can be dragged, a
<code title="event-dragstart"><a href=
"#dragstart">dragstart</a></code> event must then be fired.</p>
<p>If it is a selection that is being dragged, then this event must
be fired on the node that the user started the drag on (typically
the text node that the user originally clicked). If the user did
not specify a particular node, for example if the user just told
the user agent to begin a drag of "the selection", then the event
must be fired on the deepest node that is a common ancestor of all
parts of the selection.</p>
<p class="big-issue">We should look into how browsers do other
types (e.g. Firefox apparently also adds text/html for internal
drag and drop of a selection).</p>
<p>If it is not a selection that is being dragged, then the event
must be fired on the element that is being dragged.</p>
<p>The node on which the event is fired is the <dfn id=
"source2">source node</dfn> . Multiple events are fired on this
node during the course of the drag-and-drop operation.</p>
<p>If it is a selection that is being dragged, the <code title=
"dom-DragEvent-dataTransfer"><a href=
"#datatransfer">dataTransfer</a></code> member of the event must be
created with no nodes. Otherwise, it must be created containing
just the <a href="#source2">source node</a> . Script can use the
<code title="dom-DataTransfer-addElement"><a href=
"#addelement">addElement()</a></code> method to add further
elements to the list of what is being dragged.</p>
<p>If it is a selection that is being dragged, the <code title=
"dom-DragEvent-dataTransfer"><a href=
"#datatransfer">dataTransfer</a></code> member of the event must
have the text of the selection added to it as the data associated
with the <code title="">text/plain</code> format. Otherwise, if it
is an <code><a href="#img">img</a></code> element being dragged,
then the value of the element's <code title="dom-img-src"><a href=
"#src0">src</a></code> DOM attribute must be added, associated with
the <code title="">text/uri-list</code> format. Otherwise, if it is
an <code><a href="#a">a</a></code> element being dragged, then the
value of the element's <code title="dom-a-href"><a href=
"#href3">href</a></code> DOM attribute must be added, associated
with the <code title="">text/uri-list</code> format. Otherwise, no
data is added to the object by the user agent.</p>
<p>If the event is canceled, then the drag-and-drop operation must
not occur; the user agent must not continue with this
algorithm.</p>
<p>If it is not canceled, then the drag-and-drop operation must be
initiated.</p>
<p class="note">Since events with no event handlers registered are,
almost by definition, never canceled, drag-and-drop is always
available to the user if the author does not specifically prevent
it.</p>
<p id="base-dnd-feedback">The drag-and-drop feedback must be
generated from the first of the following sources that is
available:</p>
<ol>
<li>The element specified in the last call to the <code title=
"dom-DataTransfer-setDragImage"><a href=
"#setdragimage">setDragImage()</a></code> method of the
<code title="dom-DragEvent-dataTransfer"><a href=
"#datatransfer">dataTransfer</a></code> object of the <code title=
"event-dragstart"><a href="#dragstart">dragstart</a></code> event,
if the method was called. In visual media, if this is used, the
<var title="">x</var> and <var title="">y</var> arguments that were
passed to that method should be used as hints for where to put the
cursor relative to the resulting image. The values are expressed as
distances in CSS pixels from the left side and from the top side of
the image respectively. <a href="#references">[CSS21]</a></li>
<li>The elements that were added to the <code title=
"dom-DragEvent-dataTransfer"><a href=
"#datatransfer">dataTransfer</a></code> object, both before the
event was fired, and during the handling of the event using the
<code title="dom-DataTransfer-addElement"><a href=
"#addelement">addElement()</a></code> method, if any such elements
were indeed added.</li>
<li>The selection that the user is dragging.</li>
</ol>
<p>The user agent must take a note of <a href="#setdata" title=
"dom-DataTransfer-setData">the data that was placed</a> in the
<code title="dom-DragEvent-dataTransfer"><a href=
"#datatransfer">dataTransfer</a></code> object. This data will be
made available again when the <code title="event-drop"><a href=
"#drop">drop</a></code> event is fired.</p>
<p>From this point until the end of the drag-and-drop operation,
device input events (e.g. mouse and keyboard events) must be
suppressed. In addition, the user agent must track all DOM changes
made during the drag-and-drop operation, and add them to its
<a href="#undo">undo history</a> as one atomic operation once the
drag-and-drop operation has ended.</p>
<p>During the drag operation, the element directly indicated by the
user as the drop target is called the <dfn id="immediate">immediate
user selection</dfn> . (Only elements can be selected by the user;
other nodes must not be made available as drop targets.) However,
the <a href="#immediate">immediate user selection</a> is not
necessarily the <dfn id="current2">current target element</dfn> ,
which is the element currently selected for the drop part of the
drag-and-drop operation. The <a href="#immediate">immediate user
selection</a> changes as the user selects different elements
(either by pointing at them with a pointing device, or by selecting
them in some other way). The <a href="#current2">current target
element</a> changes when the <a href="#immediate">immediate user
selection</a> changes, based on the results of event handlers in
the document, as described below.</p>
<p>Both the <a href="#current2">current target element</a> and the
<a href="#immediate">immediate user selection</a> can be null,
which means no target element is selected. They can also both be
elements in other (DOM-based) documents, or other (non-Web)
programs altogether. (For example, a user could drag text to a
word-processor.) The <a href="#current2">current target element</a>
is initially null.</p>
<p>In addition, there is also a <dfn id="current3">current drag
operation</dfn> , which can take on the values "none", "copy",
"link", and "move". Initially it has the value "none". It is
updated by the user agent as described in the steps below.</p>
<p>User agents must, every 350ms (±200ms), perform the following
steps in sequence. (If the user agent is still performing the
previous iteration of the sequence when the next iteration becomes
due, the user agent must not execute the overdue iteration,
effectively "skipping missed frames" of the drag-and-drop
operation.)</p>
<ol>
<li>
<p>First, the user agent must fire a <code title=
"event-drag"><a href="#drag">drag</a></code> event at the <a href=
"#source2">source node</a> . If this event is canceled, the user
agent must set the <a href="#current3">current drag operation</a>
to none (no drag operation).</p>
</li>
<li>
<p>Next, if the <code title="event-drag"><a href=
"#drag">drag</a></code> event was not canceled and the user has not
ended the drag-and-drop operation, the user agent must check the
state of the drag-and-drop operation, as follows:</p>
<ol>
<li>
<p>First, if the user is indicating a different <a href=
"#immediate">immediate user selection</a> than during the last
iteration (or if this is the first iteration), and if this <a href=
"#immediate">immediate user selection</a> is not the same as the
<a href="#current2">current target element</a> , then the <a href=
"#current2">current target element</a> must be updated, as
follows:</p>
<ol>
<li>
<p>If the new <a href="#immediate">immediate user selection</a> is
null, or is in a non-DOM document or application, then set the
<a href="#current2">current target element</a> to the same
value.</p>
</li>
<li>
<p>Otherwise, the user agent must fire a <code title=
"event-dragenter"><a href="#dragenter">dragenter</a></code> event
at the <a href="#immediate">immediate user selection</a> .</p>
</li>
<li>
<p>If the event is canceled, then the <a href="#current2">current
target element</a> must be set to the <a href=
"#immediate">immediate user selection</a> .</p>
</li>
<li>
<p>Otherwise, if the <a href="#current2">current target element</a>
is not <a href="#the-body1">the body element</a> , the user agent
must fire a <code title="event-dragenter"><a href=
"#dragenter">dragenter</a></code> event at <a href="#the-body1">the
body element</a> , and the <a href="#current2">current target
element</a> must be set to <a href="#the-body1">the body
element</a> , regardless of whether that event was canceled or not.
(If <a href="#the-body1">the body element</a> is null, then the
<a href="#current2">current target element</a> would be set to null
too in this case, it wouldn't be set to the <code>Document</code>
object.)</p>
</li>
</ol>
</li>
<li>
<p>If the previous step caused the <a href="#current2">current
target element</a> to change, and if the previous target element
was not null or a part of a non-DOM document, the user agent must
fire a <code title="event-dragleave"><a href=
"#dragleave">dragleave</a></code> event at the previous target
element.</p>
</li>
<li>
<p>If the <a href="#current2">current target element</a> is a DOM
element, the user agent must fire a <code title=
"event-dragover"><a href="#dragover">dragover</a></code> event at
this <a href="#current2">current target element</a> .</p>
<p>If the <code title="event-dragover"><a href=
"#dragover">dragover</a></code> event is <ins class=
"diff-new">not</ins> canceled, the <a href="#current3">current drag
operation</a> must be reset to "none".</p>
<p>Otherwise, the <a href="#current3">current drag operation</a>
must be set based on the values the <code title=
"dom-DataTransfer-effectAllowed"><a href=
"#effectallowed">effectAllowed</a></code> and <code title=
"dom-DataTransfer-dropEffect"><a href=
"#dropeffect">dropEffect</a></code> attributes of the <code title=
"dom-DragEvent-dataTransfer"><a href=
"#datatransfer">dataTransfer</a></code> object had after the event
was handled, as per the following table:</p>
<table>
<thead>
<tr>
<th><code title="dom-DataTransfer-effectAllowed"><a href=
"#effectallowed">effectAllowed</a></code></th>
<th><code title="dom-DataTransfer-dropEffect"><a href=
"#dropeffect">dropEffect</a></code></th>
<th>Drag operation</th>
</tr>
</thead>
<tbody>
<tr>
<td><code title="">uninitialized</code> , <code title=
"">copy</code> , <code title="">copyLink</code> , <code title=
"">copyMove</code> , or <code title="">all</code></td>
<td><code title="">copy</code></td>
<td>"copy"</td>
</tr>
<tr>
<td><code title="">uninitialized</code> , <code title=
"">link</code> , <code title="">copyLink</code> , <code title=
"">linkMove</code> , or <code title="">all</code></td>
<td><code title="">link</code></td>
<td>"link"</td>
</tr>
<tr>
<td><code title="">uninitialized</code> , <code title=
"">move</code> , <code title="">copyMove</code> , <code title=
"">linkMove</code> , or <code title="">all</code></td>
<td><code title="">move</code></td>
<td>"move"</td>
</tr>
<tr>
<td colspan="2">Any other case</td>
<td>"none"</td>
</tr>
</tbody>
</table>
<p>Then, regardless of whether the <code title=
"event-dragover"><a href="#dragover">dragover</a></code> event was
canceled or not, the drag feedback (e.g. the mouse cursor) must be
updated to match the <a href="#current3">current drag operation</a>
, as follows:</p>
<table>
<thead>
<tr>
<th>Drag operation</th>
<th>Feedback</th>
</tr>
</thead>
<tbody>
<tr>
<td>"copy"</td>
<td>Data will be copied if dropped here.</td>
</tr>
<tr>
<td>"link"</td>
<td>Data will be linked if dropped here.</td>
</tr>
<tr>
<td>"move"</td>
<td>Data will be moved if dropped here.</td>
</tr>
<tr>
<td>"none"</td>
<td>No operation allowed, dropping here will cancel the
drag-and-drop operation.</td>
</tr>
</tbody>
</table>
</li>
<li>
<p>Otherwise, if the <a href="#current2">current target element</a>
is not a DOM element, the user agent must use platform-specific
mechanisms to determine what drag operation is being performed
(none, copy, link, or move). This sets the <em><a href=
"#current3">current drag operation</a></em> .</p>
</li>
</ol>
</li>
<li>
<p>Otherwise, if the user ended the drag-and-drop operation (e.g.
by releasing the mouse button in a mouse-driven drag-and-drop
interface), or if the <code title="event-drag"><a href=
"#drag">drag</a></code> event was canceled, then this will be the
last iteration. The user agent must execute the following steps,
then stop looping.</p>
<ol>
<li>
<p>If the <a href="#current3">current drag operation</a> is none
(no drag operation), or, if the user ended the drag-and-drop
operation by canceling it (e.g. by hitting the <kbd>Escape</kbd>
key), or if the <a href="#current2">current target element</a> is
null, then the drag operation failed. If the <a href=
"#current2">current target element</a> is a DOM element, the user
agent must fire a <code title="event-dragleave"><a href=
"#dragleave">dragleave</a></code> event at it; otherwise, if it is
not null, it must use platform-specific conventions for drag
cancellation.</p>
</li>
<li>
<p>Otherwise, the drag operation was as success. If the <a href=
"#current2">current target element</a> is a DOM element, the user
agent must fire a <code title="event-drop"><a href=
"#drop">drop</a></code> event at it; otherwise, it must use
platform-specific conventions for indicating a drop.</p>
<p>When the target is a DOM element, the <code title=
"dom-DataTransfer-dropEffect"><a href=
"#dropeffect">dropEffect</a></code> attribute of the event's
<code title="dom-DragEvent-dataTransfer"><a href=
"#datatransfer">dataTransfer</a></code> object must be given the
value representing the <a href="#current3">current drag
operation</a> ( <code title="">copy</code> , <code title=
"">link</code> , or <code title="">move</code> ), and the object
must be set up so that the <code title=
"dom-DataTransfer-getData"><a href="#getdata">getData()</a></code>
method will return the data that was added during the <code title=
"event-dragstart"><a href="#dragstart">dragstart</a></code>
event.</p>
<p>If the event is canceled, the <a href="#current3">current drag
operation</a> must be set to the value of the <code title=
"dom-DataTransfer-dropEffect"><a href=
"#dropeffect">dropEffect</a></code> attribute of the event's
<code title="dom-DragEvent-dataTransfer"><a href=
"#datatransfer">dataTransfer</a></code> object as it stood after
the event was handled.</p>
<p>Otherwise, the event is not canceled, and the user agent must
perform the event's default action, which depends on the exact
target as follows:</p>
<dl class="switch">
<dt>If the <a href="#current2">current target element</a> is a text
field (e.g. <code>textarea</code> , or an <code>input</code>
element with <code title="">type="text"</code> )</dt>
<dd>The user agent must insert the data associated with the
<code>text/plain</code> format, if any, into the text field in a
manner consistent with platform-specific conventions (e.g.
inserting it at the current mouse cursor position, or inserting it
at the end of the field).</dd>
<dt>Otherwise</dt>
<dd>Reset the <a href="#current3">current drag operation</a> to
"none".</dd>
</dl>
</li>
<li>
<p>Finally, the user agent must fire a <code title=
"event-dragend"><a href="#dragend">dragend</a></code> event at the
<a href="#source2">source node</a> , with the <code title=
"dom-DataTransfer-dropEffect"><a href=
"#dropeffect">dropEffect</a></code> attribute of the event's
<code title="dom-DragEvent-dataTransfer"><a href=
"#datatransfer">dataTransfer</a></code> object being set to the
value corresponding to the <a href="#current3">current drag
operation</a> .</p>
<p class="note">The <a href="#current3">current drag operation</a>
can change during the processing of the <code title=
"event-drop"><a href="#drop">drop</a></code> event, if one was
fired.</p>
<p>The event is not cancelable. After the event has been handled,
the user agent must act as follows:</p>
<dl class="switch">
<dt>If the <a href="#current2">current target element</a> is a text
field (e.g. <code>textarea</code> , or an <code>input</code>
element with <code title="">type="text"</code> ), and a
<code title="event-drop"><a href="#drop">drop</a></code> event was
fired in the previous step, and the <a href="#current3">current
drag operation</a> is "move", and the source of the drag-and-drop
operation is a selection in the DOM</dt>
<dd>The user agent should delete the range representing the dragged
selection from the DOM.</dd>
<dt>If the <a href="#current2">current target element</a> is a text
field (e.g. <code>textarea</code> , or an <code>input</code>
element with <code title="">type="text"</code> ), and a
<code title="event-drop"><a href="#drop">drop</a></code> event was
fired in the previous step, and the <a href="#current3">current
drag operation</a> is "move", and the source of the drag-and-drop
operation is a selection in a text field</dt>
<dd>The user agent should delete the dragged selection from the
relevant text field.</dd>
<dt>Otherwise</dt>
<dd>The event has no default action.</dd>
</dl>
</li>
</ol>
</li>
</ol>
<h5 id="when-the"><span class="secno"><del class=
"diff-old">5.3.3.1.</del> <ins class=
"diff-chg">5.3.4.1.</ins></span> When the drag-and-drop operation
starts or ends in another document</h5>
<p>The model described above is independent of which
<code>Document</code> object the nodes involved are from; the
events must be fired as described above and the rest of the
processing model must be followed as described above, irrespective
of how many documents are involved in the operation.</p>
<h5 id="when-the0"><span class="secno"><del class=
"diff-old">5.3.3.2.</del> <ins class=
"diff-chg">5.3.4.2.</ins></span> When the drag-and-drop operation
starts or ends in another application</h5>
<p>If the drag is initiated in another application, the <a href=
"#source2">source node</a> is not a DOM node, and the user agent
must use platform-specific conventions instead when the
requirements above involve the source node. User agents in this
situation must act as if the dragged data had been added to the
<code><a href="#datatransfer0">DataTransfer</a></code> object when
the drag started, even though no <code title=
"event-dragstart"><a href="#dragstart">dragstart</a></code> event
was actually fired; user agents must similarly use
platform-specific conventions when deciding on what drag feedback
to use.</p>
<p>If a drag is started in a document but ends in another
application, then the user agent must instead replace the parts of
the processing model relating to handling the <em>target</em>
according to platform-specific conventions.</p>
<p>In any case, scripts running in the context of the document must
not be able to distinguish the case of a drag-and-drop operation
being started or ended in another application from the case of a
drag-and-drop operation being started or ended in another document
from another domain.</p>
<h4 id="the-draggable"><span class="secno"><del class=
"diff-old">5.3.4.</del> <ins class="diff-chg">5.3.5</ins></span>
The <dfn id="draggable" title=
"attr-draggable"><code>draggable</code></dfn> attribute</h4>
<p>All elements may have the <code title="attr-draggable"><a href=
"#draggable">draggable</a></code> content attribute set. The
<code title="attr-draggable"><a href=
"#draggable">draggable</a></code> attribute is an <a href=
"#enumerated">enumerated attribute</a> . It has three states. The
first state is <em>true</em> and it has the keyword <code title=
"">true</code> . The second state is <em>false</em> and it has the
keyword <code title="">false</code> . The third state is
<em>auto</em> ; it has no keywords but it is the <em>missing value
default</em> .</p>
<p>The <dfn id="draggable0" title=
"dom-draggable"><code>draggable</code></dfn> DOM attribute, whose
value depends on the content attribute's in the way described
below, controls whether or not the element is draggable. Generally,
only text selections are draggable, but elements whose <code title=
"dom-draggable"><a href="#draggable0">draggable</a></code> DOM
attribute is true become draggable as well.</p>
<p>If an element's <code title="attr-draggable"><a href=
"#draggable">draggable</a></code> content attribute has the state
<em>true</em> , the <code title="dom-draggable"><a href=
"#draggable0">draggable</a></code> DOM attribute must return
true.</p>
<p>Otherwise, if the element's <code title=
"attr-draggable"><a href="#draggable">draggable</a></code> content
attribute has the state <em>false</em> , the <code title=
"dom-draggable"><a href="#draggable0">draggable</a></code> DOM
attribute must return false.</p>
<p>Otherwise, the element's <code title="attr-draggable"><a href=
"#draggable">draggable</a></code> content attribute has the state
<em>auto</em> . If the element is an <code><a href=
"#img">img</a></code> element, or, if the element is an
<code><a href="#a">a</a></code> element with an <code title=
"attr-hyperlink-href"><a href="#href6">href</a></code> content
attribute, the <code title="dom-draggable"><a href=
"#draggable0">draggable</a></code> DOM attribute must return
true.</p>
<p>Otherwise, the <code title="dom-draggable"><a href=
"#draggable0">draggable</a></code> DOM must return false.</p>
<p>If the <code title="dom-draggable"><a href=
"#draggable0">draggable</a></code> DOM attribute is set to the
value false, the <code title="attr-draggable"><a href=
"#draggable">draggable</a></code> content attribute must be set to
the literal value <code title="">false</code> . If the <code title=
"dom-draggable"><a href="#draggable0">draggable</a></code> DOM
attribute is set to the value true, the <code title=
"attr-draggable"><a href="#draggable">draggable</a></code> content
attribute must be set to the literal value <code title=
"">true</code> .</p>
<h4 id="copy-and"><span class="secno"><del class=
"diff-old">5.3.5.</del> <ins class="diff-chg">5.3.6</ins></span>
Copy and paste</h4>
<p>Copy-and-paste is a form of drag-and-drop: the "copy" part is
equivalent to dragging content to another application (the
"clipboard"), and the "paste" part is equivalent to dragging
content <em>from</em> another application.</p>
<p>Select-and-paste (a model used by mouse operations in the X
Window System) is equivalent to a drag-and-drop operation where the
source is the selection.</p>
<h5 id="copy-to"><span class="secno"><del class=
"diff-old">5.3.5.1.</del> <ins class=
"diff-chg">5.3.6.1.</ins></span> Copy to clipboard</h5>
<p>When the user invokes a copy operation, the user agent must act
as if the user had invoked a drag on the current selection. If the
drag-and-drop operation initiates, then the user agent must act as
if the user had indicated (as the <a href="#immediate">immediate
user selection</a> ) a hypothetical application representing the
<del class="diff-old">clipbroad.</del> <ins class=
"diff-chg">clipboard.</ins> Then, the user agent must act as if the
user had ended the drag-and-drop operation without canceling it. If
the drag-and-drop operation didn't get canceled, the user agent
should then follow the relevant platform-specific conventions for
copy operations (e.g. updating the clipboard).</p>
<h5 id="cut-to"><span class="secno"><del class=
"diff-old">5.3.5.2.</del> <ins class=
"diff-chg">5.3.6.2.</ins></span> Cut to clipboard</h5>
<p>When the user invokes a cut operation, the user agent must act
as if the user had invoked a copy operation (see the previous
section), followed, if the copy was completed successfully, by
<a href="#contenteditable-delete">a selection delete operation</a>
.</p>
<h5 id="paste"><span class="secno"><del class=
"diff-old">5.3.5.3.</del> <ins class=
"diff-chg">5.3.6.3.</ins></span> Paste from clipboard</h5>
<p>When the user invokes a clipboard paste operation, the user
agent must act as if the user had invoked a drag on a hypothetical
application representing the clipboard, setting the data associated
with the drag as the <del class="diff-old">text from the keyboard
(either as text/plain or text/uri-list ). If the contents of</del>
<ins class="diff-chg">content on</ins> the clipboard <del class=
"diff-old">cannot be represented as text or URIs, then the paste
operation must not have any effect.</del> <ins class="diff-chg">(in
whatever formats are available).</ins></p>
<p>Then, the user agent must act as if the user had indicated (as
the <a href="#immediate">immediate user selection</a> ) the element
with the keyboard focus, and then ended the drag-and-drop operation
without canceling it.</p>
<h5 id="paste0"><span class="secno"><del class=
"diff-old">5.3.5.4.</del> <ins class=
"diff-chg">5.3.6.4.</ins></span> Paste from selection</h5>
<p>When the user invokes a selection paste operation, the user
agent must act as if the user had invoked a drag on the current
selection, then indicated (as the <a href="#immediate">immediate
user selection</a> ) the element with the keyboard focus, and then
ended the drag-and-drop operation without canceling it. <del class=
"diff-old">If the contents of the selection cannot be represented
as text or URIs, then the paste operation must not have any
effect.</del></p>
<h4 id="security8"><span class="secno"><del class=
"diff-old">5.3.6.</del> <ins class="diff-chg">5.3.7</ins></span>
Security risks in the drag-and-drop model</h4>
<p>User agents must not make the data added to the <code><a href=
"#datatransfer0">DataTransfer</a></code> object during the
<code title="event-dragstart"><a href=
"#dragstart">dragstart</a></code> event available to scripts until
the <code title="event-drop"><a href="#drop">drop</a></code> event,
because otherwise, if a user were to drag sensitive information
from one document to a second document, crossing a hostile third
document in the process, the hostile document could intercept the
data.</p>
<p>For the same reason, user agents must <del class=
"diff-old">only</del> consider a drop to be successful <ins class=
"diff-new">only</ins> if the user specifically ended the drag
operation — if any scripts end the drag operation, it must be
considered unsuccessful (canceled) and the <code title=
"event-drop"><a href="#drop">drop</a></code> event must not be
fired.</p>
<p>User agents should take care to not start drag-and-drop
operations in response to script actions. For example, in a
mouse-and-window environment, if a script moves a window while the
user has his mouse button depressed, the UA would not consider that
to start a drag. This is important because otherwise UAs could
cause data to be dragged from sensitive sources and dropped into
hostile documents without the user's consent.</p>
<h3 id="undo"><span class="secno"><del class="diff-old">5.4.</del>
<ins class="diff-chg">5.4</ins></span> <dfn id="undo-history">Undo
history</dfn></h3>
<p class="big-issue">There has got to be a better way of doing
this, surely.</p>
<p>The user agent must associate an <dfn id="undo-transaction">undo
transaction history</dfn> with each <code><a href=
"#htmldocument">HTMLDocument</a></code> object.</p>
<p>The <a href="#undo-transaction">undo transaction history</a> is
a list of entries. The entries are of two type: <a href=
"#dom-changes">DOM changes</a> and <a href="#undo-object" title=
"undo object">undo objects</a> .</p>
<p>Each <dfn id="dom-changes">DOM changes</dfn> entry in the
<a href="#undo-transaction">undo transaction history</a> consists
of batches of one or more of the following:</p>
<ul>
<li>Changes to the <a href="#content">content attributes</a> of an
<code>Element</code> node.</li>
<li>Changes to the <a href="#dom-attributes">DOM attributes</a> of
a <code>Node</code> .</li>
<li>Changes to the DOM hierarchy of nodes that are descendants of
the <code><a href="#htmldocument">HTMLDocument</a></code> object (
<code>parentNode</code> , <code>childNodes</code> ).</li>
</ul>
<p><dfn id="undo-object">Undo object</dfn> entries consist of
objects representing state that scripts running in the document are
managing. For example, a Web mail application could use an <a href=
"#undo-object">undo object</a> to keep track of the fact that a
user has moved an e-mail to a particular folder, so that the user
can undo the action and have the e-mail return to its former
location.</p>
<p>Broadly speaking, <a href="#dom-changes">DOM changes</a> entries
are handled by the UA in response to user edits of form controls
and <span>editing hosts</span> on the page, and <a href=
"#undo-object">undo object</a> entries are handled by script in
response to higher-level user actions (such as interactions with
server-side state, or in the implementation of a drawing tool).</p>
<h4 id="the-undomanager"><span class="secno"><del class=
"diff-old">5.4.1.</del> <ins class="diff-chg">5.4.1</ins></span>
The <code><a href="#undomanager">UndoManager</a></code>
interface</h4>
<div class="big-issue">
<p>This API sucks. Seriously. It's a terrible API. Really bad. I
hate it. Here are the requirements:</p>
<ul>
<li>Has to cope with cases where the server has undo state already
when the page is loaded, that can be stuffed into the undo buffer
onload.</li>
<li>Has to support undo/redo.</li>
<li>Has to cope with the "undo" action being "contact the server
and tell it to undo", rather than it being the opposite of the
"redo" action.</li>
<li>Has to cope with some undo states expiring from the undo
history (e.g. server can only remember one undelete action) but
other states not expiring (e.g. client can undo arbitrary amounts
of local edits).</li>
</ul>
</div>
<p>To manage <a href="#undo-object">undo object</a> entries in the
<a href="#undo-transaction">undo transaction history</a> , the
<code><a href="#undomanager">UndoManager</a></code> interface can
be used:</p>
<pre class="idl">
interface <dfn id="undomanager">UndoManager</dfn> {
<del class=
"diff-old"> unsigned long (in DOMObject data, in DOMStrong title);
void (in unsigned long index);
</del>
<ins class="diff-chg"> unsigned long <a href="#adddata" title=
"dom-UndoManager-add">add</a>(in DOMObject data, in DOMString title);
[XXX] void <a href="#remove2" title=
"dom-UndoManager-remove">remove</a>(in unsigned long index);
</ins>
void <a href="#clearundo" title=
"dom-UndoManager-clearUndo">clearUndo</a>();
void <a href="#clearredo" title=
"dom-UndoManager-clearRedo">clearRedo</a>();
<del class="diff-old"> DOMObject (in unsigned long index);
readonly attribute unsigned long ;
</del>
<ins class="diff-chg"> [IndexGetter] DOMObject <a href="#itemn"
title="dom-UndoManager-item">item</a>(in unsigned long index);
readonly attribute unsigned long <a href="#length11" title=
"dom-UndoManager-length">length</a>;
</ins>
readonly attribute unsigned long <a href="#position0" title=
"dom-UndoManager-position">position</a>;
};
</pre>
<p>The <dfn id="undomanager0" title=
"dom-undoManager"><code>undoManager</code></dfn> attribute of the
<code><a href="#window">Window</a></code> interface must return the
object implementing the <code><a href=
"#undomanager">UndoManager</a></code> interface for that
<code><a href="#window">Window</a></code> object's associated
<code><a href="#htmldocument">HTMLDocument</a></code> object.</p>
<p><del class="diff-old">In the ECMAScript DOM binding, objects
implementing this interface must also support being dereferenced
using the square bracket notation, such that dereferencing with an
integer index is equivalent to invoking the item() method with that
index (e.g. undoManager[1] returns the same as undoManager.item(1)
).</del> <code><a href="#undomanager">UndoManager</a></code>
objects represent their document's <a href="#undo-transaction">undo
transaction history</a> . Only <a href="#undo-object">undo
object</a> entries are visible with this API, but this does not
mean that <a href="#dom-changes">DOM changes</a> entries are absent
from the <a href="#undo-transaction">undo transaction history</a>
.</p>
<p>The <dfn id="length11" title=
"dom-UndoManager-length"><code>length</code></dfn> attribute must
return the number of <a href="#undo-object">undo object</a> entries
in the <a href="#undo-transaction">undo transaction history</a>
.</p>
<p>The <dfn id="itemn" title="dom-UndoManager-item"><code>item(
<var title="">n</var> )</code></dfn> method must return the
<var title="">n</var> th <a href="#undo-object">undo object</a>
entry in the <a href="#undo-transaction">undo transaction
history</a> .</p>
<p>The <a href="#undo-transaction">undo transaction history</a> has
a <dfn id="current4" title="undo position">current position</dfn> .
This is the position between two entries in the <a href=
"#undo-transaction">undo transaction history</a> 's list where the
previous entry represents what needs to happen if the user invokes
the "undo" command (the "undo" side, lower numbers), and the next
entry represents what needs to happen if the user invokes the
"redo" command (the "redo" side, higher numbers).</p>
<p>The <dfn id="position0" title=
"dom-UndoManager-position"><code>position</code></dfn> attribute
must return the index of the <a href="#undo-object">undo object</a>
entry nearest to the <a href="#current4">undo position</a> , on the
"redo" side. If there are no <a href="#undo-object">undo object</a>
entries on the "redo" side, then the attribute must return the same
as the <code title="dom-UndoManager-length"><a href=
"#length11">length</a></code> attribute. If there are no <a href=
"#undo-object">undo object</a> entries on the "undo" side of the
<a href="#current4">undo position</a> , the <code title=
"dom-UndoManager-position"><a href="#position0">position</a></code>
attribute returns zero.</p>
<p class="note">Since the <a href="#undo-transaction">undo
transaction history</a> contains both <a href="#undo-object">undo
object</a> entries and <a href="#dom-changes">DOM changes</a>
entries, but the <code title="dom-UndoManager-position"><a href=
"#position0">position</a></code> attribute only returns indices
relative to <a href="#undo-object">undo object</a> entries, it is
possible for several "undo" or "redo" actions to be performed
without the value of the <code title=
"dom-UndoManager-position"><a href="#position0">position</a></code>
attribute changing.</p>
<p>The <dfn id="adddata" title="dom-UndoManager-add"><code>add(
<var title="">data</var> , <var title="">title</var> )</code></dfn>
method's <del class="diff-old">behaviour</del> <ins class=
"diff-chg">behavior</ins> depends on the current state. Normally,
it must insert the <var title="">data</var> object passed as an
argument into the <a href="#undo-transaction">undo transaction
history</a> immediately before the <a href="#current4">undo
position</a> , optionally remembering the given <var title=
"">title</var> to use in the UI. If the method is called <a href=
"#undo-moving0" title="do-undo">during an undo operation</a> ,
however, the object must instead be added immediately
<em>after</em> the <a href="#current4">undo position</a> .</p>
<p>If the method is called and there is neither <a href=
"#undo-moving0" title="do-undo">an undo operation in progress</a>
nor <a href="#redo-moving0" title="do-redo">a redo operation in
progress</a> then any entries in the <a href=
"#undo-transaction">undo transaction history</a> after the <a href=
"#current4">undo position</a> must be removed (as if <code title=
"dom-UndoManager-clearRedo"><a href=
"#clearredo">clearRedo()</a></code> had been called).</p>
<p class="big-issue">We could fire events when someone adds
something to the undo history -- one event per undo object entry
before the position (or after, during redo addition), allowing the
script to decide if that entry should remain or not. Or something.
Would make it potentially easier to expire server-held state when
the server limitations come into play.</p>
<p>The <dfn id="remove2" title=
"dom-UndoManager-remove"><code>remove( <var title="">index</var>
)</code></dfn> method must remove the <a href="#undo-object">undo
object</a> entry with the specified <var title="">index</var> . If
the index is less than zero or greater than or equal to
<code title="dom-UndoManager-length"><a href=
"#length11">length</a></code> then the method must raise an
<code>INDEX_SIZE_ERR</code> exception. <a href="#dom-changes">DOM
changes</a> entries are unaffected by this method.</p>
<p>The <dfn id="clearundo" title=
"dom-UndoManager-clearUndo"><code>clearUndo()</code></dfn> method
must remove all entries in the <a href="#undo-transaction">undo
transaction history</a> before the <a href="#current4">undo
position</a> , be they <a href="#dom-changes">DOM changes</a>
entries or <a href="#undo-object">undo object</a> entries.</p>
<p>The <dfn id="clearredo" title=
"dom-UndoManager-clearRedo"><code>clearRedo()</code></dfn> method
must remove all entries in the <a href="#undo-transaction">undo
transaction history</a> after the <a href="#current4">undo
position</a> , be they <a href="#dom-changes">DOM changes</a>
entries or <a href="#undo-object">undo object</a> entries.</p>
<p class="big-issue">Another idea is to have a way for scripts to
say "startBatchingDOMChangesForUndo()" and after that the changes
to the DOM go in as if the user had done them.</p>
<h4 id="undo-moving"><span class="secno"><del class=
"diff-old">5.4.2.</del> <ins class="diff-chg">5.4.2</ins></span>
<dfn id="undo-moving0" title="do-undo">Undo: moving back in the
undo transaction history</dfn></h4>
<p>When the user invokes an undo operation, or when the
<code title="dom-document-execCommand"><a href=
"#execCommand">execCommand()</a></code> method is called with the
<code title="command-undo"><a href="#undo1">undo</a></code>
command, the user agent must perform an undo operation.</p>
<p>If the <a href="#current4">undo position</a> is at the start of
the <a href="#undo-transaction">undo transaction history</a> , then
the user agent must do nothing.</p>
<p>If the entry immediately before the <a href="#current4">undo
position</a> is a <a href="#dom-changes">DOM changes</a> entry,
then the user agent must remove that <a href="#dom-changes">DOM
changes</a> entry, reverse the DOM changes that were listed in that
entry, and, if the changes were reversed with no problems, add a
new <a href="#dom-changes">DOM changes</a> entry (consisting of the
opposite of those DOM changes) to the <a href=
"#undo-transaction">undo transaction history</a> on the other side
of the <a href="#current4">undo position</a> .</p>
<p>If the DOM changes cannot be undone (e.g. because the DOM state
is no longer consistent with the changes represented in the entry),
then the user agent must simply remove the <a href=
"#dom-changes">DOM changes</a> entry, without doing anything
else.</p>
<p>If the entry immediately before the <a href="#current4">undo
position</a> is an <a href="#undo-object">undo object</a> entry,
then the user agent must first remove that <a href=
"#undo-object">undo object</a> entry from the <a href=
"#undo-transaction">undo transaction history</a> , and then must
fire an <code title="event-undo"><a href="#undo0">undo</a></code>
event on the <code>Document</code> object, using the <a href=
"#undo-object">undo object</a> entry's associated undo object as
the event's data.</p>
<p>Any calls to <code title="dom-undoManager-add"><a href=
"#adddata">add()</a></code> while the event is being handled will
be used to populate the redo history, and will then be used if the
user invokes the "redo" command to undo his undo.</p>
<h4 id="redo-moving"><span class="secno"><del class=
"diff-old">5.4.3.</del> <ins class="diff-chg">5.4.3</ins></span>
<dfn id="redo-moving0" title="do-redo">Redo: moving forward in the
undo transaction history</dfn></h4>
<p>When the user invokes a redo operation, or when the <code title=
"dom-document-execCommand"><a href=
"#execCommand">execCommand()</a></code> method is called with the
<code title="command-redo"><a href="#redo0">redo</a></code>
command, the user agent must perform a redo operation.</p>
<p>This is mostly the opposite of an <a href="#undo-moving0" title=
"do-undo">undo operation</a> , but the full definition is included
here for completeness.</p>
<p>If the <a href="#current4">undo position</a> is at the end of
the <a href="#undo-transaction">undo transaction history</a> , then
the user agent must do nothing.</p>
<p>If the entry immediately after the <a href="#current4">undo
position</a> is a <a href="#dom-changes">DOM changes</a> entry,
then the user agent must remove that <a href="#dom-changes">DOM
changes</a> entry, reverse the DOM changes that were listed in that
entry, and, if the changes were reversed with no problems, add a
new <a href="#dom-changes">DOM changes</a> entry (consisting of the
opposite of those DOM changes) to the <a href=
"#undo-transaction">undo transaction history</a> on the other side
of the <a href="#current4">undo position</a> .</p>
<p>If the DOM changes cannot be redone (e.g. because the DOM state
is no longer consistent with the changes represented in the entry),
then the user agent must simply remove the <a href=
"#dom-changes">DOM changes</a> entry, without doing anything
else.</p>
<p>If the entry immediately after the <a href="#current4">undo
position</a> is an <a href="#undo-object">undo object</a> entry,
then the user agent must first remove that <a href=
"#undo-object">undo object</a> entry from the <a href=
"#undo-transaction">undo transaction history</a> , and then must
fire a <code title="event-undo"><a href="#undo0">redo</a></code>
event on the <code>Document</code> object, using the <a href=
"#undo-object">undo object</a> entry's associated undo object as
the event's data.</p>
<h4 id="the-undomanagerevent"><span class="secno"><del class=
"diff-old">5.4.4.</del> <ins class="diff-chg">5.4.4</ins></span>
The <code><a href="#undomanagerevent">UndoManagerEvent</a></code>
interface and the <code title="event-undo"><a href=
"#undo0">undo</a></code> and <code title="event-redo"><a href=
"#redo">redo</a></code> events</h4>
<pre class="idl">
interface <dfn id=
"undomanagerevent">UndoManagerEvent</dfn> : Event {
readonly attribute DOMObject <a href="#data3" title=
"dom-UndoManagerEvent-data">data</a>;
void <a href="#initundomanagerevent" title=
"dom-UndoManagerEvent-initUndoManagerEvent">initUndoManagerEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMObject dataArg);
void <span title=
"dom-UndoManagerEvent-initUndoManagerEventNS">initUndoManagerEventNS</span>(in DOMString namespaceURIArg, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMObject dataArg);
};
</pre>
<p>The <dfn id="initundomanagerevent" title=
"dom-UndoManagerEvent-initUndoManagerEvent"><code>initUndoManagerEvent()</code></dfn>
and <dfn id="initundomanagereventns"><code title=
"dom-UndoManagerEvent-initUndoManagerEventNS">initUndoManagerEventNS()</code></dfn>
methods must initialise the event in a manner analogous to the
similarly-named methods in the DOM3 Events interfaces. <a href=
"#references">[DOM3EVENTS]</a></p>
<p>The <dfn id="data3" title=
"dom-UndoManagerEvent-data"><code>data</code></dfn> attribute
represents the <a href="#undo-object">undo object</a> for the
event.</p>
<p>The <dfn id="undo0" title="event-undo"><code>undo</code></dfn>
and <dfn id="redo" title="event-redo"><code>redo</code></dfn>
events do not bubble, cannot be canceled, and have no default
action. When the user agent fires one of these events it must use
the <code><a href="#undomanagerevent">UndoManagerEvent</a></code>
interface, with the <code title=
"dom-UndoManagerEvent-data"><a href="#data3">data</a></code> field
containing the relevant <a href="#undo-object">undo object</a>
.</p>
<h4 id="implementation0"><span class="secno"><del class=
"diff-old">5.4.5.</del> <ins class="diff-chg">5.4.5</ins></span>
Implementation notes</h4>
<p>How user agents present the above conceptual model to the user
is not defined. The undo interface could be a filtered view of the
<a href="#undo-transaction">undo transaction history</a> , it could
manipulate the <a href="#undo-transaction">undo transaction
history</a> in ways not described above, and so forth. For example,
it is possible to design a UA that appears to have separate
<a href="#undo-transaction" title="undo transaction history">undo
transaction histories</a> for each form control; similarly, it is
possible to design systems where the user has access to more undo
information than is present in the <del class=
"diff-old">offical</del> <ins class="diff-chg">official</ins> (as
described above) <a href="#undo-transaction">undo transaction
history</a> (such as providing a tree-based approach to document
state). Such UI models should be based upon the single <a href=
"#undo-transaction">undo transaction history</a> described in this
section, however, such that to a script there is no detectable
difference. <del class="diff-old">5.5. Command APIs The
execCommand( commandId , doShowUI , value ) method on the
HTMLDocument interface allows scripts to perform actions on the
current selection or at the current caret position. Generally,
these commands would be used to implement editor UI, for example
having a "delete" button on a toolbar. There are three variants to
this method, with one, two, and three arguments respectively. The
doShowUI and value parameters, even if specified, are ignored
unless otherwise stated. In this specification, in fact, the
doShowUI parameter is always ignored, regardless of its value. It
is included for historical reasons only. When any of these methods
are invoked, user agents must act as described in the list below.
For actions marked " editing hosts only ", if the selection is not
entirely within an editing host , of if there is no selection and
the caret is not inside an editing host , then the user agent must
do nothing. If the commandId is undo The user agent must move back
one step in its undo transaction history , restoring the associated
state. If there is no further undo information the user agent must
do nothing. See the undo history . If the commandId is redo The
user agent must move forward one step in its undo transaction
history , restoring the associated state. If there is no further
undo (well, "redo") information the user agent must do nothing. See
the undo history . If the commandId is selectAll The user agent
must change the selection so that all the content in the currently
focused editing host is selected. If no editing host is focused,
then the content of the entire document must be selected. If the
commandId is unselect The user agent must change the selection so
that nothing is selected. We need some sort of way in which the
user can make a selection without risk of script clobbering it. If
the commandId is superscript Editing hosts only. The user agent
must act as if the user had requested that the selection be wrapped
in the semantics of the sup element (or unwrapped, or, if there is
no selection, have that semantic inserted or removed — the exact
behaviour is UA-defined). If the commandId is subscript Editing
hosts only. The user agent must act as if the user had requested
that the selection be wrapped in the semantics of the sub element
(or, again, unwrapped, or have that semantic inserted or removed,
as defined by the UA). If the commandId is formatBlock Editing
hosts only. This command changes the semantics of the blocks
containing the selection. If there is no selection, then, where in
the description below refers to the selection, the user agent must
act as if the selection was an empty range at the caret position.
If the value parameter is not specified or has a value other than
one of the following literal strings: <address> <aside>
<h1> <h2> <h3> <h4> <h5> <h6>
<nav> <p> <pre> ...then the user agent must do
nothing. Otherwise, the user agent must, for every position in the
selection, take the furthest prose content ancestor element of that
position that contains only phrasing content , and, if that element
is a descendant of the editing host, rename it (as if the
Element.renameNode() method had been used) according to the value ,
by stripping the leading < character and the trailing >
character and using the rest as the new tag name, using the HTML
namespace. If the commandId is delete Editing hosts only. The user
agent must act as if the user had performed a backspace operation .
If the commandId is forwardDelete Editing hosts only. The user
agent must act as if the user had performed a forward delete
operation . If the commandId is insertLineBreak Editing hosts only.
The user agent must act as if the user had requested a line
separator . If the commandId is insertParagraph Editing hosts only.
The user agent must act as if the user had performed a break block
editing action. If the commandId is insertText Editing hosts only.
The user agent must act as if the user had inserted text
corresponding to the value parameter. If the commandId is vendorID
- customCommandID User agents may implement vendor-specific
extensions to this API. Vendor-specific extensions to the list of
commands should use the syntax vendorID - customCommandID so as to
prevent clashes between extensions from different vendors and
future additions to this specification. If the commandId is
something else User agents must do nothing.</del></p>
<h3 id="selection"><span class="secno"><del class=
"diff-old">5.6.</del> <ins class="diff-chg">5.5</ins></span> The
text selection APIs</h3>
<p>Every <a href="#browsing1">browsing context</a> has <dfn id=
"a-selection" title="the selection">a selection</dfn> . The
selection can be empty, and the selection can have more than one
range (a disjointed selection). The user should be able to change
the selection. User agents are not required to let the user select
more than one range, and may collapse multiple ranges in the
selection to a single range when the user interacts with the
selection. (But, of course, the user agent may let the user create
selections with multiple ranges.)</p>
<p>This one selection must be shared by all the content of the
browsing context (though not by nested <a href="#browsing1" title=
"browsing context">browsing contexts</a> ), including any editing
hosts in the document. (Editing hosts that are not inside a
document cannot have a selection.)</p>
<p>If the selection is empty (collapsed, so that it has only one
segment and that segment's start and end points are the same) then
the selection's position should equal the caret position. When the
selection is not empty, this specification does not define the
caret position; user agents should follow platform conventions in
deciding whether the caret is at the start of the selection, the
end of the selection, or somewhere else.</p>
<p>On some platforms (such as those using Wordstar editing
conventions), the caret position is totally independent of the
start and end of the selection, even when the selection is empty.
On such platforms, user agents may ignore the requirement that the
cursor position be linked to the position of the selection
altogether.</p>
<p>Mostly for historical reasons, in addition to the <a href=
"#browsing1">browsing context</a> 's <a href="#a-selection" title=
"the selection">selection</a> , each <code>textarea</code> and
<code>input</code> element has an independent selection. These are
the <dfn id="text-field" title="text field selection">text field
selections</dfn> .</p>
<p><ins class="diff-new">User agents may selectively ignore
attempts to use the API to adjust the selection made after the user
has modified the selection. For example, if the user has just
selected part of a word, the user agent could ignore attempts to
use the API call to immediately unselect the selection altogether,
but could allow attempts to change the selection to select the
entire word.</ins></p>
<p><ins class="diff-new">User agents may also allow the user to
create selections that are not exposed to the API.</ins></p>
<p>The <code><a href="#datagrid0">datagrid</a></code> and
<code>select</code> elements also have selections, indicating which
items have been picked by the user. These are not discussed in this
section.</p>
<p class="note">This specification does not specify how selections
are presented to the user. The Selectors specification, in
conjunction with CSS, can be used to style text selections using
the <code><a href="#selection1">::selection</a></code>
pseudo-element. <a href="#references">[SELECTORS]</a> <a href=
"#references">[CSS21]</a></p>
<h4 id="documentSelection"><span class="secno"><del class=
"diff-old">5.6.1.</del> <ins class="diff-chg">5.5.1</ins></span>
APIs for the browsing context selection</h4>
<p>The <dfn id="getselection" title=
"dom-getSelection"><code>getSelection()</code></dfn> method on the
<code><a href="#window">Window</a></code> interface must return the
<code><a href="#selection1">Selection</a></code> object
representing <a href="#a-selection">the selection</a> of that
<code><a href="#window">Window</a></code> object's <a href=
"#browsing1">browsing context</a> .</p>
<p>For historical reasons, the <dfn id="getselection0" title=
"dom-document-getSelection"><code>getSelection()</code></dfn>
method on the <code><a href="#htmldocument">HTMLDocument</a></code>
interface must return the same <code><a href=
"#selection1">Selection</a></code> object. <del class=
"diff-old">{</del></p>
<pre>
<ins class="diff-chg"> class=idl>[<a href="#stringify0" title=
"dom-selection-toString">Stringifies</a>] interface <dfn id=
"selection1">Selection</dfn> {
</ins>
readonly attribute Node <a href="#anchornode" title=
"dom-selection-anchorNode">anchorNode</a>;
readonly attribute long <a href="#anchoroffset" title=
"dom-selection-anchorOffset">anchorOffset</a>;
readonly attribute Node <a href="#focusnode" title=
"dom-selection-focusNode">focusNode</a>;
readonly attribute long <a href="#focusoffset" title=
"dom-selection-focusOffset">focusOffset</a>;
readonly attribute boolean <a href="#iscollapsed" title=
"dom-selection-isCollapsed">isCollapsed</a>;
void <a href="#collapse" title=
"dom-selection-collapse">collapse</a>(in Node parentNode, in long offset);
void <a href="#collapsetostart" title=
"dom-selection-collapseToStart">collapseToStart</a>();
void <a href="#collapsetoend" title=
"dom-selection-collapseToEnd">collapseToEnd</a>();
void <a href="#selectallchildren" title=
"dom-selection-selectAllChildren">selectAllChildren</a>(in Node parentNode);
void <a href="#deletefromdocument" title=
"dom-selection-deleteFromDocument">deleteFromDocument</a>();
readonly attribute long <a href="#rangecount" title=
"dom-selection-rangeCount">rangeCount</a>;
Range <a href="#getrangeat" title=
"dom-selection-getRangeAt">getRangeAt</a>(in long index);
void <a href="#addrange" title=
"dom-selection-addRange">addRange</a>(in Range range);
void <a href="#removerange" title=
"dom-selection-removeRange">removeRange</a>(in Range range);
void <a href="#removeallranges" title=
"dom-selection-removeAllRanges">removeAllRanges</a>();
<del class="diff-old"> DOMString ();
</del>
};
</pre>
<p>The <code><a href="#selection1">Selection</a></code> interface
is represents a list of <code>Range</code> objects. The first item
in the list has index 0, and the last item has index <var title=
"">count</var> -1, where <var title="">count</var> is the number of
ranges in the list. <a href="#references">[DOM2RANGE]</a></p>
<p>All of the members of the <code><a href=
"#selection1">Selection</a></code> interface are defined in terms
of operations on the <code>Range</code> objects represented by this
object. These operations can raise exceptions, as defined for the
<code>Range</code> interface; this can therefore result in the
members of the <code><a href="#selection1">Selection</a></code>
interface raising exceptions as well, in addition to any explicitly
called out below.</p>
<p>The <dfn id="anchornode" title=
"dom-selection-anchorNode"><code>anchorNode</code></dfn> attribute
must return the value returned by the <code title=
"">startContainer</code> attribute of the last <code>Range</code>
object in the list, or null if the list is empty.</p>
<p>The <dfn id="anchoroffset" title=
"dom-selection-anchorOffset"><code>anchorOffset</code></dfn>
attribute must return the value returned by the <code title=
"">startOffset</code> attribute of the last <code>Range</code>
object in the list, or 0 if the list is empty.</p>
<p>The <dfn id="focusnode" title=
"dom-selection-focusNode"><code>focusNode</code></dfn> attribute
must return the value returned by the <code title=
"">endContainer</code> attribute of the last <code>Range</code>
object in the list, or null if the list is empty.</p>
<p>The <dfn id="focusoffset" title=
"dom-selection-focusOffset"><code>focusOffset</code></dfn>
attribute must return the value returned by the <code title=
"">endOffset</code> attribute of the last <code>Range</code> object
in the list, or 0 if the list is empty.</p>
<p>The <dfn id="iscollapsed" title=
"dom-selection-isCollapsed"><code>isCollapsed</code></dfn>
attribute must return true if there are zero ranges, or if there is
exactly one range and its <code title="">collapsed</code> attribute
is itself true. Otherwise it must return false.</p>
<p>The <dfn id="collapse" title=
"dom-selection-collapse"><code>collapse( <var title=
"">parentNode</var> , <var title="">offset</var> )</code></dfn>
method must raise a <code>WRONG_DOCUMENT_ERR</code> DOM exception
if <var title="">parentNode</var> 's <code title=
"">ownerDocument</code> is not the <code><a href=
"#htmldocument">HTMLDocument</a></code> object with which the
<code><a href="#selection1">Selection</a></code> object is
associated. Otherwise it is, and the method must remove all the
ranges in the <code><a href="#selection1">Selection</a></code>
list, then create a new <code>Range</code> object, add it to the
list, and invoke its <code title="">setStart()</code> and
<code title="">setEnd()</code> methods with the <var title=
"">parentNode</var> and <var title="">offset</var> values as their
arguments.</p>
<p>The <dfn id="collapsetostart" title=
"dom-selection-collapseToStart"><code>collapseToStart()</code></dfn>
method must raise an <code>INVALID_STATE_ERR</code> DOM exception
if there are no ranges in the list. Otherwise, it must invoke the
<code title="dom-selection-collapse"><a href=
"#collapse">collapse()</a></code> method with the <code title=
"">startContainer</code> and <code title="">startOffset</code>
values of the first <code>Range</code> object in the list as the
arguments.</p>
<p>The <dfn id="collapsetoend" title=
"dom-selection-collapseToEnd"><code>collapseToEnd()</code></dfn>
method must raise an <code>INVALID_STATE_ERR</code> DOM exception
if there are no ranges in the list. Otherwise, it must invoke the
<code title="dom-selection-collapse"><a href=
"#collapse">collapse()</a></code> method with the <code title=
"">endContainer</code> and <code title="">endOffset</code> values
of the last <code>Range</code> object in the list as the
arguments.</p>
<p>The <dfn id="selectallchildren" title=
"dom-selection-selectAllChildren"><code>selectAllChildren(
<var title="">parentNode</var> )</code></dfn> method must invoke
the <code title="dom-selection-collapse"><a href=
"#collapse">collapse()</a></code> method with the <var title=
"">parentNode</var> value as the first argument and 0 as the second
argument, and must then invoke the <code title=
"">selectNodeContents()</code> method on the first (and only) range
in the list with the <var title="">parentNode</var> value as the
argument.</p>
<p>The <dfn id="deletefromdocument" title=
"dom-selection-deleteFromDocument"><code>deleteFromDocument()</code></dfn>
method must invoke the <code title="">deleteContents()</code>
method on each range in the list, if any, from first to last.</p>
<p>The <dfn id="rangecount" title=
"dom-selection-rangeCount"><code>rangeCount</code></dfn> attribute
must return the number of ranges in the list.</p>
<p>The <dfn id="getrangeat" title=
"dom-selection-getRangeAt"><code>getRangeAt( <var title=
"">index</var> )</code></dfn> method must return the <var title=
"">index</var> th range in the list. If <var title="">index</var>
is less than zero or greater or equal to the value returned by the
<code title="dom-selection-rangeCount"><a href=
"#rangecount">rangeCount</a></code> attribute, then the method must
raise an <code>INDEX_SIZE_ERR</code> DOM exception.</p>
<p>The <dfn id="addrange" title=
"dom-selection-addRange"><code>addRange( <var title="">range</var>
)</code></dfn> method must add the given <var title="">range</var>
Range object to the list of selections, at the end (so the newly
added range is the new last range). Duplicates are not prevented; a
range may be added more than once in which case it appears in the
list more than once, which (for example) will cause <del class=
"diff-old">toString()</del> <a href="#stringify0" title=
"dom-selection-toString"><ins class=
"diff-chg">stringification</ins></a> to return the range's text
twice.</p>
<p>The <dfn id="removerange" title=
"dom-selection-removeRange"><code>removeRange( <var title=
"">range</var> )</code></dfn> method must remove the first
occurrence of <var title="">range</var> in the list of ranges, if
it appears at all.</p>
<p>The <dfn id="removeallranges" title=
"dom-selection-removeAllRanges"><code>removeAllRanges()</code></dfn>
method must remove all the ranges from the list of ranges, such
that the <code title="dom-selection-rangeCount"><a href=
"#rangecount">rangeCount</a></code> attribute returns 0 after the
<code title="dom-selection-removeAllRanges"><a href=
"#removeallranges">removeAllRanges()</a></code> method is invoked
(and until a new range is added to the list, either through this
interface or via user interaction).</p>
<p><del class="diff-old">The toString() method</del> <ins class=
"diff-chg">Objects implementing this interface</ins> must
<del class="diff-old">return</del> <dfn id="stringify0" title=
"dom-selection-toString"><ins class=
"diff-chg">stringify</ins></dfn> <ins class="diff-chg">to</ins> a
concatenation of the results of invoking the <code title=
"">toString()</code> method of the <code>Range</code> object on
each of the ranges of the selection, in the order they appear in
the list (first to last). <del class="diff-old">In language
bindings where this is supported, objects implementing the
Selection interface must stringify to the value returned by the
object's toString() method.</del></p>
<div class="example">
<p>In the following document fragment, the emphasised parts
indicate the selection.</p>
<pre>
<p>
The
cute
girl
likes
<em>
the
</em>
<cite>
<em>
Oxford
English
</em>
Dictionary</cite>.</p>
</pre>
<p>If a script invoked <code title=
"">window.getSelection().toString()</code> , the return value would
be " <code>the Oxford English</code> ".</p>
</div>
<p class="note">The <code><a href=
"#selection1">Selection</a></code> interface has no relation to the
<code><a href="#datagridselection">DataGridSelection</a></code>
interface.</p>
<h4 id="textFieldSelection"><span class="secno"><del class=
"diff-old">5.6.2.</del> <ins class="diff-chg">5.5.2</ins></span>
APIs for the text field selections</h4>
<p class="big-issue">When we define HTMLTextAreaElement and
HTMLInputElement we will have to add the IDL given below to both of
their IDLs.</p>
<p>The <code>input</code> and <code>textarea</code> elements define
four members in their DOM interfaces for handling their text
selection:</p>
<pre class="idl">
void <a href="#select1" title=
"dom-textarea/input-select">select</a>();
attribute unsigned long <a href="#selectionstart" title=
"dom-textarea/input-selectionStart">selectionStart</a>;
attribute unsigned long <a href="#selectionend" title=
"dom-textarea/input-selectionEnd">selectionEnd</a>;
void
<a href="#setselectionrange" title=
"dom-textarea/input-setSelectionRange">
setSelectionRange
</a>
(in
unsigned
long
start,
in
unsigned
long
end);
</pre>
<p>These methods and attributes expose and control the selection of
<code>input</code> and <code>textarea</code> text fields.</p>
<p>The <dfn id="select1" title=
"dom-textarea/input-select"><code>select()</code></dfn> method must
cause the contents of the text field to be fully selected.</p>
<p>The <dfn id="selectionstart" title=
"dom-textarea/input-selectionStart"><code>selectionStart</code></dfn>
attribute must, on getting, return the offset (in logical order) to
the character that immediately follows the start of the selection.
If there is no selection, then it must return the offset (in
logical order) to the character that immediately follows the text
entry cursor.</p>
<p>On setting, it must act as if the <code title=
"dom-textarea/input-setSelectionRange"><a href=
"#setselectionrange">setSelectionRange()</a></code> method had been
called, with the new value as the first argument, and the current
value of the <code title="dom-textarea/input-selectionEnd"><a href=
"#selectionend">selectionEnd</a></code> attribute as the second
argument, unless the current value of the <code title=
"dom-textarea/input-selectionEnd"><a href=
"#selectionend">selectionEnd</a></code> is less than the new value,
in which case the second argument must also be the new value.</p>
<p>The <dfn id="selectionend" title=
"dom-textarea/input-selectionEnd"><code>selectionEnd</code></dfn>
attribute must, on getting, return the offset (in logical order) to
the character that immediately follows the end of the selection. If
there is no selection, then it must return the offset (in logical
order) to the character that immediately follows the text entry
cursor.</p>
<p>On setting, it must act as if the <code title=
"dom-textarea/input-setSelectionRange"><a href=
"#setselectionrange">setSelectionRange()</a></code> method had been
called, with the current value of the <code title=
"dom-textarea/input-selectionStart"><a href=
"#selectionstart">selectionStart</a></code> attribute as the first
argument, and new value as the second argument.</p>
<p>The <dfn id="setselectionrange" title=
"dom-textarea/input-setSelectionRange"><code>setSelectionRange(
<var title="">start</var> , <var title="">end</var> )</code></dfn>
method must set the selection of the text field to the sequence of
characters starting with the character at the <var title=
"">start</var> th position (in logical order) and ending with the
character at the <span>( <var title="">end</var> -1)</span> th
position. Arguments greater than the length of the value in the
text field must be treated as pointing at the end of the text
field. If <var title="">end</var> is less than or equal to
<var title="">start</var> then the start of the selection and the
end of the selection must both be placed immediately before the
character with offset <var title="">end</var> . In UAs where there
is no concept of an empty selection, this must set the cursor to be
just before the character with offset <var title="">end</var> .</p>
<div class="example">
<p>To obtain the currently selected text, the following JavaScript
suffices:</p>
<pre>
var
selectionText
=
control.value.substring(control.selectionStart,
control.selectionEnd);
</pre>
<p>...where <var title="">control</var> is the <code>input</code>
or <code>textarea</code> element.</p>
</div>
<p>Characters with no visible rendering, such as U+200D ZERO WIDTH
JOINER, still count as characters. Thus, for instance, the
selection can include just an invisible character, and the text
insertion cursor can be placed to one side or another of such a
character.</p>
<p>When these methods and attributes are used with
<code>input</code> elements that are not displaying simple text
fields, they must raise an <code>INVALID_STATE_ERR</code>
exception.</p>
<h3 id="command"><span class="secno"><ins class=
"diff-new">5.6</ins></span> <ins class="diff-new">Command
APIs</ins></h3>
<p><ins class="diff-new">The</ins> <dfn id="execCommand" title=
"dom-document-execCommand"><code><ins class=
"diff-new">execCommand(</ins> <var title=""><ins class=
"diff-new">commandId</ins></var> ,<var title=""><ins class=
"diff-new">showUI</ins></var> ,<var title=""><ins class=
"diff-new">value</ins></var> <ins class=
"diff-new">)</ins></code></dfn> <ins class="diff-new">method on
the</ins> <code><a href="#htmldocument"><ins class=
"diff-new">HTMLDocument</ins></a></code> <ins class=
"diff-new">interface allows scripts to perform actions on the</ins>
<a href="#a-selection" title="the selection"><ins class=
"diff-new">current selection</ins></a> <ins class="diff-new">or at
the current caret position. Generally, these commands would be used
to implement editor UI, for example having a "delete" button on a
toolbar.</ins></p>
<p><ins class="diff-new">There are three variants to this method,
with one, two, and three arguments respectively. The</ins>
<var title=""><ins class="diff-new">showUI</ins></var> <ins class=
"diff-new">and</ins> <var title=""><ins class=
"diff-new">value</ins></var> <ins class="diff-new">parameters, even
if specified, are ignored unless otherwise stated.</ins></p>
<p><ins class="diff-new">When</ins> <code title=
"dom-document-execCommand"><a href="#execCommand"><ins class=
"diff-new">execCommand()</ins></a></code> <ins class="diff-new">is
invoked, the user agent must follow the following steps:</ins></p>
<ol>
<li><ins class="diff-new">If the given</ins> <var title=
""><ins class="diff-new">commandId</ins></var> <ins class=
"diff-new">maps to an entry in the list below whose "Enabled When"
entry has a condition that is currently false, do nothing; abort
these steps.</ins></li>
<li><ins class="diff-new">Otherwise, execute the "Action" listed
below for the given</ins> <var title=""><ins class=
"diff-new">commandId</ins></var> .</li>
</ol>
<p><ins class="diff-new">A document is</ins> <dfn id=
"ready"><ins class="diff-new">ready for editing host
commands</ins></dfn> <ins class="diff-new">if it has a selection
that is entirely within an</ins> <a href="#editing1"><ins class=
"diff-new">editing host</ins></a> ,<ins class="diff-new">or if it
has no selection but its caret is inside an</ins> <a href=
"#editing1"><ins class="diff-new">editing host</ins></a> .</p>
<p><ins class="diff-new">The</ins> <dfn id="querycommandenabled"
title="dom-document-queryCommandEnabled"><code><ins class=
"diff-new">queryCommandEnabled(</ins> <var title=""><ins class=
"diff-new">commandId</ins></var> <ins class=
"diff-new">)</ins></code></dfn> <ins class="diff-new">method, when
invoked, must return true if the condition listed below under
"Enabled When" for the given</ins> <var title=""><ins class=
"diff-new">commandId</ins></var> <ins class="diff-new">is true, and
false otherwise.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="querycommandindeterm"
title="dom-document-queryCommandIndeterm"><code><ins class=
"diff-new">queryCommandIndeterm(</ins> <var title=""><ins class=
"diff-new">commandId</ins></var> <ins class=
"diff-new">)</ins></code></dfn> <ins class="diff-new">method, when
invoked, must return true if the condition listed below under
"Indeterminate When" for the given</ins> <var title=""><ins class=
"diff-new">commandId</ins></var> <ins class="diff-new">is true, and
false otherwise.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="querycommandstate"
title="dom-document-queryCommandState"><code><ins class=
"diff-new">queryCommandState(</ins> <var title=""><ins class=
"diff-new">commandId</ins></var> <ins class=
"diff-new">)</ins></code></dfn> <ins class="diff-new">method, when
invoked, must return the value expressed below under "State" for
the given</ins> <var title=""><ins class=
"diff-new">commandId</ins></var> .</p>
<p><ins class="diff-new">The</ins> <dfn id="querycommandsupported"
title="dom-document-queryCommandSupported"><code><ins class=
"diff-new">queryCommandSupported(</ins> <var title=""><ins class=
"diff-new">commandId</ins></var> <ins class=
"diff-new">)</ins></code></dfn> <ins class="diff-new">method, when
invoked, must return true if the given</ins> <var title=
""><ins class="diff-new">commandId</ins></var> <ins class=
"diff-new">is in the list below, and false otherwise.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="querycommandvalue"
title="dom-document-queryCommandValue"><code><ins class=
"diff-new">queryCommandValue(</ins> <var title=""><ins class=
"diff-new">commandId</ins></var> <ins class=
"diff-new">)</ins></code></dfn> <ins class="diff-new">method, when
invoked, must return the value expressed below under "Value" for
the given</ins> <var title=""><ins class=
"diff-new">commandId</ins></var> .</p>
<p><ins class="diff-new">The possible values for</ins> <var title=
""><ins class="diff-new">commandId</ins></var> ,<ins class=
"diff-new">and their corresponding meanings, are as follows. These
values are case-insensitive.</ins></p>
<dl>
<dt><dfn id="bold" title="command-bold"><code><ins class=
"diff-new">bold</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must act as if the user had
requested that the selection</ins> <a href=
"#contenteditable-wrapSemantic"><ins class="diff-new">be wrapped in
the semantics</ins></a> <ins class="diff-new">of the</ins>
<em title=""><code><a href="#b"><ins class=
"diff-new">b</ins></a></code></em> <ins class="diff-new">element
(or, again, unwrapped, or have that semantic inserted or removed,
as defined by the UA).</ins></dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The document is</ins> <a href=
"#ready"><ins class="diff-new">ready for editing host
commands</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">True if the selection, or the caret, if there is no
selection, is, or is contained within, a</ins> <code><a href=
"#b"><ins class="diff-new">b</ins></a></code> <ins class=
"diff-new">element. False otherwise.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">The string "</ins> <code title=""><ins class=
"diff-new">true</ins></code> <ins class="diff-new">" if the
expression given for the "State" above is true, the string "</ins>
<code title=""><ins class="diff-new">false</ins></code> <ins class=
"diff-new">" otherwise.</ins></dd>
<dt><dfn id="createlink" title=
"command-createLink"><code><ins class=
"diff-new">createLink</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must act as if the user had
requested that the selection</ins> <a href=
"#contenteditable-wrapSemantic"><ins class="diff-new">be wrapped in
the semantics</ins></a> <ins class="diff-new">of the</ins>
<em title=""><code><a href="#a"><ins class=
"diff-new">a</ins></a></code></em> <ins class="diff-new">element
(or, again, unwrapped, or have that semantic inserted or removed,
as defined by the UA). If the user agent creates an</ins>
<code><a href="#a"><ins class="diff-new">a</ins></a></code>
<ins class="diff-new">element or modifies an existing</ins>
<code><a href="#a"><ins class="diff-new">a</ins></a></code>
<ins class="diff-new">element, then if the</ins> <var title=
""><ins class="diff-new">showUI</ins></var> <ins class=
"diff-new">argument is present and has the value false, then the
value of the</ins> <var title=""><ins class=
"diff-new">value</ins></var> <ins class="diff-new">argument must be
used as the URI of the link. Otherwise, the user should be prompted
for the URI of the link.</ins></dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The document is</ins> <a href=
"#ready"><ins class="diff-new">ready for editing host
commands</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">Always false.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">Always the string "</ins> <code title=""><ins class=
"diff-new">false</ins></code> <ins class="diff-new">".</ins></dd>
<dt><dfn id="delete" title="command-delete"><code><ins class=
"diff-new">delete</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must act as if the user had
performed</ins> <a href="#contenteditable-delete"><ins class=
"diff-new">a backspace operation</ins></a> .</dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The document is</ins> <a href=
"#ready"><ins class="diff-new">ready for editing host
commands</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">Always false.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">Always the string "</ins> <code title=""><ins class=
"diff-new">false</ins></code> <ins class="diff-new">".</ins></dd>
<dt><dfn id="formatblock" title=
"command-formatBlock"><code><ins class=
"diff-new">formatBlock</ins></code></dfn></dt>
<dd>
<p><strong><ins class="diff-new">Action:</ins></strong> <ins class=
"diff-new">The user agent must run the following steps:</ins></p>
<ol>
<li>
<p><ins class="diff-new">If the</ins> <var title=""><ins class=
"diff-new">value</ins></var> <ins class="diff-new">argument wasn't
specified, abort these steps without doing anything.</ins></p>
</li>
<li>
<p><ins class="diff-new">If the</ins> <var title=""><ins class=
"diff-new">value</ins></var> <ins class="diff-new">argument has a
leading U+003C LESS-THAN SIGN character ('<') and a trailing
U+003E GREATER-THAN SIGN character ('> '), then remove the first
and last characters from</ins> <var title=""><ins class=
"diff-new">value</ins></var> .</p>
</li>
<li>
<p><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">value</ins></var> <ins class="diff-new">is (now) a
case-insensitive match for the tag name of an element defined by
this specification that is defined to be a</ins> <span><ins class=
"diff-new">prose element</ins></span> <ins class="diff-new">but not
a</ins> <span><ins class="diff-new">phrasing element</ins></span>
,<ins class="diff-new">then, for every position in the selection,
take the furthest</ins> <a href="#flow-content0"><ins class=
"diff-new">flow content</ins></a> <ins class="diff-new">ancestor
element of that position that contains only</ins> <a href=
"#phrasing0"><ins class="diff-new">phrasing content</ins></a>
,<ins class="diff-new">and, if that element is</ins> <a href=
"#editable0"><ins class="diff-new">editable</ins></a> ,<ins class=
"diff-new">and has a content model that allows it to contain</ins>
<span><ins class="diff-new">prose content</ins></span> <ins class=
"diff-new">other than</ins> <a href="#phrasing0"><ins class=
"diff-new">phrasing content</ins></a> ,<ins class="diff-new">and
has a parent element whose content model allows that parent to
contain any</ins> <span><ins class="diff-new">prose
content</ins></span> ,<ins class="diff-new">rename the element (as
if the</ins> <code title=""><ins class=
"diff-new">Element.renameNode()</ins></code> <ins class=
"diff-new">method had been used) to</ins> <var title=""><ins class=
"diff-new">value</ins></var> ,<ins class="diff-new">using the HTML
namespace.</ins></p>
<p><ins class="diff-new">If there is no selection, then, where in
the description above refers to the selection, the user agent must
act as if the selection was an empty range (with just one position)
at the caret position.</ins></p>
</li>
</ol>
</dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The document is</ins> <a href=
"#ready"><ins class="diff-new">ready for editing host
commands</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">Always false.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">Always the string "</ins> <code title=""><ins class=
"diff-new">false</ins></code> <ins class="diff-new">".</ins></dd>
<dt><dfn id="forwarddelete" title=
"command-forwardDelete"><code><ins class=
"diff-new">forwardDelete</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must act as if the user had
performed</ins> <a href="#contenteditable-delete"><ins class=
"diff-new">a forward delete operation</ins></a> .</dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The document is</ins> <a href=
"#ready"><ins class="diff-new">ready for editing host
commands</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">Always false.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">Always the string "</ins> <code title=""><ins class=
"diff-new">false</ins></code> <ins class="diff-new">".</ins></dd>
<dt><dfn id="insertimage" title=
"command-insertImage"><code><ins class=
"diff-new">insertImage</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must act as if the user had
requested that the selection</ins> <a href=
"#contenteditable-wrapSemantic"><ins class="diff-new">be wrapped in
the semantics</ins></a> <ins class="diff-new">of the</ins>
<em title=""><code><a href="#img"><ins class=
"diff-new">img</ins></a></code></em> <ins class="diff-new">element
(or, again, unwrapped, or have that semantic inserted or removed,
as defined by the UA). If the user agent creates an</ins>
<code><a href="#img"><ins class="diff-new">img</ins></a></code>
<ins class="diff-new">element or modifies an existing</ins>
<code><a href="#img"><ins class="diff-new">img</ins></a></code>
<ins class="diff-new">element, then if the</ins> <var title=
""><ins class="diff-new">showUI</ins></var> <ins class=
"diff-new">argument is present and has the value false, then the
value of the</ins> <var title=""><ins class=
"diff-new">value</ins></var> <ins class="diff-new">argument must be
used as the URI of the image. Otherwise, the user should be
prompted for the URI of the image.</ins></dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The document is</ins> <a href=
"#ready"><ins class="diff-new">ready for editing host
commands</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">Always false.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">Always the string "</ins> <code title=""><ins class=
"diff-new">false</ins></code> <ins class="diff-new">".</ins></dd>
<dt><dfn id="inserthtml" title=
"command-insertHTML"><code><ins class=
"diff-new">insertHTML</ins></code></dfn></dt>
<dd>
<p><strong><ins class="diff-new">Action:</ins></strong> <ins class=
"diff-new">The user agent must run the following steps:</ins></p>
<ol>
<li>
<p><ins class="diff-new">If the</ins> <var title=""><ins class=
"diff-new">value</ins></var> <ins class="diff-new">argument wasn't
specified, abort these steps without doing anything.</ins></p>
</li>
<li>
<p><ins class="diff-new">If there is a selection, act as if the
user had requested that</ins> <a href=
"#contenteditable-delete"><ins class="diff-new">the selection be
deleted</ins></a> .</p>
</li>
<li>
<p><ins class="diff-new">Invoke the</ins> <a href=
"#html-fragment0"><ins class="diff-new">HTML fragment parsing
algorithm</ins></a> <ins class="diff-new">with an arbitrary
orphan</ins> <code><a href="#body0"><ins class=
"diff-new">body</ins></a></code> <ins class="diff-new">element as
the</ins> <i><a href="#context0"><ins class=
"diff-new">context</ins></a></i> <ins class="diff-new">element and
with the</ins> <var title=""><ins class=
"diff-new">value</ins></var> <ins class="diff-new">argument
as</ins> <i><ins class="diff-new">input</ins></i> .</p>
</li>
<li>
<p><ins class="diff-new">Insert the nodes returned by the previous
step into the document at the location of the caret.</ins></p>
</li>
</ol>
</dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The document is</ins> <a href=
"#ready"><ins class="diff-new">ready for editing host
commands</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">Always false.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">Always the string "</ins> <code title=""><ins class=
"diff-new">false</ins></code> <ins class="diff-new">".</ins></dd>
<dt><dfn id="insertlinebreak" title=
"command-insertLineBreak"><code><ins class=
"diff-new">insertLineBreak</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must act as if the user
had</ins> <a href="#contenteditable-br"><ins class=
"diff-new">requested a line separator</ins></a> .</dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The document is</ins> <a href=
"#ready"><ins class="diff-new">ready for editing host
commands</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">Always false.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">Always the string "</ins> <code title=""><ins class=
"diff-new">false</ins></code> <ins class="diff-new">".</ins></dd>
<dt><dfn id="insertorderedlist" title=
"command-insertOrderedList"><code><ins class=
"diff-new">insertOrderedList</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must act as if the user had
requested that the selection</ins> <a href=
"#contenteditable-wrapSemantic"><ins class="diff-new">be wrapped in
the semantics</ins></a> <ins class="diff-new">of the</ins>
<code><a href="#ol"><ins class="diff-new">ol</ins></a></code>
<ins class="diff-new">element (or unwrapped, or, if there is no
selection, have that semantic inserted or removed — the exact
behavior is UA-defined).</ins></dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The document is</ins> <a href=
"#ready"><ins class="diff-new">ready for editing host
commands</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">Always false.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">Always the string "</ins> <code title=""><ins class=
"diff-new">false</ins></code> <ins class="diff-new">".</ins></dd>
<dt><dfn id="insertorderedlist0" title=
"command-insertOrderedList"><code><ins class=
"diff-new">insertOrderedList</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must act as if the user had
requested that the selection</ins> <a href=
"#contenteditable-wrapSemantic"><ins class="diff-new">be wrapped in
the semantics</ins></a> <ins class="diff-new">of the</ins>
<code><a href="#ul"><ins class="diff-new">ul</ins></a></code>
<ins class="diff-new">element (or unwrapped, or, if there is no
selection, have that semantic inserted or removed — the exact
behavior is UA-defined).</ins></dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The document is</ins> <a href=
"#ready"><ins class="diff-new">ready for editing host
commands</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">Always false.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">Always the string "</ins> <code title=""><ins class=
"diff-new">false</ins></code> <ins class="diff-new">".</ins></dd>
<dt><dfn id="insertparagraph" title=
"command-insertParagraph"><code><ins class=
"diff-new">insertParagraph</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must act as if the user had
performed a</ins> <a href="#contenteditable-breakBlock"><ins class=
"diff-new">break block</ins></a> <ins class="diff-new">editing
action.</ins></dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The document is</ins> <a href=
"#ready"><ins class="diff-new">ready for editing host
commands</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">Always false.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">Always the string "</ins> <code title=""><ins class=
"diff-new">false</ins></code> <ins class="diff-new">".</ins></dd>
<dt><dfn id="inserttext" title=
"command-insertText"><code><ins class=
"diff-new">insertText</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must act as if the user
had</ins> <a href="#contenteditable-insertText"><ins class=
"diff-new">inserted text</ins></a> <ins class=
"diff-new">corresponding to the</ins> <var title=""><ins class=
"diff-new">value</ins></var> <ins class=
"diff-new">parameter.</ins></dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The document is</ins> <a href=
"#ready"><ins class="diff-new">ready for editing host
commands</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">Always false.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">Always the string "</ins> <code title=""><ins class=
"diff-new">false</ins></code> <ins class="diff-new">".</ins></dd>
<dt><dfn id="italic" title="command-italic"><code><ins class=
"diff-new">italic</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must act as if the user had
requested that the selection</ins> <a href=
"#contenteditable-wrapSemantic"><ins class="diff-new">be wrapped in
the semantics</ins></a> <ins class="diff-new">of the</ins>
<em title=""><code><a href="#i"><ins class=
"diff-new">i</ins></a></code></em> <ins class="diff-new">element
(or, again, unwrapped, or have that semantic inserted or removed,
as defined by the UA).</ins></dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The document is</ins> <a href=
"#ready"><ins class="diff-new">ready for editing host
commands</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">True if the selection, or the caret, if there is no
selection, is, or is contained within, a</ins> <code><a href=
"#i"><ins class="diff-new">i</ins></a></code> <ins class=
"diff-new">element. False otherwise.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">The string "</ins> <code title=""><ins class=
"diff-new">true</ins></code> <ins class="diff-new">" if the
expression given for the "State" above is true, the string "</ins>
<code title=""><ins class="diff-new">false</ins></code> <ins class=
"diff-new">" otherwise.</ins></dd>
<dt><dfn id="redo0" title="command-redo"><code><ins class=
"diff-new">redo</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must</ins> <a href=
"#redo-moving0" title="do-redo"><ins class="diff-new">move forward
one step</ins></a> <ins class="diff-new">in its</ins> <a href=
"#undo-transaction"><ins class="diff-new">undo transaction
history</ins></a> ,<ins class="diff-new">restoring the associated
state. If the</ins> <a href="#current4"><ins class="diff-new">undo
position</ins></a> <ins class="diff-new">is at the end of the</ins>
<a href="#undo-transaction"><ins class="diff-new">undo transaction
history</ins></a> ,<ins class="diff-new">the user agent must do
nothing. See the</ins> <a href="#undo-history"><ins class=
"diff-new">undo history</ins></a> .</dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The</ins> <a href="#current4"><ins class=
"diff-new">undo position</ins></a> <ins class="diff-new">is not at
the end of the</ins> <a href="#undo-transaction"><ins class=
"diff-new">undo transaction history</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">Always false.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">Always the string "</ins> <code title=""><ins class=
"diff-new">false</ins></code> <ins class="diff-new">".</ins></dd>
<dt><dfn id="selectall0" title=
"command-selectAll"><code><ins class="diff-new">selectAll</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must change the selection so
that all the content in the currently focused</ins> <a href=
"#editing1"><ins class="diff-new">editing host</ins></a>
<ins class="diff-new">is selected. If no</ins> <a href=
"#editing1"><ins class="diff-new">editing host</ins></a>
<ins class="diff-new">is focused, then the content of the entire
document must be selected.</ins></dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">Always.</ins></dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">Always false.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">Always the string "</ins> <code title=""><ins class=
"diff-new">false</ins></code> <ins class="diff-new">".</ins></dd>
<dt><dfn id="subscript" title="command-subscript"><code><ins class=
"diff-new">subscript</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must act as if the user had
requested that the selection</ins> <a href=
"#contenteditable-wrapSemantic"><ins class="diff-new">be wrapped in
the semantics</ins></a> <ins class="diff-new">of the</ins>
<em title=""><code><a href="#sub"><ins class=
"diff-new">sub</ins></a></code></em> <ins class="diff-new">element
(or, again, unwrapped, or have that semantic inserted or removed,
as defined by the UA).</ins></dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The document is</ins> <a href=
"#ready"><ins class="diff-new">ready for editing host
commands</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">True if the selection, or the caret, if there is no
selection, is, or is contained within, a</ins> <code><a href=
"#sub"><ins class="diff-new">sub</ins></a></code> <ins class=
"diff-new">element. False otherwise.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">The string "</ins> <code title=""><ins class=
"diff-new">true</ins></code> <ins class="diff-new">" if the
expression given for the "State" above is true, the string "</ins>
<code title=""><ins class="diff-new">false</ins></code> <ins class=
"diff-new">" otherwise.</ins></dd>
<dt><dfn id="superscript" title=
"command-superscript"><code><ins class=
"diff-new">superscript</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must act as if the user had
requested that the selection</ins> <a href=
"#contenteditable-wrapSemantic"><ins class="diff-new">be wrapped in
the semantics</ins></a> <ins class="diff-new">of the</ins>
<code><a href="#sup"><ins class="diff-new">sup</ins></a></code>
<ins class="diff-new">element (or unwrapped, or, if there is no
selection, have that semantic inserted or removed — the exact
behavior is UA-defined).</ins></dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The document is</ins> <a href=
"#ready"><ins class="diff-new">ready for editing host
commands</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">True if the selection, or the caret, if there is no
selection, is, or is contained within, a</ins> <code><a href=
"#sup"><ins class="diff-new">sup</ins></a></code> <ins class=
"diff-new">element. False otherwise.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">The string "</ins> <code title=""><ins class=
"diff-new">true</ins></code> <ins class="diff-new">" if the
expression given for the "State" above is true, the string "</ins>
<code title=""><ins class="diff-new">false</ins></code> <ins class=
"diff-new">" otherwise.</ins></dd>
<dt><dfn id="undo1" title="command-undo"><code><ins class=
"diff-new">undo</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must</ins> <a href=
"#undo-moving0" title="do-undo"><ins class="diff-new">move back one
step</ins></a> <ins class="diff-new">in its</ins> <a href=
"#undo-transaction"><ins class="diff-new">undo transaction
history</ins></a> ,<ins class="diff-new">restoring the associated
state. If the</ins> <a href="#current4"><ins class="diff-new">undo
position</ins></a> <ins class="diff-new">is at the start of
the</ins> <a href="#undo-transaction"><ins class="diff-new">undo
transaction history</ins></a> ,<ins class="diff-new">the user agent
must do nothing. See the</ins> <a href="#undo-history"><ins class=
"diff-new">undo history</ins></a> .</dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The</ins> <a href="#current4"><ins class=
"diff-new">undo position</ins></a> <ins class="diff-new">is not at
the start of the</ins> <a href="#undo-transaction"><ins class=
"diff-new">undo transaction history</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">Always false.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">Always the string "</ins> <code title=""><ins class=
"diff-new">false</ins></code> <ins class="diff-new">".</ins></dd>
<dt><dfn id="unlink" title="command-unlink"><code><ins class=
"diff-new">unlink</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must remove all</ins>
<code><a href="#a"><ins class="diff-new">a</ins></a></code>
<ins class="diff-new">elements that have</ins> <code title=
"attr-a-href"><ins class="diff-new">href</ins></code> <ins class=
"diff-new">attributes and that are partially or completely included
in the current selection.</ins></dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">The document has a selection that is entirely
within an</ins> <a href="#editing1"><ins class="diff-new">editing
host</ins></a> .</dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">Always false.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">Always the string "</ins> <code title=""><ins class=
"diff-new">false</ins></code> <ins class="diff-new">".</ins></dd>
<dt><dfn id="unselect" title="command-unselect"><code><ins class=
"diff-new">unselect</ins></code></dfn></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">The user agent must change the selection so
that nothing is selected.</ins></dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">Always.</ins></dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">Always false.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">Always the string "</ins> <code title=""><ins class=
"diff-new">false</ins></code> <ins class="diff-new">".</ins></dd>
<dt><code><var title=""><ins class="diff-new">vendorID</ins></var>
<ins class="diff-new">-</ins> <var title=""><ins class=
"diff-new">customCommandID</ins></var></code></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">User agents may implement vendor-specific
extensions to this API. Vendor-specific extensions to the list of
commands should use the syntax</ins> <code><var title=
""><ins class="diff-new">vendorID</ins></var> <ins class=
"diff-new">-</ins> <var title=""><ins class=
"diff-new">customCommandID</ins></var></code> <ins class=
"diff-new">so as to prevent clashes between extensions from
different vendors and future additions to this
specification.</ins></dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">UA-defined.</ins></dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">UA-defined.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">UA-defined.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">UA-defined.</ins></dd>
<dt><ins class="diff-new">Anything else</ins></dt>
<dd><strong><ins class="diff-new">Action:</ins></strong>
<ins class="diff-new">User agents must do nothing.</ins></dd>
<dd><strong><ins class="diff-new">Enabled When:</ins></strong>
<ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">Indeterminate
When:</ins></strong> <ins class="diff-new">Never.</ins></dd>
<dd><strong><ins class="diff-new">State:</ins></strong> <ins class=
"diff-new">Always false.</ins></dd>
<dd><strong><ins class="diff-new">Value:</ins></strong> <ins class=
"diff-new">Always the string "</ins> <code title=""><ins class=
"diff-new">false</ins></code> <ins class="diff-new">".</ins></dd>
</dl>
<h2 id="comms"><span class="secno">6.</span> Communication</h2>
<h3 id="event1"><span class="secno"><del class=
"diff-old">6.1.</del> <ins class="diff-chg">6.1</ins></span> Event
definitions</h3>
<p>Messages in <a href="#cross-document">cross-document
messaging</a> <del class="diff-old">and, by default,</del>
<ins class="diff-chg">and</ins> in <a href=
"#server-sent">server-sent DOM events</a> , use the <dfn id=
"message0" title="event-message"><code>message</code></dfn>
event.</p>
<p>The following interface is defined for this event:</p>
<pre class="idl">
interface <dfn id="messageevent">MessageEvent</dfn> : Event {
readonly attribute DOMString <a href="#data4" title=
"dom-MessageEvent-data">data</a>;
<del class="diff-old"> readonly attribute DOMString ;
readonly attribute DOMString ;
readonly attribute ;
void (in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString dataArg, in DOMString domainArg, in DOMString uriArg, in Window sourceArg);
void (in DOMString namespaceURI, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString dataArg, in DOMString domainArg, in DOMString uriArg, in Window sourceArg);
</del>
<ins class="diff-chg"> readonly attribute DOMString <a href=
"#origin1" title="dom-MessageEvent-origin">origin</a>;
readonly attribute DOMString <a href="#lasteventid" title=
"dom-MessageEvent-lastEventId">lastEventId</a>;
readonly attribute <a href="#window">Window</a> <a href=
"#source3" title="dom-MessageEvent-source">source</a>;
void <a href="#initmessageevent" title=
"dom-MessageEvent-initMessageEvent">initMessageEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString dataArg, in DOMString originArg, in DOMString lastEventIdArg, in Window sourceArg);
void <a href="#initmessageeventns" title=
"dom-MessageEvent-initMessageEventNS">initMessageEventNS</a>(in DOMString namespaceURI, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString dataArg, in DOMString originArg, in DOMString lastEventIdArg, in Window sourceArg);
</ins>
};
</pre>
<p>The <dfn id="initmessageevent" title=
"dom-MessageEvent-initMessageEvent"><code>initMessageEvent()</code></dfn>
and <dfn id="initmessageeventns" title=
"dom-MessageEvent-initMessageEventNS"><code>initMessageEventNS()</code></dfn>
methods must initialise the event in a manner analogous to the
similarly-named methods in the DOM3 Events interfaces. <a href=
"#references">[DOM3EVENTS]</a></p>
<p>The <dfn id="data4" title=
"dom-MessageEvent-data"><code>data</code></dfn> attribute
represents the message being sent.</p>
<p>The <dfn id="origin1" title=
"dom-MessageEvent-origin"><code><del class="diff-old">domain</del>
<ins class="diff-chg">origin</ins></code></dfn> attribute
represents, in <a href="#cross-document">cross-document
messaging</a> , the <del class="diff-old">domain</del> <a href=
"#origin0"><ins class="diff-chg">origin</ins></a> of the document
<del class="diff-old">from which</del> <ins class="diff-chg">that
sent</ins> the message <del class="diff-old">came.</del>
<ins class="diff-chg">(typically the scheme, hostname, and port of
the document, but not its path or fragment identifier).</ins></p>
<p>The <dfn id="lasteventid" title=
"dom-MessageEvent-lastEventId"><code><del class=
"diff-old">uri</del> <ins class=
"diff-chg">lastEventId</ins></code></dfn> attribute represents, in
<del class="diff-old">cross-document messaging</del> <a href=
"#server-sent"><ins class="diff-chg">server-sent dom
events</ins></a> , the <del class="diff-old">address</del>
<span><ins class="diff-chg">last event ID string</ins></span> of
the <del class="diff-old">document from which the message
came.</del> <ins class="diff-chg">event source.</ins></p>
<p>The <dfn id="source3" title=
"dom-MessageEvent-source"><code>source</code></dfn> attribute
represents, in <a href="#cross-document">cross-document
messaging</a> , the <code><a href="#window">Window</a></code> from
which the message came.</p>
<h3 id="server-sent-events"><span class="secno"><del class=
"diff-old">6.2.</del> <ins class="diff-chg">6.2</ins></span>
<dfn id="server-sent">Server-sent DOM events</dfn></h3>
<p>This section describes a mechanism for allowing servers to
dispatch DOM events into documents that expect it. The
<code><a href="#event-source">event-source</a></code> element
provides a simple interface to this mechanism.</p>
<h4 id="the-remoteeventtarget"><span class="secno"><del class=
"diff-old">6.2.1.</del> <ins class="diff-chg">6.2.1</ins></span>
The <dfn id=
"remoteeventtarget"><code>RemoteEventTarget</code></dfn>
interface</h4>
<p>Any object that implements the <code>EventTarget</code>
interface must also implement the <code><a href=
"#remoteeventtarget0">RemoteEventTarget</a></code> interface.</p>
<pre class="idl">
interface <dfn id="remoteeventtarget0">RemoteEventTarget</dfn> {
void <a href="#addeventsource" title=
"dom-RemoteEventTarget-addEventSource">addEventSource</a>(in DOMString src);
void <a href="#removeeventsource" title=
"dom-RemoteEventTarget-removeEventSource">removeEventSource</a>(in DOMString src);
};
</pre>
<p>When the <dfn id="addeventsource" title=
"dom-RemoteEventTarget-addEventSource"><code>addEventSource(
<var title="">src</var> )</code></dfn> method is invoked, the user
agent must add the URI specified in <var title="">src</var> to the
<a href="#list-of3" title="concept-event-source-list">list of event
sources</a> for that object. The same URI can be registered
multiple times.</p>
<p>When the <dfn id="removeeventsource" title=
"dom-RemoteEventTarget-removeEventSource"><code>removeEventSource(
<var title="">src</var> )</code></dfn> method is invoked, the user
agent must remove the URI specified in <var title="">src</var> from
the <a href="#list-of3" title="concept-event-source-list">list of
event sources</a> for that object. If the same URI has been
registered multiple times, removing it must <del class=
"diff-old">only</del> remove <ins class="diff-new">only</ins> one
instance of that URI for each invocation of the <code title=
"removeEventSource">removeEventSource()</code> method.</p>
<p>Relative URIs must be resolved relative to <span class=
"big-issue">...</span> .</p>
<h4 id="connecting"><span class="secno"><del class=
"diff-old">6.2.2.</del> <ins class="diff-chg">6.2.2</ins></span>
Connecting to an event stream</h4>
<p>Each object implementing the <code>EventTarget</code> and
<code><a href="#remoteeventtarget0">RemoteEventTarget</a></code>
interfaces has a <dfn id="list-of3" title=
"concept-event-source-list">list of event sources</dfn> that are
registered for that object.</p>
<p>When a new URI is added to this list, the user agent should, as
soon as all currently executing scripts (if any) have finished
executing, and if the specified URI isn't removed from the list
before they do so, fetch the resource identified by that URI.</p>
<p>When an event source is removed from the list of event sources
for an object, if that resource is still being fetched, then the
relevant connection must be closed.</p>
<p>Since connections established to remote servers for such
resources are expected to be long-lived, UAs should ensure that
appropriate buffering is used. In particular, while line buffering
may be safe if lines are defined to end with a single U+000A LINE
FEED character, block buffering or line buffering with different
expected line endings can cause delays in event dispatch.</p>
<p><ins class="diff-new">Each event source in the list must have
associated with it the following:</ins></p>
<ul>
<li><ins class="diff-new">The</ins> <dfn id="reconnection" title=
"concept-event-stream-reconnection-time"><ins class=
"diff-new">reconnection time</ins></dfn> ,<ins class="diff-new">in
milliseconds. This must initially be a user-agent-defined value,
probably in the region of a few seconds.</ins></li>
<li><ins class="diff-new">The</ins> <dfn id="last-event" title=
"concept-event-stream-last-event-id"><ins class="diff-new">last
event ID string</ins></dfn> .<ins class="diff-new">This must
initially be the empty string.</ins></li>
</ul>
<p>In general, the semantics of the transport protocol specified by
the URIs for the event sources must be followed, including HTTP
caching rules.</p>
<p>For HTTP connections, the <code title="">Accept</code> header
may be included; if included, it must <del class=
"diff-old">only</del> contain <ins class="diff-new">only</ins>
formats of event framing that are supported by the user agent (one
of which must be <code><del class=
"diff-old">application/x-dom-event-stream</del> <ins class=
"diff-chg">text/event-stream</ins></code> , as described
below).</p>
<p>Other formats of event framing may also be supported in addition
to <code><del class="diff-old">application/x-dom-event-stream</del>
<ins class="diff-chg">text/event-stream</ins></code> , but this
specification does not define how they are to be parsed or
processed.</p>
<p class="note">Such formats could include systems like SMS-push;
for example servers could use <code title="">Accept</code> headers
and HTTP redirects to an SMS-push mechanism as a kind of protocol
negotiation to reduce network load in GSM environments.</p>
<p>User agents should use the <code>Cache-Control: no-cache</code>
header in requests to bypass any caches for requests of event
sources.</p>
<p><ins class="diff-new">If the event source's last event ID string
is not the empty string, then a</ins> <code title=""><ins class=
"diff-new">Last-Event-ID</ins></code> <ins class="diff-new">HTTP
header must be included with the request, whose value is the value
of the event source's last event ID string.</ins></p>
<p>For connections to domains other than <a href="#domain0">the
document's domain</a> , the semantics of the Access-Control HTTP
header must be followed. <a href=
"#references">[ACCESSCONTROL]</a></p>
<p>HTTP 200 OK responses with a <a href=
"#content-type8">Content-Type</a> header specifying the type
<code><del class="diff-old">application/x-dom-event-stream</del>
<ins class="diff-chg">text/event-stream</ins></code> that are
either from <a href="#domain0">the document's domain</a> or
explicitly allowed by the Access-Control HTTP headers must be
processed line by line <a href="#event-stream-interpretation">as
described below</a> .</p>
<p>For the purposes of such successfully opened event streams only,
user agents should ignore HTTP cache headers, and instead assume
that the resource indicates that it does not wish to be cached.</p>
<p>If such a resource completes loading (i.e. the entire HTTP
response body is received or the connection itself closes), the
user agent should request the event source resource again after a
delay <ins class="diff-new">equal to the reconnection time</ins> of
<del class="diff-old">approximately five seconds.</del> <ins class=
"diff-chg">the event source.</ins></p>
<p>HTTP 200 OK responses that have a <a href=
"#content-type8">Content-Type</a> other than <code><del class=
"diff-old">application/x-dom-event-stream</del> <ins class=
"diff-chg">text/event-stream</ins></code> (or some other supported
type), and HTTP responses whose Access-Control headers indicate
that the resource are not to be used, must be ignored and must
prevent the user agent from refetching the resource for that event
source.</p>
<p>HTTP 201 Created, 202 Accepted, 203 Non-Authoritative
Information, and 206 Partial Content responses must be treated like
HTTP 200 OK responses for the purposes of reopening event source
resources. They are, however, likely to indicate an error has
occurred somewhere and may cause the user agent to emit a
warning.</p>
<p>HTTP 204 No Content, and 205 Reset Content responses must be
treated as if they were 200 OK responses with the right MIME type
but no content, and should therefore cause the user agent to
refetch the resource after a <del class="diff-old">short
delay.</del> <ins class="diff-chg">delay equal to the reconnection
time of the event source.</ins></p>
<p>HTTP 300 Multiple Choices responses should be handled
automatically if possible (treating the responses as if they were
302 Found responses pointing to the appropriate resource), and
otherwise must be treated as HTTP 404 responses.</p>
<p>HTTP 301 Moved Permanently responses must cause the user agent
to reconnect using the new server specified URI instead of the
previously specified URI for all subsequent requests for this event
source. (It doesn't affect other event sources with the same URI
unless they also receive 301 responses, and it doesn't affect
future sessions, e.g. if the page is reloaded.)</p>
<p>HTTP 302 Found, 303 See Other, and 307 Temporary Redirect
responses must cause the user agent to connect to the new
server-specified URI, but if the user agent needs to again request
the resource at a later point, it must return to the previously
specified URI for this event source.</p>
<p>HTTP 304 Not Modified responses should be handled like HTTP 200
OK responses, with the content coming from the user agent cache. A
new request should then be made after a <del class=
"diff-old">short</del> delay <ins class="diff-new">equal to the
reconnection time</ins> of <del class="diff-old">approximately five
seconds.</del> <ins class="diff-chg">the event source.</ins></p>
<p>HTTP 305 Use Proxy, HTTP 401 Unauthorized, and 407 Proxy
Authentication Required should be treated transparently as for any
other subresource.</p>
<p>Any other HTTP response code not listed here should cause the
user agent to stop trying to process this event source.</p>
<p>DNS errors must be considered fatal, and cause the user agent to
not open any connection for that event source.</p>
<p>For non-HTTP protocols, UAs should act in equivalent ways.</p>
<h4 id="parsing1"><span class="secno"><del class=
"diff-old">6.2.3.</del> <ins class="diff-chg">6.2.3</ins></span>
Parsing an event stream</h4>
<p>This event stream format's MIME type is <code><del class=
"diff-old">application/x-dom-event-stream</del> <ins class=
"diff-chg">text/event-stream</ins></code> .</p>
<p>The event stream format is (in pseudo-BNF):</p>
<pre>
<stream> ::= <bom>? <event>*
<del class=
"diff-old"><event> ::= [ <comment> | <command> | <field> ]* <newline>
<comment> ::= ';' <any-char>* <newline>
<command> ::= ':' <any-char>* <newline>
<field> ::= <name> [ ':' <space>? <any-char>* ]? <newline>
<name> ::= <name-start-char> <name-char>*
</del>
<ins class=
"diff-chg"><event> ::= [ <comment> | <field> ]* <newline>
<comment> ::= <colon> <any-char>* <newline>
<field> ::= <name-char>+ [ <colon> <space>? <any-char>* ]? <newline>
</ins>
# characters:
<bom> ::= a single U+FEFF BYTE ORDER MARK character
<space> ::= a single U+0020 SPACE character (' ')
<newline> ::= a U+000D CARRIAGE RETURN character
followed by a U+000A LINE FEED character
| a single U+000D CARRIAGE RETURN character
| a single U+000A LINE FEED character
| the end of the file
<del class=
"diff-old"><name-start-char> ::= a single Unicode character other than
':', ';', U+000D CARRIAGE RETURN and U+000A LINE FEED
</del>
<ins class=
"diff-chg"><colon> ::= a single U+003A COLON character (':')
</ins>
<name-char> ::= a single Unicode character other than
<del class=
"diff-old"> ':', U+000D CARRIAGE RETURN and U+000A LINE FEED
</del>
<ins class=
"diff-chg"> U+003A COLON, U+000D CARRIAGE RETURN and U+000A LINE FEED
</ins>
<any-char> ::= a single Unicode character other than
U+000D CARRIAGE RETURN and U+000A LINE FEED
</pre>
<p>Event streams in this format must always be encoded as
UTF-8.</p>
<p>Lines must be separated by either a U+000D CARRIAGE RETURN
U+000A LINE FEED (CRLF) character pair, a single U+000A LINE FEED
(LF) character, or a single U+000D CARRIAGE RETURN (CR) character.
<del class="diff-old">User agents must treat those three variants
as equivalent line terminators.</del></p>
<h4 id="event-stream-interpretation"><span class=
"secno"><ins class="diff-chg">6.2.4</ins></span> <ins class=
"diff-chg">Interpreting an event stream</ins></h4>
<p>Bytes or sequences of bytes that are not valid UTF-8 sequences
must be interpreted as the U+FFFD REPLACEMENT CHARACTER.</p>
<p>One leading U+FEFF BYTE ORDER MARK character must be ignored if
any are present.</p>
<p>The stream must then be parsed by reading everything line by
line, <del class="diff-old">in blocks separated by blank lines.
Comment lines (those starting</del> with <del class=
"diff-old">the</del> <ins class="diff-chg">a U+000D CARRIAGE RETURN
U+000A LINE FEED (CRLF)</ins> character <del class=
"diff-old">';')</del> <ins class="diff-chg">pair, a single U+000A
LINE FEED (LF) character, a single U+000D CARRIAGE RETURN (CR)
character,</ins> and <del class="diff-old">command lines (those
starting with the character ':') must be ignored. Command lines are
reserved for future extensions. For each non-blank, non-comment,
non-command line, the field name must first be taken. This is
everything on</del> the <del class="diff-old">line up to but not
including</del> <ins class="diff-chg">end of</ins> the <del class=
"diff-old">first colon (':') or</del> <ins class="diff-chg">file
being</ins> the <ins class="diff-new">four ways in which a</ins>
line <del class="diff-old">terminator, whichever comes first. Then,
if there was</del> <ins class="diff-chg">can end.</ins></p>
<p><ins class="diff-chg">When</ins> a <del class="diff-old">colon,
the</del> <ins class="diff-chg">stream is parsed, a</ins>
<var title="">data <del class="diff-old">for that line</del></var>
<ins class="diff-chg">buffer and an</ins> <var title=""><ins class=
"diff-chg">event name</ins></var> <ins class=
"diff-chg">buffer</ins> must be <del class="diff-old">taken. This
is everything after the colon, ignoring a single space after the
colon if there is one, up</del> <ins class="diff-chg">associated
with it. They must be initialized</ins> to the <del class=
"diff-old">end of</del> <ins class="diff-chg">empty
string</ins></p>
<p><ins class="diff-chg">Lines must be processed, in</ins> the
<del class="diff-old">line.</del> <ins class="diff-chg">order they
are received, as follows:</ins></p>
<dl class="switch">
<dt>If <del class="diff-old">there was no colon</del> the
<del class="diff-old">data</del> <ins class="diff-chg">line</ins>
is <del class="diff-old">the</del> empty <del class=
"diff-old">string. Examples: Field name: Field data This is
a</del> <ins class="diff-chg">(a</ins> blank <del class=
"diff-old">field 1. These two lines: have the same data 2.
These two lines:have the same data 1. But these two lines: do
not 2. But these two lines: do not</del> <ins class=
"diff-chg">line)</ins></dt>
<dd>
<p><a href="#dispatchMessage"><ins class="diff-new">Dispatch the
event</ins></a> ,<ins class="diff-new">as defined below.</ins></p>
</dd>
<dt>If <ins class="diff-new">the line starts with</ins> a
<del class="diff-old">field name occurs multiple times in a
block,</del> <ins class="diff-chg">U+003A COLON character
(':')</ins></dt>
<dd>
<p><ins class="diff-chg">Ignore</ins> the <del class=
"diff-old">value for that field in that black must consist of</del>
<ins class="diff-chg">line.</ins></p>
</dd>
<dt><ins class="diff-chg">If the line contains a U+003A COLON
character (':') character</ins></dt>
<dd>
<p><ins class="diff-chg">Collect</ins> the <del class=
"diff-old">data parts for each of those lines, concatenated with
U+000A LINE FEED</del> characters <del class="diff-old">between
them (regardless of what</del> <ins class="diff-chg">on</ins> the
line <del class="diff-old">terminators used in</del> <ins class=
"diff-chg">before</ins> the <del class="diff-old">stream actually
are).</del> <ins class="diff-chg">first U+003A COLON character
(':'), and let</ins> <var title=""><ins class=
"diff-chg">field</ins></var> <ins class="diff-chg">be that
string.</ins></p>
<p><del class="diff-old">For example,</del> <ins class=
"diff-chg">Collect</ins> the <del class="diff-old">following block:
Test: Line 1 Foo: Bar Test: Line 2 ...is
treated as having two fields, one called Test with</del>
<ins class="diff-chg">characters on</ins> the <del class=
"diff-old">value " Line 1\nLine 2 " (where \n represents a
newline),</del> <ins class="diff-chg">line after the first U+003A
COLON character (':'),</ins> and <del class="diff-old">one called
Foo</del> <ins class="diff-chg">let</ins> <var title=""><ins class=
"diff-chg">value</ins></var> <ins class="diff-chg">be that string.
If</ins> <var title=""><ins class="diff-chg">value</ins></var>
<ins class="diff-chg">starts</ins> with <del class=
"diff-old">the</del> <ins class="diff-chg">a single U+0020 SPACE
character, remove it from</ins> <var title="">value <del class=
"diff-old">" Bar " (note the leading space
character).</del></var> .</p>
<p><del class="diff-old">A block thus consists of all the
name-value pairs for its fields. Command lines have no effect on
blocks and are not considered part of a block. Since any random
stream of characters matches the above format, there is no need to
define any error handling.</del> <del class="diff-old">6.2.4.
Interpreting an event stream Once</del> <a href=
"#processField"><ins class="diff-chg">Process</ins> the <del class=
"diff-old">fields have been parsed, they are interpreted as follows
(these are case-sensitive exact comparisons): Event</del> field
<del class="diff-old">This</del></a> <ins class="diff-chg">using
the steps described below, using</ins> <var title="">field
<del class="diff-old">gives</del></var> <ins class=
"diff-chg">as</ins> the <ins class="diff-new">field</ins> name
<del class="diff-old">of</del> <ins class="diff-chg">and</ins>
<var title=""><ins class="diff-chg">value</ins></var> <ins class=
"diff-chg">as</ins> the <del class="diff-old">event. For example,
load , DOMActivate , updateTicker . If there is no</del> field
<del class="diff-old">with this name, the name message must be
used.</del> <ins class="diff-chg">value.</ins></p>
</dd>
<dt><del class="diff-old">Namespace field This field gives the DOM3
namespace for the event. (For normal DOM events this would be
null.) If it isn't specified</del> <ins class=
"diff-chg">Otherwise,</ins> the <del class="diff-old">event
namespace</del> <ins class="diff-chg">string</ins> is <del class=
"diff-old">null. Class field</del> <ins class="diff-chg">not empty
but does not contain a U+003A COLON character (':')
character</ins></dt>
<dd>
<p><del class="diff-old">This field gives is</del> <a href=
"#processField"><ins class="diff-chg">Process</ins> the <del class=
"diff-old">interface used for</del> <ins class=
"diff-chg">field</ins></a> <ins class="diff-chg">using</ins> the
<del class="diff-old">event, for instance Event , UIEvent ,
MutationEvent , KeyboardEvent , etc. For compatibility with DOM3
Events,</del> <ins class="diff-chg">steps described below,
using</ins> the <del class="diff-old">values UIEvents , MouseEvents
, MutationEvents , and HTMLEvents are valid values and must be
treated respectively</del> <ins class="diff-chg">whole line</ins>
as <del class="diff-old">meaning</del> the <del class=
"diff-old">interfaces UIEvent , MouseEvent , MutationEvent ,</del>
<ins class="diff-chg">field name,</ins> and <del class=
"diff-old">Event . (This value can therefore be used</del>
<ins class="diff-chg">the empty string</ins> as the <del class=
"diff-old">argument to createEvent() .)</del> <ins class=
"diff-chg">field value.</ins></p>
</dd>
</dl>
<p><del class="diff-old">If the value is not specified but the
Namespace is null and</del> <ins class="diff-chg">Once</ins> the
<del class="diff-old">Event field exactly matches one</del>
<ins class="diff-chg">end</ins> of the <del class="diff-old">events
specified by DOM3 Events in section 1.4.2 "Complete list of event
types" , then</del> <ins class="diff-chg">file is reached,</ins>
the <del class="diff-old">interface used</del> <ins class=
"diff-chg">user agent</ins> must <del class="diff-old">default
to</del> <a href="#dispatchMessage"><ins class=
"diff-chg">dispatch</ins> the <del class="diff-old">interface
relevant for that</del> event <del class="diff-old">type.
[DOM3EVENTS]</del></a> <del class="diff-old">For example: Event:
click ...would cause Class to be treated</del> <ins class=
"diff-chg">one final time,</ins> as <del class=
"diff-old">MouseEvent . If</del> <ins class="diff-chg">defined
below.</ins></p>
<p id="processField"><ins class="diff-chg">The steps to</ins>
<dfn id="process" title=""><ins class="diff-chg">process</ins> the
<del class="diff-old">Namespace is null</del> <ins class=
"diff-chg">field</ins></dfn> <ins class="diff-chg">given a field
name</ins> and <ins class="diff-new">a field value depend on</ins>
the <del class="diff-old">Event</del> field <del class=
"diff-old">is message (including if it was not specified
explicitly), then</del> <ins class="diff-chg">name, as given
in</ins> the <del class="diff-old">MessageEvent interface</del>
<ins class="diff-chg">following list. Field names</ins> must be
<del class="diff-old">used. Otherwise,</del> <ins class=
"diff-chg">compared literally, with no case folding
performed.</ins></p>
<dl class="switch">
<dt><ins class="diff-chg">If</ins> the <del class="diff-old">Event
interface must be used. It</del> <ins class="diff-chg">field
name</ins> is <del class="diff-old">quite possible to give</del>
<ins class="diff-chg">"event"</ins></dt>
<dd>
<p><ins class="diff-chg">Set</ins> the <del class="diff-old">wrong
class for an event. This is equivalent to creating an</del>
<var title="">event <del class="diff-old">in the DOM using the DOM
Event APIs, but using</del> <ins class="diff-chg">name</ins></var>
<ins class="diff-chg">buffer</ins> the <del class="diff-old">wrong
interface for it.</del> <ins class="diff-chg">to field
value.</ins></p>
</dd>
<dt><del class="diff-old">Bubbles</del> <ins class="diff-chg">If
the</ins> field <ins class="diff-new">name is "data"</ins></dt>
<dd>
<p><del class="diff-old">This field specifies whether</del>
<ins class="diff-chg">If</ins> the <del class=
"diff-old">event</del> <var title=""><ins class=
"diff-chg">data</ins></var> <ins class="diff-chg">buffer</ins> is
<ins class="diff-new">not the empty string, then append a single
U+000A LINE FEED character</ins> to <del class="diff-old">bubble.
If it is specified and has</del> the <var title=""><ins class=
"diff-new">data</ins></var> <ins class="diff-new">buffer. Append
the field</ins> value <del class="diff-old">No ,</del> <ins class=
"diff-chg">to</ins> the <del class="diff-old">event must not
bubble.</del> <var title=""><ins class="diff-chg">data</ins></var>
<ins class="diff-chg">buffer.</ins></p>
</dd>
<dt>If <del class="diff-old">it</del> <ins class="diff-chg">the
field name</ins> is <del class="diff-old">specified and has any
other value (including no or NO ) then</del> <ins class=
"diff-chg">"id"</ins></dt>
<dd>
<p><ins class="diff-chg">Set</ins> the event <del class=
"diff-old">must bubble.</del> <ins class="diff-chg">stream's</ins>
<a href="#last-event" title=
"concept-event-stream-last-event-id"><ins class="diff-chg">last
event ID</ins></a> <ins class="diff-chg">to the field
value.</ins></p>
</dd>
<dt>If <del class="diff-old">it is not specified but</del> the
<del class="diff-old">Namespace</del> field <ins class=
"diff-new">name</ins> is <del class="diff-old">null and</del>
<ins class="diff-chg">"retry"</ins></dt>
<dd>
<p><ins class="diff-chg">If</ins> the <del class=
"diff-old">Event</del> field <del class="diff-old">exactly matches
one</del> <ins class="diff-chg">value consists</ins> of <del class=
"diff-old">the events specified by DOM3 Events</del> <ins class=
"diff-chg">only characters</ins> in <del class="diff-old">section
1.4.2 "Complete list of event types" ,</del> <ins class=
"diff-chg">the range U+0030 DIGIT ZERO ('0') U+0039 DIGIT NINE
('9'),</ins> then <ins class="diff-new">interpret</ins> the
<del class="diff-old">event must bubble if</del> <ins class=
"diff-chg">field value as an integer in base ten, and set</ins> the
<del class="diff-old">DOM3 Events spec specifies that that</del>
event <del class="diff-old">bubbles, and musn't bubble if it
specifies it does not. [DOM3EVENTS]</del> <ins class=
"diff-chg">stream's</ins> <a href="#reconnection" title=
"concept-event-stream-reconnection-time"><ins class=
"diff-chg">reconnection time</ins></a> <del class="diff-old">For
example: Event: load ...would cause Bubbles</del> to <del class=
"diff-old">be treated as No .</del> <ins class="diff-chg">that
integer.</ins> Otherwise, <ins class="diff-new">ignore</ins> the
<del class="diff-old">event must bubble.</del> <ins class=
"diff-chg">field.</ins></p>
</dd>
<dt><del class="diff-old">Cancelable field</del> <ins class=
"diff-chg">Otherwise</ins></dt>
<dd>
<p><del class="diff-old">This</del> <ins class="diff-chg">The</ins>
field <del class="diff-old">specifies whether the event can have
its default action prevented. If it</del> is <del class=
"diff-old">specified and has</del> <ins class=
"diff-chg">ignored.</ins></p>
</dd>
</dl>
<p id="dispatchMessage"><ins class="diff-chg">When</ins> the
<del class="diff-old">value No ,</del> <ins class="diff-chg">user
agent is required to</ins> <dfn id="dispatch" title=""><ins class=
"diff-chg">dispatch</ins> the event</dfn> , <ins class=
"diff-new">then the user agent</ins> must <del class="diff-old">not
be cancelable.</del> <ins class="diff-chg">act as
follows:</ins></p>
<ol>
<li>
<p>If <del class="diff-old">it</del> <ins class=
"diff-chg">the</ins> <var title=""><ins class=
"diff-chg">data</ins></var> <ins class="diff-chg">buffer</ins> is
<del class="diff-old">specified</del> <ins class="diff-chg">an
empty string, set the</ins> <var title=""><ins class=
"diff-chg">data</ins></var> <ins class="diff-chg">buffer</ins> and
<del class="diff-old">has any other value (including no or NO )
then</del> the <var title="">event <del class="diff-old">must be
cancelable.</del> <ins class="diff-chg">name</ins></var>
<ins class="diff-chg">buffer to the empty string and abort these
steps.</ins></p>
</li>
<li>
<p>If <del class="diff-old">it</del> <ins class=
"diff-chg">the</ins> <var title=""><ins class="diff-chg">event
name</ins></var> <ins class="diff-chg">buffer</ins> is not
<del class="diff-old">specified, but</del> the <del class=
"diff-old">Namespace field</del> <ins class="diff-chg">empty string
but</ins> is <del class="diff-old">null and the Event field exactly
matches one of the events specified by DOM3 Events in section 1.4.2
"Complete list of event types"</del> <ins class="diff-chg">also not
a valid</ins> <a href=
"http://www.w3.org/TR/REC-xml-names/#NT-NCName"><ins class=
"diff-chg">NCName</ins></a> , <del class="diff-old">then</del>
<ins class="diff-chg">set</ins> the <var title=""><ins class=
"diff-new">data</ins></var> <ins class="diff-new">buffer and
the</ins> <var title="">event <del class="diff-old">must be
cancelable if</del> <ins class="diff-chg">name</ins></var>
<ins class="diff-chg">buffer to</ins> the <del class=
"diff-old">DOM3 Events specification specifies that it is,</del>
<ins class="diff-chg">empty string</ins> and <del class=
"diff-old">must not be cancelable otherwise. [DOM3EVENTS] For
example: Event: load ...would cause Cancelable to be treated as No
.</del> <ins class="diff-chg">abort these steps.</ins></p>
</li>
<li>
<p>Otherwise, <del class="diff-old">the</del> <ins class=
"diff-chg">create an</ins> event <del class="diff-old">must be
cancelable.</del> <ins class="diff-chg">that uses the</ins>
<code><a href="#messageevent"><ins class=
"diff-chg">MessageEvent</ins></a> <del class=
"diff-old">Target</del></code> <del class="diff-old">field This
field gives the node that</del> <ins class="diff-chg">interface,
with</ins> the event <del class="diff-old">is to be dispatched on.
If the object for</del> <ins class="diff-chg">name</ins>
<code title="event-message"><a href="#message0"><ins class=
"diff-chg">message</ins></a></code> , which <del class=
"diff-old">the event source is being processed is</del> <ins class=
"diff-chg">does</ins> not <del class="diff-old">a Node, but the
Target field is nonetheless specified, then the event must be
dropped. Otherwise, if field</del> <ins class=
"diff-chg">bubble,</ins> is <del class="diff-old">specified</del>
<ins class="diff-chg">cancelable,</ins> and <del class=
"diff-old">its value starts with a #</del> <ins class=
"diff-chg">has no default action. The</ins> <code title=
"dom-MessageEvent-data"><a href="#data4"><ins class=
"diff-chg">data</ins></a></code> <del class="diff-old">character,
then</del> <ins class="diff-chg">attribute must be set to</ins> the
<del class="diff-old">remainder</del> <ins class=
"diff-chg">value</ins> of the <del class="diff-old">value
represents an ID, and</del> <var title=""><ins class=
"diff-chg">data</ins></var> <ins class="diff-chg">buffer,</ins> the
<del class="diff-old">event</del> <code title=
"dom-MessageEvent-origin"><a href="#origin1"><ins class=
"diff-chg">origin</ins></a></code> <ins class=
"diff-chg">attribute</ins> must be <del class="diff-old">dispatched
on the same node as would be obtained by the getElementById()
method on</del> <ins class="diff-chg">set to</ins> the <del class=
"diff-old">ownerDocument</del> <a href="#origin0"><ins class=
"diff-chg">origin</ins></a> of the <del class="diff-old">node
whose</del> event <del class="diff-old">source is being processed.
For example, Target: #test ...would target the element with ID test
. Otherwise, if the field is specified and its value is</del>
<ins class="diff-chg">stream's URI,</ins> the <del class=
"diff-old">literal string " Document</del> <code title=
"dom-MessageEvent-lastEventId"><a href="#lasteventid"><ins class=
"diff-chg">lastEventId</ins></a></code> <del class="diff-old">",
then the event</del> <ins class="diff-chg">attribute</ins> must be
<del class="diff-old">dispatched at</del> <ins class="diff-chg">set
to</ins> the <del class="diff-old">ownerDocument</del>
<span><ins class="diff-chg">last event ID string</ins></span> of
the <del class="diff-old">node whose</del> event <del class=
"diff-old">source is being processed. Otherwise, the field (whether
specified or not) is ignored</del> <ins class=
"diff-chg">source,</ins> and the <del class="diff-old">event</del>
<code title="dom-MessageEvent-source"><a href=
"#source3"><ins class="diff-chg">source</ins></a></code>
<ins class="diff-chg">attribute</ins> must be <del class=
"diff-old">dispatched at the object itself.</del> <ins class=
"diff-chg">set to null.</ins></p>
</li>
<li>
<p><del class="diff-old">Other fields depend on the interface
specified (or possibly implied) by the Class field.</del> If the
<del class="diff-old">specified interface has an attribute that
exactly matches the</del> <var title=""><ins class=
"diff-chg">event</ins> name <del class="diff-old">of the field, and
the</del></var> <ins class="diff-chg">buffer has a</ins> value
<del class="diff-old">of</del> <ins class="diff-chg">other
than</ins> the <del class="diff-old">field can be converted
(using</del> <ins class="diff-chg">empty string, change</ins> the
type <del class="diff-old">conversions defined in ECMAScript)</del>
<ins class="diff-chg">of the newly created event</ins> to
<ins class="diff-new">equal</ins> the <del class=
"diff-old">type</del> <ins class="diff-chg">value</ins> of the
<del class="diff-old">attribute, then it must be used. Any
attributes (other than</del> <var title=""><ins class=
"diff-chg">event name</ins></var> <ins class=
"diff-chg">buffer.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Set</ins> the <del class="diff-old">Event
interface attributes) that do not have matching fields are
initialised</del> <var title=""><ins class=
"diff-chg">data</ins></var> <ins class="diff-chg">buffer and
the</ins> <var title=""><ins class="diff-chg">event
name</ins></var> <ins class="diff-chg">buffer</ins> to <del class=
"diff-old">zero, null, false, or</del> the empty string.</p>
</li>
<li>
<p><del class="diff-old">For example: Event: click Class:
MouseEvent button: 2 ...would result in a 'click'</del> <ins class=
"diff-chg">Dispatch the newly created</ins> event <del class=
"diff-old">using</del> <ins class="diff-chg">at</ins> the
<code><del class="diff-old">MouseEvent interface that has button
set to 2</del> <a href="#remoteeventtarget0"><ins class=
"diff-chg">RemoteEventTarget</ins></a></code> <del class=
"diff-old">but screenX , screenY , etc, set</del> <ins class=
"diff-chg">object</ins> to <del class="diff-old">0, false, or null
as appropriate. If a field does not match any of the attributes
on</del> <ins class="diff-chg">which</ins> the <del class=
"diff-old">event, it must be ignored. For example: Event: keypress
Class: MouseEvent keyIdentifier: 0 ...would result in a
MouseEvent</del> event <del class="diff-old">with its fields all at
their default values, with the</del> <ins class="diff-chg">stream
is registered.</ins></p>
</li>
</ol>
<p class="note"><ins class="diff-chg">If an</ins> event <del class=
"diff-old">name being keypress . The keyIdentifier field would be
ignored. (If the author had not included the Class field
explicitly, it would have just worked, since the class would</del>
<ins class="diff-chg">doesn't</ins> have <del class=
"diff-old">defaulted as described above.) Once a blank line or the
end of the file is reached,</del> an <ins class="diff-new">"id"
field, but an earlier</ins> event <del class="diff-old">of the type
and namespace given by the Event and Namespace fields respectively
must be synthesized and dispatched to the appropriate node as
described by</del> <ins class="diff-chg">did set</ins> the
<del class="diff-old">fields above. No</del> event <del class=
"diff-old">must be dispatched until a blank line has been received
or the end of the file reached. The</del> <ins class=
"diff-chg">source's</ins> <span><ins class="diff-chg">last</ins>
event <del class="diff-old">must be dispatched as if using the DOM
dispatchEvent() method. Thus, if</del> <ins class="diff-chg">ID
string</ins></span> ,<ins class="diff-chg">then</ins> the
<del class="diff-old">Event</del> <ins class=
"diff-chg">event's</ins> <code title=
"dom-MessageEvent-lastEventId"><a href="#lasteventid"><ins class=
"diff-chg">lastEventId</ins></a></code> field <del class=
"diff-old">was omitted, leaving the name as the empty string, or if
the name had invalid characters, then</del> <ins class=
"diff-chg">will be set to</ins> the <del class=
"diff-old">dispatching</del> <ins class="diff-chg">value</ins> of
<ins class="diff-new">whatever</ins> the <del class=
"diff-old">event fails. Events fired from event sources do not have
user-agent default actions.</del> <ins class="diff-chg">last seen
"id" field was.</ins></p>
<div class="example">
<p>The following event stream, once followed by a blank line:</p>
<pre>
data: YHOO
data: -2
data:
10
</pre>
<p>...would cause an event <code title="event-message"><a href=
"#message0">message</a></code> with the interface <code><a href=
"#messageevent">MessageEvent</a></code> to be dispatched on the
<code><a href="#event-source">event-source</a></code> element,
<del class="diff-old">which would then bubble up the DOM, and</del>
whose <code title="dom-MessageEvent-data"><a href=
"#data4">data</a></code> attribute would contain the string
<code>YHOO\n-2\n10</code> (where <code>\n</code> <del class=
"diff-old">again</del> represents a newline).</p>
<p>This could be used as follows:</p>
<pre>
<event-source src="http://stocks.example.com/ticker.php"
onmessage="var
data
=
event.data.split('\n');
updateStocks(data[0],
data[1],
data[2]);">
</pre>
<p>...where <code title="">updateStocks()</code> is a function
defined as:</p>
<pre>
function
updateStocks(symbol,
delta,
value)
{
...
}
</pre>
<p>...or some such.</p>
</div>
<div class="example">
<p>The following stream contains four <del class="diff-old">blocks
and therefore fires four events.</del> <ins class=
"diff-chg">blocks.</ins> The first block has just a comment, and
will fire <del class="diff-old">a message event with all the fields
set to the empty string or null.</del> <ins class=
"diff-chg">nothing.</ins> The second block has two fields with
names <del class="diff-old">"load"</del> <ins class=
"diff-chg">"data"</ins> and <del class="diff-old">"Target"</del>
<ins class="diff-chg">"id"</ins> respectively; <del class=
"diff-old">since there is no " load " member on</del> <ins class=
"diff-chg">an event will be fired for this block, with</ins> the
<del class="diff-old">MessageEvent object that field is ignored,
leaving</del> <ins class="diff-chg">data "first event", and will
then set</ins> the <ins class="diff-new">last</ins> event
<del class="diff-old">as</del> <ins class="diff-chg">ID to "1" so
that if the connection died between this block and the next, the
server would be sent</ins> a <del class="diff-old">second
message</del> <code title=""><ins class=
"diff-chg">Last-Event-ID</ins></code> <ins class="diff-new">header
with the value "1". The third block fires an</ins> event with
<del class="diff-old">all</del> <ins class="diff-chg">data "second
event", and also has an "id" field, this time with no value, which
resets</ins> the <del class="diff-old">fields set</del> <ins class=
"diff-chg">last event ID</ins> to the empty string <del class=
"diff-old">or null, but this time</del> <ins class=
"diff-chg">(meaning no</ins> <code title=""><ins class=
"diff-chg">Last-Event-ID</ins></code> <ins class="diff-chg">header
will now be sent in</ins> the event <del class="diff-old">is
targetted at</del> <ins class="diff-chg">of a reconnection being
attempted). Finally the last block just fires</ins> an <del class=
"diff-old">element</del> <ins class="diff-chg">event</ins> with
<del class="diff-old">ID "image1". The third</del> <ins class=
"diff-chg">the data "third event". Note that the last</ins> block
<del class="diff-old">is empty (no lines between two</del>
<ins class="diff-chg">doesn't have to end with a</ins> blank
<del class="diff-old">lines), and</del> <ins class=
"diff-chg">line,</ins> the <del class="diff-old">fourth block has
only two comments, so they both yet again fire</del> <ins class=
"diff-chg">end of the stream is enough to trigger the dispatch of
the last event.</ins></p>
<pre>
: test stream
<del class="diff-old">message
</del>
<ins class="diff-chg">data: first event
id: 1
</ins>
<del class="diff-old">events
</del>
<ins class="diff-chg">data: second event
id
data:
third
event
</ins>
</pre></div>
<div class="example">
<p><ins class="diff-chg">The following stream fires just one
event:</ins></p>
<pre>
data<ins class="diff-chg">
data
data
data:
</ins>
</pre>
<p><ins class="diff-chg">The first and last blocks do nothing,
since they do not contain any actual data (the</ins> <var title=
""><ins class="diff-chg">data</ins></var> <ins class=
"diff-chg">buffer remains at the empty string, and so nothing gets
dispatched). The middle block fires an event</ins> with <del class=
"diff-old">all</del> the <del class="diff-old">fields</del>
<ins class="diff-chg">data</ins> set to <del class="diff-old">the
empty string or null.</del> <ins class="diff-chg">a single newline
character.</ins></p>
<del class="diff-old">; test load Target: #image1</del></div>
<div class="example">
<p><ins class="diff-chg">The following stream fires two identical
events:</ins></p>
<pre>
data:test
<del class=
"diff-old">; if any more events follow this block, they will not be affected by
; the "Target" and "load" fields above.
</del>
<ins class="diff-chg">data: test
</ins>
</pre>
<p><ins class="diff-new">This is because the space after the colon
is ignored if present.</ins></p>
</div>
<h4 id="notes"><span class="secno"><del class=
"diff-old">6.2.5.</del> <ins class="diff-chg">6.2.5</ins></span>
Notes</h4>
<p>Legacy proxy servers are known to, in certain cases, drop HTTP
connections after a short timeout. To protect against such proxy
servers, authors can include a comment line (one starting with a
<del class="diff-old">';'</del> <ins class="diff-chg">':'</ins>
character) every 15 seconds or so.</p>
<p>Authors wishing to relate event source connections to each other
or to specific documents previously served might find that relying
on IP addresses doesn't work, as individual clients can have
multiple IP addresses (due to having multiple proxy servers) and
individual IP addresses can have multiple clients (due to sharing a
proxy server). It is better to include a unique identifier in the
document when it is served and then pass that identifier as part of
the URI in the <code title="attr-event-source-src"><a href=
"#src11">src</a></code> attribute of the <code><a href=
"#event-source">event-source</a></code> element.</p>
<p>Implementations that support HTTP's per-server connection
limitation might run into trouble when opening multiple pages from
a site if each page has an <code><a href=
"#event-source">event-source</a></code> to the same domain. Authors
can avoid this using the relatively complex mechanism of using
unique domain names per connection, or by allowing the user to
enable or disable the <code><a href=
"#event-source">event-source</a></code> functionality on a per-page
basis.</p>
<h3 id="network"><span class="secno"><del class=
"diff-old">6.3.</del> <ins class="diff-chg">6.3</ins></span>
Network connections</h3>
<p>To enable Web applications to communicate with each other in
local area networks, and to maintain bidirectional communications
with their originating server, this specification introduces the
<code><a href="#connection0">Connection</a></code> interface.</p>
<p>The <code><a href="#window">Window</a></code> interface provides
three constructors for creating <code><a href=
"#connection0">Connection</a></code> objects: <code title=
"dom-TCPConnection"><a href=
"#tcpconnection">TCPConnection()</a></code> , for creating a direct
(possibly encrypted) link to another node on the Internet using
TCP/IP; <code title="dom-LocalBroadcastConnection"><a href=
"#localbroadcastconnection">LocalBroadcastConnection()</a></code> ,
for creating a connection to any listening peer on a local network
(which could be a local TCP/IP subnet using UDP, a Bluetooth PAN,
or another kind of network infrastructure); and <code title=
"dom-PeerToPeerConnection"><a href=
"#peertopeerconnection">PeerToPeerConnection()</a></code> , for a
direct peer-to-peer connection (which could again be over TCP/IP,
Bluetooth, IrDA, or some other type of network).</p>
<p class="note">This interface does not allow for raw access to the
underlying network. For example, this interface could not be used
to implement an IRC client without proxying messages through a
custom server.</p>
<h4 id="network-intro"><span class="secno"><del class=
"diff-old">6.3.1.</del> <ins class="diff-chg">6.3.1</ins></span>
Introduction</h4>
<p><em>This section is non-normative.</em></p>
<p class="big-issue">An introduction to the client-side and
server-side of using the direct connection APIs.</p>
<p class="big-issue">An example of a party-line implementation of a
broadcast service, and direct peer-to-peer chat for direct local
connections.</p>
<h4 id="the-connection"><span class="secno"><del class=
"diff-old">6.3.2.</del> <ins class="diff-chg">6.3.2</ins></span>
The <code><a href="#connection0">Connection</a></code>
interface</h4>
<pre class="idl">
interface <dfn id="connection0">Connection</dfn> {
readonly attribute DOMString <a href="#network1" title=
"dom-Connection-network">network</a>;
readonly attribute DOMString <a href="#peer" title=
"dom-Connection-peer">peer</a>;
<del class="diff-old"> readonly attribute int ;
</del>
<ins class="diff-chg"> readonly attribute int <a href=
"#readystate1" title="dom-Connection-readyState">readyState</a>;
</ins>
attribute EventListener <a href="#onopen" title=
"dom-Connection-onopen">onopen</a>;
attribute EventListener <a href="#onread" title=
"dom-Connection-onread">onread</a>;
attribute EventListener <a href="#onclose" title=
"dom-Connection-onclose">onclose</a>;
void <a href="#send" title=
"dom-Connection-send">send</a>(in DOMString data);
void <a href="#disconnect" title=
"dom-Connection-disconnect">disconnect</a>();
};
</pre>
<p><code><a href="#connection0">Connection</a></code> objects must
also implement the <code>EventTarget</code> interface. <a href=
"#references">[DOM3EVENTS]</a></p>
<p>When a <code><a href="#connection0">Connection</a></code> object
is created, the UA must try to establish a connection, as described
in the sections below describing each connection type.</p>
<p>The <dfn id="network1" title=
"dom-Connection-network"><code>network</code></dfn> attribute
represents the name of the network connection (the value depends on
the kind of connection being established). The <dfn id="peer"
title="dom-Connection-peer"><code>peer</code></dfn> attribute
identifies the remote host for direct (non-broadcast)
connections.</p>
<p>The <code title="dom-Connection-network"><a href=
"#network1">network</a></code> attribute must be set as soon as the
<code><a href="#connection0">Connection</a></code> object is
created, and keeps the same value for the lifetime of the object.
The <code title="dom-Connection-peer"><a href=
"#peer">peer</a></code> attribute must initially be set to the
empty string and must be updated once, when the connection is
established, after which point it must keep the same value for the
lifetime of the object.</p>
<p>The <dfn id="readystate1" title=
"dom-Connection-readyState"><code>readyState</code></dfn> attribute
represents the state of the connection. When the object is created
it must be set to 0. It can have the following values:</p>
<dl>
<dt>0 Connecting</dt>
<dd>The connection has not yet been established.</dd>
<dt>1 Connected</dt>
<dd>The connection is established and communication is
possible.</dd>
<dt>2 Closed</dt>
<dd>The connection has been closed.</dd>
</dl>
<p id="openConnection">Once a connection is established, the
<code title="dom-Connection-readyState"><a href=
"#readystate1">readyState</a></code> attribute's value must be
changed to 1, and the <code title="event-connection-open"><a href=
"#open3">open</a></code> event must be fired on the <code><a href=
"#connection0">Connection</a></code> object.</p>
<p>When data is received, the <code title=
"event-connection-read"><a href="#read">read</a></code> event will
be fired on the <code><a href="#connection0">Connection</a></code>
object.</p>
<p id="closeConnection">When the connection is closed, the
<code title="dom-Connection-readyState"><a href=
"#readystate1">readyState</a></code> attribute's value must be
changed to 2, and the <code title="event-connection-close"><a href=
"#close0">close</a></code> event must be fired on the
<code><a href="#connection0">Connection</a></code> object.</p>
<p>The <dfn id="onopen" title=
"dom-Connection-onopen"><code>onopen</code></dfn> , <dfn id=
"onread" title="dom-Connection-onread"><code>onread</code></dfn> ,
and <dfn id="onclose" title=
"dom-Connection-onclose"><code>onclose</code></dfn> attributes
must, when set, register their new value as an event listener for
their respective events (namely <code title=
"event-connection-open"><a href="#open3">open</a></code> ,
<code title="event-connection-read"><a href="#read">read</a></code>
, and <code title="event-connection-close"><a href=
"#close0">close</a></code> ), and unregister their previous value
if any.</p>
<p>The <dfn id="send" title=
"dom-Connection-send"><code>send()</code></dfn> method transmits
data using the connection. If the connection is not yet
established, it must raise an <code>INVALID_STATE_ERR</code>
exception. If the connection <em>is</em> established, then the
<del class="diff-old">behaviour</del> <ins class=
"diff-chg">behavior</ins> depends on the connection type, as
described below.</p>
<p>The <dfn id="disconnect" title=
"dom-Connection-disconnect"><code>disconnect()</code></dfn> method
must close the connection, if it is open. If the connection is
already closed, it must do nothing. Closing the connection causes a
<code title="event-connection-close"><a href=
"#close0">close</a></code> event to be fired and the <code title=
"dom-Connection-readyState"><a href=
"#readystate1">readyState</a></code> attribute's value to change,
as <a href="#closeConnection">described above</a> .</p>
<h4 id="connection"><span class="secno"><del class=
"diff-old">6.3.3.</del> <ins class="diff-chg">6.3.3</ins></span>
Connection Events</h4>
<p>All the events described in this section are events in no
namespace, which do not bubble, are not cancelable, and have no
default action.</p>
<p>The <dfn id="open3" title=
"event-connection-open"><code>open</code></dfn> event is fired when
the connection is established. UAs must use the normal
<code>Event</code> interface when firing this event.</p>
<p>The <dfn id="close0" title=
"event-connection-close"><code>close</code></dfn> event is fired
when the connection is closed (whether by the author, calling the
<code title="dom-Connection-disconnect"><a href=
"#disconnect">disconnect()</a></code> method, or by the server, or
by a network error). UAs must use the normal <code>Event</code>
interface when firing this event as well.</p>
<p class="note">No information regarding why the connection was
closed is passed to the application in this version of this
specification.</p>
<p>The <dfn id="read" title=
"event-connection-read"><code>read</code></dfn> event is fired when
when data is received for a connection. UAs must use the
<code><a href="#connectionreadevent">ConnectionReadEvent</a></code>
interface for this event.</p>
<pre class="idl">
interface <dfn id=
"connectionreadevent">ConnectionReadEvent</dfn> : Event {
readonly attribute DOMString <a href="#data5" title=
"dom-ConnectionReadEvent-data">data</a>;
<del class="diff-old"> readonly attribute DOMString ;
</del>
<ins class="diff-chg"> readonly attribute DOMString <a href=
"#source4" title="dom-ConnectionReadEvent-source">source</a>;
</ins>
void <a href="#initconnectionreadevent" title=
"dom-ConnectionReadEvent-initConnectionReadEvent">initConnectionReadEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString dataArg);
void <a href="#initconnectionreadeventns" title=
"dom-ConnectionReadEvent-initConnectionReadEventNS">initConnectionReadEventNS</a>(in DOMString namespaceURI, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString dataArg);
};
</pre>
<p>The <dfn id="initconnectionreadevent" title=
"dom-ConnectionReadEvent-initConnectionReadEvent"><code>initConnectionReadEvent()</code></dfn>
and <dfn id="initconnectionreadeventns" title=
"dom-ConnectionReadEvent-initConnectionReadEventNS"><code>initConnectionReadEventNS()</code></dfn>
methods must initialise the event in a manner analogous to the
similarly-named methods in the DOM3 Events interfaces. <a href=
"#references">[DOM3EVENTS]</a></p>
<p>The <dfn id="data5" title=
"dom-ConnectionReadEvent-data"><code>data</code></dfn> attribute
represents the data that was transmitted from the peer.</p>
<p>The <dfn id="source4" title=
"dom-ConnectionReadEvent-source"><code>source</code></dfn>
attribute represents the name of the peer. This is primarily useful
on broadcast connections; on direct connections it is equal to the
<code title="dom-Connection-peer"><a href="#peer">peer</a></code>
attribute on the <code><a href="#connection0">Connection</a></code>
object.</p>
<p>Events that would be fired during script execution (e.g. between
the connection object being created — and thus the connection being
established — and the current script completing; or, during the
execution of a <code title="event-connection-read"><a href=
"#read">read</a></code> event handler) must be buffered, and those
events queued up and each one individually fired after the script
has completed.</p>
<h4 id="tcp-connections"><span class="secno"><del class=
"diff-old">6.3.4.</del> <ins class="diff-chg">6.3.4</ins></span>
TCP connections</h4>
<p>The <dfn id="tcpconnection" title=
"dom-TCPConnection"><code>TCPConnection( <var title=
"">subdomain</var> , <var title="">port</var> , <var title=
"">secure</var> )</code></dfn> constructor on the <code><a href=
"#window">Window</a></code> interface returns a new object
implementing the <code><a href="#connection0">Connection</a></code>
interface, set up for a direct connection to a specified host on
the page's domain.</p>
<p>When this constructor is invoked, the following steps must be
followed.</p>
<p>First, if the <del class="diff-old">domain</del> <ins class=
"diff-chg">host</ins> part of the script's <a href=
"#origin0">origin</a> is not a host name (e.g. it is an IP address)
then the UA must raise a <a href="#security9">security
exception</a> . <span class="issue">We currently don't allow
connections to be set up back to an originating IP address, but we
could, if the subdomain is the empty string.</span></p>
<p>Then, if the <var title="">subdomain</var> argument is null or
the empty string, the target host is the <del class=
"diff-old">domain</del> <ins class="diff-chg">host</ins> part of
the script's <a href="#origin0">origin</a> . Otherwise, the
<var title="">subdomain</var> argument is prepended to the
<del class="diff-old">domain</del> <ins class="diff-chg">host</ins>
part of the script's <a href="#origin0">origin</a> with a dot
separating the two strings, and that is the target host.</p>
<p>If either:</p>
<ul>
<li>the target host is not a valid host name, or</li>
<li>the <var title="">port</var> argument is neither equal to 80,
nor equal to 443, nor greater than or equal to 1024 and less than
or equal to 65535,</li>
</ul>
<p>...then the UA must raise a <a href="#security9">security
exception</a> .</p>
<p>Otherwise, the user agent must verify that the <a href=
"#the-string0">the string representing the script's domain in IDNA
format</a> can be obtained without errors. If it cannot, then the
user agent must raise a <a href="#security9">security exception</a>
.</p>
<p>The user agent may also raise a <a href="#security9">security
exception</a> at this time if, for some reason, permission to
create a direct TCP connection to the relevant host is denied.
Reasons could include the UA being instructed by the user to not
allow direct connections, or the UA establishing (for instance
using UPnP) that the network topology will cause connections on the
specified port to be directed at the wrong host.</p>
<p>If no exceptions are raised by the previous steps, then a new
<code><a href="#connection0">Connection</a></code> object must be
created, its <code title="dom-Connection-peer"><a href=
"#peer">peer</a></code> attribute must be set to a string
consisting of the name of the target host, a colon (U+003A COLON),
and the port number as decimal digits, and its <code title=
"dom-Connection-network"><a href="#network1">network</a></code>
attribute must be set to the same value as the <code title=
"dom-Connection-peer"><a href="#peer">peer</a></code>
attribute.</p>
<p>This object must then be returned.</p>
<p>The user agent must then begin trying to establish a connection
with the target host and specified port. (This typically would
begin in the <del class="diff-old">backgound,</del> <ins class=
"diff-chg">background,</ins> while the script continues to
execute.)</p>
<p>If the <var title="">secure</var> boolean argument is set to
true, then the user agent must establish a secure connection with
the target host and specified port using TLS or another protocol,
negotiated with the server. <a href="#references">[RFC2246]</a> If
this fails the user agent must act as if it had <a href=
"#closeConnection">closed the connection</a> .</p>
<p>Once a secure connection is established, or if the <var title=
"">secure</var> boolean argument is not set to true, then the user
agent must continue to connect to the server using the protocol
described in the section entitled <a href="#clients0">clients
connecting over TCP</a> . All data on connections made using TLS
must be sent as "application data".</p>
<p>Once the connection is established, the UA must act as described
in the section entitled <a href="#sending0">sending and receiving
data over TCP</a> .</p>
<p>User agents should allow multiple TCP connections to be
established per host. In particular, user agents should not apply
per-host HTTP connection limits to connections established with the
<code title="dom-TCPConnection"><a href=
"#tcpconnection">TCPConnection</a></code> constructor.</p>
<h4 id="broadcast"><span class="secno"><del class=
"diff-old">6.3.5.</del> <ins class="diff-chg">6.3.5</ins></span>
Broadcast connections</h4>
<p>The <dfn id="localbroadcastconnection" title=
"dom-LocalBroadcastConnection"><code>LocalBroadcastConnection()</code></dfn>
constructor on the <code><a href="#window">Window</a></code>
interface returns a new object implementing the <code><a href=
"#connection0">Connection</a></code> interface, set up to broadcast
on the local network.</p>
<p>When this constructor is invoked, a new <code><a href=
"#connection0">Connection</a></code> object must be created.</p>
<p>The <code title="dom-Connection-network"><a href=
"#network1">network</a></code> attribute of the object must be set
to <a href="#the-string0">the string representing the script's
domain in IDNA format</a> . If this string cannot be obtained, then
the user agent must raise a <a href="#security9">security
exception</a> exception when the constructor is called.</p>
<p>The <code title="dom-Connection-peer"><a href=
"#peer">peer</a></code> attribute must be set to the empty
string.</p>
<p>The object must then be returned, unless, for some reason,
permission to broadcast on the local network is to be denied. In
the latter case, a <a href="#security9">security exception</a> must
be raised instead. User agents may deny such permission for any
reason, for example a user preference.</p>
<p>If the object is returned (i.e. if no exception is raised), the
user agent must the begin broadcasting and listening on the local
network, in the background, as described below. The user agent may
define "the local network" in any way it considers appropriate and
safe; for instance the user agent may ask the user which network
(e.g. Bluetooth, IrDA, Ethernet, etc) the user would like to
broadcast on before beginning broadcasting.</p>
<p>UAs may broadcast and listen on multiple networks at once. For
example, the UA could broadcast on both Bluetooth and Wifi at the
same time.</p>
<p>As soon as the object is returned, the connection <a href=
"#openConnection">has been established</a> , which implies that the
<code title="event-connection-open"><a href=
"#open3">open</a></code> event must be fired. Broadcast connections
are never closed.</p>
<h5 id="broadcasting"><span class="secno">6.3.5.1.</span>
Broadcasting over TCP/IP</h5>
<p class="big-issue">Should we drop this altogether? Letting people
fill the local network with garbage seems unwise.</p>
<p class="big-issue">We need to register a UDP port for this. For
now this spec refers to port 18080/udp.</p>
<p class="note">Since this feature requires that the user agent
listen to a particular port, some platforms might prevent more than
one user agent per IP address from using this feature at any one
time.</p>
<p>On TCP/IP networks, broadcast connections transmit data using
UDP over port 18080.</p>
<p>When the <code title="dom-Connection-send"><a href="#send">send(
<var title="">data</var> )</a></code> method is invoked on a
<code><a href="#connection0">Connection</a></code> object that was
created by the <code title="dom-LocalBroadcastConnection"><a href=
"#localbroadcastconnection">LocalBroadcastConnection()</a></code>
constructor, the user agent must follow these steps:</p>
<ol>
<li>Create a string consisting of the value of the <code title=
"dom-Connection-network"><a href="#network1">network</a></code>
attribute of the <code><a href="#connection0">Connection</a></code>
object, a U+0020 SPACE character, a U+0002 START OF TEXT character,
and the <var title="">data</var> argument.</li>
<li>Encode the string as UTF-8.</li>
<li>If the resulting byte stream is longer than 65487 bytes, raise
an <code>INDEX_SIZE_ERR</code> DOM exception and stop.</li>
<li>Create a UDP packet whose data is the byte stream, with the
source and destination ports being 18080, and with appropriate
length and checksum fields. Transmit this packet to IPv4 address
255.255.255.255 or IPv6 address ff02::1, as appropriate.
<span class="note">IPv6 applications will also have to enable
reception from this address.</span></li>
</ol>
<p>When a broadcast connection is opened on a TCP/IP network, the
user agent should listen for UDP packets on port 18080.</p>
<p>When the user agent receives a packet on port 18080, the user
agent must attempt to decode that packet's data as UTF-8. If the
data is not fully correct UTF-8 (i.e. if there are decoding errors)
then the packet must be ignored. Otherwise, the user agent must
check to see if the decoded string contains a U+0020 SPACE
character. If it does not, then the packet must again be ignored
(it might be a peer discovery packet from a <code title=
"dom-PeerToPeerConnection"><a href=
"#peertopeerconnection">PeerToPeerConnection()</a></code>
constructor). If it does then the user agent must split the string
at the first space character. All the characters before the space
are then known as <var title="">d</var> , and all the characters
after the space are known as <var title="">s</var> . If <var title=
"">s</var> is not at least one character long, or if the first
character of <var title="">s</var> is not a U+0002 START OF TEXT
character, then the packet must be ignored. (This allows for future
extension of this protocol.)</p>
<p>Otherwise, for each <code><a href=
"#connection0">Connection</a></code> object that was created by the
<code title="dom-LocalBroadcastConnection"><a href=
"#localbroadcastconnection">LocalBroadcastConnection()</a></code>
constructor and whose <code title="dom-Connection-network"><a href=
"#network1">network</a></code> attribute exactly matches
<var title="">d</var> , a <code title=
"event-connection-read"><a href="#read">read</a></code> event must
be fired on the <code><a href="#connection0">Connection</a></code>
object. The string <var title="">s</var> , with the first character
removed, must be used as the <code title=
"dom-ConnectionReadEvent-data"><a href="#data5">data</a></code> ,
and the source IP address of the packet as the <code title=
"dom-ConnectionReadEvent-source"><a href=
"#source4">source</a></code> .</p>
<p class="big-issue">Making the source IP available means that if
two or more machines in a private network can be made to go to a
hostile page simultaneously, the hostile page can determine the IP
addresses used locally (i.e. on the other side of any NAT router).
Is there some way we can keep link-local IP addresses secret while
still allowing for applications to distinguish between multiple
participants?</p>
<h5 id="bluetooth-broadcast"><span class="secno">6.3.5.2.</span>
Broadcasting over Bluetooth</h5>
<p class="big-issue">Does anyone know enough about Bluetooth to
write this section?</p>
<h5 id="irda-broadcast"><span class="secno">6.3.5.3.</span>
Broadcasting over IrDA</h5>
<p class="big-issue">Does anyone know enough about IrDA to write
this section?</p>
<h4 id="peer-to-peer"><span class="secno"><del class=
"diff-old">6.3.6.</del> <ins class="diff-chg">6.3.6</ins></span>
Peer-to-peer connections</h4>
<p>The <dfn id="peertopeerconnection" title=
"dom-PeerToPeerConnection"><code>PeerToPeerConnection()</code></dfn>
constructor on the <code><a href="#window">Window</a></code>
interface returns a new object implementing the <code><a href=
"#connection0">Connection</a></code> interface, set up for a direct
connection to a user-specified host.</p>
<p>When this constructor is invoked, a new <code><a href=
"#connection0">Connection</a></code> object must be created.</p>
<p>The <code title="dom-Connection-network"><a href=
"#network1">network</a></code> attribute of the object must be set
to <a href="#the-string0">the string representing the script's
domain in IDNA format</a> . If this string cannot be obtained, then
the user agent must raise a <a href="#security9">security
exception</a> exception when the constructor is called.</p>
<p>The <code title="dom-Connection-peer"><a href=
"#peer">peer</a></code> attribute must be set to the empty
string.</p>
<p>The object must then be returned, unless, for some reason,
permission to establish peer-to-peer connections is generally
disallowed, for example due to administrator settings. In the
latter case, a <a href="#security9">security exception</a> must be
raised instead.</p>
<p>The user agent must then, typically while the script resumes
execution, find a remote host to establish a connection to. To do
this it must start broadcasting and listening for peer discovery
messages and listening for incoming connection requests on all the
supported networks. How this is performed depends on the type of
network and is described below.</p>
<p>The UA should inform the user of the clients that are detected,
and allow the user to select one to connect to. UAs may also allow
users to explicit specify hosts that were not detected, e.g. by
having the user enter an IP address.</p>
<p>If an incoming connection is detected before the user specifies
a target host, the user agent should ask the user to confirm that
this is the host they wish to connect to. If it is, the connection
should be accepted and the UA will act as the <em>server</em> in
this connection. (Which UA acts as the server and which acts as the
client is not discernible at the DOM API level.)</p>
<p>If no incoming connection is detected and if the user specifies
a particular target host, a connection should be established to
that host, with the UA acting as the <em>client</em> in the
connection.</p>
<p>No more than one connection must be established per
<code><a href="#connection0">Connection</a></code> object, so once
a connection has been established, the user agent must stop
listening for further connections (unless, or until such time as,
another <code><a href="#connection0">Connection</a></code> object
is being created).</p>
<p>If at any point the user cancels the connection process or the
remote host refuses the connection, then the user agent must act as
if it had <a href="#closeConnection">closed the connection</a> ,
and stop trying to connect.</p>
<h5 id="peer-to-peer0"><span class="secno">6.3.6.1.</span>
Peer-to-peer connections over TCP/IP</h5>
<p class="big-issue">Should we replace this section with something
that uses Rendez-vous/zeroconf or equivalent?</p>
<p class="big-issue">We need to register ports for this. For now
this spec refers to port 18080/udp and 18080/tcp.</p>
<p class="note">Since this feature requires that the user agent
listen to a particular port, some platforms might prevent more than
one user agent per IP address from using this feature at any one
time.</p>
<p>When using TCP/IP, broadcasting peer discovery messages must be
done by creating UDP packets every few seconds containing as their
data the value of the connection's <code title=
"dom-Connection-network"><a href="#network1">network</a></code>
attribute, encoded as UTF-8, with the source and destination ports
being set to 18080 and appropriate length and checksum fields, and
sending these packets to address (in IPv4) 255.255.255.255 or (in
IPv6) ff02::1, as appropriate.</p>
<p>Listening for peer discovery messages must be done by examining
incoming UDP packets on port 18080. <span class="note">IPv6
applications will also have to enable reception from the ff02::1
address.</span> If their payload is exactly byte-for-byte equal to
a UTF-8 encoded version of the value of the connection's
<code title="dom-Connection-network"><a href=
"#network1">network</a></code> attribute, then the source address
of that packet represents the address of a host that is ready to
accept a peer-to-peer connection, and it should therefore be
offered to the user.</p>
<p>Incoming connection requests must be listened for on TCP port
18080. If an incoming connection is received, the UA must act as a
<em>server</em> , as described in the section entitled <a href=
"#servers0">servers accepting connections over TCP</a> .</p>
<p>If no incoming connection requests are accepted and the user
instead specifies a target host to connect to, the UA acts as a
<em>client</em> : the user agent must attempt to connect to the
user-specified host on port 18080, as described in the section
entitled <a href="#clients0">clients connecting over TCP</a> .</p>
<p>Once the connection is established, the UA must act as described
in the section entitled <a href="#sending0">sending and receiving
data over TCP</a> .</p>
<p class="note">This specification does not include a way to
establish <em>secure</em> (encrypted) peer-to-peer connections at
this time. <span class="big-issue">If you can see a good way to do
this, let me know.</span></p>
<h5 id="bluetooth-peer"><span class="secno">6.3.6.2.</span>
Peer-to-peer connections over Bluetooth</h5>
<p class="big-issue">Does anyone know enough about Bluetooth to
write this section?</p>
<h5 id="irda-peer"><span class="secno">6.3.6.3.</span> Peer-to-peer
connections over IrDA</h5>
<p class="big-issue">Does anyone know enough about IrDA to write
this section?</p>
<h4 id="the-common"><span class="secno"><del class=
"diff-old">6.3.7.</del> <ins class="diff-chg">6.3.7</ins></span>
The common protocol for TCP-based connections</h4>
<p>The same protocol is used for <code title=
"dom-TCPConnection"><a href=
"#tcpconnection">TCPConnection</a></code> and <code title=
"dom-PeerToPeerConnection"><a href=
"#peertopeerconnection">PeerToPeerConnection</a></code> connection
types. This section describes how such connections are established
from the client and server sides, and then describes how data is
sent and received over such connections (which is the same for both
clients and servers).</p>
<h5 id="clients"><span class="secno">6.3.7.1.</span> <dfn id=
"clients0">Clients connecting over TCP</dfn></h5>
<p>This section defines the client-side requirements of the
protocol used by the <code title="dom-TCPConnection"><a href=
"#tcpconnection">TCPConnection</a></code> and <code title=
"dom-PeerToPeerConnection"><a href=
"#peertopeerconnection">PeerToPeerConnection</a></code> connection
types.</p>
<p>If a TCP connection to the specified target host and port cannot
be established, for example because the target host is a domain
name that cannot be resolved to an IP address, or because packets
cannot be routed to the host, the user agent should retry creating
the connection. If the user agent gives up trying to connect, the
user agent must act as if it had <a href="#closeConnection">closed
the connection</a> .</p>
<p class="note">No information regarding the state of the
connection is passed to the application while the connection is
being established in this version of this specification.</p>
<p>Once a TCP/IP connection to the remote host is established, the
user agent must transmit the following sequence of bytes,
represented here in hexadecimal form:</p>
<pre>
0x48
0x65
0x6C
0x6C
0x6F
0x0A
</pre>
<p class="note">This represents the string "Hello" followed by a
newline, encoded in UTF-8.</p>
<p>The user agent must then read all the bytes sent from the remote
host, up to the first 0x0A byte (inclusive). That string of bytes
is then compared byte-for-byte to the following string of
bytes:</p>
<pre>
0x57
0x65
0x6C
0x63
0x6F
0x6E
0x65
0x0A
</pre>
<p class="note">This says "Welcome".</p>
<p>If the server sent back a string in any way different to this,
then the user agent must <a href="#closeConnection">close the
connection</a> and give up trying to connect.</p>
<p>Otherwise, the user agent must then take <a href=
"#the-string0">the string representing the script's domain in IDNA
format</a> , encode it as UTF-8, and send that to the remote host,
followed by a 0x0A byte (a U+000A LINE FEED in UTF-8).</p>
<p>The user agent must then read all the bytes sent from the remote
host, up to the first 0x0A byte (inclusive). That string of bytes
must then be compared byte-for-byte to the string that was just
sent to the server (the one with the IDNA domain name and ending
with a newline character). If the server sent back a string in any
way different to this, then the user agent must <a href=
"#closeConnection">close the connection</a> and give up trying to
connect.</p>
<p>Otherwise, the connection <a href="#openConnection">has been
established</a> (and events and so forth get fired, as described
above).</p>
<p>If at any point during this process the connection is closed
prematurely, then the user agent must <a href=
"#closeConnection">close the connection</a> and give up trying to
connect.</p>
<h5 id="servers"><span class="secno">6.3.7.2.</span> <dfn id=
"servers0">Servers accepting connections over TCP</dfn></h5>
<p>This section defines the server side of the protocol described
in the previous section. For authors, it should be used as a guide
for how to implement servers that can communicate with Web pages
over TCP. For UAs these are the requirements for the server part of
<code title="dom-PeerToPeerConnection"><a href=
"#peertopeerconnection">PeerToPeerConnection</a></code> s.</p>
<p>Once a TCP/IP connection from a remote host is established, the
user agent must transmit the following sequence of bytes,
represented here in hexadecimal form:</p>
<pre>
0x57
0x65
0x6C
0x63
0x6F
0x6E
0x65
0x0A
</pre>
<p class="note">This says "Welcome" and a newline in UTF-8.</p>
<p>The user agent must then read all the bytes sent from the remote
host, up to the first 0x0A byte (inclusive). That string of bytes
is then compared byte-for-byte to the following string of
bytes:</p>
<pre>
0x48
0x65
0x6C
0x6C
0x6F
0x0A
</pre>
<p class="note">"Hello" and a newline.</p>
<p>If the remote host sent back a string in any way different to
this, then the user agent must <a href="#closeConnection">close the
connection</a> and give up trying to connect.</p>
<p>Otherwise, the user agent must then take <a href=
"#the-string0">the string representing the script's domain in IDNA
format</a> , encode it as UTF-8, and send that to the remote host,
followed by a 0x0A byte (a U+000A LINE FEED in UTF-8).</p>
<p>The user agent must then read all the bytes sent from the remote
host, up to the first 0x0A byte (inclusive). That string of bytes
must then be compared byte-for-byte to the string that was just
sent to that host (the one with the IDNA domain name and ending
with a newline character). If the remote host sent back a string in
any way different to this, then the user agent must <a href=
"#closeConnection">close the connection</a> and give up trying to
connect.</p>
<p>Otherwise, the connection <a href="#openConnection">has been
established</a> (and events and so forth get fired, as described
above).</p>
<p class="note">For author-written servers (as opposed to the
server side of a peer-to-peer connection), the script's domain
would be replaced by the hostname of the server. Alternatively,
such servers might instead wait for the client to send its domain
string, and then simply echo it back. This would allow connections
from pages on any domain, instead of just pages originating from
the same host. The client compares the two strings to ensure they
are the same before allowing the connection to be used by author
script.</p>
<p>If at any point during this process the connection is closed
prematurely, then the user agent must <a href=
"#closeConnection">close the connection</a> and give up trying to
connect.</p>
<h5 id="sending"><span class="secno">6.3.7.3.</span> <dfn id=
"sending0">Sending and receiving data over TCP</dfn></h5>
<p>When the <code title="dom-Connection-send"><a href="#send">send(
<var title="">data</var> )</a></code> method is invoked on the
connection's corresponding <code><a href=
"#connection0">Connection</a></code> object, the user agent must
take the <var title="">data</var> argument, replace any U+0000 NULL
and U+0017 END OF TRANSMISSION BLOCK characters in it with U+FFFD
REPLACEMENT CHARACTER characters, then transmit a U+0002 START OF
TEXT character, this new <var title="">data</var> string and a
single U+0017 END OF TRANSMISSION BLOCK character (in that order)
to the remote host, all encoded as UTF-8.</p>
<p>When the user agent receives bytes on the connection, the user
agent must buffer received bytes until it receives a 0x17 byte (a
U+0017 END OF TRANSMISSION BLOCK character). If the first buffered
byte is not a 0x02 byte (a U+0002 START OF TEXT character encoded
as UTF-8) then all the data up to the 0x17 byte, inclusive, must be
dropped. (This allows for future extension of this protocol.)
Otherwise, all the data from (but not including) the 0x02 byte and
up to (but not including) the 0x17 byte must be taken, interpreted
as a UTF-8 string, and a <code title=
"event-connection-read"><a href="#read">read</a></code> event must
be fired on the <code><a href="#connection0">Connection</a></code>
object with that string as the <code title=
"dom-ConnectionReadEvent-data"><a href="#data5">data</a></code> .
If that string cannot be decoded as UTF-8 without errors, the
packet should be ignored.</p>
<p class="note">This protocol does not yet allow binary data (e.g.
an image or <a href="#media9">media data</a> ) to be efficiently
transmitted. A future version of this protocol might allow this by
using the prefix character U+001F INFORMATION SEPARATOR ONE,
followed by binary data which uses a particular byte (e.g. 0xFF) to
encode byte 0x17 somehow (since otherwise 0x17 would be treated as
transmission end by down-level UAs).</p>
<h4 id="network-security"><span class="secno"><del class=
"diff-old">6.3.8.</del> <ins class="diff-chg">6.3.8</ins></span>
Security</h4>
<p class="big-issue">Need to write this section.</p>
<p class="big-issue">If you have an unencrypted page that is
(through a man-in-the-middle attack) changed, it can access a
secure service that is using IP authentication and then send that
data back to the attacker. Ergo we should probably stop unencrypted
pages from accessing encrypted services, on the principle that the
actual level of security is zero. Then again, if we do that, we
prevent insecure sites from using SSL as a tunneling mechanism.</p>
<p class="big-issue">Should consider dropping the subdomain-only
restriction. It doesn't seem to add anything, and prevents
cross-domain chatter.</p>
<h4 id="network-other-specs"><span class="secno"><del class=
"diff-old">6.3.9.</del> <ins class="diff-chg">6.3.9</ins></span>
Relationship to other standards</h4>
<p class="big-issue">Should have a section talking about the fact
that we blithely ignoring IANA's port assignments here.</p>
<p class="big-issue">Should explain why we are not reusing HTTP for
this. (HTTP is too heavy-weight for such a simple need; requiring
authors to implement an HTTP server just to have a party line is
too much of a barrier to entry; cannot rely on prebuilt components;
having a simple protocol makes it much easier to do RAD; HTTP
doesn't fit the needs and doesn't have the security model needed;
etc)</p>
<h3 id="crossDocumentMessages"><span class="secno"><del class=
"diff-old">6.4.</del> <ins class="diff-chg">6.4</ins></span>
<dfn id="cross-document">Cross-document messaging</dfn></h3>
<p>Web browsers, for security and privacy reasons, prevent
documents in different domains from affecting each other; that is,
cross-site scripting is disallowed.</p>
<p>While this is an important security feature, it prevents pages
from different domains from communicating even when those pages are
not hostile. This section introduces a messaging system that allows
documents to communicate with each other regardless of their source
domain, in a way designed to not enable cross-site scripting
attacks.</p>
<h4 id="processing4"><span class="secno"><del class=
"diff-old">6.4.1.</del> <ins class="diff-chg">6.4.1</ins></span>
Processing model</h4>
<p>When a script invokes the <dfn id="postmessage" title=
"dom-window-postMessage"><code>postMessage( <var title=
"">message</var> , <var title=""><ins class=
"diff-new">targetOrigin</ins></var> )</code></dfn> method on a
<code><a href="#window">Window</a></code> object, the user agent
must <del class="diff-old">create</del> <ins class=
"diff-chg">follow these steps:</ins></p>
<ol>
<li>
<p><ins class="diff-chg">If the value of the</ins> <var title=
""><ins class="diff-chg">targetOrigin</ins></var> <ins class=
"diff-chg">argument is neither a single U+002A ASTERISK character
("*") nor a valid URI or IRI, then throw a</ins> <code><ins class=
"diff-chg">SYNTAX_ERR</ins></code> <ins class="diff-chg">exception
and abort the overall set of steps.</ins> <a href=
"#references"><ins class="diff-chg">[RFC3986]</ins></a> <a href=
"#references"><ins class="diff-chg">[RFC3987]</ins></a></p>
</li>
<li>
<p><ins class="diff-chg">Return from the</ins> <code title=
"dom-window-postMessage"><a href="#postmessage"><ins class=
"diff-chg">postMessage()</ins></a></code> <ins class=
"diff-chg">method, but asynchronously continue running these
steps.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Wait for the</ins> <code><a href=
"#window"><ins class="diff-chg">Window</ins></a></code> <ins class=
"diff-chg">object on which the method was invoked to have finished
executing any pending scripts.</ins></p>
</li>
<li>
<p><ins class="diff-chg">If the</ins> <var title=""><ins class=
"diff-chg">targetOrigin</ins></var> <ins class="diff-chg">argument
has a value other than a single literal U+002A ASTERISK character
("*"), and the</ins> <a href="#active"><ins class="diff-chg">active
document</ins></a> <ins class="diff-chg">of the</ins>
<code><a href="#window"><ins class=
"diff-chg">Window</ins></a></code> <ins class="diff-chg">object on
which the method was invoked does not have the</ins> <a href=
"#same-origin"><ins class="diff-chg">same origin</ins></a>
<ins class="diff-chg">as</ins> <var title=""><ins class=
"diff-chg">targetOrigin</ins></var> ,<ins class="diff-chg">then
abort these steps silently.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Create</ins> an event that uses the
<code><a href="#messageevent">MessageEvent</a></code> interface,
with the event name <code title="event-message"><a href=
"#message0">message</a></code> , which <del class=
"diff-old">bubbles,</del> <ins class="diff-chg">does not
bubble,</ins> is cancelable, and has no default action. The
<code title="dom-MessageEvent-data"><a href=
"#data4">data</a></code> attribute must be set to the value passed
as the <var title="">message</var> argument to the <code title=
"dom-window-postMessage"><a href=
"#postmessage">postMessage()</a></code> method, the <code title=
"dom-MessageEvent-origin"><del class="diff-old">domain</del>
<a href="#origin1"><ins class="diff-chg">origin</ins></a></code>
attribute must be set to the <del class="diff-old">domain</del>
<a href="#serialization0" title=
"serialization of an origin"><ins class=
"diff-chg">serialization</ins></a> of the <del class=
"diff-old">document</del> <a href="#origin0"><ins class=
"diff-chg">origin</ins></a> <del class="diff-old">that</del>
<ins class="diff-chg">of</ins> the script that invoked the
<del class="diff-old">methods is associated with,</del> <ins class=
"diff-chg">method,</ins> the <code title=
"dom-MessageEvent-lastEventId"><del class="diff-old">uri</del>
<a href="#lasteventid"><ins class=
"diff-chg">lastEventId</ins></a></code> attribute must be set to
the <del class="diff-old">URI of that document,</del> <ins class=
"diff-chg">empty string,</ins> and the <code title=
"dom-MessageEvent-source"><a href="#source3">source</a></code>
attribute must be set to the <code><a href=
"#window">Window</a></code> object of the <a href=
"#default3">default view</a> of the <a href="#browsing1">browsing
context <del class="diff-old">with</del></a> <ins class=
"diff-chg">for</ins> which <del class="diff-old">that document is
associated. Define 'domain' more exactly -- IDN vs no IDN, absence
of ports, effect of window.document.domain on its value, etc The
event must then be dispatched at</del> the <code>Document</code>
object <del class="diff-old">that</del> <ins class="diff-chg">with
which the script is associated</ins> is the <a href=
"#active">active document</a> <del class="diff-old">of</del>
<ins class="diff-chg">.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Dispatch the event created in the previous
step at</ins> the <code><a href="#window">Window</a></code> object
on which the method was invoked. <del class="diff-old">The
postMessage() method must only return once the event dispatch has
been completely processed by the target document (i.e. all three of
the capture, target, and bubble phases have been done, and event
listeners have been executed as appropriate).</del></p>
</li>
</ol>
<p class="warning">Authors should check the <code title=
"dom-MessageEvent-origin"><del class="diff-old">domain</del>
<a href="#origin1"><ins class="diff-chg">origin</ins></a></code>
attribute to ensure that messages are only accepted from domains
that they expect to receive messages from. Otherwise, bugs in the
author's message handling code could be exploited by hostile
sites.</p>
<p class="warning"><ins class="diff-new">Authors should not use the
wildcard keyword ("*") in the</ins> <var title=""><ins class=
"diff-new">targetOrigin</ins></var> <ins class="diff-new">argument
in messages that contain any confidential information, as otherwise
there is no way to guarantee that the message is only delivered to
the recipient to which it was intended.</ins></p>
<div class="example">
<p>For example, if document A contains an <code><a href=
"#object">object</a></code> element that contains document B, and
script in document A calls <code title=
"dom-window-postMessage"><a href=
"#postmessage">postMessage()</a></code> on document B, then a
message event will be fired on that element, marked as originating
from document A. The script in document A might look like:</p>
<pre>
var o = document.getElementsByTagName('object')[0];
<del class="diff-old">o.('Hello world');
</del>
<ins class="diff-chg">o.contentWindow.postMessage('Hello
world',
'http://b.example.org/');
</ins>
</pre>
<p>To register an event handler for incoming events, the script
would use <code title="">addEventListener()</code> (or similar
mechanisms). For example, the script in document B might look
like:</p>
<pre>
document.addEventListener('message', receiver, false);
function receiver(e) {
<del class="diff-old"> if (e.domain == 'example.com') {
</del>
<ins class="diff-chg"> if (e.origin == 'http://example.com') {
</ins>
if (e.data == 'Hello world') {
<del class="diff-old"> e.source.postMessage('Hello');
</del>
<ins class=
"diff-chg"> e.source.postMessage('Hello', e.origin);
</ins>
} else {
alert(e.data);
}
}
}
</pre>
<p>This script first checks the domain is the expected domain, and
then looks at the message, which it either displays to the user, or
responds to by sending a message back to the document which sent
the message in the first place.</p>
</div>
<p class="warning">The integrity of this API is based on the
inability for scripts of one <a href="#origin0">origin</a> to post
arbitrary events (using <code title="">dispatchEvent()</code> or
otherwise) to objects in other <del class="diff-old">origins.</del>
<ins class="diff-chg">origins (those that are not the</ins>
<a href="#same-origin" title="same origin"><ins class=
"diff-chg">same</ins></a> <ins class="diff-chg">).</ins></p>
<p class="note">Implementors are urged to take extra care in the
implementation of this feature. It allows authors to transmit
information from one domain to another domain, which is normally
disallowed for security reasons. It also requires that UAs be
careful to allow access to certain properties but not others.</p>
<h2 id="repetition"><span class="secno">7.</span> Repetition
templates</h2>
<p class="big-issue">See <a href=
"http://www.whatwg.org/specs/web-forms/current-work/#repeatingFormControls">
WF2</a> for now</p>
<h2 id="syntax"><span class="secno">8.</span> The HTML syntax</h2>
<h3 id="writing0"><span class="secno"><del class=
"diff-old">8.1.</del> <ins class="diff-chg">8.1</ins></span>
Writing HTML documents</h3>
<p><em>This section only applies to documents, authoring tools, and
markup generators. In particular, it does not apply to conformance
checkers; conformance checkers must use the requirements given in
the next section ("parsing HTML documents").</em></p>
<p>Documents must consist of the following parts, in the given
order:</p>
<ol>
<li>Optionally, a single U+FEFF BYTE ORDER MARK (BOM)
character.</li>
<li>Any number of <a href="#comments0" title=
"syntax-comments">comments</a> and <a href="#space" title=
"space character">space characters</a> .</li>
<li>A <a href="#doctype" title="syntax-doctype">DOCTYPE</a> .</li>
<li>Any number of <a href="#comments0" title=
"syntax-comments">comments</a> and <a href="#space" title=
"space character">space characters</a> .</li>
<li>The root element, in the form of an <code><a href=
"#html">html</a></code> <a href="#elements3" title=
"syntax-elements">element</a> .</li>
<li>Any number of <a href="#comments0" title=
"syntax-comments">comments</a> and <a href="#space" title=
"space character">space characters</a> .</li>
</ol>
<p>The various types of content mentioned above are described in
the next few sections.</p>
<p>In addition, there are some restrictions on how <span>character
encoding declarations</span> are to be <del class=
"diff-old">serialised,</del> <ins class=
"diff-chg">serialized,</ins> as discussed in the section on that
topic.</p>
<div class="note">
<p><del class="diff-old">The U+0000 NULL character must not appear
anywhere in a document.</del> Space characters before the root
<code><a href="#html">html</a></code> <ins class=
"diff-new">element, and space characters at the start of the</ins>
<code><a href="#html"><ins class="diff-new">html</ins></a></code>
element <ins class="diff-new">and before the</ins> <code><a href=
"#head"><ins class="diff-new">head</ins></a></code> <ins class=
"diff-new">element,</ins> will be dropped when the document is
parsed; space characters <em>after</em> the root <code><a href=
"#html">html</a></code> element will be parsed as if they were at
the end of the <code><del class="diff-old">html</del> <a href=
"#body0"><ins class="diff-chg">body</ins></a></code> element. Thus,
space characters around the root element do not round-trip.</p>
<p>It is suggested that newlines be inserted after the <del class=
"diff-old">DOCTYPE and</del> <ins class="diff-chg">DOCTYPE,
after</ins> any comments that <del class="diff-old">aren't in</del>
<ins class="diff-chg">are before</ins> the root <ins class=
"diff-new">element, after the</ins> <code><a href=
"#html"><ins class="diff-new">html</ins></a></code> <ins class=
"diff-new">element's start tag (if it is not</ins> <a href=
"#omitted" title="syntax-tag-omission"><ins class=
"diff-new">omitted</ins></a> <ins class="diff-new">), and after any
comments that are inside the</ins> <code><a href=
"#html"><ins class="diff-new">html</ins></a></code> <ins class=
"diff-new">element but before the</ins> <code><a href=
"#head"><ins class="diff-new">head</ins></a></code> element.</p>
</div>
<h4 id="the-doctype"><span class="secno"><del class=
"diff-old">8.1.1.</del> <ins class="diff-chg">8.1.1</ins></span>
The DOCTYPE</h4>
<p>A <dfn id="doctype" title="syntax-doctype">DOCTYPE</dfn> is a
mostly useless, but required, header.</p>
<p class="note">DOCTYPEs are required for legacy reasons. When
omitted, browsers tend to use a different rendering mode that is
incompatible with some specifications. Including the DOCTYPE in a
document ensures that the browser makes a best-effort attempt at
following the relevant specifications.</p>
<p>A DOCTYPE must consist of the following characters, in this
order:</p>
<ol class="brief">
<li>A U+003C LESS-THAN SIGN ( <code><</code> ) character.</li>
<li>A U+0021 EXCLAMATION MARK ( <code>!</code> ) character.</li>
<li>A U+0044 LATIN CAPITAL LETTER D or U+0064 LATIN SMALL LETTER D
character.</li>
<li>A U+004F LATIN CAPITAL LETTER O or U+006F LATIN SMALL LETTER O
character.</li>
<li>A U+0043 LATIN CAPITAL LETTER C or U+0063 LATIN SMALL LETTER C
character.</li>
<li>A U+0054 LATIN CAPITAL LETTER T or U+0074 LATIN SMALL LETTER T
character.</li>
<li>A U+0059 LATIN CAPITAL LETTER Y or U+0079 LATIN SMALL LETTER Y
character.</li>
<li>A U+0050 LATIN CAPITAL LETTER P or U+0070 LATIN SMALL LETTER P
character.</li>
<li>A U+0045 LATIN CAPITAL LETTER E or U+0065 LATIN SMALL LETTER E
character.</li>
<li>One or more <a href="#space" title="space character">space
characters</a> .</li>
<li>A U+0048 LATIN CAPITAL LETTER H or U+0068 LATIN SMALL LETTER H
character.</li>
<li>A U+0054 LATIN CAPITAL LETTER T or U+0074 LATIN SMALL LETTER T
character.</li>
<li>A U+004D LATIN CAPITAL LETTER M or U+006D LATIN SMALL LETTER M
character.</li>
<li>A U+004C LATIN CAPITAL LETTER L or U+006C LATIN SMALL LETTER L
character.</li>
<li>Zero or more <a href="#space" title="space character">space
characters</a> .</li>
<li>A U+003E GREATER-THAN SIGN ( <code>></code> )
character.</li>
</ol>
<p class="note">In other words, <code><!DOCTYPE HTML></code>
, case-insensitively.</p>
<h4 id="elements0"><span class="secno"><del class=
"diff-old">8.1.2.</del> <ins class="diff-chg">8.1.2</ins></span>
Elements</h4>
<p>There are <del class="diff-old">four</del> <ins class=
"diff-chg">five</ins> different kinds of <dfn id="elements3" title=
"syntax-elements">elements</dfn> : void elements, CDATA elements,
RCDATA elements, <ins class="diff-new">foreign elements,</ins> and
normal elements.</p>
<dl>
<dt><dfn id="void-elements">Void elements</dfn></dt>
<dd><code><a href="#base">base</a></code> , <code><a href=
"#link">link</a></code> , <code><a href="#meta0">meta</a></code> ,
<code><a href="#hr">hr</a></code> , <code><a href=
"#br">br</a></code> , <code><a href="#img">img</a></code> ,
<code><a href="#embed">embed</a></code> , <code><a href=
"#param">param</a></code> , <code><a href="#area">area</a></code> ,
<code><a href="#col">col</a></code> , <code>input</code></dd>
<dt>CDATA elements</dt>
<dd><code><a href="#style1">style</a></code> , <code><a href=
"#script1">script</a></code></dd>
<dt>RCDATA elements</dt>
<dd><code><a href="#title1">title</a></code> ,
<code>textarea</code></dd>
<dt><ins class="diff-new">Foreign elements</ins></dt>
<dd><ins class="diff-new">Elements from the</ins> <a href=
"#mathml0"><ins class="diff-new">MathML namespace</ins></a></dd>
<dt>Normal elements</dt>
<dd>All other allowed <a href="#html-elements">HTML elements</a>
are normal elements.</dd>
</dl>
<p><dfn id="tags" title="syntax-tags">Tags</dfn> are used to
delimit the start and end of elements in the markup. CDATA, RCDATA,
and normal elements have a <a href="#start6" title=
"syntax-start-tags">start tag</a> to indicate where they begin, and
an <a href="#end-tags0" title="syntax-end-tags">end tag</a> to
indicate where they end. The start and end tags of certain normal
elements can be <a href="#omitted" title=
"syntax-tag-omission">omitted</a> , as described later. Those that
cannot be omitted must not be omitted. Void elements only have a
start tag; end tags must not be specified for void elements.
<ins class="diff-new">Foreign elements must either have a start tag
and an end tag, or a start tag that is marked as self-closing, in
which case they must not have an end tag.</ins></p>
<p>The contents of the element must be placed between just after
the start tag (which <a href="#omitted" title=
"syntax-tag-omission">might be implied, in certain cases</a> ) and
just before the end tag (which again, <a href="#omitted" title=
"syntax-tag-omission">might be implied in certain cases</a> ). The
exact allowed contents of each individual element depends on the
content model of that element, as described earlier in this
specification. Elements must not contain content that their content
model disallows. In addition to the restrictions placed on the
contents by those content models, however, the <del class=
"diff-old">four</del> <ins class="diff-chg">five</ins> types of
elements have additional <em>syntactic</em> requirements.</p>
<p>Void elements can't have any contents (since there's no end tag,
no content can be put between the start tag and the end <del class=
"diff-old">tag.)</del> <ins class="diff-chg">tag).</ins></p>
<p>CDATA elements can have <a href="#text2" title=
"syntax-text">text</a> , though it has <a href=
"#cdata-rcdata-restrictions">restrictions</a> described below.</p>
<p>RCDATA elements can have <a href="#text2" title=
"syntax-text">text</a> and <a href="#character3" title=
"syntax-charref">character <del class="diff-old">entity</del>
references</a> , but the text must not contain an <a href=
"#ambiguous" title="syntax-ambiguous-ampersand">ambiguous
ampersand</a> . There are also <a href=
"#cdata-rcdata-restrictions">further restrictions</a> described
below.</p>
<p><ins class="diff-new">Foreign elements whose start tag is marked
as self-closing can't have any contents (since, again, as there's
no end tag, no content can be put between the start tag and the end
tag). Foreign elements whose start tag is</ins> <em><ins class=
"diff-new">not</ins></em> <ins class="diff-new">marked as
self-closing can have</ins> <a href="#text2" title=
"syntax-text"><ins class="diff-new">text</ins></a> ,<a href=
"#character3" title="syntax-charref"><ins class=
"diff-new">character references</ins></a> ,<a href="#cdata0" title=
"syntax-cdata"><ins class="diff-new">CDATA blocks</ins></a>
,<ins class="diff-new">other</ins> <a href="#elements3" title=
"syntax-elements"><ins class="diff-new">elements</ins></a>
,<ins class="diff-new">and</ins> <a href="#comments0" title=
"syntax-comments"><ins class="diff-new">comments</ins></a>
,<ins class="diff-new">but the text must not contain the character
U+003C LESS-THAN SIGN (</ins> <code><ins class=
"diff-new"><</ins></code> <ins class="diff-new">) or an</ins>
<a href="#ambiguous" title="syntax-ambiguous-ampersand"><ins class=
"diff-new">ambiguous ampersand</ins></a> .</p>
<p>Normal elements can have <a href="#text2" title=
"syntax-text">text</a> , <a href="#character3" title=
"syntax-charref">character <del class="diff-old">entity</del>
references</a> , other <a href="#elements3" title=
"syntax-elements">elements</a> , and <a href="#comments0" title=
"syntax-comments">comments</a> , but the text must not contain the
character U+003C LESS-THAN SIGN ( <code><</code> ) or an
<a href="#ambiguous" title="syntax-ambiguous-ampersand">ambiguous
ampersand</a> . Some normal elements also have <a href=
"#element-restrictions">yet more restrictions</a> on what content
they are allowed to hold, beyond the restrictions imposed by the
content model and those described in this paragraph. Those
restrictions are described below.</p>
<p>Tags contain a <dfn id="tag-name" title="syntax-tag-name">tag
name</dfn> , giving the element's name. HTML elements all have
names that only use characters in the range <ins class=
"diff-new">U+0030 DIGIT ZERO .. U+0039 DIGIT NINE,</ins> U+0061
LATIN SMALL LETTER A .. U+007A LATIN SMALL LETTER Z, <del class=
"diff-old">or, in uppercase,</del> U+0041 LATIN CAPITAL LETTER A ..
U+005A LATIN CAPITAL LETTER Z, and U+002D HYPHEN-MINUS (
<code>-</code> ). In the HTML syntax, tag names may be written with
any mix of lower- and uppercase letters that, when converted to
all-lowercase, matches the element's tag name; tag names are
case-insensitive.</p>
<h5 id="start"><span class="secno">8.1.2.1.</span> Start tags</h5>
<p><dfn id="start6" title="syntax-start-tags">Start tags</dfn> must
have the following format:</p>
<ol>
<li>The first character of a start tag must be a U+003C LESS-THAN
SIGN ( <code><</code> ).</li>
<li>The next few characters of a start tag must be the element's
<a href="#tag-name" title="syntax-tag-name">tag name</a> .</li>
<li>If there are to be any attributes in the next step, there must
first be one or more <a href="#space" title="space character">space
characters</a> .</li>
<li>Then, the start tag may have a number of attributes, the
<a href="#attributes2" title="syntax-attributes">syntax for
which</a> is described below. Attributes may be separated from each
other by one or more <a href="#space" title="space character">space
characters</a> .</li>
<li>After the attributes, there may be one or more <a href="#space"
title="space character">space characters</a> . (Some attributes are
required to be followed by a space. See the <a href="#attributes2"
title="syntax-attributes">attributes section</a> below.)</li>
<li>Then, if the element is one of the void elements, <ins class=
"diff-new">or if the element is a foreign element,</ins> then there
may be a single U+002F SOLIDUS ( <code>/</code> ) character. This
character has no effect <del class="diff-old">except to
appease</del> <ins class="diff-chg">on void elements, but on
foreign elements it marks</ins> the <del class="diff-old">markup
gods. As this character is therefore just a symbol of faith,
atheists should omit it.</del> <ins class="diff-chg">start tag as
self-closing.</ins></li>
<li>Finally, start tags must be closed by a U+003E GREATER-THAN
SIGN ( <code>></code> ) character.</li>
</ol>
<h5 id="end-tags"><span class="secno">8.1.2.2.</span> End tags</h5>
<p><dfn id="end-tags0" title="syntax-end-tags">End tags</dfn> must
have the following format:</p>
<ol>
<li>The first character of an end tag must be a U+003C LESS-THAN
SIGN ( <code><</code> ).</li>
<li>The second character of an end tag must be a U+002F SOLIDUS (
<code>/</code> ).</li>
<li>The next few characters of an end tag must be the element's
<a href="#tag-name" title="syntax-tag-name">tag name</a> .</li>
<li>After the tag name, there may be one or more <a href="#space"
title="space character">space characters</a> .</li>
<li>Finally, end tags must be closed by a U+003E GREATER-THAN SIGN
( <code>></code> ) character.</li>
</ol>
<h5 id="attributes1"><span class="secno">8.1.2.3.</span>
Attributes</h5>
<p><dfn id="attributes2" title="syntax-attributes">Attributes</dfn>
for an element are expressed inside the element's start tag.</p>
<p>Attributes have a name and a value. <dfn id="attribute" title=
"syntax-attribute-name">Attribute names</dfn> must consist of one
<del class="diff-old">character other than the space characters ,
U+003E GREATER-THAN SIGN (>), and U+002F SOLIDUS (/), followed
by zero</del> or more characters other than the <a href="#space"
title="space character">space characters</a> , <ins class=
"diff-new">U+0000 NULL, U+0022 QUOTATION MARK ("), U+0027
APOSTROPHE ('),</ins> U+003E GREATER-THAN SIGN (>), U+002F
SOLIDUS (/), and U+003D EQUALS SIGN <del class=
"diff-old">(=).</del> <ins class="diff-chg">(=) characters, the
control characters, and any characters that are not defined by
Unicode.</ins> In the HTML syntax, attribute names may be written
with any mix of lower- and uppercase letters that, when converted
to all-lowercase, matches the attribute's name; attribute names are
case-insensitive.</p>
<p><dfn id="attribute0" title="syntax-attribute-value">Attribute
values</dfn> are a mixture of <a href="#text2" title=
"syntax-text">text</a> and <a href="#character3" title=
"syntax-charref">character <del class="diff-old">entity</del>
references</a> , except with the additional restriction that the
text cannot contain an <a href="#ambiguous" title=
"syntax-ambiguous-ampersand">ambiguous ampersand</a> .</p>
<p>Attributes can be specified in four different ways:</p>
<dl>
<dt>Empty attribute syntax</dt>
<dd>
<p>Just the <a href="#attribute" title=
"syntax-attribute-name">attribute name</a> .</p>
<div class="example">
<p>In the following example, the <code title=
"attr-input-disabled">disabled</code> attribute is given with the
empty attribute syntax:</p>
<pre>
<input
<em>
disabled
</em>
>
</pre></div>
<p>If an attribute using the empty attribute syntax is to be
followed by another attribute, then there must be a <a href=
"#space">space character</a> separating the two.</p>
</dd>
<dt>Unquoted attribute value syntax</dt>
<dd>
<p>The <a href="#attribute" title="syntax-attribute-name">attribute
name</a> , followed by zero or more <a href="#space" title=
"space character">space characters</a> , followed by a single
U+003D EQUALS SIGN character, followed by zero or more <a href=
"#space" title="space character">space characters</a> , followed by
the <a href="#attribute0" title="syntax-attribute-value">attribute
value</a> , which, in addition to the requirements given above for
attribute values, must not contain any literal <a href="#space"
title="space character">space characters <del class="diff-old">or
U+003E GREATER-THAN SIGN ( > ) characters, and must not,
furthermore, start with either</del></a> , a <del class=
"diff-old">literal</del> U+0022 QUOTATION MARK ( <code>"</code> )
<del class="diff-old">character or a literal</del> <ins class=
"diff-chg">characters,</ins> U+0027 APOSTROPHE ( <code>'</code> )
<del class="diff-old">character.</del> <ins class=
"diff-chg">characters, U+003D EQUALS SIGN (</ins> <code><ins class=
"diff-chg">=</ins></code> <ins class="diff-chg">) characters, or
U+003E GREATER-THAN SIGN (</ins> <code><ins class=
"diff-chg">></ins></code> <ins class="diff-chg">)
characters.</ins></p>
<div class="example">
<p>In the following example, the <code title=
"attr-input-value">value</code> attribute is given with the
unquoted attribute value syntax:</p>
<pre>
<input
<em>
value=yes
</em>
>
</pre></div>
<p>If an attribute using the unquoted attribute syntax is to be
followed by another attribute or by one of the optional U+002F
SOLIDUS ( <code>/</code> ) characters allowed in step 6 of the
<span title="syntax-start-tag">start tag</span> syntax above, then
there must be a <a href="#space">space character</a> separating the
two.</p>
</dd>
<dt>Single-quoted attribute value syntax</dt>
<dd>
<p>The <a href="#attribute" title="syntax-attribute-name">attribute
name</a> , followed by zero or more <a href="#space" title=
"space character">space characters</a> , followed by a single
U+003D EQUALS SIGN character, followed by zero or more <a href=
"#space" title="space character">space characters</a> , followed by
a single U+0027 APOSTROPHE ( <code>'</code> ) character, followed
by the <a href="#attribute0" title=
"syntax-attribute-value">attribute value</a> , which, in addition
to the requirements given above for attribute values, must not
contain any literal U+0027 APOSTROPHE ( <code>'</code> )
characters, and finally followed by a second single U+0027
APOSTROPHE ( <code>'</code> ) character.</p>
<div class="example">
<p>In the following example, the <code title=
"attr-input-type">type</code> attribute is given with the
single-quoted attribute value syntax:</p>
<pre>
<input
<em>
type='checkbox'
</em>
>
</pre></div>
<p><ins class="diff-new">If an attribute using the single-quoted
attribute syntax is to be followed by another attribute, then there
must be a</ins> <a href="#space"><ins class="diff-new">space
character</ins></a> <ins class="diff-new">separating the
two.</ins></p>
</dd>
<dt>Double-quoted attribute value syntax</dt>
<dd>
<p>The <a href="#attribute" title="syntax-attribute-name">attribute
name</a> , followed by zero or more <a href="#space" title=
"space character">space characters</a> , followed by a single
U+003D EQUALS SIGN character, followed by zero or more <a href=
"#space" title="space character">space characters</a> , followed by
a single U+0022 QUOTATION MARK ( <code>"</code> ) character,
followed by the <a href="#attribute0" title=
"syntax-attribute-value">attribute value</a> , which, in addition
to the requirements given above for attribute values, must not
contain any literal U+0022 QUOTATION MARK ( <code>"</code> )
characters, and finally followed by a second single U+0022
QUOTATION MARK ( <code>"</code> ) character.</p>
<div class="example">
<p>In the following example, the <code title=
"attr-input-name">name</code> attribute is given with the
double-quoted attribute value syntax:</p>
<pre>
<input
<em>
name="be
evil"
</em>
>
</pre></div>
<p><ins class="diff-new">If an attribute using the double-quoted
attribute syntax is to be followed by another attribute, then there
must be a</ins> <a href="#space"><ins class="diff-new">space
character</ins></a> <ins class="diff-new">separating the
two.</ins></p>
</dd>
</dl>
<h5 id="optional"><span class="secno">8.1.2.4.</span> Optional
tags</h5>
<p>Certain tags can be <dfn id="omitted" title=
"syntax-tag-omission">omitted</dfn> .</p>
<p>An <code><a href="#html">html</a></code> element's <span title=
"syntax-start-tag">start tag</span> may be omitted if the first
thing inside the <code><a href="#html">html</a></code> element is
not a <del class="diff-old">space character or a</del> <a href=
"#comments0" title="syntax-comments">comment</a> .</p>
<p>An <code><a href="#html">html</a></code> element's <span title=
"syntax-end-tag">end tag</span> may be omitted if the
<code><a href="#html">html</a></code> element is not immediately
followed <del class="diff-old">by a space character or</del> a
<a href="#comments0" title="syntax-comments">comment <del class=
"diff-old">.</del></a> <ins class="diff-chg">and the element
contains a</ins> <code><a href="#body0"><ins class=
"diff-chg">body</ins></a></code> <ins class="diff-chg">element that
is either not empty or whose</ins> <span title=
"syntax-start-tag"><ins class="diff-chg">start tag</ins></span>
<ins class="diff-chg">has not been omitted.</ins></p>
<p>A <code><a href="#head">head</a></code> element's <span title=
"syntax-start-tag">start tag</span> may be omitted if the first
thing inside the <code><a href="#head">head</a></code> element is
an element.</p>
<p>A <code><a href="#head">head</a></code> element's <span title=
"syntax-end-tag">end tag</span> may be omitted if the
<code><a href="#head">head</a></code> element is not immediately
followed by a <a href="#space">space character</a> or a <a href=
"#comments0" title="syntax-comments">comment</a> .</p>
<p>A <code><a href="#body0">body</a></code> element's <span title=
"syntax-start-tag">start tag</span> may be omitted if the first
thing inside the <code><a href="#body0">body</a></code> element is
not a <a href="#space">space character</a> or a <a href=
"#comments0" title="syntax-comments">comment</a> , except if the
first thing inside the <code><a href="#body0">body</a></code>
element is a <code><a href="#script1">script</a></code> or
<code><a href="#style1">style</a></code> <del class=
"diff-old">element .</del> <ins class="diff-chg">element.</ins></p>
<p>A <code><a href="#body0">body</a></code> element's <span title=
"syntax-end-tag">end tag</span> may be omitted if the
<code><a href="#body0">body</a></code> element is not immediately
followed by a <del class="diff-old">space character or a</del>
<a href="#comments0" title="syntax-comments">comment <del class=
"diff-old">.</del></a> <ins class="diff-chg">and the element is
either not empty or its</ins> <span title=
"syntax-start-tag"><ins class="diff-chg">start tag</ins></span>
<ins class="diff-chg">has not been omitted.</ins></p>
<p>A <code><a href="#li">li</a></code> element's <span title=
"syntax-end-tag">end tag</span> may be omitted if the
<code><a href="#li">li</a></code> element is immediately followed
by another <code><a href="#li">li</a></code> element or if there is
no more content in the parent element.</p>
<p>A <code><a href="#dt">dt</a></code> element's <span title=
"syntax-end-tag">end tag</span> may be omitted if the
<code><a href="#dt">dt</a></code> element is immediately followed
by another <code><a href="#dt">dt</a></code> element or a
<code><a href="#dd">dd</a></code> element.</p>
<p>A <code><a href="#dd">dd</a></code> element's <span title=
"syntax-end-tag">end tag</span> may be omitted if the
<code><a href="#dd">dd</a></code> element is immediately followed
by another <code><a href="#dd">dd</a></code> element or a
<code><a href="#dt">dt</a></code> element, or if there is no more
content in the parent element.</p>
<p>A <code><a href="#p">p</a></code> element's <span title=
"syntax-end-tag">end tag</span> may be omitted if the
<code><a href="#p">p</a></code> element is immediately followed by
an <code><a href="#address">address</a></code> , <code><a href=
"#blockquote">blockquote</a></code> , <code><a href=
"#dl">dl</a></code> , <code>fieldset</code> , <code>form</code> ,
<code><a href="#h1">h1</a></code> , <code><a href=
"#h2">h2</a></code> , <code><a href="#h3">h3</a></code> ,
<code><a href="#h4">h4</a></code> , <code><a href=
"#h5">h5</a></code> , <code><a href="#h6">h6</a></code> ,
<code><a href="#hr">hr</a></code> , <code><a href=
"#menu">menu</a></code> , <code><a href="#ol">ol</a></code> ,
<code><a href="#p">p</a></code> , <code><a href=
"#pre">pre</a></code> , <code><a href="#table">table</a></code> ,
or <code><a href="#ul">ul</a></code> element, or if there is no
more content in the parent element.</p>
<p>An <code>optgroup</code> element's <span title=
"syntax-end-tag">end tag</span> may be omitted if the
<code>optgroup</code> element is immediately followed by another
<code>optgroup</code> element, or if there is no more content in
the parent element.</p>
<p>An <code>option</code> element's <span title=
"syntax-end-tag">end tag</span> may be omitted if the
<code>option</code> element is immediately followed by another
<code>option</code> element, or if there is no more content in the
parent element.</p>
<p>A <code><a href="#colgroup">colgroup</a></code> element's
<span title="syntax-start-tag">start tag</span> may be omitted if
the first thing inside the <code><a href=
"#colgroup">colgroup</a></code> element is a <code><a href=
"#col">col</a></code> element, and if the element is not
immediately preceded by another <code><a href=
"#colgroup">colgroup</a></code> element whose <span title=
"syntax-end-tag">end tag</span> has been omitted.</p>
<p>A <code><a href="#colgroup">colgroup</a></code> element's
<span title="syntax-end-tag">end tag</span> may be omitted if the
<code><a href="#colgroup">colgroup</a></code> element is not
immediately followed by a <a href="#space">space character</a> or a
<a href="#comments0" title="syntax-comments">comment</a> .</p>
<p>A <code><a href="#thead0">thead</a></code> element's
<span title="syntax-end-tag">end tag</span> may be omitted if the
<code><a href="#thead0">thead</a></code> element is immediately
followed by a <code><a href="#tbody">tbody</a></code> or
<code><a href="#tfoot0">tfoot</a></code> element.</p>
<p>A <code><a href="#tbody">tbody</a></code> element's <span title=
"syntax-start-tag">start tag</span> may be omitted if the first
thing inside the <code><a href="#tbody">tbody</a></code> element is
a <code><a href="#tr">tr</a></code> element, and if the element is
not immediately preceded by a <code><a href=
"#tbody">tbody</a></code> , <code><a href=
"#thead0">thead</a></code> , or <code><a href=
"#tfoot0">tfoot</a></code> element whose <span title=
"syntax-end-tag">end tag</span> has been omitted.</p>
<p>A <code><a href="#tbody">tbody</a></code> element's <span title=
"syntax-end-tag">end tag</span> may be omitted if the
<code><a href="#tbody">tbody</a></code> element is immediately
followed by a <code><a href="#tbody">tbody</a></code> or
<code><a href="#tfoot0">tfoot</a></code> element, or if there is no
more content in the parent element.</p>
<p>A <code><a href="#tfoot0">tfoot</a></code> element's
<span title="syntax-end-tag">end tag</span> may be omitted if the
<code><a href="#tfoot0">tfoot</a></code> element is immediately
followed by a <code><a href="#tbody">tbody</a></code> element, or
if there is no more content in the parent element.</p>
<p>A <code><a href="#tr">tr</a></code> element's <span title=
"syntax-end-tag">end tag</span> may be omitted if the
<code><a href="#tr">tr</a></code> element is immediately followed
by another <code><a href="#tr">tr</a></code> element, or if there
is no more content in the parent element.</p>
<p>A <code><a href="#td">td</a></code> element's <span title=
"syntax-end-tag">end tag</span> may be omitted if the
<code><a href="#td">td</a></code> element is immediately followed
by a <code><a href="#td">td</a></code> or <code><a href=
"#th">th</a></code> element, or if there is no more content in the
parent element.</p>
<p>A <code><a href="#th">th</a></code> element's <span title=
"syntax-end-tag">end tag</span> may be omitted if the
<code><a href="#th">th</a></code> element is immediately followed
by a <code><a href="#td">td</a></code> or <code><a href=
"#th">th</a></code> element, or if there is no more content in the
parent element.</p>
<p><strong>However</strong> , a <span title=
"syntax-start-tag">start tag</span> must never be omitted if it has
any attributes.</p>
<h5 id="element-restrictions"><span class="secno">8.1.2.5.</span>
Restrictions on content models</h5>
<p>For historical reasons, certain elements have extra restrictions
beyond even the restrictions given by their content model.</p>
<p><del class="diff-old">A p element must not contain blockquote ,
dl , menu , ol , pre , table , or ul elements, even though these
elements are technically allowed inside p elements according to the
content models described in this specification. (In fact, if one of
those elements is put inside a p element in the markup, it will
instead imply a p element end tag before it.)</del> An
<code>optgroup</code> element must not contain
<code>optgroup</code> elements, even though these elements are
technically allowed to be nested according to the content models
described in this specification. (If an <code>optgroup</code>
element is put inside another in the markup, it will in fact imply
an <code>optgroup</code> end tag before it.)</p>
<p>A <code><a href="#table">table</a></code> element must not
contain <code><a href="#tr">tr</a></code> elements, even though
these elements are technically allowed inside <code><a href=
"#table">table</a></code> elements according to the content models
described in this specification. (If a <code><a href=
"#tr">tr</a></code> element is put inside a <code><a href=
"#table">table</a></code> in the markup, it will in fact imply a
<code><a href="#tbody">tbody</a></code> start tag before it.)</p>
<p>A single U+000A LINE FEED (LF) character may be placed
immediately after the <span title="syntax-start-tag">start
tag</span> of <code><a href="#pre">pre</a></code> and
<code>textarea</code> elements. This does not affect the processing
of the element. The otherwise optional U+000A LINE FEED (LF)
character <em>must</em> be included if the element's contents start
with that character (because otherwise the leading newline in the
contents would be treated like the optional newline, and
ignored).</p>
<div class="example">
<p>The following two <code><a href="#pre">pre</a></code> blocks are
equivalent:</p>
<pre>
<pre>
Hello</pre>
</pre>
<pre>
<pre>
<br>
Hello</pre>
</pre></div>
<h5 id="cdata-rcdata-restrictions"><span class=
"secno">8.1.2.6.</span> Restrictions on the contents of CDATA and
RCDATA elements</h5>
<p>The text in CDATA and RCDATA elements must not contain any
<del class="diff-old">occurences</del> <ins class=
"diff-chg">occurrences</ins> of the string " <code title=
""></</code> " (U+003C LESS-THAN SIGN, U+002F SOLIDUS) followed
by characters that case-insensitively match the tag name of the
element followed by one of U+0009 CHARACTER TABULATION, U+000A LINE
FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), U+0020
SPACE, U+003E GREATER-THAN SIGN (> ), or U+002F SOLIDUS (/),
unless that string is part of an <a href="#escaping" title=
"syntax-escape">escaping text span</a> .</p>
<p>An <dfn id="escaping" title="syntax-escape">escaping text
span</dfn> is a span of <a href="#text2" title=
"syntax-text">text</a> <del class="diff-old">(in CDATA and RCDATA
elements) and character entity references (in RCDATA
elements)</del> that starts with an <a href="#escaping0" title=
"syntax-escape-start">escaping text span start</a> that is not
itself in an <a href="#escaping" title="syntax-escape">escaping
text span</a> , and ends at the next <a href="#escaping1" title=
"syntax-escape-end">escaping text span end</a> . <ins class=
"diff-new">There cannot be any</ins> <a href="#character3" title=
"syntax-charref"><ins class="diff-new">character
references</ins></a> <ins class="diff-new">inside an</ins> <a href=
"#escaping" title="syntax-escape"><ins class="diff-new">escaping
text span</ins></a> .</p>
<p>An <dfn id="escaping0" title="syntax-escape-start">escaping text
span start</dfn> is a part of <a href="#text2" title=
"syntax-text">text</a> that consists of the four character sequence
" <code title=""><!--</code> " (U+003C LESS-THAN SIGN, U+0021
EXCLAMATION MARK, U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS).</p>
<p>An <dfn id="escaping1" title="syntax-escape-end">escaping text
span end</dfn> is a part of <a href="#text2" title=
"syntax-text">text</a> that consists of the three character
sequence " <code title="">--></code> " (U+002D HYPHEN-MINUS,
U+002D HYPHEN-MINUS, U+003E GREATER-THAN SIGN) whose U+003E
GREATER-THAN SIGN (>).</p>
<p>An <a href="#escaping0" title="syntax-escape-start">escaping
text span start</a> may share its U+002D HYPHEN-MINUS characters
with its corresponding <a href="#escaping1" title=
"syntax-escape-end">escaping text span end</a> .</p>
<p>The text in CDATA and RCDATA elements must not have an <a href=
"#escaping0" title="syntax-escape-start">escaping text span
start</a> that is not followed by an <a href="#escaping1" title=
"syntax-escape-end">escaping text span end</a> .</p>
<h4 id="text0"><span class="secno"><del class=
"diff-old">8.1.3.</del> <ins class="diff-chg">8.1.3</ins></span>
Text</h4>
<p><dfn id="text2" title="syntax-text">Text</dfn> is allowed inside
elements, attributes, and comments. Text must consist of
<del class="diff-old">valid</del> Unicode <del class=
"diff-old">characters other than U+0000.</del> <ins class=
"diff-chg">characters.</ins> Text <del class=
"diff-old">should</del> <ins class="diff-chg">must not contain
U+0000 characters. Text must not contain permanently undefined
Unicode characters. Text must</ins> not contain control characters
other than <a href="#space" title="space character">space
characters</a> . Extra constraints are placed on what is and what
is not allowed in text based on where the text is to be put, as
described in the other sections.</p>
<h5 id="newlines"><span class="secno">8.1.3.1.</span> Newlines</h5>
<p><dfn id="newlines0" title="syntax-newlines">Newlines</dfn> in
HTML may be represented either as U+000D CARRIAGE RETURN (CR)
characters, U+000A LINE FEED (LF) characters, or pairs of U+000D
CARRIAGE RETURN (CR), U+000A LINE FEED (LF) characters in that
order.</p>
<h4 id="character"><span class="secno"><del class=
"diff-old">8.1.4.</del> <ins class="diff-chg">8.1.4</ins></span>
Character <del class="diff-old">entity</del> references</h4>
<p>In certain cases described in other sections, <a href="#text2"
title="syntax-text">text</a> may be mixed with <dfn id="character3"
title="syntax-charref">character <del class="diff-old">entity</del>
references</dfn> . These can be used to escape characters that
couldn't otherwise legally be included in <a href="#text2" title=
"syntax-text">text</a> .</p>
<p>Character <del class="diff-old">entity</del> references must
start with a U+0026 AMPERSAND ( <code>&</code> ). Following
this, there are three possible kinds of character <del class=
"diff-old">entity</del> references:</p>
<dl>
<dt>Named <del class="diff-old">entities</del> <ins class=
"diff-chg">character references</ins></dt>
<dd>The ampersand must be followed by one of the names given in the
<del class="diff-old">entities</del> <a href="#named0"><ins class=
"diff-chg">named character references</ins></a> section, using the
same case. The name must be one that is terminated by a U+003B
SEMICOLON ( <code title="">;</code> ) character.</dd>
<dt>Decimal numeric <del class="diff-old">entities</del>
<ins class="diff-chg">character reference</ins></dt>
<dd>The ampersand must be followed by a U+0023 NUMBER SIGN (
<code>#</code> ) character, followed by one or more digits in the
range U+0030 DIGIT ZERO .. U+0039 DIGIT NINE, representing a
base-ten integer that itself is a <del class="diff-old">valid</del>
Unicode code point that is not U+0000, U+000D, in the range U+0080
.. U+009F, or in the range 0xD800 .. 0xDFFF (surrogates). The
digits must then be followed by a U+003B SEMICOLON character (
<code title="">;</code> ).</dd>
<dt>Hexadecimal numeric <del class="diff-old">entities</del>
<ins class="diff-chg">character reference</ins></dt>
<dd>The ampersand must be followed by a U+0023 NUMBER SIGN (
<code>#</code> ) character, which must be followed by either a
U+0078 LATIN SMALL LETTER X or a U+0058 LATIN CAPITAL LETTER X
character, which must then be followed by one or more digits in the
range U+0030 DIGIT ZERO .. U+0039 DIGIT NINE, U+0061 LATIN SMALL
LETTER A .. U+0066 LATIN SMALL LETTER F, and U+0041 LATIN CAPITAL
LETTER A .. U+0046 LATIN CAPITAL LETTER F, representing a
base-sixteen integer that itself is a <del class=
"diff-old">valid</del> Unicode code point that is not U+0000,
U+000D, in the range U+0080 .. U+009F, or in the range 0xD800 ..
0xDFFF (surrogates). The digits must then be followed by a U+003B
SEMICOLON character ( <code title="">;</code> ).</dd>
</dl>
<p>An <dfn id="ambiguous" title=
"syntax-ambiguous-ampersand">ambiguous ampersand</dfn> is a U+0026
AMPERSAND ( <code>&</code> ) character that is <del class=
"diff-old">not the last character in the file, that is not</del>
followed by <ins class="diff-new">some</ins> <a href="#text2"
title="syntax-text"><ins class="diff-new">text</ins></a>
<ins class="diff-new">other than</ins> a <a href="#space">space
character</a> , <del class="diff-old">that is not followed by</del>
a <del class="diff-old">start tag that has not been omitted, and
that is not followed by</del> <ins class="diff-chg">U+003C
LESS-THAN SIGN character ('<'), or</ins> another U+0026
AMPERSAND ( <code>&</code> ) character.</p>
<h4 id="cdata"><span class="secno"><ins class=
"diff-new">8.1.5</ins></span> <ins class="diff-new">CDATA
blocks</ins></h4>
<p><dfn id="cdata0" title="syntax-cdata"><ins class=
"diff-new">CDATA blocks</ins></dfn> <ins class="diff-new">must
start with the character sequence U+003C LESS-THAN SIGN, U+0021
EXCLAMATION MARK, U+005B LEFT SQUARE BRACKET, U+0043 LATIN CAPITAL
LETTER C, U+0044 LATIN CAPITAL LETTER D, U+0041 LATIN CAPITAL
LETTER A, U+0054 LATIN CAPITAL LETTER T, U+0041 LATIN CAPITAL
LETTER A, U+005B LEFT SQUARE BRACKET (</ins> <code title=
""><ins class="diff-new"><![CDATA[</ins></code> <ins class=
"diff-new">). Following this sequence, the block may have</ins>
<a href="#text2" title="syntax-text"><ins class=
"diff-new">text</ins></a> ,<ins class="diff-new">with the
additional restriction that the text must not contain the three
character sequence U+005D RIGHT SQUARE BRACKET, U+005D RIGHT SQUARE
BRACKET, U+003E GREATER-THAN SIGN (</ins> <code title=
""><ins class="diff-new">]]></ins></code> <ins class=
"diff-new">). Finally, the CDATA block must be ended by the three
character sequence U+005D RIGHT SQUARE BRACKET, U+005D RIGHT SQUARE
BRACKET, U+003E GREATER-THAN SIGN (</ins> <code title=
""><ins class="diff-new">]]></ins></code> <ins class=
"diff-new">).</ins></p>
<h4 id="comments"><span class="secno"><del class=
"diff-old">8.1.5.</del> <ins class="diff-chg">8.1.6</ins></span>
Comments</h4>
<p><dfn id="comments0" title="syntax-comments">Comments</dfn> must
start with the four character sequence U+003C LESS-THAN SIGN,
U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS (
<code title=""><!--</code> ). Following this sequence, the
comment may have <a href="#text2" title="syntax-text">text</a> ,
with the additional restriction that the text must not <ins class=
"diff-new">start with a single U+003E GREATER-THAN SIGN ('>')
character, nor start with a U+002D HYPHEN-MINUS (</ins>
<code title=""><ins class="diff-new">-</ins></code> <ins class=
"diff-new">) character followed by a U+003E GREATER-THAN SIGN
('>') character, nor</ins> contain two consecutive U+002D
HYPHEN-MINUS ( <code title="">-</code> ) characters, nor end with a
U+002D HYPHEN-MINUS ( <code title="">-</code> ) character. Finally,
the comment must be ended by the three character sequence U+002D
HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E GREATER-THAN SIGN (
<code title="">--></code> ).</p>
<h3 id="parsing"><span class="secno"><del class=
"diff-old">8.2.</del> <ins class="diff-chg">8.2</ins></span>
Parsing HTML documents</h3>
<p><em>This section only applies to user agents, data mining tools,
and conformance checkers.</em></p>
<p>The rules for parsing <a href="#xml-documents">XML documents</a>
(and thus <a href="#xhtml5">XHTML</a> documents) into DOM trees are
covered by the XML and Namespaces in XML specifications, and are
out of scope of this specification. <a href="#references">[XML]</a>
<a href="#references">[XMLNS]</a></p>
<p>For <a href="#html-">HTML documents</a> , user agents must use
the parsing rules described in this section to generate the DOM
trees. Together, these rules define what is referred to as the
<dfn id="html-0">HTML parser</dfn> .</p>
<div class="note">
<p>While the HTML form of HTML5 bears a close resemblance to SGML
and XML, it is a separate language with its own parsing rules.</p>
<p>Some earlier versions of HTML (in particular from HTML2 to
HTML4) were based on SGML and used SGML parsing rules. However, few
(if any) web browsers ever implemented true SGML parsing for HTML
documents; the only user agents to strictly handle HTML as an SGML
application have historically been validators. The resulting
confusion — with validators claiming documents to have one
representation while widely deployed Web browsers interoperably
implemented a different representation — has wasted decades of
productivity. This version of HTML thus returns to a non-SGML
basis.</p>
<p>Authors interested in using SGML tools in their authoring
pipeline are encouraged to use XML tools and the XML <del class=
"diff-old">serialisation</del> <ins class=
"diff-chg">serialization</ins> of HTML5.</p>
</div>
<p>This specification defines the parsing rules for HTML documents,
whether they are syntactically <del class="diff-old">valid</del>
<ins class="diff-chg">correct</ins> or not. Certain points in the
parsing algorithm are said to be <dfn id="parse1" title=
"parse error">parse errors</dfn> . The error handling for parse
errors is well-defined: user agents must either act as described
below when encountering such problems, or must abort processing at
the first error that they encounter for which they do not wish to
apply the rules described below.</p>
<p>Conformance checkers must report at least one parse error
condition to the user if one or more parse error conditions exist
in the document and must not report parse error conditions if none
exist in the document. Conformance checkers may report more than
one parse error condition if more than one parse error conditions
exist in the document. Conformance checkers are not required to
recover from parse errors.</p>
<p class="note">Parse errors are only errors with the
<em>syntax</em> of HTML. In addition to checking for parse errors,
conformance checkers will also verify that the document obeys all
the other conformance requirements described in this
specification.</p>
<h4 id="overview"><span class="secno"><del class=
"diff-old">8.2.1.</del> <ins class="diff-chg">8.2.1</ins></span>
Overview of the parsing model</h4>
<p>The input to the HTML parsing process consists of a stream of
Unicode characters, which is passed through a <a href=
"#tokenisation0">tokenisation</a> stage (lexical analysis) followed
by a <a href="#tree-construction0">tree construction</a> stage
(semantic analysis). The output is a <code>Document</code>
object.</p>
<p class="note">Implementations that <a href="#non-scripted">do not
support scripting</a> do not have to actually create a DOM
<code>Document</code> object, but the DOM tree in such cases is
still used as the model for the rest of the specification.</p>
<p>In the common case, the data handled by the tokenisation stage
comes from the network, but <a href="#dynamic2" title=
"dynamic markup insertion">it can also come from script</a> , e.g.
using the <code title="dom-document-write-HTML"><a href=
"#document.write...">document.write()</a></code> API.</p>
<p><img alt="" src="images/parsing-model-overview.png"></p>
<p id="nestedParsing">There is only one set of state for the
tokeniser stage and the tree construction stage, but the tree
construction stage is reentrant, meaning that while the tree
construction stage is handling one token, the tokeniser might be
resumed, causing further tokens to be emitted and processed before
the first token's processing is complete.</p>
<div class="example">
<p>In the following example, the tree construction stage will be
called upon to handle a "p" start tag token while handling the
"script" start tag token:</p>
<pre>
...
<script>
document.write('<p>');
</script>
...
</pre></div>
<h4 id="the-input0"><span class="secno"><del class=
"diff-old">8.2.2.</del> <ins class="diff-chg">8.2.2</ins></span>
The <dfn id="input0">input stream</dfn></h4>
<p>The stream of Unicode characters that consists the input to the
tokenisation stage will be initially seen by the user agent as a
stream of bytes (typically coming over the network or from the
local file system). The bytes encode the actual characters
according to a particular <em>character encoding</em> , which the
user agent must use to decode the bytes into characters.</p>
<p class="note">For XML documents, the algorithm user agents must
use to determine the character encoding is given by the XML
specification. This section does not apply to XML documents.
<a href="#references">[XML]</a></p>
<h5 id="determining"><span class="secno">8.2.2.1.</span>
Determining the character encoding</h5>
<p>In some cases, it might be impractical to unambiguously
determine the encoding before parsing the document. Because of
this, this specification provides for a two-pass mechanism with an
optional pre-scan. Implementations are allowed, as described below,
to apply a simplified parsing algorithm to whatever bytes they have
available before beginning to parse the document. Then, the real
parser is started, using a tentative encoding derived from this
pre-parse and other out-of-band metadata. If, while the document is
being loaded, the user agent discovers an encoding declaration that
conflicts with this information, then the parser can get reinvoked
to perform a parse of the document with the real encoding.</p>
<p id="documentEncoding">User agents must use the following
algorithm (the <dfn id="encoding0">encoding sniffing
algorithm</dfn> ) to determine the character encoding to use when
decoding a document in the first pass. This algorithm takes as
input any out-of-band metadata available to the user agent (e.g.
the <a href="#content-type8" title="Content-Type">Content-Type
metadata</a> of the document) and all the bytes available so far,
and returns an encoding and a <dfn id="confidence" title=
"concept-encoding-confidence">confidence</dfn> . The confidence is
either <i>tentative</i> or <i>certain</i> . The encoding used, and
whether the confidence in that encoding is <i>tentative</i> or
<i>confident</i> , is <a href="#meta-charset-during-parse">used
during the parsing</a> to determine whether to <a href=
"#change">change the encoding</a> .</p>
<ol>
<li>
<p>If the transport layer specifies an encoding, return that
encoding with the <a href="#confidence" title=
"concept-encoding-confidence">confidence</a> <i>certain</i> , and
abort these steps.</p>
</li>
<li>
<p>The user agent may wait for more bytes of the resource to be
available, either in this step or at any later step in this
algorithm. For instance, a user agent might wait 500ms or 512
bytes, whichever came first. In general preparsing the source to
find the encoding improves performance, as it reduces the need to
throw away the data structures used when parsing upon finding the
encoding information. However, if the user agent delays too long to
obtain data to determine the encoding, then the cost of the delay
could outweigh any performance improvements from the preparse.</p>
</li>
<li>
<p>For each of the rows in the following table, starting with the
first one and going down, if there are as many or more bytes
available than the number of bytes in the first column, and the
first bytes of the file match the bytes given in the first column,
then return the encoding given in the cell in the second column of
that row, with the <a href="#confidence" title=
"concept-encoding-confidence">confidence</a> <i>certain</i> , and
abort these steps:</p>
<table>
<thead>
<tr>
<th>Bytes in Hexadecimal</th>
<th><del class="diff-old">Description</del> <ins class=
"diff-chg">Encoding</ins></th>
</tr>
</thead>
<tbody>
<tr>
<td>FE FF</td>
<td>UTF-16BE <del class="diff-old">BOM</del></td>
</tr>
<tr>
<td>FF FE</td>
<td>UTF-16LE <del class="diff-old">BOM</del></td>
</tr>
<tr>
<td>EF BB BF</td>
<td>UTF-8 <del class="diff-old">BOM</del></td>
</tr>
</tbody>
</table>
<p class="note"><ins class="diff-new">This step looks for Unicode
Byte Order Marks (BOMs).</ins></p>
</li>
<li>
<p>Otherwise, the user agent will have to search for explicit
character encoding information in the file itself. This should
proceed as follows:</p>
<p>Let <var title="">position</var> be a pointer to a byte in the
input stream, initially pointing at the first byte. If at any point
during these substeps the user agent either runs out of bytes or
decides that scanning further bytes would not be efficient, then
skip to the next step of the overall character encoding detection
algorithm. User agents may decide that scanning <em>any</em> bytes
is not efficient, in which case these substeps are entirely
skipped.</p>
<p>Now, repeat the following "two" steps until the algorithm aborts
(either because user agent aborts, as described above, or because a
character encoding is found):</p>
<ol>
<li>
<p>If <var title="">position</var> points to:</p>
<dl class="switch">
<dt>A sequence of bytes starting with: 0x3C 0x21 0x2D 0x2D (ASCII
'<!--')</dt>
<dd>
<p>Advance the <var title="">position</var> pointer so that it
points at the first 0x3E byte which is preceded by two 0x2D bytes
(i.e. at the end of an ASCII '--> ' sequence) and comes after
the 0x3C byte that was found. (The two 0x2D bytes can be the same
as the those in the '<!--' sequence.)</p>
</dd>
<dt>A sequence of bytes starting with: 0x3C, 0x4D or 0x6D, 0x45 or
0x65, 0x54 or 0x74, 0x41 or 0x61, and finally one of 0x09, 0x0A,
0x0B, 0x0C, 0x0D, <del class="diff-old">0x20</del> <ins class=
"diff-chg">0x20, 0x2F</ins> (case-insensitive ASCII '<meta'
followed by a <del class="diff-old">space)</del> <ins class=
"diff-chg">space or slash)</ins></dt>
<dd>
<ol>
<li>
<p>Advance the <var title="">position</var> pointer so that it
points at the next 0x09, 0x0A, 0x0B, 0x0C, 0x0D, <ins class=
"diff-new">0x20,</ins> or <del class="diff-old">0x20</del>
<ins class="diff-chg">0x2F</ins> byte (the one in sequence of
characters matched above).</p>
</li>
<li>
<p><a href="#get-an" title=
"concept-get-attributes-when-sniffing">Get an attribute</a> and its
value. If no attribute was sniffed, then skip this inner set of
steps, and jump to the second step in the overall "two step"
algorithm.</p>
</li>
<li>
<p><del class="diff-old">Examine the attribute's name: If it is
'charset'</del> If the attribute's <del class=
"diff-old">value</del> <ins class="diff-chg">name</ins> is
<del class="diff-old">a supported character encoding,</del>
<ins class="diff-chg">neither "</ins> <code title=""><ins class=
"diff-chg">charset</ins></code> <ins class="diff-chg">" nor "</ins>
<code title=""><ins class="diff-chg">content</ins></code>
<ins class="diff-chg">",</ins> then return <del class=
"diff-old">the given encoding, with confidence tentative , and
abort all</del> <ins class="diff-chg">to step 2 in</ins> these
<ins class="diff-new">inner</ins> steps. <del class=
"diff-old">Otherwise, do nothing with this attribute, and continue
looking for other attributes.</del></p>
</li>
<li>
<p>If <del class="diff-old">it</del> <ins class="diff-chg">the
attribute's name</ins> is <del class="diff-old">'content'</del>
<ins class="diff-chg">"</ins> <code title=""><ins class=
"diff-chg">charset</ins></code> <ins class="diff-chg">", let</ins>
<var title=""><ins class="diff-chg">charset</ins></var> <ins class=
"diff-chg">be the attribute's value, interpreted as a character
encoding.</ins></p>
</li>
<li>
<p><del class="diff-old">The</del> <ins class="diff-chg">Otherwise,
the</ins> attribute's <del class="diff-old">value</del> <ins class=
"diff-chg">name</ins> is <del class="diff-old">now parsed.
Apply</del> <ins class="diff-chg">"</ins> <code title=
""><ins class="diff-chg">content</ins></code> <ins class=
"diff-chg">": apply</ins> the <a href="#algorithm4">algorithm for
extracting an encoding from a Content-Type</a> , giving the
attribute's value as the string to parse. If an encoding
<del class="diff-old">was</del> <ins class="diff-chg">is</ins>
returned, <del class="diff-old">and</del> <ins class=
"diff-chg">let</ins> <var title=""><ins class=
"diff-chg">charset</ins></var> <ins class="diff-chg">be that
encoding. Otherwise, return to step 2 in these inner
steps.</ins></p>
</li>
<li>
<p><ins class="diff-chg">If</ins> <var title=""><ins class=
"diff-chg">charset</ins></var> <ins class="diff-chg">is a UTF-16
encoding, change</ins> it <ins class="diff-new">to UTF-8.</ins></p>
</li>
<li>
<p><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">charset</ins></var> is <del class="diff-old">the name
of</del> a supported character encoding, then return <del class=
"diff-old">that</del> <ins class="diff-chg">the given</ins>
encoding, with <del class="diff-old">the</del> <a href=
"#confidence" title="concept-encoding-confidence">confidence</a>
<i>tentative</i> , and abort all these steps.</p>
</li>
<li><del class="diff-old">Otherwise, skip this 'content' attribute
and continue on with any other attributes. Any other name</del>
<p><del class="diff-old">Do nothing with that attribute.
Return</del> <ins class="diff-chg">Otherwise, return</ins> to step
<del class="diff-old">1</del> <ins class="diff-chg">2</ins> in
these inner steps.</p>
</li>
</ol>
</dd>
<dt>A sequence of bytes starting with a 0x3C byte (ASCII '<'),
optionally a 0x2F byte (ASCII '/'), and finally a byte in the range
0x41-0x5A or 0x61-0x7A (an ASCII letter)</dt>
<dd>
<ol>
<li>
<p>Advance the <var title="">position</var> pointer so that it
points at the next 0x09 (ASCII TAB), 0x0A (ASCII LF), 0x0B (ASCII
VT), 0x0C (ASCII FF), 0x0D (ASCII CR), 0x20 (ASCII space),
<ins class="diff-new">or</ins> 0x3E (ASCII '> <del class=
"diff-old">'), 0x3C (ASCII '<')</del> <ins class=
"diff-chg">')</ins> byte.</p>
</li>
<li>
<p><del class="diff-old">If the pointer points to a 0x3C (ASCII
'<') byte, then return to the first step in the overall "two
step" algorithm.</del> Repeatedly <a href="#get-an" title=
"concept-get-attributes-when-sniffing">get an attribute</a> until
no further attributes can be found, then jump to the second step in
the overall "two step" algorithm.</p>
</li>
</ol>
</dd>
<dt>A sequence of bytes starting with: 0x3C 0x21 (ASCII
'<!')</dt>
<dt>A sequence of bytes starting with: 0x3C 0x2F (ASCII
'</')</dt>
<dt>A sequence of bytes starting with: 0x3C 0x3F (ASCII
'<?')</dt>
<dd>
<p>Advance the <var title="">position</var> pointer so that it
points at the first 0x3E byte (ASCII '> ') that comes after the
0x3C byte that was found.</p>
</dd>
<dt>Any other byte</dt>
<dd>
<p>Do nothing with that byte.</p>
</dd>
</dl>
</li>
<li>Move <var title="">position</var> so it points at the next byte
in the input stream, and return to the first step of this "two
step" algorithm.</li>
</ol>
<p>When the above "two step" algorithm says to <dfn id="get-an"
title="concept-get-attributes-when-sniffing">get an attribute</dfn>
, it means doing this:</p>
<ol>
<li>
<p>If the byte at <var title="">position</var> is one of 0x09
(ASCII TAB), 0x0A (ASCII LF), 0x0B (ASCII VT), 0x0C (ASCII FF),
0x0D (ASCII CR), 0x20 (ASCII space), or 0x2F (ASCII '/') then
advance <var title="">position</var> to the next byte and
<del class="diff-old">start over. If the byte at position is 0x3C
(ASCII '<'), then move position back to the previous byte, and
stop looking for an attribute. There isn't one.</del> <ins class=
"diff-chg">redo this substep.</ins></p>
</li>
<li>
<p>If the byte at <var title="">position</var> is 0x3E (ASCII '>
'), then <del class="diff-old">stop looking for</del> <ins class=
"diff-chg">abort the "get</ins> an <del class=
"diff-old">attribute.</del> <ins class="diff-chg">attribute"
algorithm.</ins> There isn't one.</p>
</li>
<li>
<p>Otherwise, the byte at <var title="">position</var> is the start
of the attribute name. Let <var title="">attribute name</var> and
<var title="">attribute value</var> be the empty string.</p>
</li>
<li>
<p><em>Attribute name</em> : Process the byte at <var title=
"">position</var> as follows:</p>
<dl class="switch">
<dt>If it is 0x3D (ASCII '='), and the <var title="">attribute
name</var> is longer than the empty string</dt>
<dd>Advance <var title="">position</var> to the next byte and jump
to the step below <del class="diff-old">labelled</del> <ins class=
"diff-chg">labeled</ins> <em>value</em> .</dd>
<dt>If it is 0x09 (ASCII TAB), 0x0A (ASCII LF), 0x0B (ASCII VT),
0x0C (ASCII FF), 0x0D (ASCII CR), or 0x20 (ASCII space)</dt>
<dd>Jump to the step below <del class="diff-old">labelled</del>
<ins class="diff-chg">labeled</ins> <em>spaces</em> .</dd>
<dt>If it is 0x2F (ASCII <del class="diff-old">'/'), 0x3C (ASCII
'<'),</del> <ins class="diff-chg">'/')</ins> or 0x3E (ASCII
<del class="diff-old">'>')</del> <ins class="diff-chg">'>
')</ins></dt>
<dd><del class="diff-old">Stop looking for</del> <ins class=
"diff-chg">Abort the "get</ins> an <del class=
"diff-old">attribute.</del> <ins class="diff-chg">attribute"
algorithm.</ins> The attribute's name is the value of <var title=
"">attribute name</var> , its value is the empty string.</dd>
<dt>If it is in the range 0x41 (ASCII 'A') to 0x5A (ASCII 'Z')</dt>
<dd>Append the Unicode character with codepoint <span><var title=
"">b</var> +0x20</span> to <var title="">attribute name</var>
(where <var title="">b</var> is the value of the byte at
<var title="">position</var> ).</dd>
<dt>Anything else</dt>
<dd>Append the Unicode character with the same codepoint as the
value of the byte at <var title="">position</var> ) to <var title=
"">attribute name</var> . (It doesn't actually matter how bytes
outside the ASCII range are handled here, since only ASCII
characters can contribute to the detection of a character
encoding.)</dd>
</dl>
</li>
<li>
<p>Advance <var title="">position</var> to the next byte and return
to the previous step.</p>
</li>
<li>
<p><em>Spaces.</em> If the byte at <var title="">position</var> is
one of 0x09 (ASCII TAB), 0x0A (ASCII LF), 0x0B (ASCII VT), 0x0C
(ASCII FF), 0x0D (ASCII CR), or 0x20 (ASCII space) then advance
<var title="">position</var> to the next byte, then, repeat this
step.</p>
</li>
<li>
<p>If the byte at <var title="">position</var> is <em>not</em> 0x3D
(ASCII '='), <del class="diff-old">stop looking for an attribute.
Move position back to</del> <ins class="diff-chg">abort</ins> the
<del class="diff-old">previous byte.</del> <ins class=
"diff-chg">"get an attribute" algorithm.</ins> The attribute's name
is the value of <var title="">attribute name</var> , its value is
the empty string.</p>
</li>
<li>
<p>Advance <var title="">position</var> past the 0x3D (ASCII '=')
byte.</p>
</li>
<li>
<p><em>Value.</em> If the byte at <var title="">position</var> is
one of 0x09 (ASCII TAB), 0x0A (ASCII LF), 0x0B (ASCII VT), 0x0C
(ASCII FF), 0x0D (ASCII CR), or 0x20 (ASCII space) then advance
<var title="">position</var> to the next byte, then, repeat this
step.</p>
</li>
<li>
<p>Process the byte at <var title="">position</var> as follows:</p>
<dl class="switch">
<dt>If it is 0x22 (ASCII '"') or 0x27 ("'")</dt>
<dd>
<ol>
<li>Let <var title="">b</var> be the value of the byte at
<var title="">position</var> .</li>
<li>Advance <var title="">position</var> to the next byte.</li>
<li>If the value of the byte at <var title="">position</var> is the
value of <var title="">b</var> , then <del class="diff-old">stop
looking for</del> <ins class="diff-chg">advance</ins> <var title=
""><ins class="diff-chg">position</ins></var> <ins class=
"diff-chg">to the next byte and abort the "get</ins> an <del class=
"diff-old">attribute.</del> <ins class="diff-chg">attribute"
algorithm.</ins> The attribute's name is the value of <var title=
"">attribute name</var> , and its value is the value of <var title=
"">attribute value</var> .</li>
<li>Otherwise, if the value of the byte at <var title=
"">position</var> is in the range 0x41 (ASCII 'A') to 0x5A (ASCII
'Z'), then append a Unicode character to <var title="">attribute
value</var> whose codepoint is 0x20 more than the value of the byte
at <var title="">position</var> .</li>
<li>Otherwise, append a Unicode character to <var title=
"">attribute value</var> whose codepoint is the same as the value
of the byte at <var title="">position</var> .</li>
<li>Return to the second step in these substeps.</li>
</ol>
</dd>
<dt>If it is <del class="diff-old">0x3C (ASCII '<'), or</del>
0x3E (ASCII <del class="diff-old">'>')</del> <ins class=
"diff-chg">'> ')</ins></dt>
<dd><del class="diff-old">Stop looking for</del> <ins class=
"diff-chg">Abort the "get</ins> an <del class=
"diff-old">attribute.</del> <ins class="diff-chg">attribute"
algorithm.</ins> The attribute's name is the value of <var title=
"">attribute name</var> , its value is the empty string.</dd>
<dt>If it is in the range 0x41 (ASCII 'A') to 0x5A (ASCII 'Z')</dt>
<dd>Append the Unicode character with codepoint <span><var title=
"">b</var> +0x20</span> to <var title="">attribute value</var>
(where <var title="">b</var> is the value of the byte at
<var title="">position</var> ). <ins class="diff-new">Advance</ins>
<var title=""><ins class="diff-new">position</ins></var>
<ins class="diff-new">to the next byte.</ins></dd>
<dt>Anything else</dt>
<dd>Append the Unicode character with the same codepoint as the
value of the byte at <var title="">position</var> ) to <var title=
"">attribute value</var> . <ins class="diff-new">Advance</ins>
<var title=""><ins class="diff-new">position</ins></var>
<ins class="diff-new">to the next byte.</ins></dd>
</dl>
</li>
<li>
<p>Process the byte at <var title="">position</var> as follows:</p>
<dl class="switch">
<dt>If it is 0x09 (ASCII TAB), 0x0A (ASCII LF), 0x0B (ASCII VT),
0x0C (ASCII FF), 0x0D (ASCII CR), 0x20 (ASCII space), <del class=
"diff-old">0x3C (ASCII '<'),</del> or 0x3E (ASCII <del class=
"diff-old">'>')</del> <ins class="diff-chg">'> ')</ins></dt>
<dd><del class="diff-old">Stop looking for</del> <ins class=
"diff-chg">Abort the "get</ins> an <del class=
"diff-old">attribute.</del> <ins class="diff-chg">attribute"
algorithm.</ins> The attribute's name is the value of <var title=
"">attribute name</var> and its value is the value of <var title=
"">attribute value</var> .</dd>
<dt>If it is in the range 0x41 (ASCII 'A') to 0x5A (ASCII 'Z')</dt>
<dd>Append the Unicode character with codepoint <span><var title=
"">b</var> +0x20</span> to <var title="">attribute value</var>
(where <var title="">b</var> is the value of the byte at
<var title="">position</var> ).</dd>
<dt>Anything else</dt>
<dd>Append the Unicode character with the same codepoint as the
value of the byte at <var title="">position</var> ) to <var title=
"">attribute value</var> .</dd>
</dl>
</li>
<li>
<p>Advance <var title="">position</var> to the next byte and return
to the previous step.</p>
</li>
</ol>
<p>For the sake of interoperability, user agents should not use a
pre-scan algorithm that returns different results than the one
described above. (But, if you do, please at least let us know, so
that we can improve this algorithm and benefit everyone...)</p>
</li>
<li>
<p>If the user agent has information on the likely encoding for
this page, e.g. based on the encoding of the page when it was last
visited, then return that encoding, with the <a href="#confidence"
title="concept-encoding-confidence">confidence</a> <i>tentative</i>
, and abort these steps.</p>
</li>
<li>
<p>The user agent may attempt to autodetect the character encoding
from applying frequency analysis or other algorithms to the data
stream. If autodetection succeeds in determining a character
encoding, then return that encoding, with the <a href="#confidence"
title="concept-encoding-confidence">confidence</a> <i>tentative</i>
, and abort these steps. <a href=
"#references">[UNIVCHARDET]</a></p>
</li>
<li>
<p>Otherwise, return an implementation-defined or user-specified
default character encoding, with the <a href="#confidence" title=
"concept-encoding-confidence">confidence</a> <i>tentative</i> .
<ins class="diff-new">In non-legacy environments, the more
comprehensive</ins> <code title=""><ins class=
"diff-new">UTF-8</ins></code> <ins class="diff-new">encoding is
recommended.</ins> Due to its use in legacy content, <code title=
"">windows-1252</code> is recommended as a default in predominantly
Western <del class="diff-old">demographics. In non-legacy
environments, the more comprehensive UTF-8 encoding is
recommended</del> <ins class="diff-chg">demographics</ins> instead.
Since these encodings can in many cases be distinguished by
inspection, a user agent may heuristically decide which to use as a
default.</p>
</li>
</ol>
<p><ins class="diff-new">The</ins> <a href=
"#character1"><ins class="diff-new">document's character
encoding</ins></a> <ins class="diff-new">must immediately be set to
the value returned from this algorithm, at the same time as the
user agent uses the returned value to select the decoder to use for
the input stream.</ins></p>
<h5 id="character0"><span class="secno">8.2.2.2.</span> Character
encoding requirements</h5>
<p>User agents must at a minimum support the UTF-8 and Windows-1252
encodings, but may support more.</p>
<p class="note">It is not unusual for Web browsers to support
dozens if not upwards of a hundred distinct character
encodings.</p>
<p>User agents must support the preferred MIME name of every
character encoding they support that has a preferred MIME name, and
should support all the IANA-registered aliases. <a href=
"#references">[IANACHARSET]</a></p>
<p>When <ins class="diff-new">comparing a string specifying a
character encoding with the name or alias of a character encoding
to determine if they are equal, user agents must ignore the all
characters in the ranges U+0009 to U+000D, U+0020 to U+002F, U+003A
to U+0040, U+005B to U+0060, and U+007B to U+007E (all whitespace
and punctuation characters in ASCII) in both names, and then
perform the comparison case-insensitively.</ins></p>
<p class="example"><ins class="diff-new">For instance, "GB_2312-80"
and "g.b.2312(80)" are considered equivalent names.</ins></p>
<p><ins class="diff-new">When</ins> a user agent would otherwise
use <ins class="diff-new">an encoding given in</ins> the
<del class="diff-old">ISO-8859-1 encoding,</del> <ins class=
"diff-chg">first column of the following table,</ins> it must
instead use the <ins class="diff-new">encoding given in the cell in
the second column of the same row. Any bytes that are treated
differently due to this encoding aliasing must be considered</ins>
<a href="#parse1" title="parse error"><ins class="diff-new">parse
errors</ins></a> .</p>
<table>
<caption><ins class="diff-new">Character encoding
overrides</ins></caption>
<thead>
<tr>
<th><ins class="diff-new">Input encoding</ins></th>
<th><ins class="diff-new">Replacement encoding</ins></th>
<th><ins class="diff-new">References</ins></th>
</tr>
</thead>
<tbody>
<tr>
<td><ins class="diff-new">EUC-KR</ins></td>
<td><ins class="diff-new">Windows-949</ins></td>
<td><a href="#references"><ins class="diff-new">[EUCKR]</ins></a>
<a href="#references"><ins class="diff-new">[WIN949]</ins></a></td>
</tr>
<tr>
<td><ins class="diff-new">GB2312</ins></td>
<td><ins class="diff-new">GBK</ins></td>
<td><a href="#references"><ins class="diff-new">[GB2312]</ins></a>
<a href="#references"><ins class="diff-new">[GBK]</ins></a></td>
</tr>
<tr>
<td><ins class="diff-new">GB_2312-80</ins></td>
<td><ins class="diff-new">GBK</ins></td>
<td><a href="#references"><ins class="diff-new">[RFC1345]</ins></a>
<a href="#references"><ins class="diff-new">[GBK]</ins></a></td>
</tr>
<tr>
<td><ins class="diff-new">ISO-8859-1</ins></td>
<td>Windows-1252 <del class="diff-old">encoding.</del></td>
<td><a href="#references"><ins class="diff-chg">[RFC1345]</ins></a>
<a href="#references"><ins class=
"diff-chg">[WIN1252]</ins></a></td>
</tr>
<tr>
<td><ins class="diff-chg">ISO-8859-9</ins></td>
<td><ins class="diff-chg">Windows-1254</ins></td>
<td><a href="#references"><ins class="diff-chg">[RFC1345]</ins></a>
<a href="#references"><ins class=
"diff-chg">[WIN1254]</ins></a></td>
</tr>
<tr>
<td><ins class="diff-chg">ISO-8859-11</ins></td>
<td><ins class="diff-chg">Windows-874</ins></td>
<td><a href="#references"><ins class=
"diff-chg">[ISO885911]</ins></a> <a href="#references"><ins class=
"diff-chg">[WIN874]</ins></a></td>
</tr>
<tr>
<td><ins class="diff-chg">KS_C_5601-1987</ins></td>
<td><ins class="diff-chg">Windows-949</ins></td>
<td><a href="#references"><ins class="diff-chg">[RFC1345]</ins></a>
<a href="#references"><ins class="diff-chg">[WIN949]</ins></a></td>
</tr>
<tr>
<td><ins class="diff-chg">TIS-620</ins></td>
<td><ins class="diff-chg">Windows-874</ins></td>
<td><a href="#references"><ins class="diff-chg">[TIS620]</ins></a>
<a href="#references"><ins class="diff-chg">[WIN874]</ins></a></td>
</tr>
<tr>
<td><ins class="diff-chg">x-x-big5</ins></td>
<td><ins class="diff-chg">Big5</ins></td>
<td><a href="#references"><ins class=
"diff-chg">[BIG5]</ins></a></td>
</tr>
</tbody>
</table>
<p class="note"><del class="diff-old">This</del> <ins class=
"diff-chg">The</ins> requirement <ins class="diff-new">to treat
certain encodings as other encodings according to the table
above</ins> is a willful violation of the W3C Character Model
specification. <a href="#references">[CHARMOD]</a></p>
<p>User agents must not support the CESU-8, UTF-7, BOCU-1 and SCSU
encodings. <a href="#references">[CESU8]</a> <a href=
"#references">[UTF7]</a> <a href="#references">[BOCU1]</a> <a href=
"#references">[SCSU]</a></p>
<p>Support for UTF-32 is not recommended. This encoding is rarely
used, and frequently misimplemented.</p>
<p class="note"><ins class="diff-new">This specification does not
make any attempt to support UTF-32 in its algorithms; support and
use of UTF-32 can thus lead to unexpected behavior in
implementations of this specification.</ins></p>
<h5 id="preprocessing"><span class="secno">8.2.2.3.</span>
Preprocessing the input stream</h5>
<p>Given an encoding, the bytes in the input stream must be
converted to Unicode characters for the tokeniser, as described by
the rules for that encoding, except that <ins class=
"diff-new">the</ins> leading U+FEFF BYTE ORDER MARK <del class=
"diff-old">characters</del> <ins class="diff-chg">character, if
any,</ins> must not be stripped by the encoding <del class=
"diff-old">layer.</del> <ins class="diff-chg">layer (it is stripped
by the rule below).</ins></p>
<p>Bytes or sequences of bytes in the original byte stream that
could not be converted to Unicode characters must be converted to
U+FFFD REPLACEMENT CHARACTER code points.</p>
<p class="note"><ins class="diff-new">Bytes or sequences of bytes
in the original byte stream that did not conform to the encoding
specification (e.g. invalid UTF-8 byte sequences in a UTF-8 input
stream) are errors that conformance checkers are expected to
report.</ins></p>
<p>One leading U+FEFF BYTE ORDER MARK character must be ignored if
any are present.</p>
<p>All U+0000 NULL characters in the input must be replaced by
U+FFFD REPLACEMENT CHARACTERs. Any occurrences of such characters
is a <a href="#parse1">parse error</a> .</p>
<p><ins class="diff-new">Any occurrences of any characters in the
ranges U+0001 to U+0008, U+000E to U+001F, U+007F to U+009F, U+D800
to U+DFFF , U+FDD0 to U+FDDF, and characters U+FFFE, U+FFFF,
U+1FFFE, U+1FFFF, U+2FFFE, U+2FFFF, U+3FFFE, U+3FFFF, U+4FFFE,
U+4FFFF, U+5FFFE, U+5FFFF, U+6FFFE, U+6FFFF, U+7FFFE, U+7FFFF,
U+8FFFE, U+8FFFF, U+9FFFE, U+9FFFF, U+AFFFE, U+AFFFF, U+BFFFE,
U+BFFFF, U+CFFFE, U+CFFFF, U+DFFFE, U+DFFFF, U+EFFFE, U+EFFFF,
U+FFFFE, U+FFFFF, U+10FFFE, and U+10FFFF are</ins> <a href=
"#parse1" title="parse error"><ins class="diff-new">parse
errors</ins></a> .<ins class="diff-new">(These are all control
characters or permanently undefined Unicode characters.)</ins></p>
<p>U+000D CARRIAGE RETURN (CR) characters, and U+000A LINE FEED
(LF) characters, are treated specially. Any CR characters that are
followed by LF characters must be removed, and any CR characters
not followed by LF characters must be converted to LF characters.
Thus, newlines in HTML DOMs are represented by LF characters, and
there are never any CR characters in the input to the <a href=
"#tokenisation0">tokenisation</a> stage.</p>
<p>The <dfn id="next-input">next input character</dfn> is the first
character in the input stream that has not yet been <dfn id=
"consumed">consumed</dfn> . Initially, the <em><a href=
"#next-input">next input character</a></em> is the first character
in the input.</p>
<p>The <dfn id="insertion">insertion point</dfn> is the position
(just before a character or just before the end of the input
stream) where content inserted using <code title=
"dom-document-write-HTML"><a href=
"#document.write...">document.write()</a></code> is actually
inserted. The insertion point is relative to the position of the
character immediately after it, it is not an absolute offset into
the input stream. Initially, the insertion point is <del class=
"diff-old">uninitialised.</del> <ins class=
"diff-chg">uninitialized.</ins></p>
<p>The "EOF" character in the tables below is a conceptual
character representing the end of the <a href="#input0">input
stream</a> . If the parser is a <a href=
"#script-created">script-created parser</a> , then the end of the
<a href="#input0">input stream</a> is reached when an <dfn id=
"explicit0">explicit "EOF" character</dfn> (inserted by the
<code title="dom-document-close"><a href=
"#close">document.close()</a></code> method) is consumed.
Otherwise, the "EOF" character is not a real character in the
stream, but rather the lack of any further characters.</p>
<h5 id="changing"><span class="secno">8.2.2.4.</span> Changing the
encoding while parsing</h5>
<p>When the parser requires the user agent to <dfn id=
"change">change the encoding</dfn> , it must run the following
steps. This might happen if the <a href="#encoding0">encoding
sniffing algorithm</a> described above failed to find an encoding,
or if it found an encoding that was not the actual encoding of the
file.</p>
<ol>
<li>If the new encoding is <del class="diff-old">UTF-16,</del>
<ins class="diff-chg">a UTF-16 encoding,</ins> change it to
UTF-8.</li>
<li>If the new encoding is identical or equivalent to the encoding
that is already being used to interpret the input stream, then set
the <a href="#confidence" title=
"concept-encoding-confidence">confidence</a> to <i>confident</i>
and abort these steps. This happens when the encoding information
found in the file matches what the <a href="#encoding0">encoding
sniffing algorithm</a> determined to be the encoding, and in the
second pass through the parser if the first pass found that the
encoding sniffing algorithm described in the earlier section failed
to find the right encoding.</li>
<li>If all the bytes up to the last byte converted by the current
decoder have the same Unicode interpretations in both the current
encoding and the new encoding, and if the user agent supports
changing the converter on the fly, then the user agent may change
to the new converter for the encoding on the fly. Set the <a href=
"#character1"><ins class="diff-new">document's character</ins>
encoding</a> <ins class="diff-new">and the encoding used to convert
the input stream</ins> to the new encoding, set the <a href=
"#confidence" title="concept-encoding-confidence">confidence</a> to
<i>confident</i> , and abort these steps.</li>
<li>Otherwise, <a href="#navigate">navigate</a> to the document
again, with <a href="#replacement">replacement enabled</a> ,
<ins class="diff-new">and using the same</ins> <a href=
"#source0"><ins class="diff-new">source browsing context</ins></a>
, but this time skip the <a href="#encoding0">encoding sniffing
algorithm</a> and instead just set the encoding to the new encoding
and the <a href="#confidence" title=
"concept-encoding-confidence">confidence</a> to <i>confident</i> .
Whenever possible, this should be done without actually contacting
the network layer (the bytes should be re-parsed from memory), even
if, e.g., the document is marked as not being cacheable.</li>
</ol>
<del class="diff-old">While</del>
<h4 id="parse"><span class="secno"><ins class=
"diff-chg">8.2.3</ins></span> <ins class="diff-chg">Parse
state</ins></h4>
<h5 id="the-insertion"><span class="secno"><ins class=
"diff-chg">8.2.3.1.</ins></span> <ins class="diff-chg">The
insertion mode</ins></h5>
<p><ins class="diff-chg">Initially</ins> the <del class=
"diff-old">invocation</del> <span><ins class="diff-chg">insertion
mode</ins></span> <ins class="diff-chg">is "</ins> <a href=
"#initial" title="insertion mode: initial"><ins class=
"diff-chg">initial</ins></a> <ins class="diff-chg">". It can change
to "</ins> <a href="#before4" title=
"insertion mode: before html"><ins class="diff-chg">before
html</ins></a> <ins class="diff-chg">", "</ins> <a href="#before5"
title="insertion mode: before head"><ins class="diff-chg">before
head</ins></a> <ins class="diff-chg">", "</ins> <a href="#in-head"
title="insertion mode: in head"><ins class="diff-chg">in
head</ins></a> <ins class="diff-chg">", "</ins> <a href="#in-head0"
title="insertion mode: in head noscript"><ins class="diff-chg">in
head noscript</ins></a> <ins class="diff-chg">", "</ins> <a href=
"#after4" title="insertion mode: after head"><ins class=
"diff-chg">after head</ins></a> <ins class="diff-chg">", "</ins>
<a href="#in-body" title="insertion mode: in body"><ins class=
"diff-chg">in body</ins></a> <ins class="diff-chg">", "</ins>
<a href="#in-table" title="insertion mode: in table"><ins class=
"diff-chg">in table</ins></a> <ins class="diff-chg">", "</ins>
<a href="#in-caption" title=
"insertion mode: in caption"><ins class="diff-chg">in
caption</ins></a> <ins class="diff-chg">", "</ins> <a href=
"#in-column" title="insertion mode: in column group"><ins class=
"diff-chg">in column group</ins></a> <ins class="diff-chg">",
"</ins> <a href="#in-table0" title=
"insertion mode: in table body"><ins class="diff-chg">in table
body</ins></a> <ins class="diff-chg">", "</ins> <a href="#in-row"
title="insertion mode: in row"><ins class="diff-chg">in
row</ins></a> <ins class="diff-chg">", "</ins> <a href="#in-cell"
title="insertion mode: in cell"><ins class="diff-chg">in
cell</ins></a> <ins class="diff-chg">", "</ins> <a href=
"#in-select" title="insertion mode: in select"><ins class=
"diff-chg">in select</ins></a> <ins class="diff-chg">", "</ins>
<a href="#in-select0" title=
"insertion mode: in select in table"><ins class="diff-chg">in
select in table</ins></a> <ins class="diff-chg">", "</ins> <a href=
"#in-foreign" title=
"insertion mode: in foreign content"><ins class="diff-chg">in
foreign content</ins></a> <ins class="diff-chg">", "</ins> <a href=
"#after5" title="insertion mode: after body"><ins class=
"diff-chg">after body</ins></a> <ins class="diff-chg">", "</ins>
<a href="#in-frameset" title=
"insertion mode: in frameset"><ins class="diff-chg">in
frameset</ins></a> <ins class="diff-chg">", "</ins> <a href=
"#after6" title="insertion mode: after frameset"><ins class=
"diff-chg">after frameset</ins></a> <ins class="diff-chg">",
"</ins> <a href="#after7" title=
"insertion mode: after after body"><ins class="diff-chg">after
after body</ins></a> <ins class="diff-chg">", and "</ins> <a href=
"#after8" title="insertion mode: after after frameset"><ins class=
"diff-chg">after after frameset</ins></a> <ins class="diff-chg">"
during the course</ins> of <del class="diff-old">this</del>
<ins class="diff-chg">the parsing, as described in the</ins>
<a href="#tree-construction0"><ins class="diff-chg">tree
construction</ins></a> <ins class="diff-chg">stage. The insertion
mode affects how tokens are processed and whether CDATA blocks are
supported.</ins></p>
<p><ins class="diff-chg">Seven of these modes, namely "</ins>
<a href="#in-head" title="insertion mode: in head"><ins class=
"diff-chg">in head</ins></a> <ins class="diff-chg">", "</ins>
<a href="#in-body" title="insertion mode: in body"><ins class=
"diff-chg">in body</ins></a> <ins class="diff-chg">", "</ins>
<a href="#in-table" title="insertion mode: in table"><ins class=
"diff-chg">in table</ins></a> <ins class="diff-chg">", "</ins>
<a href="#in-table0" title=
"insertion mode: in table body"><ins class="diff-chg">in table
body</ins></a> <ins class="diff-chg">", "</ins> <a href="#in-row"
title="insertion mode: in row"><ins class="diff-chg">in
row</ins></a> <ins class="diff-chg">", "</ins> <a href="#in-cell"
title="insertion mode: in cell"><ins class="diff-chg">in
cell</ins></a> <ins class="diff-chg">", and "</ins> <a href=
"#in-select" title="insertion mode: in select"><ins class=
"diff-chg">in select</ins></a> <ins class="diff-chg">", are
special, in that the other modes defer to them at various times.
When the</ins> algorithm <ins class="diff-new">below says that the
user agent is to do something "</ins> <dfn id="using8"><ins class=
"diff-new">using the rules for</ins></dfn> <ins class=
"diff-new">the</ins> <var title=""><ins class=
"diff-new">m</ins></var> <ins class="diff-new">insertion mode",
where</ins> <var title=""><ins class="diff-new">m</ins></var>
<ins class="diff-new">is one of these modes, the user agent must
use the rules described under that</ins> <span><ins class=
"diff-new">insertion mode</ins></span> <ins class="diff-new">'s
section, but must leave the</ins> <span><ins class=
"diff-new">insertion mode</ins></span> <ins class=
"diff-new">unchanged (unless the rules in that section themselves
switch the</ins> <span><ins class="diff-new">insertion
mode</ins></span> <ins class="diff-new">).</ins></p>
<p><ins class="diff-new">When the insertion mode is switched to
"</ins> <a href="#in-foreign" title=
"insertion mode: in foreign content"><ins class="diff-new">in
foreign content</ins></a> <ins class="diff-new">", the</ins>
<dfn id="secondary1"><ins class="diff-new">secondary insertion
mode</ins></dfn> <ins class="diff-new">is also set. This secondary
mode is used within the rules for the "</ins> <a href="#in-foreign"
title="insertion mode: in foreign content"><ins class="diff-new">in
foreign content</ins></a> <ins class="diff-new">" mode to handle
HTML (i.e. not foreign) content.</ins></p>
<p><ins class="diff-new">When the steps below require the UA
to</ins> <dfn id="reset"><ins class="diff-new">reset the insertion
mode appropriately</ins></dfn> ,<ins class="diff-new">it means the
UA must follow these steps:</ins></p>
<ol>
<li><ins class="diff-new">Let</ins> <var title=""><ins class=
"diff-new">last</ins></var> <ins class="diff-new">be
false.</ins></li>
<li><ins class="diff-new">Let</ins> <var title=""><ins class=
"diff-new">node</ins></var> <ins class="diff-new">be the last node
in the</ins> <a href="#stack"><ins class="diff-new">stack of open
elements</ins></a> .</li>
<li><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">node</ins></var> <ins class="diff-new">is the first node
in the stack of open elements, then set</ins> <var title=
""><ins class="diff-new">last</ins></var> <ins class="diff-new">to
true and set</ins> <var title=""><ins class=
"diff-new">node</ins></var> <ins class="diff-new">to the</ins>
<var title=""><ins class="diff-new">context</ins></var> <ins class=
"diff-new">element. (</ins> <a href="#fragment"><ins class=
"diff-new">fragment case</ins></a> <ins class=
"diff-new">)</ins></li>
<li><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">node</ins></var> <ins class="diff-new">is a</ins>
<code><ins class="diff-new">select</ins></code> <ins class=
"diff-new">element, then switch the</ins> <span><ins class=
"diff-new">insertion mode</ins></span> <ins class="diff-new">to
"</ins> <a href="#in-select" title=
"insertion mode: in select"><ins class="diff-new">in
select</ins></a> <ins class="diff-new">" and abort these steps.
(</ins> <a href="#fragment"><ins class="diff-new">fragment
case</ins></a> <ins class="diff-new">)</ins></li>
<li><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">node</ins></var> <ins class="diff-new">is a</ins>
<code><a href="#td"><ins class="diff-new">td</ins></a></code>
<ins class="diff-new">or</ins> <code><a href="#th"><ins class=
"diff-new">th</ins></a></code> <ins class="diff-new">element
and</ins> <var title=""><ins class="diff-new">last</ins></var> is
<ins class="diff-new">false, then switch the</ins>
<span><ins class="diff-new">insertion mode</ins></span> <ins class=
"diff-new">to "</ins> <a href="#in-cell" title=
"insertion mode: in cell"><ins class="diff-new">in cell</ins></a>
<ins class="diff-new">" and abort these steps.</ins></li>
<li><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">node</ins></var> <ins class="diff-new">is a</ins>
<code><a href="#tr"><ins class="diff-new">tr</ins></a></code>
<ins class="diff-new">element, then switch the</ins>
<span><ins class="diff-new">insertion mode</ins></span> <ins class=
"diff-new">to "</ins> <a href="#in-row" title=
"insertion mode: in row"><ins class="diff-new">in row</ins></a>
<ins class="diff-new">" and abort these steps.</ins></li>
<li><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">node</ins></var> <ins class="diff-new">is a</ins>
<code><a href="#tbody"><ins class="diff-new">tbody</ins></a></code>
,<code><a href="#thead0"><ins class=
"diff-new">thead</ins></a></code> ,<ins class="diff-new">or</ins>
<code><a href="#tfoot0"><ins class=
"diff-new">tfoot</ins></a></code> <ins class="diff-new">element,
then switch the</ins> <span><ins class="diff-new">insertion
mode</ins></span> <ins class="diff-new">to "</ins> <a href=
"#in-table0" title="insertion mode: in table body"><ins class=
"diff-new">in table body</ins></a> <ins class="diff-new">" and
abort these steps.</ins></li>
<li><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">node</ins></var> <ins class="diff-new">is a</ins>
<code><a href="#caption0"><ins class=
"diff-new">caption</ins></a></code> <ins class="diff-new">element,
then switch the</ins> <span><ins class="diff-new">insertion
mode</ins></span> <ins class="diff-new">to "</ins> <a href=
"#in-caption" title="insertion mode: in caption"><ins class=
"diff-new">in caption</ins></a> <ins class="diff-new">" and abort
these steps.</ins></li>
<li><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">node</ins></var> <ins class="diff-new">is a</ins>
<code><a href="#colgroup"><ins class=
"diff-new">colgroup</ins></a></code> <ins class="diff-new">element,
then switch the</ins> <span><ins class="diff-new">insertion
mode</ins></span> <ins class="diff-new">to "</ins> <a href=
"#in-column" title="insertion mode: in column group"><ins class=
"diff-new">in column group</ins></a> <ins class="diff-new">" and
abort these steps. (</ins> <a href="#fragment"><ins class=
"diff-new">fragment case</ins></a> <ins class=
"diff-new">)</ins></li>
<li><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">node</ins></var> <ins class="diff-new">is a</ins>
<code><a href="#table"><ins class="diff-new">table</ins></a></code>
<ins class="diff-new">element, then switch the</ins>
<span><ins class="diff-new">insertion mode</ins></span> <ins class=
"diff-new">to "</ins> <a href="#in-table" title=
"insertion mode: in table"><ins class="diff-new">in table</ins></a>
<ins class="diff-new">" and abort these steps.</ins></li>
<li><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">node</ins></var> <ins class="diff-new">is an element
from the</ins> <a href="#mathml0"><ins class="diff-new">MathML
namespace</ins></a> ,<ins class="diff-new">then switch the</ins>
<span><ins class="diff-new">insertion mode</ins></span> <ins class=
"diff-new">to "</ins> <a href="#in-foreign" title=
"insertion mode: in foreign content"><ins class="diff-new">in
foreign content</ins></a> <ins class="diff-new">", let the</ins>
<a href="#secondary1"><ins class="diff-new">secondary insertion
mode</ins></a> <ins class="diff-new">be "</ins> <a href="#in-body"
title="insertion mode: in body"><ins class="diff-new">in
body</ins></a> <ins class="diff-new">", and abort these
steps.</ins></li>
<li><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">node</ins></var> <ins class="diff-new">is a</ins>
<code><a href="#head"><ins class="diff-new">head</ins></a></code>
<ins class="diff-new">element, then switch the</ins>
<span><ins class="diff-new">insertion mode</ins></span> <ins class=
"diff-new">to "</ins> <a href="#in-body" title=
"insertion mode: in body"><ins class="diff-new">in body</ins></a>
<ins class="diff-new">" ("</ins> <a href="#in-body" title=
"insertion mode: in body"><ins class="diff-new">in body</ins></a>
<ins class="diff-new">"!</ins> <em>not <ins class=
"diff-new">"</ins> <a href="#in-head" title=
"insertion mode: in head"><ins class="diff-new">in head</ins></a>
<ins class="diff-new">"</ins></em> !)<ins class="diff-new">and
abort these steps. (</ins> <a href="#fragment"><ins class=
"diff-new">fragment case</ins></a> <ins class=
"diff-new">)</ins></li>
<li><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">node</ins></var> <ins class="diff-new">is</ins> a
<del class="diff-old">parse error,</del> <code><a href=
"#body0"><ins class="diff-chg">body</ins></a></code> <ins class=
"diff-chg">element, then switch the</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> <ins class="diff-chg">to
"</ins> <a href="#in-body" title=
"insertion mode: in body"><ins class="diff-chg">in body</ins></a>
<ins class="diff-chg">" and abort these steps.</ins></li>
<li><ins class="diff-chg">If</ins> <var title=""><ins class=
"diff-chg">node</ins></var> <ins class="diff-chg">is a</ins>
<code><ins class="diff-chg">frameset</ins></code> <ins class=
"diff-chg">element, then switch the</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> <ins class="diff-chg">to
"</ins> <a href="#in-frameset" title=
"insertion mode: in frameset"><ins class="diff-chg">in
frameset</ins></a> <ins class="diff-chg">" and abort these steps.
(</ins> <a href="#fragment"><ins class="diff-chg">fragment
case</ins></a> <ins class="diff-chg">)</ins></li>
<li><ins class="diff-chg">If</ins> <var title=""><ins class=
"diff-chg">node</ins></var> <ins class="diff-chg">is an</ins>
<code><a href="#html"><ins class="diff-chg">html</ins></a></code>
<ins class="diff-chg">element, then: if the</ins> <a href=
"#head-element"><code title=""><ins class=
"diff-chg">head</ins></code> <ins class="diff-chg">element
pointer</ins></a> <ins class="diff-chg">is null, switch the</ins>
<span><ins class="diff-chg">insertion mode</ins></span> <ins class=
"diff-chg">to "</ins> <a href="#before5" title=
"insertion mode: before head"><ins class="diff-chg">before
head</ins></a> <ins class="diff-chg">", otherwise, switch the</ins>
<span><ins class="diff-chg">insertion mode</ins></span> <ins class=
"diff-chg">to "</ins> <a href="#after4" title=
"insertion mode: after head"><ins class="diff-chg">after
head</ins></a> <ins class="diff-chg">". In either case, abort these
steps. (</ins> <a href="#fragment"><ins class="diff-chg">fragment
case</ins></a> <ins class="diff-chg">)</ins></li>
<li><ins class="diff-chg">If</ins> <var title=""><ins class=
"diff-chg">last</ins></var> <ins class="diff-chg">is true, then
switch the</ins> <span><ins class="diff-chg">insertion
mode</ins></span> <ins class="diff-chg">to "</ins> <a href=
"#in-body" title="insertion mode: in body"><ins class="diff-chg">in
body</ins></a> <ins class="diff-chg">" and abort these steps.
(</ins> <a href="#fragment"><ins class="diff-chg">fragment
case</ins></a> <ins class="diff-chg">)</ins></li>
<li><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">node</ins></var> <ins class="diff-chg">now be the node
before</ins> <var title=""><ins class="diff-chg">node</ins></var>
<ins class="diff-chg">in the</ins> <a href="#stack"><ins class=
"diff-chg">stack of open elements</ins></a> .</li>
<li><ins class="diff-chg">Return to step 3.</ins></li>
</ol>
<h5 id="the-stack"><span class="secno"><ins class=
"diff-chg">8.2.3.2.</ins></span> <ins class="diff-chg">The stack of
open elements</ins></h5>
<p><ins class="diff-chg">Initially the</ins> <dfn id=
"stack"><ins class="diff-chg">stack of open elements</ins></dfn>
<ins class="diff-chg">is empty. The stack grows downwards; the
topmost node on the stack is the first one added to the stack, and
the bottommost node of the stack is the most recently added node in
the stack (notwithstanding when the stack is manipulated in a
random access fashion as part of</ins> <a href=
"#adoptionAgency"><ins class="diff-chg">the handling for misnested
tags</ins></a> <ins class="diff-chg">).</ins></p>
<p><ins class="diff-chg">The "</ins> <a href="#before4" title=
"insertion mode: before html"><ins class="diff-chg">before
html</ins></a> <ins class="diff-chg">"</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> <ins class=
"diff-chg">creates the</ins> <code><a href="#html"><ins class=
"diff-chg">html</ins></a></code> <ins class="diff-chg">root element
node, which is then added to the stack.</ins></p>
<p><ins class="diff-chg">In the</ins> <a href=
"#fragment"><ins class="diff-chg">fragment case</ins></a>
,<ins class="diff-chg">the</ins> <a href="#stack"><ins class=
"diff-chg">stack of open elements</ins></a> <ins class=
"diff-chg">is initialized to contain an</ins> <code><a href=
"#html"><ins class="diff-chg">html</ins></a></code> <ins class=
"diff-chg">element that is created as part of</ins> <a href=
"#html-fragment0" title=
"html fragment parsing algorithm"><ins class="diff-chg">that
algorithm</ins></a> .<ins class="diff-chg">(The</ins> <a href=
"#fragment"><ins class="diff-chg">fragment case</ins></a>
<ins class="diff-chg">skips the "</ins> <a href="#before4" title=
"insertion mode: before html"><ins class="diff-chg">before
html</ins></a> <ins class="diff-chg">"</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> .)</p>
<p><ins class="diff-chg">The</ins> <code><a href=
"#html"><ins class="diff-chg">html</ins></a></code> <ins class=
"diff-chg">node, however</ins> it is <del class="diff-old">still
indicative</del> <ins class="diff-chg">created, is the topmost
node</ins> of <del class="diff-old">non-conforming</del>
<ins class="diff-chg">the stack. It never gets popped off the
stack.</ins></p>
<p><ins class="diff-chg">The</ins> <dfn id="current5"><ins class=
"diff-chg">current node</ins></dfn> <ins class="diff-chg">is the
bottommost node in this stack.</ins></p>
<p><ins class="diff-chg">The</ins> <dfn id="current6"><ins class=
"diff-chg">current table</ins></dfn> <ins class="diff-chg">is the
last</ins> <code><a href="#table"><ins class=
"diff-chg">table</ins></a></code> <ins class="diff-chg">element in
the</ins> <a href="#stack"><ins class="diff-chg">stack of open
elements</ins></a> ,<ins class="diff-chg">if there is one. If there
is no</ins> <code><a href="#table"><ins class=
"diff-chg">table</ins></a></code> <ins class="diff-chg">element in
the</ins> <a href="#stack"><ins class="diff-chg">stack of open
elements</ins></a> <ins class="diff-chg">(</ins> <a href=
"#fragment"><ins class="diff-chg">fragment case</ins></a>
<ins class="diff-chg">), then the</ins> <a href=
"#current6"><ins class="diff-chg">current table</ins></a>
<ins class="diff-chg">is the first element in the</ins> <a href=
"#stack"><ins class="diff-chg">stack of open elements</ins></a>
<ins class="diff-chg">(the</ins> <code><a href="#html"><ins class=
"diff-chg">html</ins></a></code> <ins class=
"diff-chg">element).</ins></p>
<p><ins class="diff-chg">Elements in the stack fall into the
following categories:</ins></p>
<dl>
<dt><dfn id="special"><ins class=
"diff-chg">Special</ins></dfn></dt>
<dd>
<p><ins class="diff-chg">The following HTML elements have varying
levels of special parsing rules:</ins> <code><a href=
"#address"><ins class="diff-chg">address</ins></a></code>
,<code><a href="#area"><ins class="diff-chg">area</ins></a></code>
,<code><a href="#base"><ins class="diff-chg">base</ins></a></code>
,<code><ins class="diff-chg">basefont</ins></code>
,<code><ins class="diff-chg">bgsound</ins></code> ,<code><a href=
"#blockquote"><ins class="diff-chg">blockquote</ins></a></code>
,<code><a href="#body0"><ins class="diff-chg">body</ins></a></code>
,<code><a href="#br"><ins class="diff-chg">br</ins></a></code>
,<code><ins class="diff-chg">center</ins></code> ,<code><a href=
"#col"><ins class="diff-chg">col</ins></a></code> ,<code><a href=
"#colgroup"><ins class="diff-chg">colgroup</ins></a></code>
,<code><a href="#dd"><ins class="diff-chg">dd</ins></a></code>
,<code><ins class="diff-chg">dir</ins></code> ,<code><a href=
"#div"><ins class="diff-chg">div</ins></a></code> ,<code><a href=
"#dl"><ins class="diff-chg">dl</ins></a></code> ,<code><a href=
"#dt"><ins class="diff-chg">dt</ins></a></code> ,<code><a href=
"#embed"><ins class="diff-chg">embed</ins></a></code>
,<code><ins class="diff-chg">fieldset</ins></code>
,<code><ins class="diff-chg">form</ins></code> ,<code><ins class=
"diff-chg">frame</ins></code> ,<code><ins class=
"diff-chg">frameset</ins></code> ,<code><a href="#h1"><ins class=
"diff-chg">h1</ins></a></code> ,<code><a href="#h2"><ins class=
"diff-chg">h2</ins></a></code> ,<code><a href="#h3"><ins class=
"diff-chg">h3</ins></a></code> ,<code><a href="#h4"><ins class=
"diff-chg">h4</ins></a></code> ,<code><a href="#h5"><ins class=
"diff-chg">h5</ins></a></code> ,<code><a href="#h6"><ins class=
"diff-chg">h6</ins></a></code> ,<code><a href="#head"><ins class=
"diff-chg">head</ins></a></code> ,<code><a href="#hr"><ins class=
"diff-chg">hr</ins></a></code> ,<code><a href="#iframe"><ins class=
"diff-chg">iframe</ins></a></code> ,<code><a href=
"#img"><ins class="diff-chg">img</ins></a></code>
,<code><ins class="diff-chg">input</ins></code> ,<code><ins class=
"diff-chg">isindex</ins></code> ,<code><a href="#li"><ins class=
"diff-chg">li</ins></a></code> ,<code><a href="#link"><ins class=
"diff-chg">link</ins></a></code> ,<code><ins class=
"diff-chg">listing</ins></code> ,<code><a href="#menu"><ins class=
"diff-chg">menu</ins></a></code> ,<code><a href=
"#meta0"><ins class="diff-chg">meta</ins></a></code>
,<code><ins class="diff-chg">noembed</ins></code>
,<code><ins class="diff-chg">noframes</ins></code> ,<code><a href=
"#noscript"><ins class="diff-chg">noscript</ins></a></code>
,<code><a href="#ol"><ins class="diff-chg">ol</ins></a></code>
,<code><ins class="diff-chg">optgroup</ins></code>
,<code><ins class="diff-chg">option</ins></code> ,<code><a href=
"#p"><ins class="diff-chg">p</ins></a></code> ,<code><a href=
"#param"><ins class="diff-chg">param</ins></a></code>
,<code><ins class="diff-chg">plaintext</ins></code> ,<code><a href=
"#pre"><ins class="diff-chg">pre</ins></a></code> ,<code><a href=
"#script1"><ins class="diff-chg">script</ins></a></code>
,<code><ins class="diff-chg">select</ins></code> ,<code><ins class=
"diff-chg">spacer</ins></code> ,<code><a href="#style1"><ins class=
"diff-chg">style</ins></a></code> ,<code><a href=
"#tbody"><ins class="diff-chg">tbody</ins></a></code>
,<code><ins class="diff-chg">textarea</ins></code> ,<code><a href=
"#tfoot0"><ins class="diff-chg">tfoot</ins></a></code>
,<code><a href="#thead0"><ins class=
"diff-chg">thead</ins></a></code> ,<code><a href=
"#title1"><ins class="diff-chg">title</ins></a></code>
,<code><a href="#tr"><ins class="diff-chg">tr</ins></a></code>
,<code><a href="#ul"><ins class="diff-chg">ul</ins></a></code>
,<ins class="diff-chg">and</ins> <code><ins class=
"diff-chg">wbr</ins></code> .</p>
</dd>
<dt><dfn id="scoping"><ins class=
"diff-chg">Scoping</ins></dfn></dt>
<dd>
<p><ins class="diff-chg">The following HTML elements introduce
new</ins> <a href="#have-an" title=
"has an element in scope"><ins class="diff-chg">scopes</ins></a>
<ins class="diff-chg">for various parts of the parsing:</ins>
<code><a href="#applet"><ins class=
"diff-chg">applet</ins></a></code> ,<code><ins class=
"diff-chg">button</ins></code> ,<code><a href=
"#caption0"><ins class="diff-chg">caption</ins></a></code>
,<code><a href="#html"><ins class="diff-chg">html</ins></a></code>
,<code><ins class="diff-chg">marquee</ins></code> ,<code><a href=
"#object"><ins class="diff-chg">object</ins></a></code>
,<code><a href="#table"><ins class=
"diff-chg">table</ins></a></code> ,<code><a href="#td"><ins class=
"diff-chg">td</ins></a></code> <ins class="diff-chg">and</ins>
<code><a href="#th"><ins class="diff-chg">th</ins></a></code> .</p>
</dd>
<dt><dfn id="formatting"><ins class=
"diff-chg">Formatting</ins></dfn></dt>
<dd>
<p><ins class="diff-chg">The following HTML elements are those that
end up in the</ins> <a href="#list-of4"><ins class="diff-chg">list
of active formatting elements</ins></a> :<code><a href=
"#a"><ins class="diff-chg">a</ins></a></code> ,<code><a href=
"#b"><ins class="diff-chg">b</ins></a></code> ,<code><ins class=
"diff-chg">big</ins></code> ,<code><a href="#em"><ins class=
"diff-chg">em</ins></a></code> ,<code><ins class=
"diff-chg">font</ins></code> ,<code><a href="#i"><ins class=
"diff-chg">i</ins></a></code> ,<code><ins class=
"diff-chg">nobr</ins></code> ,<code><ins class=
"diff-chg">s</ins></code> ,<code><a href="#small"><ins class=
"diff-chg">small</ins></a></code> ,<code><ins class=
"diff-chg">strike</ins></code> ,<code><a href="#strong"><ins class=
"diff-chg">strong</ins></a></code> ,<code><ins class=
"diff-chg">tt</ins></code> ,<ins class="diff-chg">and</ins>
<code><ins class="diff-chg">u</ins></code> .</p>
</dd>
<dt><dfn id="phrasing1"><ins class=
"diff-chg">Phrasing</ins></dfn></dt>
<dd>
<p><ins class="diff-chg">All other elements found while parsing an
HTML document.</ins></p>
</dd>
</dl>
<p class="big-issue"><ins class="diff-chg">Still need to add these
new elements to the lists:</ins> <code><a href=
"#event-source"><ins class="diff-chg">event-source</ins></a></code>
,<code><a href="#section"><ins class=
"diff-chg">section</ins></a></code> ,<code><a href=
"#nav"><ins class="diff-chg">nav</ins></a></code> ,<code><a href=
"#article"><ins class="diff-chg">article</ins></a></code>
,<code><a href="#aside"><ins class=
"diff-chg">aside</ins></a></code> ,<code><a href=
"#header"><ins class="diff-chg">header</ins></a></code>
,<code><a href="#footer"><ins class=
"diff-chg">footer</ins></a></code> ,<code><a href=
"#datagrid0"><ins class="diff-chg">datagrid</ins></a></code>
,<code><a href="#command0"><ins class=
"diff-chg">command</ins></a></code></p>
<p><ins class="diff-chg">The</ins> <a href="#stack"><ins class=
"diff-chg">stack of open elements</ins></a> <ins class=
"diff-chg">is said to</ins> <dfn id="have-an" title=
"has an element in scope"><ins class="diff-chg">have an element in
scope</ins></dfn> <ins class="diff-chg">or</ins> <dfn id="have-an0"
title="has an element in table scope"><ins class="diff-chg">have an
element in</ins> <em><ins class="diff-chg">table
scope</ins></em></dfn> <ins class="diff-chg">when the following
algorithm terminates in a match state:</ins></p>
<ol>
<li>
<p><ins class="diff-chg">Initialise</ins> <var title=""><ins class=
"diff-chg">node</ins></var> <ins class="diff-chg">to be the</ins>
<a href="#current5"><ins class="diff-chg">current node</ins></a>
<ins class="diff-chg">(the bottommost node of the stack).</ins></p>
</li>
<li>
<p><ins class="diff-chg">If</ins> <var title=""><ins class=
"diff-chg">node</ins></var> <ins class="diff-chg">is the target
node, terminate in a match state.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Otherwise, if</ins> <var title=
""><ins class="diff-chg">node</ins></var> <ins class="diff-chg">is
a</ins> <code><a href="#table"><ins class=
"diff-chg">table</ins></a></code> <ins class="diff-chg">element,
terminate in a failure state.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Otherwise, if the algorithm is the "has an
element in scope" variant (rather than the "has an element in table
scope" variant), and</ins> <var title=""><ins class=
"diff-chg">node</ins></var> <ins class="diff-chg">is one of the
following, terminate in a failure state:</ins></p>
<ul class="brief">
<li><code><a href="#applet"><ins class=
"diff-chg">applet</ins></a></code></li>
<li><code><a href="#caption0"><ins class=
"diff-chg">caption</ins></a></code></li>
<li><code><a href="#td"><ins class=
"diff-chg">td</ins></a></code></li>
<li><code><a href="#th"><ins class=
"diff-chg">th</ins></a></code></li>
<li><code><ins class="diff-chg">button</ins></code></li>
<li><code><ins class="diff-chg">marquee</ins></code></li>
<li><code><a href="#object"><ins class=
"diff-chg">object</ins></a></code></li>
</ul>
</li>
<li>
<p><ins class="diff-chg">Otherwise, if</ins> <var title=
""><ins class="diff-chg">node</ins></var> <ins class="diff-chg">is
an</ins> <code><a href="#html"><ins class=
"diff-chg">html</ins></a></code> <ins class="diff-chg">element,
terminate in a failure state. (This can only happen if the</ins>
<var title=""><ins class="diff-chg">node</ins></var> <ins class=
"diff-chg">is the topmost node of the</ins> <a href=
"#stack"><ins class="diff-chg">stack of open elements</ins></a>
,<ins class="diff-chg">and prevents the next step from being
invoked if there are no more elements in the stack.)</ins></p>
</li>
<li>
<p><ins class="diff-chg">Otherwise, set</ins> <var title=
""><ins class="diff-chg">node</ins></var> <ins class="diff-chg">to
the previous entry in the</ins> <a href="#stack"><ins class=
"diff-chg">stack of open elements</ins></a> <ins class=
"diff-chg">and return to step 2. (This will never fail, since the
loop will always terminate in the previous step if the top of the
stack is reached.)</ins></p>
</li>
</ol>
<p><ins class="diff-chg">Nothing happens if at any time any of the
elements in the</ins> <a href="#stack"><ins class="diff-chg">stack
of open elements</ins></a> <ins class="diff-chg">are moved to a new
location in, or removed from, the</ins> <code><ins class=
"diff-chg">Document</ins></code> <ins class="diff-chg">tree. In
particular, the stack is not changed in this situation. This can
cause, amongst other strange effects,</ins> content <ins class=
"diff-new">to be appended to nodes that are no longer in the
DOM.</ins></p>
<p class="note"><ins class="diff-new">In some cases (namely,
when</ins> <a href="#adoptionAgency"><ins class="diff-new">closing
misnested formatting elements</ins></a> <ins class="diff-new">),
the stack is manipulated in a random-access fashion.</ins></p>
<h5 id="the-list"><span class="secno"><ins class=
"diff-new">8.2.3.3.</ins></span> <ins class="diff-new">The list of
active formatting elements</ins></h5>
<p><ins class="diff-new">Initially the</ins> <dfn id=
"list-of4"><ins class="diff-new">list of active formatting
elements</ins></dfn> <ins class="diff-new">is empty. It is used to
handle mis-nested</ins> <a href="#formatting" title=
"formatting"><ins class="diff-new">formatting element
tags</ins></a> .</p>
<p><ins class="diff-new">The list contains elements in the</ins>
<a href="#formatting"><ins class="diff-new">formatting</ins></a>
<ins class="diff-new">category, and scope markers. The scope
markers are inserted when entering</ins> <code><a href=
"#applet"><ins class="diff-new">applet</ins></a></code> <ins class=
"diff-new">elements, buttons,</ins> <code><a href=
"#object"><ins class="diff-new">object</ins></a></code> <ins class=
"diff-new">elements, marquees, table cells, and table captions, and
are used to prevent formatting from "leaking" into</ins>
<code><a href="#applet"><ins class=
"diff-new">applet</ins></a></code> <ins class="diff-new">elements,
buttons,</ins> <code><a href="#object"><ins class=
"diff-new">object</ins></a></code> <ins class="diff-new">elements,
marquees, and tables.</ins></p>
<p><ins class="diff-new">When the steps below require the UA
to</ins> <dfn id="reconstruct"><ins class="diff-new">reconstruct
the active formatting elements</ins></dfn> ,<ins class=
"diff-new">the UA must perform the following steps:</ins></p>
<ol>
<li><ins class="diff-new">If there are no entries in the</ins>
<a href="#list-of4"><ins class="diff-new">list of active formatting
elements</ins></a> ,<ins class="diff-new">then there is nothing to
reconstruct; stop this algorithm.</ins></li>
<li><ins class="diff-new">If the last (most recently added) entry
in the</ins> <a href="#list-of4"><ins class="diff-new">list of
active formatting elements</ins></a> <ins class="diff-new">is a
marker, or if it is an element that is in the</ins> <a href=
"#stack"><ins class="diff-new">stack of open elements</ins></a>
,<ins class="diff-new">then there is nothing to reconstruct; stop
this algorithm.</ins></li>
<li><ins class="diff-new">Let</ins> <var title=""><ins class=
"diff-new">entry</ins></var> <ins class="diff-new">be the last
(most recently added) element in the</ins> <a href=
"#list-of4"><ins class="diff-new">list of active formatting
elements</ins></a> .</li>
<li><ins class="diff-new">If there are no entries before</ins>
<var title=""><ins class="diff-new">entry</ins></var> <ins class=
"diff-new">in the</ins> <a href="#list-of4"><ins class=
"diff-new">list of active formatting elements</ins></a>
,<ins class="diff-new">then jump to step 8.</ins></li>
<li><ins class="diff-new">Let</ins> <var title=""><ins class=
"diff-new">entry</ins></var> <ins class="diff-new">be the entry one
earlier than</ins> <var title=""><ins class=
"diff-new">entry</ins></var> <ins class="diff-new">in the</ins>
<a href="#list-of4"><ins class="diff-new">list of active formatting
elements</ins></a> .</li>
<li><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">entry</ins></var> <ins class="diff-new">is neither a
marker nor an element that is also in the</ins> <a href=
"#stack"><ins class="diff-new">stack of open elements</ins></a>
,<ins class="diff-new">go to step 4.</ins></li>
<li><ins class="diff-new">Let</ins> <var title=""><ins class=
"diff-new">entry</ins></var> <ins class="diff-new">be the element
one later than</ins> <var title=""><ins class=
"diff-new">entry</ins></var> <ins class="diff-new">in the</ins>
<a href="#list-of4"><ins class="diff-new">list of active formatting
elements</ins></a> .</li>
<li><ins class="diff-new">Perform a shallow clone of the
element</ins> <var title=""><ins class="diff-new">entry</ins></var>
<ins class="diff-new">to obtain</ins> <var title=""><ins class=
"diff-new">clone</ins></var> .<a href="#references"><ins class=
"diff-new">[DOM3CORE]</ins></a></li>
<li><ins class="diff-new">Append</ins> <var title=""><ins class=
"diff-new">clone</ins></var> <ins class="diff-new">to the</ins>
<a href="#current5"><ins class="diff-new">current node</ins></a>
<ins class="diff-new">and push it onto the</ins> <a href=
"#stack"><ins class="diff-new">stack of open elements</ins></a>
<ins class="diff-new">so that it is the new</ins> <a href=
"#current5"><ins class="diff-new">current node</ins></a> .</li>
<li><ins class="diff-new">Replace the entry for</ins> <var title=
""><ins class="diff-new">entry</ins></var> <ins class="diff-new">in
the list with an entry for</ins> <var title=""><ins class=
"diff-new">clone</ins></var> .</li>
<li><ins class="diff-new">If the entry for</ins> <var title=
""><ins class="diff-new">clone</ins></var> <ins class="diff-new">in
the</ins> <a href="#list-of4"><ins class="diff-new">list of active
formatting elements</ins></a> <ins class="diff-new">is not the last
entry in the list, return to step 7.</ins></li>
</ol>
<p><ins class="diff-new">This has the effect of reopening all the
formatting elements that were opened in the current body, cell, or
caption (whichever is youngest) that haven't been explicitly
closed.</ins></p>
<p class="note"><ins class="diff-new">The way this specification is
written, the</ins> <a href="#list-of4"><ins class="diff-new">list
of active formatting elements</ins></a> <ins class=
"diff-new">always consists of elements in chronological order with
the least recently added element first and the most recently added
element last (except for while steps 8 to 11 of the above algorithm
are being executed, of course).</ins></p>
<p><ins class="diff-new">When the steps below require the UA
to</ins> <dfn id="clear1"><ins class="diff-new">clear the list of
active formatting elements up to the last marker</ins></dfn>
,<ins class="diff-new">the UA must perform the following
steps:</ins></p>
<ol>
<li><ins class="diff-new">Let</ins> <var title=""><ins class=
"diff-new">entry</ins></var> <ins class="diff-new">be the last
(most recently added) entry in the</ins> <a href=
"#list-of4"><ins class="diff-new">list of active formatting
elements</ins></a> .</li>
<li><ins class="diff-new">Remove</ins> <var title=""><ins class=
"diff-new">entry</ins></var> <ins class="diff-new">from the</ins>
<a href="#list-of4"><ins class="diff-new">list of active formatting
elements</ins></a> .</li>
<li><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">entry</ins></var> <ins class="diff-new">was a marker,
then stop the algorithm at this point. The list has been cleared up
to the last marker.</ins></li>
<li><ins class="diff-new">Go to step 1.</ins></li>
</ol>
<h5 id="the-element"><span class="secno"><ins class=
"diff-new">8.2.3.4.</ins></span> <ins class="diff-new">The element
pointers</ins></h5>
<p><ins class="diff-new">Initially the</ins> <dfn id=
"head-element"><code title=""><ins class=
"diff-new">head</ins></code> <ins class="diff-new">element
pointer</ins></dfn> <ins class="diff-new">and the</ins> <dfn id=
"form-element"><code title=""><ins class=
"diff-new">form</ins></code> <ins class="diff-new">element
pointer</ins></dfn> <ins class="diff-new">are both null.</ins></p>
<p><ins class="diff-new">Once a</ins> <code><a href=
"#head"><ins class="diff-new">head</ins></a></code> <ins class=
"diff-new">element has been parsed (whether implicitly or
explicitly) the</ins> <a href="#head-element"><code title=
""><ins class="diff-new">head</ins></code> <ins class=
"diff-new">element pointer</ins></a> <ins class="diff-new">gets set
to point to this node.</ins></p>
<p><ins class="diff-new">The</ins> <a href=
"#form-element"><code title=""><ins class=
"diff-new">form</ins></code> <ins class="diff-new">element
pointer</ins></a> <ins class="diff-new">points to the last</ins>
<code><ins class="diff-new">form</ins></code> <ins class=
"diff-new">element that was opened and whose end tag has not yet
been seen. It is used to make form controls associate with forms in
the face of dramatically bad markup, for historical
reasons.</ins></p>
<h5 id="the-scripting"><span class="secno"><ins class=
"diff-new">8.2.3.5.</ins></span> <ins class="diff-new">The
scripting state</ins></h5>
<p><ins class="diff-new">The</ins> <dfn id="scripting2"><ins class=
"diff-new">scripting flag</ins></dfn> <ins class="diff-new">is set
to "enabled" if the</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">with which
the parser is associated was</ins> <a href=
"#with-script"><ins class="diff-new">with script</ins></a>
<ins class="diff-new">when the parser was created, and "disabled"
otherwise.</ins></p>
<h4 id="tokenisation"><span class="secno"><del class=
"diff-old">8.2.3.</del> <ins class="diff-chg">8.2.4</ins></span>
<dfn id="tokenisation0">Tokenisation</dfn></h4>
<p>Implementations must act as if they used the following state
machine to tokenise HTML. The state machine must start in the
<a href="#data-state">data state</a> . Most states consume a single
character, which may have various side-effects, and either switches
the state machine to a new state to <em>reconsume</em> the same
character, or switches it to a new state (to consume the next
character), or repeats the same state (to consume the next
character). Some states have more complicated <del class=
"diff-old">behaviour</del> <ins class="diff-chg">behavior</ins> and
can consume several characters before switching to another
state.</p>
<p>The exact <del class="diff-old">behaviour</del> <ins class=
"diff-chg">behavior</ins> of certain states depends on a <dfn id=
"content2">content model flag</dfn> that is set after certain
tokens are emitted. The flag has several states: <em title=
"">PCDATA</em> , <em title="">RCDATA</em> , <em title="">CDATA</em>
, and <em title="">PLAINTEXT</em> . Initially it must be in the
PCDATA state. In the RCDATA and CDATA states, a further <dfn id=
"escape">escape flag</dfn> is used to control the <del class=
"diff-old">behaviour</del> <ins class="diff-chg">behavior</ins> of
the tokeniser. It is either true or false, and initially must be
set to the false state. <ins class="diff-new">The</ins>
<span><ins class="diff-new">insertion mode</ins></span> <ins class=
"diff-new">and the</ins> <a href="#stack"><ins class=
"diff-new">stack of open elements</ins></a> <ins class=
"diff-new">also affects tokenisation.</ins></p>
<p>The output of the tokenisation step is a series of zero or more
of the following tokens: DOCTYPE, start tag, end tag, comment,
character, end-of-file. DOCTYPE tokens have a name, a public
identifier, a system identifier, and a <del class=
"diff-old">correctness flag.</del> <i><ins class=
"diff-chg">force-quirks flag</ins></i> . When a DOCTYPE token is
created, its name, public identifier, and system identifier must be
marked as <del class="diff-old">missing,</del> <ins class=
"diff-chg">missing (which is a distinct state from the empty
string),</ins> and the <del class="diff-old">correctness</del>
<i><ins class="diff-chg">force-quirks</ins> flag</i> must be set to
<i><del class="diff-old">correct</del> <ins class=
"diff-chg">off</ins></i> (its other state is <i><del class=
"diff-old">incorrect</del> <ins class="diff-chg">on</ins></i> ).
Start and end tag tokens have a tag <del class=
"diff-old">name</del> <ins class="diff-chg">name, a</ins>
<i><ins class="diff-chg">self-closing flag</ins></i> , and a list
of attributes, each of which has a name and a value. <ins class=
"diff-new">When a start or end tag token is created, its</ins>
<i><ins class="diff-new">self-closing flag</ins></i> <ins class=
"diff-new">must be unset (its other state is that it be set), and
its attributes list must be empty.</ins> Comment and character
tokens have data.</p>
<p>When a token is emitted, it must immediately be handled by the
<a href="#tree-construction0">tree construction</a> stage. The tree
construction stage can affect the state of the <a href=
"#content2">content model flag</a> , and can insert additional
characters into the stream. (For example, the <code><a href=
"#script1">script</a></code> element can result in scripts
executing and using the <a href="#dynamic2">dynamic markup
insertion</a> APIs to insert characters into the stream being
tokenised.)</p>
<p>When <ins class="diff-new">a start tag token is emitted with
its</ins> <i><ins class="diff-new">self-closing flag</ins></i>
<ins class="diff-new">set, if the flag is not</ins> <dfn id=
"acknowledged" title="acknowledge self-closing flag"><ins class=
"diff-new">acknowledged</ins></dfn> <ins class="diff-new">when it
is processed by the tree construction stage, that is a</ins>
<a href="#parse1"><ins class="diff-new">parse error</ins></a> .</p>
<p><ins class="diff-new">When</ins> an end tag token is emitted,
the <a href="#content2">content model flag</a> must be switched to
the PCDATA state.</p>
<p>When an end tag token is emitted with attributes, that is a
<a href="#parse1">parse error</a> .</p>
<p><del class="diff-old">A permitted slash</del> <ins class=
"diff-chg">When an end tag token</ins> is <del class="diff-old">a
U+002F SOLIDUS character</del> <ins class="diff-chg">emitted with
its</ins> <i><ins class="diff-chg">self-closing flag</ins></i>
<ins class="diff-chg">set,</ins> that is <del class=
"diff-old">immediately followed by</del> a <del class=
"diff-old">U+003E GREATER-THAN SIGN, if, and only if, the current
token being processed is a start tag token whose tag name is one of
the following: base , link , meta , hr , br , img , embed , param ,
area , col , input</del> <a href="#parse1"><ins class=
"diff-chg">parse error</ins></a> .</p>
<p>Before each step of the tokeniser, the user agent may check to
see if either one of the scripts in the <a href="#list-of1">list of
scripts that will execute as soon as possible</a> or the first
script in the <a href="#list-of0">list of scripts that will execute
asynchronously</a> , has <span>completed loading</span> . If one
has, then it must be <a href="#executing0" title=
"executing a script block">executed</a> and removed from its
list.</p>
<p>The tokeniser state machine is as follows:</p>
<dl>
<dt><dfn id="data-state">Data state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0026 AMPERSAND (&)</dt>
<dd>When the <a href="#content2">content model flag</a> is set to
one of the PCDATA or RCDATA <del class="diff-old">states:</del>
<ins class="diff-chg">states and the</ins> <a href=
"#escape"><ins class="diff-chg">escape flag</ins></a> <ins class=
"diff-chg">is false:</ins> switch to the <del class=
"diff-old">entity</del> <a href="#character4"><ins class=
"diff-chg">character reference</ins> data state</a> .</dd>
<dd>Otherwise: treat it as per the "anything else" entry
below.</dd>
<dt>U+002D HYPHEN-MINUS (-)</dt>
<dd>
<p>If the <a href="#content2">content model flag</a> is set to
either the RCDATA state or the CDATA state, and the <a href=
"#escape">escape flag</a> is false, and there are at least three
characters before this one in the input stream, and the last four
characters in the input stream, including this one, are U+003C
LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, and
U+002D HYPHEN-MINUS ("<!--"), then set the <a href=
"#escape">escape flag</a> to true.</p>
<p>In any case, emit the input character as a character token. Stay
in the <a href="#data-state">data state</a> .</p>
</dd>
<dt>U+003C LESS-THAN SIGN (<)</dt>
<dd>When the <a href="#content2">content model flag</a> is set to
the PCDATA state: switch to the <a href="#tag-open">tag open
state</a> .</dd>
<dd>When the <a href="#content2">content model flag</a> is set to
either the RCDATA state or the CDATA state and the <a href=
"#escape">escape flag</a> is false: switch to the <a href=
"#tag-open">tag open state</a> .</dd>
<dd>Otherwise: treat it as per the "anything else" entry
below.</dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd>
<p>If the <a href="#content2">content model flag</a> is set to
either the RCDATA state or the CDATA state, and the <a href=
"#escape">escape flag</a> is true, and the last three characters in
the input stream including this one are U+002D HYPHEN-MINUS, U+002D
HYPHEN-MINUS, U+003E GREATER-THAN SIGN ("-->"), set the <a href=
"#escape">escape flag</a> to false.</p>
<p>In any case, emit the input character as a character token. Stay
in the <a href="#data-state">data state</a> .</p>
</dd>
<dt>EOF</dt>
<dd>Emit an end-of-file token.</dd>
<dt>Anything else</dt>
<dd>Emit the input character as a character token. Stay in the
<a href="#data-state">data state</a> .</dd>
</dl>
</dd>
<dt><del class="diff-old">Entity</del> <dfn id=
"character4"><ins class="diff-chg">Character reference</ins> data
state</dfn></dt>
<dd>
<p><em>(This cannot happen if the <a href="#content2">content model
flag</a> is set to the CDATA state.)</em></p>
<p>Attempt to <a href="#consume">consume <del class="diff-old">an
entity</del> <ins class="diff-chg">a character reference</ins></a>
,<ins class="diff-chg">with no</ins> <a href=
"#additional"><ins class="diff-chg">additional allowed
character</ins></a> .</p>
<p>If nothing is returned, emit a U+0026 AMPERSAND character
token.</p>
<p>Otherwise, emit the character token that was returned.</p>
<p>Finally, switch to the <a href="#data-state">data state</a>
.</p>
</dd>
<dt><dfn id="tag-open">Tag open state</dfn></dt>
<dd>
<p>The <del class="diff-old">behaviour</del> <ins class=
"diff-chg">behavior</ins> of this state depends on the <a href=
"#content2">content model flag</a> .</p>
<dl>
<dt>If the <a href="#content2">content model flag</a> is set to the
RCDATA or CDATA states</dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> . If
it is a U+002F SOLIDUS (/) character, switch to the <a href=
"#close1">close tag open state</a> . Otherwise, emit a U+003C
LESS-THAN SIGN character token and reconsume the current input
character in the <a href="#data-state">data state</a> .</p>
</dd>
<dt>If the <a href="#content2">content model flag</a> is set to the
PCDATA state</dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0021 EXCLAMATION MARK (!)</dt>
<dd>Switch to the <a href="#markup">markup declaration open
state</a> .</dd>
<dt>U+002F SOLIDUS (/)</dt>
<dd>Switch to the <a href="#close1">close tag open state</a> .</dd>
<dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL
LETTER Z</dt>
<dd>Create a new start tag token, set its tag name to the lowercase
version of the input character (add 0x0020 to the character's code
point), then switch to the <a href="#tag-name0">tag name state</a>
. (Don't emit the token yet; further details will be filled in
before it is emitted.)</dd>
<dt>U+0061 LATIN SMALL LETTER A through to U+007A LATIN SMALL
LETTER Z</dt>
<dd>Create a new start tag token, set its tag name to the input
character, then switch to the <a href="#tag-name0">tag name
state</a> . (Don't emit the token yet; further details will be
filled in before it is emitted.)</dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd><a href="#parse1">Parse error</a> . Emit a U+003C LESS-THAN
SIGN character token and a U+003E GREATER-THAN SIGN character
token. Switch to the <a href="#data-state">data state</a> .</dd>
<dt>U+003F QUESTION MARK (?)</dt>
<dd><a href="#parse1">Parse error</a> . Switch to the <a href=
"#bogus">bogus comment state</a> .</dd>
<dt>Anything else</dt>
<dd><a href="#parse1">Parse error</a> . Emit a U+003C LESS-THAN
SIGN character token and reconsume the current input character in
the <a href="#data-state">data state</a> .</dd>
</dl>
</dd>
</dl>
</dd>
<dt><dfn id="close1">Close tag open state</dfn></dt>
<dd>
<p>If the <a href="#content2">content model flag</a> is set to the
RCDATA or CDATA states but no start tag token has ever been emitted
by this instance of the tokeniser ( <a href="#fragment">fragment
case</a> ), or, if the <a href="#content2">content model flag</a>
is set to the RCDATA or CDATA states and the next few characters do
not match the tag name of the last start tag token emitted (case
insensitively), or if they do but they are not immediately followed
by one of the following characters:</p>
<ul class="brief">
<li>U+0009 CHARACTER TABULATION</li>
<li>U+000A LINE FEED (LF)</li>
<li>U+000B LINE TABULATION</li>
<li>U+000C FORM FEED (FF)</li>
<li>U+0020 SPACE</li>
<li>U+003E GREATER-THAN SIGN (>)</li>
<li>U+002F SOLIDUS (/)</li>
<li>EOF</li>
</ul>
<p>...then emit a U+003C LESS-THAN SIGN character token, a U+002F
SOLIDUS character token, and switch to the <a href=
"#data-state">data state</a> to process the <a href=
"#next-input">next input character</a> .</p>
<p>Otherwise, if the <a href="#content2">content model flag</a> is
set to the PCDATA state, or if the next few characters <em>do</em>
match that tag name, consume the <a href="#next-input">next input
character</a> :</p>
<dl class="switch">
<dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL
LETTER Z</dt>
<dd>Create a new end tag token, set its tag name to the lowercase
version of the input character (add 0x0020 to the character's code
point), then switch to the <a href="#tag-name0">tag name state</a>
. (Don't emit the token yet; further details will be filled in
before it is emitted.)</dd>
<dt>U+0061 LATIN SMALL LETTER A through to U+007A LATIN SMALL
LETTER Z</dt>
<dd>Create a new end tag token, set its tag name to the input
character, then switch to the <a href="#tag-name0">tag name
state</a> . (Don't emit the token yet; further details will be
filled in before it is emitted.)</dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd><a href="#parse1">Parse error</a> . Switch to the <a href=
"#data-state">data state</a> .</dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Emit a U+003C LESS-THAN
SIGN character token and a U+002F SOLIDUS character token.
Reconsume the EOF character in the <a href="#data-state">data
state</a> .</dd>
<dt>Anything else</dt>
<dd><a href="#parse1">Parse error</a> . Switch to the <a href=
"#bogus">bogus comment state</a> .</dd>
</dl>
</dd>
<dt><dfn id="tag-name0">Tag name state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0009 CHARACTER TABULATION</dt>
<dt>U+000A LINE FEED (LF)</dt>
<dt>U+000B LINE TABULATION</dt>
<dt>U+000C FORM FEED (FF)</dt>
<dt>U+0020 SPACE</dt>
<dd>Switch to the <a href="#before">before attribute name state</a>
.</dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd>Emit the current tag token. Switch to the <a href=
"#data-state">data state</a> .</dd>
<dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL
LETTER Z</dt>
<dd>Append the lowercase version of the current input character
(add 0x0020 to the character's code point) to the current tag
token's tag name. Stay in the <a href="#tag-name0">tag name
state</a> .</dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Emit the current tag token.
Reconsume the EOF character in the <a href="#data-state">data
state</a> .</dd>
<dt>U+002F SOLIDUS (/)</dt>
<dd><del class="diff-old">Parse error unless this is a permitted
slash .</del> Switch to the <del class="diff-old">before attribute
name</del> <a href="#self-closing"><ins class=
"diff-chg">self-closing start tag</ins> state</a> .</dd>
<dt>Anything else</dt>
<dd>Append the current input character to the current tag token's
tag name. Stay in the <a href="#tag-name0">tag name state</a>
.</dd>
</dl>
</dd>
<dt><dfn id="before">Before attribute name state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0009 CHARACTER TABULATION</dt>
<dt>U+000A LINE FEED (LF)</dt>
<dt>U+000B LINE TABULATION</dt>
<dt>U+000C FORM FEED (FF)</dt>
<dt>U+0020 SPACE</dt>
<dd>Stay in the <a href="#before">before attribute name state</a>
.</dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd>Emit the current tag token. Switch to the <a href=
"#data-state">data state</a> .</dd>
<dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL
LETTER Z</dt>
<dd>Start a new attribute in the current tag token. Set that
attribute's name to the lowercase version of the current input
character (add 0x0020 to the character's code point), and its value
to the empty string. Switch to the <a href="#attribute1">attribute
name state</a> .</dd>
<dt>U+002F SOLIDUS (/)</dt>
<dd><ins class="diff-new">Switch to the</ins> <a href=
"#self-closing"><ins class="diff-new">self-closing start tag
state</ins></a> .</dd>
<dt><ins class="diff-new">U+0022 QUOTATION MARK (")</ins></dt>
<dt><ins class="diff-new">U+0027 APOSTROPHE (')</ins></dt>
<dt><ins class="diff-new">U+003D EQUALS SIGN (=)</ins></dt>
<dd><a href="#parse1">Parse error <del class="diff-old">unless this
is a permitted slash</del></a> . <del class="diff-old">Stay
in</del> <ins class="diff-chg">Treat it as per</ins> the
<del class="diff-old">before attribute name state .</del>
<ins class="diff-chg">"anything else" entry below.</ins></dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Emit the current tag token.
Reconsume the EOF character in the <a href="#data-state">data
state</a> .</dd>
<dt>Anything else</dt>
<dd>Start a new attribute in the current tag token. Set that
attribute's name to the current input character, and its value to
the empty string. Switch to the <a href="#attribute1">attribute
name state</a> .</dd>
</dl>
</dd>
<dt><dfn id="attribute1">Attribute name state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0009 CHARACTER TABULATION</dt>
<dt>U+000A LINE FEED (LF)</dt>
<dt>U+000B LINE TABULATION</dt>
<dt>U+000C FORM FEED (FF)</dt>
<dt>U+0020 SPACE</dt>
<dd>Switch to the <a href="#after">after attribute name state</a>
.</dd>
<dt>U+003D EQUALS SIGN (=)</dt>
<dd>Switch to the <a href="#before0">before attribute value
state</a> .</dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd>Emit the current tag token. Switch to the <a href=
"#data-state">data state</a> .</dd>
<dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL
LETTER Z</dt>
<dd>Append the lowercase version of the current input character
(add 0x0020 to the character's code point) to the current
attribute's name. Stay in the <a href="#attribute1">attribute name
state</a> .</dd>
<dt>U+002F SOLIDUS (/)</dt>
<dd><del class="diff-old">Parse error unless this is a permitted
slash .</del> Switch to the <del class="diff-old">before attribute
name</del> <a href="#self-closing"><ins class=
"diff-chg">self-closing start tag</ins> state</a> .</dd>
<dt><ins class="diff-new">U+0022 QUOTATION MARK (")</ins></dt>
<dt><ins class="diff-new">U+0027 APOSTROPHE (')</ins></dt>
<dd><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Treat it as per the "anything else" entry
below.</ins></dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Emit the current tag token.
Reconsume the EOF character in the <a href="#data-state">data
state</a> .</dd>
<dt>Anything else</dt>
<dd>Append the current input character to the current attribute's
name. Stay in the <a href="#attribute1">attribute name state</a>
.</dd>
</dl>
<p>When the user agent leaves the attribute name state (and before
emitting the tag token, if appropriate), the complete attribute's
name must be compared to the other attributes on the same token; if
there is already an attribute on the token with the exact same
name, then this is a <a href="#parse1">parse error</a> and the new
attribute must be dropped, along with the value that gets
associated with it (if any).</p>
</dd>
<dt><dfn id="after">After attribute name state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0009 CHARACTER TABULATION</dt>
<dt>U+000A LINE FEED (LF)</dt>
<dt>U+000B LINE TABULATION</dt>
<dt>U+000C FORM FEED (FF)</dt>
<dt>U+0020 SPACE</dt>
<dd>Stay in the <a href="#after">after attribute name state</a>
.</dd>
<dt>U+003D EQUALS SIGN (=)</dt>
<dd>Switch to the <a href="#before0">before attribute value
state</a> .</dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd>Emit the current tag token. Switch to the <a href=
"#data-state">data state</a> .</dd>
<dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL
LETTER Z</dt>
<dd>Start a new attribute in the current tag token. Set that
attribute's name to the lowercase version of the current input
character (add 0x0020 to the character's code point), and its value
to the empty string. Switch to the <a href="#attribute1">attribute
name state</a> .</dd>
<dt>U+002F SOLIDUS (/)</dt>
<dd><del class="diff-old">Parse error unless this is a permitted
slash .</del> Switch to the <del class="diff-old">before attribute
name</del> <a href="#self-closing"><ins class=
"diff-chg">self-closing start tag</ins> state</a> .</dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Emit the current tag token.
Reconsume the EOF character in the <a href="#data-state">data
state</a> .</dd>
<dt>Anything else</dt>
<dd>Start a new attribute in the current tag token. Set that
attribute's name to the current input character, and its value to
the empty string. Switch to the <a href="#attribute1">attribute
name state</a> .</dd>
</dl>
</dd>
<dt><dfn id="before0">Before attribute value state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0009 CHARACTER TABULATION</dt>
<dt>U+000A LINE FEED (LF)</dt>
<dt>U+000B LINE TABULATION</dt>
<dt>U+000C FORM FEED (FF)</dt>
<dt>U+0020 SPACE</dt>
<dd>Stay in the <a href="#before0">before attribute value state</a>
.</dd>
<dt>U+0022 QUOTATION MARK (")</dt>
<dd>Switch to the <a href="#attribute2">attribute value
(double-quoted) state</a> .</dd>
<dt>U+0026 AMPERSAND (&)</dt>
<dd>Switch to the <a href="#attribute4">attribute value (unquoted)
state</a> and reconsume this input character.</dd>
<dt>U+0027 APOSTROPHE (')</dt>
<dd>Switch to the <a href="#attribute3">attribute value
(single-quoted) state</a> .</dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd>Emit the current tag token. Switch to the <a href=
"#data-state">data state</a> .</dd>
<dt><ins class="diff-new">U+003D EQUALS SIGN (=)</ins></dt>
<dd><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Treat it as per the "anything else" entry
below.</ins></dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Emit the current tag token.
Reconsume the character in the <a href="#data-state">data state</a>
.</dd>
<dt>Anything else</dt>
<dd>Append the current input character to the current attribute's
value. Switch to the <a href="#attribute4">attribute value
(unquoted) state</a> .</dd>
</dl>
</dd>
<dt><dfn id="attribute2">Attribute value (double-quoted)
state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0022 QUOTATION MARK (")</dt>
<dd>Switch to the <del class="diff-old">before</del> <a href=
"#after0"><ins class="diff-chg">after</ins> attribute <del class=
"diff-old">name</del> <ins class="diff-chg">value (quoted)</ins>
state</a> .</dd>
<dt>U+0026 AMPERSAND (&)</dt>
<dd>Switch to the <del class="diff-old">entity</del> <a href=
"#character5"><ins class="diff-chg">character reference</ins> in
attribute value state <del class="diff-old">.</del></a> ,
<ins class="diff-chg">with the</ins> <a href=
"#additional"><ins class="diff-chg">additional allowed
character</ins></a> <ins class="diff-chg">being U+0022 QUOTATION
MARK (").</ins></dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Emit the current tag token.
Reconsume the character in the <a href="#data-state">data state</a>
.</dd>
<dt>Anything else</dt>
<dd>Append the current input character to the current attribute's
value. Stay in the <a href="#attribute2">attribute value
(double-quoted) state</a> .</dd>
</dl>
</dd>
<dt><dfn id="attribute3">Attribute value (single-quoted)
state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0027 APOSTROPHE (')</dt>
<dd>Switch to the <del class="diff-old">before</del> <a href=
"#after0"><ins class="diff-chg">after</ins> attribute <del class=
"diff-old">name</del> <ins class="diff-chg">value (quoted)</ins>
state</a> .</dd>
<dt>U+0026 AMPERSAND (&)</dt>
<dd>Switch to the <del class="diff-old">entity</del> <a href=
"#character5"><ins class="diff-chg">character reference</ins> in
attribute value state <del class="diff-old">.</del></a> ,
<ins class="diff-chg">with the</ins> <a href=
"#additional"><ins class="diff-chg">additional allowed
character</ins></a> <ins class="diff-chg">being U+0027 APOSTROPHE
(').</ins></dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Emit the current tag token.
Reconsume the character in the <a href="#data-state">data state</a>
.</dd>
<dt>Anything else</dt>
<dd>Append the current input character to the current attribute's
value. Stay in the <a href="#attribute3">attribute value
(single-quoted) state</a> .</dd>
</dl>
</dd>
<dt><dfn id="attribute4">Attribute value (unquoted)
state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0009 CHARACTER TABULATION</dt>
<dt>U+000A LINE FEED (LF)</dt>
<dt>U+000B LINE TABULATION</dt>
<dt>U+000C FORM FEED (FF)</dt>
<dt>U+0020 SPACE</dt>
<dd>Switch to the <a href="#before">before attribute name state</a>
.</dd>
<dt>U+0026 AMPERSAND (&)</dt>
<dd>Switch to the <del class="diff-old">entity</del> <a href=
"#character5"><ins class="diff-chg">character reference</ins> in
attribute value state</a> , <ins class="diff-new">with no</ins>
<a href="#additional"><ins class="diff-new">additional allowed
character</ins></a> .</dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd>Emit the current tag token. Switch to the <a href=
"#data-state">data state</a> .</dd>
<dt><ins class="diff-new">U+0022 QUOTATION MARK (")</ins></dt>
<dt><ins class="diff-new">U+0027 APOSTROPHE (')</ins></dt>
<dt><ins class="diff-new">U+003D EQUALS SIGN (=)</ins></dt>
<dd><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Treat it as per the "anything else" entry
below.</ins></dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Emit the current tag token.
Reconsume the character in the <a href="#data-state">data state</a>
.</dd>
<dt>Anything else</dt>
<dd>Append the current input character to the current attribute's
value. Stay in the <a href="#attribute4">attribute value (unquoted)
state</a> .</dd>
</dl>
</dd>
<dt><del class="diff-old">Entity</del> <dfn id=
"character5"><ins class="diff-chg">Character reference</ins> in
attribute value state</dfn></dt>
<dd>
<p>Attempt to <a href="#consume">consume <del class="diff-old">an
entity</del> <ins class="diff-chg">a character reference</ins></a>
.</p>
<p>If nothing is returned, append a U+0026 AMPERSAND character to
the current attribute's value.</p>
<p>Otherwise, append the returned character token to the current
attribute's value.</p>
<p>Finally, switch back to the attribute value state that you were
in when were switched into this state.</p>
</dd>
<dt><dfn id="after0"><ins class="diff-new">After attribute value
(quoted) state</ins></dfn></dt>
<dd>
<p><ins class="diff-new">Consume the</ins> <a href=
"#next-input"><ins class="diff-new">next input character</ins></a>
:</p>
<dl class="switch">
<dt><ins class="diff-new">U+0009 CHARACTER TABULATION</ins></dt>
<dt><ins class="diff-new">U+000A LINE FEED (LF)</ins></dt>
<dt><ins class="diff-new">U+000B LINE TABULATION</ins></dt>
<dt><ins class="diff-new">U+000C FORM FEED (FF)</ins></dt>
<dt><ins class="diff-new">U+0020 SPACE</ins></dt>
<dd><ins class="diff-new">Switch to the</ins> <a href=
"#before"><ins class="diff-new">before attribute name
state</ins></a> .</dd>
<dt><ins class="diff-new">U+003E GREATER-THAN SIGN
(>)</ins></dt>
<dd><ins class="diff-new">Emit the current tag token. Switch to
the</ins> <a href="#data-state"><ins class="diff-new">data
state</ins></a> .</dd>
<dt><ins class="diff-new">U+002F SOLIDUS (/)</ins></dt>
<dd><ins class="diff-new">Switch to the</ins> <a href=
"#self-closing"><ins class="diff-new">self-closing start tag
state</ins></a> .</dd>
<dt><ins class="diff-new">EOF</ins></dt>
<dd><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Emit the current tag token. Reconsume the
EOF character in the</ins> <a href="#data-state"><ins class=
"diff-new">data state</ins></a> .</dd>
<dt><ins class="diff-new">Anything else</ins></dt>
<dd><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Reconsume the character in the</ins>
<a href="#before"><ins class="diff-new">before attribute name
state</ins></a> .</dd>
</dl>
</dd>
<dt><dfn id="self-closing"><ins class="diff-new">Self-closing start
tag state</ins></dfn></dt>
<dd>
<p><ins class="diff-new">Consume the</ins> <a href=
"#next-input"><ins class="diff-new">next input character</ins></a>
:</p>
<dl class="switch">
<dt><ins class="diff-new">U+003E GREATER-THAN SIGN
(>)</ins></dt>
<dd><ins class="diff-new">Set the</ins> <i><ins class=
"diff-new">self-closing flag</ins></i> <ins class="diff-new">of the
current tag token. Emit the current tag token. Switch to the</ins>
<a href="#data-state"><ins class="diff-new">data state</ins></a>
.</dd>
<dt><ins class="diff-new">EOF</ins></dt>
<dd><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Emit the current tag token. Reconsume the
EOF character in the</ins> <a href="#data-state"><ins class=
"diff-new">data state</ins></a> .</dd>
<dt><ins class="diff-new">Anything else</ins></dt>
<dd><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Reconsume the character in the</ins>
<a href="#before"><ins class="diff-new">before attribute name
state</ins></a> .</dd>
</dl>
</dd>
<dt><dfn id="bogus">Bogus comment state</dfn></dt>
<dd>
<p><em>(This can only happen if the <a href="#content2">content
model flag</a> is set to the PCDATA state.)</em></p>
<p>Consume every character up to the first U+003E GREATER-THAN SIGN
character (>) or the end of the file (EOF), whichever comes
first. Emit a comment token whose data is the concatenation of all
the characters starting from and including the character that
caused the state machine to switch into the bogus comment state, up
to and including the last consumed character before the U+003E
character, if any, or up to the end of the file otherwise. (If the
comment was started by the end of the file (EOF), the token is
empty.)</p>
<p>Switch to the <a href="#data-state">data state</a> .</p>
<p>If the end of the file was reached, reconsume the EOF
character.</p>
</dd>
<dt><dfn id="markup">Markup declaration open state</dfn></dt>
<dd>
<p><em>(This can only happen if the <a href="#content2">content
model flag</a> is set to the PCDATA state.)</em></p>
<p>If the next two characters are both U+002D HYPHEN-MINUS (-)
characters, consume those two characters, create a comment token
whose data is the empty string, and switch to the <a href=
"#comment0">comment start state</a> .</p>
<p><del class="diff-old">Otherwise</del> <ins class=
"diff-chg">Otherwise,</ins> if the next seven characters are a
<span>case-insensitive</span> match for the word "DOCTYPE", then
consume those characters and switch to the <a href=
"#doctype0">DOCTYPE state</a> .</p>
<p>Otherwise, <ins class="diff-new">if the</ins> <span><ins class=
"diff-new">insertion mode</ins></span> is <ins class=
"diff-new">"</ins> <a href="#in-foreign" title=
"insertion mode: in foreign content"><ins class="diff-new">in
foreign content</ins></a> <ins class="diff-new">" and the</ins>
<a href="#current5"><ins class="diff-new">current node</ins></a> is
<ins class="diff-new">not an element in the</ins> <a href=
"#html-namespace0"><ins class="diff-new">HTML namespace</ins></a>
<ins class="diff-new">and the next seven characters are</ins> a
<span><ins class="diff-chg">case-sensitive</ins></span> <ins class=
"diff-chg">match for the string "[CDATA[" (the five uppercase
letters "CDATA" with a U+005B LEFT SQUARE BRACKET character before
and after), then consume those characters and switch to the</ins>
<a href="#cdata1"><ins class="diff-chg">CDATA block state</ins></a>
<ins class="diff-chg">(which is unrelated to the</ins> <a href=
"#content2"><ins class="diff-chg">content model flag</ins></a>
<ins class="diff-chg">'s CDATA state).</ins></p>
<p><ins class="diff-chg">Otherwise, this is a</ins> <a href=
"#parse1">parse error</a> . Switch to the <a href="#bogus">bogus
comment state</a> . The next character that is consumed, if any, is
the first character that will be in the comment.</p>
</dd>
<dt><dfn id="comment0">Comment start state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+002D HYPHEN-MINUS (-)</dt>
<dd>Switch to the <a href="#comment1">comment start dash state</a>
.</dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd><a href="#parse1">Parse error</a> . Emit the comment token.
Switch to the <a href="#data-state">data state</a> .</dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Emit the comment token.
Reconsume the EOF character in the <a href="#data-state">data
state</a> .</dd>
<dt>Anything else</dt>
<dd>Append the input character to the comment token's data. Switch
to the <a href="#comment">comment state</a> .</dd>
</dl>
</dd>
<dt><dfn id="comment1">Comment start dash state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+002D HYPHEN-MINUS (-)</dt>
<dd>Switch to the <a href="#comment3">comment end state</a></dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd><a href="#parse1">Parse error</a> . Emit the comment token.
Switch to the <a href="#data-state">data state</a> .</dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Emit the comment token.
Reconsume the EOF character in the <a href="#data-state">data
state</a> .</dd>
<dt>Anything else</dt>
<dd>Append a U+002D HYPHEN-MINUS (-) character and the input
character to the comment token's data. Switch to the <a href=
"#comment">comment state</a> .</dd>
</dl>
</dd>
<dt><dfn id="comment">Comment state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+002D HYPHEN-MINUS (-)</dt>
<dd>Switch to the <a href="#comment2">comment end dash
state</a></dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Emit the comment token.
Reconsume the EOF character in the <a href="#data-state">data
state</a> .</dd>
<dt>Anything else</dt>
<dd>Append the input character to the comment token's data. Stay in
the <a href="#comment">comment state</a> .</dd>
</dl>
</dd>
<dt><dfn id="comment2">Comment end dash state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+002D HYPHEN-MINUS (-)</dt>
<dd>Switch to the <a href="#comment3">comment end state</a></dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Emit the comment token.
Reconsume the EOF character in the <a href="#data-state">data
state</a> .</dd>
<dt>Anything else</dt>
<dd>Append a U+002D HYPHEN-MINUS (-) character and the input
character to the comment token's data. Switch to the <a href=
"#comment">comment state</a> .</dd>
</dl>
</dd>
<dt><dfn id="comment3">Comment end state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd>Emit the comment token. Switch to the <a href=
"#data-state">data state</a> .</dd>
<dt>U+002D HYPHEN-MINUS (-)</dt>
<dd><a href="#parse1">Parse error</a> . Append a U+002D
HYPHEN-MINUS (-) character to the comment token's data. Stay in the
<a href="#comment3">comment end state</a> .</dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Emit the comment token.
Reconsume the EOF character in the <a href="#data-state">data
state</a> .</dd>
<dt>Anything else</dt>
<dd><a href="#parse1">Parse error</a> . Append two U+002D
HYPHEN-MINUS (-) characters and the input character to the comment
token's data. Switch to the <a href="#comment">comment state</a>
.</dd>
</dl>
</dd>
<dt><dfn id="doctype0">DOCTYPE state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0009 CHARACTER TABULATION</dt>
<dt>U+000A LINE FEED (LF)</dt>
<dt>U+000B LINE TABULATION</dt>
<dt>U+000C FORM FEED (FF)</dt>
<dt>U+0020 SPACE</dt>
<dd>Switch to the <a href="#before1">before DOCTYPE name state</a>
.</dd>
<dt>Anything else</dt>
<dd><a href="#parse1">Parse error</a> . Reconsume the current
character in the <a href="#before1">before DOCTYPE name state</a>
.</dd>
</dl>
</dd>
<dt><dfn id="before1">Before DOCTYPE name state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0009 CHARACTER TABULATION</dt>
<dt>U+000A LINE FEED (LF)</dt>
<dt>U+000B LINE TABULATION</dt>
<dt>U+000C FORM FEED (FF)</dt>
<dt>U+0020 SPACE</dt>
<dd>Stay in the <a href="#before1">before DOCTYPE name state</a>
.</dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd><a href="#parse1">Parse error</a> . Create a new DOCTYPE token.
Set its <del class="diff-old">correctness</del> <i><ins class=
"diff-chg">force-quirks</ins> flag</i> to <i><del class=
"diff-old">incorrect</del> <ins class="diff-chg">on</ins></i> .
Emit the token. Switch to the <a href="#data-state">data state</a>
.</dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Create a new DOCTYPE token.
Set its <del class="diff-old">correctness</del> <i><ins class=
"diff-chg">force-quirks</ins> flag</i> to <i><del class=
"diff-old">incorrect</del> <ins class="diff-chg">on</ins></i> .
Emit the token. Reconsume the EOF character in the <a href=
"#data-state">data state</a> .</dd>
<dt>Anything else</dt>
<dd>Create a new DOCTYPE token. Set the token's name <del class=
"diff-old">name</del> to the current input character. Switch to the
<a href="#doctype1">DOCTYPE name state</a> .</dd>
</dl>
</dd>
<dt><dfn id="doctype1">DOCTYPE name state</dfn></dt>
<dd>
<p>First, consume the <a href="#next-input">next input
character</a> :</p>
<dl class="switch">
<dt>U+0009 CHARACTER TABULATION</dt>
<dt>U+000A LINE FEED (LF)</dt>
<dt>U+000B LINE TABULATION</dt>
<dt>U+000C FORM FEED (FF)</dt>
<dt>U+0020 SPACE</dt>
<dd>Switch to the <a href="#after1">after DOCTYPE name state</a>
.</dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd>Emit the current DOCTYPE token. Switch to the <a href=
"#data-state">data state</a> .</dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Set the DOCTYPE token's
<del class="diff-old">correctness</del> <i><ins class=
"diff-chg">force-quirks</ins> flag</i> to <i><del class=
"diff-old">incorrect</del> <ins class="diff-chg">on</ins></i> .
Emit that DOCTYPE token. Reconsume the EOF character in the
<a href="#data-state">data state</a> .</dd>
<dt>Anything else</dt>
<dd>Append the current input character to the current DOCTYPE
token's name. Stay in the <a href="#doctype1">DOCTYPE name
state</a> .</dd>
</dl>
</dd>
<dt><dfn id="after1">After DOCTYPE name state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0009 CHARACTER TABULATION</dt>
<dt>U+000A LINE FEED (LF)</dt>
<dt>U+000B LINE TABULATION</dt>
<dt>U+000C FORM FEED (FF)</dt>
<dt>U+0020 SPACE</dt>
<dd>Stay in the <a href="#after1">after DOCTYPE name state</a>
.</dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd>Emit the current DOCTYPE token. Switch to the <a href=
"#data-state">data state</a> .</dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Set the DOCTYPE token's
<del class="diff-old">correctness</del> <i><ins class=
"diff-chg">force-quirks</ins> flag</i> to <i><del class=
"diff-old">incorrect</del> <ins class="diff-chg">on</ins></i> .
Emit that DOCTYPE token. Reconsume the EOF character in the
<a href="#data-state">data state</a> .</dd>
<dt>Anything else</dt>
<dd>
<p>If the next six characters are a <span>case-insensitive</span>
match for the word "PUBLIC", then consume those characters and
switch to the <a href="#before2">before DOCTYPE public identifier
state</a> .</p>
<p>Otherwise, if the next six characters are a
<span>case-insensitive</span> match for the word "SYSTEM", then
consume those characters and switch to the <a href=
"#before3">before DOCTYPE system identifier state</a> .</p>
<p>Otherwise, this is the <a href="#parse1">parse error</a> .
<ins class="diff-new">Set the DOCTYPE token's</ins> <i><ins class=
"diff-new">force-quirks flag</ins></i> <ins class=
"diff-new">to</ins> <i><ins class="diff-new">on</ins></i> . Switch
to the <a href="#bogus0">bogus DOCTYPE state</a> .</p>
</dd>
</dl>
</dd>
<dt><dfn id="before2">Before DOCTYPE public identifier
state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0009 CHARACTER TABULATION</dt>
<dt>U+000A LINE FEED (LF)</dt>
<dt>U+000B LINE TABULATION</dt>
<dt>U+000C FORM FEED (FF)</dt>
<dt>U+0020 SPACE</dt>
<dd>Stay in the <a href="#before2">before DOCTYPE public identifier
state</a> .</dd>
<dt>U+0022 QUOTATION MARK (")</dt>
<dd>Set the DOCTYPE token's public identifier to the empty
<del class="diff-old">string,</del> <ins class="diff-chg">string
(not missing),</ins> then switch to the <a href="#doctype2">DOCTYPE
public identifier (double-quoted) state</a> .</dd>
<dt>U+0027 APOSTROPHE (')</dt>
<dd>Set the DOCTYPE token's public identifier to the empty
<del class="diff-old">string,</del> <ins class="diff-chg">string
(not missing),</ins> then switch to the <a href="#doctype3">DOCTYPE
public identifier (single-quoted) state</a> .</dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd><a href="#parse1">Parse error</a> . Set the DOCTYPE token's
<del class="diff-old">correctness</del> <i><ins class=
"diff-chg">force-quirks</ins> flag</i> to <i><del class=
"diff-old">incorrect</del> <ins class="diff-chg">on</ins></i> .
Emit that DOCTYPE token. Switch to the <a href="#data-state">data
state</a> .</dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Set the DOCTYPE token's
<del class="diff-old">correctness</del> <i><ins class=
"diff-chg">force-quirks</ins> flag</i> to <i><del class=
"diff-old">incorrect</del> <ins class="diff-chg">on</ins></i> .
Emit that DOCTYPE token. Reconsume the EOF character in the
<a href="#data-state">data state</a> .</dd>
<dt>Anything else</dt>
<dd><a href="#parse1">Parse error</a> . <ins class="diff-new">Set
the DOCTYPE token's</ins> <i><ins class="diff-new">force-quirks
flag</ins></i> <ins class="diff-new">to</ins> <i><ins class=
"diff-new">on</ins></i> . Switch to the <a href="#bogus0">bogus
DOCTYPE state</a> .</dd>
</dl>
</dd>
<dt><dfn id="doctype2">DOCTYPE public identifier (double-quoted)
state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0022 QUOTATION MARK (")</dt>
<dd>Switch to the <a href="#after2">after DOCTYPE public identifier
state</a> .</dd>
<dt><ins class="diff-new">U+003E GREATER-THAN SIGN
(>)</ins></dt>
<dd><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Set the DOCTYPE token's</ins> <i><ins class=
"diff-new">force-quirks flag</ins></i> <ins class=
"diff-new">to</ins> <i><ins class="diff-new">on</ins></i>
.<ins class="diff-new">Emit that DOCTYPE token. Switch to the</ins>
<a href="#data-state"><ins class="diff-new">data state</ins></a>
.</dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Set the DOCTYPE token's
<del class="diff-old">correctness</del> <i><ins class=
"diff-chg">force-quirks</ins> flag</i> to <i><del class=
"diff-old">incorrect</del> <ins class="diff-chg">on</ins></i> .
Emit that DOCTYPE token. Reconsume the EOF character in the
<a href="#data-state">data state</a> .</dd>
<dt>Anything else</dt>
<dd>Append the current input character to the current DOCTYPE
token's public identifier. Stay in the <a href="#doctype2">DOCTYPE
public identifier (double-quoted) state</a> .</dd>
</dl>
</dd>
<dt><dfn id="doctype3">DOCTYPE public identifier (single-quoted)
state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0027 APOSTROPHE (')</dt>
<dd>Switch to the <a href="#after2">after DOCTYPE public identifier
state</a> .</dd>
<dt><ins class="diff-new">U+003E GREATER-THAN SIGN
(>)</ins></dt>
<dd><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Set the DOCTYPE token's</ins> <i><ins class=
"diff-new">force-quirks flag</ins></i> <ins class=
"diff-new">to</ins> <i><ins class="diff-new">on</ins></i>
.<ins class="diff-new">Emit that DOCTYPE token. Switch to the</ins>
<a href="#data-state"><ins class="diff-new">data state</ins></a>
.</dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Set the DOCTYPE token's
<del class="diff-old">correctness</del> <i><ins class=
"diff-chg">force-quirks</ins> flag</i> to <i><del class=
"diff-old">incorrect</del> <ins class="diff-chg">on</ins></i> .
Emit that DOCTYPE token. Reconsume the EOF character in the
<a href="#data-state">data state</a> .</dd>
<dt>Anything else</dt>
<dd>Append the current input character to the current DOCTYPE
token's public identifier. Stay in the <a href="#doctype3">DOCTYPE
public identifier (single-quoted) state</a> .</dd>
</dl>
</dd>
<dt><dfn id="after2">After DOCTYPE public identifier
state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0009 CHARACTER TABULATION</dt>
<dt>U+000A LINE FEED (LF)</dt>
<dt>U+000B LINE TABULATION</dt>
<dt>U+000C FORM FEED (FF)</dt>
<dt>U+0020 SPACE</dt>
<dd>Stay in the <a href="#after2">after DOCTYPE public identifier
state</a> .</dd>
<dt>U+0022 QUOTATION MARK (")</dt>
<dd>Set the DOCTYPE token's system identifier to the empty
<del class="diff-old">string,</del> <ins class="diff-chg">string
(not missing),</ins> then switch to the <a href="#doctype4">DOCTYPE
system identifier (double-quoted) state</a> .</dd>
<dt>U+0027 APOSTROPHE (')</dt>
<dd>Set the DOCTYPE token's system identifier to the empty
<del class="diff-old">string,</del> <ins class="diff-chg">string
(not missing),</ins> then switch to the <a href="#doctype5">DOCTYPE
system identifier (single-quoted) state</a> .</dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd>Emit the current DOCTYPE token. Switch to the <a href=
"#data-state">data state</a> .</dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Set the DOCTYPE token's
<del class="diff-old">correctness</del> <i><ins class=
"diff-chg">force-quirks</ins> flag</i> to <i><del class=
"diff-old">incorrect</del> <ins class="diff-chg">on</ins></i> .
Emit that DOCTYPE token. Reconsume the EOF character in the
<a href="#data-state">data state</a> .</dd>
<dt>Anything else</dt>
<dd><a href="#parse1">Parse error</a> . <ins class="diff-new">Set
the DOCTYPE token's</ins> <i><ins class="diff-new">force-quirks
flag</ins></i> <ins class="diff-new">to</ins> <i><ins class=
"diff-new">on</ins></i> . Switch to the <a href="#bogus0">bogus
DOCTYPE state</a> .</dd>
</dl>
</dd>
<dt><dfn id="before3">Before DOCTYPE system identifier
state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0009 CHARACTER TABULATION</dt>
<dt>U+000A LINE FEED (LF)</dt>
<dt>U+000B LINE TABULATION</dt>
<dt>U+000C FORM FEED (FF)</dt>
<dt>U+0020 SPACE</dt>
<dd>Stay in the <a href="#before3">before DOCTYPE system identifier
state</a> .</dd>
<dt>U+0022 QUOTATION MARK (")</dt>
<dd>Set the DOCTYPE token's system identifier to the empty
<del class="diff-old">string,</del> <ins class="diff-chg">string
(not missing),</ins> then switch to the <a href="#doctype4">DOCTYPE
system identifier (double-quoted) state</a> .</dd>
<dt>U+0027 APOSTROPHE (')</dt>
<dd>Set the DOCTYPE token's system identifier to the empty
<del class="diff-old">string,</del> <ins class="diff-chg">string
(not missing),</ins> then switch to the <a href="#doctype5">DOCTYPE
system identifier (single-quoted) state</a> .</dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd><a href="#parse1">Parse error</a> . Set the DOCTYPE token's
<del class="diff-old">correctness</del> <i><ins class=
"diff-chg">force-quirks</ins> flag</i> to <i><del class=
"diff-old">incorrect</del> <ins class="diff-chg">on</ins></i> .
Emit that DOCTYPE token. Switch to the <a href="#data-state">data
state</a> .</dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Set the DOCTYPE token's
<del class="diff-old">correctness</del> <i><ins class=
"diff-chg">force-quirks</ins> flag</i> to <i><del class=
"diff-old">incorrect</del> <ins class="diff-chg">on</ins></i> .
Emit that DOCTYPE token. Reconsume the EOF character in the
<a href="#data-state">data state</a> .</dd>
<dt>Anything else</dt>
<dd><a href="#parse1">Parse error</a> . <ins class="diff-new">Set
the DOCTYPE token's</ins> <i><ins class="diff-new">force-quirks
flag</ins></i> <ins class="diff-new">to</ins> <i><ins class=
"diff-new">on</ins></i> . Switch to the <a href="#bogus0">bogus
DOCTYPE state</a> .</dd>
</dl>
</dd>
<dt><dfn id="doctype4">DOCTYPE system identifier (double-quoted)
state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0022 QUOTATION MARK (")</dt>
<dd>Switch to the <a href="#after3">after DOCTYPE system identifier
state</a> .</dd>
<dt><ins class="diff-new">U+003E GREATER-THAN SIGN
(>)</ins></dt>
<dd><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Set the DOCTYPE token's</ins> <i><ins class=
"diff-new">force-quirks flag</ins></i> <ins class=
"diff-new">to</ins> <i><ins class="diff-new">on</ins></i>
.<ins class="diff-new">Emit that DOCTYPE token. Switch to the</ins>
<a href="#data-state"><ins class="diff-new">data state</ins></a>
.</dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Set the DOCTYPE token's
<del class="diff-old">correctness</del> <i><ins class=
"diff-chg">force-quirks</ins> flag</i> to <i><del class=
"diff-old">incorrect</del> <ins class="diff-chg">on</ins></i> .
Emit that DOCTYPE token. Reconsume the EOF character in the
<a href="#data-state">data state</a> .</dd>
<dt>Anything else</dt>
<dd>Append the current input character to the current DOCTYPE
token's system identifier. Stay in the <a href="#doctype4">DOCTYPE
system identifier (double-quoted) state</a> .</dd>
</dl>
</dd>
<dt><dfn id="doctype5">DOCTYPE system identifier (single-quoted)
state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0027 APOSTROPHE (')</dt>
<dd>Switch to the <a href="#after3">after DOCTYPE system identifier
state</a> .</dd>
<dt><ins class="diff-new">U+003E GREATER-THAN SIGN
(>)</ins></dt>
<dd><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Set the DOCTYPE token's</ins> <i><ins class=
"diff-new">force-quirks flag</ins></i> <ins class=
"diff-new">to</ins> <i><ins class="diff-new">on</ins></i>
.<ins class="diff-new">Emit that DOCTYPE token. Switch to the</ins>
<a href="#data-state"><ins class="diff-new">data state</ins></a>
.</dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Set the DOCTYPE token's
<del class="diff-old">correctness</del> <i><ins class=
"diff-chg">force-quirks</ins> flag</i> to <i><del class=
"diff-old">incorrect</del> <ins class="diff-chg">on</ins></i> .
Emit that DOCTYPE token. Reconsume the EOF character in the
<a href="#data-state">data state</a> .</dd>
<dt>Anything else</dt>
<dd>Append the current input character to the current DOCTYPE
token's system identifier. Stay in the <a href="#doctype5">DOCTYPE
system identifier (single-quoted) state</a> .</dd>
</dl>
</dd>
<dt><dfn id="after3">After DOCTYPE system identifier
state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+0009 CHARACTER TABULATION</dt>
<dt>U+000A LINE FEED (LF)</dt>
<dt>U+000B LINE TABULATION</dt>
<dt>U+000C FORM FEED (FF)</dt>
<dt>U+0020 SPACE</dt>
<dd>Stay in the <a href="#after3">after DOCTYPE system identifier
state</a> .</dd>
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd>Emit the current DOCTYPE token. Switch to the <a href=
"#data-state">data state</a> .</dd>
<dt>EOF</dt>
<dd><a href="#parse1">Parse error</a> . Set the DOCTYPE token's
<del class="diff-old">correctness</del> <i><ins class=
"diff-chg">force-quirks</ins> flag</i> to <i><del class=
"diff-old">incorrect</del> <ins class="diff-chg">on</ins></i> .
Emit that DOCTYPE token. Reconsume the EOF character in the
<a href="#data-state">data state</a> .</dd>
<dt>Anything else</dt>
<dd><a href="#parse1">Parse error</a> . Switch to the <a href=
"#bogus0">bogus DOCTYPE state</a> . <ins class="diff-new">(This
does</ins> <em><ins class="diff-new">not</ins></em> <ins class=
"diff-new">set the DOCTYPE token's</ins> <i><ins class=
"diff-new">force-quirks flag</ins></i> <ins class=
"diff-new">to</ins> <i><ins class="diff-new">on</ins></i> .)</dd>
</dl>
</dd>
<dt><dfn id="bogus0">Bogus DOCTYPE state</dfn></dt>
<dd>
<p>Consume the <a href="#next-input">next input character</a> :</p>
<dl class="switch">
<dt>U+003E GREATER-THAN SIGN (>)</dt>
<dd><del class="diff-old">Set the DOCTYPE token's correctness flag
to incorrect .</del> Emit <del class="diff-old">that</del>
<ins class="diff-chg">the</ins> DOCTYPE token. Switch to the
<a href="#data-state">data state</a> .</dd>
<dt>EOF</dt>
<dd><del class="diff-old">Parse error . Set the DOCTYPE token's
correctness flag to incorrect .</del> Emit <del class=
"diff-old">that</del> <ins class="diff-chg">the</ins> DOCTYPE
token. Reconsume the EOF character in the <a href=
"#data-state">data state</a> .</dd>
<dt>Anything else</dt>
<dd>Stay in the <a href="#bogus0">bogus DOCTYPE state</a> .</dd>
</dl>
</dd>
<dt><dfn id="cdata1"><ins class="diff-new">CDATA block
state</ins></dfn></dt>
<dd>
<p><em><ins class="diff-new">(This can only happen if the</ins>
<a href="#content2"><ins class="diff-new">content model
flag</ins></a> <ins class="diff-new">is set to the PCDATA state,
and is unrelated to the</ins> <a href="#content2"><ins class=
"diff-new">content model flag</ins></a> <ins class="diff-new">'s
CDATA state.)</ins></em></p>
<p><ins class="diff-new">Consume every character up to the next
occurrence of the three character sequence U+005D RIGHT SQUARE
BRACKET U+005D RIGHT SQUARE BRACKET U+003E GREATER-THAN SIGN
(</ins> <code title=""><ins class="diff-new">]]></ins></code>
<ins class="diff-new">), or the end of the file (EOF), whichever
comes first. Emit a series of text tokens consisting of all the
characters consumed except the matching three character sequence at
the end (if one was found before the end of the file).</ins></p>
<p><ins class="diff-new">Switch to the</ins> <a href=
"#data-state"><ins class="diff-new">data state</ins></a> .</p>
<p><ins class="diff-new">If the end of the file was reached,
reconsume the EOF character.</ins></p>
</dd>
</dl>
<h5 id="tokenising"><span class="secno"><del class=
"diff-old">8.2.3.1.</del> <ins class=
"diff-chg">8.2.4.1.</ins></span> Tokenising <del class=
"diff-old">entities</del> <ins class="diff-chg">character
references</ins></h5>
<p>This section defines how to <dfn id="consume">consume
<del class="diff-old">an entity</del> <ins class="diff-chg">a
character reference</ins></dfn> . This definition is used when
parsing <del class="diff-old">entities</del> <ins class=
"diff-chg">character references</ins> <a href="#character4" title=
"character reference data state">in text</a> and <a href=
"#character5" title=
"character reference in attribute value state">in attributes</a>
.</p>
<p>The <del class="diff-old">behaviour</del> <ins class=
"diff-chg">behavior</ins> depends on the identity of the next
character (the one immediately after the U+0026 AMPERSAND
character):</p>
<dl class="switch">
<dt>U+0009 CHARACTER TABULATION</dt>
<dt>U+000A LINE FEED (LF)</dt>
<dt>U+000B LINE TABULATION</dt>
<dt>U+000C FORM FEED (FF)</dt>
<dt>U+0020 SPACE</dt>
<dt>U+003C LESS-THAN SIGN</dt>
<dt>U+0026 AMPERSAND</dt>
<dt>EOF</dt>
<dt><ins class="diff-new">The</ins> <dfn id=
"additional"><ins class="diff-new">additional allowed
character</ins></dfn> ,<ins class="diff-new">if there is
one</ins></dt>
<dd>Not <del class="diff-old">an entity.</del> <ins class=
"diff-chg">a character reference.</ins> No characters are consumed,
and nothing is returned. (This is not an error, either.)</dd>
<dt>U+0023 NUMBER SIGN (#)</dt>
<dd>
<p>Consume the U+0023 NUMBER SIGN.</p>
<p>The <del class="diff-old">behaviour</del> <ins class=
"diff-chg">behavior</ins> further depends on the character after
the U+0023 NUMBER SIGN:</p>
<dl class="switch">
<dt>U+0078 LATIN SMALL LETTER X</dt>
<dt>U+0058 LATIN CAPITAL LETTER X</dt>
<dd>
<p>Consume the X.</p>
<p>Follow the steps below, but using the range of characters U+0030
DIGIT ZERO through to U+0039 DIGIT NINE, U+0061 LATIN SMALL LETTER
A through to U+0066 LATIN SMALL LETTER F, and U+0041 LATIN CAPITAL
LETTER A, through to U+0046 LATIN CAPITAL LETTER F (in other words,
0-9, A-F, a-f).</p>
<p>When it comes to interpreting the number, interpret it as a
hexadecimal number.</p>
</dd>
<dt>Anything else</dt>
<dd>
<p>Follow the steps below, but using the range of characters U+0030
DIGIT ZERO through to U+0039 DIGIT NINE (i.e. just 0-9).</p>
<p>When it comes to interpreting the number, interpret it as a
decimal number.</p>
</dd>
</dl>
<p>Consume as many characters as match the range of characters
given above.</p>
<p>If no characters match the range, then don't consume any
characters (and unconsume the U+0023 NUMBER SIGN character and, if
appropriate, the X character). This is a <a href="#parse1">parse
error</a> ; nothing is returned.</p>
<p>Otherwise, if the next character is a U+003B SEMICOLON, consume
that too. If it isn't, there is a <a href="#parse1">parse error</a>
.</p>
<p>If one or more characters match the range, then take them all
and interpret the string of characters as a number (either
hexadecimal or decimal as appropriate).</p>
<p>If that number is one of the numbers in the first column of the
following table, then this is a <a href="#parse1">parse error</a> .
Find the row with that number in the first column, and return a
character token for the Unicode character given in the second
column of that row.</p>
<table>
<thead>
<tr>
<th>Number</th>
<th colspan="2">Unicode character</th>
</tr>
</thead>
<tbody>
<tr>
<td>0x0D</td>
<td>U+000A</td>
<td>LINE FEED (LF)</td>
</tr>
<tr>
<td>0x80</td>
<td>U+20AC</td>
<td>EURO SIGN ('€')</td>
</tr>
<tr>
<td>0x81</td>
<td>U+FFFD</td>
<td>REPLACEMENT CHARACTER</td>
</tr>
<tr>
<td>0x82</td>
<td>U+201A</td>
<td>SINGLE LOW-9 QUOTATION MARK ('‚')</td>
</tr>
<tr>
<td>0x83</td>
<td>U+0192</td>
<td>LATIN SMALL LETTER F WITH HOOK ('ƒ')</td>
</tr>
<tr>
<td>0x84</td>
<td>U+201E</td>
<td>DOUBLE LOW-9 QUOTATION MARK ('„')</td>
</tr>
<tr>
<td>0x85</td>
<td>U+2026</td>
<td>HORIZONTAL ELLIPSIS ('…')</td>
</tr>
<tr>
<td>0x86</td>
<td>U+2020</td>
<td>DAGGER ('†')</td>
</tr>
<tr>
<td>0x87</td>
<td>U+2021</td>
<td>DOUBLE DAGGER ('‡')</td>
</tr>
<tr>
<td>0x88</td>
<td>U+02C6</td>
<td>MODIFIER LETTER CIRCUMFLEX ACCENT ('ˆ')</td>
</tr>
<tr>
<td>0x89</td>
<td>U+2030</td>
<td>PER MILLE SIGN ('‰')</td>
</tr>
<tr>
<td>0x8A</td>
<td>U+0160</td>
<td>LATIN CAPITAL LETTER S WITH CARON ('Š')</td>
</tr>
<tr>
<td>0x8B</td>
<td>U+2039</td>
<td>SINGLE LEFT-POINTING ANGLE QUOTATION MARK ('‹')</td>
</tr>
<tr>
<td>0x8C</td>
<td>U+0152</td>
<td>LATIN CAPITAL LIGATURE OE ('Œ')</td>
</tr>
<tr>
<td>0x8D</td>
<td>U+FFFD</td>
<td>REPLACEMENT CHARACTER</td>
</tr>
<tr>
<td>0x8E</td>
<td>U+017D</td>
<td>LATIN CAPITAL LETTER Z WITH CARON ('Ž')</td>
</tr>
<tr>
<td>0x8F</td>
<td>U+FFFD</td>
<td>REPLACEMENT CHARACTER</td>
</tr>
<tr>
<td>0x90</td>
<td>U+FFFD</td>
<td>REPLACEMENT CHARACTER</td>
</tr>
<tr>
<td>0x91</td>
<td>U+2018</td>
<td>LEFT SINGLE QUOTATION MARK ('‘')</td>
</tr>
<tr>
<td>0x92</td>
<td>U+2019</td>
<td>RIGHT SINGLE QUOTATION MARK ('’')</td>
</tr>
<tr>
<td>0x93</td>
<td>U+201C</td>
<td>LEFT DOUBLE QUOTATION MARK ('“')</td>
</tr>
<tr>
<td>0x94</td>
<td>U+201D</td>
<td>RIGHT DOUBLE QUOTATION MARK ('”')</td>
</tr>
<tr>
<td>0x95</td>
<td>U+2022</td>
<td>BULLET ('•')</td>
</tr>
<tr>
<td>0x96</td>
<td>U+2013</td>
<td>EN DASH ('–')</td>
</tr>
<tr>
<td>0x97</td>
<td>U+2014</td>
<td>EM DASH ('—')</td>
</tr>
<tr>
<td>0x98</td>
<td>U+02DC</td>
<td>SMALL TILDE ('˜')</td>
</tr>
<tr>
<td>0x99</td>
<td>U+2122</td>
<td>TRADE MARK SIGN ('™')</td>
</tr>
<tr>
<td>0x9A</td>
<td>U+0161</td>
<td>LATIN SMALL LETTER S WITH CARON ('š')</td>
</tr>
<tr>
<td>0x9B</td>
<td>U+203A</td>
<td>SINGLE RIGHT-POINTING ANGLE QUOTATION MARK ('›')</td>
</tr>
<tr>
<td>0x9C</td>
<td>U+0153</td>
<td>LATIN SMALL LIGATURE OE ('œ')</td>
</tr>
<tr>
<td>0x9D</td>
<td>U+FFFD</td>
<td>REPLACEMENT CHARACTER</td>
</tr>
<tr>
<td>0x9E</td>
<td>U+017E</td>
<td>LATIN SMALL LETTER Z WITH CARON ('ž')</td>
</tr>
<tr>
<td>0x9F</td>
<td>U+0178</td>
<td>LATIN CAPITAL LETTER Y WITH DIAERESIS ('Ÿ')</td>
</tr>
</tbody>
</table>
<p>Otherwise, if the number is <del class="diff-old">zero, if the
number is higher than 0x10FFFF, or if it's one of the surrogate
characters (characters</del> in the range <ins class=
"diff-new">0x0000 to 0x0008, 0x000E to 0x001F, 0x007F to
0x009F,</ins> 0xD800 to <del class="diff-old">0xDFFF),</del>
<ins class="diff-chg">0xDFFF , 0xFDD0 to 0xFDDF, or is one of
0xFFFE, 0xFFFF, 0x1FFFE, 0x1FFFF, 0x2FFFE, 0x2FFFF, 0x3FFFE,
0x3FFFF, 0x4FFFE, 0x4FFFF, 0x5FFFE, 0x5FFFF, 0x6FFFE, 0x6FFFF,
0x7FFFE, 0x7FFFF, 0x8FFFE, 0x8FFFF, 0x9FFFE, 0x9FFFF, 0xAFFFE,
0xAFFFF, 0xBFFFE, 0xBFFFF, 0xCFFFE, 0xCFFFF, 0xDFFFE, 0xDFFFF,
0xEFFFE, 0xEFFFF, 0xFFFFE, 0xFFFFF, 0x10FFFE, or 0x10FFFF, or is
higher than 0x10FFFF,</ins> then this is a <a href="#parse1">parse
error</a> ; return a character token for the U+FFFD REPLACEMENT
CHARACTER character instead.</p>
<p>Otherwise, return a character token for the Unicode character
whose code point is that number.</p>
</dd>
<dt>Anything else</dt>
<dd>
<p>Consume the maximum number of characters possible, with the
consumed characters case-sensitively matching one of the
identifiers in the first column of the <del class=
"diff-old">entities</del> <a href="#named0"><ins class=
"diff-chg">named character references</ins></a> table.</p>
<p>If no match can be made, then this is a <a href="#parse1">parse
error</a> . No characters are consumed, and nothing is
returned.</p>
<p>If the last character matched is not a U+003B SEMICOLON (
<code title="">;</code> ), there is a <a href="#parse1">parse
error</a> .</p>
<p>If the <del class="diff-old">entity</del> <ins class=
"diff-chg">character reference</ins> is being consumed <a href=
"#character5" title=
"character reference in attribute value state">as part of an
attribute</a> , and the last character matched is not a U+003B
SEMICOLON ( <code title="">;</code> ), and the next character is in
the range U+0030 DIGIT ZERO to U+0039 DIGIT NINE, U+0041 LATIN
CAPITAL LETTER A to U+005A LATIN CAPITAL LETTER Z, or U+0061 LATIN
SMALL LETTER A to U+007A LATIN SMALL LETTER Z, then, for historical
reasons, all the characters that were matched after the U+0026
AMPERSAND (&) must be unconsumed, and nothing is returned.</p>
<p>Otherwise, return a character token for the character
corresponding to the <del class="diff-old">entity</del> <ins class=
"diff-chg">character reference</ins> name (as given by the second
column of the <del class="diff-old">entities</del> <a href=
"#named0"><ins class="diff-chg">named character
references</ins></a> table).</p>
<div class="example">
<p>If the markup contains <code title="">I'm &notit; I tell
you</code> , the <del class="diff-old">entity</del> <ins class=
"diff-chg">character reference</ins> is parsed as "not", as in,
<code title="">I'm ¬it; I tell you</code> . But if the markup was
<code title="">I'm &notin; I tell you</code> , the <del class=
"diff-old">entity</del> <ins class="diff-chg">character
reference</ins> would be parsed as "notin;", resulting in
<code title="">I'm ∉ I tell you</code> .</p>
</div>
</dd>
</dl>
<h4 id="tree-construction"><span class="secno"><del class=
"diff-old">8.2.4.</del> <ins class="diff-chg">8.2.5</ins></span>
<dfn id="tree-construction0">Tree construction</dfn></h4>
<p>The input to the tree construction stage is a sequence of tokens
from the <a href="#tokenisation0">tokenisation</a> stage. The tree
construction stage is associated with a DOM <code>Document</code>
object when a parser is created. The "output" of this stage
consists of dynamically modifying or extending that document's DOM
tree.</p>
<p><del class="diff-old">Tree construction passes through several
phases. Initially, UAs must act according to the steps described as
being those of the initial phase .</del> This specification does
not define when an interactive user agent has to render the
<code>Document</code> <ins class="diff-new">so that it is</ins>
available to the user, or when it has to begin accepting user
input.</p>
<p><ins class="diff-new">As each token is emitted from the
tokeniser, the user agent must process the token according to the
rules given in the section corresponding to the current</ins>
<span><ins class="diff-new">insertion mode</ins></span> .</p>
<p>When the steps below require the UA to <del class=
"diff-old">append</del> <dfn id="insert"><ins class=
"diff-chg">insert</ins> a character</dfn> <del class=
"diff-old">to</del> <ins class="diff-chg">into</ins> a node,
<ins class="diff-new">if that node has a child immediately before
where</ins> the <del class="diff-old">UA must collect it</del>
<ins class="diff-chg">character is to be inserted,</ins> and
<del class="diff-old">all subsequent consecutive characters</del>
that <del class="diff-old">would</del> <ins class="diff-chg">child
is a</ins> <code><ins class="diff-chg">Text</ins></code>
<ins class="diff-chg">node, then the character must</ins> be
appended to that <del class="diff-old">node, and insert one</del>
<code><ins class="diff-chg">Text</ins></code> <ins class=
"diff-chg">node; otherwise, a new</ins> <code>Text</code> node
whose data is <ins class="diff-new">just that character must be
inserted in</ins> the <del class="diff-old">concatenation of all
those characters.</del> <ins class="diff-chg">appropriate
place.</ins></p>
<p id="mutation-during-parsing">DOM mutation events must not fire
for changes caused by the UA parsing the document. (Conceptually,
the parser is not mutating the DOM, it is constructing it.) This
includes the parsing of any content inserted using <code title=
"dom-document-write-HTML"><a href=
"#document.write...">document.write()</a></code> and <code title=
"dom-document-writeln"><a href=
"#document.writeln...">document.writeln()</a></code> calls.
<a href="#references">[DOM3EVENTS]</a></p>
<p class="note">Not all of the tag names mentioned below are
conformant tag names in this specification; many are included to
handle legacy content. They still form part of the algorithm that
implementations are required to implement to claim conformance.</p>
<p class="note">The algorithm described below places no limit on
the depth of the DOM tree generated, or on the length of tag names,
attribute names, attribute values, text nodes, etc. While
<del class="diff-old">implementators</del> <ins class=
"diff-chg">implementors</ins> are encouraged to avoid arbitrary
limits, it is <del class="diff-old">recognised</del> <ins class=
"diff-chg">recognized</ins> that <a href=
"#hardwareLimitations">practical concerns</a> will likely force
user agents to impose nesting depths.</p>
<h5 id="creating"><span class="secno"><del class=
"diff-old">8.2.4.1.</del> <ins class=
"diff-chg">8.2.5.1.</ins></span> <ins class="diff-new">Creating and
inserting elements</ins></h5>
<p><ins class="diff-new">When the steps below require the UA
to</ins> <dfn id="create" title=
"create an element for the token"><ins class="diff-new">create an
element for a token</ins></dfn> <ins class="diff-new">in a
particular namespace, the UA must create a node implementing the
interface appropriate for the element type corresponding to the tag
name of the token in the given namespace (as given in the
specification that defines that element, e.g. for an</ins>
<code><a href="#a"><ins class="diff-chg">a</ins></a></code>
<ins class="diff-chg">element in the</ins> <a href=
"#html-namespace0"><ins class="diff-chg">HTML namespace</ins></a>
,<ins class="diff-chg">this specification defines it to be
the</ins> <code><a href="#htmlanchorelement"><ins class=
"diff-chg">HTMLAnchorElement</ins></a></code> <ins class=
"diff-chg">interface), with the tag name being the name of that
element, with the node being in the given namespace, and with the
attributes on the node being those given in the given
token.</ins></p>
<p>The <del class="diff-old">initial phase</del> <ins class=
"diff-chg">interface appropriate for an element in the</ins>
<a href="#html-namespace0"><ins class="diff-chg">HTML
namespace</ins></a> <ins class="diff-chg">that is not defined in
this specification is</ins> <code><a href=
"#htmlelement"><ins class="diff-chg">HTMLElement</ins></a></code>
.<ins class="diff-chg">The interface appropriate for an element in
another namespace that is not defined by that namespace's
specification is</ins> <code><ins class=
"diff-chg">Element</ins></code> .</p>
<p><ins class="diff-chg">When the steps below require the UA
to</ins> <dfn id="insert0"><ins class="diff-chg">insert an HTML
element</ins></dfn> <ins class="diff-new">for a token, the UA must
first</ins> <a href="#create"><ins class="diff-new">create an
element for the token</ins></a> <ins class="diff-new">in the</ins>
<a href="#html-namespace0"><ins class="diff-new">HTML
namespace</ins></a> ,<ins class="diff-new">and then append this
node to the</ins> <a href="#current5"><ins class="diff-new">current
node</ins></a> ,<ins class="diff-new">and push it onto the</ins>
<a href="#stack"><ins class="diff-new">stack of open
elements</ins></a> <ins class="diff-new">so that it is the
new</ins> <a href="#current5"><ins class="diff-new">current
node</ins></a> .</p>
<p><ins class="diff-new">The steps below may also require that the
UA insert an HTML element in a particular place, in which case the
UA must follow the same steps except that it must insert or append
the new node in the location specified instead of appending it to
the</ins> <a href="#current5"><ins class="diff-new">current
node</ins></a> .<ins class="diff-new">(This happens in particular
during the parsing of tables with invalid content.)</ins></p>
<p><ins class="diff-new">When the steps below require the UA
to</ins> <dfn id="insert1"><ins class="diff-new">insert a foreign
element</ins></dfn> <ins class="diff-new">for a token, the UA must
first</ins> <a href="#create"><ins class="diff-new">create an
element for the token</ins></a> <ins class="diff-new">in the given
namespace, and then append this node to the</ins> <a href=
"#current5"><ins class="diff-new">current node</ins></a>
,<ins class="diff-new">and push it onto the</ins> <a href=
"#stack"><ins class="diff-new">stack of open elements</ins></a>
<ins class="diff-new">so that it is the new</ins> <a href=
"#current5"><ins class="diff-new">current node</ins></a>
.<ins class="diff-new">If the newly created element has an</ins>
<code title=""><ins class="diff-new">xmlns</ins></code> <ins class=
"diff-new">attribute in the</ins> <a href="#xmlns"><ins class=
"diff-new">XMLNS namespace</ins></a> <ins class="diff-new">whose
value is not exactly the same as the element's namespace, that is
a</ins> <a href="#parse1"><ins class="diff-new">parse
error</ins></a> .</p>
<p><ins class="diff-new">When the steps below require the user
agent to</ins> <dfn id="adjust"><ins class="diff-new">adjust
foreign attributes</ins></dfn> <ins class="diff-new">for a token,
then, if any of the attributes on the token match the strings given
in the first column of the following table, let the attribute be a
namespaced attribute, with the prefix being the string given in the
corresponding cell in the second column, the local name being the
string given in the corresponding cell in the third column, and the
namespace being the namespace given in the corresponding cell in
the fourth column. (This fixes the use of namespaced attributes, in
particular</ins> <code title=""><ins class=
"diff-new">xml:lang</ins></code> .)</p>
<table>
<thead>
<tr>
<th><ins class="diff-new">Attribute name</ins></th>
<th><ins class="diff-new">Prefix</ins></th>
<th><ins class="diff-new">Local name</ins></th>
<th><ins class="diff-new">Namespace</ins></th>
</tr>
</thead>
<tbody>
<tr>
<td><code title=""><ins class=
"diff-new">xlink:actuate</ins></code></td>
<td><code title=""><ins class="diff-new">xlink</ins></code></td>
<td><code title=""><ins class="diff-new">actuate</ins></code></td>
<td><a href="#xlink"><ins class="diff-new">XLink
namespace</ins></a></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-new">xlink:arcrole</ins></code></td>
<td><code title=""><ins class="diff-new">xlink</ins></code></td>
<td><code title=""><ins class="diff-new">arcrole</ins></code></td>
<td><a href="#xlink"><ins class="diff-new">XLink
namespace</ins></a></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-new">xlink:href</ins></code></td>
<td><code title=""><ins class="diff-new">xlink</ins></code></td>
<td><code title=""><ins class="diff-new">href</ins></code></td>
<td><a href="#xlink"><ins class="diff-new">XLink
namespace</ins></a></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-new">xlink:role</ins></code></td>
<td><code title=""><ins class="diff-new">xlink</ins></code></td>
<td><code title=""><ins class="diff-new">role</ins></code></td>
<td><a href="#xlink"><ins class="diff-new">XLink
namespace</ins></a></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-new">xlink:show</ins></code></td>
<td><code title=""><ins class="diff-new">xlink</ins></code></td>
<td><code title=""><ins class="diff-new">show</ins></code></td>
<td><a href="#xlink"><ins class="diff-new">XLink
namespace</ins></a></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-new">xlink:title</ins></code></td>
<td><code title=""><ins class="diff-new">xlink</ins></code></td>
<td><code title=""><ins class="diff-new">title</ins></code></td>
<td><a href="#xlink"><ins class="diff-new">XLink
namespace</ins></a></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-new">xlink:type</ins></code></td>
<td><code title=""><ins class="diff-new">xlink</ins></code></td>
<td><code title=""><ins class="diff-new">type</ins></code></td>
<td><a href="#xlink"><ins class="diff-new">XLink
namespace</ins></a></td>
</tr>
<tr>
<td><code title=""><ins class="diff-new">xml:base</ins></code></td>
<td><code title=""><ins class="diff-new">xml</ins></code></td>
<td><code title=""><ins class="diff-new">base</ins></code></td>
<td><a href="#xml-namespace"><ins class="diff-new">XML
namespace</ins></a></td>
</tr>
<tr>
<td><code title=""><ins class="diff-new">xml:lang</ins></code></td>
<td><code title=""><ins class="diff-new">xml</ins></code></td>
<td><code title=""><ins class="diff-new">lang</ins></code></td>
<td><a href="#xml-namespace"><ins class="diff-new">XML
namespace</ins></a></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-new">xml:space</ins></code></td>
<td><code title=""><ins class="diff-new">xml</ins></code></td>
<td><code title=""><ins class="diff-new">space</ins></code></td>
<td><a href="#xml-namespace"><ins class="diff-new">XML
namespace</ins></a></td>
</tr>
<tr>
<td><code title=""><ins class="diff-new">xmlns</ins></code></td>
<td><ins class="diff-new">(none)</ins></td>
<td><code title=""><ins class="diff-new">xmlns</ins></code></td>
<td><a href="#xmlns"><ins class="diff-new">XMLNS
namespace</ins></a></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-new">xmlns:xlink</ins></code></td>
<td><code title=""><ins class="diff-new">xmlns</ins></code></td>
<td><code title=""><ins class="diff-new">xlink</ins></code></td>
<td><a href="#xmlns"><ins class="diff-new">XMLNS
namespace</ins></a></td>
</tr>
</tbody>
</table>
<p><ins class="diff-new">The</ins> <dfn id="generic"><ins class=
"diff-new">generic CDATA parsing algorithm</ins></dfn> <ins class=
"diff-new">and the</ins> <dfn id="generic0"><ins class=
"diff-new">generic RCDATA parsing algorithm</ins></dfn> <ins class=
"diff-new">consist of the following steps. These algorithms are
always invoked in response to a start tag token.</ins></p>
<ol>
<li>
<p><a href="#create"><ins class="diff-new">Create an element for
the token</ins></a> <ins class="diff-new">in the</ins> <a href=
"#html-namespace0"><ins class="diff-new">HTML namespace</ins></a>
.</p>
</li>
<li>
<p><ins class="diff-new">Append the new element to the</ins>
<a href="#current5"><ins class="diff-new">current node</ins></a>
.</p>
</li>
<li>
<p><ins class="diff-new">If the algorithm that was invoked is
the</ins> <a href="#generic"><ins class="diff-new">generic CDATA
parsing algorithm</ins></a> ,<ins class="diff-new">switch the
tokeniser's</ins> <a href="#content2"><ins class="diff-new">content
model flag</ins></a> <ins class="diff-new">to the CDATA state;
otherwise the algorithm invoked was the</ins> <a href=
"#generic0"><ins class="diff-new">generic RCDATA parsing
algorithm</ins></a> ,<ins class="diff-new">switch the
tokeniser's</ins> <a href="#content2"><ins class="diff-new">content
model flag</ins></a> <ins class="diff-new">to the RCDATA
state.</ins></p>
</li>
<li>
<p><ins class="diff-new">Then, collect all the character tokens
that the tokeniser returns until it returns a token that is not a
character token, or until it stops tokenising.</ins></p>
</li>
<li>
<p><ins class="diff-new">If this process resulted in a collection
of character tokens, append a single</ins> <code><ins class=
"diff-new">Text</ins></code> <ins class="diff-new">node, whose
contents is the concatenation of all those tokens' characters, to
the new element node.</ins></p>
</li>
<li>
<p><ins class="diff-new">The tokeniser's</ins> <a href=
"#content2"><ins class="diff-new">content model flag</ins></a>
<ins class="diff-new">will have switched back to the PCDATA
state.</ins></p>
</li>
<li>
<p><ins class="diff-new">If the next token is an end tag token with
the same tag name as the start tag token, ignore it. Otherwise,
it's an end-of-file token, and this is a</ins> <a href=
"#parse1"><ins class="diff-new">parse error</ins></a> .</p>
</li>
</ol>
<h5 id="closing"><span class="secno"><ins class=
"diff-new">8.2.5.2.</ins></span> <ins class="diff-new">Closing
elements that have implied end tags</ins></h5>
<p><del class="diff-old">Initially,</del> <ins class=
"diff-chg">When</ins> the <del class="diff-old">tree construction
stage</del> <ins class="diff-chg">steps below require the UA
to</ins> <dfn id="generate"><ins class="diff-chg">generate implied
end tags</ins></dfn> ,<ins class="diff-chg">then, while the</ins>
<a href="#current5"><ins class="diff-chg">current node</ins></a>
<ins class="diff-chg">is a</ins> <code><a href="#dd"><ins class=
"diff-chg">dd</ins></a></code> <ins class="diff-chg">element,
a</ins> <code><a href="#dt"><ins class=
"diff-chg">dt</ins></a></code> <ins class="diff-chg">element,
an</ins> <code><a href="#li"><ins class=
"diff-chg">li</ins></a></code> <ins class="diff-chg">element,
an</ins> <code><ins class="diff-chg">option</ins></code>
<ins class="diff-chg">element, an</ins> <code><ins class=
"diff-chg">optgroup</ins></code> <ins class="diff-chg">element,
a</ins> <code><a href="#p"><ins class="diff-chg">p</ins></a></code>
<ins class="diff-chg">element, an</ins> <code><a href=
"#rp"><ins class="diff-chg">rp</ins></a></code> <ins class=
"diff-chg">element, or an</ins> <code><a href="#rt"><ins class=
"diff-chg">rt</ins></a></code> <ins class="diff-chg">element, the
UA</ins> must <del class="diff-old">handle each token emitted</del>
<ins class="diff-chg">pop the</ins> <a href="#current5"><ins class=
"diff-chg">current node</ins></a> <ins class="diff-chg">off
the</ins> <a href="#stack"><ins class="diff-chg">stack of open
elements</ins></a> .</p>
<p><ins class="diff-chg">If a step requires the UA to generate
implied end tags but lists an element to exclude</ins> from the
<del class="diff-old">tokenisation</del> <ins class=
"diff-chg">process, then the UA must perform the above steps as if
that element was not in the above list.</ins></p>
<h5 id="foster"><span class="secno"><ins class=
"diff-chg">8.2.5.3.</ins></span> <ins class="diff-chg">Foster
parenting</ins></h5>
<p><ins class="diff-chg">Foster parenting happens when content is
misnested in tables.</ins></p>
<p><ins class="diff-chg">When a node</ins> <var title=
""><ins class="diff-chg">node</ins></var> <ins class="diff-chg">is
to be</ins> <dfn id="foster0" title="foster parent"><ins class=
"diff-chg">foster parented</ins></dfn> ,<ins class="diff-chg">the
node</ins> <var title=""><ins class="diff-chg">node</ins></var>
<ins class="diff-chg">must be inserted into the</ins> <i><a href=
"#foster1"><ins class="diff-chg">foster parent element</ins></a>
<del class="diff-old">stage</del></i> , <ins class="diff-chg">and
the</ins> <a href="#current6"><ins class="diff-chg">current
table</ins></a> <ins class="diff-chg">must be marked as</ins>
<dfn id="tainted"><ins class="diff-chg">tainted</ins></dfn>
.<ins class="diff-chg">(Once the</ins> <a href=
"#current6"><ins class="diff-chg">current table</ins></a>
<ins class="diff-chg">has been</ins> <a href="#tainted"><ins class=
"diff-chg">tainted</ins></a> ,<ins class="diff-chg">whitespace
characters are inserted into the</ins> <i><a href=
"#foster1"><ins class="diff-chg">foster parent
element</ins></a></i> <ins class="diff-chg">instead of the</ins>
<a href="#current5"><ins class="diff-chg">current node</ins></a>
.)</p>
<p><ins class="diff-chg">The</ins> <dfn id="foster1"><ins class=
"diff-chg">foster parent element</ins></dfn> <ins class=
"diff-chg">is the parent element of the last</ins> <code><a href=
"#table"><ins class="diff-chg">table</ins></a></code> <ins class=
"diff-chg">element in the</ins> <a href="#stack"><ins class=
"diff-chg">stack of open elements</ins></a> ,<ins class=
"diff-chg">if there is a</ins> <code><a href="#table"><ins class=
"diff-chg">table</ins></a></code> <ins class="diff-chg">element and
it has such a parent element. If there is no</ins> <code><a href=
"#table"><ins class="diff-chg">table</ins></a></code> <ins class=
"diff-chg">element in the</ins> <a href="#stack"><ins class=
"diff-chg">stack of open elements</ins></a> <ins class=
"diff-chg">(</ins> <a href="#fragment"><ins class=
"diff-chg">fragment case</ins></a> <ins class="diff-chg">), then
the</ins> <em><a href="#foster1"><ins class="diff-chg">foster
parent element</ins></a></em> <ins class="diff-chg">is the first
element in the</ins> <a href="#stack"><ins class="diff-chg">stack
of open elements</ins></a> <ins class="diff-chg">(the</ins>
<code><a href="#html"><ins class="diff-chg">html</ins></a></code>
<ins class="diff-chg">element). Otherwise, if there is a</ins>
<code><a href="#table"><ins class="diff-chg">table</ins></a></code>
<ins class="diff-chg">element in the</ins> <a href=
"#stack"><ins class="diff-chg">stack of open elements</ins></a>
,<ins class="diff-chg">but the last</ins> <code><a href=
"#table"><ins class="diff-chg">table</ins></a></code> <ins class=
"diff-chg">element in the</ins> <a href="#stack"><ins class=
"diff-chg">stack of open elements</ins></a> <ins class=
"diff-chg">has no parent, or its parent node is not an element,
then the</ins> <em><a href="#foster1"><ins class="diff-chg">foster
parent element</ins></a></em> <ins class="diff-chg">is the element
before the last</ins> <code><a href="#table"><ins class=
"diff-chg">table</ins></a></code> <ins class="diff-chg">element in
the</ins> <a href="#stack"><ins class="diff-chg">stack of open
elements</ins></a> .</p>
<p><ins class="diff-chg">If the</ins> <i><a href=
"#foster1"><ins class="diff-chg">foster parent
element</ins></a></i> <ins class="diff-chg">is the parent element
of the last</ins> <code><a href="#table"><ins class=
"diff-chg">table</ins></a></code> <ins class="diff-chg">element in
the</ins> <a href="#stack"><ins class="diff-chg">stack of open
elements</ins></a> ,<ins class="diff-chg">then</ins> <var title=
""><ins class="diff-chg">node</ins></var> <ins class=
"diff-chg">must be inserted immediately</ins> <em><ins class=
"diff-chg">before</ins></em> <ins class="diff-chg">the last</ins>
<code><a href="#table"><ins class="diff-chg">table</ins></a></code>
<ins class="diff-chg">element in the</ins> <a href=
"#stack"><ins class="diff-chg">stack of open elements</ins></a>
<ins class="diff-chg">in the</ins> <i><a href=
"#foster1"><ins class="diff-chg">foster parent
element</ins></a></i> <ins class="diff-chg">; otherwise,</ins>
<var title=""><ins class="diff-chg">node</ins></var> <ins class=
"diff-chg">must be</ins> <em><ins class=
"diff-chg">appended</ins></em> <ins class="diff-chg">to the</ins>
<i><a href="#foster1"><ins class="diff-chg">foster parent
element</ins></a></i> .</p>
<h5 id="the-initial"><span class="secno"><ins class=
"diff-chg">8.2.5.4.</ins></span> <ins class="diff-chg">The "</ins>
<dfn id="initial" title="insertion mode: initial"><ins class=
"diff-chg">initial</ins></dfn> <ins class="diff-chg">" insertion
mode</ins></h5>
<p><ins class="diff-chg">When the</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> <ins class="diff-chg">is
"</ins> <a href="#initial" title=
"insertion mode: initial"><ins class="diff-chg">initial</ins></a>
<ins class="diff-chg">", tokens must be handled</ins> as
follows:</p>
<dl class="switch">
<dt>A character token that is one of one of U+0009 CHARACTER
TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
FORM FEED (FF), or U+0020 SPACE</dt>
<dd>
<p>Ignore the token.</p>
</dd>
<dt>A comment token</dt>
<dd>
<p>Append a <code>Comment</code> node to the <code>Document</code>
object with the <code title="">data</code> attribute set to the
data given in the comment token.</p>
</dd>
<dt>A DOCTYPE token</dt>
<dd>
<p>If the DOCTYPE token's <code title="">name</code> does not
case-insensitively match the string " <code title="">HTML</code> ",
or if the token's public identifier is not missing, or if the
token's system identifier is not missing, then there is a <a href=
"#parse1">parse error</a> . Conformance checkers may, instead of
reporting this error, switch to a conformance checking mode for
another language (e.g. based on the DOCTYPE token a conformance
checker could <del class="diff-old">recognise</del> <ins class=
"diff-chg">recognize</ins> that the document is an HTML4-era
document, and defer to an HTML4 conformance checker.)</p>
<p>Append a <code>DocumentType</code> node to the
<code>Document</code> node, with the <code title="">name</code>
attribute set to the name given in the DOCTYPE token; the
<code title="">publicId</code> attribute set to the public
identifier given in the DOCTYPE token, or the empty string if the
public identifier was <del class="diff-old">not set;</del>
<ins class="diff-chg">missing;</ins> the <code title=
"">systemId</code> attribute set to the system identifier given in
the DOCTYPE token, or the empty string if the system identifier was
<del class="diff-old">not set;</del> <ins class=
"diff-chg">missing;</ins> and the other attributes specific to
<code>DocumentType</code> objects set to null and empty lists as
appropriate. Associate the <code>DocumentType</code> node with the
<code>Document</code> object so that it is returned as the value of
the <code title="">doctype</code> attribute of the
<code>Document</code> object.</p>
<p id="quirks-mode-doctypes">Then, if the DOCTYPE token matches one
of the conditions in the following list, then set the document to
<a href="#quirks">quirks mode</a> :</p>
<ul class="brief">
<li>The <del class="diff-old">correctness</del> <i><ins class=
"diff-chg">force-quirks</ins> flag</i> is set to <i><del class=
"diff-old">incorrect</del> <ins class="diff-chg">on</ins></i>
.</li>
<li>The name is set to anything other than " <code title=
"">HTML</code> ".</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">+//Silmaril//dtd html Pro v0r11 <del class=
"diff-old">19970101//EN</del> <ins class=
"diff-chg">19970101//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//AdvaSoft Ltd//DTD HTML 3.0 asWedit + <del class=
"diff-old">extensions//EN</del> <ins class=
"diff-chg">extensions//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//AS//DTD HTML 3.0 asWedit + <del class=
"diff-old">extensions//EN</del> <ins class=
"diff-chg">extensions//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML 2.0 Level <del class="diff-old">1//EN</del>
<ins class="diff-chg">1//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML 2.0 Level <del class="diff-old">2//EN</del>
<ins class="diff-chg">2//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML 2.0 Strict Level <del class=
"diff-old">1//EN</del> <ins class="diff-chg">1//</ins></code>
"</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML 2.0 Strict Level <del class=
"diff-old">2//EN</del> <ins class="diff-chg">2//</ins></code>
"</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML 2.0 <del class="diff-old">Strict//EN " The
public identifier is set to: " -//IETF//DTD HTML 2.0//EN</del>
<ins class="diff-chg">Strict//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML <del class="diff-old">2.1E//EN</del>
<ins class="diff-chg">2.0//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML <del class="diff-old">3.0//EN</del>
<ins class="diff-chg">2.1E//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML <del class="diff-old">3.0//EN//</del>
<ins class="diff-chg">3.0//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML 3.2 <del class="diff-old">Final//EN " The
public identifier is set to: " -//IETF//DTD HTML 3.2//EN " The
public identifier is set to: " -//IETF//DTD HTML 3//EN " The public
identifier is set to: " -//IETF//DTD HTML Level 0//EN " The public
identifier is set to: " -//IETF//DTD HTML Level 0//EN//2.0 " The
public identifier is set to: " -//IETF//DTD HTML Level 1//EN " The
public identifier is set to: " -//IETF//DTD HTML Level 1//EN//2.0 "
The public identifier is set to: " -//IETF//DTD HTML Level 2//EN "
The public identifier is set to: " -//IETF//DTD HTML Level
2//EN//2.0</del> <ins class="diff-chg">Final//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML <del class="diff-old">Level 3//EN</del>
<ins class="diff-chg">3.2//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML <del class="diff-old">Level 3//EN//3.0</del>
<ins class="diff-chg">3//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML <del class="diff-old">Strict</del> Level
<del class="diff-old">0//EN</del> <ins class=
"diff-chg">0//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML <del class="diff-old">Strict</del> Level
<del class="diff-old">0//EN//2.0</del> <ins class=
"diff-chg">1//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML <del class="diff-old">Strict</del> Level
<del class="diff-old">1//EN</del> <ins class=
"diff-chg">2//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML <del class="diff-old">Strict</del> Level
<del class="diff-old">1//EN//2.0</del> <ins class=
"diff-chg">3//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML Strict Level <del class="diff-old">2//EN</del>
<ins class="diff-chg">0//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML Strict Level <del class=
"diff-old">2//EN//2.0</del> <ins class="diff-chg">1//</ins></code>
"</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML Strict Level <del class="diff-old">3//EN</del>
<ins class="diff-chg">2//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML Strict Level <del class="diff-old">3//EN//3.0
" The public identifier is set to: " -//IETF//DTD HTML Strict//EN "
The public identifier is set to: " -//IETF//DTD HTML
Strict//EN//2.0</del> <ins class="diff-chg">3//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD HTML <del class="diff-old">Strict//EN//3.0 " The
public identifier is set to: " -//IETF//DTD HTML//EN " The public
identifier is set to: " -//IETF//DTD HTML//EN//2.0</del>
<ins class="diff-chg">Strict//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//IETF//DTD <del class="diff-old">HTML//EN//3.0</del>
<ins class="diff-chg">HTML//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//Metrius//DTD Metrius <del class=
"diff-old">Presentational//EN</del> <ins class=
"diff-chg">Presentational//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//Microsoft//DTD Internet Explorer 2.0 HTML <del class=
"diff-old">Strict//EN</del> <ins class=
"diff-chg">Strict//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//Microsoft//DTD Internet Explorer 2.0 <del class=
"diff-old">HTML//EN</del> <ins class="diff-chg">HTML//</ins></code>
"</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//Microsoft//DTD Internet Explorer 2.0 <del class=
"diff-old">Tables//EN</del> <ins class=
"diff-chg">Tables//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//Microsoft//DTD Internet Explorer 3.0 HTML <del class=
"diff-old">Strict//EN</del> <ins class=
"diff-chg">Strict//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//Microsoft//DTD Internet Explorer 3.0 <del class=
"diff-old">HTML//EN</del> <ins class="diff-chg">HTML//</ins></code>
"</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//Microsoft//DTD Internet Explorer 3.0 <del class=
"diff-old">Tables//EN</del> <ins class=
"diff-chg">Tables//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//Netscape Comm. Corp.//DTD <del class=
"diff-old">HTML//EN</del> <ins class="diff-chg">HTML//</ins></code>
"</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//Netscape Comm. Corp.//DTD Strict <del class=
"diff-old">HTML//EN</del> <ins class="diff-chg">HTML//</ins></code>
"</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//O'Reilly and Associates//DTD HTML <del class=
"diff-old">2.0//EN</del> <ins class="diff-chg">2.0//</ins></code>
"</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//O'Reilly and Associates//DTD HTML Extended <del class=
"diff-old">1.0//EN</del> <ins class="diff-chg">1.0//</ins></code>
"</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with: "</ins> <code title=
""><ins class="diff-chg">-//O'Reilly and Associates//DTD HTML
Extended Relaxed 1.0//</ins></code> <ins class=
"diff-chg">"</ins></li>
<li><ins class="diff-chg">The public identifier starts with:
"</ins> <code title=""><ins class="diff-chg">-//SoftQuad
Software//DTD HoTMetaL PRO 6.0::19990601::extensions to HTML
4.0//</ins></code> <ins class="diff-chg">"</ins></li>
<li><ins class="diff-chg">The public identifier starts with:
"</ins> <code title=""><ins class="diff-chg">-//SoftQuad//DTD
HoTMetaL PRO 4.0::19971010::extensions to HTML 4.0//</ins></code>
<ins class="diff-chg">"</ins></li>
<li><ins class="diff-chg">The public identifier starts with:</ins>
" <code title="">-//Spyglass//DTD HTML 2.0 <del class=
"diff-old">Extended//EN</del> <ins class=
"diff-chg">Extended//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//SQ//DTD HTML 2.0 HoTMetaL + <del class=
"diff-old">extensions//EN</del> <ins class=
"diff-chg">extensions//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title="">-//Sun
Microsystems Corp.//DTD HotJava <del class=
"diff-old">HTML//EN</del> <ins class="diff-chg">HTML//</ins></code>
"</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title="">-//Sun
Microsystems Corp.//DTD HotJava Strict <del class=
"diff-old">HTML//EN</del> <ins class="diff-chg">HTML//</ins></code>
"</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//W3C//DTD HTML 3 <del class="diff-old">1995-03-24//EN</del>
<ins class="diff-chg">1995-03-24//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//W3C//DTD HTML 3.2 <del class="diff-old">Draft//EN</del>
<ins class="diff-chg">Draft//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//W3C//DTD HTML 3.2 <del class="diff-old">Final//EN</del>
<ins class="diff-chg">Final//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//W3C//DTD HTML <del class="diff-old">3.2//EN</del> <ins class=
"diff-chg">3.2//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//W3C//DTD HTML 3.2S <del class="diff-old">Draft//EN</del>
<ins class="diff-chg">Draft//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//W3C//DTD HTML 4.0 <del class="diff-old">Frameset//EN</del>
<ins class="diff-chg">Frameset//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//W3C//DTD HTML 4.0 <del class=
"diff-old">Transitional//EN</del> <ins class=
"diff-chg">Transitional//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//W3C//DTD HTML Experimental <del class=
"diff-old">19960712//EN</del> <ins class=
"diff-chg">19960712//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//W3C//DTD HTML Experimental <del class=
"diff-old">970421//EN</del> <ins class=
"diff-chg">970421//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//W3C//DTD W3 <del class="diff-old">HTML//EN " The public
identifier is set to: " -//W3O//DTD W3 HTML 3.0//EN</del>
<ins class="diff-chg">HTML//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//W3O//DTD W3 HTML <del class="diff-old">3.0//EN//</del>
<ins class="diff-chg">3.0//</ins></code> "</li>
<li>The public identifier is set to: " <code title="">-//W3O//DTD
W3 HTML Strict 3.0//EN//</code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//WebTechs//DTD Mozilla HTML <del class=
"diff-old">2.0//EN</del> <ins class="diff-chg">2.0//</ins></code>
"</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//WebTechs//DTD Mozilla <del class="diff-old">HTML//EN</del>
<ins class="diff-chg">HTML//</ins></code> "</li>
<li>The public identifier is set to: " <code title="">-/W3C/DTD
HTML 4.0 Transitional/EN</code> "</li>
<li>The public identifier is set to: " <code title="">HTML</code>
"</li>
<li>The system identifier is set to: " <code title=
"">http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd</code>
"</li>
<li>The system identifier is missing and the public identifier
<del class="diff-old">is set to:</del> <ins class="diff-chg">starts
with:</ins> " <code title="">-//W3C//DTD HTML 4.01 <del class=
"diff-old">Frameset//EN</del> <ins class=
"diff-chg">Frameset//</ins></code> "</li>
<li>The system identifier is missing and the public identifier
<del class="diff-old">is set to:</del> <ins class="diff-chg">starts
with:</ins> " <code title="">-//W3C//DTD HTML 4.01 <del class=
"diff-old">Transitional//EN</del> <ins class=
"diff-chg">Transitional//</ins></code> "</li>
</ul>
<p>Otherwise, if the DOCTYPE token matches one of the conditions in
the following list, then set the document to <a href=
"#limited">limited quirks mode</a> :</p>
<ul class="brief">
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//W3C//DTD XHTML 1.0 <del class="diff-old">Frameset//EN</del>
<ins class="diff-chg">Frameset//</ins></code> "</li>
<li>The public identifier <del class="diff-old">is set to:</del>
<ins class="diff-chg">starts with:</ins> " <code title=
"">-//W3C//DTD XHTML 1.0 <del class=
"diff-old">Transitional//EN</del> <ins class=
"diff-chg">Transitional//</ins></code> "</li>
<li>The system identifier is not missing and the public identifier
<del class="diff-old">is set to:</del> <ins class="diff-chg">starts
with:</ins> " <code title="">-//W3C//DTD HTML 4.01 <del class=
"diff-old">Frameset//EN</del> <ins class=
"diff-chg">Frameset//</ins></code> "</li>
<li>The system identifier is not missing and the public identifier
<del class="diff-old">is set to:</del> <ins class="diff-chg">starts
with:</ins> " <code title="">-//W3C//DTD HTML 4.01 <del class=
"diff-old">Transitional//EN</del> <ins class=
"diff-chg">Transitional//</ins></code> "</li>
</ul>
<p>The name, system identifier, and public identifier strings must
be compared to the values given in the lists above in a
case-insensitive manner. <ins class="diff-new">A system identifier
whose value is the empty string is not considered missing for the
purposes of the conditions above.</ins></p>
<p>Then, switch <del class="diff-old">to</del> the <del class=
"diff-old">root element phase</del> <span><ins class=
"diff-chg">insertion mode</ins></span> <ins class="diff-chg">to
"</ins> <a href="#before4" title=
"insertion mode: before html"><ins class="diff-chg">before
html</ins></a> <del class="diff-old">of the tree construction
stage.</del> <ins class="diff-chg">".</ins></p>
</dd>
<dt><del class="diff-old">A start tag token An end tag token A
character token that is not one of one of U+0009 CHARACTER
TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
FORM FEED (FF), or U+0020 SPACE An end-of-file token</del>
<ins class="diff-chg">Anything else</ins></dt>
<dd>
<p><a href="#parse1">Parse error</a> .</p>
<p>Set the document to <a href="#quirks">quirks mode</a> .</p>
<p><del class="diff-old">Then, switch to</del> <ins class=
"diff-chg">Switch</ins> the <del class="diff-old">root element
phase</del> <span><ins class="diff-chg">insertion mode</ins></span>
<ins class="diff-chg">to "</ins> <a href="#before4" title=
"insertion mode: before html"><ins class="diff-chg">before
html</ins></a> <del class="diff-old">of the tree construction stage
and</del> <ins class="diff-chg">", then</ins> reprocess the current
token.</p>
</dd>
</dl>
<h5 id="the-before"><span class="secno"><del class=
"diff-old">8.2.4.2.</del> <ins class=
"diff-chg">8.2.5.5.</ins></span> The <del class="diff-old">root
element phase</del> <ins class="diff-chg">"</ins> <dfn id="before4"
title="insertion mode: before html"><ins class="diff-chg">before
html</ins></dfn> <ins class="diff-chg">" insertion mode</ins></h5>
<p><del class="diff-old">After</del> <ins class=
"diff-chg">When</ins> the <del class="diff-old">initial phase , as
each token</del> <span><ins class="diff-chg">insertion
mode</ins></span> is <del class="diff-old">emitted from the
tokenisation</del> <ins class="diff-chg">"</ins> <a href="#before4"
title="insertion mode: before html"><ins class="diff-chg">before
html</ins></a> <del class="diff-old">stage, it</del> <ins class=
"diff-chg">", tokens</ins> must be <del class=
"diff-old">processed</del> <ins class="diff-chg">handled</ins> as
<del class="diff-old">described in this section.</del> <ins class=
"diff-chg">follows:</ins></p>
<dl class="switch">
<dt>A DOCTYPE token</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Ignore the token.</p>
</dd>
<dt>A comment token</dt>
<dd>
<p>Append a <code>Comment</code> node to the <code>Document</code>
object with the <code title="">data</code> attribute set to the
data given in the comment token.</p>
</dd>
<dt>A character token that is one of one of U+0009 CHARACTER
TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
FORM FEED (FF), or U+0020 SPACE</dt>
<dd>
<p>Ignore the token.</p>
</dd>
<dt>A <del class="diff-old">character token that is not one of
U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF), U+000B LINE
TABULATION, U+000C FORM FEED (FF), or U+0020 SPACE A</del> start
tag <del class="diff-old">token An end</del> <ins class=
"diff-chg">whose</ins> tag <del class="diff-old">token An
end-of-file token</del> <ins class="diff-chg">name is
"html"</ins></dt>
<dd><del class="diff-old">If</del>
<p><a href="#create"><ins class="diff-chg">Create an element
for</ins> the token <del class="diff-old">is a start tag token
with</del></a> <ins class="diff-chg">in</ins> the <del class=
"diff-old">tag name "html", and</del> <a href=
"#html-namespace0"><ins class="diff-chg">HTML namespace</ins></a>
.<ins class="diff-chg">Append</ins> it <ins class="diff-new">to
the</ins> <code><ins class="diff-new">Document</ins></code>
<ins class="diff-new">object. Put this element in the</ins>
<a href="#stack"><ins class="diff-new">stack of open
elements</ins></a> .</p>
<p id="parser-appcache"><ins class="diff-new">If the token</ins>
has an attribute <del class="diff-old">"application",</del>
<ins class="diff-chg">"manifest",</ins> then run the <a href=
"#application2" title=
"concept-appcache-init-with-attribute">application cache selection
algorithm</a> with the value of that attribute as the manifest
<del class="diff-old">URI.</del> <ins class="diff-chg">URI,
resolving relative URIs according to section 5.1 of RFC3986 as if
there was no base URI embedded in content (i.e. relative to the
base URI from the encapsulating entity or the URI used to retrieve
the entity).</ins> Otherwise, run the <a href="#application3"
title="concept-appcache-init-no-attribute">application cache
selection algorithm</a> with no manifest. <a href=
"#references"><ins class="diff-new">[RFC3986]</ins></a></p>
<p><ins class="diff-new">Switch the</ins> <span><ins class=
"diff-new">insertion mode</ins></span> <ins class="diff-new">to
"</ins> <a href="#before5" title=
"insertion mode: before head"><ins class="diff-new">before
head</ins></a> <ins class="diff-new">".</ins></p>
</dd>
<dt><ins class="diff-new">Anything else</ins></dt>
<dd>
<p>Create an <code><a href="#htmlelement">HTMLElement</a></code>
node with the tag name <code><a href="#html">html</a></code> , in
the <a href="#html-namespace0">HTML namespace</a> . Append it to
the <code>Document</code> object. <ins class="diff-new">Put this
element in the</ins> <a href="#stack"><ins class="diff-new">stack
of open elements</ins></a> .</p>
<p><ins class="diff-new">Run the</ins> <a href="#application3"
title="concept-appcache-init-no-attribute"><ins class=
"diff-new">application cache selection algorithm</ins></a>
<ins class="diff-new">with no manifest.</ins></p>
<p>Switch <del class="diff-old">to</del> the <del class=
"diff-old">main phase</del> <span><ins class="diff-chg">insertion
mode</ins></span> <ins class="diff-chg">to "</ins> <a href=
"#before5" title="insertion mode: before head"><ins class=
"diff-chg">before head</ins></a> <del class="diff-old">and</del>
<ins class="diff-chg">", then</ins> reprocess the current
token.</p>
<p class="big-issue">Should probably make end tags be ignored, so
that "</head> <!-- --> <html> " puts the comment
before the root node (or should we?)</p>
</dd>
</dl>
<p>The root element can end up being removed from the
<code>Document</code> object, e.g. by scripts; nothing in
particular happens in such cases, content continues being appended
to the nodes as described in the next section. <del class=
"diff-old">8.2.4.3. The main phase After the root element phase ,
each token emitted from the tokenisation stage must be processed as
described in this section. This is by far the most involved part of
parsing an HTML document. The tree construction stage in this phase
has several pieces of state: a stack of open elements , a list of
active formatting elements , a head element pointer , a form
element pointer , and an insertion mode . We could just fold
insertion modes and phases into one concept (and duplicate the two
rules common to all insertion modes into all of them). 8.2.4.3.1.
The stack of open elements Initially the stack of open elements
contains just the html root element node created in the last phase
before switching to this phase (or, in the fragment case , the html
element created as part of that algorithm ). That's the topmost
node of the stack. It never gets popped off the stack. (This stack
grows downwards.) The current node is the bottommost node in this
stack. Elements in the stack fall into the following categories:
Special The following HTML elements have varying levels of special
parsing rules: address , area , base , basefont , bgsound ,
blockquote , body , br , center , col , colgroup , dd , dir , div ,
dl , dt , embed , fieldset , form , frame , frameset , h1 , h2 , h3
, h4 , h5 , h6 , head , hr , iframe , image , img , input , isindex
, li , link , listing , menu , meta , noembed , noframes , noscript
, ol , optgroup , option , p , param , plaintext , pre , script ,
select , spacer , style , tbody , textarea , tfoot , thead , title
, tr , ul , and wbr . Scoping The following HTML elements introduce
new scopes for various parts of the parsing: button , caption ,
html , marquee , object , table , td and th . Formatting The
following HTML elements are those that end up in the list of active
formatting elements : a , b , big , em , font , i , nobr , s ,
small , strike , strong , tt , and u . Phrasing All other elements
found while parsing an HTML document. Still need to add these new
elements to the lists: event-source , section , nav , article ,
aside , header , footer , datagrid , command The stack of open
elements is said to have an element in scope or have an element in
table scope when the following algorithm terminates in a match
state: Initialise node to be the current node (the bottommost node
of the stack). If node is the target node, terminate in a match
state. Otherwise, if node is a table element, terminate in a
failure state. Otherwise, if the algorithm is the "has an element
in scope" variant (rather than the "has an element in table scope"
variant), and node is one of the following, terminate in a failure
state: caption td th button marquee object Otherwise, if node is an
html element, terminate in a failure state. (This can only happen
if the node is the topmost node of the stack of open elements , and
prevents the next step from being invoked if there are no more
elements in the stack.) Otherwise, set node to the previous entry
in the stack of open elements and return to step 2. (This will
never fail, since the loop will always terminate in the previous
step if the top of the stack is reached.) Nothing happens if at any
time any of the elements in the stack of open elements are moved to
a new location in, or removed from, the Document tree. In
particular, the stack is not changed in this situation. This can
cause, amongst other strange effects, content to be appended to
nodes that are no longer in the DOM. In some cases (namely, when
closing misnested formatting elements ), the stack is manipulated
in a random-access fashion.</del></p>
<h5 id="the-before0"><span class="secno"><del class=
"diff-old">8.2.4.3.2.</del> <ins class=
"diff-chg">8.2.5.6.</ins></span> The <del class="diff-old">list of
active formatting elements Initially the list of active formatting
elements is empty. It is used to handle mis-nested formatting
element tags . The list contains elements in the formatting
category, and scope markers. The scope markers are inserted when
entering buttons, object elements, marquees, table cells, and table
captions, and are used to prevent formatting from "leaking" into
tables, buttons, object elements, and marquees. When the steps
below require the UA to reconstruct the active formatting elements
, the UA must perform the following steps: If there are no entries
in the list of active formatting elements , then there is nothing
to reconstruct; stop this algorithm. If the last (most recently
added) entry in the list of active formatting elements is a marker,
or if it is an element that is in the stack of open elements , then
there is nothing to reconstruct; stop this algorithm. Let entry be
the last (most recently added) element in the list of active
formatting elements . If there are no entries</del> <ins class=
"diff-chg">"</ins> <dfn id="before5" title=
"insertion mode: before head">before <del class="diff-old">entry in
the list of active formatting elements , then jump to step 8. Let
entry be the entry one earlier than entry in the list of active
formatting elements . If entry is neither a marker nor an element
that is also in the stack of open elements , go to step 4. Let
entry be the element one later than entry in the list of active
formatting elements . Perform a shallow clone of the element entry
to obtain clone . [DOM3CORE] Append clone to the current node and
push it onto the stack of open elements so that it is the new
current node . Replace the entry for entry in the list with an
entry for clone . If the entry for clone in the list of active
formatting elements is not the last entry in the list, return to
step 7. This has the effect of reopening all the formatting
elements that were opened in the current body, cell, or caption
(whichever is youngest) that haven't been explicitly closed. The
way this specification is written, the list of active formatting
elements always consists of elements in chronological order with
the least recently added element first and the most recently added
element last (except for while steps 8 to 11 of the above algorithm
are being executed, of course). When the steps below require the UA
to clear the list of active formatting elements up to the last
marker , the UA must perform the following steps: Let entry be the
last (most recently added) entry in the list of active formatting
elements . Remove entry from the list of active formatting elements
. If entry was a marker, then stop the algorithm at this point. The
list has been cleared up to the last marker. Go to step 1.
8.2.4.3.3. Creating and inserting HTML elements When the steps
below require the UA to create an element for a token , the UA must
create a node implementing the interface appropriate for the
element type corresponding to the tag name of the token (as given
in the section of this specification that defines that element,
e.g. for an a element it would be the HTMLAnchorElement interface),
with the tag name being the name of that element, with the node
being in the HTML namespace , and with the attributes on the node
being those given in the given token. When the steps below require
the UA to insert an HTML element for a token, the UA must first
create an element for the token , and then append this node to the
current node , and push it onto the stack of open elements so that
it is the new current node . The steps below may also require that
the UA insert an HTML element in a particular place, in which case
the UA must create an element for the token and then insert or
append the new node in the location specified. (This happens in
particular during the parsing of tables with invalid content.) The
interface appropriate for an element that is not defined in this
specification is HTMLElement . The generic CDATA parsing algorithm
and the generic RCDATA parsing algorithm consist of the following
steps. These algorithms are always invoked in response to a start
tag token, and are always passed a context node , typically the
current node , which is used as the place to insert the resulting
element node. Create an element for the token . Append the new
element to the given context node . If the algorithm that was
invoked is the generic CDATA parsing algorithm , switch the
tokeniser's content model flag to the CDATA state; otherwise the
algorithm invoked was the generic RCDATA parsing algorithm , switch
the tokeniser's content model flag to the RCDATA state. Then,
collect all the character tokens that the tokeniser returns until
it returns a token that is not a character token, or until it stops
tokenising. If this process resulted in a collection of character
tokens, append a single Text node, whose contents is the
concatenation of all those tokens' characters, to the new element
node. The tokeniser's content model flag will have switched back to
the PCDATA state. If the next token is an end tag token with the
same tag name as the start tag token, ignore it. Otherwise, this is
a parse error . 8.2.4.3.4. Closing elements that have implied end
tags When the steps below require the UA to generate implied end
tags , then, if the current node is a dd element, a dt element, an
li element, a p element, a tbody element, a td element, a tfoot
element, a th element, a thead element, a tr element, the UA must
act as if an end tag with the respective tag name had been seen and
then generate implied end tags again. The step that requires the UA
to generate implied end tags but lists an element to exclude from
the process, then the UA must perform the above steps as if that
element was not in the above list. 8.2.4.3.5. The element pointers
Initially the</del> head <del class="diff-old">element
pointer</del></dfn> <del class="diff-old">and the form element
pointer are both null. Once a head element has been parsed (whether
implicitly or explicitly) the head element pointer gets set to
point to this node. The form element pointer points to the last
form element that was opened and whose end tag has not yet been
seen. It is used to make form controls associate with forms in the
face of dramatically bad markup, for historical reasons. 8.2.4.3.6.
The insertion mode Initially the</del> <ins class=
"diff-chg">"</ins> insertion mode <del class="diff-old">is " before
head ". It can change to " in head ", " in head noscript ", " after
head ", " in body ", " in table ", " in caption ", " in column
group ", " in table body ", " in row ", " in cell ", " in select ",
" after body ", " in frameset ", and " after frameset " during the
course of the parsing, as described below. It affects how certain
tokens are processed. If the tree construction stage is switched
from the main phase to the trailing end phase and back again, the
various pieces of state are not reset; the UA must act as if the
state was maintained.</del></h5>
<p>When the <del class="diff-old">steps below require the UA to
reset the insertion mode appropriately , it means the UA must
follow these steps: Let last be false. Let node be the last node in
the stack of open elements . If node is the first node in the stack
of open elements, then set last to true. If the context element of
the</del> <span><del class="diff-old">HTML fragment parsing
algorithm is neither a td element nor a th element, then set node
to the context element. ( fragment case ) If node is a select
element, then switch the</del> insertion mode <del class=
"diff-old">to " in select " and abort these steps. ( fragment case
) If node is a td or th element, then switch the insertion mode to
" in cell " and abort these steps. If node is a tr element, then
switch the insertion mode to " in row " and abort these steps. If
node is a tbody , thead , or tfoot element, then switch the
insertion mode to " in table body " and abort these steps. If node
is a caption element, then switch the insertion mode to " in
caption " and abort these steps. If node is a colgroup element,
then switch the insertion mode to " in column group " and abort
these steps. ( fragment case ) If node is a table element, then
switch the insertion mode to " in table " and abort these steps. If
node is a head element, then switch the insertion mode to " in body
" (" in body "! not " in head " !) and abort these steps. (
fragment case ) If node is a body element, then switch the
insertion mode to " in body " and abort these steps. If node is a
frameset element, then switch the insertion mode to " in frameset "
and abort these steps. ( fragment case ) If node is an html
element, then: if the head element pointer</del></span> is
<del class="diff-old">null, switch the insertion mode to</del> "
<a href="#before5" title="insertion mode: before head">before
head</a> ", <del class="diff-old">otherwise, switch the insertion
mode to " after head ". In either case, abort these steps. (
fragment case ) If last is true, then set the insertion mode to "
in body " and abort these steps. ( fragment case ) Let node now be
the node before node in the stack of open elements . Return to step
3. 8.2.4.3.7. How to handle</del> tokens <del class="diff-old">in
the main phase Tokens in the main phase</del> must be handled as
follows:</p>
<dl class="switch">
<dt>A <del class="diff-old">DOCTYPE token Parse error . Ignore the
token. A start tag whose tag name is "html" If this start tag token
was not the first start tag token, then it is a parse error . For
each attribute on the token, check to see if the attribute is
already present on the top element of the stack of open elements .
If it is not, add the attribute and its corresponding value to that
element. An end-of-file token Generate implied end tags. If there
are more than two nodes on the stack of open elements , or if there
are two nodes but the second node is not a body node, this is a
parse error . Otherwise, if the parser was originally created as
part of the HTML fragment parsing algorithm , and there's more than
one element in the stack of open elements , and the second node on
the stack of open elements is not a body node, then this is a parse
error . ( fragment case ) Stop parsing. This fails because it
doesn't imply HEAD and BODY tags. We should probably expand out the
insertion modes and merge them with phases and then put the three
things here into each insertion mode instead of trying to factor
them out so carefully. Anything else Depends on the insertion mode
: If the insertion mode is " before head " Handle the token as
follows: A</del> character token that is one of one of U+0009
CHARACTER TABULATION, U+000A LINE FEED (LF), U+000B LINE
TABULATION, U+000C FORM FEED (FF), or U+0020 SPACE</dt>
<dd>
<p><del class="diff-old">Append the character to</del> <ins class=
"diff-chg">Ignore</ins> the <del class="diff-old">current node
.</del> <ins class="diff-chg">token.</ins></p>
</dd>
<dt>A comment token</dt>
<dd>
<p>Append a <code>Comment</code> node to the <a href=
"#current5">current node</a> with the <code title="">data</code>
attribute set to the data given in the comment token.</p>
</dd>
<dt>A <ins class="diff-new">DOCTYPE token</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Ignore the token.</ins></p>
</dd>
<dt><ins class="diff-new">A</ins> start tag whose tag name is
<del class="diff-old">"head"</del> <ins class=
"diff-chg">"html"</ins></dt>
<dd>
<p><del class="diff-old">Create an element for</del> <ins class=
"diff-chg">Process</ins> the token <del class="diff-old">. Set the
head element pointer to this new element node. Append the new
element to</del> <a href="#using8"><ins class=
"diff-chg">using</ins> the <del class="diff-old">current node</del>
<ins class="diff-chg">rules for</ins></a> <del class="diff-old">and
push it onto the stack of open elements . Change</del> the
<del class="diff-old">insertion mode to</del> " <a href="#in-body"
title="insertion mode: in body">in <del class="diff-old">head</del>
<ins class="diff-chg">body</ins></a> <del class="diff-old">".</del>
<ins class="diff-chg">"</ins> <span><ins class="diff-chg">insertion
mode</ins></span> .</p>
</dd>
<dt>A start tag <del class="diff-old">token</del> whose tag name is
<del class="diff-old">one of: "base", "link", "meta", "script",
"style", "title"</del> <ins class="diff-chg">"head"</ins></dt>
<dd>
<p><del class="diff-old">Act as if a start tag token with the tag
name "head" and no attributes had been seen, then reprocess</del>
<a href="#insert0"><ins class="diff-chg">Insert an HTML
element</ins></a> <ins class="diff-chg">for</ins> the <del class=
"diff-old">current</del> token.</p>
<del class="diff-old">This will result in a</del>
<p><ins class="diff-chg">Set the</ins> <a href=
"#head-element"><code title=""><ins class=
"diff-chg">head</ins></code> <ins class="diff-chg">element
pointer</ins></a> <ins class="diff-chg">to the newly created</ins>
<code><a href="#head">head</a></code> <del class="diff-old">element
being generated, and with the current token being reprocessed
in</del> <ins class="diff-chg">element.</ins></p>
<p><ins class="diff-chg">Switch</ins> the <span><ins class=
"diff-new">insertion mode</ins></span> <ins class=
"diff-new">to</ins> " <a href="#in-head" title=
"insertion mode: in head">in head</a> <del class="diff-old">"
insertion mode .</del> <ins class="diff-chg">".</ins></p>
</dd>
<dt>An end tag whose tag name is one of: "head", <del class=
"diff-old">"body", "html", "p",</del> "br"</dt>
<dd>
<p>Act as if a start tag token with the tag name "head" and no
attributes had been seen, then reprocess the current token.</p>
</dd>
<dt>Any other end tag</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Ignore the token.</p>
<del class="diff-old">Do we really want to ignore end tags here? A
character token that is not one of U+0009 CHARACTER TABULATION,
U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED
(FF), or U+0020 SPACE</del></dd>
<dt><del class="diff-old">Any other start tag token</del>
<ins class="diff-chg">Anything else</ins></dt>
<dd>
<p>Act as if a start tag token with the tag name "head" and no
attributes had been seen, then reprocess the current token.</p>
<p class="note">This will result in an empty <code><a href=
"#head">head</a></code> element being generated, with the current
token being reprocessed in the " <a href="#after4" title=
"insertion mode: after head">after head</a> " <span>insertion mode
<del class="diff-old">.</del></span> .</p>
</dd>
</dl>
<del class="diff-old">If the insertion mode is</del>
<h5 id="parsing-main-inhead"><span class="secno"><ins class=
"diff-chg">8.2.5.7.</ins></span> <ins class="diff-chg">The</ins> "
<dfn id="in-head" title="insertion mode: in head">in head</dfn> "
<ins class="diff-chg">insertion mode</ins></h5>
<p><del class="diff-old">Handle</del> <ins class=
"diff-chg">When</ins> the <del class="diff-old">token</del>
<span><ins class="diff-chg">insertion mode</ins></span> <ins class=
"diff-chg">is "</ins> <a href="#in-head" title=
"insertion mode: in head"><ins class="diff-chg">in head</ins></a>
<ins class="diff-chg">", tokens must be handled</ins> as
<del class="diff-old">follows.</del> <ins class=
"diff-chg">follows:</ins></p>
<dl class="switch">
<dt>A character token that is one of one of U+0009 CHARACTER
TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
FORM FEED (FF), or U+0020 SPACE</dt>
<dd>
<p><del class="diff-old">Append</del> <a href="#insert" title=
"insert a character"><ins class="diff-chg">Insert</ins> the
character</a> <del class="diff-old">to</del> <ins class=
"diff-chg">into</ins> the <a href="#current5">current node</a>
.</p>
</dd>
<dt>A comment token</dt>
<dd>
<p>Append a <code>Comment</code> node to the <a href=
"#current5">current node</a> with the <code title="">data</code>
attribute set to the data given in the comment token.</p>
</dd>
<dt>A <ins class="diff-new">DOCTYPE token</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Ignore the token.</ins></p>
</dd>
<dt><ins class="diff-new">A start tag whose tag name is
"html"</ins></dt>
<dd>
<p><ins class="diff-new">Process the token</ins> <a href=
"#using8"><ins class="diff-new">using the rules for</ins></a>
<ins class="diff-new">the "</ins> <a href="#in-body" title=
"insertion mode: in body"><ins class="diff-new">in body</ins></a>
<ins class="diff-new">"</ins> <span><ins class="diff-new">insertion
mode</ins></span> .</p>
</dd>
<dt><ins class="diff-new">A</ins> start tag whose tag name is one
of: "base", <ins class="diff-new">"command", "event-source",</ins>
"link"</dt>
<dd>
<p><a href="#insert0">Insert an HTML element</a> for the token.
<ins class="diff-new">Immediately pop the</ins> <a href=
"#current5"><ins class="diff-new">current node</ins></a>
<ins class="diff-new">off the</ins> <a href="#stack"><ins class=
"diff-new">stack of open elements</ins></a> .</p>
<p><a href="#acknowledged" title=
"acknowledge self-closing flag"><ins class="diff-new">Acknowledge
the token's</ins> <i><ins class="diff-new">self-closing
flag</ins></i></a> ,<ins class="diff-new">if it is set.</ins></p>
</dd>
<dt>A start tag whose tag name is "meta"</dt>
<dd>
<p><a href="#insert0">Insert an HTML element</a> for the token.
<ins class="diff-new">Immediately pop the</ins> <a href=
"#current5"><ins class="diff-new">current node</ins></a>
<ins class="diff-new">off the</ins> <a href="#stack"><ins class=
"diff-new">stack of open elements</ins></a> .</p>
<p><a href="#acknowledged" title=
"acknowledge self-closing flag"><ins class="diff-new">Acknowledge
the token's</ins> <i><ins class="diff-new">self-closing
flag</ins></i></a> ,<ins class="diff-new">if it is set.</ins></p>
<p id="meta-charset-during-parse">If the element has a <code title=
"attr-meta-charset"><a href="#charset1">charset</a></code>
attribute, and its value is a supported encoding, and the <a href=
"#confidence" title="concept-encoding-confidence">confidence</a> is
currently <i>tentative</i> , then <a href="#change">change the
encoding</a> to the encoding given by the value of the <code title=
"attr-meta-charset"><a href="#charset1">charset</a></code>
attribute.</p>
<p>Otherwise, if the element has a <code title=
"attr-meta-charset"><a href="#charset1">content</a></code>
attribute, and applying the <a href="#algorithm4">algorithm
<del class="diff-old">to extract</del> <ins class="diff-chg">for
extracting</ins> an encoding from a Content-Type</a> to its value
returns a supported encoding <var title="">encoding</var> , and the
<a href="#confidence" title=
"concept-encoding-confidence">confidence</a> is currently
<i>tentative</i> , then <a href="#change">change the encoding</a>
to the encoding <var title="">encoding</var> .</p>
</dd>
<dt>A start tag whose tag name is "title"</dt>
<dd>
<p>Follow the <a href="#generic0">generic RCDATA parsing algorithm
<del class="diff-old">, with the head element pointer as the
context node , unless that's null, in which case use the current
node ( fragment cose ).</del></a> .</p>
</dd>
<dt>A start tag whose tag name is "noscript", if <ins class=
"diff-new">the</ins> <a href="#scripting2">scripting <ins class=
"diff-new">flag</ins></a> is enabled <del class=
"diff-old">:</del></dt>
<dt>A start tag whose tag name is <ins class="diff-new">one of:
"noframes",</ins> "style"</dt>
<dd>
<p>Follow the <a href="#generic">generic CDATA parsing algorithm
<del class="diff-old">, with the current node as the context node
.</del></a> .</p>
</dd>
<dt>A start tag whose tag name is "noscript", if <ins class=
"diff-chg">the</ins> <a href="#scripting2">scripting <ins class=
"diff-new">flag</ins></a> is disabled <del class=
"diff-old">:</del></dt>
<dd>
<p><a href="#insert0">Insert <del class="diff-old">a noscript</del>
<ins class="diff-chg">an HTML</ins> element</a> for the token.</p>
<p><del class="diff-old">Change</del> <ins class=
"diff-chg">Switch</ins> the <span>insertion mode</span> to "
<a href="#in-head0" title="insertion mode: in head noscript">in
head noscript</a> ".</p>
</dd>
<dt id="scriptTag">A start tag whose tag name is "script"</dt>
<dd>
<p><a href="#create">Create an element for the token</a>
<ins class="diff-new">in the</ins> <a href=
"#html-namespace0"><ins class="diff-new">HTML namespace</ins></a>
.</p>
<p>Mark the element as being <a href=
"#parser-inserted">"parser-inserted"</a> . This ensures that, if
the script is external, any <code title=
"dom-document-write-HTML"><a href=
"#document.write...">document.write()</a></code> calls in the
script will execute in-line, instead of blowing the document away,
as would happen in most other cases.</p>
<p>Switch the tokeniser's <a href="#content2">content model
flag</a> to the CDATA state.</p>
<p>Then, collect all the character tokens that the tokeniser
returns until it returns a token that is not a character token, or
until it stops tokenising.</p>
<p>If this process resulted in a collection of character tokens,
append a single <code>Text</code> node to the <code><a href=
"#script1">script</a></code> element node whose contents is the
concatenation of all those tokens' characters.</p>
<p>The tokeniser's <a href="#content2">content model flag</a> will
have switched back to the PCDATA state.</p>
<p>If the next token is not an end tag token with the tag name
"script", then this is a <a href="#parse1">parse error</a> ; mark
the <code><a href="#script1">script</a></code> element as <a href=
"#already">"already executed"</a> . Otherwise, the token is the
<code><a href="#script1">script</a></code> element's end tag, so
ignore it.</p>
<p>If the parser was originally created for the <a href=
"#html-fragment0">HTML fragment parsing algorithm</a> , then mark
the <code><a href="#script1">script</a></code> element as <a href=
"#already">"already executed"</a> , and skip the rest of the
processing described for this token (including the part below where
" <a href="#the-script" title=
"the script that will execute as soon as the parser resumes">scripts
that will execute as soon as the parser resumes</a> " are
executed). ( <a href="#fragment">fragment case</a> )</p>
<p class="note">Marking the <code><a href=
"#script1">script</a></code> element as "already executed" prevents
it from executing when it is inserted into the document a few
paragraphs below. Thus, scripts missing their end tags and scripts
that were inserted using <code title="dom-innerHTML-HTML"><a href=
"#innerhtml0">innerHTML</a></code> aren't executed.</p>
<p>Let the <var title="">old insertion point</var> have the same
value as the current <a href="#insertion">insertion point</a> . Let
the <a href="#insertion">insertion point</a> be just before the
<a href="#next-input">next input character</a> .</p>
<p>Append the new element to the <a href="#current5">current
node</a> . <a href="#running" title="running a script">Special
processing occurs when a <code>script</code> element is inserted
into a document</a> that might cause some script to execute, which
might cause <a href="#document.write..." title=
"dom-document-write-HTML">new characters to be inserted into the
tokeniser</a> .</p>
<p>Let the <a href="#insertion">insertion point</a> have the value
of the <var title="">old insertion point</var> . (In other words,
restore the <a href="#insertion">insertion point</a> to the value
it had before the previous paragraph. This value might be the
"undefined" value.)</p>
<p id="scriptTagParserResumes">At this stage, if there is <a href=
"#the-script" title=
"the script that will execute as soon as the parser resumes">a
script that will execute as soon as the parser resumes</a> ,
then:</p>
<dl class="switch">
<dt>If the tree construction stage is <a href=
"#nestedParsing">being called reentrantly</a> , say from a call to
<code title="dom-document-write-HTML"><a href=
"#document.write...">document.write()</a></code> :</dt>
<dd>
<p>Abort the processing of any nested <del class=
"diff-old">invokations</del> <ins class=
"diff-chg">invocations</ins> of the tokeniser, yielding control
back to the caller. (Tokenisation will resume when the caller
returns to the "outer" tree construction stage.)</p>
</dd>
<dt>Otherwise:</dt>
<dd>
<p>Follow these steps:</p>
<ol>
<li>
<p>Let <var title="">the script</var> be <a href="#the-script">the
script that will execute as soon as the parser resumes</a> . There
is no longer <a href="#the-script" title=
"the script that will execute as soon as the parser resumes">a
script that will execute as soon as the parser resumes</a> .</p>
</li>
<li>
<p><a href="#pause">Pause</a> until the script has <span>completed
loading</span> .</p>
</li>
<li>
<p>Let the <a href="#insertion">insertion point</a> be just before
the <a href="#next-input">next input character</a> .</p>
</li>
<li>
<p><a href="#executing0" title="executing a script block">Execute
the script</a> .</p>
</li>
<li>
<p>Let the <a href="#insertion">insertion point</a> be undefined
again.</p>
</li>
<li>
<p>If there is once again <a href="#the-script" title=
"the script that will execute as soon as the parser resumes">a
script that will execute as soon as the parser resumes</a> , then
repeat these steps from step 1.</p>
</li>
</ol>
</dd>
</dl>
</dd>
<dt>An end tag whose tag name is "head"</dt>
<dd>
<p>Pop the <a href="#current5">current node</a> (which will be the
<code><a href="#head">head</a></code> element) off the <a href=
"#stack">stack of open elements</a> .</p>
<p><del class="diff-old">Change</del> <ins class=
"diff-chg">Switch</ins> the <span>insertion mode</span> to "
<a href="#after4" title="insertion mode: after head">after head</a>
".</p>
</dd>
<dt>An end tag whose tag name is <del class="diff-old">one of:
"body", "html", "p",</del> "br"</dt>
<dd>
<p>Act as described in the "anything else" entry below.</p>
</dd>
<dt>A start tag whose tag name is "head"</dt>
<dt>Any other end tag</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Ignore the token.</p>
</dd>
<dt>Anything else</dt>
<dd>
<p>Act as if an end tag token with the tag name "head" had been
seen, and reprocess the current token.</p>
<p class="big-issue">In certain UAs, <a href=
"https://bugzilla.mozilla.org/attachment.cgi?id=180157&action=view">
some elements</a> don't trigger the "in body" mode straight away,
but instead get put into the head. Do we want to copy that?</p>
</dd>
</dl>
<del class="diff-old">If</del>
<h5 id="parsing-main-inheadnoscript"><span class=
"secno"><ins class="diff-chg">8.2.5.8.</ins></span> <ins class=
"diff-chg">The "</ins> <dfn id="in-head0" title=
"insertion mode: in head noscript"><ins class="diff-chg">in head
noscript</ins></dfn> <ins class="diff-chg">" insertion
mode</ins></h5>
<p><ins class="diff-chg">When</ins> the <span>insertion mode</span>
is " <a href="#in-head0" title=
"insertion mode: in head noscript">in head noscript <del class=
"diff-old">"</del></a> <ins class="diff-chg">", tokens must be
handled as follows:</ins></p>
<dl class="switch">
<dt><ins class="diff-new">A DOCTYPE token</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Ignore the token.</ins></p>
</dd>
<dt><ins class="diff-new">A start tag whose tag name is
"html"</ins></dt>
<dd>
<p><ins class="diff-new">Process the token</ins> <a href=
"#using8"><ins class="diff-new">using the rules for</ins></a>
<ins class="diff-new">the "</ins> <a href="#in-body" title=
"insertion mode: in body"><ins class="diff-new">in body</ins></a>
<ins class="diff-new">"</ins> <span><ins class="diff-new">insertion
mode</ins></span> .</p>
</dd>
<dt>An end tag whose tag name is "noscript"</dt>
<dd>
<p>Pop the <a href="#current5">current node</a> (which will be a
<code><a href="#noscript">noscript</a></code> element) from the
<a href="#stack">stack of open elements</a> ; the new <a href=
"#current5">current node</a> will be a <code><a href=
"#head">head</a></code> element.</p>
<p>Switch the <span>insertion mode</span> to " <a href="#in-head"
title="insertion mode: in head">in head</a> ".</p>
</dd>
<dt>A character token that is one of one of U+0009 CHARACTER
TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
FORM FEED (FF), or U+0020 SPACE</dt>
<dt>A comment token</dt>
<dt>A start tag whose tag name is one of: "link", "meta",
<ins class="diff-new">"noframes",</ins> "style"</dt>
<dd>
<p>Process the token <del class="diff-old">as if</del> <a href=
"#using8"><ins class="diff-chg">using</ins> the <del class=
"diff-old">insertion mode</del> <ins class="diff-chg">rules
for</ins></a> <del class="diff-old">had been</del> <ins class=
"diff-chg">the</ins> " <a href="#in-head" title=
"insertion mode: in head">in head</a> <del class=
"diff-old">".</del> <ins class="diff-chg">"</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> .</p>
</dd>
<dt>An end tag whose tag name is one of: <del class=
"diff-old">"p",</del> "br"</dt>
<dd>
<p>Act as described in the "anything else" entry below.</p>
</dd>
<dt>A start tag whose tag name is one of: "head", "noscript"</dt>
<dt>Any other end tag</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Ignore the token.</p>
</dd>
<dt>Anything else</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Act as if an end tag with
the tag name "noscript" had been seen and reprocess the current
token.</p>
</dd>
</dl>
<del class="diff-old">If the insertion mode is</del>
<h5 id="the-after"><span class="secno"><ins class=
"diff-chg">8.2.5.9.</ins></span> <ins class="diff-chg">The</ins> "
<dfn id="after4" title="insertion mode: after head">after
head</dfn> " <ins class="diff-chg">insertion mode</ins></h5>
<p><del class="diff-old">Handle</del> <ins class=
"diff-chg">When</ins> the <del class="diff-old">token</del>
<span><ins class="diff-chg">insertion mode</ins></span> <ins class=
"diff-chg">is "</ins> <a href="#after4" title=
"insertion mode: after head"><ins class="diff-chg">after
head</ins></a> <ins class="diff-chg">", tokens must be
handled</ins> as follows:</p>
<dl class="switch">
<dt>A character token that is one of one of U+0009 CHARACTER
TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
FORM FEED (FF), or U+0020 SPACE</dt>
<dd>
<p><del class="diff-old">Append</del> <a href="#insert" title=
"insert a character"><ins class="diff-chg">Insert</ins> the
character</a> <del class="diff-old">to</del> <ins class=
"diff-chg">into</ins> the <a href="#current5">current node</a>
.</p>
</dd>
<dt>A comment token</dt>
<dd>
<p>Append a <code>Comment</code> node to the <a href=
"#current5">current node</a> with the <code title="">data</code>
attribute set to the data given in the comment token.</p>
</dd>
<dt>A <ins class="diff-new">DOCTYPE token</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Ignore the token.</ins></p>
</dd>
<dt><ins class="diff-new">A start tag whose tag name is
"html"</ins></dt>
<dd>
<p><ins class="diff-new">Process the token</ins> <a href=
"#using8"><ins class="diff-new">using the rules for</ins></a>
<ins class="diff-new">the "</ins> <a href="#in-body" title=
"insertion mode: in body"><ins class="diff-new">in body</ins></a>
<ins class="diff-new">"</ins> <span><ins class="diff-new">insertion
mode</ins></span> .</p>
</dd>
<dt><ins class="diff-new">A</ins> start tag whose tag name is
"body"</dt>
<dd>
<p><a href="#insert0">Insert <del class="diff-old">a body</del>
<ins class="diff-chg">an HTML</ins> element</a> for the token.</p>
<p><del class="diff-old">Change</del> <ins class=
"diff-chg">Switch</ins> the <span>insertion mode</span> to "
<a href="#in-body" title="insertion mode: in body">in body</a>
".</p>
</dd>
<dt>A start tag whose tag name is "frameset"</dt>
<dd>
<p><a href="#insert0">Insert <del class="diff-old">a frameset</del>
<ins class="diff-chg">an HTML</ins> element</a> for the token.</p>
<p><del class="diff-old">Change</del> <ins class=
"diff-chg">Switch</ins> the <span>insertion mode</span> to "
<a href="#in-frameset" title="insertion mode: in frameset">in
frameset</a> ".</p>
</dd>
<dt>A start tag token whose tag name is one of: "base", "link",
"meta", <ins class="diff-new">"noframes",</ins> "script", "style",
"title"</dt>
<dd>
<p><a href="#parse1">Parse error</a> .</p>
<p>Push the node pointed to by the <a href=
"#head-element"><code title="">head</code> element pointer</a> onto
the <a href="#stack">stack of open elements</a> .</p>
<p>Process the token <del class="diff-old">as if</del> <a href=
"#using8"><ins class="diff-chg">using</ins> the <del class=
"diff-old">insertion mode</del> <ins class="diff-chg">rules
for</ins></a> <del class="diff-old">had been</del> <ins class=
"diff-chg">the</ins> " <a href="#in-head" title=
"insertion mode: in head">in head</a> <del class=
"diff-old">".</del> <ins class="diff-chg">"</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> .</p>
<p>Pop the <a href="#current5">current node</a> (which will be the
node pointed to by the <a href="#head-element"><code title=
"">head</code> element pointer</a> ) off the <a href="#stack">stack
of open elements</a> .</p>
</dd>
<dt><ins class="diff-new">A start tag whose tag name is
"head"</ins></dt>
<dt><ins class="diff-new">Any other end tag</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Ignore the token.</ins></p>
</dd>
<dt>Anything else</dt>
<dd>
<p>Act as if a start tag token with the tag name "body" and no
attributes had been seen, and then reprocess the current token.</p>
</dd>
</dl>
<del class="diff-old">If the insertion mode is</del>
<h5 id="parsing-main-inbody"><span class="secno"><ins class=
"diff-chg">8.2.5.10.</ins></span> <ins class="diff-chg">The</ins> "
<dfn id="in-body" title="insertion mode: in body">in body</dfn> "
<ins class="diff-chg">insertion mode</ins></h5>
<p><del class="diff-old">Handle</del> <ins class=
"diff-chg">When</ins> the <del class="diff-old">token</del>
<span><ins class="diff-chg">insertion mode</ins></span> <ins class=
"diff-chg">is "</ins> <a href="#in-body" title=
"insertion mode: in body"><ins class="diff-chg">in body</ins></a>
<ins class="diff-chg">", tokens must be handled</ins> as
follows:</p>
<dl class="switch">
<dt>A character token</dt>
<dd>
<p><a href="#reconstruct">Reconstruct the active formatting
elements</a> , if any.</p>
<p><del class="diff-old">Append</del> <a href="#insert" title=
"insert a character"><ins class="diff-chg">Insert</ins> the token's
character</a> <del class="diff-old">to</del> <ins class=
"diff-chg">into</ins> the <a href="#current5">current node</a>
.</p>
</dd>
<dt>A comment token</dt>
<dd>
<p>Append a <code>Comment</code> node to the <a href=
"#current5">current node</a> with the <code title="">data</code>
attribute set to the data given in the comment token.</p>
</dd>
<dt>A <ins class="diff-new">DOCTYPE token</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Ignore the token.</ins></p>
</dd>
<dt><ins class="diff-new">A</ins> start tag <del class=
"diff-old">token</del> whose tag name is <del class="diff-old">one
of: "base", "link", "meta", "script", "style"</del> <ins class=
"diff-chg">"html"</ins></dt>
<dd>
<p><del class="diff-old">Process</del> <a href=
"#parse1"><ins class="diff-chg">Parse error</ins></a> .<ins class=
"diff-chg">For each attribute on</ins> the <del class=
"diff-old">token as</del> <ins class="diff-chg">token, check to
see</ins> if the <del class="diff-old">insertion mode had been " in
head ".</del> <ins class="diff-chg">attribute is already present on
the top element of the</ins> <a href="#stack"><ins class=
"diff-chg">stack of open elements</ins></a> .<ins class=
"diff-chg">If it is not, add the attribute and its corresponding
value to that element.</ins></p>
</dd>
<dt>A start tag <ins class="diff-new">token</ins> whose tag name is
<ins class="diff-new">one of: "base", "command", "event-source",
"link", "meta", "noframes", "script", "style",</ins> "title"</dt>
<dd>
<p><del class="diff-old">Parse error .</del> Process the token
<del class="diff-old">as if</del> <a href="#using8"><ins class=
"diff-chg">using</ins> the <del class="diff-old">insertion
mode</del> <ins class="diff-chg">rules for</ins></a> <del class=
"diff-old">had been</del> <ins class="diff-chg">the</ins> "
<a href="#in-head" title="insertion mode: in head">in head</a>
<del class="diff-old">".</del> <ins class="diff-chg">"</ins>
<span><ins class="diff-chg">insertion mode</ins></span> .</p>
</dd>
<dt>A start tag whose tag name is "body"</dt>
<dd>
<p><a href="#parse1">Parse error</a> .</p>
<p>If the second element on the <a href="#stack">stack of open
elements</a> is not a <code><a href="#body0">body</a></code>
element, or, if the <a href="#stack">stack of open elements</a> has
only one node on it, then ignore the token. ( <a href=
"#fragment">fragment case</a> )</p>
<p>Otherwise, for each attribute on the token, check to see if the
attribute is already present on the <code><a href=
"#body0">body</a></code> element (the second element) on the
<a href="#stack">stack of open elements</a> . If it is not, add the
attribute and its corresponding value to that element.</p>
</dd>
<dt>An <del class="diff-old">end tag whose tag name is "body"</del>
<ins class="diff-chg">end-of-file token</ins></dt>
<dd>
<p>If <del class="diff-old">the second element</del> <ins class=
"diff-chg">there is a node</ins> in the <a href="#stack">stack of
open elements</a> <ins class="diff-new">that</ins> is not
<ins class="diff-new">either a</ins> <code><a href=
"#dd"><ins class="diff-new">dd</ins></a></code> <ins class=
"diff-new">element, a</ins> <code><a href="#dt"><ins class=
"diff-new">dt</ins></a></code> <ins class="diff-new">element,
an</ins> <code><a href="#li"><ins class=
"diff-new">li</ins></a></code> <ins class="diff-new">element,
a</ins> <code><a href="#p"><ins class="diff-new">p</ins></a></code>
<ins class="diff-new">element, a</ins> <code><a href=
"#tbody"><ins class="diff-new">tbody</ins></a></code> <ins class=
"diff-new">element, a</ins> <code><a href="#td"><ins class=
"diff-new">td</ins></a></code> <ins class="diff-new">element,
a</ins> <code><a href="#tfoot0"><ins class=
"diff-new">tfoot</ins></a></code> <ins class=
"diff-new">element,</ins> a <code><a href="#th"><ins class=
"diff-new">th</ins></a></code> <ins class="diff-new">element,
a</ins> <code><a href="#thead0"><ins class=
"diff-new">thead</ins></a></code> <ins class="diff-new">element,
a</ins> <code><a href="#tr"><ins class=
"diff-new">tr</ins></a></code> <ins class="diff-new">element,
the</ins> <code><a href="#body0">body</a></code> element,
<ins class="diff-new">or the</ins> <code><a href=
"#html"><ins class="diff-new">html</ins></a></code> <ins class=
"diff-new">element, then</ins> this is a <a href="#parse1">parse
error</a> . <del class="diff-old">Ignore</del></p>
<p><a href="#stops"><ins class="diff-chg">Stop parsing</ins></a>
.</p>
</dd>
<dt><ins class="diff-chg">An end tag whose tag name is
"body"</ins></dt>
<dd>
<p><ins class="diff-chg">If</ins> the <del class="diff-old">token.
( fragment case</del> <a href="#stack"><ins class="diff-chg">stack
of open elements</ins></a> <del class="diff-old">)</del>
<ins class="diff-chg">does not</ins> <a href="#have-an" title=
"has an element in scope"><ins class="diff-chg">have a</ins>
<code><ins class="diff-chg">body</ins></code> <ins class=
"diff-chg">element in scope</ins></a> ,<ins class="diff-chg">this
is a</ins> <a href="#parse1"><ins class="diff-chg">parse
error</ins></a> <ins class="diff-chg">; ignore the token.</ins></p>
<p>Otherwise, if there is a node in the <a href="#stack">stack of
open elements</a> that is not either a <code><a href=
"#dd">dd</a></code> element, a <code><a href="#dt">dt</a></code>
element, an <code><a href="#li">li</a></code> element, a
<code><a href="#p">p</a></code> element, a <code><a href=
"#tbody">tbody</a></code> element, a <code><a href=
"#td">td</a></code> element, a <code><a href=
"#tfoot0">tfoot</a></code> element, a <code><a href=
"#th">th</a></code> element, a <code><a href=
"#thead0">thead</a></code> element, a <code><a href=
"#tr">tr</a></code> element, the <code><a href=
"#body0">body</a></code> element, or the <code><a href=
"#html">html</a></code> element, then this is a <a href=
"#parse1">parse error</a> .</p>
<p><del class="diff-old">Change</del> <ins class=
"diff-chg">Switch</ins> the <span>insertion mode</span> to "
<a href="#after5" title="insertion mode: after body">after body</a>
". <ins class="diff-new">Otherwise, ignore the token.</ins></p>
</dd>
<dt>An end tag whose tag name is "html"</dt>
<dd>
<p>Act as if an end tag with tag name "body" had been seen, then,
if that token wasn't ignored, reprocess the current token.</p>
<p class="note">The fake end tag token here can only be ignored in
the <a href="#fragment">fragment case</a> .</p>
</dd>
<dt>A start tag whose tag name is one of: "address", <ins class=
"diff-new">"article", "aside",</ins> "blockquote", "center",
<ins class="diff-new">"datagrid", "dialog",</ins> "dir", "div",
"dl", "fieldset", <del class="diff-old">"listing",</del>
<ins class="diff-chg">"footer", "h1", "h2", "h3", "h4", "h5", "h6",
"header",</ins> "menu", <ins class="diff-new">"nav",</ins> "ol",
"p", <ins class="diff-new">"section",</ins> "ul"</dt>
<dd><del class="diff-old">This doesn't match browsers.</del>
<p>If the <a href="#stack">stack of open elements</a> <a href=
"#have-an" title="has an element in scope">has a <code>p</code>
element in scope</a> , then act as if an end tag with the tag name
<code><a href="#p">p</a></code> had been seen.</p>
<p><a href="#insert0">Insert an HTML element</a> for the token.</p>
</dd>
<dt>A start tag whose tag name is <del class="diff-old">"pre"</del>
<ins class="diff-chg">one of: "pre", "listing"</ins></dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> <a href=
"#have-an" title="has an element in scope">has a <code>p</code>
element in scope</a> , then act as if an end tag with the tag name
<code><a href="#p">p</a></code> had been seen.</p>
<p><a href="#insert0">Insert an HTML element</a> for the token.</p>
<p>If the next token is a U+000A LINE FEED (LF) character token,
then ignore that token and move on to the next one. (Newlines at
the start of <code><a href="#pre">pre</a></code> blocks are ignored
as an authoring convenience.)</p>
</dd>
<dt>A start tag whose tag name is "form"</dt>
<dd>
<p>If the <a href="#form-element"><code title="form">form</code>
element pointer</a> is not null, ignore the token with a <a href=
"#parse1">parse error</a> .</p>
<p>Otherwise:</p>
<p>If the <a href="#stack">stack of open elements</a> <a href=
"#have-an" title="has an element in scope">has a <code>p</code>
element in scope</a> , then act as if an end tag with the tag name
<code><a href="#p">p</a></code> had been seen.</p>
<p><a href="#insert0">Insert an HTML element</a> for the token, and
set the <code title="form">form</code> element pointer to point to
the element created.</p>
</dd>
<dt>A start tag whose tag name is "li"</dt>
<dd>
<p><del class="diff-old">If the stack of open elements has a p
element in scope , then act as if an end tag with the tag name p
had been seen.</del> Run the following algorithm:</p>
<ol>
<li>
<p>Initialise <var title="">node</var> to be the <a href=
"#current5">current node</a> (the bottommost node of the
stack).</p>
</li>
<li>
<p>If <var title="">node</var> is an <code><a href=
"#li">li</a></code> element, then <del class="diff-old">pop all the
nodes from</del> <ins class="diff-chg">act as if an end tag
with</ins> the <del class="diff-old">current node</del> <ins class=
"diff-chg">tag name</ins> <code><a href="#li"><ins class=
"diff-chg">li</ins></a> <del class="diff-old">up to node ,
including node , then stop this algorithm. If more than one node is
popped,</del></code> <ins class="diff-chg">had been seen,</ins>
then <del class="diff-old">this is a parse error .</del>
<ins class="diff-chg">jump to the last step.</ins></p>
</li>
<li>
<p>If <var title="">node</var> is not in the <a href=
"#formatting">formatting</a> category, and is not in the <a href=
"#phrasing1">phrasing</a> category, and is not an <code><a href=
"#address">address</a></code> or <code><a href=
"#div">div</a></code> element, then <del class="diff-old">stop this
algorithm.</del> <ins class="diff-chg">jump to the last
step.</ins></p>
</li>
<li>
<p>Otherwise, set <var title="">node</var> to the previous entry in
the <a href="#stack">stack of open elements</a> and return to step
2. <del class="diff-old">Finally, insert an li element . A start
tag whose tag name is one of: "dd", "dt"</del></p>
</li>
<li>
<p>If the <a href="#stack">stack of open elements</a> <a href=
"#have-an" title="has an element in scope">has a <code>p</code>
element in scope</a> , then act as if an end tag with the tag name
<code><a href="#p">p</a></code> had been seen.</p>
<p><ins class="diff-new">Finally,</ins> <a href=
"#insert0"><ins class="diff-new">insert an HTML element</ins></a>
<ins class="diff-new">for the token.</ins></p>
</li>
</ol>
</dd>
<dt><ins class="diff-new">A start tag whose tag name is one of:
"dd", "dt"</ins></dt>
<dd>
<p>Run the following algorithm:</p>
<ol>
<li>
<p>Initialise <var title="">node</var> to be the <a href=
"#current5">current node</a> (the bottommost node of the
stack).</p>
</li>
<li>
<p>If <var title="">node</var> is a <code><a href=
"#dd">dd</a></code> or <code><a href="#dt">dt</a></code> element,
then <del class="diff-old">pop all the nodes from</del> <ins class=
"diff-chg">act as if an end tag with</ins> the <del class=
"diff-old">current node up to node , including</del> <ins class=
"diff-chg">same tag name as</ins> <var title="">node <del class=
"diff-old">, then stop this algorithm. If more than one node is
popped,</del></var> <ins class="diff-chg">had been seen,</ins> then
<del class="diff-old">this is a parse error .</del> <ins class=
"diff-chg">jump to the last step.</ins></p>
</li>
<li>
<p>If <var title="">node</var> is not in the <a href=
"#formatting">formatting</a> category, and is not in the <a href=
"#phrasing1">phrasing</a> category, and is not an <code><a href=
"#address">address</a></code> or <code><a href=
"#div">div</a></code> element, then <del class="diff-old">stop this
algorithm.</del> <ins class="diff-chg">jump to the last
step.</ins></p>
</li>
<li>
<p>Otherwise, set <var title="">node</var> to the previous entry in
the <a href="#stack">stack of open elements</a> and return to step
2.</p>
</li>
<li>
<p><ins class="diff-chg">If the</ins> <a href="#stack"><ins class=
"diff-chg">stack of open elements</ins></a> <a href="#have-an"
title="has an element in scope"><ins class="diff-chg">has a</ins>
<code><ins class="diff-chg">p</ins></code> <ins class=
"diff-chg">element in scope</ins></a> ,<ins class="diff-chg">then
act as if an end tag with the tag name</ins> <code><a href=
"#p"><ins class="diff-chg">p</ins></a></code> <ins class=
"diff-chg">had been seen.</ins></p>
<p>Finally, <a href="#insert0">insert an HTML element</a>
<del class="diff-old">with the same tag name as</del> <ins class=
"diff-chg">for</ins> the <del class="diff-old">token's.</del>
<ins class="diff-chg">token.</ins></p>
</li>
</ol>
</dd>
<dt>A start tag whose tag name is "plaintext"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> <a href=
"#have-an" title="has an element in scope">has a <code>p</code>
element in scope</a> , then act as if an end tag with the tag name
<code><a href="#p">p</a></code> had been seen.</p>
<p><a href="#insert0">Insert an HTML element</a> for the token.</p>
<p>Switch the <a href="#content2">content model flag</a> to the
PLAINTEXT state.</p>
<p class="note">Once a start tag with the tag name "plaintext" has
been seen, that will be the last token ever seen other than
character tokens (and the end-of-file token), because there is no
way to switch the <a href="#content2">content model flag</a> out of
the PLAINTEXT state.</p>
</dd>
<dt>An end tag whose tag name is one of: "address", <ins class=
"diff-new">"article", "aside",</ins> "blockquote", "center",
<ins class="diff-new">"datagrid", "dialog",</ins> "dir", "div",
"dl", "fieldset", <ins class="diff-new">"footer", "header",</ins>
"listing", "menu", <ins class="diff-new">"nav",</ins> "ol", "pre",
<ins class="diff-new">"section",</ins> "ul"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> <del class=
"diff-old">has</del> <ins class="diff-chg">does not</ins> <a href=
"#have-an" title="has an element in scope"><ins class=
"diff-chg">have</ins> an element in scope</a> with the same tag
name as that of the token, then <ins class="diff-new">this is
a</ins> <a href="#parse1"><ins class="diff-new">parse
error</ins></a> .</p>
<p><ins class="diff-new">Otherwise, run these steps:</ins></p>
<ol>
<li>
<p><a href="#generate"><del class="diff-old">generate</del>
<ins class="diff-chg">Generate</ins> implied end tags</a> .</p>
</li>
<li>
<p><del class="diff-old">Now, if</del> <ins class=
"diff-chg">If</ins> the <a href="#current5">current node</a> is not
an element with the same tag name as that of the token, then this
is a <a href="#parse1">parse error</a> .</p>
</li>
<li>
<p><del class="diff-old">If</del> <ins class="diff-chg">Pop
elements from</ins> the <a href="#stack">stack of open elements</a>
<del class="diff-old">has</del> <ins class="diff-chg">until</ins>
an element <del class="diff-old">in scope</del> with the same tag
name as <del class="diff-old">that of</del> the <del class=
"diff-old">token, then pop elements from this stack until an
element with that tag name</del> <ins class="diff-chg">token</ins>
has been popped from the stack.</p>
</li>
</ol>
</dd>
<dt>An end tag whose tag name is "form"</dt>
<dd>
<p><ins class="diff-new">Set the</ins> <a href=
"#form-element"><code title=""><ins class=
"diff-new">form</ins></code> <ins class="diff-new">element
pointer</ins></a> <ins class="diff-new">to null.</ins></p>
<p>If the <a href="#stack">stack of open elements</a> <del class=
"diff-old">has</del> <ins class="diff-chg">does not</ins> <a href=
"#have-an" title="has an element in scope"><ins class=
"diff-chg">have</ins> an element in scope</a> with the same tag
name as that of the token, then <ins class="diff-new">this is
a</ins> <a href="#parse1"><ins class="diff-new">parse
error</ins></a> .</p>
<p><ins class="diff-new">Otherwise, run these steps:</ins></p>
<ol>
<li>
<p><a href="#generate"><del class="diff-old">generate</del>
<ins class="diff-chg">Generate</ins> implied end tags</a> .</p>
</li>
<li>
<p><del class="diff-old">Now, if</del> <ins class=
"diff-chg">If</ins> the <a href="#current5">current node</a> is not
an element with the same tag name as that of the token, then this
is a <a href="#parse1">parse error</a> .</p>
</li>
<li>
<p><del class="diff-old">Otherwise, if</del> <ins class=
"diff-chg">Pop elements from</ins> the <del class=
"diff-old">current node</del> <a href="#stack"><ins class=
"diff-chg">stack of open elements</ins></a> <del class=
"diff-old">is</del> <ins class="diff-chg">until</ins> an element
with the same tag name as <del class="diff-old">that of</del> the
token <del class="diff-old">pop that element</del> <ins class=
"diff-chg">has been popped</ins> from the stack. <del class=
"diff-old">In any case, set the form element pointer to
null.</del></p>
</li>
</ol>
</dd>
<dt>An end tag whose tag name is "p"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> <ins class=
"diff-new">does not</ins> <a href="#have-an" title=
"has an element in scope"><del class="diff-old">has a p</del>
<ins class="diff-chg">have an</ins> element in scope <del class=
"diff-old">,</del></a> <ins class="diff-chg">with the same tag name
as that of the token,</ins> then <del class="diff-old">generate
implied end tags , except for</del> <ins class="diff-chg">this is
a</ins> <a href="#parse1"><ins class="diff-chg">parse
error</ins></a> <ins class="diff-chg">; act as if a start tag with
the tag name</ins> <code><a href="#p">p</a></code> <del class=
"diff-old">elements.</del> <ins class="diff-chg">had been seen,
then reprocess the current token.</ins></p>
<p><ins class="diff-new">Otherwise, run these steps:</ins></p>
<ol>
<li>
<p><a href="#generate"><ins class="diff-new">Generate implied end
tags</ins></a> ,<ins class="diff-new">except for elements with the
same tag name as the token.</ins></p>
</li>
<li>
<p>If the <a href="#current5">current node</a> is not <del class=
"diff-old">a p element,</del> <ins class="diff-chg">an element with
the same tag name as that of the token,</ins> then this is a
<a href="#parse1">parse error</a> .</p>
</li>
<li>
<p><del class="diff-old">If</del> <ins class="diff-chg">Pop
elements from</ins> the <a href="#stack">stack of open elements</a>
<del class="diff-old">has a p element in scope , then pop elements
from this stack</del> until <del class="diff-old">the stack no
longer has a p</del> <ins class="diff-chg">an</ins> element
<del class="diff-old">in scope . Otherwise, act as if a start
tag</del> with the <ins class="diff-new">same</ins> tag name
<del class="diff-old">p had</del> <ins class="diff-chg">as the
token has</ins> been <del class="diff-old">seen, then
reprocess</del> <ins class="diff-chg">popped from</ins> the
<del class="diff-old">current token.</del> <ins class=
"diff-chg">stack.</ins></p>
</li>
</ol>
</dd>
<dt>An end tag whose tag name is one of: "dd", "dt", "li"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> <del class=
"diff-old">has</del> <ins class="diff-chg">does not</ins> <a href=
"#have-an" title="has an element in scope"><ins class=
"diff-chg">have</ins> an element in scope</a> <del class=
"diff-old">whose tag name matches</del> <ins class=
"diff-chg">with</ins> the <ins class="diff-new">same</ins> tag name
<ins class="diff-new">as that</ins> of the token, then <ins class=
"diff-new">this is a</ins> <a href="#parse1"><ins class=
"diff-new">parse error</ins></a> .</p>
<p><ins class="diff-new">Otherwise, run these steps:</ins></p>
<ol>
<li>
<p><a href="#generate"><del class="diff-old">generate</del>
<ins class="diff-chg">Generate</ins> implied end tags</a> , except
for elements with the same tag name as the token.</p>
</li>
<li>
<p>If the <a href="#current5">current node</a> is not an element
with the same tag name as <ins class="diff-new">that of</ins> the
token, then this is a <a href="#parse1">parse error</a> .</p>
</li>
<li>
<p><del class="diff-old">If</del> <ins class="diff-chg">Pop
elements from</ins> the <a href="#stack">stack of open elements</a>
<del class="diff-old">has an element in scope whose tag name
matches the tag name of the token, then pop elements from this
stack</del> until an element with <del class="diff-old">that</del>
<ins class="diff-chg">the same</ins> tag name <ins class=
"diff-new">as the token</ins> has been popped from the stack.
<del class="diff-old">A start tag whose tag name is one of: "h1",
"h2", "h3", "h4", "h5", "h6" If the stack of open elements has a p
element in scope , then act as if an end tag with the tag name p
had been seen. Insert an HTML element for the token.</del></p>
</li>
</ol>
</dd>
<dt>An end tag whose tag name is one of: "h1", "h2", "h3", "h4",
"h5", "h6"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> <ins class=
"diff-new">does not</ins> <a href="#have-an" title=
"has an element in scope"><del class="diff-old">has</del>
<ins class="diff-chg">have an element</ins> in scope</a>
<del class="diff-old">an element</del> whose tag name is one of
"h1", "h2", "h3", "h4", "h5", or "h6", then <ins class=
"diff-new">this is a</ins> <a href="#parse1"><ins class=
"diff-new">parse error</ins></a> .</p>
<p><ins class="diff-new">Otherwise, run these steps:</ins></p>
<ol>
<li>
<p><a href="#generate"><del class="diff-old">generate</del>
<ins class="diff-chg">Generate</ins> implied end tags</a> .</p>
</li>
<li>
<p><del class="diff-old">Now, if</del> <ins class=
"diff-chg">If</ins> the <a href="#current5">current node</a> is not
an element with the same tag name as that of the token, then this
is a <a href="#parse1">parse error</a> .</p>
</li>
<li>
<p><del class="diff-old">If</del> <ins class="diff-chg">Pop
elements from</ins> the <a href="#stack">stack of open elements</a>
<del class="diff-old">has in scope</del> <ins class=
"diff-chg">until</ins> an element whose tag name is one of "h1",
"h2", "h3", "h4", "h5", or <del class="diff-old">"h6", then pop
elements from the stack until an element with one of those tag
names</del> <ins class="diff-chg">"h6"</ins> has been popped from
the stack.</p>
</li>
</ol>
</dd>
<dt><ins class="diff-new">An end tag whose tag name is
"sarcasm"</ins></dt>
<dd>
<p><ins class="diff-new">Take a deep breath, then act as described
in the "any other end tag" entry below.</ins></p>
</dd>
<dt>A start tag whose tag name is "a"</dt>
<dd>
<p>If the <a href="#list-of4">list of active formatting
elements</a> contains an element whose tag name is "a" between the
end of the list and the last marker on the list (or the start of
the list if there is no marker on the list), then this is a
<a href="#parse1">parse error</a> ; act as if an end tag with the
tag name "a" had been seen, then remove that element from the
<a href="#list-of4">list of active formatting elements</a> and the
<a href="#stack">stack of open elements</a> if the end tag didn't
already remove it (it might not have if the element is not <a href=
"#have-an0" title="has an element in table scope">in table
scope</a> ).</p>
<p class="example">In the non-conforming stream
<code><a href="a"> a<table>
<a href="b"> b</table> x</code> , the first
<code><a href="#a">a</a></code> element would be closed upon seeing
the second one, and the "x" character would be inside a link to
"b", not to "a". This is despite the fact that the outer
<code><a href="#a">a</a></code> element is not in table scope
(meaning that a regular <code></a></code> end tag at the
start of the table wouldn't close the outer <code><a href=
"#a">a</a></code> element).</p>
<p><a href="#reconstruct">Reconstruct the active formatting
elements</a> , if any.</p>
<p><a href="#insert0">Insert an HTML element</a> for the token. Add
that element to the <a href="#list-of4">list of active formatting
elements</a> .</p>
</dd>
<dt>A start tag whose tag name is one of: "b", "big", "em", "font",
"i", "s", "small", "strike", "strong", "tt", "u"</dt>
<dd>
<p><a href="#reconstruct">Reconstruct the active formatting
elements</a> , if any.</p>
<p><a href="#insert0">Insert an HTML element</a> for the token. Add
that element to the <a href="#list-of4">list of active formatting
elements</a> .</p>
</dd>
<dt>A start tag whose tag name is "nobr"</dt>
<dd>
<p><a href="#reconstruct">Reconstruct the active formatting
elements</a> , if any.</p>
<p>If the <a href="#stack">stack of open elements</a> <a href=
"#have-an" title="has an element in scope">has a <code>nobr</code>
element in scope</a> , then this is a <a href="#parse1">parse
error</a> . Act as if an end tag with the tag name
<code>nobr</code> had been seen, then once again <a href=
"#reconstruct">reconstruct the active formatting elements</a> , if
any.</p>
<p><a href="#insert0">Insert an HTML element</a> for the token. Add
that element to the <a href="#list-of4">list of active formatting
elements</a> .</p>
</dd>
<dt id="adoptionAgency">An end tag whose tag name is one of: "a",
"b", "big", "em", "font", "i", "nobr", "s", "small", "strike",
"strong", "tt", "u"</dt>
<dd>
<p>Follow these steps:</p>
<ol>
<li>
<p>Let the <var title="">formatting element</var> be the last
element in the <a href="#list-of4">list of active formatting
elements</a> that:</p>
<ul>
<li>is between the end of the list and the last scope marker in the
list, if any, or the start of the list otherwise, and</li>
<li>has the same tag name as the token.</li>
</ul>
<p>If there is no such node, or, if that node is also in the
<a href="#stack">stack of open elements</a> but the element is not
<a href="#have-an" title="has an element in scope">in scope</a> ,
then this is a <a href="#parse1">parse error</a> . Abort these
steps. The token is ignored.</p>
<p>Otherwise, if there is such a node, but that node is not in the
<a href="#stack">stack of open elements</a> , then this is a
<a href="#parse1">parse error</a> ; remove the element from the
list, and abort these steps.</p>
<p>Otherwise, there is a <var title="">formatting element</var> and
that element is in <a href="#stack" title=
"stack of open elements">the stack</a> and is <a href="#have-an"
title="has an element in scope">in scope</a> . If the element is
not the <a href="#current5">current node</a> , this is a <a href=
"#parse1">parse error</a> . In any case, proceed with the algorithm
as written in the following steps.</p>
</li>
<li>
<p>Let the <var title="">furthest block</var> be the topmost node
in the <a href="#stack">stack of open elements</a> that is lower in
the stack than the <var title="">formatting element</var> , and is
not an element in the <a href="#phrasing1">phrasing</a> or <a href=
"#formatting">formatting</a> categories. There might not be
one.</p>
</li>
<li>
<p>If there is no <var title="">furthest block</var> , then the UA
must skip the subsequent steps and instead just pop all the nodes
from the bottom of the <a href="#stack">stack of open elements</a>
, from the <a href="#current5">current node</a> up to and including
the <var title="">formatting element</var> , and remove the
<var title="">formatting element</var> from the <a href=
"#list-of4">list of active formatting elements</a> .</p>
</li>
<li>
<p>Let the <var title="">common ancestor</var> be the element
immediately above the <var title="">formatting element</var> in the
<a href="#stack">stack of open elements</a> .</p>
</li>
<li>
<p>If the <var title="">furthest block</var> has a parent node,
then remove the <var title="">furthest block</var> from its parent
node.</p>
</li>
<li>
<p>Let a bookmark note the position of the <var title="">formatting
element</var> in the <a href="#list-of4">list of active formatting
elements</a> relative to the elements on either side of it in the
list.</p>
</li>
<li>
<p>Let <var title="">node</var> and <var title="">last node</var>
be the <var title="">furthest block</var> . Follow these steps:</p>
<ol>
<li>Let <var title="">node</var> be the element immediately
<del class="diff-old">prior to</del> <ins class=
"diff-chg">above</ins> <var title="">node</var> in the <a href=
"#stack">stack of open elements</a> .</li>
<li>If <var title="">node</var> is not in the <a href=
"#list-of4">list of active formatting elements</a> , then remove
<var title="">node</var> from the <a href="#stack">stack of open
elements</a> and then go back to step 1.</li>
<li>Otherwise, if <var title="">node</var> is the <var title=
"">formatting element</var> , then go to the next step in the
overall algorithm.</li>
<li>Otherwise, if <var title="">last node</var> is the <var title=
"">furthest block</var> , then move the aforementioned bookmark to
be immediately after the <var title="">node</var> in the <a href=
"#list-of4">list of active formatting elements</a> .</li>
<li>If <var title="">node</var> has any children, perform a shallow
clone of <var title="">node</var> , replace the entry for
<var title="">node</var> in the <a href="#list-of4">list of active
formatting elements</a> with an entry for the clone, replace the
entry for <var title="">node</var> in the <a href="#stack">stack of
open elements</a> with an entry for the clone, and let <var title=
"">node</var> be the clone.</li>
<li>Insert <var title="">last node</var> into <var title=
"">node</var> , first removing it from its previous parent node if
any.</li>
<li>Let <var title="">last node</var> be <var title="">node</var>
.</li>
<li>Return to step 1 of this inner set of steps.</li>
</ol>
</li>
<li>
<p><del class="diff-old">Insert</del> <ins class="diff-chg">If
the</ins> <var title=""><ins class="diff-chg">common
ancestor</ins></var> <ins class="diff-chg">node is a</ins>
<code><a href="#table"><ins class="diff-chg">table</ins></a></code>
,<code><a href="#tbody"><ins class=
"diff-chg">tbody</ins></a></code> ,<code><a href=
"#tfoot0"><ins class="diff-chg">tfoot</ins></a></code>
,<code><a href="#thead0"><ins class=
"diff-chg">thead</ins></a></code> ,<ins class="diff-chg">or</ins>
<code><a href="#tr"><ins class="diff-chg">tr</ins></a></code>
<ins class="diff-chg">element, then,</ins> <a href=
"#foster0"><ins class="diff-chg">foster parent</ins></a>
<ins class="diff-chg">whatever</ins> <var title=""><ins class=
"diff-chg">last node</ins></var> <ins class="diff-chg">ended up
being in the previous step.</ins></p>
<p><ins class="diff-chg">Otherwise, append</ins> whatever
<var title="">last node</var> ended up being in the previous step
<del class="diff-old">into</del> <ins class="diff-chg">to</ins> the
<var title="">common ancestor</var> node, first removing it from
its previous parent node if any.</p>
</li>
<li>
<p>Perform a shallow clone of the <var title="">formatting
element</var> .</p>
</li>
<li>
<p>Take all of the child nodes of the <var title="">furthest
block</var> and append them to the clone created in the last
step.</p>
</li>
<li>
<p>Append that clone to the <var title="">furthest block</var>
.</p>
</li>
<li>
<p>Remove the <var title="">formatting element</var> from the
<a href="#list-of4">list of active formatting elements</a> , and
insert the clone into the <a href="#list-of4">list of active
formatting elements</a> at the position of the aforementioned
bookmark.</p>
</li>
<li>
<p>Remove the <var title="">formatting element</var> from the
<a href="#stack">stack of open elements</a> , and insert the clone
into the <a href="#stack">stack of open elements</a> immediately
<del class="diff-old">after (i.e. in a more deeply nested position
than)</del> <ins class="diff-chg">below</ins> the position of the
<var title="">furthest block</var> in that stack.</p>
</li>
<li>
<p>Jump back to step 1 in this series of steps.</p>
</li>
</ol>
<p class="note">The way these steps are defined, only elements in
the <a href="#formatting">formatting</a> category ever get cloned
by this algorithm.</p>
<p class="note">Because of the way this algorithm causes elements
to change parents, it has been dubbed the "adoption agency
algorithm" (in contrast with other possibly algorithms for dealing
with misnested content, which included the "incest algorithm", the
"secret affair algorithm", and the "Heisenberg algorithm").</p>
</dd>
<dt>A start tag whose tag name is "button"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> <a href=
"#have-an" title="has an element in scope">has a
<code>button</code> element in scope</a> , then this is a <a href=
"#parse1">parse error</a> ; act as if an end tag with the tag name
"button" had been seen, then reprocess the token.</p>
<p>Otherwise:</p>
<p><a href="#reconstruct">Reconstruct the active formatting
elements</a> , if any.</p>
<p><a href="#insert0">Insert an HTML element</a> for the token.</p>
<p><ins class="diff-new">If the</ins> <a href=
"#form-element"><code title=""><ins class=
"diff-new">form</ins></code> <ins class="diff-new">element
pointer</ins></a> <ins class="diff-new">is not null, then</ins>
<span><ins class="diff-new">associate</ins></span> <ins class=
"diff-new">the</ins> <code><ins class=
"diff-new">button</ins></code> <ins class="diff-new">element with
the</ins> <code><ins class="diff-new">form</ins></code> <ins class=
"diff-new">element pointed to by the</ins> <a href=
"#form-element"><code title=""><ins class=
"diff-new">form</ins></code> <ins class="diff-new">element
pointer</ins></a> .</p>
<p>Insert a marker at the end of the <a href="#list-of4">list of
active formatting elements</a> .</p>
</dd>
<dt>A start tag token whose tag name is one of: <ins class=
"diff-new">"applet",</ins> "marquee", "object"</dt>
<dd>
<p><a href="#reconstruct">Reconstruct the active formatting
elements</a> , if any.</p>
<p><a href="#insert0">Insert an HTML element</a> for the token.</p>
<p>Insert a marker at the end of the <a href="#list-of4">list of
active formatting elements</a> .</p>
</dd>
<dt>An end tag token whose tag name is one of: <ins class=
"diff-new">"applet",</ins> "button", "marquee", "object"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> <ins class=
"diff-new">does not</ins> <a href="#have-an" title=
"has an element in scope"><del class="diff-old">has</del>
<ins class="diff-chg">have an element</ins> in scope</a>
<del class="diff-old">an element whose tag name is</del>
<ins class="diff-chg">with</ins> the same <del class="diff-old">as
the</del> tag name <ins class="diff-new">as that</ins> of the
token, then <ins class="diff-new">this is a</ins> <a href=
"#parse1"><ins class="diff-new">parse error</ins></a> .</p>
<p><ins class="diff-new">Otherwise, run these steps:</ins></p>
<ol>
<li>
<p><a href="#generate"><del class="diff-old">generate</del>
<ins class="diff-chg">Generate</ins> implied end tags</a> .</p>
</li>
<li>
<p><del class="diff-old">Now, if</del> <ins class=
"diff-chg">If</ins> the <a href="#current5">current node</a> is not
an element with the same tag name as <ins class="diff-new">that
of</ins> the token, then this is a <a href="#parse1">parse
error</a> .</p>
</li>
<li>
<p><del class="diff-old">Now, if</del> <ins class="diff-chg">Pop
elements from</ins> the <a href="#stack">stack of open elements</a>
<del class="diff-old">has</del> <ins class="diff-chg">until</ins>
an element <del class="diff-old">in scope whose tag name
matches</del> <ins class="diff-chg">with</ins> the <ins class=
"diff-new">same</ins> tag name <del class="diff-old">of the token,
then pop elements from</del> <ins class="diff-chg">as</ins> the
<del class="diff-old">stack until that element</del> <ins class=
"diff-chg">token</ins> has been popped from the <del class=
"diff-old">stack, and clear</del> <ins class=
"diff-chg">stack.</ins></p>
</li>
<li><a href="#clear1"><ins class="diff-chg">Clear</ins> the list of
active formatting elements up to the last marker</a> .</li>
</ol>
</dd>
<dt>A start tag whose tag name is "xmp"</dt>
<dd>
<p><a href="#reconstruct">Reconstruct the active formatting
elements</a> , if any.</p>
<p>Follow the <a href="#generic">generic CDATA parsing algorithm
<del class="diff-old">, with the current node as the context node
.</del></a> .</p>
</dd>
<dt>A start tag whose tag name is "table"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> <a href=
"#have-an" title="has an element in scope">has a <code>p</code>
element in scope</a> , then act as if an end tag with the tag name
<code><a href="#p">p</a></code> had been seen.</p>
<p><a href="#insert0">Insert an HTML element</a> for the token.</p>
<p><del class="diff-old">Change</del> <ins class=
"diff-chg">Switch</ins> the <span>insertion mode</span> to "
<a href="#in-table" title="insertion mode: in table">in table</a>
".</p>
</dd>
<dt>A start tag whose tag name is one of: "area", "basefont",
"bgsound", "br", "embed", "img", <del class=
"diff-old">"param",</del> "spacer", "wbr"</dt>
<dd>
<p><a href="#reconstruct">Reconstruct the active formatting
elements</a> , if any.</p>
<p><a href="#insert0">Insert an HTML element</a> for the token.
Immediately pop the <a href="#current5"><ins class=
"diff-chg">current node</ins></a> <ins class="diff-chg">off
the</ins> <a href="#stack"><ins class="diff-chg">stack of open
elements</ins></a> .</p>
<p><a href="#acknowledged" title=
"acknowledge self-closing flag"><ins class="diff-chg">Acknowledge
the token's</ins> <i><ins class="diff-chg">self-closing
flag</ins></i></a> ,<ins class="diff-chg">if it is set.</ins></p>
</dd>
<dt><ins class="diff-chg">A start tag whose tag name is one of:
"param", "source"</ins></dt>
<dd>
<p><a href="#insert0"><ins class="diff-chg">Insert an HTML
element</ins></a> <ins class="diff-chg">for the token. Immediately
pop the</ins> <a href="#current5">current node</a> off the <a href=
"#stack">stack of open elements</a> .</p>
<p><a href="#acknowledged" title=
"acknowledge self-closing flag"><ins class="diff-new">Acknowledge
the token's</ins> <i><ins class="diff-new">self-closing
flag</ins></i></a> ,<ins class="diff-new">if it is set.</ins></p>
</dd>
<dt>A start tag whose tag name is "hr"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> <a href=
"#have-an" title="has an element in scope">has a <code>p</code>
element in scope</a> , then act as if an end tag with the tag name
<code><a href="#p">p</a></code> had been seen.</p>
<p><a href="#insert0">Insert an HTML element</a> for the token.
Immediately pop the <a href="#current5">current node</a> off the
<a href="#stack">stack of open elements</a> .</p>
<p><a href="#acknowledged" title=
"acknowledge self-closing flag"><ins class="diff-new">Acknowledge
the token's</ins> <i><ins class="diff-new">self-closing
flag</ins></i></a> ,<ins class="diff-new">if it is set.</ins></p>
</dd>
<dt>A start tag whose tag name is "image"</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Change the token's tag name
to "img" and reprocess it. (Don't ask.)</p>
</dd>
<dt>A start tag whose tag name is "input"</dt>
<dd>
<p><a href="#reconstruct">Reconstruct the active formatting
elements</a> , if any.</p>
<p><a href="#insert0">Insert an <del class="diff-old">input</del>
<ins class="diff-chg">HTML</ins> element</a> for the token.
<ins class="diff-new">Immediately pop the</ins> <a href=
"#current5"><ins class="diff-new">current node</ins></a>
<ins class="diff-new">off the</ins> <a href="#stack"><ins class=
"diff-new">stack of open elements</ins></a> .</p>
<p><a href="#acknowledged" title=
"acknowledge self-closing flag"><ins class="diff-new">Acknowledge
the token's</ins> <i><ins class="diff-new">self-closing
flag</ins></i></a> ,<ins class="diff-new">if it is set.</ins></p>
<p>If the <a href="#form-element"><code title="">form</code>
element pointer</a> is not null, then <span>associate</span> the
<ins class="diff-new">newly created</ins> <code>input</code>
element with the <code>form</code> element pointed to by the
<a href="#form-element"><code title="">form</code> element
pointer</a> .</p>
<del class="diff-old">Pop that input element off the stack of open
elements .</del></dd>
<dt id="isindex">A start tag whose tag name is "isindex"</dt>
<dd>
<p><a href="#parse1">Parse error</a> .</p>
<p>If the <a href="#form-element"><code title="">form</code>
element pointer</a> is not null, then ignore the token.</p>
<p>Otherwise:</p>
<p><a href="#acknowledged" title=
"acknowledge self-closing flag"><ins class="diff-new">Acknowledge
the token's</ins> <i><ins class="diff-new">self-closing
flag</ins></i></a> ,<ins class="diff-new">if it is set.</ins></p>
<p>Act as if a start tag token with the tag name "form" had been
seen.</p>
<p>If the token has an attribute called "action", set the
<code title="attr-form-action">action</code> attribute on the
resulting <code>form</code> element to the value of the "action"
attribute of the token.</p>
<p>Act as if a start tag token with the tag name "hr" had been
seen.</p>
<p>Act as if a start tag token with the tag name "p" had been
seen.</p>
<p>Act as if a start tag token with the tag name "label" had been
seen.</p>
<p>Act as if a stream of character tokens had been seen (see below
for what they should say).</p>
<p>Act as if a start tag token with the tag name "input" had been
seen, with all the attributes from the "isindex" token except
"name", "action", and "prompt". Set the <code title=
"attr-input-name">name</code> attribute of the resulting
<code>input</code> element to the value " <code title=
"">isindex</code> ".</p>
<p>Act as if a stream of character tokens had been seen (see below
for what they should say).</p>
<p>Act as if an end tag token with the tag name "label" had been
seen.</p>
<p>Act as if an end tag token with the tag name "p" had been
seen.</p>
<p>Act as if a start tag token with the tag name "hr" had been
seen.</p>
<p>Act as if an end tag token with the tag name "form" had been
seen.</p>
<p>If the token has an attribute with the name "prompt", then the
first stream of characters must be the same string as given in that
attribute, and the second stream of characters must be empty.
Otherwise, the two streams of character tokens together should,
together with the <code>input</code> element, express the
equivalent of "This is a searchable index. Insert your search
keywords here: (input field)" in the user's preferred language.</p>
<p class="big-issue">Then need to specify that if the form
submission causes just a single form control, whose name is
"isindex", to be submitted, then we submit just the value part, not
the "isindex=" part.</p>
</dd>
<dt>A start tag whose tag name is "textarea"</dt>
<dd>
<p><a href="#create">Create an element for the token</a>
<ins class="diff-new">in the</ins> <a href=
"#html-namespace0"><ins class="diff-new">HTML namespace</ins></a>
.<ins class="diff-new">Append the new element to the</ins> <a href=
"#current5"><ins class="diff-new">current node</ins></a> .</p>
<p>If the <a href="#form-element"><code title="">form</code>
element pointer</a> is not null, then <span>associate</span> the
<ins class="diff-new">newly created</ins> <code>textarea</code>
element with the <code>form</code> element pointed to by the
<a href="#form-element"><code title="">form</code> element
pointer</a> .</p>
<p><del class="diff-old">Append the new element to the current node
.</del> Switch the tokeniser's <a href="#content2">content model
flag</a> to the RCDATA state.</p>
<p>If the next token is a U+000A LINE FEED (LF) character token,
then ignore that token and move on to the next one. (Newlines at
the start of <code>textarea</code> elements are ignored as an
authoring convenience.)</p>
<p>Then, collect all the character tokens that the tokeniser
returns until it returns a token that is not a character token, or
until it stops tokenising.</p>
<p>If this process resulted in a collection of character tokens,
append a single <code>Text</code> node, whose contents is the
concatenation of all those tokens' characters, to the new element
node.</p>
<p>The tokeniser's <a href="#content2">content model flag</a> will
have switched back to the PCDATA state.</p>
<p>If the next token is an end tag token with the tag name
"textarea", ignore it. Otherwise, this is a <a href="#parse1">parse
error</a> .</p>
</dd>
<dt>A start tag whose tag name is one of: "iframe", <del class=
"diff-old">"noembed", "noframes"</del> <ins class=
"diff-chg">"noembed"</ins></dt>
<dt>A start tag whose tag name is "noscript", if <ins class=
"diff-new">the</ins> <a href="#scripting2">scripting <ins class=
"diff-new">flag</ins></a> is enabled <del class=
"diff-old">:</del></dt>
<dd>
<p>Follow the <a href="#generic">generic CDATA parsing algorithm
<del class="diff-old">, with the current node as the context node
.</del></a> .</p>
</dd>
<dt>A start tag whose tag name is "select"</dt>
<dd>
<p><a href="#reconstruct">Reconstruct the active formatting
elements</a> , if any.</p>
<p><a href="#insert0">Insert an HTML element</a> for the token.</p>
<p><del class="diff-old">Change</del> <ins class=
"diff-chg">If</ins> the <a href="#form-element"><code title=
""><ins class="diff-chg">form</ins></code> <ins class=
"diff-chg">element pointer</ins></a> <ins class="diff-chg">is not
null, then</ins> <span><ins class="diff-chg">associate</ins></span>
<ins class="diff-chg">the</ins> <code><ins class=
"diff-chg">select</ins></code> <ins class="diff-chg">element with
the</ins> <code><ins class="diff-chg">form</ins></code> <ins class=
"diff-chg">element pointed to by the</ins> <a href=
"#form-element"><code title=""><ins class=
"diff-chg">form</ins></code> <ins class="diff-chg">element
pointer</ins></a> .</p>
<p><ins class="diff-chg">If the</ins> <span>insertion mode</span>
<ins class="diff-new">is one of</ins> <a href="#in-table" title=
"insertion mode: in table"><ins class="diff-new">in table</ins></a>
<ins class="diff-new">", "</ins> <a href="#in-caption" title=
"insertion mode: in caption"><ins class="diff-new">in
caption</ins></a> <ins class="diff-new">", "</ins> <a href=
"#in-column" title="insertion mode: in column group"><ins class=
"diff-new">in column group</ins></a> <ins class="diff-new">",
"</ins> <a href="#in-table0" title=
"insertion mode: in table body"><ins class="diff-new">in table
body</ins></a> <ins class="diff-new">", "</ins> <a href="#in-row"
title="insertion mode: in row"><ins class="diff-new">in
row</ins></a> <ins class="diff-new">", or "</ins> <a href=
"#in-cell" title="insertion mode: in cell"><ins class="diff-new">in
cell</ins></a> <ins class="diff-new">", then switch the</ins>
<span><ins class="diff-new">insertion mode</ins></span> <ins class=
"diff-new">to "</ins> <a href="#in-select0" title=
"insertion mode: in select in table"><ins class="diff-new">in
select in table</ins></a> <ins class="diff-new">". Otherwise,
switch the</ins> <span><ins class="diff-new">insertion
mode</ins></span> to " <a href="#in-select" title=
"insertion mode: in select">in select</a> ".</p>
</dd>
<dt><ins class="diff-new">A start tag whose tag name is one of:
"rp", "rt"</ins></dt>
<dd>
<p><ins class="diff-new">If the</ins> <a href="#stack"><ins class=
"diff-new">stack of open elements</ins></a> <a href="#have-an"
title="has an element in scope"><ins class="diff-new">has a</ins>
<code><ins class="diff-new">ruby</ins></code> <ins class=
"diff-new">element in scope</ins></a> ,<ins class=
"diff-new">then</ins> <a href="#generate"><ins class=
"diff-new">generate implied end tags</ins></a> .<ins class=
"diff-new">If the</ins> <a href="#current5"><ins class=
"diff-new">current node</ins></a> <ins class="diff-new">is not then
a</ins> <code><a href="#ruby"><ins class=
"diff-new">ruby</ins></a></code> <ins class="diff-new">element,
this is a</ins> <a href="#parse1"><ins class="diff-new">parse
error</ins></a> <ins class="diff-new">; pop all the nodes from
the</ins> <a href="#current5"><ins class="diff-new">current
node</ins></a> <ins class="diff-new">up to the node immediately
before the bottommost</ins> <code><a href="#ruby"><ins class=
"diff-new">ruby</ins></a></code> <ins class="diff-new">element on
the</ins> <a href="#stack"><ins class="diff-new">stack of open
elements</ins></a> .</p>
<p><a href="#insert0"><ins class="diff-new">Insert an HTML
element</ins></a> <ins class="diff-new">for the token.</ins></p>
</dd>
<dt>An end tag whose tag name is "br"</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Act as if a start tag token
with the tag name "br" had been seen. Ignore the end tag token.</p>
</dd>
<dt>A start <del class="diff-old">or end</del> <ins class=
"diff-chg">tag whose tag name is "math"</ins></dt>
<dd>
<p><a href="#reconstruct"><ins class="diff-chg">Reconstruct the
active formatting elements</ins></a> ,<ins class="diff-chg">if
any.</ins></p>
<p><a href="#adjust"><ins class="diff-chg">Adjust foreign
attributes</ins></a> <ins class="diff-chg">for the token. (This
fixes the use of namespaced attributes, in particular
XLink.)</ins></p>
<p><a href="#insert1"><ins class="diff-chg">Insert a foreign
element</ins></a> <ins class="diff-chg">for the token, in the</ins>
<a href="#mathml0"><ins class="diff-chg">MathML namespace</ins></a>
.</p>
<p><ins class="diff-chg">If the token has its</ins> <i><ins class=
"diff-chg">self-closing flag</ins></i> <ins class="diff-chg">set,
pop the</ins> <a href="#current5"><ins class="diff-chg">current
node</ins></a> <ins class="diff-chg">off the</ins> <a href=
"#stack"><ins class="diff-chg">stack of open elements</ins></a>
<ins class="diff-chg">and</ins> <a href="#acknowledged" title=
"acknowledge self-closing flag"><ins class="diff-chg">acknowledge
the token's</ins> <i><ins class="diff-chg">self-closing
flag</ins></i></a> .</p>
<p><ins class="diff-chg">Otherwise, let the</ins> <a href=
"#secondary1"><ins class="diff-chg">secondary insertion
mode</ins></a> <ins class="diff-chg">be the current</ins>
<span><ins class="diff-chg">insertion mode</ins></span>
,<ins class="diff-chg">and then switch the</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> <ins class="diff-chg">to
"</ins> <a href="#in-foreign" title=
"insertion mode: in foreign content"><ins class="diff-chg">in
foreign content</ins></a> <ins class="diff-chg">".</ins></p>
</dd>
<dt><ins class="diff-chg">A start</ins> tag whose tag name is one
of: "caption", "col", "colgroup", "frame", "frameset", "head",
<del class="diff-old">"option", "optgroup",</del> "tbody", "td",
"tfoot", "th", "thead", "tr" <del class="diff-old">An end tag whose
tag name is one of: "area", "basefont", "bgsound", "br", "embed",
"hr", "iframe", "image", "img", "input", "isindex", "noembed",
"noframes", "param", "select", "spacer", "table", "textarea",
"wbr"</del></dt>
<dd><del class="diff-old">An end tag whose tag name is "noscript",
if scripting is enabled :</del></dd>
<dd>
<p><a href="#parse1">Parse error</a> . Ignore the token.</p>
</dd>
<dt><del class="diff-old">A start or end tag whose tag name is one
of: "event-source", "section", "nav", "article", "aside", "header",
"footer", "datagrid", "command" Work in progress! A</del>
<ins class="diff-chg">Any other</ins> start tag <del class=
"diff-old">token not covered by the previous entries</del></dt>
<dd>
<p><a href="#reconstruct">Reconstruct the active formatting
elements</a> , if any.</p>
<p><a href="#insert0">Insert an HTML element</a> for the token.</p>
<p class="note">This element will be a <a href=
"#phrasing1">phrasing</a> element.</p>
</dd>
<dt><del class="diff-old">An</del> <ins class="diff-chg">Any
other</ins> end tag <del class="diff-old">token not covered by the
previous entries</del></dt>
<dd>
<p>Run the following algorithm:</p>
<ol>
<li>
<p>Initialise <var title="">node</var> to be the <a href=
"#current5">current node</a> (the bottommost node of the
stack).</p>
</li>
<li>
<p>If <var title="">node</var> has the same tag name as the end tag
token, then:</p>
<ol>
<li>
<p><a href="#generate">Generate implied end tags</a> .</p>
</li>
<li>
<p>If the tag name of the end tag token does not match the tag name
of the <a href="#current5">current node</a> , this is a <a href=
"#parse1">parse error</a> .</p>
</li>
<li>
<p>Pop all the nodes from the <a href="#current5">current node</a>
up to <var title="">node</var> , including <var title="">node</var>
, then stop this algorithm.</p>
</li>
</ol>
</li>
<li>
<p>Otherwise, if <var title="">node</var> is in neither the
<a href="#formatting">formatting</a> category nor the <a href=
"#phrasing1">phrasing</a> category, then this is a <a href=
"#parse1">parse error</a> . Stop this algorithm. The end tag token
is ignored.</p>
</li>
<li>
<p>Set <var title="">node</var> to the previous entry in the
<a href="#stack">stack of open elements</a> .</p>
</li>
<li>
<p>Return to step 2.</p>
</li>
</ol>
</dd>
</dl>
<del class="diff-old">If</del>
<h5 id="parsing-main-intable"><span class="secno"><ins class=
"diff-chg">8.2.5.11.</ins></span> <ins class="diff-chg">The "</ins>
<dfn id="in-table" title="insertion mode: in table"><ins class=
"diff-chg">in table</ins></dfn> <ins class="diff-chg">" insertion
mode</ins></h5>
<p><ins class="diff-chg">When</ins> the <span>insertion mode</span>
is " <a href="#in-table" title="insertion mode: in table">in table
<del class="diff-old">"</del></a> <ins class="diff-chg">", tokens
must be handled as follows:</ins></p>
<dl class="switch">
<dt>A character token that is one of one of U+0009 CHARACTER
TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
FORM FEED (FF), or U+0020 SPACE</dt>
<dd>
<p><del class="diff-old">Append</del> <ins class="diff-chg">If
the</ins> <a href="#current6"><ins class="diff-chg">current
table</ins></a> <ins class="diff-chg">is</ins> <a href=
"#tainted"><ins class="diff-chg">tainted</ins></a> ,<ins class=
"diff-chg">then act as described in the "anything else" entry
below.</ins></p>
<p><ins class="diff-chg">Otherwise,</ins> <a href="#insert" title=
"insert a character"><ins class="diff-chg">insert</ins> the
character</a> <del class="diff-old">to</del> <ins class=
"diff-chg">into</ins> the <a href="#current5">current node</a>
.</p>
</dd>
<dt>A comment token</dt>
<dd>
<p>Append a <code>Comment</code> node to the <a href=
"#current5">current node</a> with the <code title="">data</code>
attribute set to the data given in the comment token.</p>
</dd>
<dt>A <ins class="diff-new">DOCTYPE token</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Ignore the token.</ins></p>
</dd>
<dt><ins class="diff-new">A</ins> start tag whose tag name is
"caption"</dt>
<dd>
<p><a href="#clear2">Clear the stack back to a table context</a> .
(See below.)</p>
<p>Insert a marker at the end of the <a href="#list-of4">list of
active formatting elements</a> .</p>
<p><a href="#insert0">Insert an HTML element</a> for the token,
then switch the <span>insertion mode</span> to " <a href=
"#in-caption" title="insertion mode: in caption">in caption</a>
".</p>
</dd>
<dt>A start tag whose tag name is "colgroup"</dt>
<dd>
<p><a href="#clear2">Clear the stack back to a table context</a> .
(See below.)</p>
<p><a href="#insert0">Insert an HTML element</a> for the token,
then switch the <span>insertion mode</span> to " <a href=
"#in-column" title="insertion mode: in column group">in column
group</a> ".</p>
</dd>
<dt>A start tag whose tag name is "col"</dt>
<dd>
<p>Act as if a start tag token with the tag name "colgroup" had
been seen, then reprocess the current token.</p>
</dd>
<dt>A start tag whose tag name is one of: "tbody", "tfoot",
"thead"</dt>
<dd>
<p><a href="#clear2">Clear the stack back to a table context</a> .
(See below.)</p>
<p><a href="#insert0">Insert an HTML element</a> for the token,
then switch the <span>insertion mode</span> to " <a href=
"#in-table0" title="insertion mode: in table body">in table
body</a> ".</p>
</dd>
<dt>A start tag whose tag name is one of: "td", "th", "tr"</dt>
<dd>
<p>Act as if a start tag token with the tag name "tbody" had been
seen, then reprocess the current token.</p>
</dd>
<dt>A start tag whose tag name is "table"</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Act as if an end tag token
with the tag name "table" had been seen, then, if that token wasn't
ignored, reprocess the current token.</p>
<p class="note">The fake end tag token here can only be ignored in
the <a href="#fragment">fragment case</a> .</p>
</dd>
<dt>An end tag whose tag name is "table"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> does not
<a href="#have-an0" title="has an element in table scope">have an
element in table scope</a> with the same tag name as the token,
this is a <a href="#parse1">parse error</a> . Ignore the token. (
<a href="#fragment">fragment case</a> )</p>
<p>Otherwise:</p>
<p><del class="diff-old">Generate implied end tags . Now, if the
current node is not a table element, then this is a parse error
.</del> Pop elements from this stack until a <code><a href=
"#table">table</a></code> element has been popped from the
stack.</p>
<p><a href="#reset">Reset the insertion mode appropriately</a>
.</p>
</dd>
<dt>An end tag whose tag name is one of: "body", "caption", "col",
"colgroup", "html", "tbody", "td", "tfoot", "th", "thead",
"tr"</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Ignore the token.</p>
</dd>
<dt><del class="diff-old">Anything else</del> <ins class=
"diff-chg">A start tag whose tag name is one of: "style",
"script"</ins></dt>
<dd>
<p><del class="diff-old">Parse error . Process</del> <ins class=
"diff-chg">If</ins> the <del class="diff-old">token</del> <a href=
"#current6"><ins class="diff-chg">current table</ins></a>
<ins class="diff-chg">is</ins> <a href="#tainted"><ins class=
"diff-chg">tainted</ins></a> <ins class="diff-chg">then act</ins>
as <del class="diff-old">if</del> <ins class="diff-chg">described
in</ins> the <del class="diff-old">insertion mode</del> <ins class=
"diff-chg">"anything else" entry below.</ins></p>
<p><ins class="diff-chg">Otherwise, process the token</ins>
<a href="#using8"><ins class="diff-chg">using the rules
for</ins></a> <del class="diff-old">was</del> <ins class=
"diff-chg">the</ins> " <a href="#in-head" title=
"insertion mode: in head">in <del class="diff-old">body</del>
<ins class="diff-chg">head</ins></a> <del class="diff-old">", with
the following exception:</del> <ins class="diff-chg">"</ins>
<span><ins class="diff-chg">insertion mode</ins></span> .</p>
</dd>
<dt><ins class="diff-new">A start tag whose tag name is
"input"</ins></dt>
<dd>
<p>If the <del class="diff-old">current node is a table , tbody ,
tfoot , thead ,</del> <ins class="diff-chg">token does not have an
attribute with the name "type",</ins> or <del class="diff-old">tr
element, then, whenever</del> <ins class="diff-chg">if it does, but
that attribute's value is not</ins> a <del class="diff-old">node
would be inserted into</del> <ins class="diff-chg">case-insensitive
match for</ins> the <ins class="diff-chg">string "hidden", or, if
the</ins> <a href="#current6">current <del class=
"diff-old">node</del> <ins class="diff-chg">table</ins></a>
<ins class="diff-chg">is</ins> <a href="#tainted"><ins class=
"diff-chg">tainted</ins></a> , <del class="diff-old">it must
instead be inserted into</del> <ins class="diff-chg">then: act as
described in</ins> the <ins class="diff-chg">"anything else" entry
below.</ins></p>
<p><ins class="diff-chg">Otherwise:</ins></p>
<p><del class="diff-old">foster parent</del> <a href=
"#parse1"><ins class="diff-chg">Parse error</ins></a> .</p>
<p><a href="#insert0"><ins class="diff-chg">Insert an HTML</ins>
element</a> <del class="diff-old">.</del> <ins class="diff-chg">for
the token.</ins></p>
<p><del class="diff-old">The foster parent</del> <ins class=
"diff-chg">If the</ins> <a href="#form-element"><code title=
""><ins class="diff-chg">form</ins></code> element <ins class=
"diff-chg">pointer</ins></a> is <ins class="diff-new">not null,
then</ins> <span><ins class="diff-new">associate</ins></span> the
<del class="diff-old">parent</del> <code><ins class=
"diff-chg">input</ins></code> element <del class=
"diff-old">of</del> <ins class="diff-chg">with</ins> the
<del class="diff-old">last</del> <code><del class=
"diff-old">table</del> <ins class="diff-chg">form</ins></code>
element <del class="diff-old">in</del> <ins class=
"diff-chg">pointed to by</ins> the <del class="diff-old">stack of
open elements , if there is a table</del> <a href=
"#form-element"><code title=""><ins class=
"diff-new">form</ins></code> element <del class="diff-old">and it
has such a parent element. If there is no</del> <ins class=
"diff-chg">pointer</ins></a> .</p>
<p><ins class="diff-chg">Pop that</ins> <code><del class=
"diff-old">table</del> <ins class="diff-chg">input</ins></code>
element <del class="diff-old">in</del> <ins class=
"diff-chg">off</ins> the <a href="#stack">stack of open elements
<del class="diff-old">( fragment case ), then</del></a> .</p>
</dd>
<dt><ins class="diff-chg">An end-of-file token</ins></dt>
<dd>
<p><ins class="diff-chg">If</ins> the <del class="diff-old">foster
parent element</del> <a href="#current5"><ins class=
"diff-chg">current node</ins></a> is <ins class=
"diff-new">not</ins> the <del class="diff-old">first element in the
stack of open elements (the</del> <ins class="diff-chg">root</ins>
<code><a href="#html">html</a></code> <del class=
"diff-old">element). Otherwise, if there</del> <ins class=
"diff-chg">element, then this</ins> is a <del class=
"diff-old">table</del> <a href="#parse1"><ins class=
"diff-chg">parse error.</ins></a> .</p>
<p class="note"><ins class="diff-chg">It can only be the</ins>
<a href="#current5"><ins class="diff-chg">current node</ins></a>
<del class="diff-old">element</del> in the <del class=
"diff-old">stack of open elements , but the last</del> <a href=
"#fragment"><ins class="diff-chg">fragment case</ins></a> .</p>
<p><del class="diff-old">table</del> <a href="#stops"><ins class=
"diff-chg">Stop parsing.</ins></a> <del class="diff-old">element
in</del></p>
</dd>
<dt><ins class="diff-chg">Anything else</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-chg">Parse error</ins></a>
.<ins class="diff-chg">Process</ins> the <del class=
"diff-old">stack of open elements has no parent, or its parent node
is not an element, then</del> <ins class="diff-chg">token</ins>
<a href="#using8"><ins class="diff-chg">using</ins> the <del class=
"diff-old">foster parent element</del> <ins class="diff-chg">rules
for</ins></a> <del class="diff-old">is</del> the <del class=
"diff-old">element before</del> <ins class="diff-chg">"</ins>
<a href="#in-body" title="insertion mode: in body"><ins class=
"diff-chg">in body</ins></a> <ins class="diff-chg">"</ins>
<span><ins class="diff-chg">insertion mode</ins></span>
,<ins class="diff-chg">except that if</ins> the <del class=
"diff-old">last</del> <a href="#current5"><ins class=
"diff-chg">current node</ins></a> <ins class="diff-chg">is a</ins>
<code><a href="#table">table</a> <del class="diff-old">element in
the stack of open elements . If the</del></code> ,
<code><del class="diff-old">foster parent element</del> <a href=
"#tbody"><ins class="diff-chg">tbody</ins></a> <del class=
"diff-old">is the parent element of the last</del></code> ,
<code><del class="diff-old">table</del> <a href=
"#tfoot0"><ins class="diff-chg">tfoot</ins></a> <del class=
"diff-old">element in the stack of open elements , then the new
node must be inserted immediately before the last</del></code> ,
<code><del class="diff-old">table</del> <a href=
"#thead0"><ins class="diff-chg">thead</ins></a> <del class=
"diff-old">element in the stack of open elements in the foster
parent element</del></code> , <ins class="diff-chg">or</ins>
<code><a href="#tr"><ins class="diff-chg">tr</ins></a> <del class=
"diff-old">; otherwise,</del></code> <ins class="diff-chg">element,
then, whenever a node would be inserted into</ins> the <del class=
"diff-old">new</del> <a href="#current5"><ins class=
"diff-chg">current</ins> node</a> , <ins class="diff-new">it</ins>
must <ins class="diff-new">instead</ins> be <del class=
"diff-old">appended to the</del> <a href="#foster0" title=
"foster parent">foster <del class="diff-old">parent element</del>
<ins class="diff-chg">parented</ins></a> .</p>
</dd>
</dl>
<p>When the steps above require the UA to <dfn id="clear2">clear
the stack back to a table context</dfn> , it means that the UA
must, while the <a href="#current5">current node</a> is not a
<code><a href="#table">table</a></code> element or an
<code><a href="#html">html</a></code> element, pop elements from
the <a href="#stack">stack of open elements</a> . <del class=
"diff-old">If this causes any elements to be popped from the stack,
then this is a parse error .</del></p>
<p class="note">The <a href="#current5">current node</a> being an
<code><a href="#html">html</a></code> element after this process is
a <a href="#fragment">fragment case</a> . <del class=
"diff-old">If</del></p>
<h5 id="parsing-main-incaption"><span class="secno"><ins class=
"diff-chg">8.2.5.12.</ins></span> <ins class="diff-chg">The "</ins>
<dfn id="in-caption" title="insertion mode: in caption"><ins class=
"diff-chg">in caption</ins></dfn> <ins class="diff-chg">" insertion
mode</ins></h5>
<p><ins class="diff-chg">When</ins> the <span>insertion mode</span>
is " <a href="#in-caption" title="insertion mode: in caption">in
caption <del class="diff-old">"</del></a> <ins class="diff-chg">",
tokens must be handled as follows:</ins></p>
<dl class="switch">
<dt>An end tag whose tag name is "caption"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> does not
<a href="#have-an0" title="has an element in table scope">have an
element in table scope</a> with the same tag name as the token,
this is a <a href="#parse1">parse error</a> . Ignore the token. (
<a href="#fragment">fragment case</a> )</p>
<p>Otherwise:</p>
<p><a href="#generate">Generate implied end tags</a> .</p>
<p>Now, if the <a href="#current5">current node</a> is not a
<code><a href="#caption0">caption</a></code> element, then this is
a <a href="#parse1">parse error</a> .</p>
<p>Pop elements from this stack until a <code><a href=
"#caption0">caption</a></code> element has been popped from the
stack.</p>
<p><a href="#clear1">Clear the list of active formatting elements
up to the last marker</a> .</p>
<p>Switch the <span>insertion mode</span> to " <a href="#in-table"
title="insertion mode: in table">in table</a> ".</p>
</dd>
<dt>A start tag whose tag name is one of: "caption", "col",
"colgroup", "tbody", "td", "tfoot", "th", "thead", "tr"</dt>
<dt>An end tag whose tag name is "table"</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Act as if an end tag with
the tag name "caption" had been seen, then, if that token wasn't
ignored, reprocess the current token.</p>
<p class="note">The fake end tag token here can only be ignored in
the <a href="#fragment">fragment case</a> .</p>
</dd>
<dt>An end tag whose tag name is one of: "body", "col", "colgroup",
"html", "tbody", "td", "tfoot", "th", "thead", "tr"</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Ignore the token.</p>
</dd>
<dt>Anything else</dt>
<dd>
<p>Process the token <del class="diff-old">as if</del> <a href=
"#using8"><ins class="diff-chg">using</ins> the <del class=
"diff-old">insertion mode</del> <ins class="diff-chg">rules
for</ins></a> <del class="diff-old">was</del> <ins class=
"diff-chg">the</ins> " <a href="#in-body" title=
"insertion mode: in body">in body</a> <del class=
"diff-old">".</del> <ins class="diff-chg">"</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> .</p>
</dd>
</dl>
<del class="diff-old">If</del>
<h5 id="parsing-main-incolgroup"><span class="secno"><ins class=
"diff-chg">8.2.5.13.</ins></span> <ins class="diff-chg">The "</ins>
<dfn id="in-column" title=
"insertion mode: in column group"><ins class="diff-chg">in column
group</ins></dfn> <ins class="diff-chg">" insertion mode</ins></h5>
<p><ins class="diff-chg">When</ins> the <span>insertion mode</span>
is " <a href="#in-column" title=
"insertion mode: in column group">in column group <del class=
"diff-old">"</del></a> <ins class="diff-chg">", tokens must be
handled as follows:</ins></p>
<dl class="switch">
<dt>A character token that is one of one of U+0009 CHARACTER
TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
FORM FEED (FF), or U+0020 SPACE</dt>
<dd>
<p><del class="diff-old">Append</del> <a href="#insert" title=
"insert a character"><ins class="diff-chg">Insert</ins> the
character</a> <del class="diff-old">to</del> <ins class=
"diff-chg">into</ins> the <a href="#current5">current node</a>
.</p>
</dd>
<dt>A comment token</dt>
<dd>
<p>Append a <code>Comment</code> node to the <a href=
"#current5">current node</a> with the <code title="">data</code>
attribute set to the data given in the comment token.</p>
</dd>
<dt>A <ins class="diff-new">DOCTYPE token</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Ignore the token.</ins></p>
</dd>
<dt><ins class="diff-new">A start tag whose tag name is
"html"</ins></dt>
<dd>
<p><ins class="diff-new">Process the token</ins> <a href=
"#using8"><ins class="diff-new">using the rules for</ins></a>
<ins class="diff-new">the "</ins> <a href="#in-body" title=
"insertion mode: in body"><ins class="diff-new">in body</ins></a>
<ins class="diff-new">"</ins> <span><ins class="diff-new">insertion
mode</ins></span> .</p>
</dd>
<dt><ins class="diff-new">A</ins> start tag whose tag name is
"col"</dt>
<dd>
<p><a href="#insert0">Insert <del class="diff-old">a col</del>
<ins class="diff-chg">an HTML</ins> element</a> for the token.
Immediately pop the <a href="#current5">current node</a> off the
<a href="#stack">stack of open elements</a> .</p>
<p><a href="#acknowledged" title=
"acknowledge self-closing flag"><ins class="diff-new">Acknowledge
the token's</ins> <i><ins class="diff-new">self-closing
flag</ins></i></a> ,<ins class="diff-new">if it is set.</ins></p>
</dd>
<dt>An end tag whose tag name is "colgroup"</dt>
<dd>
<p>If the <a href="#current5">current node</a> is the root
<code><a href="#html">html</a></code> element, then this is a
<a href="#parse1">parse error</a> , ignore the token. ( <a href=
"#fragment">fragment case</a> )</p>
<p>Otherwise, pop the <a href="#current5">current node</a> (which
will be a <code><a href="#colgroup">colgroup</a></code> element)
from the <a href="#stack">stack of open elements</a> . Switch the
<span>insertion mode</span> to " <a href="#in-table" title=
"insertion mode: in table">in table</a> ".</p>
</dd>
<dt>An end tag whose tag name is "col"</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Ignore the token.</p>
</dd>
<dt><ins class="diff-new">An end-of-file token</ins></dt>
<dd>
<p><ins class="diff-new">If the</ins> <a href=
"#current5"><ins class="diff-new">current node</ins></a>
<ins class="diff-new">is the root</ins> <code><a href=
"#html"><ins class="diff-new">html</ins></a></code> <ins class=
"diff-new">element, then</ins> <a href="#stops"><ins class=
"diff-new">stop parsing</ins></a> .<ins class="diff-new">(</ins>
<a href="#fragment"><ins class="diff-new">fragment case</ins></a>
<ins class="diff-new">)</ins></p>
<p><ins class="diff-new">Otherwise, act as described in the
"anything else" entry below.</ins></p>
</dd>
<dt>Anything else</dt>
<dd>
<p>Act as if an end tag with the tag name "colgroup" had been seen,
and then, if that token wasn't ignored, reprocess the current
token.</p>
<p class="note">The fake end tag token here can only be ignored in
the <a href="#fragment">fragment case</a> .</p>
</dd>
</dl>
<del class="diff-old">If</del>
<h5 id="parsing-main-intbody"><span class="secno"><ins class=
"diff-chg">8.2.5.14.</ins></span> <ins class="diff-chg">The "</ins>
<dfn id="in-table0" title=
"insertion mode: in table body"><ins class="diff-chg">in table
body</ins></dfn> <ins class="diff-chg">" insertion mode</ins></h5>
<p><ins class="diff-chg">When</ins> the <span>insertion mode</span>
is " <a href="#in-table0" title="insertion mode: in table body">in
table body <del class="diff-old">"</del></a> <ins class=
"diff-chg">", tokens must be handled as follows:</ins></p>
<dl class="switch">
<dt>A start tag whose tag name is "tr"</dt>
<dd>
<p><a href="#clear3">Clear the stack back to a table body
context</a> . (See below.)</p>
<p><a href="#insert0">Insert <del class="diff-old">a tr</del>
<ins class="diff-chg">an HTML</ins> element</a> for the token, then
switch the <span>insertion mode</span> to " <a href="#in-row"
title="insertion mode: in row">in row</a> ".</p>
</dd>
<dt>A start tag whose tag name is one of: "th", "td"</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Act as if a start tag with
the tag name "tr" had been seen, then reprocess the current
token.</p>
</dd>
<dt>An end tag whose tag name is one of: "tbody", "tfoot",
"thead"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> does not
<a href="#have-an0" title="has an element in table scope">have an
element in table scope</a> with the same tag name as the token,
this is a <a href="#parse1">parse error</a> . Ignore the token.</p>
<p>Otherwise:</p>
<p><a href="#clear3">Clear the stack back to a table body
context</a> . (See below.)</p>
<p>Pop the <a href="#current5">current node</a> from the <a href=
"#stack">stack of open elements</a> . Switch the <span>insertion
mode</span> to " <a href="#in-table" title=
"insertion mode: in table">in table</a> ".</p>
</dd>
<dt>A start tag whose tag name is one of: "caption", "col",
"colgroup", "tbody", "tfoot", "thead"</dt>
<dt>An end tag whose tag name is "table"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> does not
<a href="#have-an0" title="has an element in table scope">have a
<code>tbody</code> , <code>thead</code> , or <code>tfoot</code>
element in table scope</a> , this is a <a href="#parse1">parse
error</a> . Ignore the token. ( <a href="#fragment">fragment
case</a> )</p>
<p>Otherwise:</p>
<p><a href="#clear3">Clear the stack back to a table body
context</a> . (See below.)</p>
<p>Act as if an end tag with the same tag name as the <a href=
"#current5">current node</a> ("tbody", "tfoot", or "thead") had
been seen, then reprocess the current token.</p>
</dd>
<dt>An end tag whose tag name is one of: "body", "caption", "col",
"colgroup", "html", "td", "th", "tr"</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Ignore the token.</p>
</dd>
<dt>Anything else</dt>
<dd>
<p>Process the token <del class="diff-old">as if</del> <a href=
"#using8"><ins class="diff-chg">using</ins> the <del class=
"diff-old">insertion mode</del> <ins class="diff-chg">rules
for</ins></a> <del class="diff-old">was</del> <ins class=
"diff-chg">the</ins> " <a href="#in-table" title=
"insertion mode: in table">in table</a> <del class=
"diff-old">".</del> <ins class="diff-chg">"</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> .</p>
</dd>
</dl>
<p>When the steps above require the UA to <dfn id="clear3">clear
the stack back to a table body context</dfn> , it means that the UA
must, while the <a href="#current5">current node</a> is not a
<code><a href="#tbody">tbody</a></code> , <code><a href=
"#tfoot0">tfoot</a></code> , <code><a href=
"#thead0">thead</a></code> , or <code><a href=
"#html">html</a></code> element, pop elements from the <a href=
"#stack">stack of open elements</a> . <del class="diff-old">If this
causes any elements to be popped from the stack, then this is a
parse error .</del></p>
<p class="note">The <a href="#current5">current node</a> being an
<code><a href="#html">html</a></code> element after this process is
a <a href="#fragment">fragment case</a> . <del class=
"diff-old">If</del></p>
<h5 id="parsing-main-intr"><span class="secno"><ins class=
"diff-chg">8.2.5.15.</ins></span> <ins class="diff-chg">The "</ins>
<dfn id="in-row" title="insertion mode: in row"><ins class=
"diff-chg">in row</ins></dfn> <ins class="diff-chg">" insertion
mode</ins></h5>
<p><ins class="diff-chg">When</ins> the <span>insertion mode</span>
is " <a href="#in-row" title="insertion mode: in row">in row
<del class="diff-old">"</del></a> <ins class="diff-chg">", tokens
must be handled as follows:</ins></p>
<dl class="switch">
<dt>A start tag whose tag name is one of: "th", "td"</dt>
<dd>
<p><a href="#clear4">Clear the stack back to a table row
context</a> . (See below.)</p>
<p><a href="#insert0">Insert an HTML element</a> for the token,
then switch the <span>insertion mode</span> to " <a href="#in-cell"
title="insertion mode: in cell">in cell</a> ".</p>
<p>Insert a marker at the end of the <a href="#list-of4">list of
active formatting elements</a> .</p>
</dd>
<dt>An end tag whose tag name is "tr"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> does not
<a href="#have-an0" title="has an element in table scope">have an
element in table scope</a> with the same tag name as the token,
this is a <a href="#parse1">parse error</a> . Ignore the token. (
<a href="#fragment">fragment case</a> )</p>
<p>Otherwise:</p>
<p><a href="#clear4">Clear the stack back to a table row
context</a> . (See below.)</p>
<p>Pop the <a href="#current5">current node</a> (which will be a
<code><a href="#tr">tr</a></code> element) from the <a href=
"#stack">stack of open elements</a> . Switch the <span>insertion
mode</span> to " <a href="#in-table0" title=
"insertion mode: in table body">in table body</a> ".</p>
</dd>
<dt>A start tag whose tag name is one of: "caption", "col",
"colgroup", "tbody", "tfoot", "thead", "tr"</dt>
<dt>An end tag whose tag name is "table"</dt>
<dd>
<p>Act as if an end tag with the tag name "tr" had been seen, then,
if that token wasn't ignored, reprocess the current token.</p>
<p class="note">The fake end tag token here can only be ignored in
the <a href="#fragment">fragment case</a> .</p>
</dd>
<dt>An end tag whose tag name is one of: "tbody", "tfoot",
"thead"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> does not
<a href="#have-an0" title="has an element in table scope">have an
element in table scope</a> with the same tag name as the token,
this is a <a href="#parse1">parse error</a> . Ignore the token.</p>
<p>Otherwise, act as if an end tag with the tag name "tr" had been
seen, then reprocess the current token.</p>
</dd>
<dt>An end tag whose tag name is one of: "body", "caption", "col",
"colgroup", "html", "td", "th"</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Ignore the token.</p>
</dd>
<dt>Anything else</dt>
<dd>
<p>Process the token <del class="diff-old">as if</del> <a href=
"#using8"><ins class="diff-chg">using</ins> the <del class=
"diff-old">insertion mode</del> <ins class="diff-chg">rules
for</ins></a> <del class="diff-old">was</del> <ins class=
"diff-chg">the</ins> " <a href="#in-table" title=
"insertion mode: in table">in table</a> <del class=
"diff-old">".</del> <ins class="diff-chg">"</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> .</p>
</dd>
</dl>
<p>When the steps above require the UA to <dfn id="clear4">clear
the stack back to a table row context</dfn> , it means that the UA
must, while the <a href="#current5">current node</a> is not a
<code><a href="#tr">tr</a></code> element or an <code><a href=
"#html">html</a></code> element, pop elements from the <a href=
"#stack">stack of open elements</a> . <del class="diff-old">If this
causes any elements to be popped from the stack, then this is a
parse error .</del></p>
<p class="note">The <a href="#current5">current node</a> being an
<code><a href="#html">html</a></code> element after this process is
a <a href="#fragment">fragment case</a> . <del class=
"diff-old">If</del></p>
<h5 id="parsing-main-intd"><span class="secno"><ins class=
"diff-chg">8.2.5.16.</ins></span> <ins class="diff-chg">The "</ins>
<dfn id="in-cell" title="insertion mode: in cell"><ins class=
"diff-chg">in cell</ins></dfn> <ins class="diff-chg">" insertion
mode</ins></h5>
<p><ins class="diff-chg">When</ins> the <span>insertion mode</span>
is " <a href="#in-cell" title="insertion mode: in cell">in cell
<del class="diff-old">"</del></a> <ins class="diff-chg">", tokens
must be handled as follows:</ins></p>
<dl class="switch">
<dt>An end tag whose tag name is one of: "td", "th"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> does not
<a href="#have-an0" title="has an element in table scope">have an
element in table scope</a> with the same tag name as that of the
token, then this is a <a href="#parse1">parse error</a> and the
token must be ignored.</p>
<p>Otherwise:</p>
<p><a href="#generate">Generate implied end tags <del class=
"diff-old">, except for elements with the same tag name as the
token.</del></a> .</p>
<p>Now, if the <a href="#current5">current node</a> is not an
element with the same tag name as the token, then this is a
<a href="#parse1">parse error</a> .</p>
<p>Pop elements from this stack until an element with the same tag
name as the token has been popped from the stack.</p>
<p><a href="#clear1">Clear the list of active formatting elements
up to the last marker</a> .</p>
<p>Switch the <span>insertion mode</span> to " <a href="#in-row"
title="insertion mode: in row">in row</a> ". (The <a href=
"#current5">current node</a> will be a <code><a href=
"#tr">tr</a></code> element at this point.)</p>
</dd>
<dt>A start tag whose tag name is one of: "caption", "col",
"colgroup", "tbody", "td", "tfoot", "th", "thead", "tr"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> does
<em>not</em> <a href="#have-an0" title=
"has an element in table scope">have a <code>td</code> or
<code>th</code> element in table scope</a> , then this is a
<a href="#parse1">parse error</a> ; ignore the token. ( <a href=
"#fragment">fragment case</a> )</p>
<p>Otherwise, <a href="#close2">close the cell</a> (see below) and
reprocess the current token.</p>
</dd>
<dt>An end tag whose tag name is one of: "body", "caption", "col",
"colgroup", "html"</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Ignore the token.</p>
</dd>
<dt>An end tag whose tag name is one of: "table", "tbody", "tfoot",
"thead", "tr"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> does not
<a href="#have-an0" title="has an element in table scope">have an
element in table scope</a> with the same tag name as that of the
token (which can only happen for "tbody", "tfoot" and "thead", or,
in the <a href="#fragment">fragment case</a> ), then this is a
<a href="#parse1">parse error</a> and the token must be
ignored.</p>
<p>Otherwise, <a href="#close2">close the cell</a> (see below) and
reprocess the current token.</p>
</dd>
<dt>Anything else</dt>
<dd>
<p>Process the token <del class="diff-old">as if</del> <a href=
"#using8"><ins class="diff-chg">using</ins> the <del class=
"diff-old">insertion mode</del> <ins class="diff-chg">rules
for</ins></a> <del class="diff-old">was</del> <ins class=
"diff-chg">the</ins> " <a href="#in-body" title=
"insertion mode: in body">in body</a> <del class=
"diff-old">".</del> <ins class="diff-chg">"</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> .</p>
</dd>
</dl>
<p>Where the steps above say to <dfn id="close2">close the
cell</dfn> , they mean to run the following algorithm:</p>
<ol>
<li>
<p>If the <a href="#stack">stack of open elements</a> <a href=
"#have-an0" title="has an element in table scope">has a
<code>td</code> element in table scope</a> , then act as if an end
tag token with the tag name "td" had been seen.</p>
</li>
<li>
<p>Otherwise, the <a href="#stack">stack of open elements</a> will
<a href="#have-an0" title="has an element in table scope">have a
<code>th</code> element in table scope</a> ; act as if an end tag
token with the tag name "th" had been seen.</p>
</li>
</ol>
<p class="note">The <a href="#stack">stack of open elements</a>
cannot have both a <code><a href="#td">td</a></code> and a
<code><a href="#th">th</a></code> element <a href="#have-an0"
title="has an element in table scope">in table scope</a> at the
same time, nor can it have neither when the <span>insertion
mode</span> is " <a href="#in-cell" title=
"insertion mode: in cell">in cell</a> ". <del class="diff-old">If
the insertion mode is</del></p>
<h5 id="parsing-main-inselect"><span class="secno"><ins class=
"diff-chg">8.2.5.17.</ins></span> <ins class="diff-chg">The</ins> "
<dfn id="in-select" title="insertion mode: in select">in
select</dfn> " <ins class="diff-chg">insertion mode</ins></h5>
<p><del class="diff-old">Handle</del> <ins class=
"diff-chg">When</ins> the <del class="diff-old">token</del>
<span><ins class="diff-chg">insertion mode</ins></span> <ins class=
"diff-chg">is "</ins> <a href="#in-select" title=
"insertion mode: in select"><ins class="diff-chg">in
select</ins></a> <ins class="diff-chg">", tokens must be
handled</ins> as follows:</p>
<dl class="switch">
<dt>A character token</dt>
<dd>
<p><del class="diff-old">Append</del> <a href="#insert" title=
"insert a character"><ins class="diff-chg">Insert</ins> the token's
character</a> <del class="diff-old">to</del> <ins class=
"diff-chg">into</ins> the <a href="#current5">current node</a>
.</p>
</dd>
<dt>A comment token</dt>
<dd>
<p>Append a <code>Comment</code> node to the <a href=
"#current5">current node</a> with the <code title="">data</code>
attribute set to the data given in the comment token.</p>
</dd>
<dt>A <ins class="diff-new">DOCTYPE token</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Ignore the token.</ins></p>
</dd>
<dt><ins class="diff-new">A start tag whose tag name is
"html"</ins></dt>
<dd>
<p><ins class="diff-new">Process the token</ins> <a href=
"#using8"><ins class="diff-new">using the rules for</ins></a>
<ins class="diff-new">the "</ins> <a href="#in-body" title=
"insertion mode: in body"><ins class="diff-new">in body</ins></a>
<ins class="diff-new">"</ins> <span><ins class="diff-new">insertion
mode</ins></span> .</p>
</dd>
<dt><ins class="diff-new">A</ins> start tag whose tag name is
"option"</dt>
<dd>
<p>If the <a href="#current5">current node</a> is an
<code>option</code> element, act as if an end tag with the tag name
"option" had been seen.</p>
<p><a href="#insert0">Insert an HTML element</a> for the token.</p>
</dd>
<dt>A start tag whose tag name is "optgroup"</dt>
<dd>
<p>If the <a href="#current5">current node</a> is an
<code>option</code> element, act as if an end tag with the tag name
"option" had been seen.</p>
<p>If the <a href="#current5">current node</a> is an
<code>optgroup</code> element, act as if an end tag with the tag
name "optgroup" had been seen.</p>
<p><a href="#insert0">Insert an HTML element</a> for the token.</p>
</dd>
<dt>An end tag whose tag name is "optgroup"</dt>
<dd>
<p>First, if the <a href="#current5">current node</a> is an
<code>option</code> element, and the node immediately before it in
the <a href="#stack">stack of open elements</a> is an
<code>optgroup</code> element, then act as if an end tag with the
tag name "option" had been seen.</p>
<p>If the <a href="#current5">current node</a> is an
<code>optgroup</code> element, then pop that node from the <a href=
"#stack">stack of open elements</a> . Otherwise, this is a <a href=
"#parse1">parse error</a> , ignore the token.</p>
</dd>
<dt>An end tag whose tag name is "option"</dt>
<dd>
<p>If the <a href="#current5">current node</a> is an
<code>option</code> element, then pop that node from the <a href=
"#stack">stack of open elements</a> . Otherwise, this is a <a href=
"#parse1">parse error</a> , ignore the token.</p>
</dd>
<dt>An end tag whose tag name is "select"</dt>
<dd>
<p>If the <a href="#stack">stack of open elements</a> does not
<a href="#have-an0" title="has an element in table scope">have an
element in table scope</a> with the same tag name as the token,
this is a <a href="#parse1">parse error</a> . Ignore the token. (
<a href="#fragment">fragment case</a> )</p>
<p>Otherwise:</p>
<p>Pop elements from the <a href="#stack">stack of open
elements</a> until a <code>select</code> element has been popped
from the stack.</p>
<p><a href="#reset">Reset the insertion mode appropriately</a>
.</p>
</dd>
<dt>A start tag whose tag name is "select"</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Act as if the token had been
an end tag with the tag name "select" instead.</p>
</dd>
<dt><ins class="diff-new">A start tag whose tag name is one of:
"input", "textarea"</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Act as if an end tag with the tag name
"select" had been seen, and reprocess the token.</ins></p>
</dd>
<dt><ins class="diff-new">An end-of-file token</ins></dt>
<dd>
<p><ins class="diff-new">If the</ins> <a href=
"#current5"><ins class="diff-new">current node</ins></a>
<ins class="diff-new">is not the root</ins> <code><a href=
"#html"><ins class="diff-new">html</ins></a></code> <ins class=
"diff-new">element, then this is a</ins> <a href=
"#parse1"><ins class="diff-new">parse error.</ins></a> .</p>
<p class="note"><ins class="diff-new">It can only be the</ins>
<a href="#current5"><ins class="diff-new">current node</ins></a>
<ins class="diff-new">in the</ins> <a href="#fragment"><ins class=
"diff-new">fragment case</ins></a> .</p>
<p><a href="#stops"><ins class="diff-new">Stop
parsing.</ins></a></p>
</dd>
<dt><ins class="diff-new">Anything else</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Ignore the token.</ins></p>
</dd>
</dl>
<h5 id="parsing-main-inselectintable"><span class=
"secno"><ins class="diff-new">8.2.5.18.</ins></span> <ins class=
"diff-new">The "</ins> <dfn id="in-select0" title=
"insertion mode: in select in table"><ins class="diff-new">in
select in table</ins></dfn> <ins class="diff-new">" insertion
mode</ins></h5>
<p><ins class="diff-new">When the</ins> <span><ins class=
"diff-new">insertion mode</ins></span> <ins class="diff-new">is
"</ins> <a href="#in-select0" title=
"insertion mode: in select in table"><ins class="diff-new">in
select in table</ins></a> <ins class="diff-new">", tokens must be
handled as follows:</ins></p>
<dl class="switch">
<dt><ins class="diff-new">A start tag whose tag name is one of:
"caption", "table", "tbody", "tfoot", "thead", "tr", "td",
"th"</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Act as if an end tag with the tag name
"select" had been seen, and reprocess the token.</ins></p>
</dd>
<dt>An end tag whose tag name is one of: "caption", "table",
"tbody", "tfoot", "thead", "tr", "td", "th"</dt>
<dd>
<p><a href="#parse1">Parse error</a> .</p>
<p>If the <a href="#stack">stack of open elements</a> <a href=
"#have-an0">has an element in table scope</a> with the same tag
name as that of the token, then act as if an end tag with the tag
name "select" had been seen, and reprocess the token. Otherwise,
ignore the token.</p>
</dd>
<dt>Anything else</dt>
<dd>
<p><ins class="diff-new">Process the token</ins> <a href=
"#using8"><ins class="diff-new">using the rules for</ins></a>
<ins class="diff-new">the "</ins> <a href="#in-select" title=
"insertion mode: in select"><ins class="diff-new">in
select</ins></a> <ins class="diff-new">"</ins> <span><ins class=
"diff-new">insertion mode</ins></span> .</p>
</dd>
</dl>
<h5 id="parsing-main-inforeign"><span class="secno"><ins class=
"diff-chg">8.2.5.19.</ins></span> <ins class="diff-chg">The "</ins>
<dfn id="in-foreign" title=
"insertion mode: in foreign content"><ins class="diff-chg">in
foreign content</ins></dfn> <ins class="diff-chg">" insertion
mode</ins></h5>
<p><ins class="diff-chg">When the</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> <ins class="diff-chg">is
"</ins> <a href="#in-foreign" title=
"insertion mode: in foreign content"><ins class="diff-chg">in
foreign content</ins></a> <ins class="diff-chg">", tokens must be
handled as follows:</ins></p>
<dl class="switch">
<dt><ins class="diff-chg">A character token</ins></dt>
<dd>
<p><a href="#insert" title="insert a character"><ins class=
"diff-chg">Insert the token's character</ins></a> <ins class=
"diff-chg">into the</ins> <a href="#current5"><ins class=
"diff-chg">current node</ins></a> .</p>
</dd>
<dt><ins class="diff-chg">A comment token</ins></dt>
<dd>
<p><ins class="diff-chg">Append a</ins> <code><ins class=
"diff-chg">Comment</ins></code> <ins class="diff-chg">node to
the</ins> <a href="#current5"><ins class="diff-chg">current
node</ins></a> <ins class="diff-chg">with the</ins> <code title=
""><ins class="diff-chg">data</ins></code> <ins class=
"diff-chg">attribute set to the data given in the comment
token.</ins></p>
</dd>
<dt><ins class="diff-chg">A DOCTYPE token</ins></dt>
<dd>
<p><a href="#parse1">Parse error</a> . Ignore the token.</p>
<del class="diff-old">If</del></dd>
<dt><ins class="diff-chg">A start tag whose tag name is neither
"mglyph" nor "malignmark", if</ins> the <a href=
"#current5"><ins class="diff-chg">current node</ins></a>
<ins class="diff-chg">is an</ins> <code title=""><ins class=
"diff-chg">mi</ins></code> <ins class="diff-chg">element in
the</ins> <a href="#mathml0"><ins class="diff-chg">MathML
namespace</ins></a> .</dt>
<dt><ins class="diff-chg">A start tag whose tag name is neither
"mglyph" nor "malignmark", if the</ins> <a href=
"#current5"><ins class="diff-chg">current node</ins></a>
<ins class="diff-chg">is an</ins> <code title=""><ins class=
"diff-chg">mo</ins></code> <ins class="diff-chg">element in
the</ins> <a href="#mathml0"><ins class="diff-chg">MathML
namespace</ins></a> .</dt>
<dt><ins class="diff-chg">A start tag whose tag name is neither
"mglyph" nor "malignmark", if the</ins> <a href=
"#current5"><ins class="diff-chg">current node</ins></a>
<ins class="diff-chg">is an</ins> <code title=""><ins class=
"diff-chg">mn</ins></code> <ins class="diff-chg">element in
the</ins> <a href="#mathml0"><ins class="diff-chg">MathML
namespace</ins></a> .</dt>
<dt><ins class="diff-chg">A start tag whose tag name is neither
"mglyph" nor "malignmark", if the</ins> <a href=
"#current5"><ins class="diff-chg">current node</ins></a>
<ins class="diff-chg">is an</ins> <code title=""><ins class=
"diff-chg">ms</ins></code> <ins class="diff-chg">element in
the</ins> <a href="#mathml0"><ins class="diff-chg">MathML
namespace</ins></a> .</dt>
<dt><ins class="diff-chg">A start tag whose tag name is neither
"mglyph" nor "malignmark", if the</ins> <a href=
"#current5"><ins class="diff-chg">current node</ins></a>
<ins class="diff-chg">is an</ins> <code title=""><ins class=
"diff-chg">mtext</ins></code> <ins class="diff-chg">element in
the</ins> <a href="#mathml0"><ins class="diff-chg">MathML
namespace</ins></a> .</dt>
<dt><ins class="diff-chg">A start tag, if the</ins> <a href=
"#current5"><ins class="diff-chg">current node</ins></a>
<ins class="diff-chg">is an element in the</ins> <a href=
"#html-namespace0"><ins class="diff-chg">HTML namespace</ins></a>
.</dt>
<dt><ins class="diff-chg">An end tag</ins></dt>
<dd>
<p><ins class="diff-chg">Process the token</ins> <a href=
"#using8"><ins class="diff-chg">using the rules for</ins></a>
<ins class="diff-chg">the</ins> <a href="#secondary1"><ins class=
"diff-chg">secondary</ins> insertion mode</a> .</p>
<p><ins class="diff-new">If, after doing so, the</ins>
<span><ins class="diff-new">insertion mode</ins></span> <ins class=
"diff-new">is still "</ins> <a href="#in-foreign" title=
"insertion mode: in foreign content"><ins class="diff-new">in
foreign content</ins></a> <ins class="diff-new">", but there</ins>
is <ins class="diff-new">no element in scope that has a namespace
other than the</ins> <a href="#html-namespace0"><ins class=
"diff-new">HTML namespace</ins></a> ,<ins class="diff-new">switch
the</ins> <span><ins class="diff-new">insertion mode</ins></span>
<ins class="diff-new">to the</ins> <a href=
"#secondary1"><ins class="diff-new">secondary insertion
mode</ins></a> .</p>
</dd>
<dt><ins class="diff-new">A start tag whose tag name is one of:
"b", "big", "blockquote", "body", "br", "center", "code", "dd",
"div", "dl", "dt" , "em", "embed", "font", "h1", "h2", "h3", "h4",
"h5", "h6" , "hr", "i", "img", "li", "listing" , "menu", "meta",
"nobr", "ol" , "p", "pre", "ruby", "s", "small", "span", "strong",
"strike" , "sub", "sup", "table", "tt", "u", "ul", "var"</ins></dt>
<dt><ins class="diff-new">An end-of-file token</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.</p>
<p><ins class="diff-new">Pop elements from the</ins> <a href=
"#stack"><ins class="diff-new">stack of open elements</ins></a>
<ins class="diff-new">until the</ins> <a href=
"#current5"><ins class="diff-new">current node</ins></a>
<ins class="diff-new">is in the</ins> <a href=
"#html-namespace0"><ins class="diff-new">HTML namespace</ins></a>
.</p>
<p><ins class="diff-new">Switch the</ins> <span><ins class=
"diff-new">insertion mode</ins></span> <ins class="diff-new">to
the</ins> <a href="#secondary1"><ins class="diff-new">secondary
insertion mode</ins></a> ,<ins class="diff-new">and reprocess the
token.</ins></p>
</dd>
<dt><ins class="diff-new">Any other start tag</ins></dt>
<dd>
<p><a href="#adjust"><ins class="diff-new">Adjust foreign
attributes</ins></a> <ins class="diff-new">for the token. (This
fixes the use of namespaced attributes, in particular XLink in
SVG.)</ins></p>
<p><a href="#insert1"><ins class="diff-new">Insert a foreign
element</ins></a> <ins class="diff-new">for the token, in the same
namespace as the</ins> <a href="#current5"><ins class=
"diff-new">current node</ins></a> .</p>
<p><ins class="diff-new">If the token has its</ins> <i><ins class=
"diff-new">self-closing flag</ins></i> <ins class="diff-new">set,
pop the</ins> <a href="#current5"><ins class="diff-new">current
node</ins></a> <ins class="diff-new">off the</ins> <a href=
"#stack"><ins class="diff-new">stack of open elements</ins></a>
<ins class="diff-new">and</ins> <a href="#acknowledged" title=
"acknowledge self-closing flag"><ins class="diff-new">acknowledge
the token's</ins> <i><ins class="diff-new">self-closing
flag</ins></i></a> .</p>
</dd>
</dl>
<h5 id="parsing-main-afterbody"><span class="secno"><ins class=
"diff-new">8.2.5.20.</ins></span> <ins class="diff-new">The</ins> "
<dfn id="after5" title="insertion mode: after body">after
body</dfn> " <ins class="diff-chg">insertion mode</ins></h5>
<p><del class="diff-old">Handle</del> <ins class=
"diff-chg">When</ins> the <del class="diff-old">token</del>
<span><ins class="diff-chg">insertion mode</ins></span> <ins class=
"diff-chg">is "</ins> <a href="#after5" title=
"insertion mode: after body"><ins class="diff-chg">after
body</ins></a> <ins class="diff-chg">", tokens must be
handled</ins> as follows:</p>
<dl class="switch">
<dt>A character token that is one of one of U+0009 CHARACTER
TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
FORM FEED (FF), or U+0020 SPACE</dt>
<dd>
<p>Process the token <del class="diff-old">as it would be processed
if</del> <a href="#using8"><ins class="diff-chg">using</ins> the
<del class="diff-old">insertion mode</del> <ins class=
"diff-chg">rules for</ins></a> <del class="diff-old">was</del>
<ins class="diff-chg">the</ins> " <a href="#in-body" title=
"insertion mode: in body">in body</a> <del class=
"diff-old">".</del> <ins class="diff-chg">"</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> .</p>
</dd>
<dt>A comment token</dt>
<dd>
<p>Append a <code>Comment</code> node to the first element in the
<a href="#stack">stack of open elements</a> (the <code><a href=
"#html">html</a></code> element), with the <code title=
"">data</code> attribute set to the data given in the comment
token.</p>
</dd>
<dt><ins class="diff-new">A DOCTYPE token</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Ignore the token.</ins></p>
</dd>
<dt><ins class="diff-new">A start tag whose tag name is
"html"</ins></dt>
<dd>
<p><ins class="diff-new">Process the token</ins> <a href=
"#using8"><ins class="diff-new">using the rules for</ins></a>
<ins class="diff-new">the "</ins> <a href="#in-body" title=
"insertion mode: in body"><ins class="diff-new">in body</ins></a>
<ins class="diff-new">"</ins> <span><ins class="diff-new">insertion
mode</ins></span> .</p>
</dd>
<dt>An end tag whose tag name is "html"</dt>
<dd>
<p>If the parser was originally created as part of the <a href=
"#html-fragment0">HTML fragment parsing algorithm</a> , this is a
<a href="#parse1">parse error</a> ; ignore the token. <del class=
"diff-old">(The element will be an html element in this
case.)</del> ( <a href="#fragment">fragment case</a> )</p>
<p>Otherwise, switch <del class="diff-old">to</del> the <del class=
"diff-old">trailing end phase .</del> <span><ins class=
"diff-chg">insertion mode</ins></span> <ins class="diff-chg">to
"</ins> <a href="#after7" title=
"insertion mode: after after body"><ins class="diff-chg">after
after body</ins></a> <ins class="diff-chg">".</ins></p>
</dd>
<dt><ins class="diff-chg">An end-of-file token</ins></dt>
<dd>
<p><a href="#stops"><ins class="diff-chg">Stop
parsing.</ins></a></p>
</dd>
<dt>Anything else</dt>
<dd>
<p><a href="#parse1">Parse error</a> . <del class=
"diff-old">Set</del> <ins class="diff-chg">Switch</ins> the
<span>insertion mode</span> to " <a href="#in-body" title=
"insertion mode: in body">in body</a> " and reprocess the
token.</p>
</dd>
</dl>
<del class="diff-old">If the insertion mode is</del>
<h5 id="parsing-main-inframeset"><span class="secno"><ins class=
"diff-chg">8.2.5.21.</ins></span> <ins class="diff-chg">The</ins> "
<dfn id="in-frameset" title="insertion mode: in frameset">in
frameset</dfn> " <ins class="diff-chg">insertion mode</ins></h5>
<p><del class="diff-old">Handle</del> <ins class=
"diff-chg">When</ins> the <del class="diff-old">token</del>
<span><ins class="diff-chg">insertion mode</ins></span> <ins class=
"diff-chg">is "</ins> <a href="#in-frameset" title=
"insertion mode: in frameset"><ins class="diff-chg">in
frameset</ins></a> <ins class="diff-chg">", tokens must be
handled</ins> as follows:</p>
<dl class="switch">
<dt>A character token that is one of one of U+0009 CHARACTER
TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
FORM FEED (FF), or U+0020 SPACE</dt>
<dd>
<p><del class="diff-old">Append</del> <a href="#insert" title=
"insert a character"><ins class="diff-chg">Insert</ins> the
character</a> <del class="diff-old">to</del> <ins class=
"diff-chg">into</ins> the <a href="#current5">current node</a>
.</p>
</dd>
<dt>A comment token</dt>
<dd>
<p>Append a <code>Comment</code> node to the <a href=
"#current5">current node</a> with the <code title="">data</code>
attribute set to the data given in the comment token.</p>
</dd>
<dt>A <ins class="diff-new">DOCTYPE token</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Ignore the token.</ins></p>
</dd>
<dt><ins class="diff-new">A start tag whose tag name is
"html"</ins></dt>
<dd>
<p><ins class="diff-new">Process the token</ins> <a href=
"#using8"><ins class="diff-new">using the rules for</ins></a>
<ins class="diff-new">the "</ins> <a href="#in-body" title=
"insertion mode: in body"><ins class="diff-new">in body</ins></a>
<ins class="diff-new">"</ins> <span><ins class="diff-new">insertion
mode</ins></span> .</p>
</dd>
<dt><ins class="diff-new">A</ins> start tag whose tag name is
"frameset"</dt>
<dd>
<p><a href="#insert0">Insert <del class="diff-old">a frameset</del>
<ins class="diff-chg">an HTML</ins> element</a> for the token.</p>
</dd>
<dt>An end tag whose tag name is "frameset"</dt>
<dd>
<p>If the <a href="#current5">current node</a> is the root
<code><a href="#html">html</a></code> element, then this is a
<a href="#parse1">parse error</a> ; ignore the token. ( <a href=
"#fragment">fragment case</a> )</p>
<p>Otherwise, pop the <a href="#current5">current node</a> from the
<a href="#stack">stack of open elements</a> .</p>
<p>If the parser was <em>not</em> originally created as part of the
<a href="#html-fragment0">HTML fragment parsing algorithm</a> (
<a href="#fragment">fragment case</a> ), and the <a href=
"#current5">current node</a> is no longer a <code>frameset</code>
element, then <del class="diff-old">change</del> <ins class=
"diff-chg">switch</ins> the <span>insertion mode</span> to "
<a href="#after6" title="insertion mode: after frameset">after
frameset</a> ".</p>
</dd>
<dt>A start tag whose tag name is "frame"</dt>
<dd>
<p><a href="#insert0">Insert an HTML element</a> for the token.
Immediately pop the <a href="#current5">current node</a> off the
<a href="#stack">stack of open elements</a> .</p>
<p><a href="#acknowledged" title=
"acknowledge self-closing flag"><ins class="diff-new">Acknowledge
the token's</ins> <i><ins class="diff-new">self-closing
flag</ins></i></a> ,<ins class="diff-new">if it is set.</ins></p>
</dd>
<dt>A start tag whose tag name is "noframes"</dt>
<dd>
<p>Process the token <del class="diff-old">as if</del> <a href=
"#using8"><ins class="diff-chg">using</ins> the <ins class=
"diff-chg">rules for</ins></a> <ins class="diff-chg">the "</ins>
<a href="#in-head" title="insertion mode: in head"><ins class=
"diff-chg">in head</ins></a> <ins class="diff-chg">"</ins>
<span>insertion mode</span> .</p>
</dd>
<dt><ins class="diff-new">An end-of-file token</ins></dt>
<dd>
<p><ins class="diff-new">If the</ins> <a href=
"#current5"><ins class="diff-new">current node</ins></a>
<ins class="diff-new">is not the root</ins> <code><a href=
"#html"><ins class="diff-new">html</ins></a></code> <ins class=
"diff-new">element, then this is a</ins> <a href=
"#parse1"><ins class="diff-new">parse error.</ins></a> .</p>
<p class="note"><ins class="diff-new">It can only be the</ins>
<a href="#current5"><ins class="diff-new">current node</ins></a>
<del class="diff-old">had been "</del> in <del class=
"diff-old">body</del> <ins class="diff-chg">the</ins> <a href=
"#fragment"><ins class="diff-chg">fragment case</ins></a> .</p>
<p><a href="#stops"><ins class="diff-chg">Stop parsing.</ins></a>
<del class="diff-old">".</del></p>
</dd>
<dt>Anything else</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Ignore the token.</p>
</dd>
</dl>
<del class="diff-old">If the insertion mode is</del>
<h5 id="parsing-main-afterframeset"><span class="secno"><ins class=
"diff-chg">8.2.5.22.</ins></span> <ins class="diff-chg">The</ins> "
<dfn id="after6" title="insertion mode: after frameset">after
frameset</dfn> " <ins class="diff-chg">insertion mode</ins></h5>
<p><del class="diff-old">Handle</del> <ins class=
"diff-chg">When</ins> the <del class="diff-old">token</del>
<span><ins class="diff-chg">insertion mode</ins></span> <ins class=
"diff-chg">is "</ins> <a href="#after6" title=
"insertion mode: after frameset"><ins class="diff-chg">after
frameset</ins></a> <ins class="diff-chg">", tokens must be
handled</ins> as follows:</p>
<dl class="switch">
<dt>A character token that is one of one of U+0009 CHARACTER
TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
FORM FEED (FF), or U+0020 SPACE</dt>
<dd>
<p><del class="diff-old">Append</del> <a href="#insert" title=
"insert a character"><ins class="diff-chg">Insert</ins> the
character</a> <del class="diff-old">to</del> <ins class=
"diff-chg">into</ins> the <a href="#current5">current node</a>
.</p>
</dd>
<dt>A comment token</dt>
<dd>
<p>Append a <code>Comment</code> node to the <a href=
"#current5">current node</a> with the <code title="">data</code>
attribute set to the data given in the comment token.</p>
</dd>
<dt><ins class="diff-new">A DOCTYPE token</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Ignore the token.</ins></p>
</dd>
<dt><ins class="diff-new">A start tag whose tag name is
"html"</ins></dt>
<dd>
<p><ins class="diff-new">Process the token</ins> <a href=
"#using8"><ins class="diff-new">using the rules for</ins></a>
<ins class="diff-new">the "</ins> <a href="#in-body" title=
"insertion mode: in body"><ins class="diff-new">in body</ins></a>
<ins class="diff-new">"</ins> <span><ins class="diff-new">insertion
mode</ins></span> .</p>
</dd>
<dt>An end tag whose tag name is "html"</dt>
<dd>
<p>Switch <del class="diff-old">to</del> the <del class=
"diff-old">trailing end phase .</del> <span><ins class=
"diff-chg">insertion mode</ins></span> <ins class="diff-chg">to
"</ins> <a href="#after8" title=
"insertion mode: after after frameset"><ins class="diff-chg">after
after frameset</ins></a> <ins class="diff-chg">".</ins></p>
</dd>
<dt>A start tag whose tag name is "noframes"</dt>
<dd>
<p>Process the token <del class="diff-old">as if</del> <a href=
"#using8"><ins class="diff-chg">using</ins> the <del class=
"diff-old">insertion mode</del> <ins class="diff-chg">rules
for</ins></a> <del class="diff-old">had been</del> <ins class=
"diff-chg">the</ins> " <a href="#in-head" title=
"insertion mode: in head">in <del class="diff-old">body</del>
<ins class="diff-chg">head</ins></a> <del class="diff-old">".</del>
<ins class="diff-chg">"</ins> <span><ins class="diff-chg">insertion
mode</ins></span> .</p>
</dd>
<dt><ins class="diff-chg">An end-of-file token</ins></dt>
<dd>
<p><a href="#stops"><ins class="diff-chg">Stop
parsing.</ins></a></p>
</dd>
<dt>Anything else</dt>
<dd>
<p><a href="#parse1">Parse error</a> . Ignore the token.</p>
</dd>
</dl>
<p class="big-issue">This doesn't handle UAs that don't support
frames, or that do support frames but want to show the NOFRAMES
content. Supporting the former is easy; supporting the latter is
harder.</p>
<h5 id="the-after0"><span class="secno"><del class=
"diff-old">8.2.4.4.</del> <ins class=
"diff-chg">8.2.5.23.</ins></span> The <del class=
"diff-old">trailing end phase</del> <ins class="diff-chg">"</ins>
<dfn id="after7" title=
"insertion mode: after after body"><ins class="diff-chg">after
after body</ins></dfn> <ins class="diff-chg">" insertion
mode</ins></h5>
<p><del class="diff-old">After</del> <ins class=
"diff-chg">When</ins> the <del class="diff-old">main phase , as
each token</del> <span><ins class="diff-chg">insertion
mode</ins></span> is <del class="diff-old">emitted from the
tokenisation</del> <ins class="diff-chg">"</ins> <a href="#after7"
title="insertion mode: after after body"><ins class=
"diff-chg">after after body</ins></a> <del class="diff-old">stage,
it</del> <ins class="diff-chg">", tokens</ins> must be <del class=
"diff-old">processed</del> <ins class="diff-chg">handled</ins> as
<del class="diff-old">described in this section.</del> <ins class=
"diff-chg">follows:</ins></p>
<dl class="switch">
<dt>A <del class="diff-old">DOCTYPE token Parse error . Ignore the
token. A</del> comment token</dt>
<dd>
<p>Append a <code>Comment</code> node to the <code>Document</code>
object with the <code title="">data</code> attribute set to the
data given in the comment token.</p>
</dd>
<dt>A <ins class="diff-new">DOCTYPE token</ins></dt>
<dt><ins class="diff-new">A</ins> character token that is one of
one of U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF), U+000B
LINE TABULATION, U+000C FORM FEED (FF), or U+0020 SPACE</dt>
<dt><ins class="diff-new">A start tag whose tag name is
"html"</ins></dt>
<dd>
<p>Process the token <del class="diff-old">as it would</del>
<a href="#using8"><ins class="diff-chg">using the rules
for</ins></a> <ins class="diff-chg">the "</ins> <a href="#in-body"
title="insertion mode: in body"><ins class="diff-chg">in
body</ins></a> <ins class="diff-chg">"</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> .</p>
</dd>
<dt><ins class="diff-chg">An end-of-file token</ins></dt>
<dd>
<p><a href="#stops"><ins class="diff-chg">Stop parsing</ins></a>
.</p>
</dd>
<dt><ins class="diff-chg">Anything else</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-chg">Parse error</ins></a>
.<ins class="diff-chg">Switch the</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> <ins class="diff-chg">to
"</ins> <a href="#in-body" title=
"insertion mode: in body"><ins class="diff-chg">in body</ins></a>
<ins class="diff-chg">" and reprocess the token.</ins></p>
</dd>
</dl>
<h5 id="the-after1"><span class="secno"><ins class=
"diff-chg">8.2.5.24.</ins></span> <ins class="diff-chg">The "</ins>
<dfn id="after8" title=
"insertion mode: after after frameset"><ins class="diff-chg">after
after frameset</ins></dfn> <ins class="diff-chg">" insertion
mode</ins></h5>
<p><ins class="diff-chg">When the</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> <ins class="diff-chg">is
"</ins> <a href="#after8" title=
"insertion mode: after after frameset"><ins class="diff-chg">after
after frameset</ins></a> <ins class="diff-chg">", tokens must</ins>
be <del class="diff-old">processed</del> <ins class=
"diff-chg">handled as follows:</ins></p>
<dl class="switch">
<dt><ins class="diff-chg">A comment token</ins></dt>
<dd>
<p><ins class="diff-chg">Append a</ins> <code><ins class=
"diff-chg">Comment</ins></code> <ins class="diff-chg">node to
the</ins> <code><ins class="diff-chg">Document</ins></code>
<ins class="diff-chg">object with the</ins> <code title=
""><ins class="diff-chg">data</ins></code> <ins class=
"diff-chg">attribute set to the data given</ins> in the <del class=
"diff-old">main phase .</del> <ins class="diff-chg">comment
token.</ins></p>
</dd>
<dt>A <ins class="diff-new">DOCTYPE token</ins></dt>
<dt><ins class="diff-new">A</ins> character token that is
<del class="diff-old">not</del> <ins class="diff-chg">one of</ins>
one of U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF), U+000B
LINE TABULATION, U+000C FORM FEED (FF), or U+0020 SPACE</dt>
<dt>A start tag <del class="diff-old">token An end</del>
<ins class="diff-chg">whose</ins> tag <del class=
"diff-old">token</del> <ins class="diff-chg">name is
"html"</ins></dt>
<dd>
<p><del class="diff-old">Parse error . Switch back to</del>
<ins class="diff-chg">Process</ins> the <del class="diff-old">main
phase</del> <ins class="diff-chg">token</ins> <a href=
"#using8"><ins class="diff-chg">using the rules for</ins></a>
<del class="diff-old">and reprocess</del> the <del class=
"diff-old">token.</del> <ins class="diff-chg">"</ins> <a href=
"#in-body" title="insertion mode: in body"><ins class="diff-chg">in
body</ins></a> <ins class="diff-chg">"</ins> <span><ins class=
"diff-chg">insertion mode</ins></span> .</p>
</dd>
<dt>An end-of-file token</dt>
<dd>
<p><a href="#stops">Stop parsing</a> .</p>
</dd>
<dt><ins class="diff-new">Anything else</ins></dt>
<dd>
<p><a href="#parse1"><ins class="diff-new">Parse error</ins></a>
.<ins class="diff-new">Switch the</ins> <span><ins class=
"diff-new">insertion mode</ins></span> <ins class="diff-new">to
"</ins> <a href="#in-frameset" title=
"insertion mode: in frameset"><ins class="diff-new">in
frameset</ins></a> <ins class="diff-new">" and reprocess the
token.</ins></p>
</dd>
</dl>
<h4 id="the-end"><span class="secno"><del class=
"diff-old">8.2.5.</del> <ins class="diff-chg">8.2.6</ins></span>
The <del class="diff-old">End</del> <ins class=
"diff-chg">end</ins></h4>
<p>Once the user agent <dfn id="stops" title="stop parsing">stops
parsing</dfn> the document, the user agent must follow the steps in
this section.</p>
<p>First, the <a href="#current"><ins class="diff-new">current
document readiness</ins></a> <ins class="diff-new">must be set to
"interactive".</ins></p>
<p><ins class="diff-new">Then, the</ins> rules for <a href=
"#when-a">when a script completes loading</a> start applying
(script execution is no longer managed by the parser).</p>
<p>If any of the scripts in the <a href="#list-of1">list of scripts
that will execute as soon as possible</a> have <span>completed
loading</span> , or if the <a href="#list-of0">list of scripts that
will execute asynchronously</a> is not empty and the first script
in that list has <span>completed loading</span> , then the user
agent must act as if those scripts just completed loading,
following the rules given for that in the <code><a href=
"#script1">script</a></code> element definition.</p>
<p>Then, if the <a href="#list-of">list of scripts that will
execute when the document has finished parsing</a> is not empty,
and the first item in this list has already <span>completed
loading</span> , then the user agent must act as if that script
just finished loading.</p>
<p>By this point, there will be no scripts that have loaded but
have not yet been executed.</p>
<p>The user agent must then <a href="#firing2">fire a simple
event</a> called <code title=
"event-DOMContentLoaded">DOMContentLoaded</code> at the
<code>Document</code> .</p>
<p>Once everything that <dfn id="delays" title=
"delay the load event">delays the load event</dfn> has completed,
the user agent must <ins class="diff-new">set the</ins> <a href=
"#current"><ins class="diff-new">current document
readiness</ins></a> <ins class="diff-new">to "complete", and
then</ins> <a href="#firing4" title="fire a load event">fire a
<code title="event-load">load</code> event</a> at <a href=
"#the-body1">the <code>body</code> element</a> .</p>
<p class="big-issue">delaying the load event for things like image
loads allows for intranet port scans (even without javascript!).
Should we really encode that into the spec?</p>
<h3 id="namespaces"><span class="secno"><del class=
"diff-old">8.3.</del> <ins class="diff-chg">8.3</ins></span>
Namespaces</h3>
<p>The <dfn id="html-namespace0">HTML namespace</dfn> is:
<code>http://www.w3.org/1999/xhtml</code></p>
<p><ins class="diff-chg">The</ins> <dfn id="mathml0"><ins class=
"diff-chg">MathML namespace</ins></dfn> <ins class=
"diff-chg">is:</ins> <code><ins class=
"diff-chg">http://www.w3.org/1998/Math/MathML</ins></code></p>
<p><ins class="diff-chg">The</ins> <dfn id=
"svg-namespace"><ins class="diff-chg">SVG namespace</ins></dfn>
<ins class="diff-chg">is:</ins> <code><ins class=
"diff-chg">http://www.w3.org/2000/svg</ins></code></p>
<p><ins class="diff-chg">The</ins> <dfn id="xlink"><ins class=
"diff-chg">XLink namespace</ins></dfn> <ins class=
"diff-chg">is:</ins> <code><ins class=
"diff-chg">http://www.w3.org/1999/xlink</ins></code></p>
<p><ins class="diff-chg">The</ins> <dfn id=
"xml-namespace"><ins class="diff-chg">XML namespace</ins></dfn>
<ins class="diff-chg">is:</ins> <code><ins class=
"diff-chg">http://www.w3.org/XML/1998/namespace</ins></code></p>
<p><ins class="diff-chg">The</ins> <dfn id="xmlns"><ins class=
"diff-chg">XMLNS namespace</ins></dfn> <ins class=
"diff-chg">is:</ins> <code><ins class=
"diff-chg">http://www.w3.org/2000/xmlns/</ins></code></p>
<h3 id="serializing"><span class="secno"><del class=
"diff-old">8.4.</del> <ins class="diff-chg">8.4</ins></span>
<del class="diff-old">Serialising</del> <ins class=
"diff-chg">Serializing</ins> HTML fragments</h3>
<p>The following steps form the <dfn id="html-fragment">HTML
fragment <del class="diff-old">serialisation</del> <ins class=
"diff-chg">serialization</ins> algorithm</dfn> . The algorithm
takes as input a DOM <code>Element</code> or <code>Document</code>
, referred to as <var title="">the node</var> , and either returns
a string or raises an exception.</p>
<p class="note">This algorithm <del class=
"diff-old">serialises</del> <ins class="diff-chg">serializes</ins>
the <em>children</em> of the node being <del class=
"diff-old">serialised,</del> <ins class=
"diff-chg">serialized,</ins> not the node itself.</p>
<ol>
<li>
<p>Let <var title="">s</var> be a string, and initialise it to the
empty string.</p>
</li>
<li>
<p>For each child node <del class="diff-old">child</del> of
<var title="">the node</var> , in <a href="#tree-order">tree
order</a> , <del class="diff-old">append</del> <ins class=
"diff-chg">run the following steps:</ins></p>
<ol>
<li>
<p><ins class="diff-chg">Let</ins> <var title=""><ins class=
"diff-chg">current node</ins></var> <ins class="diff-chg">be the
child node being processed.</ins></p>
</li>
<li>
<p><ins class="diff-chg">Append</ins> the appropriate string from
the following list to <var title="">s</var> :</p>
<dl class="switch">
<dt>If <del class="diff-old">the child</del> <var title=
""><ins class="diff-chg">current</ins> node</var> is an
<code title="">Element</code></dt>
<dd>
<p>Append a U+003C LESS-THAN SIGN ( <code title=""><</code> )
character, followed by the element's tag name. (For nodes created
by the <a href="#html-0">HTML parser</a> , <code title=
"">Document.createElement()</code> , or <code title=
"">Document.renameNode()</code> , the tag name will be
lowercase.)</p>
<p>For each attribute that the element has, append a U+0020 SPACE
character, the attribute's name (which, for attributes set by the
<a href="#html-0">HTML parser</a> or by <code title=
"">Element.setAttributeNode()</code> or <code title=
"">Element.setAttribute()</code> , will be lowercase), a U+003D
EQUALS SIGN ( <code title="">=</code> ) character, a U+0022
QUOTATION MARK ( <code title="">"</code> ) character, the
attribute's value, <a href="#escapingString" title=
"escaping a string">escaped as described below <del class=
"diff-old">,</del></a> <ins class="diff-chg">in</ins>
<i><ins class="diff-chg">attribute mode</ins></i> , and a second
U+0022 QUOTATION MARK ( <code title="">"</code> ) character.</p>
<p>While the exact order of attributes is UA-defined, and may
depend on factors such as the order that the attributes were given
in the original markup, the sort order must be stable, such that
consecutive invocations of this algorithm <del class=
"diff-old">serialise</del> <ins class="diff-chg">serialize</ins> an
element's attributes in the same order.</p>
<p>Append a U+003E GREATER-THAN SIGN ( <code title="">></code> )
character.</p>
<p>If <del class="diff-old">the child</del> <var title=
""><ins class="diff-chg">current</ins> node</var> is an
<code><a href="#area">area</a></code> , <code><a href=
"#base">base</a></code> , <code>basefont</code> ,
<code>bgsound</code> , <code><a href="#br">br</a></code> ,
<code><a href="#col">col</a></code> , <code><a href=
"#embed">embed</a></code> , <code>frame</code> , <code><a href=
"#hr">hr</a></code> , <code><a href="#img">img</a></code> ,
<code>input</code> , <code><a href="#link">link</a></code> ,
<code><a href="#meta0">meta</a></code> , <code><a href=
"#param">param</a></code> , <code>spacer</code> , or
<code>wbr</code> element, then continue on to the next child node
at this point.</p>
<p>If <del class="diff-old">the child</del> <var title=
""><ins class="diff-chg">current</ins> node</var> is a
<code><a href="#pre">pre</a></code> <del class="diff-old">or</del>
<code>textarea</code> , <ins class="diff-new">or</ins>
<code><ins class="diff-new">listing</ins></code> element, append a
U+000A LINE FEED (LF) character.</p>
<p>Append the value of running the <a href="#html-fragment">HTML
fragment <del class="diff-old">serialisation</del> <ins class=
"diff-chg">serialization</ins> algorithm</a> on the <var title=
""><del class="diff-old">child</del> <ins class="diff-chg">current
node</ins></var> element (thus recursing into this algorithm for
that element), followed by a U+003C LESS-THAN SIGN ( <code title=
""><</code> ) character, a U+002F SOLIDUS ( <code title=
"">/</code> ) character, the element's tag name again, and finally
a U+003E GREATER-THAN SIGN ( <code title="">></code> )
character.</p>
</dd>
<dt>If <del class="diff-old">the child</del> <var title=
""><ins class="diff-chg">current</ins> node</var> is a <code title=
"">Text</code> or <code title="">CDATASection</code> node</dt>
<dd>
<p>If one of the ancestors of <del class="diff-old">the child</del>
<var title=""><ins class="diff-chg">current</ins> node</var> is a
<code><a href="#style1">style</a></code> , <code><a href=
"#script1">script</a></code> , <code>xmp</code> , <code><a href=
"#iframe">iframe</a></code> , <code>noembed</code> ,
<code>noframes</code> , <code><a href=
"#noscript">noscript</a></code> , or <code>plaintext</code>
element, then append the value of <del class="diff-old">the</del>
<var title=""><del class="diff-old">child</del> <ins class=
"diff-chg">current node</ins></var> <del class=
"diff-old">node's</del> <ins class="diff-chg">'s</ins> <code title=
"">data</code> DOM attribute literally.</p>
<p>Otherwise, append the value of <del class="diff-old">the</del>
<var title=""><del class="diff-old">child</del> <ins class=
"diff-chg">current node</ins></var> <del class=
"diff-old">node's</del> <ins class="diff-chg">'s</ins> <code title=
"">data</code> DOM attribute, <a href="#escapingString" title=
"escaping a string">escaped as described below</a> .</p>
</dd>
<dt>If <del class="diff-old">the child</del> <var title=
""><ins class="diff-chg">current</ins> node</var> is a <code title=
"">Comment</code></dt>
<dd>
<p>Append the literal string <code><!--</code> (U+003C LESS-THAN
SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, U+002D
HYPHEN-MINUS), followed by the value of <del class=
"diff-old">the</del> <var title=""><del class=
"diff-old">child</del> <ins class="diff-chg">current
node</ins></var> <del class="diff-old">node's</del> <ins class=
"diff-chg">'s</ins> <code title="">data</code> DOM attribute,
followed by the literal string <code>--></code> (U+002D
HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E GREATER-THAN SIGN).</p>
</dd>
<dt>If <var title=""><ins class="diff-new">current node</ins></var>
<ins class="diff-new">is a</ins> <code title=""><ins class=
"diff-new">ProcessingInstruction</ins></code></dt>
<dd>
<p><ins class="diff-new">Append</ins> the <del class=
"diff-old">child</del> <ins class="diff-chg">literal string</ins>
<code><ins class="diff-chg"><?</ins></code> <ins class=
"diff-chg">(U+003C LESS-THAN SIGN, U+003F QUESTION MARK), followed
by the value of</ins> <var title=""><ins class=
"diff-chg">current</ins> node</var> <ins class="diff-new">'s</ins>
<code title=""><ins class="diff-new">target</ins></code>
<ins class="diff-new">DOM attribute, followed by a single U+0020
SPACE character, followed by the value of</ins> <var title=
""><ins class="diff-new">current node</ins></var> <ins class=
"diff-new">'s</ins> <code title=""><ins class=
"diff-new">data</ins></code> <ins class="diff-new">DOM attribute,
followed by a single U+003E GREATER-THAN SIGN character ('>
').</ins></p>
</dd>
<dt><ins class="diff-new">If</ins> <var title=""><ins class=
"diff-new">current node</ins></var> is a <code title=
"">DocumentType</code></dt>
<dd>
<p>Append the literal string <code><!DOCTYPE</code> (U+003C
LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+0044 LATIN CAPITAL
LETTER D, U+004F LATIN CAPITAL LETTER O, U+0043 LATIN CAPITAL
LETTER C, U+0054 LATIN CAPITAL LETTER T, U+0059 LATIN CAPITAL
LETTER Y, U+0050 LATIN CAPITAL LETTER P, U+0045 LATIN CAPITAL
LETTER E), followed by a space (U+0020 SPACE), followed by the
value of <del class="diff-old">the</del> <var title=""><del class=
"diff-old">child</del> <ins class="diff-chg">current
node</ins></var> <del class="diff-old">node's</del> <ins class=
"diff-chg">'s</ins> <code title="">name</code> DOM attribute,
followed by the literal string <code>></code> (U+003E
GREATER-THAN SIGN).</p>
</dd>
</dl>
<p>Other <del class="diff-old">nodes</del> <ins class=
"diff-chg">node</ins> types (e.g. <code title="">Attr</code> )
cannot occur as children of elements. <del class=
"diff-old">If</del> <ins class="diff-chg">If, despite this,</ins>
they <del class="diff-old">do,</del> <ins class="diff-chg">somehow
do occur,</ins> this algorithm must raise an
<code>INVALID_STATE_ERR</code> exception.</p>
</li>
</ol>
</li>
<li>
<p>The result of the algorithm is the string <var title="">s</var>
.</p>
</li>
</ol>
<p><dfn id="escapingString">Escaping a string</dfn> (for the
purposes of the algorithm above) consists of replacing any
<del class="diff-old">occurances</del> <ins class=
"diff-chg">occurrences</ins> of the " <code title="">&</code> "
character by the string " <code title="">&amp;</code> ", any
<del class="diff-old">occurances</del> <ins class=
"diff-chg">occurrences</ins> of the " <code title=""><</code> "
character by the string " <code title="">&lt;</code> ", any
<del class="diff-old">occurances</del> <ins class=
"diff-chg">occurrences</ins> of the " <code title="">></code> "
character by the string " <code title="">&gt;</code> ",
<del class="diff-old">and</del> any <del class=
"diff-old">occurances</del> <ins class="diff-chg">occurrences of
the U+00A0 NO-BREAK SPACE character by the string "</ins>
<code title=""><ins class="diff-chg">&nbsp;</ins></code>
<ins class="diff-chg">", and, if the algorithm was invoked in
the</ins> <i><ins class="diff-chg">attribute mode</ins></i>
,<ins class="diff-chg">any occurrences</ins> of the " <code title=
"">"</code> " character by the string " <code title=
"">&quot;</code> ".</p>
<p class="note">Entity reference nodes are <a href=
"#entity-references">assumed to be expanded</a> by the user agent,
and are therefore not covered in the algorithm above.</p>
<p class="note">It is possible that the output of this algorithm,
if parsed with an <a href="#html-0">HTML parser</a> , will not
return the original tree structure. For instance, if a
<code>textarea</code> element to which a <code title=
"">Comment</code> node has been appended is <del class=
"diff-old">serialised</del> <ins class="diff-chg">serialized</ins>
and the output is then reparsed, the comment will end up being
displayed in the text field. Similarly, if, as a result of DOM
manipulation, an element contains a comment that contains the
literal string " <code title="">--></code> ", then when the
result of <del class="diff-old">serialising</del> <ins class=
"diff-chg">serializing</ins> the element is parsed, the comment
will be truncated at that point and the rest of the comment will be
interpreted as markup. More examples would be making a
<code><a href="#script1">script</a></code> element contain a text
node with the text string " <code></script></code> ", or
having a <code><a href="#p">p</a></code> element that contains a
<code><a href="#ul">ul</a></code> element (as the <code><a href=
"#ul">ul</a></code> element's <span title="syntax-start-tag">start
tag</span> would imply the end tag for the <code><a href=
"#p">p</a></code> ).</p>
<h3 id="parsing2"><span class="secno"><del class=
"diff-old">8.5.</del> <ins class="diff-chg">8.5</ins></span>
Parsing HTML fragments</h3>
<p>The following steps form the <dfn id="html-fragment0">HTML
fragment parsing algorithm</dfn> . The algorithm takes as input a
DOM <code>Element</code> , referred to as <ins class=
"diff-new">the</ins> <var title="">context <del class=
"diff-old">,</del></var> <ins class="diff-chg">element,</ins> which
gives the context for the parser, as well as <var title=
"">input</var> , a string to parse, and returns a list of zero or
more nodes.</p>
<p class="note">Parts marked <dfn id="fragment">fragment case</dfn>
in algorithms in the parser section are parts that only occur if
the parser was created for the purposes of this algorithm. The
algorithms have been annotated with such markings for informational
purposes only; such markings have no normative weight. If it is
possible for a condition described as a <a href=
"#fragment">fragment case</a> to occur even when the parser wasn't
created for the purposes of handling this algorithm, then that is
an error in the specification.</p>
<ol>
<li>
<p>Create a new <code>Document</code> node, and mark it as being an
<a href="#html-" title="HTML documents">HTML document</a> .</p>
</li>
<li>
<p>Create a new <a href="#html-0">HTML parser</a> , and associate
it with the just created <code>Document</code> node.</p>
</li>
<li>
<p>Set the <a href="#html-0">HTML parser</a> 's <a href=
"#tokenisation0">tokenisation</a> stage's <a href=
"#content2">content model flag</a> according to the <var title=
"">context</var> element, as follows:</p>
<dl class="switch">
<dt>If it is a <code><a href="#title1">title</a></code> or
<code>textarea</code> element</dt>
<dd>Set the <a href="#content2">content model flag</a> to
<em>RCDATA</em> .</dd>
<dt>If it is a <code><a href="#style1">style</a></code> ,
<code><a href="#script1">script</a></code> , <code>xmp</code> ,
<code><a href="#iframe">iframe</a></code> , <code>noembed</code> ,
or <code>noframes</code> element</dt>
<dd>Set the <a href="#content2">content model flag</a> to
<em>CDATA</em> .</dd>
<dt>If it is a <code><a href="#noscript">noscript</a></code>
element</dt>
<dd>If <ins class="diff-new">the</ins> <a href=
"#scripting2">scripting <ins class="diff-new">flag</ins></a> is
<del class="diff-old">enabled ,</del> <ins class=
"diff-chg">enabled,</ins> set the <a href="#content2">content model
flag</a> to <em>CDATA</em> . Otherwise, set the <a href=
"#content2">content model flag</a> to <em>PCDATA</em> .</dd>
<dt>If it is a <code>plaintext</code> element</dt>
<dd>Set the <a href="#content2">content model flag</a> to
<em>PLAINTEXT</em> .</dd>
<dt>Otherwise</dt>
<dd>Set the <a href="#content2">content model flag</a> to
<em>PCDATA</em> .</dd>
</dl>
</li>
<li>
<p><del class="diff-old">Switch the HTML parser 's tree
construction stage to the main phase .</del> Let <var title=
"">root</var> be a new <code><a href="#html">html</a></code>
element with no attributes.</p>
</li>
<li>
<p>Append the element <var title="">root</var> to the
<code>Document</code> node created above.</p>
</li>
<li>
<p>Set up the parser's <a href="#stack">stack of open elements</a>
so that it contains just the single element <var title=
"">root</var> .</p>
</li>
<li>
<p><a href="#reset" title=
"reset the insertion mode appropriately">Reset the parser's
insertion mode appropriately</a> .</p>
<p class="note">The parser will reference the <var title=
"">context</var> <del class="diff-old">node</del> <ins class=
"diff-chg">element</ins> as part of that algorithm.</p>
</li>
<li>
<p>Set the parser's <a href="#form-element"><code>form</code>
element pointer</a> to the nearest node to the <var title=
"">context</var> <ins class="diff-new">element</ins> that is a
<code>form</code> element (going straight up the ancestor chain,
and including the element itself, if it is a <code>form</code>
element), or, if there is no such <code>form</code> element, to
null.</p>
</li>
<li>
<p>Place into the <a href="#input0">input stream</a> for the
<a href="#html-0">HTML parser</a> just created the <var title=
"">input</var> .</p>
</li>
<li>
<p>Start the parser and let it run until it has consumed all the
characters just inserted into the input stream.</p>
</li>
<li>
<p>Return all the child nodes of <var title="">root</var> ,
preserving the document order.</p>
</li>
</ol>
<h3 id="named"><span class="secno"><del class="diff-old">8.6.</del>
<ins class="diff-chg">8.6</ins></span> <del class=
"diff-old">Entities</del> <dfn id="named0"><ins class=
"diff-chg">Named character references</ins></dfn></h3>
<p>This table lists the <del class="diff-old">entity</del>
<ins class="diff-chg">character reference</ins> names that are
supported by HTML, and the code points to which they refer. It is
referenced by the previous sections.</p>
<div class="tall-and-narrow">
<table>
<thead>
<tr>
<th><del class="diff-old">Entity</del> Name</th>
<th>Character</th>
</tr>
</thead>
<tbody>
<tr>
<td><code title="">AElig;</code></td>
<td><del class="diff-old">U+00C6</del> <ins class=
"diff-chg">U+000C6</ins></td>
</tr>
<tr>
<td><code title="">AElig</code></td>
<td><del class="diff-old">U+00C6</del> <ins class=
"diff-chg">U+000C6</ins></td>
</tr>
<tr>
<td><code title="">AMP;</code></td>
<td><del class="diff-old">U+0026</del> <ins class=
"diff-chg">U+00026</ins></td>
</tr>
<tr>
<td><code title="">AMP</code></td>
<td><del class="diff-old">U+0026</del> <ins class=
"diff-chg">U+00026</ins></td>
</tr>
<tr>
<td><code title="">Aacute;</code></td>
<td><del class="diff-old">U+00C1</del> <ins class=
"diff-chg">U+000C1</ins></td>
</tr>
<tr>
<td><code title="">Aacute</code></td>
<td><del class="diff-old">U+00C1</del> <ins class=
"diff-chg">U+000C1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Abreve;</ins></code></td>
<td><ins class="diff-chg">U+00102</ins></td>
</tr>
<tr>
<td><code title="">Acirc;</code></td>
<td><del class="diff-old">U+00C2</del> <ins class=
"diff-chg">U+000C2</ins></td>
</tr>
<tr>
<td><code title="">Acirc</code></td>
<td><del class="diff-old">U+00C2</del> <ins class=
"diff-chg">U+000C2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Acy;</ins></code></td>
<td><ins class="diff-chg">U+00410</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Afr;</ins></code></td>
<td><ins class="diff-chg">U+1D504</ins></td>
</tr>
<tr>
<td><code title="">Agrave;</code></td>
<td><del class="diff-old">U+00C0</del> <ins class=
"diff-chg">U+000C0</ins></td>
</tr>
<tr>
<td><code title="">Agrave</code></td>
<td><del class="diff-old">U+00C0</del> <ins class=
"diff-chg">U+000C0</ins></td>
</tr>
<tr>
<td><code title="">Alpha;</code></td>
<td><del class="diff-old">U+0391</del> <ins class=
"diff-chg">U+00391</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Amacr;</ins></code></td>
<td><ins class="diff-chg">U+00100</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">And;</ins></code></td>
<td><ins class="diff-chg">U+02A53</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Aogon;</ins></code></td>
<td><ins class="diff-chg">U+00104</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Aopf;</ins></code></td>
<td><ins class="diff-chg">U+1D538</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ApplyFunction;</ins></code></td>
<td><ins class="diff-chg">U+02061</ins></td>
</tr>
<tr>
<td><code title="">Aring;</code></td>
<td><del class="diff-old">U+00C5</del> <ins class=
"diff-chg">U+000C5</ins></td>
</tr>
<tr>
<td><code title="">Aring</code></td>
<td><del class="diff-old">U+00C5</del> <ins class=
"diff-chg">U+000C5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ascr;</ins></code></td>
<td><ins class="diff-chg">U+1D49C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Assign;</ins></code></td>
<td><ins class="diff-chg">U+02254</ins></td>
</tr>
<tr>
<td><code title="">Atilde;</code></td>
<td><del class="diff-old">U+00C3</del> <ins class=
"diff-chg">U+000C3</ins></td>
</tr>
<tr>
<td><code title="">Atilde</code></td>
<td><del class="diff-old">U+00C3</del> <ins class=
"diff-chg">U+000C3</ins></td>
</tr>
<tr>
<td><code title="">Auml;</code></td>
<td><del class="diff-old">U+00C4</del> <ins class=
"diff-chg">U+000C4</ins></td>
</tr>
<tr>
<td><code title="">Auml</code></td>
<td><del class="diff-old">U+00C4</del> <ins class=
"diff-chg">U+000C4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Backslash;</ins></code></td>
<td><ins class="diff-chg">U+02216</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Barv;</ins></code></td>
<td><ins class="diff-chg">U+02AE7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Barwed;</ins></code></td>
<td><ins class="diff-chg">U+02306</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Bcy;</ins></code></td>
<td><ins class="diff-chg">U+00411</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Because;</ins></code></td>
<td><ins class="diff-chg">U+02235</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Bernoullis;</ins></code></td>
<td><ins class="diff-chg">U+0212C</ins></td>
</tr>
<tr>
<td><code title="">Beta;</code></td>
<td><del class="diff-old">U+0392</del> <ins class=
"diff-chg">U+00392</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Bfr;</ins></code></td>
<td><ins class="diff-chg">U+1D505</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Bopf;</ins></code></td>
<td><ins class="diff-chg">U+1D539</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Breve;</ins></code></td>
<td><ins class="diff-chg">U+002D8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Bscr;</ins></code></td>
<td><ins class="diff-chg">U+0212C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Bumpeq;</ins></code></td>
<td><ins class="diff-chg">U+0224E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">CHcy;</ins></code></td>
<td><ins class="diff-chg">U+00427</ins></td>
</tr>
<tr>
<td><code title="">COPY;</code></td>
<td><del class="diff-old">U+00A9</del> <ins class=
"diff-chg">U+000A9</ins></td>
</tr>
<tr>
<td><code title="">COPY</code></td>
<td><del class="diff-old">U+00A9</del> <ins class=
"diff-chg">U+000A9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Cacute;</ins></code></td>
<td><ins class="diff-chg">U+00106</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Cap;</ins></code></td>
<td><ins class="diff-chg">U+022D2</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">CapitalDifferentialD;</ins></code></td>
<td><ins class="diff-chg">U+02145</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Cayleys;</ins></code></td>
<td><ins class="diff-chg">U+0212D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ccaron;</ins></code></td>
<td><ins class="diff-chg">U+0010C</ins></td>
</tr>
<tr>
<td><code title="">Ccedil;</code></td>
<td><del class="diff-old">U+00C7</del> <ins class=
"diff-chg">U+000C7</ins></td>
</tr>
<tr>
<td><code title="">Ccedil</code></td>
<td><del class="diff-old">U+00C7</del> <ins class=
"diff-chg">U+000C7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ccirc;</ins></code></td>
<td><ins class="diff-chg">U+00108</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Cconint;</ins></code></td>
<td><ins class="diff-chg">U+02230</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Cdot;</ins></code></td>
<td><ins class="diff-chg">U+0010A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Cedilla;</ins></code></td>
<td><ins class="diff-chg">U+000B8</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">CenterDot;</ins></code></td>
<td><ins class="diff-chg">U+000B7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Cfr;</ins></code></td>
<td><ins class="diff-chg">U+0212D</ins></td>
</tr>
<tr>
<td><code title="">Chi;</code></td>
<td><del class="diff-old">U+03A7</del> <ins class=
"diff-chg">U+003A7</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">CircleDot;</ins></code></td>
<td><ins class="diff-chg">U+02299</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">CircleMinus;</ins></code></td>
<td><ins class="diff-chg">U+02296</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">CirclePlus;</ins></code></td>
<td><ins class="diff-chg">U+02295</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">CircleTimes;</ins></code></td>
<td><ins class="diff-chg">U+02297</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ClockwiseContourIntegral;</ins></code></td>
<td><ins class="diff-chg">U+02232</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">CloseCurlyDoubleQuote;</ins></code></td>
<td><ins class="diff-chg">U+0201D</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">CloseCurlyQuote;</ins></code></td>
<td><ins class="diff-chg">U+02019</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Colon;</ins></code></td>
<td><ins class="diff-chg">U+02237</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Colone;</ins></code></td>
<td><ins class="diff-chg">U+02A74</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Congruent;</ins></code></td>
<td><ins class="diff-chg">U+02261</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Conint;</ins></code></td>
<td><ins class="diff-chg">U+0222F</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ContourIntegral;</ins></code></td>
<td><ins class="diff-chg">U+0222E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Copf;</ins></code></td>
<td><ins class="diff-chg">U+02102</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Coproduct;</ins></code></td>
<td><ins class="diff-chg">U+02210</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">CounterClockwiseContourIntegral;</ins></code></td>
<td><ins class="diff-chg">U+02233</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Cross;</ins></code></td>
<td><ins class="diff-chg">U+02A2F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Cscr;</ins></code></td>
<td><ins class="diff-chg">U+1D49E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Cup;</ins></code></td>
<td><ins class="diff-chg">U+022D3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">CupCap;</ins></code></td>
<td><ins class="diff-chg">U+0224D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">DD;</ins></code></td>
<td><ins class="diff-chg">U+02145</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DDotrahd;</ins></code></td>
<td><ins class="diff-chg">U+02911</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">DJcy;</ins></code></td>
<td><ins class="diff-chg">U+00402</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">DScy;</ins></code></td>
<td><ins class="diff-chg">U+00405</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">DZcy;</ins></code></td>
<td><ins class="diff-chg">U+0040F</ins></td>
</tr>
<tr>
<td><code title="">Dagger;</code></td>
<td><del class="diff-old">U+2021</del> <ins class=
"diff-chg">U+02021</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Darr;</ins></code></td>
<td><ins class="diff-chg">U+021A1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Dashv;</ins></code></td>
<td><ins class="diff-chg">U+02AE4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Dcaron;</ins></code></td>
<td><ins class="diff-chg">U+0010E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Dcy;</ins></code></td>
<td><ins class="diff-chg">U+00414</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Del;</ins></code></td>
<td><ins class="diff-chg">U+02207</ins></td>
</tr>
<tr>
<td><code title="">Delta;</code></td>
<td><del class="diff-old">U+0394</del> <ins class=
"diff-chg">U+00394</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Dfr;</ins></code></td>
<td><ins class="diff-chg">U+1D507</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DiacriticalAcute;</ins></code></td>
<td><ins class="diff-chg">U+000B4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DiacriticalDot;</ins></code></td>
<td><ins class="diff-chg">U+002D9</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DiacriticalDoubleAcute;</ins></code></td>
<td><ins class="diff-chg">U+002DD</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DiacriticalGrave;</ins></code></td>
<td><ins class="diff-chg">U+00060</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DiacriticalTilde;</ins></code></td>
<td><ins class="diff-chg">U+002DC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Diamond;</ins></code></td>
<td><ins class="diff-chg">U+022C4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DifferentialD;</ins></code></td>
<td><ins class="diff-chg">U+02146</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Dopf;</ins></code></td>
<td><ins class="diff-chg">U+1D53B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Dot;</ins></code></td>
<td><ins class="diff-chg">U+000A8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">DotDot;</ins></code></td>
<td><ins class="diff-chg">U+020DC</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DotEqual;</ins></code></td>
<td><ins class="diff-chg">U+02250</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DoubleContourIntegral;</ins></code></td>
<td><ins class="diff-chg">U+0222F</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DoubleDot;</ins></code></td>
<td><ins class="diff-chg">U+000A8</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DoubleDownArrow;</ins></code></td>
<td><ins class="diff-chg">U+021D3</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DoubleLeftArrow;</ins></code></td>
<td><ins class="diff-chg">U+021D0</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DoubleLeftRightArrow;</ins></code></td>
<td><ins class="diff-chg">U+021D4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DoubleLeftTee;</ins></code></td>
<td><ins class="diff-chg">U+02AE4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DoubleLongLeftArrow;</ins></code></td>
<td><ins class="diff-chg">U+027F8</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DoubleLongLeftRightArrow;</ins></code></td>
<td><ins class="diff-chg">U+027FA</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DoubleLongRightArrow;</ins></code></td>
<td><ins class="diff-chg">U+027F9</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DoubleRightArrow;</ins></code></td>
<td><ins class="diff-chg">U+021D2</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DoubleRightTee;</ins></code></td>
<td><ins class="diff-chg">U+022A8</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DoubleUpArrow;</ins></code></td>
<td><ins class="diff-chg">U+021D1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DoubleUpDownArrow;</ins></code></td>
<td><ins class="diff-chg">U+021D5</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DoubleVerticalBar;</ins></code></td>
<td><ins class="diff-chg">U+02225</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DownArrow;</ins></code></td>
<td><ins class="diff-chg">U+02193</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DownArrowBar;</ins></code></td>
<td><ins class="diff-chg">U+02913</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DownArrowUpArrow;</ins></code></td>
<td><ins class="diff-chg">U+021F5</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DownBreve;</ins></code></td>
<td><ins class="diff-chg">U+00311</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DownLeftRightVector;</ins></code></td>
<td><ins class="diff-chg">U+02950</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DownLeftTeeVector;</ins></code></td>
<td><ins class="diff-chg">U+0295E</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DownLeftVector;</ins></code></td>
<td><ins class="diff-chg">U+021BD</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DownLeftVectorBar;</ins></code></td>
<td><ins class="diff-chg">U+02956</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DownRightTeeVector;</ins></code></td>
<td><ins class="diff-chg">U+0295F</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DownRightVector;</ins></code></td>
<td><ins class="diff-chg">U+021C1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DownRightVectorBar;</ins></code></td>
<td><ins class="diff-chg">U+02957</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">DownTee;</ins></code></td>
<td><ins class="diff-chg">U+022A4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">DownTeeArrow;</ins></code></td>
<td><ins class="diff-chg">U+021A7</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Downarrow;</ins></code></td>
<td><ins class="diff-chg">U+021D3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Dscr;</ins></code></td>
<td><ins class="diff-chg">U+1D49F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Dstrok;</ins></code></td>
<td><ins class="diff-chg">U+00110</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ENG;</ins></code></td>
<td><ins class="diff-chg">U+0014A</ins></td>
</tr>
<tr>
<td><code title="">ETH;</code></td>
<td><del class="diff-old">U+00D0</del> <ins class=
"diff-chg">U+000D0</ins></td>
</tr>
<tr>
<td><code title="">ETH</code></td>
<td><del class="diff-old">U+00D0</del> <ins class=
"diff-chg">U+000D0</ins></td>
</tr>
<tr>
<td><code title="">Eacute;</code></td>
<td><del class="diff-old">U+00C9</del> <ins class=
"diff-chg">U+000C9</ins></td>
</tr>
<tr>
<td><code title="">Eacute</code></td>
<td><del class="diff-old">U+00C9</del> <ins class=
"diff-chg">U+000C9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ecaron;</ins></code></td>
<td><ins class="diff-chg">U+0011A</ins></td>
</tr>
<tr>
<td><code title="">Ecirc;</code></td>
<td><del class="diff-old">U+00CA</del> <ins class=
"diff-chg">U+000CA</ins></td>
</tr>
<tr>
<td><code title="">Ecirc</code></td>
<td><del class="diff-old">U+00CA</del> <ins class=
"diff-chg">U+000CA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ecy;</ins></code></td>
<td><ins class="diff-chg">U+0042D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Edot;</ins></code></td>
<td><ins class="diff-chg">U+00116</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Efr;</ins></code></td>
<td><ins class="diff-chg">U+1D508</ins></td>
</tr>
<tr>
<td><code title="">Egrave;</code></td>
<td><del class="diff-old">U+00C8</del> <ins class=
"diff-chg">U+000C8</ins></td>
</tr>
<tr>
<td><code title="">Egrave</code></td>
<td><del class="diff-old">U+00C8</del> <ins class=
"diff-chg">U+000C8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Element;</ins></code></td>
<td><ins class="diff-chg">U+02208</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Emacr;</ins></code></td>
<td><ins class="diff-chg">U+00112</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">EmptySmallSquare;</ins></code></td>
<td><ins class="diff-chg">U+025FB</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">EmptyVerySmallSquare;</ins></code></td>
<td><ins class="diff-chg">U+025AB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Eogon;</ins></code></td>
<td><ins class="diff-chg">U+00118</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Eopf;</ins></code></td>
<td><ins class="diff-chg">U+1D53C</ins></td>
</tr>
<tr>
<td><code title="">Epsilon;</code></td>
<td><del class="diff-old">U+0395</del> <ins class=
"diff-chg">U+00395</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Equal;</ins></code></td>
<td><ins class="diff-chg">U+02A75</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">EqualTilde;</ins></code></td>
<td><ins class="diff-chg">U+02242</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Equilibrium;</ins></code></td>
<td><ins class="diff-chg">U+021CC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Escr;</ins></code></td>
<td><ins class="diff-chg">U+02130</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Esim;</ins></code></td>
<td><ins class="diff-chg">U+02A73</ins></td>
</tr>
<tr>
<td><code title="">Eta;</code></td>
<td><del class="diff-old">U+0397</del> <ins class=
"diff-chg">U+00397</ins></td>
</tr>
<tr>
<td><code title="">Euml;</code></td>
<td><del class="diff-old">U+00CB</del> <ins class=
"diff-chg">U+000CB</ins></td>
</tr>
<tr>
<td><code title="">Euml</code></td>
<td><del class="diff-old">U+00CB</del> <ins class=
"diff-chg">U+000CB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Exists;</ins></code></td>
<td><ins class="diff-chg">U+02203</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ExponentialE;</ins></code></td>
<td><ins class="diff-chg">U+02147</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Fcy;</ins></code></td>
<td><ins class="diff-chg">U+00424</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ffr;</ins></code></td>
<td><ins class="diff-chg">U+1D509</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">FilledSmallSquare;</ins></code></td>
<td><ins class="diff-chg">U+025FC</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">FilledVerySmallSquare;</ins></code></td>
<td><ins class="diff-chg">U+025AA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Fopf;</ins></code></td>
<td><ins class="diff-chg">U+1D53D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ForAll;</ins></code></td>
<td><ins class="diff-chg">U+02200</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Fouriertrf;</ins></code></td>
<td><ins class="diff-chg">U+02131</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Fscr;</ins></code></td>
<td><ins class="diff-chg">U+02131</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">GJcy;</ins></code></td>
<td><ins class="diff-chg">U+00403</ins></td>
</tr>
<tr>
<td><code title="">GT;</code></td>
<td><del class="diff-old">U+003E</del> <ins class=
"diff-chg">U+0003E</ins></td>
</tr>
<tr>
<td><code title="">GT</code></td>
<td><del class="diff-old">U+003E</del> <ins class=
"diff-chg">U+0003E</ins></td>
</tr>
<tr>
<td><code title="">Gamma;</code></td>
<td><del class="diff-old">U+0393</del> <ins class=
"diff-chg">U+00393</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Gammad;</ins></code></td>
<td><ins class="diff-chg">U+003DC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Gbreve;</ins></code></td>
<td><ins class="diff-chg">U+0011E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Gcedil;</ins></code></td>
<td><ins class="diff-chg">U+00122</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Gcirc;</ins></code></td>
<td><ins class="diff-chg">U+0011C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Gcy;</ins></code></td>
<td><ins class="diff-chg">U+00413</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Gdot;</ins></code></td>
<td><ins class="diff-chg">U+00120</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Gfr;</ins></code></td>
<td><ins class="diff-chg">U+1D50A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Gg;</ins></code></td>
<td><ins class="diff-chg">U+022D9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Gopf;</ins></code></td>
<td><ins class="diff-chg">U+1D53E</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">GreaterEqual;</ins></code></td>
<td><ins class="diff-chg">U+02265</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">GreaterEqualLess;</ins></code></td>
<td><ins class="diff-chg">U+022DB</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">GreaterFullEqual;</ins></code></td>
<td><ins class="diff-chg">U+02267</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">GreaterGreater;</ins></code></td>
<td><ins class="diff-chg">U+02AA2</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">GreaterLess;</ins></code></td>
<td><ins class="diff-chg">U+02277</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">GreaterSlantEqual;</ins></code></td>
<td><ins class="diff-chg">U+02A7E</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">GreaterTilde;</ins></code></td>
<td><ins class="diff-chg">U+02273</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Gscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4A2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Gt;</ins></code></td>
<td><ins class="diff-chg">U+0226B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">HARDcy;</ins></code></td>
<td><ins class="diff-chg">U+0042A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Hacek;</ins></code></td>
<td><ins class="diff-chg">U+002C7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Hat;</ins></code></td>
<td><ins class="diff-chg">U+0005E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Hcirc;</ins></code></td>
<td><ins class="diff-chg">U+00124</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Hfr;</ins></code></td>
<td><ins class="diff-chg">U+0210C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">HilbertSpace;</ins></code></td>
<td><ins class="diff-chg">U+0210B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Hopf;</ins></code></td>
<td><ins class="diff-chg">U+0210D</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">HorizontalLine;</ins></code></td>
<td><ins class="diff-chg">U+02500</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Hscr;</ins></code></td>
<td><ins class="diff-chg">U+0210B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Hstrok;</ins></code></td>
<td><ins class="diff-chg">U+00126</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">HumpDownHump;</ins></code></td>
<td><ins class="diff-chg">U+0224E</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">HumpEqual;</ins></code></td>
<td><ins class="diff-chg">U+0224F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">IEcy;</ins></code></td>
<td><ins class="diff-chg">U+00415</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">IJlig;</ins></code></td>
<td><ins class="diff-chg">U+00132</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">IOcy;</ins></code></td>
<td><ins class="diff-chg">U+00401</ins></td>
</tr>
<tr>
<td><code title="">Iacute;</code></td>
<td><del class="diff-old">U+00CD</del> <ins class=
"diff-chg">U+000CD</ins></td>
</tr>
<tr>
<td><code title="">Iacute</code></td>
<td><del class="diff-old">U+00CD</del> <ins class=
"diff-chg">U+000CD</ins></td>
</tr>
<tr>
<td><code title="">Icirc;</code></td>
<td><del class="diff-old">U+00CE</del> <ins class=
"diff-chg">U+000CE</ins></td>
</tr>
<tr>
<td><code title="">Icirc</code></td>
<td><del class="diff-old">U+00CE</del> <ins class=
"diff-chg">U+000CE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Icy;</ins></code></td>
<td><ins class="diff-chg">U+00418</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Idot;</ins></code></td>
<td><ins class="diff-chg">U+00130</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ifr;</ins></code></td>
<td><ins class="diff-chg">U+02111</ins></td>
</tr>
<tr>
<td><code title="">Igrave;</code></td>
<td><del class="diff-old">U+00CC</del> <ins class=
"diff-chg">U+000CC</ins></td>
</tr>
<tr>
<td><code title="">Igrave</code></td>
<td><del class="diff-old">U+00CC</del> <ins class=
"diff-chg">U+000CC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Im;</ins></code></td>
<td><ins class="diff-chg">U+02111</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Imacr;</ins></code></td>
<td><ins class="diff-chg">U+0012A</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ImaginaryI;</ins></code></td>
<td><ins class="diff-chg">U+02148</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Implies;</ins></code></td>
<td><ins class="diff-chg">U+021D2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Int;</ins></code></td>
<td><ins class="diff-chg">U+0222C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Integral;</ins></code></td>
<td><ins class="diff-chg">U+0222B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Intersection;</ins></code></td>
<td><ins class="diff-chg">U+022C2</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">InvisibleComma;</ins></code></td>
<td><ins class="diff-chg">U+02063</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">InvisibleTimes;</ins></code></td>
<td><ins class="diff-chg">U+02062</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Iogon;</ins></code></td>
<td><ins class="diff-chg">U+0012E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Iopf;</ins></code></td>
<td><ins class="diff-chg">U+1D540</ins></td>
</tr>
<tr>
<td><code title="">Iota;</code></td>
<td><del class="diff-old">U+0399</del> <ins class=
"diff-chg">U+00399</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Iscr;</ins></code></td>
<td><ins class="diff-chg">U+02110</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Itilde;</ins></code></td>
<td><ins class="diff-chg">U+00128</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Iukcy;</ins></code></td>
<td><ins class="diff-chg">U+00406</ins></td>
</tr>
<tr>
<td><code title="">Iuml;</code></td>
<td><del class="diff-old">U+00CF</del> <ins class=
"diff-chg">U+000CF</ins></td>
</tr>
<tr>
<td><code title="">Iuml</code></td>
<td><del class="diff-old">U+00CF</del> <ins class=
"diff-chg">U+000CF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Jcirc;</ins></code></td>
<td><ins class="diff-chg">U+00134</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Jcy;</ins></code></td>
<td><ins class="diff-chg">U+00419</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Jfr;</ins></code></td>
<td><ins class="diff-chg">U+1D50D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Jopf;</ins></code></td>
<td><ins class="diff-chg">U+1D541</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Jscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4A5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Jsercy;</ins></code></td>
<td><ins class="diff-chg">U+00408</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Jukcy;</ins></code></td>
<td><ins class="diff-chg">U+00404</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">KHcy;</ins></code></td>
<td><ins class="diff-chg">U+00425</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">KJcy;</ins></code></td>
<td><ins class="diff-chg">U+0040C</ins></td>
</tr>
<tr>
<td><code title="">Kappa;</code></td>
<td><del class="diff-old">U+039A</del> <ins class=
"diff-chg">U+0039A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Kcedil;</ins></code></td>
<td><ins class="diff-chg">U+00136</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Kcy;</ins></code></td>
<td><ins class="diff-chg">U+0041A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Kfr;</ins></code></td>
<td><ins class="diff-chg">U+1D50E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Kopf;</ins></code></td>
<td><ins class="diff-chg">U+1D542</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Kscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4A6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">LJcy;</ins></code></td>
<td><ins class="diff-chg">U+00409</ins></td>
</tr>
<tr>
<td><code title="">LT;</code></td>
<td><del class="diff-old">U+003C</del> <ins class=
"diff-chg">U+0003C</ins></td>
</tr>
<tr>
<td><code title="">LT</code></td>
<td><del class="diff-old">U+003C</del> <ins class=
"diff-chg">U+0003C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Lacute;</ins></code></td>
<td><ins class="diff-chg">U+00139</ins></td>
</tr>
<tr>
<td><code title="">Lambda;</code></td>
<td><del class="diff-old">U+039B</del> <ins class=
"diff-chg">U+0039B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Lang;</ins></code></td>
<td><ins class="diff-chg">U+027EA</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Laplacetrf;</ins></code></td>
<td><ins class="diff-chg">U+02112</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Larr;</ins></code></td>
<td><ins class="diff-chg">U+0219E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Lcaron;</ins></code></td>
<td><ins class="diff-chg">U+0013D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Lcedil;</ins></code></td>
<td><ins class="diff-chg">U+0013B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Lcy;</ins></code></td>
<td><ins class="diff-chg">U+0041B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftAngleBracket;</ins></code></td>
<td><ins class="diff-chg">U+027E8</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftArrow;</ins></code></td>
<td><ins class="diff-chg">U+02190</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftArrowBar;</ins></code></td>
<td><ins class="diff-chg">U+021E4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftArrowRightArrow;</ins></code></td>
<td><ins class="diff-chg">U+021C6</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftCeiling;</ins></code></td>
<td><ins class="diff-chg">U+02308</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftDoubleBracket;</ins></code></td>
<td><ins class="diff-chg">U+027E6</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftDownTeeVector;</ins></code></td>
<td><ins class="diff-chg">U+02961</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftDownVector;</ins></code></td>
<td><ins class="diff-chg">U+021C3</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftDownVectorBar;</ins></code></td>
<td><ins class="diff-chg">U+02959</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftFloor;</ins></code></td>
<td><ins class="diff-chg">U+0230A</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftRightArrow;</ins></code></td>
<td><ins class="diff-chg">U+02194</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftRightVector;</ins></code></td>
<td><ins class="diff-chg">U+0294E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">LeftTee;</ins></code></td>
<td><ins class="diff-chg">U+022A3</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftTeeArrow;</ins></code></td>
<td><ins class="diff-chg">U+021A4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftTeeVector;</ins></code></td>
<td><ins class="diff-chg">U+0295A</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftTriangle;</ins></code></td>
<td><ins class="diff-chg">U+022B2</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftTriangleBar;</ins></code></td>
<td><ins class="diff-chg">U+029CF</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftTriangleEqual;</ins></code></td>
<td><ins class="diff-chg">U+022B4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftUpDownVector;</ins></code></td>
<td><ins class="diff-chg">U+02951</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftUpTeeVector;</ins></code></td>
<td><ins class="diff-chg">U+02960</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftUpVector;</ins></code></td>
<td><ins class="diff-chg">U+021BF</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftUpVectorBar;</ins></code></td>
<td><ins class="diff-chg">U+02958</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftVector;</ins></code></td>
<td><ins class="diff-chg">U+021BC</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LeftVectorBar;</ins></code></td>
<td><ins class="diff-chg">U+02952</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Leftarrow;</ins></code></td>
<td><ins class="diff-chg">U+021D0</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Leftrightarrow;</ins></code></td>
<td><ins class="diff-chg">U+021D4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LessEqualGreater;</ins></code></td>
<td><ins class="diff-chg">U+022DA</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LessFullEqual;</ins></code></td>
<td><ins class="diff-chg">U+02266</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LessGreater;</ins></code></td>
<td><ins class="diff-chg">U+02276</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LessLess;</ins></code></td>
<td><ins class="diff-chg">U+02AA1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LessSlantEqual;</ins></code></td>
<td><ins class="diff-chg">U+02A7D</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LessTilde;</ins></code></td>
<td><ins class="diff-chg">U+02272</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Lfr;</ins></code></td>
<td><ins class="diff-chg">U+1D50F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ll;</ins></code></td>
<td><ins class="diff-chg">U+022D8</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Lleftarrow;</ins></code></td>
<td><ins class="diff-chg">U+021DA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Lmidot;</ins></code></td>
<td><ins class="diff-chg">U+0013F</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LongLeftArrow;</ins></code></td>
<td><ins class="diff-chg">U+027F5</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LongLeftRightArrow;</ins></code></td>
<td><ins class="diff-chg">U+027F7</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LongRightArrow;</ins></code></td>
<td><ins class="diff-chg">U+027F6</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Longleftarrow;</ins></code></td>
<td><ins class="diff-chg">U+027F8</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Longleftrightarrow;</ins></code></td>
<td><ins class="diff-chg">U+027FA</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Longrightarrow;</ins></code></td>
<td><ins class="diff-chg">U+027F9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Lopf;</ins></code></td>
<td><ins class="diff-chg">U+1D543</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LowerLeftArrow;</ins></code></td>
<td><ins class="diff-chg">U+02199</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">LowerRightArrow;</ins></code></td>
<td><ins class="diff-chg">U+02198</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Lscr;</ins></code></td>
<td><ins class="diff-chg">U+02112</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Lsh;</ins></code></td>
<td><ins class="diff-chg">U+021B0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Lstrok;</ins></code></td>
<td><ins class="diff-chg">U+00141</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Lt;</ins></code></td>
<td><ins class="diff-chg">U+0226A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Map;</ins></code></td>
<td><ins class="diff-chg">U+02905</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Mcy;</ins></code></td>
<td><ins class="diff-chg">U+0041C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">MediumSpace;</ins></code></td>
<td><ins class="diff-chg">U+0205F</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Mellintrf;</ins></code></td>
<td><ins class="diff-chg">U+02133</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Mfr;</ins></code></td>
<td><ins class="diff-chg">U+1D510</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">MinusPlus;</ins></code></td>
<td><ins class="diff-chg">U+02213</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Mopf;</ins></code></td>
<td><ins class="diff-chg">U+1D544</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Mscr;</ins></code></td>
<td><ins class="diff-chg">U+02133</ins></td>
</tr>
<tr>
<td><code title="">Mu;</code></td>
<td><del class="diff-old">U+039C</del> <ins class=
"diff-chg">U+0039C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">NJcy;</ins></code></td>
<td><ins class="diff-chg">U+0040A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Nacute;</ins></code></td>
<td><ins class="diff-chg">U+00143</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ncaron;</ins></code></td>
<td><ins class="diff-chg">U+00147</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ncedil;</ins></code></td>
<td><ins class="diff-chg">U+00145</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ncy;</ins></code></td>
<td><ins class="diff-chg">U+0041D</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NegativeMediumSpace;</ins></code></td>
<td><ins class="diff-chg">U+0200B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NegativeThickSpace;</ins></code></td>
<td><ins class="diff-chg">U+0200B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NegativeThinSpace;</ins></code></td>
<td><ins class="diff-chg">U+0200B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NegativeVeryThinSpace;</ins></code></td>
<td><ins class="diff-chg">U+0200B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NestedGreaterGreater;</ins></code></td>
<td><ins class="diff-chg">U+0226B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NestedLessLess;</ins></code></td>
<td><ins class="diff-chg">U+0226A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">NewLine;</ins></code></td>
<td><ins class="diff-chg">U+0000A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Nfr;</ins></code></td>
<td><ins class="diff-chg">U+1D511</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">NoBreak;</ins></code></td>
<td><ins class="diff-chg">U+02060</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NonBreakingSpace;</ins></code></td>
<td><ins class="diff-chg">U+000A0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Nopf;</ins></code></td>
<td><ins class="diff-chg">U+02115</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Not;</ins></code></td>
<td><ins class="diff-chg">U+02AEC</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotCongruent;</ins></code></td>
<td><ins class="diff-chg">U+02262</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotCupCap;</ins></code></td>
<td><ins class="diff-chg">U+0226D</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotDoubleVerticalBar;</ins></code></td>
<td><ins class="diff-chg">U+02226</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotElement;</ins></code></td>
<td><ins class="diff-chg">U+02209</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotEqual;</ins></code></td>
<td><ins class="diff-chg">U+02260</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotExists;</ins></code></td>
<td><ins class="diff-chg">U+02204</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotGreater;</ins></code></td>
<td><ins class="diff-chg">U+0226F</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotGreaterEqual;</ins></code></td>
<td><ins class="diff-chg">U+02271</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotGreaterLess;</ins></code></td>
<td><ins class="diff-chg">U+02279</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotGreaterTilde;</ins></code></td>
<td><ins class="diff-chg">U+02275</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotLeftTriangle;</ins></code></td>
<td><ins class="diff-chg">U+022EA</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotLeftTriangleEqual;</ins></code></td>
<td><ins class="diff-chg">U+022EC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">NotLess;</ins></code></td>
<td><ins class="diff-chg">U+0226E</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotLessEqual;</ins></code></td>
<td><ins class="diff-chg">U+02270</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotLessGreater;</ins></code></td>
<td><ins class="diff-chg">U+02278</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotLessTilde;</ins></code></td>
<td><ins class="diff-chg">U+02274</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotPrecedes;</ins></code></td>
<td><ins class="diff-chg">U+02280</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotPrecedesSlantEqual;</ins></code></td>
<td><ins class="diff-chg">U+022E0</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotReverseElement;</ins></code></td>
<td><ins class="diff-chg">U+0220C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotRightTriangle;</ins></code></td>
<td><ins class="diff-chg">U+022EB</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotRightTriangleEqual;</ins></code></td>
<td><ins class="diff-chg">U+022ED</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotSquareSubsetEqual;</ins></code></td>
<td><ins class="diff-chg">U+022E2</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotSquareSupersetEqual;</ins></code></td>
<td><ins class="diff-chg">U+022E3</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotSubsetEqual;</ins></code></td>
<td><ins class="diff-chg">U+02288</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotSucceeds;</ins></code></td>
<td><ins class="diff-chg">U+02281</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotSucceedsSlantEqual;</ins></code></td>
<td><ins class="diff-chg">U+022E1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotSupersetEqual;</ins></code></td>
<td><ins class="diff-chg">U+02289</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotTilde;</ins></code></td>
<td><ins class="diff-chg">U+02241</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotTildeEqual;</ins></code></td>
<td><ins class="diff-chg">U+02244</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotTildeFullEqual;</ins></code></td>
<td><ins class="diff-chg">U+02247</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotTildeTilde;</ins></code></td>
<td><ins class="diff-chg">U+02249</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">NotVerticalBar;</ins></code></td>
<td><ins class="diff-chg">U+02224</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Nscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4A9</ins></td>
</tr>
<tr>
<td><code title="">Ntilde;</code></td>
<td><del class="diff-old">U+00D1</del> <ins class=
"diff-chg">U+000D1</ins></td>
</tr>
<tr>
<td><code title="">Ntilde</code></td>
<td><del class="diff-old">U+00D1</del> <ins class=
"diff-chg">U+000D1</ins></td>
</tr>
<tr>
<td><code title="">Nu;</code></td>
<td><del class="diff-old">U+039D</del> <ins class=
"diff-chg">U+0039D</ins></td>
</tr>
<tr>
<td><code title="">OElig;</code></td>
<td><del class="diff-old">U+0152</del> <ins class=
"diff-chg">U+00152</ins></td>
</tr>
<tr>
<td><code title="">Oacute;</code></td>
<td><del class="diff-old">U+00D3</del> <ins class=
"diff-chg">U+000D3</ins></td>
</tr>
<tr>
<td><code title="">Oacute</code></td>
<td><del class="diff-old">U+00D3</del> <ins class=
"diff-chg">U+000D3</ins></td>
</tr>
<tr>
<td><code title="">Ocirc;</code></td>
<td><del class="diff-old">U+00D4</del> <ins class=
"diff-chg">U+000D4</ins></td>
</tr>
<tr>
<td><code title="">Ocirc</code></td>
<td><del class="diff-old">U+00D4</del> <ins class=
"diff-chg">U+000D4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ocy;</ins></code></td>
<td><ins class="diff-chg">U+0041E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Odblac;</ins></code></td>
<td><ins class="diff-chg">U+00150</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ofr;</ins></code></td>
<td><ins class="diff-chg">U+1D512</ins></td>
</tr>
<tr>
<td><code title="">Ograve;</code></td>
<td><del class="diff-old">U+00D2</del> <ins class=
"diff-chg">U+000D2</ins></td>
</tr>
<tr>
<td><code title="">Ograve</code></td>
<td><del class="diff-old">U+00D2</del> <ins class=
"diff-chg">U+000D2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Omacr;</ins></code></td>
<td><ins class="diff-chg">U+0014C</ins></td>
</tr>
<tr>
<td><code title="">Omega;</code></td>
<td><del class="diff-old">U+03A9</del> <ins class=
"diff-chg">U+003A9</ins></td>
</tr>
<tr>
<td><code title="">Omicron;</code></td>
<td><del class="diff-old">U+039F</del> <ins class=
"diff-chg">U+0039F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Oopf;</ins></code></td>
<td><ins class="diff-chg">U+1D546</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">OpenCurlyDoubleQuote;</ins></code></td>
<td><ins class="diff-chg">U+0201C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">OpenCurlyQuote;</ins></code></td>
<td><ins class="diff-chg">U+02018</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Or;</ins></code></td>
<td><ins class="diff-chg">U+02A54</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Oscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4AA</ins></td>
</tr>
<tr>
<td><code title="">Oslash;</code></td>
<td><del class="diff-old">U+00D8</del> <ins class=
"diff-chg">U+000D8</ins></td>
</tr>
<tr>
<td><code title="">Oslash</code></td>
<td><del class="diff-old">U+00D8</del> <ins class=
"diff-chg">U+000D8</ins></td>
</tr>
<tr>
<td><code title="">Otilde;</code></td>
<td><del class="diff-old">U+00D5</del> <ins class=
"diff-chg">U+000D5</ins></td>
</tr>
<tr>
<td><code title="">Otilde</code></td>
<td><del class="diff-old">U+00D5</del> <ins class=
"diff-chg">U+000D5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Otimes;</ins></code></td>
<td><ins class="diff-chg">U+02A37</ins></td>
</tr>
<tr>
<td><code title="">Ouml;</code></td>
<td><del class="diff-old">U+00D6</del> <ins class=
"diff-chg">U+000D6</ins></td>
</tr>
<tr>
<td><code title="">Ouml</code></td>
<td><del class="diff-old">U+00D6</del> <ins class=
"diff-chg">U+000D6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">OverBar;</ins></code></td>
<td><ins class="diff-chg">U+000AF</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">OverBrace;</ins></code></td>
<td><ins class="diff-chg">U+023DE</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">OverBracket;</ins></code></td>
<td><ins class="diff-chg">U+023B4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">OverParenthesis;</ins></code></td>
<td><ins class="diff-chg">U+023DC</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">PartialD;</ins></code></td>
<td><ins class="diff-chg">U+02202</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Pcy;</ins></code></td>
<td><ins class="diff-chg">U+0041F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Pfr;</ins></code></td>
<td><ins class="diff-chg">U+1D513</ins></td>
</tr>
<tr>
<td><code title="">Phi;</code></td>
<td><del class="diff-old">U+03A6</del> <ins class=
"diff-chg">U+003A6</ins></td>
</tr>
<tr>
<td><code title="">Pi;</code></td>
<td><del class="diff-old">U+03A0</del> <ins class=
"diff-chg">U+003A0</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">PlusMinus;</ins></code></td>
<td><ins class="diff-chg">U+000B1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Poincareplane;</ins></code></td>
<td><ins class="diff-chg">U+0210C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Popf;</ins></code></td>
<td><ins class="diff-chg">U+02119</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Pr;</ins></code></td>
<td><ins class="diff-chg">U+02ABB</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Precedes;</ins></code></td>
<td><ins class="diff-chg">U+0227A</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">PrecedesEqual;</ins></code></td>
<td><ins class="diff-chg">U+02AAF</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">PrecedesSlantEqual;</ins></code></td>
<td><ins class="diff-chg">U+0227C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">PrecedesTilde;</ins></code></td>
<td><ins class="diff-chg">U+0227E</ins></td>
</tr>
<tr>
<td><code title="">Prime;</code></td>
<td><del class="diff-old">U+2033</del> <ins class=
"diff-chg">U+02033</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Product;</ins></code></td>
<td><ins class="diff-chg">U+0220F</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Proportion;</ins></code></td>
<td><ins class="diff-chg">U+02237</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Proportional;</ins></code></td>
<td><ins class="diff-chg">U+0221D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Pscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4AB</ins></td>
</tr>
<tr>
<td><code title="">Psi;</code></td>
<td><del class="diff-old">U+03A8</del> <ins class=
"diff-chg">U+003A8</ins></td>
</tr>
<tr>
<td><code title="">QUOT;</code></td>
<td><del class="diff-old">U+0022</del> <ins class=
"diff-chg">U+00022</ins></td>
</tr>
<tr>
<td><code title="">QUOT</code></td>
<td><del class="diff-old">U+0022</del> <ins class=
"diff-chg">U+00022</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Qfr;</ins></code></td>
<td><ins class="diff-chg">U+1D514</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Qopf;</ins></code></td>
<td><ins class="diff-chg">U+0211A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Qscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4AC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">RBarr;</ins></code></td>
<td><ins class="diff-chg">U+02910</ins></td>
</tr>
<tr>
<td><code title="">REG;</code></td>
<td><del class="diff-old">U+00AE</del> <ins class=
"diff-chg">U+000AE</ins></td>
</tr>
<tr>
<td><code title="">REG</code></td>
<td><del class="diff-old">U+00AE</del> <ins class=
"diff-chg">U+000AE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Racute;</ins></code></td>
<td><ins class="diff-chg">U+00154</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Rang;</ins></code></td>
<td><ins class="diff-chg">U+027EB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Rarr;</ins></code></td>
<td><ins class="diff-chg">U+021A0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Rarrtl;</ins></code></td>
<td><ins class="diff-chg">U+02916</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Rcaron;</ins></code></td>
<td><ins class="diff-chg">U+00158</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Rcedil;</ins></code></td>
<td><ins class="diff-chg">U+00156</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Rcy;</ins></code></td>
<td><ins class="diff-chg">U+00420</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Re;</ins></code></td>
<td><ins class="diff-chg">U+0211C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ReverseElement;</ins></code></td>
<td><ins class="diff-chg">U+0220B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ReverseEquilibrium;</ins></code></td>
<td><ins class="diff-chg">U+021CB</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ReverseUpEquilibrium;</ins></code></td>
<td><ins class="diff-chg">U+0296F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Rfr;</ins></code></td>
<td><ins class="diff-chg">U+0211C</ins></td>
</tr>
<tr>
<td><code title="">Rho;</code></td>
<td><del class="diff-old">U+03A1</del> <ins class=
"diff-chg">U+003A1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightAngleBracket;</ins></code></td>
<td><ins class="diff-chg">U+027E9</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightArrow;</ins></code></td>
<td><ins class="diff-chg">U+02192</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightArrowBar;</ins></code></td>
<td><ins class="diff-chg">U+021E5</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightArrowLeftArrow;</ins></code></td>
<td><ins class="diff-chg">U+021C4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightCeiling;</ins></code></td>
<td><ins class="diff-chg">U+02309</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightDoubleBracket;</ins></code></td>
<td><ins class="diff-chg">U+027E7</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightDownTeeVector;</ins></code></td>
<td><ins class="diff-chg">U+0295D</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightDownVector;</ins></code></td>
<td><ins class="diff-chg">U+021C2</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightDownVectorBar;</ins></code></td>
<td><ins class="diff-chg">U+02955</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightFloor;</ins></code></td>
<td><ins class="diff-chg">U+0230B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightTee;</ins></code></td>
<td><ins class="diff-chg">U+022A2</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightTeeArrow;</ins></code></td>
<td><ins class="diff-chg">U+021A6</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightTeeVector;</ins></code></td>
<td><ins class="diff-chg">U+0295B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightTriangle;</ins></code></td>
<td><ins class="diff-chg">U+022B3</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightTriangleBar;</ins></code></td>
<td><ins class="diff-chg">U+029D0</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightTriangleEqual;</ins></code></td>
<td><ins class="diff-chg">U+022B5</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightUpDownVector;</ins></code></td>
<td><ins class="diff-chg">U+0294F</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightUpTeeVector;</ins></code></td>
<td><ins class="diff-chg">U+0295C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightUpVector;</ins></code></td>
<td><ins class="diff-chg">U+021BE</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightUpVectorBar;</ins></code></td>
<td><ins class="diff-chg">U+02954</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightVector;</ins></code></td>
<td><ins class="diff-chg">U+021C0</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RightVectorBar;</ins></code></td>
<td><ins class="diff-chg">U+02953</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Rightarrow;</ins></code></td>
<td><ins class="diff-chg">U+021D2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ropf;</ins></code></td>
<td><ins class="diff-chg">U+0211D</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RoundImplies;</ins></code></td>
<td><ins class="diff-chg">U+02970</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Rrightarrow;</ins></code></td>
<td><ins class="diff-chg">U+021DB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Rscr;</ins></code></td>
<td><ins class="diff-chg">U+0211B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Rsh;</ins></code></td>
<td><ins class="diff-chg">U+021B1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">RuleDelayed;</ins></code></td>
<td><ins class="diff-chg">U+029F4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">SHCHcy;</ins></code></td>
<td><ins class="diff-chg">U+00429</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">SHcy;</ins></code></td>
<td><ins class="diff-chg">U+00428</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">SOFTcy;</ins></code></td>
<td><ins class="diff-chg">U+0042C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Sacute;</ins></code></td>
<td><ins class="diff-chg">U+0015A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Sc;</ins></code></td>
<td><ins class="diff-chg">U+02ABC</ins></td>
</tr>
<tr>
<td><code title="">Scaron;</code></td>
<td><del class="diff-old">U+0160</del> <ins class=
"diff-chg">U+00160</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Scedil;</ins></code></td>
<td><ins class="diff-chg">U+0015E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Scirc;</ins></code></td>
<td><ins class="diff-chg">U+0015C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Scy;</ins></code></td>
<td><ins class="diff-chg">U+00421</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Sfr;</ins></code></td>
<td><ins class="diff-chg">U+1D516</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ShortDownArrow;</ins></code></td>
<td><ins class="diff-chg">U+02193</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ShortLeftArrow;</ins></code></td>
<td><ins class="diff-chg">U+02190</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ShortRightArrow;</ins></code></td>
<td><ins class="diff-chg">U+02192</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ShortUpArrow;</ins></code></td>
<td><ins class="diff-chg">U+02191</ins></td>
</tr>
<tr>
<td><code title="">Sigma;</code></td>
<td><del class="diff-old">U+03A3</del> <ins class=
"diff-chg">U+003A3</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">SmallCircle;</ins></code></td>
<td><ins class="diff-chg">U+02218</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Sopf;</ins></code></td>
<td><ins class="diff-chg">U+1D54A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Sqrt;</ins></code></td>
<td><ins class="diff-chg">U+0221A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Square;</ins></code></td>
<td><ins class="diff-chg">U+025A1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">SquareIntersection;</ins></code></td>
<td><ins class="diff-chg">U+02293</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">SquareSubset;</ins></code></td>
<td><ins class="diff-chg">U+0228F</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">SquareSubsetEqual;</ins></code></td>
<td><ins class="diff-chg">U+02291</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">SquareSuperset;</ins></code></td>
<td><ins class="diff-chg">U+02290</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">SquareSupersetEqual;</ins></code></td>
<td><ins class="diff-chg">U+02292</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">SquareUnion;</ins></code></td>
<td><ins class="diff-chg">U+02294</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Sscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4AE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Star;</ins></code></td>
<td><ins class="diff-chg">U+022C6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Sub;</ins></code></td>
<td><ins class="diff-chg">U+022D0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Subset;</ins></code></td>
<td><ins class="diff-chg">U+022D0</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">SubsetEqual;</ins></code></td>
<td><ins class="diff-chg">U+02286</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Succeeds;</ins></code></td>
<td><ins class="diff-chg">U+0227B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">SucceedsEqual;</ins></code></td>
<td><ins class="diff-chg">U+02AB0</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">SucceedsSlantEqual;</ins></code></td>
<td><ins class="diff-chg">U+0227D</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">SucceedsTilde;</ins></code></td>
<td><ins class="diff-chg">U+0227F</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">SuchThat;</ins></code></td>
<td><ins class="diff-chg">U+0220B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Sum;</ins></code></td>
<td><ins class="diff-chg">U+02211</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Sup;</ins></code></td>
<td><ins class="diff-chg">U+022D1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Superset;</ins></code></td>
<td><ins class="diff-chg">U+02283</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">SupersetEqual;</ins></code></td>
<td><ins class="diff-chg">U+02287</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Supset;</ins></code></td>
<td><ins class="diff-chg">U+022D1</ins></td>
</tr>
<tr>
<td><code title="">THORN;</code></td>
<td><del class="diff-old">U+00DE</del> <ins class=
"diff-chg">U+000DE</ins></td>
</tr>
<tr>
<td><code title="">THORN</code></td>
<td><del class="diff-old">U+00DE</del> <ins class=
"diff-chg">U+000DE</ins></td>
</tr>
<tr>
<td><code title="">TRADE;</code></td>
<td><del class="diff-old">U+2122</del> <ins class=
"diff-chg">U+02122</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">TSHcy;</ins></code></td>
<td><ins class="diff-chg">U+0040B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">TScy;</ins></code></td>
<td><ins class="diff-chg">U+00426</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Tab;</ins></code></td>
<td><ins class="diff-chg">U+00009</ins></td>
</tr>
<tr>
<td><code title="">Tau;</code></td>
<td><del class="diff-old">U+03A4</del> <ins class=
"diff-chg">U+003A4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Tcaron;</ins></code></td>
<td><ins class="diff-chg">U+00164</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Tcedil;</ins></code></td>
<td><ins class="diff-chg">U+00162</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Tcy;</ins></code></td>
<td><ins class="diff-chg">U+00422</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Tfr;</ins></code></td>
<td><ins class="diff-chg">U+1D517</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Therefore;</ins></code></td>
<td><ins class="diff-chg">U+02234</ins></td>
</tr>
<tr>
<td><code title="">Theta;</code></td>
<td><del class="diff-old">U+0398</del> <ins class=
"diff-chg">U+00398</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ThinSpace;</ins></code></td>
<td><ins class="diff-chg">U+02009</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Tilde;</ins></code></td>
<td><ins class="diff-chg">U+0223C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">TildeEqual;</ins></code></td>
<td><ins class="diff-chg">U+02243</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">TildeFullEqual;</ins></code></td>
<td><ins class="diff-chg">U+02245</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">TildeTilde;</ins></code></td>
<td><ins class="diff-chg">U+02248</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Topf;</ins></code></td>
<td><ins class="diff-chg">U+1D54B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">TripleDot;</ins></code></td>
<td><ins class="diff-chg">U+020DB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Tscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4AF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Tstrok;</ins></code></td>
<td><ins class="diff-chg">U+00166</ins></td>
</tr>
<tr>
<td><code title="">Uacute;</code></td>
<td><del class="diff-old">U+00DA</del> <ins class=
"diff-chg">U+000DA</ins></td>
</tr>
<tr>
<td><code title="">Uacute</code></td>
<td><del class="diff-old">U+00DA</del> <ins class=
"diff-chg">U+000DA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Uarr;</ins></code></td>
<td><ins class="diff-chg">U+0219F</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Uarrocir;</ins></code></td>
<td><ins class="diff-chg">U+02949</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ubrcy;</ins></code></td>
<td><ins class="diff-chg">U+0040E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ubreve;</ins></code></td>
<td><ins class="diff-chg">U+0016C</ins></td>
</tr>
<tr>
<td><code title="">Ucirc;</code></td>
<td><del class="diff-old">U+00DB</del> <ins class=
"diff-chg">U+000DB</ins></td>
</tr>
<tr>
<td><code title="">Ucirc</code></td>
<td><del class="diff-old">U+00DB</del> <ins class=
"diff-chg">U+000DB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ucy;</ins></code></td>
<td><ins class="diff-chg">U+00423</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Udblac;</ins></code></td>
<td><ins class="diff-chg">U+00170</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ufr;</ins></code></td>
<td><ins class="diff-chg">U+1D518</ins></td>
</tr>
<tr>
<td><code title="">Ugrave;</code></td>
<td><del class="diff-old">U+00D9</del> <ins class=
"diff-chg">U+000D9</ins></td>
</tr>
<tr>
<td><code title="">Ugrave</code></td>
<td><del class="diff-old">U+00D9</del> <ins class=
"diff-chg">U+000D9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Umacr;</ins></code></td>
<td><ins class="diff-chg">U+0016A</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">UnderBar;</ins></code></td>
<td><ins class="diff-chg">U+00332</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">UnderBrace;</ins></code></td>
<td><ins class="diff-chg">U+023DF</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">UnderBracket;</ins></code></td>
<td><ins class="diff-chg">U+023B5</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">UnderParenthesis;</ins></code></td>
<td><ins class="diff-chg">U+023DD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Union;</ins></code></td>
<td><ins class="diff-chg">U+022C3</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">UnionPlus;</ins></code></td>
<td><ins class="diff-chg">U+0228E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Uogon;</ins></code></td>
<td><ins class="diff-chg">U+00172</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Uopf;</ins></code></td>
<td><ins class="diff-chg">U+1D54C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">UpArrow;</ins></code></td>
<td><ins class="diff-chg">U+02191</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">UpArrowBar;</ins></code></td>
<td><ins class="diff-chg">U+02912</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">UpArrowDownArrow;</ins></code></td>
<td><ins class="diff-chg">U+021C5</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">UpDownArrow;</ins></code></td>
<td><ins class="diff-chg">U+02195</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">UpEquilibrium;</ins></code></td>
<td><ins class="diff-chg">U+0296E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">UpTee;</ins></code></td>
<td><ins class="diff-chg">U+022A5</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">UpTeeArrow;</ins></code></td>
<td><ins class="diff-chg">U+021A5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Uparrow;</ins></code></td>
<td><ins class="diff-chg">U+021D1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">Updownarrow;</ins></code></td>
<td><ins class="diff-chg">U+021D5</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">UpperLeftArrow;</ins></code></td>
<td><ins class="diff-chg">U+02196</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">UpperRightArrow;</ins></code></td>
<td><ins class="diff-chg">U+02197</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Upsi;</ins></code></td>
<td><ins class="diff-chg">U+003D2</ins></td>
</tr>
<tr>
<td><code title="">Upsilon;</code></td>
<td><del class="diff-old">U+03A5</del> <ins class=
"diff-chg">U+003A5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Uring;</ins></code></td>
<td><ins class="diff-chg">U+0016E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Uscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4B0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Utilde;</ins></code></td>
<td><ins class="diff-chg">U+00168</ins></td>
</tr>
<tr>
<td><code title="">Uuml;</code></td>
<td><del class="diff-old">U+00DC</del> <ins class=
"diff-chg">U+000DC</ins></td>
</tr>
<tr>
<td><code title="">Uuml</code></td>
<td><del class="diff-old">U+00DC</del> <ins class=
"diff-chg">U+000DC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">VDash;</ins></code></td>
<td><ins class="diff-chg">U+022AB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Vbar;</ins></code></td>
<td><ins class="diff-chg">U+02AEB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Vcy;</ins></code></td>
<td><ins class="diff-chg">U+00412</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Vdash;</ins></code></td>
<td><ins class="diff-chg">U+022A9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Vdashl;</ins></code></td>
<td><ins class="diff-chg">U+02AE6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Vee;</ins></code></td>
<td><ins class="diff-chg">U+022C1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Verbar;</ins></code></td>
<td><ins class="diff-chg">U+02016</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Vert;</ins></code></td>
<td><ins class="diff-chg">U+02016</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">VerticalBar;</ins></code></td>
<td><ins class="diff-chg">U+02223</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">VerticalLine;</ins></code></td>
<td><ins class="diff-chg">U+0007C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">VerticalSeparator;</ins></code></td>
<td><ins class="diff-chg">U+02758</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">VerticalTilde;</ins></code></td>
<td><ins class="diff-chg">U+02240</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">VeryThinSpace;</ins></code></td>
<td><ins class="diff-chg">U+0200A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Vfr;</ins></code></td>
<td><ins class="diff-chg">U+1D519</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Vopf;</ins></code></td>
<td><ins class="diff-chg">U+1D54D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Vscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4B1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Vvdash;</ins></code></td>
<td><ins class="diff-chg">U+022AA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Wcirc;</ins></code></td>
<td><ins class="diff-chg">U+00174</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Wedge;</ins></code></td>
<td><ins class="diff-chg">U+022C0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Wfr;</ins></code></td>
<td><ins class="diff-chg">U+1D51A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Wopf;</ins></code></td>
<td><ins class="diff-chg">U+1D54E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Wscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4B2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Xfr;</ins></code></td>
<td><ins class="diff-chg">U+1D51B</ins></td>
</tr>
<tr>
<td><code title="">Xi;</code></td>
<td><del class="diff-old">U+039E</del> <ins class=
"diff-chg">U+0039E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Xopf;</ins></code></td>
<td><ins class="diff-chg">U+1D54F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Xscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4B3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">YAcy;</ins></code></td>
<td><ins class="diff-chg">U+0042F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">YIcy;</ins></code></td>
<td><ins class="diff-chg">U+00407</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">YUcy;</ins></code></td>
<td><ins class="diff-chg">U+0042E</ins></td>
</tr>
<tr>
<td><code title="">Yacute;</code></td>
<td><del class="diff-old">U+00DD</del> <ins class=
"diff-chg">U+000DD</ins></td>
</tr>
<tr>
<td><code title="">Yacute</code></td>
<td><del class="diff-old">U+00DD</del> <ins class=
"diff-chg">U+000DD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ycirc;</ins></code></td>
<td><ins class="diff-chg">U+00176</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Ycy;</ins></code></td>
<td><ins class="diff-chg">U+0042B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Yfr;</ins></code></td>
<td><ins class="diff-chg">U+1D51C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Yopf;</ins></code></td>
<td><ins class="diff-chg">U+1D550</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Yscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4B4</ins></td>
</tr>
<tr>
<td><code title="">Yuml;</code></td>
<td><del class="diff-old">U+0178</del> <ins class=
"diff-chg">U+00178</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ZHcy;</ins></code></td>
<td><ins class="diff-chg">U+00416</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Zacute;</ins></code></td>
<td><ins class="diff-chg">U+00179</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Zcaron;</ins></code></td>
<td><ins class="diff-chg">U+0017D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Zcy;</ins></code></td>
<td><ins class="diff-chg">U+00417</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Zdot;</ins></code></td>
<td><ins class="diff-chg">U+0017B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ZeroWidthSpace;</ins></code></td>
<td><ins class="diff-chg">U+0200B</ins></td>
</tr>
<tr>
<td><code title="">Zeta;</code></td>
<td><del class="diff-old">U+0396</del> <ins class=
"diff-chg">U+00396</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Zfr;</ins></code></td>
<td><ins class="diff-chg">U+02128</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Zopf;</ins></code></td>
<td><ins class="diff-chg">U+02124</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">Zscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4B5</ins></td>
</tr>
<tr>
<td><code title="">aacute;</code></td>
<td><del class="diff-old">U+00E1</del> <ins class=
"diff-chg">U+000E1</ins></td>
</tr>
<tr>
<td><code title="">aacute</code></td>
<td><del class="diff-old">U+00E1</del> <ins class=
"diff-chg">U+000E1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">abreve;</ins></code></td>
<td><ins class="diff-chg">U+00103</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ac;</ins></code></td>
<td><ins class="diff-chg">U+0223E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">acd;</ins></code></td>
<td><ins class="diff-chg">U+0223F</ins></td>
</tr>
<tr>
<td><code title="">acirc;</code></td>
<td><del class="diff-old">U+00E2</del> <ins class=
"diff-chg">U+000E2</ins></td>
</tr>
<tr>
<td><code title="">acirc</code></td>
<td><del class="diff-old">U+00E2</del> <ins class=
"diff-chg">U+000E2</ins></td>
</tr>
<tr>
<td><code title="">acute;</code></td>
<td><del class="diff-old">U+00B4</del> <ins class=
"diff-chg">U+000B4</ins></td>
</tr>
<tr>
<td><code title="">acute</code></td>
<td><del class="diff-old">U+00B4</del> <ins class=
"diff-chg">U+000B4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">acy;</ins></code></td>
<td><ins class="diff-chg">U+00430</ins></td>
</tr>
<tr>
<td><code title="">aelig;</code></td>
<td><del class="diff-old">U+00E6</del> <ins class=
"diff-chg">U+000E6</ins></td>
</tr>
<tr>
<td><code title="">aelig</code></td>
<td><del class="diff-old">U+00E6</del> <ins class=
"diff-chg">U+000E6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">af;</ins></code></td>
<td><ins class="diff-chg">U+02061</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">afr;</ins></code></td>
<td><ins class="diff-chg">U+1D51E</ins></td>
</tr>
<tr>
<td><code title="">agrave;</code></td>
<td><del class="diff-old">U+00E0</del> <ins class=
"diff-chg">U+000E0</ins></td>
</tr>
<tr>
<td><code title="">agrave</code></td>
<td><del class="diff-old">U+00E0</del> <ins class=
"diff-chg">U+000E0</ins></td>
</tr>
<tr>
<td><code title="">alefsym;</code></td>
<td><del class="diff-old">U+2135</del> <ins class=
"diff-chg">U+02135</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">aleph;</ins></code></td>
<td><ins class="diff-chg">U+02135</ins></td>
</tr>
<tr>
<td><code title="">alpha;</code></td>
<td><del class="diff-old">U+03B1</del> <ins class=
"diff-chg">U+003B1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">amacr;</ins></code></td>
<td><ins class="diff-chg">U+00101</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">amalg;</ins></code></td>
<td><ins class="diff-chg">U+02A3F</ins></td>
</tr>
<tr>
<td><code title="">amp;</code></td>
<td><del class="diff-old">U+0026</del> <ins class=
"diff-chg">U+00026</ins></td>
</tr>
<tr>
<td><code title="">amp</code></td>
<td><del class="diff-old">U+0026</del> <ins class=
"diff-chg">U+00026</ins></td>
</tr>
<tr>
<td><code title="">and;</code></td>
<td><del class="diff-old">U+2227</del> <ins class=
"diff-chg">U+02227</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">andand;</ins></code></td>
<td><ins class="diff-chg">U+02A55</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">andd;</ins></code></td>
<td><ins class="diff-chg">U+02A5C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">andslope;</ins></code></td>
<td><ins class="diff-chg">U+02A58</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">andv;</ins></code></td>
<td><ins class="diff-chg">U+02A5A</ins></td>
</tr>
<tr>
<td><code title="">ang;</code></td>
<td><del class="diff-old">U+2220</del> <ins class=
"diff-chg">U+02220</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ange;</ins></code></td>
<td><ins class="diff-chg">U+029A4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">angle;</ins></code></td>
<td><ins class="diff-chg">U+02220</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">angmsd;</ins></code></td>
<td><ins class="diff-chg">U+02221</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">angmsdaa;</ins></code></td>
<td><ins class="diff-chg">U+029A8</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">angmsdab;</ins></code></td>
<td><ins class="diff-chg">U+029A9</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">angmsdac;</ins></code></td>
<td><ins class="diff-chg">U+029AA</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">angmsdad;</ins></code></td>
<td><ins class="diff-chg">U+029AB</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">angmsdae;</ins></code></td>
<td><ins class="diff-chg">U+029AC</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">angmsdaf;</ins></code></td>
<td><ins class="diff-chg">U+029AD</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">angmsdag;</ins></code></td>
<td><ins class="diff-chg">U+029AE</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">angmsdah;</ins></code></td>
<td><ins class="diff-chg">U+029AF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">angrt;</ins></code></td>
<td><ins class="diff-chg">U+0221F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">angrtvb;</ins></code></td>
<td><ins class="diff-chg">U+022BE</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">angrtvbd;</ins></code></td>
<td><ins class="diff-chg">U+0299D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">angsph;</ins></code></td>
<td><ins class="diff-chg">U+02222</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">angst;</ins></code></td>
<td><ins class="diff-chg">U+0212B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">angzarr;</ins></code></td>
<td><ins class="diff-chg">U+0237C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">aogon;</ins></code></td>
<td><ins class="diff-chg">U+00105</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">aopf;</ins></code></td>
<td><ins class="diff-chg">U+1D552</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ap;</ins></code></td>
<td><ins class="diff-chg">U+02248</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">apE;</ins></code></td>
<td><ins class="diff-chg">U+02A70</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">apacir;</ins></code></td>
<td><ins class="diff-chg">U+02A6F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ape;</ins></code></td>
<td><ins class="diff-chg">U+0224A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">apid;</ins></code></td>
<td><ins class="diff-chg">U+0224B</ins></td>
</tr>
<tr>
<td><code title="">apos;</code></td>
<td><del class="diff-old">U+0027</del> <ins class=
"diff-chg">U+00027</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">approx;</ins></code></td>
<td><ins class="diff-chg">U+02248</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">approxeq;</ins></code></td>
<td><ins class="diff-chg">U+0224A</ins></td>
</tr>
<tr>
<td><code title="">aring;</code></td>
<td><del class="diff-old">U+00E5</del> <ins class=
"diff-chg">U+000E5</ins></td>
</tr>
<tr>
<td><code title="">aring</code></td>
<td><del class="diff-old">U+00E5</del> <ins class=
"diff-chg">U+000E5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ascr;</ins></code></td>
<td><ins class="diff-chg">U+1D4B6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ast;</ins></code></td>
<td><ins class="diff-chg">U+0002A</ins></td>
</tr>
<tr>
<td><code title="">asymp;</code></td>
<td><del class="diff-old">U+2248</del> <ins class=
"diff-chg">U+02248</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">asympeq;</ins></code></td>
<td><ins class="diff-chg">U+0224D</ins></td>
</tr>
<tr>
<td><code title="">atilde;</code></td>
<td><del class="diff-old">U+00E3</del> <ins class=
"diff-chg">U+000E3</ins></td>
</tr>
<tr>
<td><code title="">atilde</code></td>
<td><del class="diff-old">U+00E3</del> <ins class=
"diff-chg">U+000E3</ins></td>
</tr>
<tr>
<td><code title="">auml;</code></td>
<td><del class="diff-old">U+00E4</del> <ins class=
"diff-chg">U+000E4</ins></td>
</tr>
<tr>
<td><code title="">auml</code></td>
<td><del class="diff-old">U+00E4</del> <ins class=
"diff-chg">U+000E4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">awconint;</ins></code></td>
<td><ins class="diff-chg">U+02233</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">awint;</ins></code></td>
<td><ins class="diff-chg">U+02A11</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bNot;</ins></code></td>
<td><ins class="diff-chg">U+02AED</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">backcong;</ins></code></td>
<td><ins class="diff-chg">U+0224C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">backepsilon;</ins></code></td>
<td><ins class="diff-chg">U+003F6</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">backprime;</ins></code></td>
<td><ins class="diff-chg">U+02035</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">backsim;</ins></code></td>
<td><ins class="diff-chg">U+0223D</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">backsimeq;</ins></code></td>
<td><ins class="diff-chg">U+022CD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">barvee;</ins></code></td>
<td><ins class="diff-chg">U+022BD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">barwed;</ins></code></td>
<td><ins class="diff-chg">U+02305</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">barwedge;</ins></code></td>
<td><ins class="diff-chg">U+02305</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bbrk;</ins></code></td>
<td><ins class="diff-chg">U+023B5</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">bbrktbrk;</ins></code></td>
<td><ins class="diff-chg">U+023B6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bcong;</ins></code></td>
<td><ins class="diff-chg">U+0224C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bcy;</ins></code></td>
<td><ins class="diff-chg">U+00431</ins></td>
</tr>
<tr>
<td><code title="">bdquo;</code></td>
<td><del class="diff-old">U+201E</del> <ins class=
"diff-chg">U+0201E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">becaus;</ins></code></td>
<td><ins class="diff-chg">U+02235</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">because;</ins></code></td>
<td><ins class="diff-chg">U+02235</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bemptyv;</ins></code></td>
<td><ins class="diff-chg">U+029B0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bepsi;</ins></code></td>
<td><ins class="diff-chg">U+003F6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bernou;</ins></code></td>
<td><ins class="diff-chg">U+0212C</ins></td>
</tr>
<tr>
<td><code title="">beta;</code></td>
<td><del class="diff-old">U+03B2</del> <ins class=
"diff-chg">U+003B2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">beth;</ins></code></td>
<td><ins class="diff-chg">U+02136</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">between;</ins></code></td>
<td><ins class="diff-chg">U+0226C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bfr;</ins></code></td>
<td><ins class="diff-chg">U+1D51F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bigcap;</ins></code></td>
<td><ins class="diff-chg">U+022C2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bigcirc;</ins></code></td>
<td><ins class="diff-chg">U+025EF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bigcup;</ins></code></td>
<td><ins class="diff-chg">U+022C3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bigodot;</ins></code></td>
<td><ins class="diff-chg">U+02A00</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">bigoplus;</ins></code></td>
<td><ins class="diff-chg">U+02A01</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">bigotimes;</ins></code></td>
<td><ins class="diff-chg">U+02A02</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">bigsqcup;</ins></code></td>
<td><ins class="diff-chg">U+02A06</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bigstar;</ins></code></td>
<td><ins class="diff-chg">U+02605</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">bigtriangledown;</ins></code></td>
<td><ins class="diff-chg">U+025BD</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">bigtriangleup;</ins></code></td>
<td><ins class="diff-chg">U+025B3</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">biguplus;</ins></code></td>
<td><ins class="diff-chg">U+02A04</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bigvee;</ins></code></td>
<td><ins class="diff-chg">U+022C1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">bigwedge;</ins></code></td>
<td><ins class="diff-chg">U+022C0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bkarow;</ins></code></td>
<td><ins class="diff-chg">U+0290D</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">blacklozenge;</ins></code></td>
<td><ins class="diff-chg">U+029EB</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">blacksquare;</ins></code></td>
<td><ins class="diff-chg">U+025AA</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">blacktriangle;</ins></code></td>
<td><ins class="diff-chg">U+025B4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">blacktriangledown;</ins></code></td>
<td><ins class="diff-chg">U+025BE</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">blacktriangleleft;</ins></code></td>
<td><ins class="diff-chg">U+025C2</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">blacktriangleright;</ins></code></td>
<td><ins class="diff-chg">U+025B8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">blank;</ins></code></td>
<td><ins class="diff-chg">U+02423</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">blk12;</ins></code></td>
<td><ins class="diff-chg">U+02592</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">blk14;</ins></code></td>
<td><ins class="diff-chg">U+02591</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">blk34;</ins></code></td>
<td><ins class="diff-chg">U+02593</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">block;</ins></code></td>
<td><ins class="diff-chg">U+02588</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bnot;</ins></code></td>
<td><ins class="diff-chg">U+02310</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bopf;</ins></code></td>
<td><ins class="diff-chg">U+1D553</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bot;</ins></code></td>
<td><ins class="diff-chg">U+022A5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bottom;</ins></code></td>
<td><ins class="diff-chg">U+022A5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bowtie;</ins></code></td>
<td><ins class="diff-chg">U+022C8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxDL;</ins></code></td>
<td><ins class="diff-chg">U+02557</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxDR;</ins></code></td>
<td><ins class="diff-chg">U+02554</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxDl;</ins></code></td>
<td><ins class="diff-chg">U+02556</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxDr;</ins></code></td>
<td><ins class="diff-chg">U+02553</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxH;</ins></code></td>
<td><ins class="diff-chg">U+02550</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxHD;</ins></code></td>
<td><ins class="diff-chg">U+02566</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxHU;</ins></code></td>
<td><ins class="diff-chg">U+02569</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxHd;</ins></code></td>
<td><ins class="diff-chg">U+02564</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxHu;</ins></code></td>
<td><ins class="diff-chg">U+02567</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxUL;</ins></code></td>
<td><ins class="diff-chg">U+0255D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxUR;</ins></code></td>
<td><ins class="diff-chg">U+0255A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxUl;</ins></code></td>
<td><ins class="diff-chg">U+0255C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxUr;</ins></code></td>
<td><ins class="diff-chg">U+02559</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxV;</ins></code></td>
<td><ins class="diff-chg">U+02551</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxVH;</ins></code></td>
<td><ins class="diff-chg">U+0256C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxVL;</ins></code></td>
<td><ins class="diff-chg">U+02563</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxVR;</ins></code></td>
<td><ins class="diff-chg">U+02560</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxVh;</ins></code></td>
<td><ins class="diff-chg">U+0256B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxVl;</ins></code></td>
<td><ins class="diff-chg">U+02562</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxVr;</ins></code></td>
<td><ins class="diff-chg">U+0255F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxbox;</ins></code></td>
<td><ins class="diff-chg">U+029C9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxdL;</ins></code></td>
<td><ins class="diff-chg">U+02555</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxdR;</ins></code></td>
<td><ins class="diff-chg">U+02552</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxdl;</ins></code></td>
<td><ins class="diff-chg">U+02510</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxdr;</ins></code></td>
<td><ins class="diff-chg">U+0250C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxh;</ins></code></td>
<td><ins class="diff-chg">U+02500</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxhD;</ins></code></td>
<td><ins class="diff-chg">U+02565</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxhU;</ins></code></td>
<td><ins class="diff-chg">U+02568</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxhd;</ins></code></td>
<td><ins class="diff-chg">U+0252C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxhu;</ins></code></td>
<td><ins class="diff-chg">U+02534</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">boxminus;</ins></code></td>
<td><ins class="diff-chg">U+0229F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxplus;</ins></code></td>
<td><ins class="diff-chg">U+0229E</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">boxtimes;</ins></code></td>
<td><ins class="diff-chg">U+022A0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxuL;</ins></code></td>
<td><ins class="diff-chg">U+0255B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxuR;</ins></code></td>
<td><ins class="diff-chg">U+02558</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxul;</ins></code></td>
<td><ins class="diff-chg">U+02518</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxur;</ins></code></td>
<td><ins class="diff-chg">U+02514</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxv;</ins></code></td>
<td><ins class="diff-chg">U+02502</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxvH;</ins></code></td>
<td><ins class="diff-chg">U+0256A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxvL;</ins></code></td>
<td><ins class="diff-chg">U+02561</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxvR;</ins></code></td>
<td><ins class="diff-chg">U+0255E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxvh;</ins></code></td>
<td><ins class="diff-chg">U+0253C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxvl;</ins></code></td>
<td><ins class="diff-chg">U+02524</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">boxvr;</ins></code></td>
<td><ins class="diff-chg">U+0251C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bprime;</ins></code></td>
<td><ins class="diff-chg">U+02035</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">breve;</ins></code></td>
<td><ins class="diff-chg">U+002D8</ins></td>
</tr>
<tr>
<td><code title="">brvbar;</code></td>
<td><del class="diff-old">U+00A6</del> <ins class=
"diff-chg">U+000A6</ins></td>
</tr>
<tr>
<td><code title="">brvbar</code></td>
<td><del class="diff-old">U+00A6</del> <ins class=
"diff-chg">U+000A6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4B7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bsemi;</ins></code></td>
<td><ins class="diff-chg">U+0204F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bsim;</ins></code></td>
<td><ins class="diff-chg">U+0223D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bsime;</ins></code></td>
<td><ins class="diff-chg">U+022CD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bsol;</ins></code></td>
<td><ins class="diff-chg">U+0005C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bsolb;</ins></code></td>
<td><ins class="diff-chg">U+029C5</ins></td>
</tr>
<tr>
<td><code title="">bull;</code></td>
<td><del class="diff-old">U+2022</del> <ins class=
"diff-chg">U+02022</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bullet;</ins></code></td>
<td><ins class="diff-chg">U+02022</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bump;</ins></code></td>
<td><ins class="diff-chg">U+0224E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bumpE;</ins></code></td>
<td><ins class="diff-chg">U+02AAE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bumpe;</ins></code></td>
<td><ins class="diff-chg">U+0224F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">bumpeq;</ins></code></td>
<td><ins class="diff-chg">U+0224F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cacute;</ins></code></td>
<td><ins class="diff-chg">U+00107</ins></td>
</tr>
<tr>
<td><code title="">cap;</code></td>
<td><del class="diff-old">U+2229</del> <ins class=
"diff-chg">U+02229</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">capand;</ins></code></td>
<td><ins class="diff-chg">U+02A44</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">capbrcup;</ins></code></td>
<td><ins class="diff-chg">U+02A49</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">capcap;</ins></code></td>
<td><ins class="diff-chg">U+02A4B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">capcup;</ins></code></td>
<td><ins class="diff-chg">U+02A47</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">capdot;</ins></code></td>
<td><ins class="diff-chg">U+02A40</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">caret;</ins></code></td>
<td><ins class="diff-chg">U+02041</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">caron;</ins></code></td>
<td><ins class="diff-chg">U+002C7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ccaps;</ins></code></td>
<td><ins class="diff-chg">U+02A4D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ccaron;</ins></code></td>
<td><ins class="diff-chg">U+0010D</ins></td>
</tr>
<tr>
<td><code title="">ccedil;</code></td>
<td><del class="diff-old">U+00E7</del> <ins class=
"diff-chg">U+000E7</ins></td>
</tr>
<tr>
<td><code title="">ccedil</code></td>
<td><del class="diff-old">U+00E7</del> <ins class=
"diff-chg">U+000E7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ccirc;</ins></code></td>
<td><ins class="diff-chg">U+00109</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ccups;</ins></code></td>
<td><ins class="diff-chg">U+02A4C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ccupssm;</ins></code></td>
<td><ins class="diff-chg">U+02A50</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cdot;</ins></code></td>
<td><ins class="diff-chg">U+0010B</ins></td>
</tr>
<tr>
<td><code title="">cedil;</code></td>
<td><del class="diff-old">U+00B8</del> <ins class=
"diff-chg">U+000B8</ins></td>
</tr>
<tr>
<td><code title="">cedil</code></td>
<td><del class="diff-old">U+00B8</del> <ins class=
"diff-chg">U+000B8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cemptyv;</ins></code></td>
<td><ins class="diff-chg">U+029B2</ins></td>
</tr>
<tr>
<td><code title="">cent;</code></td>
<td><del class="diff-old">U+00A2</del> <ins class=
"diff-chg">U+000A2</ins></td>
</tr>
<tr>
<td><code title="">cent</code></td>
<td><del class="diff-old">U+00A2</del> <ins class=
"diff-chg">U+000A2</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">centerdot;</ins></code></td>
<td><ins class="diff-chg">U+000B7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cfr;</ins></code></td>
<td><ins class="diff-chg">U+1D520</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">chcy;</ins></code></td>
<td><ins class="diff-chg">U+00447</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">check;</ins></code></td>
<td><ins class="diff-chg">U+02713</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">checkmark;</ins></code></td>
<td><ins class="diff-chg">U+02713</ins></td>
</tr>
<tr>
<td><code title="">chi;</code></td>
<td><del class="diff-old">U+03C7</del> <ins class=
"diff-chg">U+003C7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cir;</ins></code></td>
<td><ins class="diff-chg">U+025CB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cirE;</ins></code></td>
<td><ins class="diff-chg">U+029C3</ins></td>
</tr>
<tr>
<td><code title="">circ;</code></td>
<td><del class="diff-old">U+02C6</del> <ins class=
"diff-chg">U+002C6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">circeq;</ins></code></td>
<td><ins class="diff-chg">U+02257</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">circlearrowleft;</ins></code></td>
<td><ins class="diff-chg">U+021BA</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">circlearrowright;</ins></code></td>
<td><ins class="diff-chg">U+021BB</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">circledR;</ins></code></td>
<td><ins class="diff-chg">U+000AE</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">circledS;</ins></code></td>
<td><ins class="diff-chg">U+024C8</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">circledast;</ins></code></td>
<td><ins class="diff-chg">U+0229B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">circledcirc;</ins></code></td>
<td><ins class="diff-chg">U+0229A</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">circleddash;</ins></code></td>
<td><ins class="diff-chg">U+0229D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cire;</ins></code></td>
<td><ins class="diff-chg">U+02257</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">cirfnint;</ins></code></td>
<td><ins class="diff-chg">U+02A10</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cirmid;</ins></code></td>
<td><ins class="diff-chg">U+02AEF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cirscir;</ins></code></td>
<td><ins class="diff-chg">U+029C2</ins></td>
</tr>
<tr>
<td><code title="">clubs;</code></td>
<td><del class="diff-old">U+2663</del> <ins class=
"diff-chg">U+02663</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">clubsuit;</ins></code></td>
<td><ins class="diff-chg">U+02663</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">colon;</ins></code></td>
<td><ins class="diff-chg">U+0003A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">colone;</ins></code></td>
<td><ins class="diff-chg">U+02254</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">coloneq;</ins></code></td>
<td><ins class="diff-chg">U+02254</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">comma;</ins></code></td>
<td><ins class="diff-chg">U+0002C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">commat;</ins></code></td>
<td><ins class="diff-chg">U+00040</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">comp;</ins></code></td>
<td><ins class="diff-chg">U+02201</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">compfn;</ins></code></td>
<td><ins class="diff-chg">U+02218</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">complement;</ins></code></td>
<td><ins class="diff-chg">U+02201</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">complexes;</ins></code></td>
<td><ins class="diff-chg">U+02102</ins></td>
</tr>
<tr>
<td><code title="">cong;</code></td>
<td><del class="diff-old">U+2245</del> <ins class=
"diff-chg">U+02245</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">congdot;</ins></code></td>
<td><ins class="diff-chg">U+02A6D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">conint;</ins></code></td>
<td><ins class="diff-chg">U+0222E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">copf;</ins></code></td>
<td><ins class="diff-chg">U+1D554</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">coprod;</ins></code></td>
<td><ins class="diff-chg">U+02210</ins></td>
</tr>
<tr>
<td><code title="">copy;</code></td>
<td><del class="diff-old">U+00A9</del> <ins class=
"diff-chg">U+000A9</ins></td>
</tr>
<tr>
<td><code title="">copy</code></td>
<td><del class="diff-old">U+00A9</del> <ins class=
"diff-chg">U+000A9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">copysr;</ins></code></td>
<td><ins class="diff-chg">U+02117</ins></td>
</tr>
<tr>
<td><code title="">crarr;</code></td>
<td><del class="diff-old">U+21B5</del> <ins class=
"diff-chg">U+021B5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cross;</ins></code></td>
<td><ins class="diff-chg">U+02717</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4B8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">csub;</ins></code></td>
<td><ins class="diff-chg">U+02ACF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">csube;</ins></code></td>
<td><ins class="diff-chg">U+02AD1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">csup;</ins></code></td>
<td><ins class="diff-chg">U+02AD0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">csupe;</ins></code></td>
<td><ins class="diff-chg">U+02AD2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ctdot;</ins></code></td>
<td><ins class="diff-chg">U+022EF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cudarrl;</ins></code></td>
<td><ins class="diff-chg">U+02938</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cudarrr;</ins></code></td>
<td><ins class="diff-chg">U+02935</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cuepr;</ins></code></td>
<td><ins class="diff-chg">U+022DE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cuesc;</ins></code></td>
<td><ins class="diff-chg">U+022DF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cularr;</ins></code></td>
<td><ins class="diff-chg">U+021B6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cularrp;</ins></code></td>
<td><ins class="diff-chg">U+0293D</ins></td>
</tr>
<tr>
<td><code title="">cup;</code></td>
<td><del class="diff-old">U+222A</del> <ins class=
"diff-chg">U+0222A</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">cupbrcap;</ins></code></td>
<td><ins class="diff-chg">U+02A48</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cupcap;</ins></code></td>
<td><ins class="diff-chg">U+02A46</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cupcup;</ins></code></td>
<td><ins class="diff-chg">U+02A4A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cupdot;</ins></code></td>
<td><ins class="diff-chg">U+0228D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cupor;</ins></code></td>
<td><ins class="diff-chg">U+02A45</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">curarr;</ins></code></td>
<td><ins class="diff-chg">U+021B7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">curarrm;</ins></code></td>
<td><ins class="diff-chg">U+0293C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">curlyeqprec;</ins></code></td>
<td><ins class="diff-chg">U+022DE</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">curlyeqsucc;</ins></code></td>
<td><ins class="diff-chg">U+022DF</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">curlyvee;</ins></code></td>
<td><ins class="diff-chg">U+022CE</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">curlywedge;</ins></code></td>
<td><ins class="diff-chg">U+022CF</ins></td>
</tr>
<tr>
<td><code title="">curren;</code></td>
<td><del class="diff-old">U+00A4</del> <ins class=
"diff-chg">U+000A4</ins></td>
</tr>
<tr>
<td><code title="">curren</code></td>
<td><del class="diff-old">U+00A4</del> <ins class=
"diff-chg">U+000A4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">curvearrowleft;</ins></code></td>
<td><ins class="diff-chg">U+021B6</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">curvearrowright;</ins></code></td>
<td><ins class="diff-chg">U+021B7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cuvee;</ins></code></td>
<td><ins class="diff-chg">U+022CE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cuwed;</ins></code></td>
<td><ins class="diff-chg">U+022CF</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">cwconint;</ins></code></td>
<td><ins class="diff-chg">U+02232</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cwint;</ins></code></td>
<td><ins class="diff-chg">U+02231</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">cylcty;</ins></code></td>
<td><ins class="diff-chg">U+0232D</ins></td>
</tr>
<tr>
<td><code title="">dArr;</code></td>
<td><del class="diff-old">U+21D3</del> <ins class=
"diff-chg">U+021D3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dHar;</ins></code></td>
<td><ins class="diff-chg">U+02965</ins></td>
</tr>
<tr>
<td><code title="">dagger;</code></td>
<td><del class="diff-old">U+2020</del> <ins class=
"diff-chg">U+02020</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">daleth;</ins></code></td>
<td><ins class="diff-chg">U+02138</ins></td>
</tr>
<tr>
<td><code title="">darr;</code></td>
<td><del class="diff-old">U+2193</del> <ins class=
"diff-chg">U+02193</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dash;</ins></code></td>
<td><ins class="diff-chg">U+02010</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dashv;</ins></code></td>
<td><ins class="diff-chg">U+022A3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dbkarow;</ins></code></td>
<td><ins class="diff-chg">U+0290F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dblac;</ins></code></td>
<td><ins class="diff-chg">U+002DD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dcaron;</ins></code></td>
<td><ins class="diff-chg">U+0010F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dcy;</ins></code></td>
<td><ins class="diff-chg">U+00434</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dd;</ins></code></td>
<td><ins class="diff-chg">U+02146</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ddagger;</ins></code></td>
<td><ins class="diff-chg">U+02021</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ddarr;</ins></code></td>
<td><ins class="diff-chg">U+021CA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ddotseq;</ins></code></td>
<td><ins class="diff-chg">U+02A77</ins></td>
</tr>
<tr>
<td><code title="">deg;</code></td>
<td><del class="diff-old">U+00B0</del> <ins class=
"diff-chg">U+000B0</ins></td>
</tr>
<tr>
<td><code title="">deg</code></td>
<td><del class="diff-old">U+00B0</del> <ins class=
"diff-chg">U+000B0</ins></td>
</tr>
<tr>
<td><code title="">delta;</code></td>
<td><del class="diff-old">U+03B4</del> <ins class=
"diff-chg">U+003B4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">demptyv;</ins></code></td>
<td><ins class="diff-chg">U+029B1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dfisht;</ins></code></td>
<td><ins class="diff-chg">U+0297F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dfr;</ins></code></td>
<td><ins class="diff-chg">U+1D521</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dharl;</ins></code></td>
<td><ins class="diff-chg">U+021C3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dharr;</ins></code></td>
<td><ins class="diff-chg">U+021C2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">diam;</ins></code></td>
<td><ins class="diff-chg">U+022C4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">diamond;</ins></code></td>
<td><ins class="diff-chg">U+022C4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">diamondsuit;</ins></code></td>
<td><ins class="diff-chg">U+02666</ins></td>
</tr>
<tr>
<td><code title="">diams;</code></td>
<td><del class="diff-old">U+2666</del> <ins class=
"diff-chg">U+02666</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">die;</ins></code></td>
<td><ins class="diff-chg">U+000A8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">digamma;</ins></code></td>
<td><ins class="diff-chg">U+003DD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">disin;</ins></code></td>
<td><ins class="diff-chg">U+022F2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">div;</ins></code></td>
<td><ins class="diff-chg">U+000F7</ins></td>
</tr>
<tr>
<td><code title="">divide;</code></td>
<td><del class="diff-old">U+00F7</del> <ins class=
"diff-chg">U+000F7</ins></td>
</tr>
<tr>
<td><code title="">divide</code></td>
<td><del class="diff-old">U+00F7</del> <ins class=
"diff-chg">U+000F7</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">divideontimes;</ins></code></td>
<td><ins class="diff-chg">U+022C7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">divonx;</ins></code></td>
<td><ins class="diff-chg">U+022C7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">djcy;</ins></code></td>
<td><ins class="diff-chg">U+00452</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dlcorn;</ins></code></td>
<td><ins class="diff-chg">U+0231E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dlcrop;</ins></code></td>
<td><ins class="diff-chg">U+0230D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dollar;</ins></code></td>
<td><ins class="diff-chg">U+00024</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dopf;</ins></code></td>
<td><ins class="diff-chg">U+1D555</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dot;</ins></code></td>
<td><ins class="diff-chg">U+002D9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">doteq;</ins></code></td>
<td><ins class="diff-chg">U+02250</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">doteqdot;</ins></code></td>
<td><ins class="diff-chg">U+02251</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">dotminus;</ins></code></td>
<td><ins class="diff-chg">U+02238</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dotplus;</ins></code></td>
<td><ins class="diff-chg">U+02214</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">dotsquare;</ins></code></td>
<td><ins class="diff-chg">U+022A1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">doublebarwedge;</ins></code></td>
<td><ins class="diff-chg">U+02306</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">downarrow;</ins></code></td>
<td><ins class="diff-chg">U+02193</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">downdownarrows;</ins></code></td>
<td><ins class="diff-chg">U+021CA</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">downharpoonleft;</ins></code></td>
<td><ins class="diff-chg">U+021C3</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">downharpoonright;</ins></code></td>
<td><ins class="diff-chg">U+021C2</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">drbkarow;</ins></code></td>
<td><ins class="diff-chg">U+02910</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">drcorn;</ins></code></td>
<td><ins class="diff-chg">U+0231F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">drcrop;</ins></code></td>
<td><ins class="diff-chg">U+0230C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4B9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dscy;</ins></code></td>
<td><ins class="diff-chg">U+00455</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dsol;</ins></code></td>
<td><ins class="diff-chg">U+029F6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dstrok;</ins></code></td>
<td><ins class="diff-chg">U+00111</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dtdot;</ins></code></td>
<td><ins class="diff-chg">U+022F1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dtri;</ins></code></td>
<td><ins class="diff-chg">U+025BF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dtrif;</ins></code></td>
<td><ins class="diff-chg">U+025BE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">duarr;</ins></code></td>
<td><ins class="diff-chg">U+021F5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">duhar;</ins></code></td>
<td><ins class="diff-chg">U+0296F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dwangle;</ins></code></td>
<td><ins class="diff-chg">U+029A6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">dzcy;</ins></code></td>
<td><ins class="diff-chg">U+0045F</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">dzigrarr;</ins></code></td>
<td><ins class="diff-chg">U+027FF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">eDDot;</ins></code></td>
<td><ins class="diff-chg">U+02A77</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">eDot;</ins></code></td>
<td><ins class="diff-chg">U+02251</ins></td>
</tr>
<tr>
<td><code title="">eacute;</code></td>
<td><del class="diff-old">U+00E9</del> <ins class=
"diff-chg">U+000E9</ins></td>
</tr>
<tr>
<td><code title="">eacute</code></td>
<td><del class="diff-old">U+00E9</del> <ins class=
"diff-chg">U+000E9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">easter;</ins></code></td>
<td><ins class="diff-chg">U+02A6E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ecaron;</ins></code></td>
<td><ins class="diff-chg">U+0011B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ecir;</ins></code></td>
<td><ins class="diff-chg">U+02256</ins></td>
</tr>
<tr>
<td><code title="">ecirc;</code></td>
<td><del class="diff-old">U+00EA</del> <ins class=
"diff-chg">U+000EA</ins></td>
</tr>
<tr>
<td><code title="">ecirc</code></td>
<td><del class="diff-old">U+00EA</del> <ins class=
"diff-chg">U+000EA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ecolon;</ins></code></td>
<td><ins class="diff-chg">U+02255</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ecy;</ins></code></td>
<td><ins class="diff-chg">U+0044D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">edot;</ins></code></td>
<td><ins class="diff-chg">U+00117</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ee;</ins></code></td>
<td><ins class="diff-chg">U+02147</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">efDot;</ins></code></td>
<td><ins class="diff-chg">U+02252</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">efr;</ins></code></td>
<td><ins class="diff-chg">U+1D522</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">eg;</ins></code></td>
<td><ins class="diff-chg">U+02A9A</ins></td>
</tr>
<tr>
<td><code title="">egrave;</code></td>
<td><del class="diff-old">U+00E8</del> <ins class=
"diff-chg">U+000E8</ins></td>
</tr>
<tr>
<td><code title="">egrave</code></td>
<td><del class="diff-old">U+00E8</del> <ins class=
"diff-chg">U+000E8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">egs;</ins></code></td>
<td><ins class="diff-chg">U+02A96</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">egsdot;</ins></code></td>
<td><ins class="diff-chg">U+02A98</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">el;</ins></code></td>
<td><ins class="diff-chg">U+02A99</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">elinters;</ins></code></td>
<td><ins class="diff-chg">U+023E7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ell;</ins></code></td>
<td><ins class="diff-chg">U+02113</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">els;</ins></code></td>
<td><ins class="diff-chg">U+02A95</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">elsdot;</ins></code></td>
<td><ins class="diff-chg">U+02A97</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">emacr;</ins></code></td>
<td><ins class="diff-chg">U+00113</ins></td>
</tr>
<tr>
<td><code title="">empty;</code></td>
<td><ins class="diff-new">U+02205</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-new">emptyset;</ins></code></td>
<td><del class="diff-old">U+2205</del> <ins class=
"diff-chg">U+02205</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">emptyv;</ins></code></td>
<td><ins class="diff-chg">U+02205</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">emsp13;</ins></code></td>
<td><ins class="diff-chg">U+02004</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">emsp14;</ins></code></td>
<td><ins class="diff-chg">U+02005</ins></td>
</tr>
<tr>
<td><code title="">emsp;</code></td>
<td><del class="diff-old">U+2003</del> <ins class=
"diff-chg">U+02003</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">eng;</ins></code></td>
<td><ins class="diff-chg">U+0014B</ins></td>
</tr>
<tr>
<td><code title="">ensp;</code></td>
<td><del class="diff-old">U+2002</del> <ins class=
"diff-chg">U+02002</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">eogon;</ins></code></td>
<td><ins class="diff-chg">U+00119</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">eopf;</ins></code></td>
<td><ins class="diff-chg">U+1D556</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">epar;</ins></code></td>
<td><ins class="diff-chg">U+022D5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">eparsl;</ins></code></td>
<td><ins class="diff-chg">U+029E3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">eplus;</ins></code></td>
<td><ins class="diff-chg">U+02A71</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">epsi;</ins></code></td>
<td><ins class="diff-chg">U+003F5</ins></td>
</tr>
<tr>
<td><code title="">epsilon;</code></td>
<td><del class="diff-old">U+03B5</del> <ins class=
"diff-chg">U+003B5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">epsiv;</ins></code></td>
<td><ins class="diff-chg">U+003B5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">eqcirc;</ins></code></td>
<td><ins class="diff-chg">U+02256</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">eqcolon;</ins></code></td>
<td><ins class="diff-chg">U+02255</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">eqsim;</ins></code></td>
<td><ins class="diff-chg">U+02242</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">eqslantgtr;</ins></code></td>
<td><ins class="diff-chg">U+02A96</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">eqslantless;</ins></code></td>
<td><ins class="diff-chg">U+02A95</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">equals;</ins></code></td>
<td><ins class="diff-chg">U+0003D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">equest;</ins></code></td>
<td><ins class="diff-chg">U+0225F</ins></td>
</tr>
<tr>
<td><code title="">equiv;</code></td>
<td><del class="diff-old">U+2261</del> <ins class=
"diff-chg">U+02261</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">equivDD;</ins></code></td>
<td><ins class="diff-chg">U+02A78</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">eqvparsl;</ins></code></td>
<td><ins class="diff-chg">U+029E5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">erDot;</ins></code></td>
<td><ins class="diff-chg">U+02253</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">erarr;</ins></code></td>
<td><ins class="diff-chg">U+02971</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">escr;</ins></code></td>
<td><ins class="diff-chg">U+0212F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">esdot;</ins></code></td>
<td><ins class="diff-chg">U+02250</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">esim;</ins></code></td>
<td><ins class="diff-chg">U+02242</ins></td>
</tr>
<tr>
<td><code title="">eta;</code></td>
<td><del class="diff-old">U+03B7</del> <ins class=
"diff-chg">U+003B7</ins></td>
</tr>
<tr>
<td><code title="">eth;</code></td>
<td><del class="diff-old">U+00F0</del> <ins class=
"diff-chg">U+000F0</ins></td>
</tr>
<tr>
<td><code title="">eth</code></td>
<td><del class="diff-old">U+00F0</del> <ins class=
"diff-chg">U+000F0</ins></td>
</tr>
<tr>
<td><code title="">euml;</code></td>
<td><del class="diff-old">U+00EB</del> <ins class=
"diff-chg">U+000EB</ins></td>
</tr>
<tr>
<td><code title="">euml</code></td>
<td><del class="diff-old">U+00EB</del> <ins class=
"diff-chg">U+000EB</ins></td>
</tr>
<tr>
<td><code title="">euro;</code></td>
<td><del class="diff-old">U+20AC</del> <ins class=
"diff-chg">U+020AC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">excl;</ins></code></td>
<td><ins class="diff-chg">U+00021</ins></td>
</tr>
<tr>
<td><code title="">exist;</code></td>
<td><del class="diff-old">U+2203</del> <ins class=
"diff-chg">U+02203</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">expectation;</ins></code></td>
<td><ins class="diff-chg">U+02130</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">exponentiale;</ins></code></td>
<td><ins class="diff-chg">U+02147</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">fallingdotseq;</ins></code></td>
<td><ins class="diff-chg">U+02252</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">fcy;</ins></code></td>
<td><ins class="diff-chg">U+00444</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">female;</ins></code></td>
<td><ins class="diff-chg">U+02640</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ffilig;</ins></code></td>
<td><ins class="diff-chg">U+0FB03</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">fflig;</ins></code></td>
<td><ins class="diff-chg">U+0FB00</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ffllig;</ins></code></td>
<td><ins class="diff-chg">U+0FB04</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ffr;</ins></code></td>
<td><ins class="diff-chg">U+1D523</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">filig;</ins></code></td>
<td><ins class="diff-chg">U+0FB01</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">flat;</ins></code></td>
<td><ins class="diff-chg">U+0266D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">fllig;</ins></code></td>
<td><ins class="diff-chg">U+0FB02</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">fltns;</ins></code></td>
<td><ins class="diff-chg">U+025B1</ins></td>
</tr>
<tr>
<td><code title="">fnof;</code></td>
<td><del class="diff-old">U+0192</del> <ins class=
"diff-chg">U+00192</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">fopf;</ins></code></td>
<td><ins class="diff-chg">U+1D557</ins></td>
</tr>
<tr>
<td><code title="">forall;</code></td>
<td><del class="diff-old">U+2200</del> <ins class=
"diff-chg">U+02200</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">fork;</ins></code></td>
<td><ins class="diff-chg">U+022D4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">forkv;</ins></code></td>
<td><ins class="diff-chg">U+02AD9</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">fpartint;</ins></code></td>
<td><ins class="diff-chg">U+02A0D</ins></td>
</tr>
<tr>
<td><code title="">frac12;</code></td>
<td><del class="diff-old">U+00BD</del> <ins class=
"diff-chg">U+000BD</ins></td>
</tr>
<tr>
<td><code title="">frac12</code></td>
<td><del class="diff-old">U+00BD</del> <ins class=
"diff-chg">U+000BD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">frac13;</ins></code></td>
<td><ins class="diff-chg">U+02153</ins></td>
</tr>
<tr>
<td><code title="">frac14;</code></td>
<td><del class="diff-old">U+00BC</del> <ins class=
"diff-chg">U+000BC</ins></td>
</tr>
<tr>
<td><code title="">frac14</code></td>
<td><ins class="diff-new">U+000BC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-new">frac15;</ins></code></td>
<td><del class="diff-old">U+00BC</del> <ins class=
"diff-chg">U+02155</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">frac16;</ins></code></td>
<td><ins class="diff-chg">U+02159</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">frac18;</ins></code></td>
<td><ins class="diff-chg">U+0215B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">frac23;</ins></code></td>
<td><ins class="diff-chg">U+02154</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">frac25;</ins></code></td>
<td><ins class="diff-chg">U+02156</ins></td>
</tr>
<tr>
<td><code title="">frac34;</code></td>
<td><del class="diff-old">U+00BE</del> <ins class=
"diff-chg">U+000BE</ins></td>
</tr>
<tr>
<td><code title="">frac34</code></td>
<td><del class="diff-old">U+00BE</del> <ins class=
"diff-chg">U+000BE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">frac35;</ins></code></td>
<td><ins class="diff-chg">U+02157</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">frac38;</ins></code></td>
<td><ins class="diff-chg">U+0215C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">frac45;</ins></code></td>
<td><ins class="diff-chg">U+02158</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">frac56;</ins></code></td>
<td><ins class="diff-chg">U+0215A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">frac58;</ins></code></td>
<td><ins class="diff-chg">U+0215D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">frac78;</ins></code></td>
<td><ins class="diff-chg">U+0215E</ins></td>
</tr>
<tr>
<td><code title="">frasl;</code></td>
<td><del class="diff-old">U+2044</del> <ins class=
"diff-chg">U+02044</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">frown;</ins></code></td>
<td><ins class="diff-chg">U+02322</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">fscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4BB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gE;</ins></code></td>
<td><ins class="diff-chg">U+02267</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gEl;</ins></code></td>
<td><ins class="diff-chg">U+02A8C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gacute;</ins></code></td>
<td><ins class="diff-chg">U+001F5</ins></td>
</tr>
<tr>
<td><code title="">gamma;</code></td>
<td><del class="diff-old">U+03B3</del> <ins class=
"diff-chg">U+003B3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gammad;</ins></code></td>
<td><ins class="diff-chg">U+003DD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gap;</ins></code></td>
<td><ins class="diff-chg">U+02A86</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gbreve;</ins></code></td>
<td><ins class="diff-chg">U+0011F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gcirc;</ins></code></td>
<td><ins class="diff-chg">U+0011D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gcy;</ins></code></td>
<td><ins class="diff-chg">U+00433</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gdot;</ins></code></td>
<td><ins class="diff-chg">U+00121</ins></td>
</tr>
<tr>
<td><code title="">ge;</code></td>
<td><del class="diff-old">U+2265</del> <ins class=
"diff-chg">U+02265</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gel;</ins></code></td>
<td><ins class="diff-chg">U+022DB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">geq;</ins></code></td>
<td><ins class="diff-chg">U+02265</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">geqq;</ins></code></td>
<td><ins class="diff-chg">U+02267</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">geqslant;</ins></code></td>
<td><ins class="diff-chg">U+02A7E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ges;</ins></code></td>
<td><ins class="diff-chg">U+02A7E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gescc;</ins></code></td>
<td><ins class="diff-chg">U+02AA9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gesdot;</ins></code></td>
<td><ins class="diff-chg">U+02A80</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gesdoto;</ins></code></td>
<td><ins class="diff-chg">U+02A82</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">gesdotol;</ins></code></td>
<td><ins class="diff-chg">U+02A84</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gesles;</ins></code></td>
<td><ins class="diff-chg">U+02A94</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gfr;</ins></code></td>
<td><ins class="diff-chg">U+1D524</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gg;</ins></code></td>
<td><ins class="diff-chg">U+0226B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ggg;</ins></code></td>
<td><ins class="diff-chg">U+022D9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gimel;</ins></code></td>
<td><ins class="diff-chg">U+02137</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gjcy;</ins></code></td>
<td><ins class="diff-chg">U+00453</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gl;</ins></code></td>
<td><ins class="diff-chg">U+02277</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">glE;</ins></code></td>
<td><ins class="diff-chg">U+02A92</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gla;</ins></code></td>
<td><ins class="diff-chg">U+02AA5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">glj;</ins></code></td>
<td><ins class="diff-chg">U+02AA4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gnE;</ins></code></td>
<td><ins class="diff-chg">U+02269</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gnap;</ins></code></td>
<td><ins class="diff-chg">U+02A8A</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">gnapprox;</ins></code></td>
<td><ins class="diff-chg">U+02A8A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gne;</ins></code></td>
<td><ins class="diff-chg">U+02A88</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gneq;</ins></code></td>
<td><ins class="diff-chg">U+02A88</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gneqq;</ins></code></td>
<td><ins class="diff-chg">U+02269</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gnsim;</ins></code></td>
<td><ins class="diff-chg">U+022E7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gopf;</ins></code></td>
<td><ins class="diff-chg">U+1D558</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">grave;</ins></code></td>
<td><ins class="diff-chg">U+00060</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gscr;</ins></code></td>
<td><ins class="diff-chg">U+0210A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gsim;</ins></code></td>
<td><ins class="diff-chg">U+02273</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gsime;</ins></code></td>
<td><ins class="diff-chg">U+02A8E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gsiml;</ins></code></td>
<td><ins class="diff-chg">U+02A90</ins></td>
</tr>
<tr>
<td><code title="">gt;</code></td>
<td><del class="diff-old">U+003E</del> <ins class=
"diff-chg">U+0003E</ins></td>
</tr>
<tr>
<td><code title="">gt</code></td>
<td><del class="diff-old">U+003E</del> <ins class=
"diff-chg">U+0003E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gtcc;</ins></code></td>
<td><ins class="diff-chg">U+02AA7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gtcir;</ins></code></td>
<td><ins class="diff-chg">U+02A7A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gtdot;</ins></code></td>
<td><ins class="diff-chg">U+022D7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gtlPar;</ins></code></td>
<td><ins class="diff-chg">U+02995</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gtquest;</ins></code></td>
<td><ins class="diff-chg">U+02A7C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">gtrapprox;</ins></code></td>
<td><ins class="diff-chg">U+02A86</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gtrarr;</ins></code></td>
<td><ins class="diff-chg">U+02978</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gtrdot;</ins></code></td>
<td><ins class="diff-chg">U+022D7</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">gtreqless;</ins></code></td>
<td><ins class="diff-chg">U+022DB</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">gtreqqless;</ins></code></td>
<td><ins class="diff-chg">U+02A8C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gtrless;</ins></code></td>
<td><ins class="diff-chg">U+02277</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">gtrsim;</ins></code></td>
<td><ins class="diff-chg">U+02273</ins></td>
</tr>
<tr>
<td><code title="">hArr;</code></td>
<td><del class="diff-old">U+21D4</del> <ins class=
"diff-chg">U+021D4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">hairsp;</ins></code></td>
<td><ins class="diff-chg">U+0200A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">half;</ins></code></td>
<td><ins class="diff-chg">U+000BD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">hamilt;</ins></code></td>
<td><ins class="diff-chg">U+0210B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">hardcy;</ins></code></td>
<td><ins class="diff-chg">U+0044A</ins></td>
</tr>
<tr>
<td><code title="">harr;</code></td>
<td><del class="diff-old">U+2194</del> <ins class=
"diff-chg">U+02194</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">harrcir;</ins></code></td>
<td><ins class="diff-chg">U+02948</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">harrw;</ins></code></td>
<td><ins class="diff-chg">U+021AD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">hbar;</ins></code></td>
<td><ins class="diff-chg">U+0210F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">hcirc;</ins></code></td>
<td><ins class="diff-chg">U+00125</ins></td>
</tr>
<tr>
<td><code title="">hearts;</code></td>
<td><del class="diff-old">U+2665</del> <ins class=
"diff-chg">U+02665</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">heartsuit;</ins></code></td>
<td><ins class="diff-chg">U+02665</ins></td>
</tr>
<tr>
<td><code title="">hellip;</code></td>
<td><del class="diff-old">U+2026</del> <ins class=
"diff-chg">U+02026</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">hercon;</ins></code></td>
<td><ins class="diff-chg">U+022B9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">hfr;</ins></code></td>
<td><ins class="diff-chg">U+1D525</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">hksearow;</ins></code></td>
<td><ins class="diff-chg">U+02925</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">hkswarow;</ins></code></td>
<td><ins class="diff-chg">U+02926</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">hoarr;</ins></code></td>
<td><ins class="diff-chg">U+021FF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">homtht;</ins></code></td>
<td><ins class="diff-chg">U+0223B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">hookleftarrow;</ins></code></td>
<td><ins class="diff-chg">U+021A9</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">hookrightarrow;</ins></code></td>
<td><ins class="diff-chg">U+021AA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">hopf;</ins></code></td>
<td><ins class="diff-chg">U+1D559</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">horbar;</ins></code></td>
<td><ins class="diff-chg">U+02015</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">hscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4BD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">hslash;</ins></code></td>
<td><ins class="diff-chg">U+0210F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">hstrok;</ins></code></td>
<td><ins class="diff-chg">U+00127</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">hybull;</ins></code></td>
<td><ins class="diff-chg">U+02043</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">hyphen;</ins></code></td>
<td><ins class="diff-chg">U+02010</ins></td>
</tr>
<tr>
<td><code title="">iacute;</code></td>
<td><del class="diff-old">U+00ED</del> <ins class=
"diff-chg">U+000ED</ins></td>
</tr>
<tr>
<td><code title="">iacute</code></td>
<td><del class="diff-old">U+00ED</del> <ins class=
"diff-chg">U+000ED</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ic;</ins></code></td>
<td><ins class="diff-chg">U+02063</ins></td>
</tr>
<tr>
<td><code title="">icirc;</code></td>
<td><del class="diff-old">U+00EE</del> <ins class=
"diff-chg">U+000EE</ins></td>
</tr>
<tr>
<td><code title="">icirc</code></td>
<td><del class="diff-old">U+00EE</del> <ins class=
"diff-chg">U+000EE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">icy;</ins></code></td>
<td><ins class="diff-chg">U+00438</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">iecy;</ins></code></td>
<td><ins class="diff-chg">U+00435</ins></td>
</tr>
<tr>
<td><code title="">iexcl;</code></td>
<td><del class="diff-old">U+00A1</del> <ins class=
"diff-chg">U+000A1</ins></td>
</tr>
<tr>
<td><code title="">iexcl</code></td>
<td><del class="diff-old">U+00A1</del> <ins class=
"diff-chg">U+000A1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">iff;</ins></code></td>
<td><ins class="diff-chg">U+021D4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ifr;</ins></code></td>
<td><ins class="diff-chg">U+1D526</ins></td>
</tr>
<tr>
<td><code title="">igrave;</code></td>
<td><del class="diff-old">U+00EC</del> <ins class=
"diff-chg">U+000EC</ins></td>
</tr>
<tr>
<td><code title="">igrave</code></td>
<td><del class="diff-old">U+00EC</del> <ins class=
"diff-chg">U+000EC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ii;</ins></code></td>
<td><ins class="diff-chg">U+02148</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">iiiint;</ins></code></td>
<td><ins class="diff-chg">U+02A0C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">iiint;</ins></code></td>
<td><ins class="diff-chg">U+0222D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">iinfin;</ins></code></td>
<td><ins class="diff-chg">U+029DC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">iiota;</ins></code></td>
<td><ins class="diff-chg">U+02129</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ijlig;</ins></code></td>
<td><ins class="diff-chg">U+00133</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">imacr;</ins></code></td>
<td><ins class="diff-chg">U+0012B</ins></td>
</tr>
<tr>
<td><code title="">image;</code></td>
<td><del class="diff-old">U+2111</del> <ins class=
"diff-chg">U+02111</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">imagline;</ins></code></td>
<td><ins class="diff-chg">U+02110</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">imagpart;</ins></code></td>
<td><ins class="diff-chg">U+02111</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">imath;</ins></code></td>
<td><ins class="diff-chg">U+00131</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">imof;</ins></code></td>
<td><ins class="diff-chg">U+022B7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">imped;</ins></code></td>
<td><ins class="diff-chg">U+001B5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">in;</ins></code></td>
<td><ins class="diff-chg">U+02208</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">incare;</ins></code></td>
<td><ins class="diff-chg">U+02105</ins></td>
</tr>
<tr>
<td><code title="">infin;</code></td>
<td><del class="diff-old">U+221E</del> <ins class=
"diff-chg">U+0221E</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">infintie;</ins></code></td>
<td><ins class="diff-chg">U+029DD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">inodot;</ins></code></td>
<td><ins class="diff-chg">U+00131</ins></td>
</tr>
<tr>
<td><code title="">int;</code></td>
<td><del class="diff-old">U+222B</del> <ins class=
"diff-chg">U+0222B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">intcal;</ins></code></td>
<td><ins class="diff-chg">U+022BA</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">integers;</ins></code></td>
<td><ins class="diff-chg">U+02124</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">intercal;</ins></code></td>
<td><ins class="diff-chg">U+022BA</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">intlarhk;</ins></code></td>
<td><ins class="diff-chg">U+02A17</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">intprod;</ins></code></td>
<td><ins class="diff-chg">U+02A3C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">iocy;</ins></code></td>
<td><ins class="diff-chg">U+00451</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">iogon;</ins></code></td>
<td><ins class="diff-chg">U+0012F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">iopf;</ins></code></td>
<td><ins class="diff-chg">U+1D55A</ins></td>
</tr>
<tr>
<td><code title="">iota;</code></td>
<td><del class="diff-old">U+03B9</del> <ins class=
"diff-chg">U+003B9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">iprod;</ins></code></td>
<td><ins class="diff-chg">U+02A3C</ins></td>
</tr>
<tr>
<td><code title="">iquest;</code></td>
<td><del class="diff-old">U+00BF</del> <ins class=
"diff-chg">U+000BF</ins></td>
</tr>
<tr>
<td><code title="">iquest</code></td>
<td><del class="diff-old">U+00BF</del> <ins class=
"diff-chg">U+000BF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">iscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4BE</ins></td>
</tr>
<tr>
<td><code title="">isin;</code></td>
<td><del class="diff-old">U+2208</del> <ins class=
"diff-chg">U+02208</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">isinE;</ins></code></td>
<td><ins class="diff-chg">U+022F9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">isindot;</ins></code></td>
<td><ins class="diff-chg">U+022F5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">isins;</ins></code></td>
<td><ins class="diff-chg">U+022F4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">isinsv;</ins></code></td>
<td><ins class="diff-chg">U+022F3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">isinv;</ins></code></td>
<td><ins class="diff-chg">U+02208</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">it;</ins></code></td>
<td><ins class="diff-chg">U+02062</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">itilde;</ins></code></td>
<td><ins class="diff-chg">U+00129</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">iukcy;</ins></code></td>
<td><ins class="diff-chg">U+00456</ins></td>
</tr>
<tr>
<td><code title="">iuml;</code></td>
<td><del class="diff-old">U+00EF</del> <ins class=
"diff-chg">U+000EF</ins></td>
</tr>
<tr>
<td><code title="">iuml</code></td>
<td><del class="diff-old">U+00EF</del> <ins class=
"diff-chg">U+000EF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">jcirc;</ins></code></td>
<td><ins class="diff-chg">U+00135</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">jcy;</ins></code></td>
<td><ins class="diff-chg">U+00439</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">jfr;</ins></code></td>
<td><ins class="diff-chg">U+1D527</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">jmath;</ins></code></td>
<td><ins class="diff-chg">U+00237</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">jopf;</ins></code></td>
<td><ins class="diff-chg">U+1D55B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">jscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4BF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">jsercy;</ins></code></td>
<td><ins class="diff-chg">U+00458</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">jukcy;</ins></code></td>
<td><ins class="diff-chg">U+00454</ins></td>
</tr>
<tr>
<td><code title="">kappa;</code></td>
<td><del class="diff-old">U+03BA</del> <ins class=
"diff-chg">U+003BA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">kappav;</ins></code></td>
<td><ins class="diff-chg">U+003F0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">kcedil;</ins></code></td>
<td><ins class="diff-chg">U+00137</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">kcy;</ins></code></td>
<td><ins class="diff-chg">U+0043A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">kfr;</ins></code></td>
<td><ins class="diff-chg">U+1D528</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">kgreen;</ins></code></td>
<td><ins class="diff-chg">U+00138</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">khcy;</ins></code></td>
<td><ins class="diff-chg">U+00445</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">kjcy;</ins></code></td>
<td><ins class="diff-chg">U+0045C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">kopf;</ins></code></td>
<td><ins class="diff-chg">U+1D55C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">kscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4C0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lAarr;</ins></code></td>
<td><ins class="diff-chg">U+021DA</ins></td>
</tr>
<tr>
<td><code title="">lArr;</code></td>
<td><del class="diff-old">U+21D0</del> <ins class=
"diff-chg">U+021D0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lAtail;</ins></code></td>
<td><ins class="diff-chg">U+0291B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lBarr;</ins></code></td>
<td><ins class="diff-chg">U+0290E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lE;</ins></code></td>
<td><ins class="diff-chg">U+02266</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lEg;</ins></code></td>
<td><ins class="diff-chg">U+02A8B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lHar;</ins></code></td>
<td><ins class="diff-chg">U+02962</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lacute;</ins></code></td>
<td><ins class="diff-chg">U+0013A</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">laemptyv;</ins></code></td>
<td><ins class="diff-chg">U+029B4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lagran;</ins></code></td>
<td><ins class="diff-chg">U+02112</ins></td>
</tr>
<tr>
<td><code title="">lambda;</code></td>
<td><del class="diff-old">U+03BB</del> <ins class=
"diff-chg">U+003BB</ins></td>
</tr>
<tr>
<td><code title="">lang;</code></td>
<td><del class="diff-old">U+3008</del> <ins class=
"diff-chg">U+027E8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">langd;</ins></code></td>
<td><ins class="diff-chg">U+02991</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">langle;</ins></code></td>
<td><ins class="diff-chg">U+027E8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lap;</ins></code></td>
<td><ins class="diff-chg">U+02A85</ins></td>
</tr>
<tr>
<td><code title="">laquo;</code></td>
<td><del class="diff-old">U+00AB</del> <ins class=
"diff-chg">U+000AB</ins></td>
</tr>
<tr>
<td><code title="">laquo</code></td>
<td><del class="diff-old">U+00AB</del> <ins class=
"diff-chg">U+000AB</ins></td>
</tr>
<tr>
<td><code title="">larr;</code></td>
<td><del class="diff-old">U+2190</del> <ins class=
"diff-chg">U+02190</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">larrb;</ins></code></td>
<td><ins class="diff-chg">U+021E4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">larrbfs;</ins></code></td>
<td><ins class="diff-chg">U+0291F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">larrfs;</ins></code></td>
<td><ins class="diff-chg">U+0291D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">larrhk;</ins></code></td>
<td><ins class="diff-chg">U+021A9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">larrlp;</ins></code></td>
<td><ins class="diff-chg">U+021AB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">larrpl;</ins></code></td>
<td><ins class="diff-chg">U+02939</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">larrsim;</ins></code></td>
<td><ins class="diff-chg">U+02973</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">larrtl;</ins></code></td>
<td><ins class="diff-chg">U+021A2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lat;</ins></code></td>
<td><ins class="diff-chg">U+02AAB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">latail;</ins></code></td>
<td><ins class="diff-chg">U+02919</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">late;</ins></code></td>
<td><ins class="diff-chg">U+02AAD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lbarr;</ins></code></td>
<td><ins class="diff-chg">U+0290C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lbbrk;</ins></code></td>
<td><ins class="diff-chg">U+02772</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lbrace;</ins></code></td>
<td><ins class="diff-chg">U+0007B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lbrack;</ins></code></td>
<td><ins class="diff-chg">U+0005B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lbrke;</ins></code></td>
<td><ins class="diff-chg">U+0298B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lbrksld;</ins></code></td>
<td><ins class="diff-chg">U+0298F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lbrkslu;</ins></code></td>
<td><ins class="diff-chg">U+0298D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lcaron;</ins></code></td>
<td><ins class="diff-chg">U+0013E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lcedil;</ins></code></td>
<td><ins class="diff-chg">U+0013C</ins></td>
</tr>
<tr>
<td><code title="">lceil;</code></td>
<td><del class="diff-old">U+2308</del> <ins class=
"diff-chg">U+02308</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lcub;</ins></code></td>
<td><ins class="diff-chg">U+0007B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lcy;</ins></code></td>
<td><ins class="diff-chg">U+0043B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ldca;</ins></code></td>
<td><ins class="diff-chg">U+02936</ins></td>
</tr>
<tr>
<td><code title="">ldquo;</code></td>
<td><del class="diff-old">U+201C</del> <ins class=
"diff-chg">U+0201C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ldquor;</ins></code></td>
<td><ins class="diff-chg">U+0201E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ldrdhar;</ins></code></td>
<td><ins class="diff-chg">U+02967</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ldrushar;</ins></code></td>
<td><ins class="diff-chg">U+0294B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ldsh;</ins></code></td>
<td><ins class="diff-chg">U+021B2</ins></td>
</tr>
<tr>
<td><code title="">le;</code></td>
<td><del class="diff-old">U+2264</del> <ins class=
"diff-chg">U+02264</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">leftarrow;</ins></code></td>
<td><ins class="diff-chg">U+02190</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">leftarrowtail;</ins></code></td>
<td><ins class="diff-chg">U+021A2</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">leftharpoondown;</ins></code></td>
<td><ins class="diff-chg">U+021BD</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">leftharpoonup;</ins></code></td>
<td><ins class="diff-chg">U+021BC</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">leftleftarrows;</ins></code></td>
<td><ins class="diff-chg">U+021C7</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">leftrightarrow;</ins></code></td>
<td><ins class="diff-chg">U+02194</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">leftrightarrows;</ins></code></td>
<td><ins class="diff-chg">U+021C6</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">leftrightharpoons;</ins></code></td>
<td><ins class="diff-chg">U+021CB</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">leftrightsquigarrow;</ins></code></td>
<td><ins class="diff-chg">U+021AD</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">leftthreetimes;</ins></code></td>
<td><ins class="diff-chg">U+022CB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">leg;</ins></code></td>
<td><ins class="diff-chg">U+022DA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">leq;</ins></code></td>
<td><ins class="diff-chg">U+02264</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">leqq;</ins></code></td>
<td><ins class="diff-chg">U+02266</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">leqslant;</ins></code></td>
<td><ins class="diff-chg">U+02A7D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">les;</ins></code></td>
<td><ins class="diff-chg">U+02A7D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lescc;</ins></code></td>
<td><ins class="diff-chg">U+02AA8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lesdot;</ins></code></td>
<td><ins class="diff-chg">U+02A7F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lesdoto;</ins></code></td>
<td><ins class="diff-chg">U+02A81</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">lesdotor;</ins></code></td>
<td><ins class="diff-chg">U+02A83</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lesges;</ins></code></td>
<td><ins class="diff-chg">U+02A93</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">lessapprox;</ins></code></td>
<td><ins class="diff-chg">U+02A85</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lessdot;</ins></code></td>
<td><ins class="diff-chg">U+022D6</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">lesseqgtr;</ins></code></td>
<td><ins class="diff-chg">U+022DA</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">lesseqqgtr;</ins></code></td>
<td><ins class="diff-chg">U+02A8B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lessgtr;</ins></code></td>
<td><ins class="diff-chg">U+02276</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lesssim;</ins></code></td>
<td><ins class="diff-chg">U+02272</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lfisht;</ins></code></td>
<td><ins class="diff-chg">U+0297C</ins></td>
</tr>
<tr>
<td><code title="">lfloor;</code></td>
<td><del class="diff-old">U+230A</del> <ins class=
"diff-chg">U+0230A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lfr;</ins></code></td>
<td><ins class="diff-chg">U+1D529</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lg;</ins></code></td>
<td><ins class="diff-chg">U+02276</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lgE;</ins></code></td>
<td><ins class="diff-chg">U+02A91</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lhard;</ins></code></td>
<td><ins class="diff-chg">U+021BD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lharu;</ins></code></td>
<td><ins class="diff-chg">U+021BC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lharul;</ins></code></td>
<td><ins class="diff-chg">U+0296A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lhblk;</ins></code></td>
<td><ins class="diff-chg">U+02584</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ljcy;</ins></code></td>
<td><ins class="diff-chg">U+00459</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ll;</ins></code></td>
<td><ins class="diff-chg">U+0226A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">llarr;</ins></code></td>
<td><ins class="diff-chg">U+021C7</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">llcorner;</ins></code></td>
<td><ins class="diff-chg">U+0231E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">llhard;</ins></code></td>
<td><ins class="diff-chg">U+0296B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lltri;</ins></code></td>
<td><ins class="diff-chg">U+025FA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lmidot;</ins></code></td>
<td><ins class="diff-chg">U+00140</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lmoust;</ins></code></td>
<td><ins class="diff-chg">U+023B0</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">lmoustache;</ins></code></td>
<td><ins class="diff-chg">U+023B0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lnE;</ins></code></td>
<td><ins class="diff-chg">U+02268</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lnap;</ins></code></td>
<td><ins class="diff-chg">U+02A89</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">lnapprox;</ins></code></td>
<td><ins class="diff-chg">U+02A89</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lne;</ins></code></td>
<td><ins class="diff-chg">U+02A87</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lneq;</ins></code></td>
<td><ins class="diff-chg">U+02A87</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lneqq;</ins></code></td>
<td><ins class="diff-chg">U+02268</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lnsim;</ins></code></td>
<td><ins class="diff-chg">U+022E6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">loang;</ins></code></td>
<td><ins class="diff-chg">U+027EC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">loarr;</ins></code></td>
<td><ins class="diff-chg">U+021FD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lobrk;</ins></code></td>
<td><ins class="diff-chg">U+027E6</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">longleftarrow;</ins></code></td>
<td><ins class="diff-chg">U+027F5</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">longleftrightarrow;</ins></code></td>
<td><ins class="diff-chg">U+027F7</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">longmapsto;</ins></code></td>
<td><ins class="diff-chg">U+027FC</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">longrightarrow;</ins></code></td>
<td><ins class="diff-chg">U+027F6</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">looparrowleft;</ins></code></td>
<td><ins class="diff-chg">U+021AB</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">looparrowright;</ins></code></td>
<td><ins class="diff-chg">U+021AC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lopar;</ins></code></td>
<td><ins class="diff-chg">U+02985</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lopf;</ins></code></td>
<td><ins class="diff-chg">U+1D55D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">loplus;</ins></code></td>
<td><ins class="diff-chg">U+02A2D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lotimes;</ins></code></td>
<td><ins class="diff-chg">U+02A34</ins></td>
</tr>
<tr>
<td><code title="">lowast;</code></td>
<td><del class="diff-old">U+2217</del> <ins class=
"diff-chg">U+02217</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lowbar;</ins></code></td>
<td><ins class="diff-chg">U+0005F</ins></td>
</tr>
<tr>
<td><code title="">loz;</code></td>
<td><del class="diff-old">U+25CA</del> <ins class=
"diff-chg">U+025CA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lozenge;</ins></code></td>
<td><ins class="diff-chg">U+025CA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lozf;</ins></code></td>
<td><ins class="diff-chg">U+029EB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lpar;</ins></code></td>
<td><ins class="diff-chg">U+00028</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lparlt;</ins></code></td>
<td><ins class="diff-chg">U+02993</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lrarr;</ins></code></td>
<td><ins class="diff-chg">U+021C6</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">lrcorner;</ins></code></td>
<td><ins class="diff-chg">U+0231F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lrhar;</ins></code></td>
<td><ins class="diff-chg">U+021CB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lrhard;</ins></code></td>
<td><ins class="diff-chg">U+0296D</ins></td>
</tr>
<tr>
<td><code title="">lrm;</code></td>
<td><del class="diff-old">U+200E</del> <ins class=
"diff-chg">U+0200E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lrtri;</ins></code></td>
<td><ins class="diff-chg">U+022BF</ins></td>
</tr>
<tr>
<td><code title="">lsaquo;</code></td>
<td><del class="diff-old">U+2039</del> <ins class=
"diff-chg">U+02039</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4C1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lsh;</ins></code></td>
<td><ins class="diff-chg">U+021B0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lsim;</ins></code></td>
<td><ins class="diff-chg">U+02272</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lsime;</ins></code></td>
<td><ins class="diff-chg">U+02A8D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lsimg;</ins></code></td>
<td><ins class="diff-chg">U+02A8F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lsqb;</ins></code></td>
<td><ins class="diff-chg">U+0005B</ins></td>
</tr>
<tr>
<td><code title="">lsquo;</code></td>
<td><del class="diff-old">U+2018</del> <ins class=
"diff-chg">U+02018</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lsquor;</ins></code></td>
<td><ins class="diff-chg">U+0201A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lstrok;</ins></code></td>
<td><ins class="diff-chg">U+00142</ins></td>
</tr>
<tr>
<td><code title="">lt;</code></td>
<td><del class="diff-old">U+003C</del> <ins class=
"diff-chg">U+0003C</ins></td>
</tr>
<tr>
<td><code title="">lt</code></td>
<td><del class="diff-old">U+003C</del> <ins class=
"diff-chg">U+0003C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ltcc;</ins></code></td>
<td><ins class="diff-chg">U+02AA6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ltcir;</ins></code></td>
<td><ins class="diff-chg">U+02A79</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ltdot;</ins></code></td>
<td><ins class="diff-chg">U+022D6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">lthree;</ins></code></td>
<td><ins class="diff-chg">U+022CB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ltimes;</ins></code></td>
<td><ins class="diff-chg">U+022C9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ltlarr;</ins></code></td>
<td><ins class="diff-chg">U+02976</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ltquest;</ins></code></td>
<td><ins class="diff-chg">U+02A7B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ltrPar;</ins></code></td>
<td><ins class="diff-chg">U+02996</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ltri;</ins></code></td>
<td><ins class="diff-chg">U+025C3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ltrie;</ins></code></td>
<td><ins class="diff-chg">U+022B4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ltrif;</ins></code></td>
<td><ins class="diff-chg">U+025C2</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">lurdshar;</ins></code></td>
<td><ins class="diff-chg">U+0294A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">luruhar;</ins></code></td>
<td><ins class="diff-chg">U+02966</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">mDDot;</ins></code></td>
<td><ins class="diff-chg">U+0223A</ins></td>
</tr>
<tr>
<td><code title="">macr;</code></td>
<td><del class="diff-old">U+00AF</del> <ins class=
"diff-chg">U+000AF</ins></td>
</tr>
<tr>
<td><code title="">macr</code></td>
<td><del class="diff-old">U+00AF</del> <ins class=
"diff-chg">U+000AF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">male;</ins></code></td>
<td><ins class="diff-chg">U+02642</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">malt;</ins></code></td>
<td><ins class="diff-chg">U+02720</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">maltese;</ins></code></td>
<td><ins class="diff-chg">U+02720</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">map;</ins></code></td>
<td><ins class="diff-chg">U+021A6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">mapsto;</ins></code></td>
<td><ins class="diff-chg">U+021A6</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">mapstodown;</ins></code></td>
<td><ins class="diff-chg">U+021A7</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">mapstoleft;</ins></code></td>
<td><ins class="diff-chg">U+021A4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">mapstoup;</ins></code></td>
<td><ins class="diff-chg">U+021A5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">marker;</ins></code></td>
<td><ins class="diff-chg">U+025AE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">mcomma;</ins></code></td>
<td><ins class="diff-chg">U+02A29</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">mcy;</ins></code></td>
<td><ins class="diff-chg">U+0043C</ins></td>
</tr>
<tr>
<td><code title="">mdash;</code></td>
<td><del class="diff-old">U+2014</del> <ins class=
"diff-chg">U+02014</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">measuredangle;</ins></code></td>
<td><ins class="diff-chg">U+02221</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">mfr;</ins></code></td>
<td><ins class="diff-chg">U+1D52A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">mho;</ins></code></td>
<td><ins class="diff-chg">U+02127</ins></td>
</tr>
<tr>
<td><code title="">micro;</code></td>
<td><del class="diff-old">U+00B5</del> <ins class=
"diff-chg">U+000B5</ins></td>
</tr>
<tr>
<td><code title="">micro</code></td>
<td><del class="diff-old">U+00B5</del> <ins class=
"diff-chg">U+000B5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">mid;</ins></code></td>
<td><ins class="diff-chg">U+02223</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">midast;</ins></code></td>
<td><ins class="diff-chg">U+0002A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">midcir;</ins></code></td>
<td><ins class="diff-chg">U+02AF0</ins></td>
</tr>
<tr>
<td><code title="">middot;</code></td>
<td><del class="diff-old">U+00B7</del> <ins class=
"diff-chg">U+000B7</ins></td>
</tr>
<tr>
<td><code title="">middot</code></td>
<td><del class="diff-old">U+00B7</del> <ins class=
"diff-chg">U+000B7</ins></td>
</tr>
<tr>
<td><code title="">minus;</code></td>
<td><del class="diff-old">U+2212</del> <ins class=
"diff-chg">U+02212</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">minusb;</ins></code></td>
<td><ins class="diff-chg">U+0229F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">minusd;</ins></code></td>
<td><ins class="diff-chg">U+02238</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">minusdu;</ins></code></td>
<td><ins class="diff-chg">U+02A2A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">mlcp;</ins></code></td>
<td><ins class="diff-chg">U+02ADB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">mldr;</ins></code></td>
<td><ins class="diff-chg">U+02026</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">mnplus;</ins></code></td>
<td><ins class="diff-chg">U+02213</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">models;</ins></code></td>
<td><ins class="diff-chg">U+022A7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">mopf;</ins></code></td>
<td><ins class="diff-chg">U+1D55E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">mp;</ins></code></td>
<td><ins class="diff-chg">U+02213</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">mscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4C2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">mstpos;</ins></code></td>
<td><ins class="diff-chg">U+0223E</ins></td>
</tr>
<tr>
<td><code title="">mu;</code></td>
<td><del class="diff-old">U+03BC</del> <ins class=
"diff-chg">U+003BC</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">multimap;</ins></code></td>
<td><ins class="diff-chg">U+022B8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">mumap;</ins></code></td>
<td><ins class="diff-chg">U+022B8</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">nLeftarrow;</ins></code></td>
<td><ins class="diff-chg">U+021CD</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">nLeftrightarrow;</ins></code></td>
<td><ins class="diff-chg">U+021CE</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">nRightarrow;</ins></code></td>
<td><ins class="diff-chg">U+021CF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nVDash;</ins></code></td>
<td><ins class="diff-chg">U+022AF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nVdash;</ins></code></td>
<td><ins class="diff-chg">U+022AE</ins></td>
</tr>
<tr>
<td><code title="">nabla;</code></td>
<td><del class="diff-old">U+2207</del> <ins class=
"diff-chg">U+02207</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nacute;</ins></code></td>
<td><ins class="diff-chg">U+00144</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nap;</ins></code></td>
<td><ins class="diff-chg">U+02249</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">napos;</ins></code></td>
<td><ins class="diff-chg">U+00149</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">napprox;</ins></code></td>
<td><ins class="diff-chg">U+02249</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">natur;</ins></code></td>
<td><ins class="diff-chg">U+0266E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">natural;</ins></code></td>
<td><ins class="diff-chg">U+0266E</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">naturals;</ins></code></td>
<td><ins class="diff-chg">U+02115</ins></td>
</tr>
<tr>
<td><code title="">nbsp;</code></td>
<td><del class="diff-old">U+00A0</del> <ins class=
"diff-chg">U+000A0</ins></td>
</tr>
<tr>
<td><code title="">nbsp</code></td>
<td><del class="diff-old">U+00A0</del> <ins class=
"diff-chg">U+000A0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ncap;</ins></code></td>
<td><ins class="diff-chg">U+02A43</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ncaron;</ins></code></td>
<td><ins class="diff-chg">U+00148</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ncedil;</ins></code></td>
<td><ins class="diff-chg">U+00146</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ncong;</ins></code></td>
<td><ins class="diff-chg">U+02247</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ncup;</ins></code></td>
<td><ins class="diff-chg">U+02A42</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ncy;</ins></code></td>
<td><ins class="diff-chg">U+0043D</ins></td>
</tr>
<tr>
<td><code title="">ndash;</code></td>
<td><del class="diff-old">U+2013</del> <ins class=
"diff-chg">U+02013</ins></td>
</tr>
<tr>
<td><code title="">ne;</code></td>
<td><del class="diff-old">U+2260</del> <ins class=
"diff-chg">U+02260</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">neArr;</ins></code></td>
<td><ins class="diff-chg">U+021D7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nearhk;</ins></code></td>
<td><ins class="diff-chg">U+02924</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nearr;</ins></code></td>
<td><ins class="diff-chg">U+02197</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nearrow;</ins></code></td>
<td><ins class="diff-chg">U+02197</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nequiv;</ins></code></td>
<td><ins class="diff-chg">U+02262</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nesear;</ins></code></td>
<td><ins class="diff-chg">U+02928</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nexist;</ins></code></td>
<td><ins class="diff-chg">U+02204</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nexists;</ins></code></td>
<td><ins class="diff-chg">U+02204</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nfr;</ins></code></td>
<td><ins class="diff-chg">U+1D52B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nge;</ins></code></td>
<td><ins class="diff-chg">U+02271</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ngeq;</ins></code></td>
<td><ins class="diff-chg">U+02271</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ngsim;</ins></code></td>
<td><ins class="diff-chg">U+02275</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ngt;</ins></code></td>
<td><ins class="diff-chg">U+0226F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ngtr;</ins></code></td>
<td><ins class="diff-chg">U+0226F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nhArr;</ins></code></td>
<td><ins class="diff-chg">U+021CE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nharr;</ins></code></td>
<td><ins class="diff-chg">U+021AE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nhpar;</ins></code></td>
<td><ins class="diff-chg">U+02AF2</ins></td>
</tr>
<tr>
<td><code title="">ni;</code></td>
<td><del class="diff-old">U+220B</del> <ins class=
"diff-chg">U+0220B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nis;</ins></code></td>
<td><ins class="diff-chg">U+022FC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nisd;</ins></code></td>
<td><ins class="diff-chg">U+022FA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">niv;</ins></code></td>
<td><ins class="diff-chg">U+0220B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">njcy;</ins></code></td>
<td><ins class="diff-chg">U+0045A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nlArr;</ins></code></td>
<td><ins class="diff-chg">U+021CD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nlarr;</ins></code></td>
<td><ins class="diff-chg">U+0219A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nldr;</ins></code></td>
<td><ins class="diff-chg">U+02025</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nle;</ins></code></td>
<td><ins class="diff-chg">U+02270</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">nleftarrow;</ins></code></td>
<td><ins class="diff-chg">U+0219A</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">nleftrightarrow;</ins></code></td>
<td><ins class="diff-chg">U+021AE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nleq;</ins></code></td>
<td><ins class="diff-chg">U+02270</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nless;</ins></code></td>
<td><ins class="diff-chg">U+0226E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nlsim;</ins></code></td>
<td><ins class="diff-chg">U+02274</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nlt;</ins></code></td>
<td><ins class="diff-chg">U+0226E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nltri;</ins></code></td>
<td><ins class="diff-chg">U+022EA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nltrie;</ins></code></td>
<td><ins class="diff-chg">U+022EC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nmid;</ins></code></td>
<td><ins class="diff-chg">U+02224</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nopf;</ins></code></td>
<td><ins class="diff-chg">U+1D55F</ins></td>
</tr>
<tr>
<td><code title="">not;</code></td>
<td><del class="diff-old">U+00AC</del> <ins class=
"diff-chg">U+000AC</ins></td>
</tr>
<tr>
<td><code title="">not</code></td>
<td><del class="diff-old">U+00AC</del> <ins class=
"diff-chg">U+000AC</ins></td>
</tr>
<tr>
<td><code title="">notin;</code></td>
<td><del class="diff-old">U+2209</del> <ins class=
"diff-chg">U+02209</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">notinva;</ins></code></td>
<td><ins class="diff-chg">U+02209</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">notinvb;</ins></code></td>
<td><ins class="diff-chg">U+022F7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">notinvc;</ins></code></td>
<td><ins class="diff-chg">U+022F6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">notni;</ins></code></td>
<td><ins class="diff-chg">U+0220C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">notniva;</ins></code></td>
<td><ins class="diff-chg">U+0220C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">notnivb;</ins></code></td>
<td><ins class="diff-chg">U+022FE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">notnivc;</ins></code></td>
<td><ins class="diff-chg">U+022FD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">npar;</ins></code></td>
<td><ins class="diff-chg">U+02226</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">nparallel;</ins></code></td>
<td><ins class="diff-chg">U+02226</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">npolint;</ins></code></td>
<td><ins class="diff-chg">U+02A14</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">npr;</ins></code></td>
<td><ins class="diff-chg">U+02280</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nprcue;</ins></code></td>
<td><ins class="diff-chg">U+022E0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nprec;</ins></code></td>
<td><ins class="diff-chg">U+02280</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nrArr;</ins></code></td>
<td><ins class="diff-chg">U+021CF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nrarr;</ins></code></td>
<td><ins class="diff-chg">U+0219B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">nrightarrow;</ins></code></td>
<td><ins class="diff-chg">U+0219B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nrtri;</ins></code></td>
<td><ins class="diff-chg">U+022EB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nrtrie;</ins></code></td>
<td><ins class="diff-chg">U+022ED</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nsc;</ins></code></td>
<td><ins class="diff-chg">U+02281</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nsccue;</ins></code></td>
<td><ins class="diff-chg">U+022E1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4C3</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">nshortmid;</ins></code></td>
<td><ins class="diff-chg">U+02224</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">nshortparallel;</ins></code></td>
<td><ins class="diff-chg">U+02226</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nsim;</ins></code></td>
<td><ins class="diff-chg">U+02241</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nsime;</ins></code></td>
<td><ins class="diff-chg">U+02244</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nsimeq;</ins></code></td>
<td><ins class="diff-chg">U+02244</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nsmid;</ins></code></td>
<td><ins class="diff-chg">U+02224</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nspar;</ins></code></td>
<td><ins class="diff-chg">U+02226</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nsqsube;</ins></code></td>
<td><ins class="diff-chg">U+022E2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nsqsupe;</ins></code></td>
<td><ins class="diff-chg">U+022E3</ins></td>
</tr>
<tr>
<td><code title="">nsub;</code></td>
<td><del class="diff-old">U+2284</del> <ins class=
"diff-chg">U+02284</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nsube;</ins></code></td>
<td><ins class="diff-chg">U+02288</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">nsubseteq;</ins></code></td>
<td><ins class="diff-chg">U+02288</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nsucc;</ins></code></td>
<td><ins class="diff-chg">U+02281</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nsup;</ins></code></td>
<td><ins class="diff-chg">U+02285</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nsupe;</ins></code></td>
<td><ins class="diff-chg">U+02289</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">nsupseteq;</ins></code></td>
<td><ins class="diff-chg">U+02289</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ntgl;</ins></code></td>
<td><ins class="diff-chg">U+02279</ins></td>
</tr>
<tr>
<td><code title="">ntilde;</code></td>
<td><del class="diff-old">U+00F1</del> <ins class=
"diff-chg">U+000F1</ins></td>
</tr>
<tr>
<td><code title="">ntilde</code></td>
<td><del class="diff-old">U+00F1</del> <ins class=
"diff-chg">U+000F1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ntlg;</ins></code></td>
<td><ins class="diff-chg">U+02278</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ntriangleleft;</ins></code></td>
<td><ins class="diff-chg">U+022EA</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ntrianglelefteq;</ins></code></td>
<td><ins class="diff-chg">U+022EC</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ntriangleright;</ins></code></td>
<td><ins class="diff-chg">U+022EB</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ntrianglerighteq;</ins></code></td>
<td><ins class="diff-chg">U+022ED</ins></td>
</tr>
<tr>
<td><code title="">nu;</code></td>
<td><del class="diff-old">U+03BD</del> <ins class=
"diff-chg">U+003BD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">num;</ins></code></td>
<td><ins class="diff-chg">U+00023</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">numero;</ins></code></td>
<td><ins class="diff-chg">U+02116</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">numsp;</ins></code></td>
<td><ins class="diff-chg">U+02007</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nvDash;</ins></code></td>
<td><ins class="diff-chg">U+022AD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nvHarr;</ins></code></td>
<td><ins class="diff-chg">U+02904</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nvdash;</ins></code></td>
<td><ins class="diff-chg">U+022AC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nvinfin;</ins></code></td>
<td><ins class="diff-chg">U+029DE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nvlArr;</ins></code></td>
<td><ins class="diff-chg">U+02902</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nvrArr;</ins></code></td>
<td><ins class="diff-chg">U+02903</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nwArr;</ins></code></td>
<td><ins class="diff-chg">U+021D6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nwarhk;</ins></code></td>
<td><ins class="diff-chg">U+02923</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nwarr;</ins></code></td>
<td><ins class="diff-chg">U+02196</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nwarrow;</ins></code></td>
<td><ins class="diff-chg">U+02196</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">nwnear;</ins></code></td>
<td><ins class="diff-chg">U+02927</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">oS;</ins></code></td>
<td><ins class="diff-chg">U+024C8</ins></td>
</tr>
<tr>
<td><code title="">oacute;</code></td>
<td><del class="diff-old">U+00F3</del> <ins class=
"diff-chg">U+000F3</ins></td>
</tr>
<tr>
<td><code title="">oacute</code></td>
<td><del class="diff-old">U+00F3</del> <ins class=
"diff-chg">U+000F3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">oast;</ins></code></td>
<td><ins class="diff-chg">U+0229B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ocir;</ins></code></td>
<td><ins class="diff-chg">U+0229A</ins></td>
</tr>
<tr>
<td><code title="">ocirc;</code></td>
<td><del class="diff-old">U+00F4</del> <ins class=
"diff-chg">U+000F4</ins></td>
</tr>
<tr>
<td><code title="">ocirc</code></td>
<td><ins class="diff-new">U+000F4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-new">ocy;</ins></code></td>
<td><del class="diff-old">U+00F4</del> <ins class=
"diff-chg">U+0043E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">odash;</ins></code></td>
<td><ins class="diff-chg">U+0229D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">odblac;</ins></code></td>
<td><ins class="diff-chg">U+00151</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">odiv;</ins></code></td>
<td><ins class="diff-chg">U+02A38</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">odot;</ins></code></td>
<td><ins class="diff-chg">U+02299</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">odsold;</ins></code></td>
<td><ins class="diff-chg">U+029BC</ins></td>
</tr>
<tr>
<td><code title="">oelig;</code></td>
<td><del class="diff-old">U+0153</del> <ins class=
"diff-chg">U+00153</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ofcir;</ins></code></td>
<td><ins class="diff-chg">U+029BF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ofr;</ins></code></td>
<td><ins class="diff-chg">U+1D52C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ogon;</ins></code></td>
<td><ins class="diff-chg">U+002DB</ins></td>
</tr>
<tr>
<td><code title="">ograve;</code></td>
<td><del class="diff-old">U+00F2</del> <ins class=
"diff-chg">U+000F2</ins></td>
</tr>
<tr>
<td><code title="">ograve</code></td>
<td><del class="diff-old">U+00F2</del> <ins class=
"diff-chg">U+000F2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ogt;</ins></code></td>
<td><ins class="diff-chg">U+029C1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ohbar;</ins></code></td>
<td><ins class="diff-chg">U+029B5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ohm;</ins></code></td>
<td><ins class="diff-chg">U+02126</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">oint;</ins></code></td>
<td><ins class="diff-chg">U+0222E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">olarr;</ins></code></td>
<td><ins class="diff-chg">U+021BA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">olcir;</ins></code></td>
<td><ins class="diff-chg">U+029BE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">olcross;</ins></code></td>
<td><ins class="diff-chg">U+029BB</ins></td>
</tr>
<tr>
<td><code title="">oline;</code></td>
<td><del class="diff-old">U+203E</del> <ins class=
"diff-chg">U+0203E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">olt;</ins></code></td>
<td><ins class="diff-chg">U+029C0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">omacr;</ins></code></td>
<td><ins class="diff-chg">U+0014D</ins></td>
</tr>
<tr>
<td><code title="">omega;</code></td>
<td><del class="diff-old">U+03C9</del> <ins class=
"diff-chg">U+003C9</ins></td>
</tr>
<tr>
<td><code title="">omicron;</code></td>
<td><del class="diff-old">U+03BF</del> <ins class=
"diff-chg">U+003BF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">omid;</ins></code></td>
<td><ins class="diff-chg">U+029B6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ominus;</ins></code></td>
<td><ins class="diff-chg">U+02296</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">oopf;</ins></code></td>
<td><ins class="diff-chg">U+1D560</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">opar;</ins></code></td>
<td><ins class="diff-chg">U+029B7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">operp;</ins></code></td>
<td><ins class="diff-chg">U+029B9</ins></td>
</tr>
<tr>
<td><code title="">oplus;</code></td>
<td><del class="diff-old">U+2295</del> <ins class=
"diff-chg">U+02295</ins></td>
</tr>
<tr>
<td><code title="">or;</code></td>
<td><del class="diff-old">U+2228</del> <ins class=
"diff-chg">U+02228</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">orarr;</ins></code></td>
<td><ins class="diff-chg">U+021BB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ord;</ins></code></td>
<td><ins class="diff-chg">U+02A5D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">order;</ins></code></td>
<td><ins class="diff-chg">U+02134</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">orderof;</ins></code></td>
<td><ins class="diff-chg">U+02134</ins></td>
</tr>
<tr>
<td><code title="">ordf;</code></td>
<td><del class="diff-old">U+00AA</del> <ins class=
"diff-chg">U+000AA</ins></td>
</tr>
<tr>
<td><code title="">ordf</code></td>
<td><del class="diff-old">U+00AA</del> <ins class=
"diff-chg">U+000AA</ins></td>
</tr>
<tr>
<td><code title="">ordm;</code></td>
<td><del class="diff-old">U+00BA</del> <ins class=
"diff-chg">U+000BA</ins></td>
</tr>
<tr>
<td><code title="">ordm</code></td>
<td><del class="diff-old">U+00BA</del> <ins class=
"diff-chg">U+000BA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">origof;</ins></code></td>
<td><ins class="diff-chg">U+022B6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">oror;</ins></code></td>
<td><ins class="diff-chg">U+02A56</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">orslope;</ins></code></td>
<td><ins class="diff-chg">U+02A57</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">orv;</ins></code></td>
<td><ins class="diff-chg">U+02A5B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">oscr;</ins></code></td>
<td><ins class="diff-chg">U+02134</ins></td>
</tr>
<tr>
<td><code title="">oslash;</code></td>
<td><del class="diff-old">U+00F8</del> <ins class=
"diff-chg">U+000F8</ins></td>
</tr>
<tr>
<td><code title="">oslash</code></td>
<td><del class="diff-old">U+00F8</del> <ins class=
"diff-chg">U+000F8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">osol;</ins></code></td>
<td><ins class="diff-chg">U+02298</ins></td>
</tr>
<tr>
<td><code title="">otilde;</code></td>
<td><del class="diff-old">U+00F5</del> <ins class=
"diff-chg">U+000F5</ins></td>
</tr>
<tr>
<td><code title="">otilde</code></td>
<td><del class="diff-old">U+00F5</del> <ins class=
"diff-chg">U+000F5</ins></td>
</tr>
<tr>
<td><code title="">otimes;</code></td>
<td><del class="diff-old">U+2297</del> <ins class=
"diff-chg">U+02297</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">otimesas;</ins></code></td>
<td><ins class="diff-chg">U+02A36</ins></td>
</tr>
<tr>
<td><code title="">ouml;</code></td>
<td><del class="diff-old">U+00F6</del> <ins class=
"diff-chg">U+000F6</ins></td>
</tr>
<tr>
<td><code title="">ouml</code></td>
<td><del class="diff-old">U+00F6</del> <ins class=
"diff-chg">U+000F6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ovbar;</ins></code></td>
<td><ins class="diff-chg">U+0233D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">par;</ins></code></td>
<td><ins class="diff-chg">U+02225</ins></td>
</tr>
<tr>
<td><code title="">para;</code></td>
<td><del class="diff-old">U+00B6</del> <ins class=
"diff-chg">U+000B6</ins></td>
</tr>
<tr>
<td><code title="">para</code></td>
<td><del class="diff-old">U+00B6</del> <ins class=
"diff-chg">U+000B6</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">parallel;</ins></code></td>
<td><ins class="diff-chg">U+02225</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">parsim;</ins></code></td>
<td><ins class="diff-chg">U+02AF3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">parsl;</ins></code></td>
<td><ins class="diff-chg">U+02AFD</ins></td>
</tr>
<tr>
<td><code title="">part;</code></td>
<td><del class="diff-old">U+2202</del> <ins class=
"diff-chg">U+02202</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">pcy;</ins></code></td>
<td><ins class="diff-chg">U+0043F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">percnt;</ins></code></td>
<td><ins class="diff-chg">U+00025</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">period;</ins></code></td>
<td><ins class="diff-chg">U+0002E</ins></td>
</tr>
<tr>
<td><code title="">permil;</code></td>
<td><del class="diff-old">U+2030</del> <ins class=
"diff-chg">U+02030</ins></td>
</tr>
<tr>
<td><code title="">perp;</code></td>
<td><del class="diff-old">U+22A5</del> <ins class=
"diff-chg">U+022A5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">pertenk;</ins></code></td>
<td><ins class="diff-chg">U+02031</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">pfr;</ins></code></td>
<td><ins class="diff-chg">U+1D52D</ins></td>
</tr>
<tr>
<td><code title="">phi;</code></td>
<td><del class="diff-old">U+03C6</del> <ins class=
"diff-chg">U+003C6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">phiv;</ins></code></td>
<td><ins class="diff-chg">U+003C6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">phmmat;</ins></code></td>
<td><ins class="diff-chg">U+02133</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">phone;</ins></code></td>
<td><ins class="diff-chg">U+0260E</ins></td>
</tr>
<tr>
<td><code title="">pi;</code></td>
<td><del class="diff-old">U+03C0</del> <ins class=
"diff-chg">U+003C0</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">pitchfork;</ins></code></td>
<td><ins class="diff-chg">U+022D4</ins></td>
</tr>
<tr>
<td><code title="">piv;</code></td>
<td><del class="diff-old">U+03D6</del> <ins class=
"diff-chg">U+003D6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">planck;</ins></code></td>
<td><ins class="diff-chg">U+0210F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">planckh;</ins></code></td>
<td><ins class="diff-chg">U+0210E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">plankv;</ins></code></td>
<td><ins class="diff-chg">U+0210F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">plus;</ins></code></td>
<td><ins class="diff-chg">U+0002B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">plusacir;</ins></code></td>
<td><ins class="diff-chg">U+02A23</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">plusb;</ins></code></td>
<td><ins class="diff-chg">U+0229E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">pluscir;</ins></code></td>
<td><ins class="diff-chg">U+02A22</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">plusdo;</ins></code></td>
<td><ins class="diff-chg">U+02214</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">plusdu;</ins></code></td>
<td><ins class="diff-chg">U+02A25</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">pluse;</ins></code></td>
<td><ins class="diff-chg">U+02A72</ins></td>
</tr>
<tr>
<td><code title="">plusmn;</code></td>
<td><del class="diff-old">U+00B1</del> <ins class=
"diff-chg">U+000B1</ins></td>
</tr>
<tr>
<td><code title="">plusmn</code></td>
<td><del class="diff-old">U+00B1</del> <ins class=
"diff-chg">U+000B1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">plussim;</ins></code></td>
<td><ins class="diff-chg">U+02A26</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">plustwo;</ins></code></td>
<td><ins class="diff-chg">U+02A27</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">pm;</ins></code></td>
<td><ins class="diff-chg">U+000B1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">pointint;</ins></code></td>
<td><ins class="diff-chg">U+02A15</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">popf;</ins></code></td>
<td><ins class="diff-chg">U+1D561</ins></td>
</tr>
<tr>
<td><code title="">pound;</code></td>
<td><del class="diff-old">U+00A3</del> <ins class=
"diff-chg">U+000A3</ins></td>
</tr>
<tr>
<td><code title="">pound</code></td>
<td><del class="diff-old">U+00A3</del> <ins class=
"diff-chg">U+000A3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">pr;</ins></code></td>
<td><ins class="diff-chg">U+0227A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">prE;</ins></code></td>
<td><ins class="diff-chg">U+02AB3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">prap;</ins></code></td>
<td><ins class="diff-chg">U+02AB7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">prcue;</ins></code></td>
<td><ins class="diff-chg">U+0227C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">pre;</ins></code></td>
<td><ins class="diff-chg">U+02AAF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">prec;</ins></code></td>
<td><ins class="diff-chg">U+0227A</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">precapprox;</ins></code></td>
<td><ins class="diff-chg">U+02AB7</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">preccurlyeq;</ins></code></td>
<td><ins class="diff-chg">U+0227C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">preceq;</ins></code></td>
<td><ins class="diff-chg">U+02AAF</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">precnapprox;</ins></code></td>
<td><ins class="diff-chg">U+02AB9</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">precneqq;</ins></code></td>
<td><ins class="diff-chg">U+02AB5</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">precnsim;</ins></code></td>
<td><ins class="diff-chg">U+022E8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">precsim;</ins></code></td>
<td><ins class="diff-chg">U+0227E</ins></td>
</tr>
<tr>
<td><code title="">prime;</code></td>
<td><del class="diff-old">U+2032</del> <ins class=
"diff-chg">U+02032</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">primes;</ins></code></td>
<td><ins class="diff-chg">U+02119</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">prnE;</ins></code></td>
<td><ins class="diff-chg">U+02AB5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">prnap;</ins></code></td>
<td><ins class="diff-chg">U+02AB9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">prnsim;</ins></code></td>
<td><ins class="diff-chg">U+022E8</ins></td>
</tr>
<tr>
<td><code title="">prod;</code></td>
<td><del class="diff-old">U+220F</del> <ins class=
"diff-chg">U+0220F</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">profalar;</ins></code></td>
<td><ins class="diff-chg">U+0232E</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">profline;</ins></code></td>
<td><ins class="diff-chg">U+02312</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">profsurf;</ins></code></td>
<td><ins class="diff-chg">U+02313</ins></td>
</tr>
<tr>
<td><code title="">prop;</code></td>
<td><del class="diff-old">U+221D</del> <ins class=
"diff-chg">U+0221D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">propto;</ins></code></td>
<td><ins class="diff-chg">U+0221D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">prsim;</ins></code></td>
<td><ins class="diff-chg">U+0227E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">prurel;</ins></code></td>
<td><ins class="diff-chg">U+022B0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">pscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4C5</ins></td>
</tr>
<tr>
<td><code title="">psi;</code></td>
<td><del class="diff-old">U+03C8</del> <ins class=
"diff-chg">U+003C8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">puncsp;</ins></code></td>
<td><ins class="diff-chg">U+02008</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">qfr;</ins></code></td>
<td><ins class="diff-chg">U+1D52E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">qint;</ins></code></td>
<td><ins class="diff-chg">U+02A0C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">qopf;</ins></code></td>
<td><ins class="diff-chg">U+1D562</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">qprime;</ins></code></td>
<td><ins class="diff-chg">U+02057</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">qscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4C6</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">quaternions;</ins></code></td>
<td><ins class="diff-chg">U+0210D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">quatint;</ins></code></td>
<td><ins class="diff-chg">U+02A16</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">quest;</ins></code></td>
<td><ins class="diff-chg">U+0003F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">questeq;</ins></code></td>
<td><ins class="diff-chg">U+0225F</ins></td>
</tr>
<tr>
<td><code title="">quot;</code></td>
<td><del class="diff-old">U+0022</del> <ins class=
"diff-chg">U+00022</ins></td>
</tr>
<tr>
<td><code title="">quot</code></td>
<td><del class="diff-old">U+0022</del> <ins class=
"diff-chg">U+00022</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rAarr;</ins></code></td>
<td><ins class="diff-chg">U+021DB</ins></td>
</tr>
<tr>
<td><code title="">rArr;</code></td>
<td><del class="diff-old">U+21D2</del> <ins class=
"diff-chg">U+021D2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rAtail;</ins></code></td>
<td><ins class="diff-chg">U+0291C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rBarr;</ins></code></td>
<td><ins class="diff-chg">U+0290F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rHar;</ins></code></td>
<td><ins class="diff-chg">U+02964</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">race;</ins></code></td>
<td><ins class="diff-chg">U+029DA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">racute;</ins></code></td>
<td><ins class="diff-chg">U+00155</ins></td>
</tr>
<tr>
<td><code title="">radic;</code></td>
<td><del class="diff-old">U+221A</del> <ins class=
"diff-chg">U+0221A</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">raemptyv;</ins></code></td>
<td><ins class="diff-chg">U+029B3</ins></td>
</tr>
<tr>
<td><code title="">rang;</code></td>
<td><del class="diff-old">U+3009</del> <ins class=
"diff-chg">U+027E9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rangd;</ins></code></td>
<td><ins class="diff-chg">U+02992</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">range;</ins></code></td>
<td><ins class="diff-chg">U+029A5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rangle;</ins></code></td>
<td><ins class="diff-chg">U+027E9</ins></td>
</tr>
<tr>
<td><code title="">raquo;</code></td>
<td><del class="diff-old">U+00BB</del> <ins class=
"diff-chg">U+000BB</ins></td>
</tr>
<tr>
<td><code title="">raquo</code></td>
<td><del class="diff-old">U+00BB</del> <ins class=
"diff-chg">U+000BB</ins></td>
</tr>
<tr>
<td><code title="">rarr;</code></td>
<td><del class="diff-old">U+2192</del> <ins class=
"diff-chg">U+02192</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rarrap;</ins></code></td>
<td><ins class="diff-chg">U+02975</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rarrb;</ins></code></td>
<td><ins class="diff-chg">U+021E5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rarrbfs;</ins></code></td>
<td><ins class="diff-chg">U+02920</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rarrc;</ins></code></td>
<td><ins class="diff-chg">U+02933</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rarrfs;</ins></code></td>
<td><ins class="diff-chg">U+0291E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rarrhk;</ins></code></td>
<td><ins class="diff-chg">U+021AA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rarrlp;</ins></code></td>
<td><ins class="diff-chg">U+021AC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rarrpl;</ins></code></td>
<td><ins class="diff-chg">U+02945</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rarrsim;</ins></code></td>
<td><ins class="diff-chg">U+02974</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rarrtl;</ins></code></td>
<td><ins class="diff-chg">U+021A3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rarrw;</ins></code></td>
<td><ins class="diff-chg">U+0219D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ratail;</ins></code></td>
<td><ins class="diff-chg">U+0291A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ratio;</ins></code></td>
<td><ins class="diff-chg">U+02236</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">rationals;</ins></code></td>
<td><ins class="diff-chg">U+0211A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rbarr;</ins></code></td>
<td><ins class="diff-chg">U+0290D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rbbrk;</ins></code></td>
<td><ins class="diff-chg">U+02773</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rbrace;</ins></code></td>
<td><ins class="diff-chg">U+0007D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rbrack;</ins></code></td>
<td><ins class="diff-chg">U+0005D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rbrke;</ins></code></td>
<td><ins class="diff-chg">U+0298C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rbrksld;</ins></code></td>
<td><ins class="diff-chg">U+0298E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rbrkslu;</ins></code></td>
<td><ins class="diff-chg">U+02990</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rcaron;</ins></code></td>
<td><ins class="diff-chg">U+00159</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rcedil;</ins></code></td>
<td><ins class="diff-chg">U+00157</ins></td>
</tr>
<tr>
<td><code title="">rceil;</code></td>
<td><del class="diff-old">U+2309</del> <ins class=
"diff-chg">U+02309</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rcub;</ins></code></td>
<td><ins class="diff-chg">U+0007D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rcy;</ins></code></td>
<td><ins class="diff-chg">U+00440</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rdca;</ins></code></td>
<td><ins class="diff-chg">U+02937</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rdldhar;</ins></code></td>
<td><ins class="diff-chg">U+02969</ins></td>
</tr>
<tr>
<td><code title="">rdquo;</code></td>
<td><del class="diff-old">U+201D</del> <ins class=
"diff-chg">U+0201D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rdquor;</ins></code></td>
<td><ins class="diff-chg">U+0201D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rdsh;</ins></code></td>
<td><ins class="diff-chg">U+021B3</ins></td>
</tr>
<tr>
<td><code title="">real;</code></td>
<td><del class="diff-old">U+211C</del> <ins class=
"diff-chg">U+0211C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">realine;</ins></code></td>
<td><ins class="diff-chg">U+0211B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">realpart;</ins></code></td>
<td><ins class="diff-chg">U+0211C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">reals;</ins></code></td>
<td><ins class="diff-chg">U+0211D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rect;</ins></code></td>
<td><ins class="diff-chg">U+025AD</ins></td>
</tr>
<tr>
<td><code title="">reg;</code></td>
<td><del class="diff-old">U+00AE</del> <ins class=
"diff-chg">U+000AE</ins></td>
</tr>
<tr>
<td><code title="">reg</code></td>
<td><del class="diff-old">U+00AE</del> <ins class=
"diff-chg">U+000AE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rfisht;</ins></code></td>
<td><ins class="diff-chg">U+0297D</ins></td>
</tr>
<tr>
<td><code title="">rfloor;</code></td>
<td><del class="diff-old">U+230B</del> <ins class=
"diff-chg">U+0230B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rfr;</ins></code></td>
<td><ins class="diff-chg">U+1D52F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rhard;</ins></code></td>
<td><ins class="diff-chg">U+021C1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rharu;</ins></code></td>
<td><ins class="diff-chg">U+021C0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rharul;</ins></code></td>
<td><ins class="diff-chg">U+0296C</ins></td>
</tr>
<tr>
<td><code title="">rho;</code></td>
<td><del class="diff-old">U+03C1</del> <ins class=
"diff-chg">U+003C1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rhov;</ins></code></td>
<td><ins class="diff-chg">U+003F1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">rightarrow;</ins></code></td>
<td><ins class="diff-chg">U+02192</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">rightarrowtail;</ins></code></td>
<td><ins class="diff-chg">U+021A3</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">rightharpoondown;</ins></code></td>
<td><ins class="diff-chg">U+021C1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">rightharpoonup;</ins></code></td>
<td><ins class="diff-chg">U+021C0</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">rightleftarrows;</ins></code></td>
<td><ins class="diff-chg">U+021C4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">rightleftharpoons;</ins></code></td>
<td><ins class="diff-chg">U+021CC</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">rightrightarrows;</ins></code></td>
<td><ins class="diff-chg">U+021C9</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">rightsquigarrow;</ins></code></td>
<td><ins class="diff-chg">U+0219D</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">rightthreetimes;</ins></code></td>
<td><ins class="diff-chg">U+022CC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ring;</ins></code></td>
<td><ins class="diff-chg">U+002DA</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">risingdotseq;</ins></code></td>
<td><ins class="diff-chg">U+02253</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rlarr;</ins></code></td>
<td><ins class="diff-chg">U+021C4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rlhar;</ins></code></td>
<td><ins class="diff-chg">U+021CC</ins></td>
</tr>
<tr>
<td><code title="">rlm;</code></td>
<td><ins class="diff-new">U+0200F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-new">rmoust;</ins></code></td>
<td><del class="diff-old">U+200F</del> <ins class=
"diff-chg">U+023B1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">rmoustache;</ins></code></td>
<td><ins class="diff-chg">U+023B1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rnmid;</ins></code></td>
<td><ins class="diff-chg">U+02AEE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">roang;</ins></code></td>
<td><ins class="diff-chg">U+027ED</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">roarr;</ins></code></td>
<td><ins class="diff-chg">U+021FE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">robrk;</ins></code></td>
<td><ins class="diff-chg">U+027E7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ropar;</ins></code></td>
<td><ins class="diff-chg">U+02986</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ropf;</ins></code></td>
<td><ins class="diff-chg">U+1D563</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">roplus;</ins></code></td>
<td><ins class="diff-chg">U+02A2E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rotimes;</ins></code></td>
<td><ins class="diff-chg">U+02A35</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rpar;</ins></code></td>
<td><ins class="diff-chg">U+00029</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rpargt;</ins></code></td>
<td><ins class="diff-chg">U+02994</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">rppolint;</ins></code></td>
<td><ins class="diff-chg">U+02A12</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rrarr;</ins></code></td>
<td><ins class="diff-chg">U+021C9</ins></td>
</tr>
<tr>
<td><code title="">rsaquo;</code></td>
<td><del class="diff-old">U+203A</del> <ins class=
"diff-chg">U+0203A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4C7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rsh;</ins></code></td>
<td><ins class="diff-chg">U+021B1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rsqb;</ins></code></td>
<td><ins class="diff-chg">U+0005D</ins></td>
</tr>
<tr>
<td><code title="">rsquo;</code></td>
<td><del class="diff-old">U+2019</del> <ins class=
"diff-chg">U+02019</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rsquor;</ins></code></td>
<td><ins class="diff-chg">U+02019</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rthree;</ins></code></td>
<td><ins class="diff-chg">U+022CC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rtimes;</ins></code></td>
<td><ins class="diff-chg">U+022CA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rtri;</ins></code></td>
<td><ins class="diff-chg">U+025B9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rtrie;</ins></code></td>
<td><ins class="diff-chg">U+022B5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rtrif;</ins></code></td>
<td><ins class="diff-chg">U+025B8</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">rtriltri;</ins></code></td>
<td><ins class="diff-chg">U+029CE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ruluhar;</ins></code></td>
<td><ins class="diff-chg">U+02968</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">rx;</ins></code></td>
<td><ins class="diff-chg">U+0211E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sacute;</ins></code></td>
<td><ins class="diff-chg">U+0015B</ins></td>
</tr>
<tr>
<td><code title="">sbquo;</code></td>
<td><del class="diff-old">U+201A</del> <ins class=
"diff-chg">U+0201A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sc;</ins></code></td>
<td><ins class="diff-chg">U+0227B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">scE;</ins></code></td>
<td><ins class="diff-chg">U+02AB4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">scap;</ins></code></td>
<td><ins class="diff-chg">U+02AB8</ins></td>
</tr>
<tr>
<td><code title="">scaron;</code></td>
<td><del class="diff-old">U+0161</del> <ins class=
"diff-chg">U+00161</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sccue;</ins></code></td>
<td><ins class="diff-chg">U+0227D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sce;</ins></code></td>
<td><ins class="diff-chg">U+02AB0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">scedil;</ins></code></td>
<td><ins class="diff-chg">U+0015F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">scirc;</ins></code></td>
<td><ins class="diff-chg">U+0015D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">scnE;</ins></code></td>
<td><ins class="diff-chg">U+02AB6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">scnap;</ins></code></td>
<td><ins class="diff-chg">U+02ABA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">scnsim;</ins></code></td>
<td><ins class="diff-chg">U+022E9</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">scpolint;</ins></code></td>
<td><ins class="diff-chg">U+02A13</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">scsim;</ins></code></td>
<td><ins class="diff-chg">U+0227F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">scy;</ins></code></td>
<td><ins class="diff-chg">U+00441</ins></td>
</tr>
<tr>
<td><code title="">sdot;</code></td>
<td><del class="diff-old">U+22C5</del> <ins class=
"diff-chg">U+022C5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sdotb;</ins></code></td>
<td><ins class="diff-chg">U+022A1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sdote;</ins></code></td>
<td><ins class="diff-chg">U+02A66</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">seArr;</ins></code></td>
<td><ins class="diff-chg">U+021D8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">searhk;</ins></code></td>
<td><ins class="diff-chg">U+02925</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">searr;</ins></code></td>
<td><ins class="diff-chg">U+02198</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">searrow;</ins></code></td>
<td><ins class="diff-chg">U+02198</ins></td>
</tr>
<tr>
<td><code title="">sect;</code></td>
<td><del class="diff-old">U+00A7</del> <ins class=
"diff-chg">U+000A7</ins></td>
</tr>
<tr>
<td><code title="">sect</code></td>
<td><del class="diff-old">U+00A7</del> <ins class=
"diff-chg">U+000A7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">semi;</ins></code></td>
<td><ins class="diff-chg">U+0003B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">seswar;</ins></code></td>
<td><ins class="diff-chg">U+02929</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">setminus;</ins></code></td>
<td><ins class="diff-chg">U+02216</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">setmn;</ins></code></td>
<td><ins class="diff-chg">U+02216</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sext;</ins></code></td>
<td><ins class="diff-chg">U+02736</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sfr;</ins></code></td>
<td><ins class="diff-chg">U+1D530</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sfrown;</ins></code></td>
<td><ins class="diff-chg">U+02322</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sharp;</ins></code></td>
<td><ins class="diff-chg">U+0266F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">shchcy;</ins></code></td>
<td><ins class="diff-chg">U+00449</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">shcy;</ins></code></td>
<td><ins class="diff-chg">U+00448</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">shortmid;</ins></code></td>
<td><ins class="diff-chg">U+02223</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">shortparallel;</ins></code></td>
<td><ins class="diff-chg">U+02225</ins></td>
</tr>
<tr>
<td><code title="">shy;</code></td>
<td><del class="diff-old">U+00AD</del> <ins class=
"diff-chg">U+000AD</ins></td>
</tr>
<tr>
<td><code title="">shy</code></td>
<td><del class="diff-old">U+00AD</del> <ins class=
"diff-chg">U+000AD</ins></td>
</tr>
<tr>
<td><code title="">sigma;</code></td>
<td><del class="diff-old">U+03C3</del> <ins class=
"diff-chg">U+003C3</ins></td>
</tr>
<tr>
<td><code title="">sigmaf;</code></td>
<td><del class="diff-old">U+03C2</del> <ins class=
"diff-chg">U+003C2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sigmav;</ins></code></td>
<td><ins class="diff-chg">U+003C2</ins></td>
</tr>
<tr>
<td><code title="">sim;</code></td>
<td><del class="diff-old">U+223C</del> <ins class=
"diff-chg">U+0223C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">simdot;</ins></code></td>
<td><ins class="diff-chg">U+02A6A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sime;</ins></code></td>
<td><ins class="diff-chg">U+02243</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">simeq;</ins></code></td>
<td><ins class="diff-chg">U+02243</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">simg;</ins></code></td>
<td><ins class="diff-chg">U+02A9E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">simgE;</ins></code></td>
<td><ins class="diff-chg">U+02AA0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">siml;</ins></code></td>
<td><ins class="diff-chg">U+02A9D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">simlE;</ins></code></td>
<td><ins class="diff-chg">U+02A9F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">simne;</ins></code></td>
<td><ins class="diff-chg">U+02246</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">simplus;</ins></code></td>
<td><ins class="diff-chg">U+02A24</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">simrarr;</ins></code></td>
<td><ins class="diff-chg">U+02972</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">slarr;</ins></code></td>
<td><ins class="diff-chg">U+02190</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">smallsetminus;</ins></code></td>
<td><ins class="diff-chg">U+02216</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">smashp;</ins></code></td>
<td><ins class="diff-chg">U+02A33</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">smeparsl;</ins></code></td>
<td><ins class="diff-chg">U+029E4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">smid;</ins></code></td>
<td><ins class="diff-chg">U+02223</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">smile;</ins></code></td>
<td><ins class="diff-chg">U+02323</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">smt;</ins></code></td>
<td><ins class="diff-chg">U+02AAA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">smte;</ins></code></td>
<td><ins class="diff-chg">U+02AAC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">softcy;</ins></code></td>
<td><ins class="diff-chg">U+0044C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sol;</ins></code></td>
<td><ins class="diff-chg">U+0002F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">solb;</ins></code></td>
<td><ins class="diff-chg">U+029C4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">solbar;</ins></code></td>
<td><ins class="diff-chg">U+0233F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sopf;</ins></code></td>
<td><ins class="diff-chg">U+1D564</ins></td>
</tr>
<tr>
<td><code title="">spades;</code></td>
<td><del class="diff-old">U+2660</del> <ins class=
"diff-chg">U+02660</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">spadesuit;</ins></code></td>
<td><ins class="diff-chg">U+02660</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">spar;</ins></code></td>
<td><ins class="diff-chg">U+02225</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sqcap;</ins></code></td>
<td><ins class="diff-chg">U+02293</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sqcup;</ins></code></td>
<td><ins class="diff-chg">U+02294</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sqsub;</ins></code></td>
<td><ins class="diff-chg">U+0228F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sqsube;</ins></code></td>
<td><ins class="diff-chg">U+02291</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">sqsubset;</ins></code></td>
<td><ins class="diff-chg">U+0228F</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">sqsubseteq;</ins></code></td>
<td><ins class="diff-chg">U+02291</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sqsup;</ins></code></td>
<td><ins class="diff-chg">U+02290</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sqsupe;</ins></code></td>
<td><ins class="diff-chg">U+02292</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">sqsupset;</ins></code></td>
<td><ins class="diff-chg">U+02290</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">sqsupseteq;</ins></code></td>
<td><ins class="diff-chg">U+02292</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">squ;</ins></code></td>
<td><ins class="diff-chg">U+025A1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">square;</ins></code></td>
<td><ins class="diff-chg">U+025A1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">squarf;</ins></code></td>
<td><ins class="diff-chg">U+025AA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">squf;</ins></code></td>
<td><ins class="diff-chg">U+025AA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">srarr;</ins></code></td>
<td><ins class="diff-chg">U+02192</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4C8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ssetmn;</ins></code></td>
<td><ins class="diff-chg">U+02216</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ssmile;</ins></code></td>
<td><ins class="diff-chg">U+02323</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sstarf;</ins></code></td>
<td><ins class="diff-chg">U+022C6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">star;</ins></code></td>
<td><ins class="diff-chg">U+02606</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">starf;</ins></code></td>
<td><ins class="diff-chg">U+02605</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">straightepsilon;</ins></code></td>
<td><ins class="diff-chg">U+003F5</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">straightphi;</ins></code></td>
<td><ins class="diff-chg">U+003D5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">strns;</ins></code></td>
<td><ins class="diff-chg">U+000AF</ins></td>
</tr>
<tr>
<td><code title="">sub;</code></td>
<td><del class="diff-old">U+2282</del> <ins class=
"diff-chg">U+02282</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">subE;</ins></code></td>
<td><ins class="diff-chg">U+02AC5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">subdot;</ins></code></td>
<td><ins class="diff-chg">U+02ABD</ins></td>
</tr>
<tr>
<td><code title="">sube;</code></td>
<td><del class="diff-old">U+2286</del> <ins class=
"diff-chg">U+02286</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">subedot;</ins></code></td>
<td><ins class="diff-chg">U+02AC3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">submult;</ins></code></td>
<td><ins class="diff-chg">U+02AC1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">subnE;</ins></code></td>
<td><ins class="diff-chg">U+02ACB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">subne;</ins></code></td>
<td><ins class="diff-chg">U+0228A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">subplus;</ins></code></td>
<td><ins class="diff-chg">U+02ABF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">subrarr;</ins></code></td>
<td><ins class="diff-chg">U+02979</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">subset;</ins></code></td>
<td><ins class="diff-chg">U+02282</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">subseteq;</ins></code></td>
<td><ins class="diff-chg">U+02286</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">subseteqq;</ins></code></td>
<td><ins class="diff-chg">U+02AC5</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">subsetneq;</ins></code></td>
<td><ins class="diff-chg">U+0228A</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">subsetneqq;</ins></code></td>
<td><ins class="diff-chg">U+02ACB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">subsim;</ins></code></td>
<td><ins class="diff-chg">U+02AC7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">subsub;</ins></code></td>
<td><ins class="diff-chg">U+02AD5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">subsup;</ins></code></td>
<td><ins class="diff-chg">U+02AD3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">succ;</ins></code></td>
<td><ins class="diff-chg">U+0227B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">succapprox;</ins></code></td>
<td><ins class="diff-chg">U+02AB8</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">succcurlyeq;</ins></code></td>
<td><ins class="diff-chg">U+0227D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">succeq;</ins></code></td>
<td><ins class="diff-chg">U+02AB0</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">succnapprox;</ins></code></td>
<td><ins class="diff-chg">U+02ABA</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">succneqq;</ins></code></td>
<td><ins class="diff-chg">U+02AB6</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">succnsim;</ins></code></td>
<td><ins class="diff-chg">U+022E9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">succsim;</ins></code></td>
<td><ins class="diff-chg">U+0227F</ins></td>
</tr>
<tr>
<td><code title="">sum;</code></td>
<td><del class="diff-old">U+2211</del> <ins class=
"diff-chg">U+02211</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">sung;</ins></code></td>
<td><ins class="diff-chg">U+0266A</ins></td>
</tr>
<tr>
<td><code title="">sup1;</code></td>
<td><del class="diff-old">U+00B9</del> <ins class=
"diff-chg">U+000B9</ins></td>
</tr>
<tr>
<td><code title="">sup1</code></td>
<td><del class="diff-old">U+00B9</del> <ins class=
"diff-chg">U+000B9</ins></td>
</tr>
<tr>
<td><code title="">sup2;</code></td>
<td><del class="diff-old">U+00B2</del> <ins class=
"diff-chg">U+000B2</ins></td>
</tr>
<tr>
<td><code title="">sup2</code></td>
<td><del class="diff-old">U+00B2</del> <ins class=
"diff-chg">U+000B2</ins></td>
</tr>
<tr>
<td><code title="">sup3;</code></td>
<td><del class="diff-old">U+00B3</del> <ins class=
"diff-chg">U+000B3</ins></td>
</tr>
<tr>
<td><code title="">sup3</code></td>
<td><del class="diff-old">U+00B3</del> <ins class=
"diff-chg">U+000B3</ins></td>
</tr>
<tr>
<td><code title="">sup;</code></td>
<td><del class="diff-old">U+2283</del> <ins class=
"diff-chg">U+02283</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">supE;</ins></code></td>
<td><ins class="diff-chg">U+02AC6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">supdot;</ins></code></td>
<td><ins class="diff-chg">U+02ABE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">supdsub;</ins></code></td>
<td><ins class="diff-chg">U+02AD8</ins></td>
</tr>
<tr>
<td><code title="">supe;</code></td>
<td><del class="diff-old">U+2287</del> <ins class=
"diff-chg">U+02287</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">supedot;</ins></code></td>
<td><ins class="diff-chg">U+02AC4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">suphsub;</ins></code></td>
<td><ins class="diff-chg">U+02AD7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">suplarr;</ins></code></td>
<td><ins class="diff-chg">U+0297B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">supmult;</ins></code></td>
<td><ins class="diff-chg">U+02AC2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">supnE;</ins></code></td>
<td><ins class="diff-chg">U+02ACC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">supne;</ins></code></td>
<td><ins class="diff-chg">U+0228B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">supplus;</ins></code></td>
<td><ins class="diff-chg">U+02AC0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">supset;</ins></code></td>
<td><ins class="diff-chg">U+02283</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">supseteq;</ins></code></td>
<td><ins class="diff-chg">U+02287</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">supseteqq;</ins></code></td>
<td><ins class="diff-chg">U+02AC6</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">supsetneq;</ins></code></td>
<td><ins class="diff-chg">U+0228B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">supsetneqq;</ins></code></td>
<td><ins class="diff-chg">U+02ACC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">supsim;</ins></code></td>
<td><ins class="diff-chg">U+02AC8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">supsub;</ins></code></td>
<td><ins class="diff-chg">U+02AD4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">supsup;</ins></code></td>
<td><ins class="diff-chg">U+02AD6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">swArr;</ins></code></td>
<td><ins class="diff-chg">U+021D9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">swarhk;</ins></code></td>
<td><ins class="diff-chg">U+02926</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">swarr;</ins></code></td>
<td><ins class="diff-chg">U+02199</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">swarrow;</ins></code></td>
<td><ins class="diff-chg">U+02199</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">swnwar;</ins></code></td>
<td><ins class="diff-chg">U+0292A</ins></td>
</tr>
<tr>
<td><code title="">szlig;</code></td>
<td><del class="diff-old">U+00DF</del> <ins class=
"diff-chg">U+000DF</ins></td>
</tr>
<tr>
<td><code title="">szlig</code></td>
<td><del class="diff-old">U+00DF</del> <ins class=
"diff-chg">U+000DF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">target;</ins></code></td>
<td><ins class="diff-chg">U+02316</ins></td>
</tr>
<tr>
<td><code title="">tau;</code></td>
<td><del class="diff-old">U+03C4</del> <ins class=
"diff-chg">U+003C4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">tbrk;</ins></code></td>
<td><ins class="diff-chg">U+023B4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">tcaron;</ins></code></td>
<td><ins class="diff-chg">U+00165</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">tcedil;</ins></code></td>
<td><ins class="diff-chg">U+00163</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">tcy;</ins></code></td>
<td><ins class="diff-chg">U+00442</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">tdot;</ins></code></td>
<td><ins class="diff-chg">U+020DB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">telrec;</ins></code></td>
<td><ins class="diff-chg">U+02315</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">tfr;</ins></code></td>
<td><ins class="diff-chg">U+1D531</ins></td>
</tr>
<tr>
<td><code title="">there4;</code></td>
<td><del class="diff-old">U+2234</del> <ins class=
"diff-chg">U+02234</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">therefore;</ins></code></td>
<td><ins class="diff-chg">U+02234</ins></td>
</tr>
<tr>
<td><code title="">theta;</code></td>
<td><del class="diff-old">U+03B8</del> <ins class=
"diff-chg">U+003B8</ins></td>
</tr>
<tr>
<td><code title="">thetasym;</code></td>
<td><del class="diff-old">U+03D1</del> <ins class=
"diff-chg">U+003D1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">thetav;</ins></code></td>
<td><ins class="diff-chg">U+003D1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">thickapprox;</ins></code></td>
<td><ins class="diff-chg">U+02248</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">thicksim;</ins></code></td>
<td><ins class="diff-chg">U+0223C</ins></td>
</tr>
<tr>
<td><code title="">thinsp;</code></td>
<td><del class="diff-old">U+2009</del> <ins class=
"diff-chg">U+02009</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">thkap;</ins></code></td>
<td><ins class="diff-chg">U+02248</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">thksim;</ins></code></td>
<td><ins class="diff-chg">U+0223C</ins></td>
</tr>
<tr>
<td><code title="">thorn;</code></td>
<td><del class="diff-old">U+00FE</del> <ins class=
"diff-chg">U+000FE</ins></td>
</tr>
<tr>
<td><code title="">thorn</code></td>
<td><del class="diff-old">U+00FE</del> <ins class=
"diff-chg">U+000FE</ins></td>
</tr>
<tr>
<td><code title="">tilde;</code></td>
<td><del class="diff-old">U+02DC</del> <ins class=
"diff-chg">U+002DC</ins></td>
</tr>
<tr>
<td><code title="">times;</code></td>
<td><del class="diff-old">U+00D7</del> <ins class=
"diff-chg">U+000D7</ins></td>
</tr>
<tr>
<td><code title="">times</code></td>
<td><del class="diff-old">U+00D7</del> <ins class=
"diff-chg">U+000D7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">timesb;</ins></code></td>
<td><ins class="diff-chg">U+022A0</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">timesbar;</ins></code></td>
<td><ins class="diff-chg">U+02A31</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">timesd;</ins></code></td>
<td><ins class="diff-chg">U+02A30</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">tint;</ins></code></td>
<td><ins class="diff-chg">U+0222D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">toea;</ins></code></td>
<td><ins class="diff-chg">U+02928</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">top;</ins></code></td>
<td><ins class="diff-chg">U+022A4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">topbot;</ins></code></td>
<td><ins class="diff-chg">U+02336</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">topcir;</ins></code></td>
<td><ins class="diff-chg">U+02AF1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">topf;</ins></code></td>
<td><ins class="diff-chg">U+1D565</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">topfork;</ins></code></td>
<td><ins class="diff-chg">U+02ADA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">tosa;</ins></code></td>
<td><ins class="diff-chg">U+02929</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">tprime;</ins></code></td>
<td><ins class="diff-chg">U+02034</ins></td>
</tr>
<tr>
<td><code title="">trade;</code></td>
<td><del class="diff-old">U+2122</del> <ins class=
"diff-chg">U+02122</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">triangle;</ins></code></td>
<td><ins class="diff-chg">U+025B5</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">triangledown;</ins></code></td>
<td><ins class="diff-chg">U+025BF</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">triangleleft;</ins></code></td>
<td><ins class="diff-chg">U+025C3</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">trianglelefteq;</ins></code></td>
<td><ins class="diff-chg">U+022B4</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">triangleq;</ins></code></td>
<td><ins class="diff-chg">U+0225C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">triangleright;</ins></code></td>
<td><ins class="diff-chg">U+025B9</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">trianglerighteq;</ins></code></td>
<td><ins class="diff-chg">U+022B5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">tridot;</ins></code></td>
<td><ins class="diff-chg">U+025EC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">trie;</ins></code></td>
<td><ins class="diff-chg">U+0225C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">triminus;</ins></code></td>
<td><ins class="diff-chg">U+02A3A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">triplus;</ins></code></td>
<td><ins class="diff-chg">U+02A39</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">trisb;</ins></code></td>
<td><ins class="diff-chg">U+029CD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">tritime;</ins></code></td>
<td><ins class="diff-chg">U+02A3B</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">trpezium;</ins></code></td>
<td><ins class="diff-chg">U+023E2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">tscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4C9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">tscy;</ins></code></td>
<td><ins class="diff-chg">U+00446</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">tshcy;</ins></code></td>
<td><ins class="diff-chg">U+0045B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">tstrok;</ins></code></td>
<td><ins class="diff-chg">U+00167</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">twixt;</ins></code></td>
<td><ins class="diff-chg">U+0226C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">twoheadleftarrow;</ins></code></td>
<td><ins class="diff-chg">U+0219E</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">twoheadrightarrow;</ins></code></td>
<td><ins class="diff-chg">U+021A0</ins></td>
</tr>
<tr>
<td><code title="">uArr;</code></td>
<td><del class="diff-old">U+21D1</del> <ins class=
"diff-chg">U+021D1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">uHar;</ins></code></td>
<td><ins class="diff-chg">U+02963</ins></td>
</tr>
<tr>
<td><code title="">uacute;</code></td>
<td><del class="diff-old">U+00FA</del> <ins class=
"diff-chg">U+000FA</ins></td>
</tr>
<tr>
<td><code title="">uacute</code></td>
<td><del class="diff-old">U+00FA</del> <ins class=
"diff-chg">U+000FA</ins></td>
</tr>
<tr>
<td><code title="">uarr;</code></td>
<td><del class="diff-old">U+2191</del> <ins class=
"diff-chg">U+02191</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ubrcy;</ins></code></td>
<td><ins class="diff-chg">U+0045E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ubreve;</ins></code></td>
<td><ins class="diff-chg">U+0016D</ins></td>
</tr>
<tr>
<td><code title="">ucirc;</code></td>
<td><del class="diff-old">U+00FB</del> <ins class=
"diff-chg">U+000FB</ins></td>
</tr>
<tr>
<td><code title="">ucirc</code></td>
<td><del class="diff-old">U+00FB</del> <ins class=
"diff-chg">U+000FB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ucy;</ins></code></td>
<td><ins class="diff-chg">U+00443</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">udarr;</ins></code></td>
<td><ins class="diff-chg">U+021C5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">udblac;</ins></code></td>
<td><ins class="diff-chg">U+00171</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">udhar;</ins></code></td>
<td><ins class="diff-chg">U+0296E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ufisht;</ins></code></td>
<td><ins class="diff-chg">U+0297E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ufr;</ins></code></td>
<td><ins class="diff-chg">U+1D532</ins></td>
</tr>
<tr>
<td><code title="">ugrave;</code></td>
<td><del class="diff-old">U+00F9</del> <ins class=
"diff-chg">U+000F9</ins></td>
</tr>
<tr>
<td><code title="">ugrave</code></td>
<td><del class="diff-old">U+00F9</del> <ins class=
"diff-chg">U+000F9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">uharl;</ins></code></td>
<td><ins class="diff-chg">U+021BF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">uharr;</ins></code></td>
<td><ins class="diff-chg">U+021BE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">uhblk;</ins></code></td>
<td><ins class="diff-chg">U+02580</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ulcorn;</ins></code></td>
<td><ins class="diff-chg">U+0231C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">ulcorner;</ins></code></td>
<td><ins class="diff-chg">U+0231C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ulcrop;</ins></code></td>
<td><ins class="diff-chg">U+0230F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ultri;</ins></code></td>
<td><ins class="diff-chg">U+025F8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">umacr;</ins></code></td>
<td><ins class="diff-chg">U+0016B</ins></td>
</tr>
<tr>
<td><code title="">uml;</code></td>
<td><del class="diff-old">U+00A8</del> <ins class=
"diff-chg">U+000A8</ins></td>
</tr>
<tr>
<td><code title="">uml</code></td>
<td><del class="diff-old">U+00A8</del> <ins class=
"diff-chg">U+000A8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">uogon;</ins></code></td>
<td><ins class="diff-chg">U+00173</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">uopf;</ins></code></td>
<td><ins class="diff-chg">U+1D566</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">uparrow;</ins></code></td>
<td><ins class="diff-chg">U+02191</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">updownarrow;</ins></code></td>
<td><ins class="diff-chg">U+02195</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">upharpoonleft;</ins></code></td>
<td><ins class="diff-chg">U+021BF</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">upharpoonright;</ins></code></td>
<td><ins class="diff-chg">U+021BE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">uplus;</ins></code></td>
<td><ins class="diff-chg">U+0228E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">upsi;</ins></code></td>
<td><ins class="diff-chg">U+003C5</ins></td>
</tr>
<tr>
<td><code title="">upsih;</code></td>
<td><del class="diff-old">U+03D2</del> <ins class=
"diff-chg">U+003D2</ins></td>
</tr>
<tr>
<td><code title="">upsilon;</code></td>
<td><del class="diff-old">U+03C5</del> <ins class=
"diff-chg">U+003C5</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">upuparrows;</ins></code></td>
<td><ins class="diff-chg">U+021C8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">urcorn;</ins></code></td>
<td><ins class="diff-chg">U+0231D</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">urcorner;</ins></code></td>
<td><ins class="diff-chg">U+0231D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">urcrop;</ins></code></td>
<td><ins class="diff-chg">U+0230E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">uring;</ins></code></td>
<td><ins class="diff-chg">U+0016F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">urtri;</ins></code></td>
<td><ins class="diff-chg">U+025F9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">uscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4CA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">utdot;</ins></code></td>
<td><ins class="diff-chg">U+022F0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">utilde;</ins></code></td>
<td><ins class="diff-chg">U+00169</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">utri;</ins></code></td>
<td><ins class="diff-chg">U+025B5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">utrif;</ins></code></td>
<td><ins class="diff-chg">U+025B4</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">uuarr;</ins></code></td>
<td><ins class="diff-chg">U+021C8</ins></td>
</tr>
<tr>
<td><code title="">uuml;</code></td>
<td><del class="diff-old">U+00FC</del> <ins class=
"diff-chg">U+000FC</ins></td>
</tr>
<tr>
<td><code title="">uuml</code></td>
<td><del class="diff-old">U+00FC</del> <ins class=
"diff-chg">U+000FC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">uwangle;</ins></code></td>
<td><ins class="diff-chg">U+029A7</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">vArr;</ins></code></td>
<td><ins class="diff-chg">U+021D5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">vBar;</ins></code></td>
<td><ins class="diff-chg">U+02AE8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">vBarv;</ins></code></td>
<td><ins class="diff-chg">U+02AE9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">vDash;</ins></code></td>
<td><ins class="diff-chg">U+022A8</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">vangrt;</ins></code></td>
<td><ins class="diff-chg">U+0299C</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">varepsilon;</ins></code></td>
<td><ins class="diff-chg">U+003B5</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">varkappa;</ins></code></td>
<td><ins class="diff-chg">U+003F0</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">varnothing;</ins></code></td>
<td><ins class="diff-chg">U+02205</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">varphi;</ins></code></td>
<td><ins class="diff-chg">U+003C6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">varpi;</ins></code></td>
<td><ins class="diff-chg">U+003D6</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">varpropto;</ins></code></td>
<td><ins class="diff-chg">U+0221D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">varr;</ins></code></td>
<td><ins class="diff-chg">U+02195</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">varrho;</ins></code></td>
<td><ins class="diff-chg">U+003F1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">varsigma;</ins></code></td>
<td><ins class="diff-chg">U+003C2</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">vartheta;</ins></code></td>
<td><ins class="diff-chg">U+003D1</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">vartriangleleft;</ins></code></td>
<td><ins class="diff-chg">U+022B2</ins></td>
</tr>
<tr>
<td><code title=""><ins class=
"diff-chg">vartriangleright;</ins></code></td>
<td><ins class="diff-chg">U+022B3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">vcy;</ins></code></td>
<td><ins class="diff-chg">U+00432</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">vdash;</ins></code></td>
<td><ins class="diff-chg">U+022A2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">vee;</ins></code></td>
<td><ins class="diff-chg">U+02228</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">veebar;</ins></code></td>
<td><ins class="diff-chg">U+022BB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">veeeq;</ins></code></td>
<td><ins class="diff-chg">U+0225A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">vellip;</ins></code></td>
<td><ins class="diff-chg">U+022EE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">verbar;</ins></code></td>
<td><ins class="diff-chg">U+0007C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">vert;</ins></code></td>
<td><ins class="diff-chg">U+0007C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">vfr;</ins></code></td>
<td><ins class="diff-chg">U+1D533</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">vltri;</ins></code></td>
<td><ins class="diff-chg">U+022B2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">vopf;</ins></code></td>
<td><ins class="diff-chg">U+1D567</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">vprop;</ins></code></td>
<td><ins class="diff-chg">U+0221D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">vrtri;</ins></code></td>
<td><ins class="diff-chg">U+022B3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">vscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4CB</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">vzigzag;</ins></code></td>
<td><ins class="diff-chg">U+0299A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">wcirc;</ins></code></td>
<td><ins class="diff-chg">U+00175</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">wedbar;</ins></code></td>
<td><ins class="diff-chg">U+02A5F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">wedge;</ins></code></td>
<td><ins class="diff-chg">U+02227</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">wedgeq;</ins></code></td>
<td><ins class="diff-chg">U+02259</ins></td>
</tr>
<tr>
<td><code title="">weierp;</code></td>
<td><del class="diff-old">U+2118</del> <ins class=
"diff-chg">U+02118</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">wfr;</ins></code></td>
<td><ins class="diff-chg">U+1D534</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">wopf;</ins></code></td>
<td><ins class="diff-chg">U+1D568</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">wp;</ins></code></td>
<td><ins class="diff-chg">U+02118</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">wr;</ins></code></td>
<td><ins class="diff-chg">U+02240</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">wreath;</ins></code></td>
<td><ins class="diff-chg">U+02240</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">wscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4CC</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">xcap;</ins></code></td>
<td><ins class="diff-chg">U+022C2</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">xcirc;</ins></code></td>
<td><ins class="diff-chg">U+025EF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">xcup;</ins></code></td>
<td><ins class="diff-chg">U+022C3</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">xdtri;</ins></code></td>
<td><ins class="diff-chg">U+025BD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">xfr;</ins></code></td>
<td><ins class="diff-chg">U+1D535</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">xhArr;</ins></code></td>
<td><ins class="diff-chg">U+027FA</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">xharr;</ins></code></td>
<td><ins class="diff-chg">U+027F7</ins></td>
</tr>
<tr>
<td><code title="">xi;</code></td>
<td><del class="diff-old">U+03BE</del> <ins class=
"diff-chg">U+003BE</ins></td>
</tr>
<tr>
<td><code title=""><del class="diff-old">yacute;</del> <ins class=
"diff-chg">xlArr;</ins></code></td>
<td><del class="diff-old">U+00FD</del> <ins class=
"diff-chg">U+027F8</ins></td>
</tr>
<tr>
<td><code title=""><del class="diff-old">yacute</del> <ins class=
"diff-chg">xlarr;</ins></code></td>
<td><del class="diff-old">U+00FD</del> <ins class=
"diff-chg">U+027F5</ins></td>
</tr>
<tr>
<td><code title=""><del class="diff-old">yen;</del> <ins class=
"diff-chg">xmap;</ins></code></td>
<td><del class="diff-old">U+00A5</del> <ins class=
"diff-chg">U+027FC</ins></td>
</tr>
<tr>
<td><code title=""><del class="diff-old">yen</del> <ins class=
"diff-chg">xnis;</ins></code></td>
<td><del class="diff-old">U+00A5</del> <ins class=
"diff-chg">U+022FB</ins></td>
</tr>
<tr>
<td><code title=""><del class="diff-old">yuml;</del> <ins class=
"diff-chg">xodot;</ins></code></td>
<td><del class="diff-old">U+00FF</del> <ins class=
"diff-chg">U+02A00</ins></td>
</tr>
<tr>
<td><code title=""><del class="diff-old">yuml</del> <ins class=
"diff-chg">xopf;</ins></code></td>
<td><del class="diff-old">U+00FF</del> <ins class=
"diff-chg">U+1D569</ins></td>
</tr>
<tr>
<td><code title=""><del class="diff-old">zeta;</del> <ins class=
"diff-chg">xoplus;</ins></code></td>
<td><del class="diff-old">U+03B6</del> <ins class=
"diff-chg">U+02A01</ins></td>
</tr>
<tr>
<td><code title=""><del class="diff-old">zwj;</del> <ins class=
"diff-chg">xotime;</ins></code></td>
<td><del class="diff-old">U+200D</del> <ins class=
"diff-chg">U+02A02</ins></td>
</tr>
<tr>
<td><code title=""><del class="diff-old">zwnj;</del> <ins class=
"diff-chg">xrArr;</ins></code></td>
<td><del class="diff-old">U+200C 9. WYSIWYG editors WYSIWYG editors
are authoring tools with a predominantly presentation-driven user
interface. 9.1. Presentational markup 9.1.1. WYSIWYG signature
WYSIWYG editors must include a meta</del> <ins class=
"diff-chg">U+027F9</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">xrarr;</ins></code>
<del class="diff-old">element in the head</del></td>
<td><ins class="diff-chg">U+027F6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">xscr;</ins></code>
<del class="diff-old">element whose name</del></td>
<td><ins class="diff-chg">U+1D4CD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">xsqcup;</ins></code>
<del class="diff-old">attribute has the value generator</del></td>
<td><ins class="diff-chg">U+02A06</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">xuplus;</ins></code>
<del class="diff-old">and whose content</del></td>
<td><ins class="diff-chg">U+02A04</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">xutri;</ins></code>
<del class="diff-old">attribute's value ends with the string
"</del></td>
<td><ins class="diff-chg">U+025B3</ins></td>
</tr>
<tr>
<td><code title=""><del class="diff-old">(WYSIWYG editor)</del>
<ins class="diff-chg">xvee;</ins></code> <del class="diff-old">".
Non-WYSIWYG authoring tools must not include this string in their
generator string. This entire section will probably be dropped. The
intent of this section was to allow a way for WYSIWYG editors,
which aren't going to use semantic markup, to still write
conforming documents, while not letting it be ok for hand-coding
authors to not use semantic markup. We still need some sort of
solution to this, but it's not clear what it is. 9.1.2. The
font</del></td>
<td><ins class="diff-chg">U+022C1</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">xwedge;</ins></code>
<del class="diff-old">element Categories Phrasing content .
Contexts in which this element may be used: Where phrasing content
is expected. Content model: Transparent . Element-specific
attributes: style</del></td>
<td><ins class="diff-chg">U+022C0</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">yacute;</ins></code>
<del class="diff-old">DOM interface: <pre class=idl>interface
{ readonly attribute CSSStyleDeclaration ; }; This entire section
will probably be dropped. The intent of this section was to allow a
way for WYSIWYG editors, which don't have enough information to use
the "real" "semantic" elements, to still make HTML pages without
abusing those semantic elements (since abusing elements is even
worse than not using them in the first place). We have still got to
find a solution to this, while not letting it be ok for hand-coding
authors to abuse the style="" attribute. The font</del></td>
<td><ins class="diff-chg">U+000FD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">yacute</ins></code>
<del class="diff-old">element doesn't represent anything. It must
not be used except by WYSIWYG editors , which may use it to achieve
presentational affects. Even WYSIWYG editors, however, should make
every effort to use appropriate semantic markup and avoid the use
of media-specific presentational markup. Conformance checkers must
consider this element to be non-conforming if it is used on a page
lacking the WYSIWYG signature . The following would be
syntactically legal (as the output from a WYSIWYG editor, though
not anywhere else): <html> <head>
<title></title> <meta name="generator"
content="Sample Editor 1.0 </head> <body> <font
style="display: block; border: solid">
<h1>Hello.</h1> </font> <p> <font
style="color: orange; background: white">How</font>
<font style="color: yellow; background:
white">do</font> <font style="color: green; background:
white"> <font style="color: blue; background:
white">do?</font> </p> </body> </html>
The first font</del></td>
<td><ins class="diff-chg">U+000FD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">yacy;</ins></code>
<del class="diff-old">element is conformant because h1</del></td>
<td><ins class="diff-chg">U+0044F</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ycirc;</ins></code>
<del class="diff-old">and p</del></td>
<td><ins class="diff-chg">U+00177</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">ycy;</ins></code>
<del class="diff-old">elements are both allowed in body</del></td>
<td><ins class="diff-chg">U+0044B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">yen;</ins></code>
<del class="diff-old">elements. the next four are allowed because
text and em</del></td>
<td><ins class="diff-chg">U+000A5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">yen</ins></code>
<del class="diff-old">elements are allowed in p</del></td>
<td><ins class="diff-chg">U+000A5</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">yfr;</ins></code>
<del class="diff-old">elements. The style</del></td>
<td><ins class="diff-chg">U+1D536</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">yicy;</ins></code>
<del class="diff-old">attribute, if specified, must contain only a
list of zero or more semicolon-separated (;) CSS declarations.
[CSS21] We probably need to move this attribute to more elements,
maybe even all of them, though if we do that we really should find
a way to strongly discourage its use (and the use of its DOM
attribute) for non-WYSIWYG authors. The declarations specified must
be parsed and treated as the body of a declaration block whose
selector matches just that font</del></td>
<td><ins class="diff-chg">U+00457</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">yopf;</ins></code>
<del class="diff-old">element. For the purposes of the CSS cascade,
the attribute must be considered to be a 'style' attribute at the
author level. The style</del></td>
<td><ins class="diff-chg">U+1D56A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">yscr;</ins></code>
<del class="diff-old">DOM attribute must return a
CSSStyleDeclaration</del></td>
<td><ins class="diff-chg">U+1D4CE</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">yucy;</ins></code>
<del class="diff-old">whose value represents the declarations
specified in the attribute, if present. Mutating the
CSSStyleDeclaration</del></td>
<td><ins class="diff-chg">U+0044E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">yuml;</ins></code>
<del class="diff-old">object must create a style</del></td>
<td><ins class="diff-chg">U+000FF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">yuml</ins></code>
<del class="diff-old">attribute on the element (if there isn't one
already) and then change its value to be a value representing the
serialised form of the CSSStyleDeclaration</del></td>
<td><ins class="diff-chg">U+000FF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">zacute;</ins></code>
<del class="diff-old">object. [CSSOM]</del></td>
<td><ins class="diff-chg">U+0017A</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">zcaron;</ins></code></td>
<td><ins class="diff-chg">U+0017E</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">zcy;</ins></code></td>
<td><ins class="diff-chg">U+00437</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">zdot;</ins></code></td>
<td><ins class="diff-chg">U+0017C</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">zeetrf;</ins></code></td>
<td><ins class="diff-chg">U+02128</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">zeta;</ins></code></td>
<td><ins class="diff-chg">U+003B6</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">zfr;</ins></code></td>
<td><ins class="diff-chg">U+1D537</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">zhcy;</ins></code></td>
<td><ins class="diff-chg">U+00436</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">zigrarr;</ins></code></td>
<td><ins class="diff-chg">U+021DD</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">zopf;</ins></code></td>
<td><ins class="diff-chg">U+1D56B</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">zscr;</ins></code></td>
<td><ins class="diff-chg">U+1D4CF</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">zwj;</ins></code></td>
<td><ins class="diff-chg">U+0200D</ins></td>
</tr>
<tr>
<td><code title=""><ins class="diff-chg">zwnj;</ins></code></td>
<td><ins class="diff-chg">U+0200C</ins></td>
</tr>
</tbody>
</table>
</div>
<h2 id="rendering"><span class="secno"><del class=
"diff-old">10.</del> <ins class="diff-chg">9.</ins></span>
Rendering <ins class="diff-new">and user-agent behavior</ins></h2>
<p class="big-issue">This section will probably include details on
how to render DATAGRID (including <span id="datagridPseudos">its
pseudo-elements</span> ), drag-and-drop, etc, in a visual medium,
in concert with CSS. Terms that need to be defined include:
<dfn id="sizing">sizing of embedded content</dfn></p>
<p>CSS UAs in visual media must, when scrolling a page to a
fragment identifier, align the top of the viewport with the target
element's top border edge.</p>
<p class="big-issue">must define letting the user <ins class=
"diff-new">"</ins> <dfn id="obtain">obtain a physical form</dfn>
<ins class="diff-new">(or a representation of a physical
form)"</ins> of a document (printing) and what this means for the
<del class="diff-old">UA</del> <ins class="diff-chg">UA, in
particular creating a new view for the print media.</ins></p>
<p class="big-issue">Must define that in CSS, tag names in HTML
documents, and class names in quirks mode documents, are
case-insensitive.</p>
<h3 id="rendering0"><span class="secno"><del class=
"diff-old">10.1.</del> <ins class="diff-chg">9.1</ins></span>
Rendering and the DOM</h3>
<p class="big-issue">This section is wrong. mediaMode will end up
on Window, I think. All views implement Window.</p>
<p>Any object implement the <code>AbstractView</code> interface
must also implement the <code><a href=
"#mediamodeabstractview">MediaModeAbstractView</a></code>
interface.</p>
<pre class="idl">
interface <dfn id=
"mediamodeabstractview">MediaModeAbstractView</dfn> {
readonly attribute DOMString <a href="#mediamode">mediaMode</a>;
};
</pre>
<p>The <dfn id="mediamode"><code>mediaMode</code></dfn> attribute
on objects implementing the <code><a href=
"#mediamodeabstractview">MediaModeAbstractView</a></code> interface
must return the string that represents the canvas' current
rendering mode ( <code>screen</code> , <code>print</code> , etc).
This is a lowercase string, as <a href=
"http://www.w3.org/TR/CSS21/media.html#media-types">defined by the
CSS specification</a> . <a href="#references">[CSS21]</a></p>
<p>Some user agents may support multiple media, in which case there
will exist multiple objects implementing the
<code>AbstractView</code> interface. Only the default view
implements the <code><a href="#window">Window</a></code> interface.
The other views can be reached using the <code><a href=
"#view">view</a></code> attribute of the <code>UIEvent</code>
<del class="diff-old">inteface,</del> <ins class=
"diff-chg">interface,</ins> during event propagation. There is no
way currently to enumerate all the views.</p>
<h3 id="rendering1"><span class="secno"><del class=
"diff-old">10.2.</del> <ins class="diff-chg">9.2</ins></span>
Rendering and menus/toolbars</h3>
<h4 id="the-icon"><span class="secno"><del class=
"diff-old">10.2.1.</del> <ins class="diff-chg">9.2.1</ins></span>
The 'icon' property</h4>
<p>UAs should use the command's Icon as the default generic icon
provided by the user agent when the 'icon' property computes to
'auto' on an element that either defines a command or refers to one
using the <code title="command-attribute">command</code> attribute,
but when the property computes to an actual image, it should use
that image instead.</p>
<h3 id="obsolete"><span class="secno"><ins class=
"diff-new">9.3</ins></span> <ins class="diff-new">Obsolete
elements, attributes, and APIs</ins></h3>
<h4 id="the-body0"><span class="secno"><ins class=
"diff-new">9.3.1</ins></span> <ins class="diff-new">The</ins>
<code><a href="#body0"><ins class="diff-new">body</ins></a></code>
<ins class="diff-new">element</ins></h4>
<p class="big-issue"><ins class="diff-new">Need to define the
content attributes in terms of CSS or something.</ins></p>
<pre class="idl">
[XXX] interface <a href=
"#htmldocument">HTMLDocument</a> {<ins class="diff-new">
attribute DOMString <a href="#fgcolor" title=
"dom-document-fgColor">fgColor</a>;
attribute DOMString <a href="#bgcolor" title=
"dom-document-bgColor">bgColor</a>;
attribute DOMString <a href="#linkcolor" title=
"dom-document-linkColor">linkColor</a>;
attribute DOMString <a href="#vlinkcolor" title=
"dom-document-vlinkColor">vlinkColor</a>;
attribute DOMString <a href="#alinkcolor" title=
"dom-document-alinkColor">alinkColor</a>;
};
</ins>
</pre>
<p><ins class="diff-new">The</ins> <dfn id="fgcolor" title=
"dom-document-fgColor"><code><ins class=
"diff-new">fgColor</ins></code></dfn> <ins class=
"diff-new">attribute on the</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">object
must</ins> <a href="#reflect"><ins class=
"diff-new">reflect</ins></a> <ins class="diff-new">the</ins>
<code title="attr-body-text"><ins class=
"diff-new">text</ins></code> <ins class="diff-new">attribute
on</ins> <a href="#the-body1"><ins class="diff-new">the</ins>
<code><ins class="diff-new">body</ins></code> <ins class=
"diff-new">element</ins></a> .</p>
<p><ins class="diff-new">The</ins> <dfn id="bgcolor" title=
"dom-document-bgColor"><code><ins class=
"diff-new">bgColor</ins></code></dfn> <ins class=
"diff-new">attribute on the</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">object
must</ins> <a href="#reflect"><ins class=
"diff-new">reflect</ins></a> <ins class="diff-new">the</ins>
<code title="attr-body-bgcolor"><ins class=
"diff-new">bgcolor</ins></code> <ins class="diff-new">attribute
on</ins> <a href="#the-body1"><ins class="diff-new">the</ins>
<code><ins class="diff-new">body</ins></code> <ins class=
"diff-new">element</ins></a> .</p>
<p><ins class="diff-new">The</ins> <dfn id="linkcolor" title=
"dom-document-linkColor"><code><ins class=
"diff-new">linkColor</ins></code></dfn> <ins class=
"diff-new">attribute on the</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">object
must</ins> <a href="#reflect"><ins class=
"diff-new">reflect</ins></a> <ins class="diff-new">the</ins>
<code title="attr-body-link"><ins class=
"diff-new">link</ins></code> <ins class="diff-new">attribute
on</ins> <a href="#the-body1"><ins class="diff-new">the</ins>
<code><ins class="diff-new">body</ins></code> <ins class=
"diff-new">element</ins></a> .</p>
<p><ins class="diff-new">The</ins> <dfn id="vlinkcolor" title=
"dom-document-vLinkColor"><code><ins class=
"diff-new">vLinkColor</ins></code></dfn> <ins class=
"diff-new">attribute on the</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">object
must</ins> <a href="#reflect"><ins class=
"diff-new">reflect</ins></a> <ins class="diff-new">the</ins>
<code title="attr-body-vlink"><ins class=
"diff-new">vlink</ins></code> <ins class="diff-new">attribute
on</ins> <a href="#the-body1"><ins class="diff-new">the</ins>
<code><ins class="diff-new">body</ins></code> <ins class=
"diff-new">element</ins></a> .</p>
<p><ins class="diff-new">The</ins> <dfn id="alinkcolor" title=
"dom-document-aLinkColor"><code><ins class=
"diff-new">aLinkColor</ins></code></dfn> <ins class=
"diff-new">attribute on the</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">object
must</ins> <a href="#reflect"><ins class=
"diff-new">reflect</ins></a> <ins class="diff-new">the</ins>
<code title="attr-body-alink"><ins class=
"diff-new">alink</ins></code> <ins class="diff-new">attribute
on</ins> <a href="#the-body1"><ins class="diff-new">the</ins>
<code><ins class="diff-new">body</ins></code> <ins class=
"diff-new">element</ins></a> .</p>
<pre ins="" class="diff-new">
class=idl>[XXX] interface <a href=
"#htmlbodyelement">HTMLBodyElement</a> {
attribute DOMString <a href="#text3" title=
"dom-body-text">text</a>;
attribute DOMString <a href="#bgcolor0" title=
"dom-body-bgColor">bgColor</a>;
attribute DOMString <a href="#background" title=
"dom-body-background">background</a>;
attribute DOMString <a href="#link0" title=
"dom-body-link">link</a>;
attribute DOMString <a href="#vlink" title=
"dom-body-vLink">vLink</a>;
attribute DOMString <a href="#alink" title=
"dom-body-aLink">aLink</a>;
};
</pre>
<p><ins class="diff-new">The</ins> <dfn id="text3" title=
"dom-body-text"><code><ins class="diff-new">text</ins></code></dfn>
<ins class="diff-new">DOM attribute of the</ins> <code><a href=
"#body0"><ins class="diff-new">body</ins></a></code> <ins class=
"diff-new">element must</ins> <a href="#reflect"><ins class=
"diff-new">reflect</ins></a> <ins class="diff-new">the
element's</ins> <code title="attr-body-text"><ins class=
"diff-new">text</ins></code> <ins class="diff-new">content
attribute.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="bgcolor0" title=
"dom-body-bgColor"><code><ins class=
"diff-new">bgColor</ins></code></dfn> <ins class="diff-new">DOM
attribute of the</ins> <code><a href="#body0"><ins class=
"diff-new">body</ins></a></code> <ins class="diff-new">element
must</ins> <a href="#reflect"><ins class=
"diff-new">reflect</ins></a> <ins class="diff-new">the
element's</ins> <code title="attr-body-bgcolor"><ins class=
"diff-new">bgcolor</ins></code> <ins class="diff-new">content
attribute.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="background" title=
"dom-body-background"><code><ins class=
"diff-new">background</ins></code></dfn> <ins class="diff-new">DOM
attribute of the</ins> <code><a href="#body0"><ins class=
"diff-new">body</ins></a></code> <ins class="diff-new">element
must</ins> <a href="#reflect"><ins class=
"diff-new">reflect</ins></a> <ins class="diff-new">the
element's</ins> <code title="attr-body-background"><ins class=
"diff-new">background</ins></code> <ins class="diff-new">content
attribute.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="link0" title=
"dom-body-link"><code><ins class="diff-new">link</ins></code></dfn>
<ins class="diff-new">DOM attribute of the</ins> <code><a href=
"#body0"><ins class="diff-new">body</ins></a></code> <ins class=
"diff-new">element must</ins> <a href="#reflect"><ins class=
"diff-new">reflect</ins></a> <ins class="diff-new">the
element's</ins> <code title="attr-body-link"><ins class=
"diff-new">link</ins></code> <ins class="diff-new">content
attribute.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="alink" title=
"dom-body-aLink"><code><ins class=
"diff-new">aLink</ins></code></dfn> <ins class="diff-new">DOM
attribute of the</ins> <code><a href="#body0"><ins class=
"diff-new">body</ins></a></code> <ins class="diff-new">element
must</ins> <a href="#reflect"><ins class=
"diff-new">reflect</ins></a> <ins class="diff-new">the
element's</ins> <code title="attr-body-alink"><ins class=
"diff-new">alink</ins></code> <ins class="diff-new">content
attribute.</ins></p>
<p><ins class="diff-new">The</ins> <dfn id="vlink" title=
"dom-body-vLink"><code><ins class=
"diff-new">vLink</ins></code></dfn> <ins class="diff-new">DOM
attribute of the</ins> <code><a href="#body0"><ins class=
"diff-new">body</ins></a></code> <ins class="diff-new">element
must</ins> <a href="#reflect"><ins class=
"diff-new">reflect</ins></a> <ins class="diff-new">the
element's</ins> <code title="attr-body-vlink"><ins class=
"diff-new">vlink</ins></code> <ins class="diff-new">content
attribute.</ins></p>
<h4 id="the-applet"><span class="secno"><ins class=
"diff-new">9.3.2</ins></span> <ins class="diff-new">The</ins>
<dfn id="applet"><code><ins class=
"diff-new">applet</ins></code></dfn> <ins class=
"diff-new">element</ins></h4>
<p><ins class="diff-new">The</ins> <code><a href=
"#applet"><ins class="diff-new">applet</ins></a></code> <ins class=
"diff-new">element is a Java-specific variant of the</ins>
<code><a href="#embed"><ins class="diff-new">embed</ins></a></code>
<ins class="diff-new">element. In HTML5 the</ins> <code><a href=
"#applet"><ins class="diff-new">applet</ins></a></code> <ins class=
"diff-new">element is obsoleted so that all extension frameworks
(Java, .NET, Flash, etc) are handled in a consistent
manner.</ins></p>
<p id="sandboxPluginApplet"><ins class="diff-new">If the</ins>
<a href="#sandboxed0"><ins class="diff-new">sandboxed plugins
browsing context flag</ins></a> <ins class="diff-new">is set on
the</ins> <a href="#browsing1"><ins class="diff-new">browsing
context</ins></a> <ins class="diff-new">for which the</ins>
<code><a href="#applet"><ins class=
"diff-new">applet</ins></a></code> <ins class="diff-new">element's
document is the</ins> <a href="#active"><ins class=
"diff-new">active document</ins></a> ,<ins class="diff-new">then
the element must be ignored (it represents nothing).</ins></p>
<p><ins class="diff-new">Otherwise,</ins> <span class=
"big-issue"><ins class="diff-new">define how the element works, if
supported</ins></span> .</p>
<pre class="idl">
[XXX] interface <a href=
"#htmldocument">HTMLDocument</a> {<ins class="diff-new">
readonly attribute <a href=
"#htmlcollection0">HTMLCollection</a> <a href="#applets" title=
"dom-document-applets">applets</a>;
};
</ins>
</pre>
<p><ins class="diff-new">The</ins> <dfn id="applets" title=
"dom-document-applets"><code><ins class=
"diff-new">applets</ins></code></dfn> <ins class=
"diff-new">attribute must return an</ins> <code><a href=
"#htmlcollection0"><ins class=
"diff-new">HTMLCollection</ins></a></code> <ins class=
"diff-new">rooted at the</ins> <code><ins class=
"diff-new">Document</ins></code> <ins class="diff-new">node, whose
filter matches only</ins> <code><a href="#applet"><ins class=
"diff-new">applet</ins></a></code> <ins class=
"diff-new">elements.</ins></p>
<h2 id="no"><span class="secno"><del class="diff-old">11.</del>
<ins class="diff-chg">10.</ins></span> Things that you can't do
with this specification because they are better handled using other
technologies that are further described herein</h2>
<p><em>This section is non-normative.</em></p>
<p>There are certain features that are not handled by this
specification because a client side markup language is not the
right level for them, or because the features exist in other
languages that can be integrated into this one. This section covers
some of the more common requests.</p>
<h3 id="localization"><span class="secno"><del class=
"diff-old">11.1.</del> <ins class="diff-chg">10.1</ins></span>
<del class="diff-old">Localisation</del> <ins class=
"diff-chg">Localization</ins></h3>
<p>If you wish to create <del class="diff-old">localised</del>
<ins class="diff-chg">localized</ins> versions of an HTML
application, the best solution is to preprocess the files on the
server, and then use HTTP content <del class=
"diff-old">negotation</del> <ins class="diff-chg">negotiation</ins>
to serve the appropriate language.</p>
<h3 id="declarative"><span class="secno"><del class=
"diff-old">11.2.</del> <ins class="diff-chg">10.2</ins></span>
Declarative 2D vector graphics and animation</h3>
<p>Embedding vector graphics into XHTML documents is the domain of
SVG.</p>
<h3 id="declarative0"><span class="secno"><del class=
"diff-old">11.3.</del> <ins class="diff-chg">10.3</ins></span>
Declarative 3D scenes</h3>
<p>Embedding 3D imagery into XHTML documents is the domain of X3D,
or technologies based on X3D that are namespace-aware.</p>
<h3 id="timers"><span class="secno"><del class=
"diff-old">11.4.</del> <ins class="diff-chg">10.4</ins></span>
Timers</h3>
<p>This section is expected to be moved to the Window Object
specification in due course.</p>
<pre class="idl">
<del class="diff-old">interface {
</del>
<ins class="diff-chg">[NoInterfaceObject] interface <dfn id=
"windowtimers">WindowTimers</dfn> {
</ins>
// timers
long <a href="#settimeout">setTimeout</a>(in <a href=
"#timeouthandler">TimeoutHandler</a> handler, in long timeout);
long <a href="#settimeout">setTimeout</a>(in <a href=
"#timeouthandler">TimeoutHandler</a> handler, in long timeout, <var title="">arguments...</var>);
long <a href=
"#settimeout">setTimeout</a>(in DOMString code, in long timeout);
long <a href=
"#settimeout">setTimeout</a>(in DOMString code, in long timeout, in DOMString language);
void <a href="#cleartimeout">clearTimeout</a>(in long handle);
long <a href="#setinterval...">setInterval</a>(in <a href=
"#timeouthandler">TimeoutHandler</a> handler, in long timeout);
long <a href="#setinterval...">setInterval</a>(in <a href=
"#timeouthandler">TimeoutHandler</a> handler, in long timeout, <var title="">arguments...</var>);
long <a href=
"#setinterval...">setInterval</a>(in DOMString code, in long timeout);
long <a href=
"#setinterval...">setInterval</a>(in DOMString code, in long timeout, in DOMString language);
void <a href="#clearinterval">clearInterval</a>(in long handle);
};
interface <dfn id="timeouthandler">TimeoutHandler</dfn> {
<del class="diff-old"> void handleEvent();
</del>
<ins class="diff-chg"> void handleEvent([Variadic] in any args);
</ins>
};
</pre>
<p>The <code><a href="#windowtimers">WindowTimers</a></code>
interface must be obtainable from any <code><a href=
"#window">Window</a></code> object using binding-specific casting
methods.</p>
<p class="big-issue"><ins class="diff-new">Actually even better
would be to just mix it straight into Window somehow.</ins></p>
<p>The <code><a href="#settimeout">setTimeout</a></code> and
<code><a href="#setinterval...">setInterval</a></code> methods
allow authors to schedule timer-based events.</p>
<p>The <dfn id="settimeout" title="setTimeout"><code>setTimeout(
<var title="">handler</var> , <var title="">timeout</var> [,
<var title="">arguments...</var> ])</code></dfn> method takes a
reference to a <code><a href=
"#timeouthandler">TimeoutHandler</a></code> object and a length of
time in milliseconds. It must return a handle to the timeout
created, and then asynchronously wait <var title="">timeout</var>
milliseconds and then invoke <code>handleEvent()</code> on the
<var title="">handler</var> object. If any <var title=
"">arguments...</var> were provided, they must be passed to the
<var title="">handler</var> as arguments to the
<code>handleEvent()</code> function.</p>
<p><del class="diff-old">In the ECMAScript DOM binding, the
ECMAScript native Function type must implement the TimeoutHandler
interface such that invoking the handleEvent() method of that
interface on the object from another language binding invokes the
function itself, with the arguments passed to handleEvent() as the
arguments passed to the function. In the ECMAScript DOM binding
itself, however, the handleEvent() method of the interface is not
directly accessible on Function objects. Such functions must be
called in the scope of the browsing context in which they were
created.</del> Alternatively, <dfn id="settimeout0" title=
""><code>setTimeout( <var title="">code</var> , <var title=
"">timeout</var> [, <var title="">language</var> ])</code></dfn>
may be used. This variant takes a string instead of a
<code><a href="#timeouthandler">TimeoutHandler</a></code> object.
That string must be parsed using the specified <var title=
"">language</var> (defaulting to ECMAScript if the third argument
is omitted) and executed in the scope of the <a href=
"#browsing1">browsing context</a> associated with the
<code><a href="#window">Window</a></code> object on which the
<code title="setTimeout"><a href=
"#settimeout">setTimeout()</a></code> method was invoked.</p>
<p class="big-issue">Need to define <var title="">language</var>
values.</p>
<p>The <dfn id="setinterval..."><code>setInterval(...)</code></dfn>
variants must work in the same way as the <code><a href=
"#settimeout">setTimeout</a></code> variants except that
<ins class="diff-new">if</ins> <var title=""><ins class=
"diff-new">timeout</ins></var> <ins class="diff-new">is a value
greater than zero,</ins> the <var title="">handler</var> or
<code><a href="#code">code</a></code> must be invoked again every
<var title="">timeout</var> milliseconds, not just the once.</p>
<p>The <dfn id="cleartimeout"><code>clearTimeout()</code></dfn> and
<dfn id="clearinterval"><code>clearInterval()</code></dfn> methods
take one integer (the value returned by <code><a href=
"#settimeout">setTimeout</a></code> and <code><a href=
"#setinterval...">setInterval</a></code> respectively) and must
cancel the specified timeout. When called with a value that does
not correspond to an active timeout or interval, the methods must
return without doing anything.</p>
<p>Timeouts must never fire while another script is executing.
(Thus the HTML scripting model is strictly single-threaded and not
reentrant.)</p>
<h2 class="no-num" id="index"><ins class=
"diff-chg">Index</ins></h2>
<p><del class="diff-old">11.5. Events In the ECMAScript DOM
binding, the ECMAScript native Function type must implement the
EventListener interface such that invoking the handleEvent()
method</del> <em><ins class="diff-chg">This section is
non-normative.</ins></em></p>
<p class="big-issue"><ins class="diff-chg">List</ins> of
<del class="diff-old">that interface on the object from another
language binding invokes the function itself, with the event
argument as its only argument. In the ECMAScript binding itself,
however, the handleEvent() method</del> <ins class=
"diff-chg">elements</ins></p>
<p class="big-issue"><ins class="diff-chg">List</ins> of
<del class="diff-old">the interface is not directly accessible on
Function objects. Such functions, when invoked, must be called in
the scope</del> <ins class="diff-chg">attributes</ins></p>
<p class="big-issue"><ins class="diff-chg">List</ins> of
<del class="diff-old">the browsing context that they were created
in.</del> <ins class="diff-chg">interfaces</ins></p>
<p class="big-issue"><ins class="diff-chg">List of events</ins></p>
<h2 class="no-num" id="references">References</h2>
<p class="big-issue">This section will be written in a future
draft.</p>
<h2 class="no-num" id="acknowledgements">Acknowledgements</h2>
<p>Thanks to Aankhen, Aaron Boodman, Aaron Leventhal, Adam
<ins class="diff-new">Barth, Adam</ins> Roben, <ins class=
"diff-new">Addison Phillips, Adele Peterson,</ins> Adrian Sutton,
Agustín Fernández, <ins class="diff-new">Alastair Campbell,</ins>
Alexey Feldgendler, <ins class="diff-new">Anders Carlsson,</ins>
Andrew Gove, Andrew Sidwell, Anne van Kesteren, Anthony Hickson,
<ins class="diff-new">Anthony Ricaud,</ins> Antti Koivisto,
<ins class="diff-new">Arphen Lin,</ins> Asbjørn Ulsberg,
<ins class="diff-new">Ashley Sheridan, Aurelien Levy,</ins> Ben
Godfrey, Ben Meadowcroft, <ins class="diff-new">Ben Millard,</ins>
Benjamin Hawkes-Lewis, Bert Bos, Billy Wong, Bjoern Hoehrmann,
Boris Zbarsky, Brad Fults, Brad Neuberg, Brady Eidson, Brendan
Eich, Brett Wilson, Brian Campbell, <ins class="diff-new">Brian
Smith, Bruce Miller, Cameron McCormack,</ins> Carlos Perelló Marín,
Chao Cai, 윤석찬 (Channy Yun), Charl van Niekerk, Charles Iliya
Krempeaux, Charles McCathieNevile, Christian Biesinger, Christian
Johansen, Chriswa, <ins class="diff-new">Cole Robison, Collin
Jackson,</ins> Daniel Brumbaugh Keeney, Daniel <ins class=
"diff-new">Glazman, Daniel</ins> Peng, Daniel Spång, <ins class=
"diff-new">Danny Sullivan,</ins> Darin <del class=
"diff-old">Alder,</del> <ins class="diff-chg">Adler,</ins> Darin
Fisher, Dave <ins class="diff-new">Camp, Dave</ins> Singer, Dave
Townsend, David Baron, David <ins class="diff-new">Bloom, David
Carlisle, David</ins> Flanagan, David Håsäther, David Hyatt,
<ins class="diff-new">Dean Edridge, Debi Orton,</ins> Derek
Featherstone, DeWitt Clinton, Dimitri Glazkov, dolphinling, Doron
Rosenberg, Doug Kramer, Eira Monstad, Elliotte Harold, Erik
Arvidsson, Evan Martin, <ins class="diff-new">Evan Prodromou,</ins>
fantasai, Franck 'Shift' Quélain, Garrett Smith, Geoffrey
<ins class="diff-new">Garen, Geoffrey</ins> Sneddon, Håkon Wium
Lie, Henri Sivonen, Henrik Lied, <ins class="diff-new">Henry Mason,
Hugh Winkler,</ins> Ignacio Javier, Ivo Emanuel Gonçalves, J. King,
<ins class="diff-new">Jacques Distler,</ins> James Graham, James
<ins class="diff-new">Justin Harrell, James</ins> M Snell, James
Perrett, Jan-Klaas Kollhof, <ins class="diff-new">Jason
White,</ins> Jasper Bryant-Greene, Jeff Cutsinger, Jeff Walden,
Jens Bannmann, <ins class="diff-new">Jens Fendler,</ins> Jeroen van
der Meer, <ins class="diff-new">Jim Jewett, Jim Meehan, Joe Clark,
Jjgod Jiang,</ins> Joel Spolsky, <ins class="diff-new">Johan
Herland,</ins> John Boyer, John Bussjaeger, John Harding, Johnny
Stenback, Jon Perlow, Jonathan Worent, Jorgen Horstink, Josh
Levenberg, Joshua Randall, Jukka K. Korpela, <ins class=
"diff-new">Julian Reschke,</ins> Kai Hendry, Kornel Lesinski, 黒澤剛志
(KUROSAWA Takeshi), Kristof Zelechovski, Lachlan Hunt, Larry Page,
Lars Gunther, <ins class="diff-new">Laura L. Carlson, Laura
Wisewell,</ins> Laurens Holst, <ins class="diff-new">Lee
Kowalkowski, Leif Halvard Silli,</ins> Lenny Domnitser, Léonard
Bouchet, Leons Petrazickis, Logan, Loune, Maciej Stachowiak,
<ins class="diff-new">Magnus Kristiansen,</ins> Malcolm Rowe, Mark
Nottingham, Mark Rowe, Mark Schenk, Martijn Wargers, Martin Atkins,
Martin Dürst, Martin Honnen, <ins class="diff-new">Masataka
Yakura,</ins> Mathieu Henri, Matthew Mastracci, Matthew Raymond,
Matthew Thomas, Mattias Waldau, Max Romantschuk, Michael 'Ratt'
Iannarelli, Michael A. Nachbaur, Michael A. Puls II, Michael
<ins class="diff-new">Carter, Michael</ins> Gratton, Michael
Powers, <ins class="diff-new">Michael(tm) Smith,</ins> Michel
Fortin, Michiel van der Blonk, Mihai Şucan, Mike Brown, Mike
Dierken, Mike Dixon, Mike Schinkel, Mike Shaver, Mikko Rantalainen,
Neil Deakin, <ins class="diff-new">Neil Soiffer, Olaf
Hoffmann,</ins> Olav Junker Kjær, <ins class="diff-new">Oliver
Hunt, Peter Karlsson,</ins> Peter Kasting, Philip Taylor,
<ins class="diff-new">Philip TAYLOR,</ins> Rachid Finge, Rajas
Moonka, <ins class="diff-new">Ralf Stoltze,</ins> Ralph Giles,
<ins class="diff-new">Raphael Champeimont, Rene Saarsoo, Richard
Ishida,</ins> Rimantas Liubertas, Robert <ins class=
"diff-new">Blaut, Robert</ins> O'Callahan, Robert Sayre, Roman
Ivanov, S. Mike Dierken, Sam Ruby, Sam Weinig, Scott Hess, Sean
Knapp, Shaun Inman, Silvia Pfeiffer, Simon Pieters, Stefan
Haustein, Stephen Ma, Steve <ins class="diff-new">Faulkner,
Steve</ins> Runyon, Steven Garrity, Stewart Brodie, Stuart
Parmenter, <ins class="diff-new">Sunava Dutta,</ins> Tantek Çelik,
<ins class="diff-new">Terrence Wood,</ins> Thomas Broyer, Thomas
O'Connor, Tim Altman, <ins class="diff-new">Tim Johansson,</ins>
Tyler Close, Vladimir Vukićević, Wakaba, <ins class=
"diff-new">Wayne Pollock,</ins> William Swanson, <ins class=
"diff-new">Yi-An Huang, and</ins> Øistein E. Andersen, <del class=
"diff-old">and everyone on the WHATWG mailing list</del> for their
useful and substantial comments.</p>
<p><ins class="diff-new">Thanks also to everyone who has ever
posted about HTML5 to their blogs, public mailing lists, or forums,
including the</ins> <a href=
"http://lists.w3.org/Archives/Public/public-html/"><ins class=
"diff-new">W3C public-html list</ins></a> <ins class="diff-new">and
the</ins> <a href="http://www.whatwg.org/mailing-list"><ins class=
"diff-new">various WHATWG lists</ins></a> .</p>
<p>Special thanks to Richard Williamson for creating the first
implementation of <code><a href="#canvas">canvas</a></code> in
Safari, from which the canvas feature was designed.</p>
<p>Special thanks also to the Microsoft employees who first
implemented the event-based drag-and-drop mechanism, <code title=
"attr-contenteditable"><a href=
"#contenteditable0">contenteditable</a></code> , and other features
first widely deployed by the Windows Internet Explorer browser.</p>
<p>Special thanks and $10,000 to David Hyatt who came up with a
broken implementation of the <a href="#adoptionAgency">adoption
agency algorithm</a> that the editor had to reverse engineer and
fix before using it in the parsing section.</p>
<p>Thanks <ins class="diff-new">to the many sources that provided
inspiration for the examples used in the specification.</ins></p>
<p><ins class="diff-new">Thanks</ins> also <ins class=
"diff-new">to</ins> the Microsoft blogging community for some
ideas, to the attendees of the W3C Workshop on Web Applications and
Compound Documents for inspiration, and to the #mrt crew, the
#mrt.no crew, <ins class="diff-new">the #whatwg crew,</ins> and the
cabal for their ideas and support.</p>
</body>
</html>
Webmaster